- 3D-Druck Einstieg und Tipps         
Ergebnis 1 bis 10 von 405

Thema: Alternative zu Flashnnn.exe

Hybrid-Darstellung

Vorheriger Beitrag Vorheriger Beitrag   Nächster Beitrag Nächster Beitrag
  1. #1
    Benutzer Stammmitglied
    Registriert seit
    25.04.2007
    Beiträge
    54

    Mit dem Kopf durch die Wand ...

    Hallo Osser,
    um überhaupt erst man ein Erfolgserlebnis zu bekommen, habe ich Deinen Ratschlag befolgt und bin dabei ganz einfach mit dem Kopf durch die Wand.
    Ich habe mir mein Beispielprogramm:

    // Blink: Turns on an LED on for one second, then off for one second...

    # include "Arduino.h"

    // Pin 13 has an LED connected on most Arduino boards.
    int led = 13; // give it a name:

    // the setup routine runs once when you press reset:
    void setup()
    {
    pinMode(led, OUTPUT); // initialize the digital pin as an output.
    }

    // the loop routine runs over and over again forever:
    void loop()
    {
    digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000); // wait for a second
    digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
    delay(1000); // wait for a second
    }
    mit der original Arduino-IDE 1.0 compilieren lassen. Die Compilermeldungen habe ich ganz einfach in den pn-Editor kopiert, die entsprechenden Befehle extrahiert, den Rest gelöscht und die AsuroFlash-Variablen eingefügt. Herausgekommen ist folgendes:

    @set path=%AF_PRGDIR%\Arduino\hardware\tools\avr\bin\;% path%
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_PRJDIR%\%AF_SOURCE_FILES% -o%AF_PRJDIR%\%AF_SOURCE_FILES%.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\WInterrupts.c -o%AF_PRJDIR%\WInterrupts.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring.c -o%AF_PRJDIR%\wiring.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_analog.c -o%AF_PRJDIR%\wiring_analog.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_digital.c -o%AF_PRJDIR%\wiring_digital.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_pulse.c -o%AF_PRJDIR%\wiring_pulse.c.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_PRJDIR%\%AF_SOURCE_FILES% -o%AF_PRJDIR%\%AF_SOURCE_FILES%.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\WInterrupts.c -o%AF_PRJDIR%\WInterrupts.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring.c -o%AF_PRJDIR%\wiring.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_analog.c -o%AF_PRJDIR%\wiring_analog.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_digital.c -o%AF_PRJDIR%\wiring_digital.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_pulse.c -o%AF_PRJDIR%\wiring_pulse.c.o
    avr-gcc -c -g -Os -Wall -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\wiring_shift.c -o%AF_PRJDIR%\wiring_shift.c.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\CDC.cpp -o%AF_PRJDIR%\CDC.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\HID.cpp -o%AF_PRJDIR%\HID.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\HardwareSerial.cpp -o%AF_PRJDIR%\HardwareSerial.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\IPAddress.cpp -o%AF_PRJDIR%\IPAddress.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\Print.cpp -o%AF_PRJDIR%\Print.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\Stream.cpp -o%AF_PRJDIR%\Stream.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\Tone.cpp -o%AF_PRJDIR%\Tone.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\USBCore.cpp -o%AF_PRJDIR%\USBCore.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\WMath.cpp -o%AF_PRJDIR%\WMath.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\WString.cpp -o%AF_PRJDIR%\WString.cpp.o
    avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=100 -I%AF_ARDCORES% -I%AF_ARDTYPES% %AF_ARDCORES%\main.cpp -o%AF_PRJDIR%\main.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\WInterrupts.c.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\wiring.c.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\wiring_analog.c.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\wiring_digital.c.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\wiring_pulse.c.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\wiring_shift.c.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\CDC.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\HID.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\HardwareSerial.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\IPAddress.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\Print.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\Stream.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\Tone.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\USBCore.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\WMath.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\WString.cpp.o
    avr-ar rcs %AF_PRJDIR%\core.a %AF_PRJDIR%\main.cpp.o
    avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o %AF_PRJDIR%\%AF_SOURCE_FILES%.elf %AF_PRJDIR%\%AF_SOURCE_FILES%.o %AF_PRJDIR%\core.a -L%AF_PRJDIR% -lm
    avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 %AF_PRJDIR%\%AF_SOURCE_FILES%.elf %AF_PRJDIR%\%AF_SOURCE_FILES%.eep
    avr-objcopy -O ihex -R .eeprom %AF_PRJDIR%\%AF_SOURCE_FILES%.elf %AF_PRJDIR%\%AF_SOURCE_FILES%.hex
    Eingetragen habe ich diesen Befehlsblock im Config-Menue unter Make all. Ein makefile ist dann nicht mehr notwendig. Das Fenster Make file im Config-Menue bleibt also leer.
    Das Aufräumen erfolgt durch einige wenige Befehle im Fenster Make clean im Config-Menue:

    del %AF_PRJDIR%\*.o
    del %AF_PRJDIR%\*.a
    del %AF_PRJDIR%\*.eep
    del %AF_PRJDIR%\*.elf
    Zusätzlich zu den Standardvariablen zeigt
    AF_ARDCORES in den Arduino-Ordner ..\hardware\arduino\cores\arduino und
    AF_ARDTYPES in den Arduino-Ordner ..\hardware\arduino\variants\standard (Uno-Board!)

    Die Arduino-Installation befindet sich im Verzeichnis von AsuroFlash im Unterordner Arduino.

    Das ganze Verfahren ist sicher alles andere als professionell, aber immerhin ein Ansatz, der schon mal funktioniert.

    An der makefile-Vorlage, die ich weiter oben erwähnt habe, bin ich bislang gescheitert.

    Gruss
    Ulli
    Geändert von ukuchel (05.01.2014 um 17:40 Uhr) Grund: Fehler im Code

  2. #2
    Benutzer Stammmitglied
    Registriert seit
    25.04.2007
    Beiträge
    54

    Beitrag ... Fortsetung

    Der nächste Schritt ist das Einbinden von weiteren Bibliotheken, z.B. zum Ansteuern eines LCD-Displays. Dazu habe ich die zunächst beiden Dateien "LiquidCrystal.h" bzw. "LiquidCrystal.cpp" aus der Arduino Installation in mein Projektverzeichnis kopiert und in mein Testprogramm includiert:

    // HalloWelt: ....

    # include "Arduino.h"
    # include "LiquidCrystal.h"
    # include "LiquidCrystal.cpp"


    // initialize the library with the numbers of the interface pins
    LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

    // the setup routine runs once when you press reset:
    void setup()
    {
    lcd.begin(16, 2); // Set up the LCD's number of columns and rows.
    lcd.print("hello, world!"); // Print a message to the LCD.
    }

    // the loop routine runs over and over again forever:
    void loop()
    { // Note: line 1 is the second row, since counting begins with 0).
    lcd.setCursor(0, 1); // Set the cursor to column 0, line 1.
    lcd.print(millis()/1000); // Print the number of seconds since reset.
    }
    Das Compilieren und das Flashen klappen einwandfrei.

    Die beiden oben genannten Dateien dürfen nicht in das AsuroFlash-Projektverzeichnis aufgenommen werden, da sonst sie Variable AF_SOURCE_FILES mehrere Einträge enthält. Dann funktioniert das Compilieren mit meiner "Kopf durch die Wand"-Methode nicht.

    Gruss
    Ulli
    Geändert von ukuchel (04.06.2013 um 12:51 Uhr)

  3. #3
    Benutzer Stammmitglied
    Registriert seit
    25.04.2007
    Beiträge
    54

    Nachtrag: Projekt-Pfadnamen mit Leerzeichen

    Wenn der Pfadname eines Projektes Leerzeichen enthält, ist in make_all und make_clean

    AF_PRJDIR

    komplett (!) durch

    "AF_PRJDIR"

    zu ersetzen. Sonst gibt der Compiler Fehlermeldungen aus.
    Alle anderen Installationsverzeichnisse enthalten bei mir keine Leerzeichen.
    Hier müssen u.U. ebenfalls Anpassungen vorgenommen werden.

    Ulli

  4. #4
    Benutzer Stammmitglied
    Registriert seit
    25.04.2007
    Beiträge
    54
    Hallo Osser,
    ich arbeite zur Zeit "immer noch" oder besser gesagt "mal wieder" mit der Kombination Arduino <> AsuroFlash.
    Dabei nutze ich ziemlich viel das integrierte Terminalprogramm und habe hier einige Verbesserungsvorschläge.
    Wenn Du Zeit und Lust hast, AF ein wenig weiterzuentwickeln, stelle ich meine Vorschläge gerne hier ins Forum.
    Gruss
    Ulli

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •  

fchao-Sinus-Wechselrichter AliExpress