Custom Bootloader implementation on STM32L4S5
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.
