K.Anemos
K.Anemos

Reputation: 11

STM32F7 hangs after system reset

I have the following problem:

STM32F7 Flash starts at 0x0800 0000. My program works fine. Then I shift my code in FLASH at 0x0802 0000 to leave space for future bootloader. I changed my MemoryMap.xml file :

<MemorySegment start="0x08020000" name="FLASH" size="0x80000" access="ReadOnly"/>

and the corresponding flashplacement.xml file:

<ProgramSection alignment="0x100" load="Yes" name=".vectors" start=" 0x8020000"/>

and start debuging....Program works fine until an link error occurs which triggers a system restart with a call of HAL_NVIC_SystemReset. The result is a hanging application which is not the case when my code resides at the start of FLASH (0x0800 0000) Does anybody knows why is this happens?

Regards

/Kostas

Upvotes: 0

Views: 835

Answers (1)

0___________
0___________

Reputation: 67476

The answer is rather easy. You cant just move memory start address. Your micro will get the stack pointer value and the reset handler routine address from the same address as usually. You need to have this boot loader already flashed( at least the vector table and the reset handler which will set the new vector table, set the app stack pointer and pass the control to your app reset handlet

Upvotes: 1

Related Questions