cancel
Showing results for 
Search instead for 
Did you mean: 

Problem implementing a simple bootloader on STM32H743

MLang.7
Associate III

Hello, I am experiencing a problem implementing a simple bootloader similar to the one showed by ST on youtube.

I decided to use 32K of flash for the loader, while the remaining flash is available for the application. Linker file of the bootloader:

MEMORY
{
  FLASH (rx)    : ORIGIN = 0x08000000, LENGTH = 32K
  DTCMRAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 128K
  RAM_D1 (xrw)   : ORIGIN = 0x24000000, LENGTH = 512K
  RAM_D2 (xrw)   : ORIGIN = 0x30000000, LENGTH = 288K
  RAM_D3 (xrw)   : ORIGIN = 0x38000000, LENGTH = 64K
  ITCMRAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 64K
}

And for the application:

MEMORY
{
  FLASH (rx)     : ORIGIN = 0x08008000, LENGTH = 2048K - 32K
  DTCMRAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 128K
  RAM_D1 (xrw)   : ORIGIN = 0x24000000, LENGTH = 512K
  RAM_D2 (xrw)   : ORIGIN = 0x30000000, LENGTH = 288K
  RAM_D3 (xrw)   : ORIGIN = 0x38000000, LENGTH = 64K
  ITCMRAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 64K
}

The flash start address for the application is therefore 0x08008000. The ISR vector table offset is changed accordingly. When combining the bootloader project and the application project for debugging, the bootloader is loaded into the lower flash segment, but application is not loaded into the upper flash segment. When checking the flash content I read 0xFFFFFFFF.

When loading just the application it works fine. It seems like CubeIDE is forgetting about the application part of the project.

EDIT: Set up similar projects for a STM32G491 and it worked on the first try. Therefore, it seems to be specific to the STM32H743.

1 ACCEPTED SOLUTION

Accepted Solutions

Aren't the Flash memory blocks much larger than 32KB ??

Try 0x08020000 instead, perhaps load SCB->VTOR via vector symbol rather than defines.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2

Aren't the Flash memory blocks much larger than 32KB ??

Try 0x08020000 instead, perhaps load SCB->VTOR via vector symbol rather than defines.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
MLang.7
Associate III

Yes, you are right. The STM32H743 features 128K-sized sectors, hence the 0x20000 offset value. Thank you very much.