2020-04-09 02:16 AM
Hi, I developed boot loader on STM32F427. When I try to erase FLASH, that will trigger HW watch dog(tick by interrupt timer) to reset our develop board. I search solution by google, many people say should move interrupt vector and IRQ handler program from FLASH to RAM. Do there have document describe how to implement it? I already followed "Use STM32F3/STM32G4 CCM SRAM with IAR™ EWARM, Keil® MDK-ARM and GNU-based toolchains"(AN4296), but it don't work.
BR,
Cloud
2020-04-09 02:53 AM
Check the following
Check every possible program line, function call, macro, variable.
2020-04-09 02:57 AM
Use memcpy(), make sure the RAM address is 512-byte aligned, and set the SCB->VTOR to the new base address.
Watch that addresses in the vector table don't point to erased areas of Flash or will call tree dependencies on same.
2020-04-09 03:12 AM
Hi Berendi,
boot loader flash region: 0x08000000 ~ 0x0803FFFF
AP flash region: 0x08040000~0x0807FFFF
Boot loader only erase/write AP FLASH address. When boot loader erase AP section, there will stop around 3 seconds .
2020-04-09 03:15 AM
Hi Clive1,
Do you mean copy IVT from FLASH to RAM at main function and set SCB->VTOR to IVT address in RAM?
BR,
Cloud
2020-04-09 10:13 PM
After adding below code in system_stm32f4xx.c, the IVT put in RAM.
memcpy((void*)0x20000000,(void const*)0x08000000,0x1FF); // Move Vector Table from FLASH to RAM
SCB->VTOR = 0x20000000; // Point at RAM copy