I've written an encrypted bootloader for the xmega which works now other than for one problem. Once the code is in, I (obviously) need to jump back to zero to execute the new code I've loaded.
I've tried all sorts of things including an assembly routine that simply contains:
after having setup PMIC, RAMPZ and EIND in C code.
I've seen on AVR freaks someone saying these are the steps that need to be taken and the Atmel bootlaoder apps note says a similar thing. However, once I get to the jpm 0, however I try it - in assembler or in C how the AVR apps note suggests, it doesn't work at all. If I set a breakpoint just before jmp 0, it gets there fine, but then stepping into it or over it just sets the program back running and if you break, you're back into the bootloader section.
The disassembly of the jmp 0 line is this:
940c 0000 JMP 0x00000; 0x00000
Anyone know how to solve this please?
Please sign in to leave a comment.