cancel
Showing results for 
Search instead for 
Did you mean: 

Misunderstanding the STM32F7 boot process

TPier
Associate III

Hi,

I attempt to free the 1st sectors of the MCU flash by relocating the firmware and its interrupt vector table to further sector (e.g sector 5 at 0x08040000 address). For that purpose, I updated

  • the linker (IAR) configuration
  • the vector table location by setting SCB->VTOR (set to 0x08040000)
  • the boot address option byte BOOT_ADD0 (set to 0x2001 to get the 0x0804000 boot address)

This configuration is only working from my debugger. The system does not start, neither in standalone, neither from the Go command of the system bootloader.

However, the Reset Handler address is well available at the 0x08040004 address.

If

  • the interrupt vector table is located at the 0x08000000,
  • the code remains at the 0x08040000 address,
  • SCB->VTOR is updated to 0x08000000,
  • BOOT_ADD0 set to 0x80 (i.e. 0x20000 boot address) or set to 0x2000 (i.e. 0x08000000 boot address),

the system is able to start, either in standalone, either from the Go command of the system bootloader.

What did I miss to get the system starting correctly from the sector 5 ? IS it really impossible to free the sector 0 ?

Many thanks in advance.

Best regards

1 REPLY 1
TDK
Super User

Seems like you have some typos, could be the issue.

> e.g sector 5 at 0x08040000 address

> the boot address option byte BOOT_ADD0 (set to 0x2001 to get the 0x0804000 boot address)

0x2001 will select 0x8004000 as the boot address, not 0x08040000 

0x2010 will select 0x8040000 as the boot address.

 

When the program "doesn't work" you can always attach a debugger without resetting/downloading code to see where it's at.

If you feel a post has answered your question, please click "Accept as Solution".