Hello All,
I have spent days looking into the issue. So I have a custom bootloader which checks for integrity of application and jumps there.
However everytime I execute jump routine it causes hard fault.
Can you please look into below code and guide me to what I am missing:
1. Boot linker file snippet:
MEMORY
{
int_flash : ORIGIN = 0x00400000, LENGTH = 0x0010000 /* 4096K - 176K (sBAF + HSE)*/
int_itcm : ORIGIN = 0x00000000, LENGTH = 0x00010000 /* 32K */
int_dtcm : ORIGIN = 0x20000000, LENGTH = 0x00020000 /* 64K */
int_sram : ORIGIN = 0x20400000, LENGTH = 0x0002DF00 /* 183.9K */
int_sram_fls_rsv : ORIGIN = 0x2042DF00, LENGTH = 0x00000100 /* 0.1K */
int_sram_stack_c0 : ORIGIN = 0x2042E000, LENGTH = 0x00001000 /* 4KB */
int_sram_stack_c1 : ORIGIN = 0x2042F000, LENGTH = 0x00001000 /* 4KB */
int_sram_no_cacheable : ORIGIN = 0x20430000, LENGTH = 0x0000FF00 /* 64KB, needs to include int_results */
int_sram_results : ORIGIN = 0x2043FF00, LENGTH = 0x00000100
int_sram_shareable : ORIGIN = 0x20440000, LENGTH = 0x00004000 /* 16KB */
ram_rsvd2 : ORIGIN = 0x20444000, LENGTH = 0 /* End of SRAM */
}
2. Application Linker file snippet:
MEMORY
{
int_flash : ORIGIN = 0x00410400, LENGTH = 0x0007FC00 /* 511K - 176K (sBAF + HSE)*/
int_itcm : ORIGIN = 0x00000000, LENGTH = 0x00010000 /* 32K */
int_dtcm : ORIGIN = 0x20000000, LENGTH = 0x00020000 /* 64K */
int_sram : ORIGIN = 0x20400000, LENGTH = 0x0002DF00 /* 183.9K */
int_sram_fls_rsv : ORIGIN = 0x2042DF00, LENGTH = 0x00000100 /* 0.1K */
int_sram_stack_c0 : ORIGIN = 0x2042E000, LENGTH = 0x00001000 /* 4KB */
int_sram_stack_c1 : ORIGIN = 0x2042F000, LENGTH = 0x00001000 /* 4KB */
int_sram_no_cacheable : ORIGIN = 0x20430000, LENGTH = 0x0000FF00 /* 64KB, needs to include int_results */
int_sram_results : ORIGIN = 0x2043FF00, LENGTH = 0x00000100
int_sram_shareable : ORIGIN = 0x20440000, LENGTH = 0x00004000 /* 16KB */
ram_rsvd2 : ORIGIN = 0x20444000, LENGTH = 0 /* End of SRAM */
}
3. Jump to application routine
void startApplication(unsigned long app_link_location)
{
S32_SCB->VTOR=(uint32_t)(app_link_location);
AppAddr resetHandle = (AppAddr)(app_link_location+4);
}
4. Calling:
startApplication(0x00411400U);
Thanks for reading.