a problem about bootloader for xmega!

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now I finish a bootloader for xmega128a1u.  It can work when jump to bootloader by watch dog or executed directly by atmel-ice,

but the uart cann't work when from app to boot by (jmp 0x20000).  

 

I guess maybe some registers not be reset by "jump 0x20000", but I can't find which register need be reset.

 

 

Thanks a lot!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Remember to control EIND

 

But seriously, take a look at some known working Xmega bootloaders and do what they do. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EIND

IIRC from one of your recent threads, IAR EWAVR.

   void (*funcptr)( void ) = 0x0000; // Set up function pointer to RESET vector.
/* ... */
	 {
	    SP_WaitForSPM();
	    SP_LockSPM();
	    PMIC_SetVectorLocationToApplication();
	    EIND = 0x00;
	    funcptr(); // Jump to Reset vector 0x0000 in Application Section.
	 }

IIRC for IAR EWAVR, the memory model can be set such that 24 bit addresses ("0x20000")

 


XMEGA AU Manual

[bottom of page 12]

3.10.3 EIND - Extended Indirect Register

EIND is concatenated with the Z-register to enable indirect jump and call to locations above the first 128KB (64K words) of the program memory.

...

AN8242 AVR1605: XMEGA Boot Loader Quick Start Guide | Application Note | Microchip Technology

AVR1605.zip | Wayback Machine

 

"Dare to be naïve." - Buckminster Fuller