I use STM32F4-Discovery stm32f407 eeprom emulation example
But the program will only run once after each Download
For the second time, jump to hard fault
How to solve this problem?Thanks
Instrument the hard fault so you can more clearly determine the cause and faulting instructions.
Make sure the FLASH region used by the EEPROM emulation does not coincide with the regions your code is placed into. ie check Linker Script or Scatter File settings, and make sure you're not erasing a portion of your active code.
How can I Reserve Sector 2 and Sector 3?
Your linker script, or scatter file, would need to describe multiple load regions with a hole between them
0x08000000..0x08007FFF (32KB) and 0x08010000..0x080FFFFF (1MB-64KB)
Retrieving data ...