AVR xmega: Software jump to zero
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:
jmp 0
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?
Many thanks,
Rob
-
Thanks Michael, but it's working now, Rob...I used xboot (http://code.google.com/p/avr-xboot/), you can try too, read the manual, if your application use UART beaware of UART_CLK2X bit (you must set it in your application) and use the Makefile (configure for your hw) to compile.
Bye.
Please sign in to leave a comment.
Comments
4 comments