Hi Will L and David Rodgers,
That's for David Rodgers's reply about the cache issues, at first, I also suspect the cache issue. I also suspect Will didn't download code the external flash, just the RAM or SDRAM, then when power off and power on the code again, the code will be lost, but debug mode has no problem.
From Will's last reply about the build result:
Memory region Used Size Region Size %age Used
BOARD_FLASH: 600088 B 96 MB 0.60%
SRAM_DTC: 112624 B 128 KB 85.93%
SRAM_ITC: 0 GB 128 KB 0.00%
SRAM_OC: 0 GB 256 KB 0.00%
BOARD_SDRAM: 0 GB 64 MB 0.00%
It seem the code also download to the external flash.
Will L, could you please give me your debug screenshot, I want to double check your code location:

Whether the code location in the 0X6000XXXX? This is the external flash memory range.
About the cache, please check your code, whether you call SCB_EnableDache or SCB_EnableICache?

Waiting for your updated information.
Have a great day,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------