size of bootloader 128a4u

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

Hi all
I'm working in a project with a atxmega128a4u, but I'm facing some difficults in customize the bootloader. I had tried to build a dfu bootloader but the source code which has been released by atmel(avr1916.zip) only works with iar and I don’t have the license(the kickstart version is not enough(I also tried with full trial version and also gives errors) because the bootloader is greater then 8 kb, any way to try to compile that in atmel studio for example?). I had already tried using asf in atmel studio create a dfu bootloader, but no success, it has errors by defaults and I cannot fix them.   
I tried to make a cdc bootloader and at least it works but occupy more then 8kb. Xmega128a4u only have 8kb for bootloader right? But we can increase that size using more space from flash?

Thanks in advance 

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

atmel(avr1916.zip) only works with iar

There is usually a compatibility file that allows compiling with either IAR or Studio.

 

Isn't the precompiled hex file (in the binaries folder) atxmega128a4u_104.hex compatible with your board?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

ricardolima wrote:
I tried to make a cdc bootloader and at least it works but occupy more then 8kb.
Instead, a vendor specific bootloader that fits in an XMEGA32A4U :

https://github.com/nonolith/USB-XMEGA/tree/master/bootloader

Recommend a read of its issue list.

ricardolima wrote:
Xmega128a4u only have 8kb for bootloader right?
Yes (8KB)

ricardolima wrote:
But we can increase that size using more space from flash?
No because when the app flash is erased then an essential part of the bootloader goes with it.

Could have a two level boot :

  1. Port (UART, USART, SPI, or TWI)
  2. USB

The first level bootloader burns the USB stack and second level bootloader into app flash.

The annoyances are having to attach, or build in, a USB bridge for an erased app flash, and SPM must be in the first level bootloader (possibly use AVR GCC trampoline)

 

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

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

Huh.  I was going to look at it, but I can no longer FIND avr1916.zip on the Atmel or microchip sites. (nor any other of the .zip files that used to be there?) :-(

 

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

Only downloaded it this morning, so very fresh wink

 

By the way it's hidden in Download software

 

 

Attachment(s): 

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

Last Edited: Fri. Apr 21, 2017 - 12:21 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's ... quite a messy bit of code!

 

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

westfw wrote:
That's ... quite a messy bit of code!
Principally because it appears to be an ASF piece of code! :-)

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

gchapman wrote:

Instead, a vendor specific bootloader that fits in an XMEGA32A4U :

https://github.com/nonolith/USB-XMEGA/tree/master/bootloader

Recommend a read of its issue list.

 

Hi I had already tried this one (one of the issue is mine). But I cannot get this working with cdc or deu because I don't know where I can find only the libraries from this one. With asa I can know which files are needed to make a boot loader with dfu or cdc but using that it automatically became greater then 8 kb :/

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

ricardolima wrote:
With asa I can know which files are needed to make a boot loader with dfu or cdc but using that it automatically became greater then 8 kb :/
Proposed solutions :

  1. Atmel Studio 6 instead of Atmel Studio 7 (a bootloader by an older AVR GCC toolchain might squeeze into the 8KB boot program space)
  2. Another bootloader spin

https://github.com/ganzziani/Xproto-Watch-Bootloader

Bootloader for the ATXMEGA256A3U http://www.gabotronics.com/oscillosco…

...

Bootloader for the ATXMEGA256A3U. The project is developed using Atmel Studio 6, available from atmel.com.

Project built from Atmel's ASF, then completed by merging code from other bootloaders.

XMEGA256A3U has an 8KB boot program space.

If I read it correctly, that one is a DFU bootloader and would interact with AVRDUDE 6.3 as the loader.

 


AVR Downloader/UploaDEr - News: AVRDUDE 6.3 released [Savannah]

by Joerg Wunsch <joerg_wunsch> on Tue 16 Feb 2016 10:12:21 PM UTC

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)

...

 

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

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

 

>> That's ... quite a messy bit of code!

Principally because it appears to be an ASF piece of code! :-)

 

I dunno.  Part of my complaint is that main.c, and the project file, are buried down underneath ..../common/services/usb/class/dfu_flip/device/bootloader/xmega/...

Maybe that's a style thing with IAR, but it seems "upside down" to me...

 

Last Edited: Fri. Apr 21, 2017 - 09:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ricardolima wrote:

I tried to make a cdc bootloader and at least it works but occupy more then 8kb. Xmega128a4u only have 8kb for bootloader right?

I did that also.  Mine is under 8k but it only does flash.  Yes, that chip has 8kB bootloader flash. 

 

 

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

Isn't it incredible that PJRC can fit a USB bootloader in 0.5K?

 

https://www.pjrc.com/teensy/half...

 

I know CDC/DFU make for an easy implementation on the PC side but you could get SIXTEEN copies of the half-day bootloader in 8K

 

And yes I know it's for different AVRs but can there really be such a gulf between AT90USB and XMEGA-USB? 

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

clawson wrote:
Isn't it incredible that PJRC can fit a USB bootloader in 0.5K?

That is 0.5K words (1K bytes).

 

Edit (Which is the minimum boot size on the AT90USB.)

 

Last Edited: Sat. Apr 22, 2017 - 07:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Impressive.

In comparison, there's a 0.5KB UART bootloader in assembly language :

TinySafeBoot - A tiny, safe and flexible AVR-Bootloader for ATtinys and ATmegas

http://jtxp.org/tech/tinysafeboot_en.htm

 

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

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

I fear you may have missed the point. Posters here are moaning about not being able to hit an 8K boundary -  WTF does it really matter if that's bytes or words? The point is someone has done this in a capacity that is about a whole order of magnitude smaller! I wonder if it is rocket science or not? 

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

Yes; it's very depressing that "it doesn't fit in 8k."  The smallest serial bootloader I know of is RalphD's picoboot, at 64 bytes (!) ( https://code.google.com/archive/... )

There are LOTS of AVR Serial bootloaders that fit in 512 bytes, including the popular Optiboot used by Arduino Uno.  But Teensy's halfkay bootloader for AVR/HWUSB is Really Impressive.

 

Does the LUFA bootloader work on XMegas?  How big is it?

 

(It's ALMOST depressing enough to want to go out and do something about it.  Sigh.  Given "more than 8k", it might make more sense to start over...)

 

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

westfw wrote:
The smallest serial bootloader I know of is RalphD's picoboot, at 64 bytes (!) ( https://code.google.com/archive/... )
Ralph has updated picoboot since it was converted from Google Code to GitHub :
https://github.com/nerdralph/picoboot

 

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

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

Hmm.  I downloaded an 'eval' version (the time-limited eval version can do >4kbytes), and was able to build the xmega128a4u bootloader without any apparent problems, and it ended up being less than 6k.

 

                ****************************************
                *                                      *
                *            MODULE SUMMARY            *
                *                                      *
                ****************************************

Module                             CODE       DATA
------                             ----       ----
                               (Rel)  (Abs)  (Rel)
?C_STARTUP                       112      2
?EPILOGUE_B_L09                   40
?MOVE_LONG_L07                    22
?PROLOGUE_L09                     32
?RESET                                    2
?S_SHL_L02                        10
?US_SHR_L02                       10
?memcpy                           32
?segment_init                    118
ccp_write_io                      14
isp                              265            93
  + shared                        14
main                              26
nvm                              702
nvm_common_spm                    30
nvm_flash_load_word_to_buffer     36
nvm_read_byte                     20
sysclk                           330
udc                            1 256            72
udi_dfu_atmel                  1 059         2 157
udi_dfu_atmel_desc                46            46
usb_device                     1 408           112
  + common                         8
N/A (command line)                             224
N/A (alignment)                    2             2
----------                     -----      -  -----
Total:                         5 584      4  2 706
  + common                         8

 

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

westfw you get the project working with the newest version of iar? i had tried that and get a lot of errors. Any trick?

LUFA dont work correctly on XMega. The rest of the mencionated bootloaders are not compatible with xmega

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

westfw you get the project working with the newest version of iar? i had tried that and get a lot of errors. Any trick?

I guess.  I don't actually have an xmega to try it out on, but it compiled without any problems, without any effort (once I found the project file to open...)