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
  • So I found out how to relocate the VTOR;

      SCB->VTOR = 0x00420000;

    Problem is now finding the start vector, I believe it's held in address 0x00420004.

    So reading that (manually) and jumping to it like this (hardcoded, I obviously need to make that dynamic) ;

    void _JumpBootLoader(void)

    {

      __asm__ (

      "b 0x00423c3d"

      );

    }

    Almost works, the new program executes, but during the initialisation I get " -- Mstack overflow 0"

Reply
  • So I found out how to relocate the VTOR;

      SCB->VTOR = 0x00420000;

    Problem is now finding the start vector, I believe it's held in address 0x00420004.

    So reading that (manually) and jumping to it like this (hardcoded, I obviously need to make that dynamic) ;

    void _JumpBootLoader(void)

    {

      __asm__ (

      "b 0x00423c3d"

      );

    }

    Almost works, the new program executes, but during the initialisation I get " -- Mstack overflow 0"

Children