Open anklimov opened 4 years ago
best example of flash operations is for any MCU architecture the eeprom emulation library. https://github.com/PhiJu5/DueFlashStorage
details are in the datasheet of the MCU. https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf
InternalStorage.cpp should be enhanced for ARM MCUs
Thank you for direction for investigations I've just added SAM3X8E to Internal storage Currently it was compiled successfully.
UPDATE: Now i'm trying to test it
I've find arduinoOTA tool in Arduino IDE distribution, it becomes at least, starting and connecting to lib after update to recent IDE release
(Other OTA flashing tools ether "ESP oriented" (espota) or didn't understand OTA: the usual DUE flasher "bossac" )
So Arduino IDE itself, even not trying to start arduinoOTA, starting bossac instead.
Have you idea to integrate ArduinoOTA to PlatformIO framework? This might be optimal way to use it across all supported platforms.
for Arduino IDE setup arduinoOTA in platform.local.txt similar to this https://github.com/jandrassy/ArduinoOTA/blob/master/extras/avr/platform.local.txt
Hello I would like to know id @anklimov managed to get it working on Arduino DUE Thanks
@gcharles81 - yes, it working pretty well. PR is not merged here (some cleanup needed, but I still out of time to manage it), but you can try my fork of ArduinoOTA... Also will be good if smbdy find some time to clean & merge DUE OTA to upstream
@anklimov Thanks will use your fork
@anklimov
Hello I am testing your fork and managed to get it working with Arduino IDE & Command line I encountered an issue only with .bin file that has a size of 165kb while it is working fine with a .bin file of 30kb
below is serial output for one successful and one fail upload
Received bytes:30000 Flashing bytes:30000 From:C0000 To:80000 PageSize:256
Failed
Received bytes:130855
@gcharles81 - thanks for testing, but result is little bit unexpected. In my case, lib working against 139680 bytes binary The maximum firmware size is 50% of flash. Did you use SAM3X8E with 512K flash?
@anklimov Thanks its also strange to me Yes I use SAM3X8E
Today I try ti did a bit deeper and modified in WiFiOTA.cpp the sendHttpResponse function and I add there a Serial.println(status) ; So I get a better understanding what is failing
The message I get on the Serial monitor after the fail is Payload size wrong , I have to google a bit maybe I find something
Open flash for write
Received bytes:126759 Payload size wrong
Solved Issue by using Baud rate of 250000 instead of 115200 , now I can upload sucsessfully
@gcharles81 - as far as firmware upload going through LAN connection, not thought serial, that is not looks like root cause of failures. May you share more details?
@anklimov - In my case I am using ESP-01 connected via serial to my Arduino DUE and using WiFiEspAT library that is why was failing with 115200 Baud.
Why it was failing I do not know maybe some sort of timeout. Thanks Charles
@anklimov Your fork works perfectly on Ethernet Shield V1
If you want to upload sketches directly from Arduino IDE place my platform.local.txt to PREFERENCES_FOLDER\packages\arduino\hardware\sam\1.6.12
# This configuration file supports the general ArduinoOTA library https://github.com/jandrassy/ArduinoOTA
## arduinoOTA as programmer. add entries with {ip} into programmers.txt
tools.bossac.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA
tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password password -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b
Any updates on this? Is @anklimov 's fork working for OTA updates from http servers?
@nanitook - my fork have basic logic, derived from @JAndrassy ' s project - sketch act as http server, not client (you need POST firmware to controller using external routine) Only differences of my fork:
sketch act as http server, not client (you need POST firmware to controller using external routine)
I'm talking about something like this. Downloading the new sketch from a remote http server and make the upgrade. If that's not possible, the only way to upgrade using OTA is using the arduino IDE?
Andrey Klimov
8 мая 2022 г., в 22:59, nanitook @.***> написал(а):
sketch act as http server, not client (you need POST firmware to controller using external routine)
I'm talking about something like this. Downloading the new sketch from a remote http server and make the upgrade. If that's not possible, the only way to upgrade using OTA is using the arduino IDE?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.
Hi! Is it possible to extend OTA support for Atmel SAM3X8E ARM Cortex-M3 ? The architecture is quite similar with already supported platforms and from the first look, it should be possible to do, but lays behind my skills I will appreciated for any kind help or advises