This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

HardFault only from bootloader

Hello,

I have am issue where my main application runs fine when I start it directly from the uVision IDE but when it is 'jumped' to from my bootloader I get a HardFault.

The only info on the hardfault is that it is "Forced" all other fault registers are 0.

It is the Hardfault handler in the main app that is getting executed, thus the fault is happening in the main app so it is difficult to debug.
Also note, the fault happens after Sysinit is called but before my main is called (somewhere in the C lib init - __main)

Can anyone think of why a fault might occur when being 'jumped' to as opposed to running from the IDE debugger directly.

Note: I've stripped down the bootloader to really a simple mem init + mem test +

__asm void boot_jump( uint32_t address )
{
   LDR SP, [R0]         ;Load new stack pointer address
   LDR PC, [R0, #4]     ;Load new program counter address
}

void execute_user_code(void)
{
        /* Change the Vector Table to the USER_FLASH_START
        in case the user application uses interrupts */
        SCB->VTOR = USER_FLASH_START & 0x1FFFFF80;

        boot_jump(USER_FLASH_START);
}

This is on an LPC1788

0