Forum: Mikrocontroller und Digitale Elektronik Atmel ATxmega128A1 Xplained direkt per USB anschließen und programmieren


von Amin A. (amin_a)


Lesenswert?

Hallo,

ich versuche den Chip direkt mit USB zu programmieren.
Mit Flip hat es nicht geklappt. Das Board wird einfach nicht aufgeführt.

Nach laanger suche habe ich das hier gefunden:
http://support.atmel.com/bin/customer.exe?=&action=viewKbEntry&id=1448
1
How do I download an application into an ATxmegaA1 Xplained board using the UART-to-USB gateway?
2
Answer
3
4
Prerequisites:
5
You will need the following:
6
7
1. The Flip Utility (you can download from here):
8
http://www.atmel.com/tools/FLIP.aspx?tab=overview
9
10
2. The AVR1927 Application note and software bundle.
11
These can be downloaded from here:
12
Appnote:
13
http://www.atmel.com/Images/doc8372.pdf
14
Software Bundle:
15
http://www.atmel.com/Images/AVR1927_XMEGA-A1_Xplained_Example_Applications.zip
16
17
Procedure:
18
19
1. Install Flip Utility
20
2. Unzip software bundle.
21
22
3. Copy a file from the software bundle to the Flip Software.
23
(This will create an ATxmega128A1 device in the selection menu in Flip)
24
Note: An ATxmega128A1U device already exists.
25
26
Copy the software bundle file <AVR1927 install dir>\Bootloader\ATxmega128A1.xml
27
to the following Flip Utility directory C:\Program Files\Atmel\Flip 3.4.5\bin\PartDescriptionFiles\
28
29
30
4. Power up the ATxmegaA1 Xplained board using a USB cable.
31
(note: the Virtual com port should enumerate in the Devices manager of windows)
32
(note: when the Virtual com port enumerates write down the com port used)
33
(note: To enable the bootloader in the ATxmega128A1 you need to hold down switch 0 (SW0)
34
while powering up the xplained board with the USB cable.)
35
36
5. Open the Flip Software
37
a. Select the ATxmega128A1 device
38
b. Select RS232 and the COMx port you wrote down above
39
c. Select 115200 baud rate and press connect button.
40
41
d. Select the following file to download (or your own hex file):
42
<AVR1927 install dir>\Script\xmega-a1_xplained-demo.hex
43
by selecting file> load hex file; in the Flip menu bar
44
e. press run and the hex file should download.
45
46
--------
47
48
49
As an alternative you can use a command line batchISP utility to download the hex file.
50
51
52
Procedure:
53
1. Goto the <AVR1927 install dir>\Script\ directory and edit the following two files, batchisp_cmd.bat
54
and commands.txt as described below.
55
56
57
To avoid setting environment variable in windows
58
Edit batchisp_cmd.bat to match this printout:
59
60
61
REM ----- Start
62
C:\"Program Files\Atmel\Flip 3.4.5\bin\batchisp" -cmdfile commands.txt
63
pause
64
REM ----- End
65
66
Edit commands.txt to match this printout:
67
68
#---- Setup for ATxmega128A1
69
-device ATXMEGA128A1
70
-hardware RS232
71
-baudrate 115200
72
-port COM4
73
74
#---- Load a HEX file
75
-operation
76
ONFAIL ABORT
77
ASSERT PASS
78
79
echo "Load HEX file:"
80
ERASE F
81
BLANKCHECK
82
MEMORY FLASH
83
LOADBUFFER xmega-a1_xplained-demo.hex
84
PROGRAM
85
VERIFY
86
START
87
RESET 0
88
#-----------
89
90
3. Open a windows command shell change directories to <AVR1927 install dir>\Script\
91
execute the command:
92
batchisp_cmd.bat
93
94
This should perform the same actions done with the Flip utility above.


der erste Teil hat insofern geholfen dass der xmega jetzt in der pull 
downliste von Flip angezeigt wird, wenn man dann auf connect klickt 
kommt ein Time Out error.

Achtung in der Anleitung beim alternativen Lösungsweg muss man die 
Versionsnummer von Flip in der batchisp_cmd.bat anpassen und den Port in 
der commands.txt anpassen.

Hier bekomme ich folgende Meldung:
1
Dokumentation Atmel-XMEGA-A1-Plattform
2
\AVR1927_XMEGA-A1_Xplained_Example_Applications\Script>C:\"Program Files (x86)\A
3
tmel\Flip 3.4.7\bin\batchisp" -cmdfile commands.txt
4
Running batchisp 1.2.5 on Fri Apr 19 21:06:58 2013
5
6
ATXMEGA128A1 - RS232 - COM7 - 115200
7
8
Device selection....................... PASS
9
Hardware selection..................... PASS
10
Opening port........................... PASS
11
Synchronizing target................... FAIL    Timeout error.
12
ISP done.

Wo ist das Problem? Hat jemand vielleicht eine Idee?

Ich habe Windows 7 SP1, 64bit

von Robert S. (bimbo385)


Angehängte Dateien:

Lesenswert?

Ja hab ich.

Der ATXMEGA128 ist nicht im Bootloader Modus.

"(note: To enable the bootloader in the ATxmega128A1 you need to hold 
down switch 0 (SW0)"

Das ist ganz wichtig!

Zum Verständnis dieses Programmiervorganges:

Der kleine Controller auf dem Board (Atmel 32UC3B...irgendwas) ist nur 
ein Umsetzer USB auf RS232 (Seriell). Unabhängig davon, ob der 
ATXmega128A1 programmiert werden soll, oder ob der nur im Betrieb mit 
dem PC "redet".

Zum Programmieren muss auf dem ATXmega128A1 ein sogenannter Bootloader 
aufgespielt sein (ist ab Werk so).

Wenn jetzt der ATXmega128A1 aufwacht, z.B. beim Anstecken oder nach 
einem Reset (Resetleitung am JTAG Anschluss nach Masse), dann startet 
als erstes der Bootloader. Der macht erst einmal nichts Anderes, als zu 
überprüfen, ob der SW0 gedrückt ist (innerhalb von ein paar ms nach dem 
Aufwachen). Ist dies nicht so, beendet sich der Bootloader und startet 
die programmierte Firmware. So sieht der normale Startvorgang aus.

Ist der Taster direkt beim Aufwachen aber gedrückt, dann bleibt der 
Bootloader stehen und wartet darauf, dass über die RS232 Schnittstelle 
(die ja über den anderen Chip nach USB adaptiert ist) eine neue Firmware 
kommt. Die eigene Firmware wird jetzt nicht gestartet.

Die neue FW programmiert der Bootloader dann in den Chip. Der 
ATXmega128A1 programmiert sich quasi selber.

Wenn er damit fertig ist, startet er die neue Firmware.


Bei dir versucht die Batchisp den Kontakt zum Board herzustellen, aber 
der Bootloader auf dem ATXmega128A1 wartet zu dem Zeitpunkt nicht auf 
eine neue Firmware.
Ursachen können vielfältig sein:
- falscher COM Port.
- richtiger COM Port gar nicht verfügbar, da der Treiber fehlt (im 
Gerätemanager nachschauen).
- Die normale Firmware läuft -> SW0 beim Einstecken nicht (richtig) 
gedrückt.
- Bootloader nicht auf dem ATXmega128A1 (mit richtigem Programmer 
umprogrammiert)


Das sind eigentlich die Standardprobleme.


Ich hab übrigens eine GUI geschrieben, die dir das Rumgetippe in dieser 
Textdatei erspart. Probier das doch einfach mal aus und gib mir eine 
Rückmeldung wenn es gefällt (bei Problemen und Kritik natürlich auch ;).

Mfg Bimbo385

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.