Atmel SAM4E Bootloader/VTOR executing new application

I've written a boot loader for the Atmel SAM4E device which is working to a point, it can receive new application code via SPI, erase flash and write to flash, but I don't understand how to execute the new application. I've learned the VTOR can be relocated, but I'm not sure how. (my application sits at address 0x00420000).
I'm very new to writing code for ARM, so I'd appreciate any help.

Many thanks

Paul

Parents
  • Hello again Paul,


    it is the Intel Hex, isn't it?
    I understand and it would be reasonable.
    However, it is strange "((start_fn *)  *((uint32_t *) 0x00420004))()" causes a stack overflow.
    Did you set the stack pointer before execution the asm statement?
    Otherwise, you should add the "__attribute__((naked))" attribute to the bootloader function in order not to use stack.

    Best regards,
    Yasuhiko Koumoto.

Reply
  • Hello again Paul,


    it is the Intel Hex, isn't it?
    I understand and it would be reasonable.
    However, it is strange "((start_fn *)  *((uint32_t *) 0x00420004))()" causes a stack overflow.
    Did you set the stack pointer before execution the asm statement?
    Otherwise, you should add the "__attribute__((naked))" attribute to the bootloader function in order not to use stack.

    Best regards,
    Yasuhiko Koumoto.

Children