Bootloader, linker and application start address
Hello everyone,
I have a problem setting the start address of an application.
I am using an STM32F429 with 2MB of Flash.
In the flash there is a custom bootloader (@0x8000000) that will performs some basic operations, then it will jump at a specified address (e.g. 0x8030000).
The source code of custom bootloader is not accessible.
The generation of the elf file is successful and the map file seems correct (also using objdump).
However when loaded, it meets an hard fault and it does not start.
In main.c file, I execute:
1) HAL_Init();
2) SystemClock_Config()
3) Interrupt Vector remap (I copy g_pfnVectors into a variable, disable irq, make SCB->VTOR poit to the variable, re-enable irq)
4)SystemCoreClockUpdate()
In the linker script of my application, I defined the memory layout like this:
*********************************************************
MEMORY
{
bootloader (rx) : ORIGIN = 0x08000000, LENGTH = 192K
flash (rx) : ORIGIN = 0x08030000, LENGTH = 2048K - 192K
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 192K
}
************************************************************
while the sections like this:
************************************************************
SECTIONS
{
.bootloader :
{
. = ALIGN(4);
KEEP(*(.bootloader))
FILL(0xFFFFFF)
. = ALIGN(4);
} >bootloader
/* Reset and ISR vectors */
.isr_vector :
{
isr_vector_start = .;
KEEP(*(.isr_vector))
} >flash
....
************************************************************
Do you have any idea? Could you please help me?
Thanks in advance.