Hi,
According to my observations this is not a hardware issue.
The exception is caused by the fact you are trying to execute function FLASH_Program2LongWords() which is located at address 0x0004000+
.text.FLASH_Program
0x00004114 0x194 ./src/flash.o
0x00004114 FLASH_Program
.text.FLASH_Program1LongWord
0x000042a8 0x134 ./src/flash.o
0x000042a8 FLASH_Program1LongWord
.text.FLASH_Program2LongWords
0x000043dc 0x168 ./src/flash.o
0x000043dc FLASH_Program2LongWords
.text.FLASH_EraseSector
0x00004544 0x100 ./src/flash.o
0x00004544 FLASH_EraseSector
The flash memory sector (0x4000 .. 0x4200) is erased by FLASH_EraseSector() in the previous step.
I'd recommend you to alloacate memory section for EEPROM in the linker file so the code does not get erased e.g.:
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000100
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
my_text (RX) : ORIGIN = 0X00004000, LENGTH = 0X00001000
m_text (RX) : ORIGIN = 0X00005000, LENGTH = 0X0001B000
m_data (RW) : ORIGIN = 0x1FFFF000, LENGTH = 0x00004000
}
Please try to adjust the linker file and check if the problem still appers or not.
Hope it helps.
Stan