DFU bootloader to 128A4u

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

Hi guys Iam searching for a while about this solution but didn't find anything. I need a source code of dfu bootloader for atmel x mega 128a4u.
I only get the zip file avr1916 which has the hex file and that works.
But I want to customize the bootloader.. In the same zip file also exist the source code but that only works in iar software. For this microprocessor iar gives a bootloader great then 4kb, that-s means I cannot use iar kickstart version for this taking in account this size limitation so I cannot compile the code. I also tried lufa but no results.
Thanks in advance

Last Edited: Wed. Mar 15, 2017 - 04:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ricardolima wrote:
For this microprocessor iar gives a bootloader great then 4kb,
I thought Atmel deliberately arranged for all the DFU bootloaders to build under 4K so that you could use the "free" version of IAR?

 

The fact is that their code is written for IAR so I don't see that you have any alternative but to use IAR?

 

LUFA does have DFU-work-alike bootloaders but Dean's site does say that "Xmega support is "experimental"" so it may not be the solution.

 

How close to 4K is the 1916 stuff anyway? Is it just a few bytes over? If so there must surely be something there that can be trimmed to bring it back under 4K ?

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

http://www.avrfreaks.net/forum/xmega-bootloader-1

by samgm2

I am getting ready to go into small production run with an XMEGAA128A4U and need to know if all the microcontroller sold by Atmel contain the bootloader code so that I can get them programmed with the firmware.

 

If not, does anyone know the specific part number for a part that contains the bootloader (DFU).

 

Sam

Not certain the following will fit in 4KB :

GitHub

ganzziani/Xproto-Watch-Bootloader

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

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.

 

Edit : not certain

 

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

Last Edited: Wed. Mar 15, 2017 - 05:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ricardolima wrote:
I need a source code of dfu bootloader for atmel x mega 128a4u.
fyi, AVRDUDE 6.3 has USB DFU to XMEGA.

 


http://savannah.nongnu.org/forum/forum.php?forum_id=8461 (News: AVRDUDE 6.3 released)

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

Thanks for all help. gchapman I-am using version 7 of atmel studio and in my keep searching I find a way to add usb atmel dfu in asf wizard but iam getting an error

Severity

Code

Description

Project

File

Line

Error

 

recipe for target 'src/ASF/common/services/isp/flip/xmega/isp.o' failed

GccBoardProject3

c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\Debug\Makefile

 

212

Its better use 6.3 version ? 

clawson the compiled file reachs 16 kb .
I will check the info you gave me.
Thank for all and sorry about the text error. Keyboard is not in my native layout

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

ricardolima wrote:
clawson the compiled file reachs 16 kb .
No that cannot be right. Surely you are measuring the size of the .hex file there not the code?

 

As for the AS7 error you quoted that "Error List" in AS7 is almost entirely pointless. Switch to the "output" tab and quote the complete detail of the error, not just the half-baked summary.

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

exactly iam talking about the hex file.

Build started.


Project "GccBoardProject3.cproj" (Compile target(s)):

Target "Compile" in file "C:\Program Files\Atmel\Studio\7.0\Vs\Compiler.targets" from project "c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\GccBoardProject3.cproj" (entry point):

Using "RunCompilerTask" task from assembly "C:\Program Files\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".

Task "RunCompilerTask"

Shell Utils Path C:\Program Files\Atmel\Studio\7.0\shellUtils

C:\Program Files\Atmel\Studio\7.0\shellUtils\make.exe "src/ASF/common/services/isp/flip/xmega/isp.o" 

Building file: ../src/ASF/common/services/isp/flip/xmega/isp.c

Invoking: AVR/GNU C Compiler : 4.9.2

"C:\Program Files\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe" -x c -DDEBUG -DBOARD=USER_BOARD -I"C:\Program Files\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.63\include" -I"../src/ASF/common/boards/user_board" -I"../src/ASF/common/boards" -I"../src/ASF/xmega/utils/preprocessor" -I"../src/ASF/xmega/utils" -I"../src/ASF/common/utils" -I"../src" -I"../src/config" -I"../src/ASF/xmega/drivers/cpu" -I"../src/ASF/xmega/drivers/nvm" -I"../src/ASF/common/services/clock" -I"../src/ASF/xmega/drivers/sleep" -I"../src/ASF/common/services/isp/flip" -I"../src/ASF/common/services/sleepmgr" -I"../src/ASF/common/services/usb" -I"../src/ASF/common/services/usb/class/dfu_flip" -I"../src/ASF/common/services/usb/class/dfu_flip/device" -I"../src/ASF/common/services/usb/udc" -I"../src/ASF/xmega/drivers/usb" -O1 -fdata-sections -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g3 -Wall -mmcu=atxmega128a4u -B "C:\Program Files\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.63\gcc\dev\atxmega128a4u" -c -std=gnu99 -fno-strict-aliasing -Wstrict-prototypes -Wmissing-prototypes -Werror-implicit-function-declaration -Wpointer-arith -mrelax -MD -MP -MF "src/ASF/common/services/isp/flip/xmega/isp.d" -MT"src/ASF/common/services/isp/flip/xmega/isp.d" -MT"src/ASF/common/services/isp/flip/xmega/isp.o" -o "src/ASF/common/services/isp/flip/xmega/isp.o" "../src/ASF/common/services/isp/flip/xmega/isp.c" 

In file included from c:\program files\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:641:0,

from ../src/ASF/xmega/utils/compiler.h:59,

from ../src/ASF/xmega/drivers/nvm/nvm.h:49,

from ../src/ASF/common/services/isp/flip/xmega/isp.c:48:

../src/ASF/common/services/isp/flip/xmega/isp.c: In function 'isp_is_security':

c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\src\ASF\common\services\isp\flip\xmega\isp.c(253,15): error: expected identifier before 'unsigned'

return !(NVM.LOCKBITS&NVM_LOCKBITS_LB1_bm);

^

c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\src\ASF\common\services\isp\flip\xmega\isp.c(254,1): warning: control reaches end of non-void function [-Wreturn-type]

}

^

c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\Debug\Makefile(212,1): error: recipe for target 'src/ASF/common/services/isp/flip/xmega/isp.o' failed

make: *** [src/ASF/common/services/isp/flip/xmega/isp.o] Error 1

Done executing task "RunCompilerTask" -- FAILED.

Done building target "Compile" in project "GccBoardProject3.cproj" -- FAILED.

Done building project "GccBoardProject3.cproj" -- FAILED.

The error is in this function

bool isp_is_security(void)

{

return !(NVM.LOCKBITS&NVM_LOCKBITS_LB1_bm);

}

Thanks for all

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

ricardolima wrote:
Its better use 6.3 version ?
Maybe though Cliff can aid you in diagnosing the problem.

ricardolima wrote:
I find a way to add usb atmel dfu in asf wizard ...
Is ASF4 in Atmel Studio?

An alternative to ASF3 is ASF4 in Atmel START; XMEGA AU is Beta in Atmel START :

Atmel START

Change Log

http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-4E095027-601A-4343-844F-2034603B4C9C-en-US-1/index.html?GUID-DC086BFD-7DA2-43E8-8AE0-457F2351FF4C

...

2017 - February:

...

...

via

Atmel START

http://start.atmel.com/

What's New

There's some flash usage reduction for USART and SPI; don't know about USB as AVR is relatively new to Atmel START.

 


Atmel START

Atmel Software Framework 4 (ASF4)

ASFv4 vs ASFv3 Benchmark

http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-4E095027-601A-4343-844F-2034603B4C9C-en-US-1/index.html?GUID-FE431B1A-031A-48CC-98AF-6984DC79800E

 

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

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\src\ASF\common\services\isp\flip\xmega\isp.c(253,15): error: expected identifier before 'unsigned'

look at the pre-pro output to see how those macros expand

 

as for measuring code by hex file size - forget that - feed the hex to avr-size, it will tell you the binary size.

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

I think in atmel start we dont have the option to add dfu_atmel_usb, at least i didnt find anything about that. So for now i'am using asf3.
With atmel studio 6.2 i have the same error, so probably its a error configuration.
Where is the pre-pro output?

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

ricardolima wrote:
Where is the pre-pro output?
In the .i file after a -save-temps

 

My point is that the error reported is:

c:\users\ieuser\Documents\Atmel Studio\7.0\GccBoardProject3\GccBoardProject3\src\ASF\common\services\isp\flip\xmega\isp.c(253,15): error: expected identifier before 'unsigned'

return !(NVM.LOCKBITS&NVM_LOCKBITS_LB1_bm);

^

As it stands there is no sign of "unsigned" there so I presume it's coming from the expansion of those macros.

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

Sorry but i dont find that file :/ Where it is ?
Anybody can do a project for 128A4U using dfu_atmel without any error? It's a simple project and it gaves error..

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

ricardolima wrote:
Sorry but i dont find that file :/ Where it is ?
If you build "Debug" then the build directory will be a sub-directory of your project directory called "Debug". If -save-temps has been used I'd expect to find .i and .s files in there alongside the final output .o files.

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

i dont have that file. I only have
src , name.eep, name.elf, name.lss, name.map, name.srec, makedep.mk and makefile

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

Anyone can do a simple project to 128a4u with dfu_atmel without any error? With last update it is giving me more errors... Thanks

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

gchapman wrote:

 

 

 

Not certain the following will fit in 4KB :

 

He's got 8KB of bootloader flash.

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

Yes it has 8 kb to bootloader. Anyone is able to make the project without error? It's a bug from atmel studio ?

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

ricardolima wrote:

Yes it has 8 kb to bootloader. Anyone is able to make the project without error? It's a bug from atmel studio ?

The bootloader was written for the IAR compiler.  I think it would need to be converted for GCC.