Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
crb
PostPosted: Feb 15, 2012 - 03:57 PM
Newbie


Joined: Nov 03, 2011
Posts: 6


This is a followup to my post:
http://www.avrfreaks.net/index.php?name ... highlight=
Problem:
I have two boards with the AT32UC3A0512 part on them. One custom and one the EVK1100. I can program both fine with the AVRStudio v5 programming utility and the dragon programmer. It should be noted when I use this utility I need to press the "chip erase" button to erase the chip before doing a program as the check box doesn't appear to actually erase.

I need to be able to command line program for Linux and Windows environments which led me to use avr32program. I get the same failure mode in both Windows 7 x64 and Linux (Redhat x64) which leads me to believe it is an error in my avr32program arguments.

My test case is a firmware load which will program with the GUI utility, but not with avr32prog. This load was pulled directly from the part via the GUI utility after it was programmed. It starts at 0x0. Here are my arguments:
Code:
avr32program -v 2 -p avrdragon -x . program -E -v -F bin eval_board_cli.hex
 -f internal@0x00000000,512Kb -r -R


And here is the output with a verbosity of 3:
Code:

Setting max size for USB endpoint 0x82 to 64.
Setting max size for USB endpoint 0x2 to 64.
Connected to AVR Dragon  version {0x070e, 0x070e}.
Device ID: 0x91edc03f.
Read JTAGID: 0x91edc03f.
Set XML part file path to .
Scanning directory . for part description files
Found matching JTAGID in part description file ./uc3a0512.xml.
MSU status register: 0x00000000.
Performed AVR_RESET(0x1f).
Performed AVR_RESET(0x01).
CHIP_ERASE: IR=0x01.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x01.
Performed AVR_RESET(0x00).
MSU status register: 0x00000000.
JTAG chip erase performed.
Resetting target.
Performed AVR_RESET(0x1f).
Performed AVR_RESET(0x07).
Read  0x00000000 from OCD register  4   DS:
Performed AVR_RESET(0x1f).
Performed AVR_RESET(0x01).
Read  0x00000000 from OCD register  2   DC:
Wrote 0xc0003000 to   OCD register  2   DC <= ABORT|RES|DBE|DBR
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Performed AVR_RESET(0x00).
Performed AVR_RESET(0x00).
Entering debug mode.
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00000000 from OCD register 68   DCCPU: ???
Reading chip configuration.
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00000000 from OCD register 68   DCCPU: ???
Wrote 0xe1b00040 to   OCD register 65   DINST <= mfsr R0, 256
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x0204098b from OCD register 68   DCCPU: ???
Wrote 0x00000000 to   OCD register 69   DCEMU <= ???
Wrote 0xe5b00045 to   OCD register 65   DINST <= mfdr R0, 276
Read  0x0204098b from system register 0x0100.
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00000000 from OCD register 68   DCCPU: ???
Wrote 0xe1b00041 to   OCD register 65   DINST <= mfsr R0, 260
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00800000 from OCD register 68   DCCPU: ???
Wrote 0x00000000 to   OCD register 69   DCEMU <= ???
Wrote 0xe5b00045 to   OCD register 65   DINST <= mfdr R0, 276
Read  0x00800000 from system register 0x0104.
Read CONFIG0: 0x0204098b.       CONFIG1: 0x00800000.
Initializing SMC.
SMC initialized.

Programming 1474709 bytes in 1 segment.
Writing 65536 bytes to memory at 0x00000000.
Writing 65536 bytes to memory at 0x00010000.                               2.2%
Writing 65536 bytes to memory at 0x00020000.                               4.4%
Writing 65536 bytes to memory at 0x00030000.                               6.7%
Writing 65536 bytes to memory at 0x00040000.                               8.9%
Writing 65536 bytes to memory at 0x00050000.                              11.1%
Writing 65536 bytes to memory at 0x00060000.                              13.3%
Writing 65536 bytes to memory at 0x00070000.                              15.6%
Writing 65536 bytes to memory at 0x00080000.                              17.8%
Writing 65536 bytes to memory at 0x00090000.                              20.0%
Writing 65536 bytes to memory at 0x000a0000.                              22.2%
Writing 65536 bytes to memory at 0x000b0000.                              24.4%
Writing 65536 bytes to memory at 0x000c0000.                              26.7%
Writing 65536 bytes to memory at 0x000d0000.                              28.9%
Writing 65536 bytes to memory at 0x000e0000.                              31.1%
Writing 65536 bytes to memory at 0x000f0000.                              33.3%
Writing 65536 bytes to memory at 0x00100000.                              35.6%
Writing 65536 bytes to memory at 0x00110000.                              37.8%
Writing 65536 bytes to memory at 0x00120000.                              40.0%
Writing 65536 bytes to memory at 0x00130000.                              42.2%
Writing 65536 bytes to memory at 0x00140000.                              44.4%
Writing 65536 bytes to memory at 0x00150000.=                             46.7%
Writing 32917 bytes to memory at 0x00160000.==                            48.9%
  Programming memory: ========================                            50.0%
Write memory failed.
Failed writing 148 bytes to address 0x00160000.
Error reading memory word from 0x00168094.
SAB read from address 0x500168094 failed.
sabRead:
The command was not understood by the JTAGICE mkII unit.

Any ideas what could be causing this? Does anyone have a valid set of avr32program arguements which works with the EVK1100 and the dragon programmer?

Thanks!


Last edited by crb on Feb 15, 2012 - 06:20 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
sambrown
PostPosted: Feb 15, 2012 - 04:10 PM
Hangaround


Joined: May 24, 2011
Posts: 254
Location: Berlin

to me this looks like you start programming the ram at 0x0 and when you start programming nirvana your programmer finds out that nirvana does not behave like ram.

maybe you should try to program your internal flash instead at an offset of 0x80000000 - it could help Wink

-sb
 
 View user's profile Send private message  
Reply with quote Back to top
crb
PostPosted: Feb 15, 2012 - 05:07 PM
Newbie


Joined: Nov 03, 2011
Posts: 6


sb, thanks for the reply. Unfortunately I have tried setting the offset and get a failure there as well. Output below.

I have tried different settings including no internal offset, internal offset of 0x80000000(below), internal offset of 0x0 with a -O of 0x8 and internal offset of 0x0 and -O of 0x0. Which makes me wonder why there is a "-O" and an address field in the "-internal".
Code:

$ ./avr32program -v 2 -p avrdragon -x . program -E -v -F bin eval_board_cli.hex
 -f internal@0x80000000,512Kb -r -R
Setting max size for USB endpoint 0x82 to 64.
Setting max size for USB endpoint 0x2 to 64.
Connected to AVR Dragon  version {0x070e, 0x070e}.
Device ID: 0x91edc03f.
Read JTAGID: 0x91edc03f.
Set XML part file path to .
Scanning directory . for part description files
Found matching JTAGID in part description file ./uc3a0512.xml.
MSU status register: 0x00000000.
Performed AVR_RESET(0x1f).
Performed AVR_RESET(0x01).
CHIP_ERASE: IR=0x01.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x05.
CHIP_ERASE: IR=0x01.
Performed AVR_RESET(0x00).
MSU status register: 0x00000000.
JTAG chip erase performed.
Resetting target.
Performed AVR_RESET(0x1f).
Performed AVR_RESET(0x07).
Read  0x00000000 from OCD register  4   DS:
Performed AVR_RESET(0x1f).
Performed AVR_RESET(0x01).
Read  0x00000000 from OCD register  2   DC:
Wrote 0xc0003000 to   OCD register  2   DC <= ABORT|RES|DBE|DBR
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Read  0x04000000 from OCD register  4   DS: DBA
Performed AVR_RESET(0x00).
Performed AVR_RESET(0x00).
Entering debug mode.
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00000000 from OCD register 68   DCCPU: ???
Reading chip configuration.
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00000000 from OCD register 68   DCCPU: ???
Wrote 0xe1b00040 to   OCD register 65   DINST <= mfsr R0, 256
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x0204098b from OCD register 68   DCCPU: ???
Wrote 0x00000000 to   OCD register 69   DCEMU <= ???
Wrote 0xe5b00045 to   OCD register 65   DINST <= mfdr R0, 276
Read  0x0204098b from system register 0x0100.
Read  0x05000020 from OCD register  4   DS: DBA|INC|DBS
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00000000 from OCD register 68   DCCPU: ???
Wrote 0xe1b00041 to   OCD register 65   DINST <= mfsr R0, 260
Wrote 0xe7b00044 to   OCD register 65   DINST <= mtdr 272, R0
Read  0x00000001 from OCD register 70   DCSR: CPUD
Read  0x00800000 from OCD register 68   DCCPU: ???
Wrote 0x00000000 to   OCD register 69   DCEMU <= ???
Wrote 0xe5b00045 to   OCD register 65   DINST <= mfdr R0, 276
Read  0x00800000 from system register 0x0104.
Read CONFIG0: 0x0204098b.       CONFIG1: 0x00800000.
Initializing SMC.
SMC initialized.

Programming 1474709 bytes in 1 segment.
Writing 65536 bytes to memory at 0x00000000.
Writing 65536 bytes to memory at 0x00010000.                               2.2%
Writing 65536 bytes to memory at 0x00020000.                               4.4%
Writing 65536 bytes to memory at 0x00030000.                               6.7%
Writing 65536 bytes to memory at 0x00040000.                               8.9%
Writing 65536 bytes to memory at 0x00050000.                              11.1%
Writing 65536 bytes to memory at 0x00060000.                              13.3%
Writing 65536 bytes to memory at 0x00070000.                              15.6%
Writing 65536 bytes to memory at 0x00080000.                              17.8%
Writing 65536 bytes to memory at 0x00090000.                              20.0%
Writing 65536 bytes to memory at 0x000a0000.                              22.2%
Writing 65536 bytes to memory at 0x000b0000.                              24.4%
Writing 65536 bytes to memory at 0x000c0000.                              26.7%
Writing 65536 bytes to memory at 0x000d0000.                              28.9%
Writing 65536 bytes to memory at 0x000e0000.                              31.1%
Writing 65536 bytes to memory at 0x000f0000.                              33.3%
Writing 65536 bytes to memory at 0x00100000.                              35.6%
Writing 65536 bytes to memory at 0x00110000.                              37.8%
Writing 65536 bytes to memory at 0x00120000.                              40.0%
Writing 65536 bytes to memory at 0x00130000.                              42.2%
Writing 65536 bytes to memory at 0x00140000.                              44.4%
Writing 65536 bytes to memory at 0x00150000.=                             46.7%
Writing 32917 bytes to memory at 0x00160000.==                            48.9%
  Programming memory: ========================                            50.0%
Write memory failed.
Failed writing 148 bytes to address 0x00160000.
Error reading memory word from 0x00168094.
SAB read from address 0x500168094 failed.
sabRead:
The command was not understood by the JTAGICE mkII unit.

 
 View user's profile Send private message  
Reply with quote Back to top
sambrown
PostPosted: Feb 15, 2012 - 05:15 PM
Hangaround


Joined: May 24, 2011
Posts: 254
Location: Berlin

do you really try to program the hex file with parameter -Fbin?

I'd try to pass the binary not the hex file and use the offset: -O0x80000000

alternatively use -Felf and pass the elf binary

-sb
 
 View user's profile Send private message  
Reply with quote Back to top
crb
PostPosted: Feb 15, 2012 - 06:20 PM
Newbie


Joined: Nov 03, 2011
Posts: 6


Yep, you're right the .bin is raw binary and the .hex isn't. I programmed the device with the GUI tool (.hex) then read back using the CLI resulting in a .bin. I then programmed the .bin and it was able to verify and start execution. It is strange the GUI programming tool supports .hex natively and the toolkit outputs a .hex natively, but avr32program does not.
So...for posterity, run the .hex through hex2bin, available at Atmel's site
http://www.atmel.com/tools/8051REFERENCEDOCUMENTS.aspx
or here (what I used)
http://sourceforge.net/projects/hex2bin/
then run the following command:
Code:
$ ./avr32program -p avrdragon -x . program -E -v -f internal@0x80000000,512Kb -O 0x80000000 -r -R -F bin bin_file.bin
 
 View user's profile Send private message  
Reply with quote Back to top
sambrown
PostPosted: Feb 15, 2012 - 06:44 PM
Hangaround


Joined: May 24, 2011
Posts: 254
Location: Berlin

that's what I call "tool driven ignorance" Wink

-sb
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits