fix 3, add hardfault pre handler

This commit is contained in:
Mario Hüttel 2017-10-31 17:04:38 +01:00
parent b1a6399e82
commit 2d794f56d8
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@
##################################################################################### #####################################################################################
#Add Files and Folders below######################################################### #Add Files and Folders below#########################################################
CFILES = main.c syscalls/syscalls.c uart/uart.c startup/system_stm32f4xx.c CFILES = main.c syscalls/syscalls.c uart/uart.c startup/system_stm32f4xx.c
ASFILES = boot/startup_stm32f4xx.S ASFILES = boot/startup_stm32f4xx.S hardfault/hardfault_prehandler.S
INCLUDEPATH = -Iinclude INCLUDEPATH = -Iinclude
@ -32,7 +32,7 @@ LFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 --disable-newlib-supplied-syscalls
LFLAGS += -Tstm32f407vgt6_flash.ld -Wl,-Map=$(mapfile).map -Wl,--gc-sections LFLAGS += -Tstm32f407vgt6_flash.ld -Wl,-Map=$(mapfile).map -Wl,--gc-sections
CFLAGS = -c -fmessage-length=0 -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork CFLAGS = -c -fmessage-length=0 -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles -Wall -O3 CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles -Wall -O0 -g3
#################################################################################### ####################################################################################

View File

@ -383,8 +383,11 @@ void SDIO_wait_cmd_sent() {
SDIO->ICR |= SDIO_ICR_CMDSENTC; SDIO->ICR |= SDIO_ICR_CMDSENTC;
} }
int __attribute__((noinline)) __attribute__((optimize("O0"))) SDIO_get_response(uint8_t expectedCMD, uint8_t typeOfAns, uint32_t *responseBuffer) { int /*__attribute__((noinline)) __attribute__((optimize("O0")))*/ SDIO_get_response(uint8_t expectedCMD, uint8_t typeOfAns, uint32_t *responseBuffer) {
uint32_t sdio_status; uint32_t sdio_status;
/* Wait until command isn't active anymore */
while (SDIO->STA & SDIO_STA_CMDACT);
//Wait for error or success //Wait for error or success
while (1) { while (1) {
sdio_status = SDIO->STA; sdio_status = SDIO->STA;