PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Asuro von Linux programmieren



brixter
02.01.2014, 20:40
Hallo,
auf meinem Laptop läuft Ubuntu 13.10, und ich möchte von diesem meinen Asuro über USB/IR programmieren. Von Windows aus war das kein Problem.
in Ubuntu habe ich ein Problem beim Kompilieren des FirstTry Beispiels. Der Compile-Vorgang wird mit folgender Meldung abgebrochen.

set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
asuro.c:34:9: error: Versuch, schlechtes »SIG_OUTPUT_COMPARE2« zu verwenden
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
asuro.c:34:9: error: Versuch, schlechtes »SIG_OUTPUT_COMPARE2« zu verwenden
asuro.c: In function ‘SIG_OUTPUT_COMPARE2’:
asuro.c:34:1: warning: ‘SIG_OUTPUT_COMPARE2’ appears to be a misspelled signal handler [enabled by default]
make: *** [asuro.o] Fehler 1

Ich habe daraufhin ein bischen gegoogelt und in in asuro.c SIG_OUTPUT_COMPARE2 durch TIMER_COMP_vect ersetzt. (Ist dieses Vorgehen richtig????)
Der Compile läuft dann ohne Probleme durch.

set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
asuro.c: In function ‘TIMER_COMP_vect’:
asuro.c:34:1: warning: ‘TIMER_COMP_vect’ appears to be a misspelled signal handler [enabled by default]
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex test.elf test.eep
avr-objcopy: --change-section-lma .eeprom=0x0000000000000000 never used
avr-objdump -h -S test.elf > test.lss
Size after:
test.elf :
section size addr
.text 1684 0
.bss 1 8388704
.stab 11988 0
.stabstr 3168 0
.comment 17 0
Total 16858


Errors: none
-------- end --------

Aber auch hier bekomme ich ein warning:
asuro.c:34:1: warning: ‘TIMER_COMP_vect’ appears to be a misspelled signal handler [enabled by default]


Das Flashen funktioniert. Hier die Ausgabe des Tools "Asuro Flash Tool":
ulding RAM » OK
Connecting to ASURO » OK
Sending Page 000 of 026 » t flashed
Sending Page 001 of 026 » flashed
Sending Page 002 of 026 » flashed
Sending Page 003 of 026 » flashed
Sending Page 004 of 026 » flashed
Sending Page 005 of 026 » flashed
Sending Page 006 of 026 » flashed
Sending Page 007 of 026 » flashed
Sending Page 008 of 026 » c flashed
Sending Page 009 of 026 » flashed
Sending Page 010 of 026 » flashed
Sending Page 011 of 026 » flashed
Sending Page 012 of 026 » c flashed
Sending Page 013 of 026 » c flashed
Sending Page 014 of 026 » flashed
Sending Page 015 of 026 » flashed
Sending Page 016 of 026 » flashed
Sending Page 017 of 026 » flashed
Sending Page 018 of 026 » c flashed
Sending Page 019 of 026 » flashed
Sending Page 020 of 026 » flashed
Sending Page 021 of 026 » flashed
Sending Page 022 of 026 » flashed
Sending Page 023 of 026 » flashed
Sending Page 024 of 026 » flashed
Sending Page 025 of 026 » flashed
Sending Page 026 of 026 » flashed
All Pages flashed
ASURO ready to start

Anschließend starte ich den Asuro neu. Mein Code scheint aber nichts zu bewirken. Die BackLEDs sind beide an. Die StatusLED grün.
Hier mein Code:

#include "asuro.h"

int main(void)
{
Init();
FrontLED(ON);
while(1);
return 0;
}

Kann mir jemand einen Tip geben, was hier schief läuft? Wie gesagt, wenn ich auf Windows compile und flashe läuft der gleiche Code. Muss ich evtl das Makefile anpassen. Oder liegt es an der Version meiner avr-tools?

- - - Aktualisiert - - -

Update:
Ich habe mir jetzt mal die alternative asuroLib von http://sourceforge.net/projects/asuro/ runtergeladen und dasselbe damit probiert... und ich hatte Erfolg! :-)
Problem ist also gelöst.

markusj
02.01.2014, 21:13
Update:
Ich habe mir jetzt mal die alternative asuroLib von http://sourceforge.net/projects/asuro/ runtergeladen und dasselbe damit probiert... und ich hatte Erfolg! :-)
Problem ist also gelöst.
Die Original-Bibliothek des DLR ist schlicht und ergreifend veraltet. Die mitgelieferte WinAVR-Version ist ähnlich betagt, deshalb bekommst du unter Windows keine Probleme. Deine Linux-Installation ist aber auf einem aktuelleren Stand und kreidet die DLR-Bibliothek daher an. Die Lösung besteht darin, eine moderne Bibliothek, wie die von dir gefundene, zu nutzen.

mfG
Markus