Skip to main content
Wisnu Pramadi
Associate
September 9, 2017
Question

Bootloader + Flash partitions

  • September 9, 2017
  • 1 reply
  • 2863 views
Posted on September 09, 2017 at 02:23

Hi,

I'm using STM32F469 which has quite a lot of flash space (2MB). I'm planning to place a bootloader to handle firmware upgrade and partitions the rest of the flash to store multiple firmware instances. Here are my setup:

Bootloader

@ 0x08000000 with size 128KB

Factory default app

@ 0x08020000 with size 640KB

Update app 1

@ 0x080C0000 with size 640KB

Update app 2

@ 0x08160000 with size 640KB

The idea is to place Bootloader and a factory default app in the flash by default. The bootloader already set the SCB->VTOR register before jumping and the factory default app has start address of 0x08020000 in the linker file like the following:

FLASH ORIGIN: 0x08020000 LENGTH: 1920K

The update 1 and 2 are for new firmware upgrade. I want the application to perform upgrade without entering the bootloader first. So update 1 will place the firmware upgrade on update 2 space when upgrading and vice versa (it's like doing ping pong). It will tell the bootloader which update is the latest one and the bootloader can jump to update 1/2 accordingly.

The problem is, I have to set the start address of the flash for each update to make it work. e.g.: I have to set the linker flash origin to 0x080C0000 if I want to place the update of update 1.

Is there any way I can skip the linker setting? or is there any way to tell the program that its start at certain address? I want the firmware update to be address independent (it can be placed either in update space 1/2) and it seems I have to set this linker statically for now.

Any though guys?

#linker #flash #bootloader #partitioning
This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
September 9, 2017
Posted on September 10, 2017 at 00:12

The vector table contains absolute addresses. If you build address independent code you'll need to rebase the vectors in the table.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Wisnu Pramadi
Associate
September 11, 2017
Posted on September 11, 2017 at 02:51

Hi Clive,

I've set the vector table to the correct address right before jumping to the application. It's still not working if I set the memory map in the linker as 0x08000000 (default). I have to set this memory map according to the firmware location if I want to make it work.

Tesla DeLorean
Guru
September 11, 2017
Posted on September 11, 2017 at 03:01

That's not what I said, reread it, and don't insert the word SET.

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