Hi Leute,
zur Zeit habe ich einen ESP32 mit einem Raspi über UART verbunden.
Wenn ich den ESP flashen will (oder muss), schicke ich über die Serielle Schnittstelle ein Kommando an den ESP: "Ey oida, mach WiFi an!"). ESP schaltet WiFi an, dann flashe ich den ESP über OTA und dann wieder über Serial: "Ey oida, mach WiFi aus!".
Jetzt will ich den ESP durch einen Arduino Nano ersetzen. Wie kann ich den vom Raspi aus über USB flashen? Brauche ich dafür die Arduino IDE auf dem Raspi?
du brauchst avrdude
IDE ist auch ok, kannst dann auch gleich auf dem Pi programmieren.
Gruß eMeS
Ich würde gern die kompilierte *. bin per FTP vom Deveveloper PC auf den Raspi schieben und dann???
avrdude muss ich mal studieren.
und dann startest du zuerst mal vom terminal "arduino tolles.ino", kompilierst das und lädtst es auf den arduino. Dann schaust du im terminal, was arduino für eine commandline mit avrdude für's flashen zusammengebaut hat. Die passt du dann an.
du brauchst avrdude
Genau was ich gesucht habe.
und dann startest du zuerst mal vom terminal "arduino tolles.ino", kompilierst das und lädtst es auf den arduino. Dann schaust du im terminal, was arduino für eine commandline mit avrdude für's flashen zusammengebaut hat. Die passt du dann an.
und so probiere ich es mal.
Habe eine Doku als PDF auf AVRDUDE - AVR Downloader/UploaDEr gefunden.
Sieht schon mal ganz gut aus.
Das Blink Beispiel auf dem PC in der Arduino IDE geladen, kompiliert, die Blink.ino.hex auf den Raspi kopiert und ab geht die Post:
pi@raspi:/ $ avrdude -C /etc/avrdude.conf -v -p atmega328p -c arduino -P /dev/ttyUSB0 -b 57600 -D -U flash:w:/home/pi/avrdude/Blink.ino.hex:i
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg WunschSystem wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/pi/.avrduderc"
User configuration file does not exist or is not a regular file, skippingUsing Port : /dev/ttyUSB0
Using Programmer : arduino
Overriding Baud Rate : 57600
AVR Part : ATmega328P
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 usavrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "/home/pi/avrdude/Blink.ino.hex"
avrdude: writing flash (928 bytes):Writing | ################################################## | 100% 0.31s
avrdude: 928 bytes of flash written
avrdude: verifying flash memory against /home/pi/avrdude/Blink.ino.hex:
avrdude: load data flash data from input file /home/pi/avrdude/Blink.ino.hex:
avrdude: input file /home/pi/avrdude/Blink.ino.hex contains 928 bytes
avrdude: reading on-chip flash data:Reading | ################################################## | 100% 0.24s
avrdude: verifying ...
avrdude: 928 bytes of flash verifiedavrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK (E:00, H:00, L:00)avrdude done. Thank you.
grins
Arduino Forum: Da werden Sie geholfen!
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.