Forum: Mikrocontroller und Digitale Elektronik Problem den chip45boot2 auf XMega 32A4 zu flashen


von Stefan (Gast)


Lesenswert?

Hallo,

Ich versuche gerade den chip45boot2 Bootloader auf einen ATXmega 32A4 zu 
flashen. Programmer ist der AVR ISP MKII zum flashen wollteich AVR Dude 
verwenden. Mit dem Programm funktioniert es :

C:\>"C:\Program Files\WinAVR\bin\avrdude.exe" avrdude -p atxmega32a4 -P 
usb -c avrisp2 -v -F -V -U f
lash:w:flash.hex

avrdude.exe: Version 5.10, compiled on Jan 19 2010 at 10:45:23
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
             Copyright (c) 2007-2009 Joerg Wunsch

             System wide configuration file is "C:\Program 
Files\WinAVR\bin\avrdude.conf"

             Using Port                    : usb
             Using Programmer              : avrisp2
avrdude.exe: usbdev_open(): Found AVRISP mkII, serno: 000200043431
             AVR Part                      : ATXMEGA32A4
             Chip Erase delay              : 0 us
             PAGEL                         : P00
             BS2                           : P00
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             serial program mode           : yes
             parallel program mode         : yes
             Timeout                       : 0
             StabDelay                     : 0
             CmdexeDelay                   : 0
             SyncLoops                     : 0
             ByteDelay                     : 0
             PollIndex                     : 0
             PollValue                     : 0x00
             Memory Detail                 :

                                      Block Poll               Page 
Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size 
#Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- 
------ ----- ----- ---------
               eeprom         0     0     0    0 no       1024   32 
0     0     0 0x00 0x00
               application    0     0     0    0 no      32768  256 
0     0     0 0x00 0x00
               apptable       0     0     0    0 no       4096  256 
0     0     0 0x00 0x00
               boot           0     0     0    0 no       4096  256 
0     0     0 0x00 0x00
               flash          0     0     0    0 no      36864  256 
0     0     0 0x00 0x00
               prodsig        0     0     0    0 no        512  256 
0     0     0 0x00 0x00
               usersig        0     0     0    0 no        512  256 
0     0     0 0x00 0x00
               signature      0     0     0    0 no          3    0 
0     0     0 0x00 0x00
               fuse0          0     0     0    0 no          1    0 
0     0     0 0x00 0x00
               fuse1          0     0     0    0 no          1    0 
0     0     0 0x00 0x00
               fuse2          0     0     0    0 no          1    0 
0     0     0 0x00 0x00
               fuse4          0     0     0    0 no          1    0 
0     0     0 0x00 0x00
               fuse5          0     0     0    0 no          1    0 
0     0     0 0x00 0x00
               lock           0     0     0    0 no          1    0 
0     0     0 0x00 0x00

             Programmer Type : STK500V2
             Description     : Atmel AVR ISP mkII
             Programmer Model: AVRISP mkII
             Hardware Version: 1
             Firmware Version Master : 1.13
             Vtarget         : 3.2 V
             SCK period      : 8.00 us

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 
0.03s

avrdude.exe: Device signature = 0x1e9541
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will 
be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "flash.hex"
avrdude.exe: input file flash.hex auto detected as Intel Hex
avrdude.exe: writing flash (11598 bytes):

Writing | ################################################## | 100% 
0.95s

avrdude.exe: 11598 bytes of flash written

avrdude.exe done.  Thank you.

...

avrdude> r flash
>>> r flash
0000  0c 94 5e 01 0c 94 8a 01  0c 94 8a 01 0c 94 8a 01  | .^. ... ... 
...|
0010  0c 94 8a 01 0c 94 8a 01  0c 94 8a 01 0c 94 8a 01  | ... ... ... 
...|
0020  0c 94 8a 01 0c 94 8a 01  0c 94 98 0c 0c 94 8a 01  | ... ... .. 
...|
0030  0c 94 8a 01 0c 94 8a 01  0c 94 8a 01 0c 94 8a 01  | ... ... ... 
...|

Programm ist drauf und läuft.

Wenn ich jetzt das entsprechende hex des bootloaders flashe :

C:\>"C:\Program Files\WinAVR\bin\avrdude.exe" avrdude -p atxmega32a4 -P 
usb -c avrisp2 -v -F -V -U f
lash:w:bloader.hex

.... entfernt ....

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 
0.03s

avrdude.exe: Device signature = 0x1e9541
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will 
be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "bloader.hex"
avrdude.exe: input file bloader.hex auto detected as Intel Hex
avrdude.exe: writing flash (35722 bytes):

Writing | ################################################## | 100% 
2.67s

avrdude.exe: 35722 bytes of flash written

avrdude.exe done.  Thank you.

siehts ja erstmal gut aus. Aber ...

avrdude> r boot
>>> r boot
0000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|
0020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|
0030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|

bootsection ist leer ...

avrdude> r flash
>>> r flash
0000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|
0010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|
0020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|
0030  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff 
|................|

geschrieben wurde aber ...

avrdude> r fuse2
>>> r fuse2
0000  bf                                                |. 
|

die fuse ist gesetzt. Muss die bootsection noch beschreibbar gemacht 
werden ? und wenn wie ? lock lässt sich irgendwie nicht lesen und ich 
trau mich nicht eifach irgendwas reinzuschreiben da ich es ja offenbar 
nicht mal kontrollieren kann.

>>> r lock
avrdude.exe: stk600_xprog_read_byte(): unknown memory "lock"
error reading lock address 0x00000 of part ATXMEGA32A4
read operation not supported on memory type "lock"

das hex-file fängt so an sollte doch eigentlich bei 32k landen :

:108000000C94BC400C94CA400C94CA400C94CA40D6
:108010000C94CA400C94CA400C94CA400C94CA40B8
:108020000C94CA400C94CA400C94CA400C94CA40A8
:108030000C94CA400C94CA400C94CA400C94CA4098
:108040000C94CA400C94CA400C94CA400C94CA4088
.....

hat irgendjemand eine Idee was hier schiefläuft ? Oder einen fertigen 
Bootloader der sich flashen lässt ?

Vielen Dank Stefan

von Thomas S. (kiu77)


Lesenswert?

Mit AtmelStudio (oder AVR-Studio) klappt das flashen normgerecht, dh. 
dass die unteren 32kB frei = xFF sind und der Bootloader im dafür 
reservierten Bereich ab x8000 steht.

Soweit jedenfalls. Funktionieren will das dann aber bei mir irgendwie 
immer noch nicht so richtig.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.