AT32UC3C0512C BOOTLOADER / APPLICATION SELECT

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

Hi,

I have made a bootloader that recieves an intel hex file and programs it into the flash memory.

This i can verify completed by performing readback of the memory with my Atamel ICE.

The application are programmed into the memory from location 0x80010000.

 

can anyone tell me how to make the call routine for the application, by this i mean the low level routine that calls either Bootloader or application.

The switching between bootloader and application are done by writing a word to the userpage, the word are recognized but the jump to application fails always

I have tried to make the jump from the trampoline, but with no luck. It seem that the application in the memory are reverted to FF's upon the call.

I need help to make the correct jump routine to execute code from location 0x80010000 

My bootloader are located at 0x80000100 , and can be started anytime. 

 

If you have any hint what i must do to make it work, please let me know

BR

Lars Hansen
 

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

This time i answer all by my self , 

following code does the job IF THE APPLICATION ARE COMPILED IN "RELEASE", else it does not work.

 

 // Jump to the start of the application (located at 0x800100000) by using assembler jump directly
		 asm volatile ("mov r1, 0x0000");
		 asm volatile ("orh r1, 0x8001");
		 asm volatile ("mov pc, r1");

 

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

Are pointers on AVR32 not 32 bit then? I would have thought:

typedef void (*fptr_t)(void);

fptr_t reset = (fptr_t)0x80010000;

{
   ...
   reset();

would probably have worked without the need to resort to Asm.