XMega128A4U Bootloader PC code (FLIP)

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

Hi. We bought one of these  XMega128A4U kits and it works well - it can be easily reprogrammed using FLIP.

 

Now we need to add this functionality to our host PC application. Does anyone know what FLIP actually does and the sequence. 

 

This app note http://www.atmel.com/images/doc8... has some info but the good stuff (PC source code for FLIP) is hidden. Thanks

 

Electronic System Design
http://www.esdn.com.au

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

Did you also download the code that goes with that App Note?

 

Jim

 

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

Hefty wrote:
Does anyone know what FLIP actually does and the sequence.
The creators of AVRDUDE for XMEGA FLIP was added to AVRDUDE 6.3

AVRDUDE 6.3 released

by Joerg Wunsch <joerg_wunsch> on Tue 16 Feb 2016

http://savannah.nongnu.org/forum/forum.php?forum_id=8461

...

 

* New programmers supported:

...

- Atmel DFU, using FLIP protocol version 1 (AT90USB and ATmegaU devices),
or version 2 (Xmega devices)

...


http://www.nongnu.org/avrdude/

http://download.savannah.gnu.org/releases/avrdude/ 

 

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

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

OK, thanks Jim and Graham. Just saw these replies now. I have downloaded the AVR1916 software and that seems to contain the Atmel ASF project for DFU code.

 

The avrdude software looks good. I just downloaded the AVRdude 6.3 but I cannot find any exe files in there anywhere. Anyone know where to get this. Avrdude looks good but like most open source projects, the documentation is very difficult to understand. I will keep searching. Thanks again.

Electronic System Design
http://www.esdn.com.au

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

Quick update. I found the version 6.3 avrdude.exe in the Arduino folder here: C:\Program Files (x86)\Arduino\hardware\tools\avr\bin

 

With Flip protocol, ATmel released this App Note AVR4023

 

Anyway, looks like avrdude command line is the way to go. 

 

Electronic System Design
http://www.esdn.com.au

Last Edited: Wed. May 24, 2017 - 11:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hefty wrote:
I just downloaded the AVRdude 6.3 but I cannot find any exe files in there anywhere. Anyone know where to get this.

http://download.savannah.gnu.org/releases/avrdude/

(search for mingw)

via

http://www.nongnu.org/avrdude/

 

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

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

Thanks Graham, got it now. Previously I downloaded the avrdude-6.3.tar.gz which only had source files. I see the mingw zip has the exe and the conf file - not sure what the relevance of mingw is.

 

All I need now is how to reset the application after flashing it. I have resorted to using Atmel Studio ASF - desparate times.

 

With the bootloader, it says that you can jump from the main application to the bootloader by jumping to BOOT_LOAD memory + 0x1fc. Do you know how to implement this? I have tried asm(" jmp 0x201fc") but that does not seem to work. If I could get this to work, I can set the fuse to reset to the application and this part of the project would be 90% there. Thanks again for you help.

Electronic System Design
http://www.esdn.com.au

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

OK, I just managed to get this working with the Imagecraft C Compiler. 

 

Here is the code:

            CPU_EIND = 1;
       //     asm (" jmp 0x100fe");
            asm("ldi r30, 0xfe");      // put 0x01fc(byte addresss/0x00fe(word address) a in Z register (r30-r31 pair)
            asm("ldi r31, 0x00");
            asm("eijmp"); 

Still have a few issues to sort out. 

Electronic System Design
http://www.esdn.com.au

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

Hefty wrote:
- not sure what the relevance of mingw is.

MinGW

Minimalist GNU for Windows

http://mingw.org/

MinGW, a contraction of "Minimalist GNU for Windows", is a minimalist development environment for native Microsoft Windows applications.

MinGW is one of the tools used to port Linux or Un*x applications to Windows; MinGW is not the only way to do that.

IIRC, MinGW is the recommended toolset for porting GCC to Windows.

Hefty wrote:
Do you know how to implement this?
No; I'm keen on bootloader runs before the application.

http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_softreset (How do I perform a software reset of the AVR?)

Hefty wrote:
I have tried asm(" jmp 0x201fc") but that does not seem to work.
Note that for XMEGA128A4U the bootloader is in a separate segment (set a ramp register then jump) (effectively a 17 bit address)

https://imagecraft.com/help/ICCV8AVR/iccavr/6-programmingavr/accessing_memory_outside_of_the_64k_range.htm

 

 

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

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

Thanks for I didn't know that.

It's similar for AVR GCC.

https://gcc.gnu.org/onlinedocs/gcc-5.4.0/gcc/AVR-Options.html#AVR-Options

...

 

3.17.5.1 EIND and Devices with More Than 128 Ki Bytes of Flash

...

 

Edit : URL

 

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

Last Edited: Thu. May 25, 2017 - 09:46 AM