fix 3, add hardfault pre handler
This commit is contained in:
		
							
								
								
									
										4
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Makefile
									
									
									
									
									
								
							@@ -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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
####################################################################################
 | 
					####################################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user