HAL_Delay stuck when sdram use as data memory
- June 27, 2021
- 4 replies
- 1061 views
Hi:
I have a custom STM32F746NG board with SDRAM IS42S328200D(Address 11 bits 2^11(Row Address)*2^8(Column Address)*32(bit)*4(bank)).
My goal is to use sdram as data memory, I followed example in STM32Cube_FW_F7_V1.16.1\Projects\STM32746G-Discovery\Examples\FMC\FMC_SDRAM_DataMemory.
1.modified STM32F746NGHx_FLASH.ld
2.modified startup_stm32f746xx.s
3.modidied system_stm32f7xx.c
4.initialize uart1 to print log and light a led.
But the HAL_Delay is stuck, and it is strange, sometimes HAL_Delay won't be stuck, but if I rebuild project, it will be stuck.
meanwhile, I noticed when it is stuck, I move bl SystemInit(in startup_stm32f746xx.s) to another line(from line 65 to line 96), it won't be stuck.
I think the reason should be systick interrupter not be called and memory map is related to this, but I don't know why.
I also add -mno-unaligned-access when build project, but nothing change.
I attached my project example. It included all file I modified.
