2024-06-14 12:09 AM
Hi,
We are working on product based on STM32L4S5 based MCU. We implemented the bootloader which are able to boot from base address (binary image starting from base address 0x08022000). Current implementation doesn't have any validation.
But due to security reason we have implemented 512 bytes of header at starting at 0x08022000 address and moved application to the address 0x08022200. We made the necessary changes in bootloader like...
unsigned long *FLASH_RST_ADDR = (unsigned long*) 0x08022204U;
unsigned long *FLASH_MSP_ADDR = (unsigned long*) 0x08022200U;
And in application we have changed the linker script and vector table offset values
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 640K
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
RAM3 (xrw) : ORIGIN = 0x20040000, LENGTH = 384K
FLASH (rx) : ORIGIN = 0x08022200, LENGTH = 400K
}
#define VECT_TAB_OFFSET 0x08022200U.
After adding the header and changing the offset value, we are unable to run the application through bootloader.
(Its going to Hardfault).
Please help us to resolve this issue.
2024-06-14 12:19 AM
All what you write lokks good, for help you need provide more information.
0x08022204U this addres seems to be out of flash range
2024-06-14 04:28 AM
Hi Radoslaw,
As per the memory organization of the stm32l4S5 controller the address 0x08022204 is part of the page17.
I think we are missing where to change the linker address and vector address. can you please specify what more information is required from our side?
2024-06-14 04:33 AM
Hard to gess, anu debug, call stack, hardfault is on booloader side or aplication. ....