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
  • I have found the problem

    It would seem that on boot a number of things are 'assumed' as being in a certain state by the compiler.

    If I disable the global interrupts, cpu_irq_disable() , before jumping, and then re-enable them, cpu_irq_enable() in the application, it works.

    My next challenge is reading and writing a single value to a specific location in flash (say 0x0048FFFF) so I can detect if I should be self writing or jumping to the application.

Reply
  • I have found the problem

    It would seem that on boot a number of things are 'assumed' as being in a certain state by the compiler.

    If I disable the global interrupts, cpu_irq_disable() , before jumping, and then re-enable them, cpu_irq_enable() in the application, it works.

    My next challenge is reading and writing a single value to a specific location in flash (say 0x0048FFFF) so I can detect if I should be self writing or jumping to the application.

Children