Hi all,
For a project i need to update the esp32s2 via a usb drive, (data pins connected to pin 19 and 20). For this i need to read a file from the usb drive and use this to update the code of the esp32s2.
I have tried the usb host examples from the esptinyusb library, but all fail to compile. Also the examples look like they have been writing for the espressif ide.
Does anybody have an example for the arduino ide that i can test and modify for the usb (drive) update?
Update esp32s2 via USB drive
Re: Update esp32s2 via USB drive
all USB examples on my Arduino compile ok - check the settings again of your Arduino
Re: Update esp32s2 via USB drive
I can confirm. With arduino-esp32 v2.0.3 host msc example can buid for both, S2 and S3.
Re: Update esp32s2 via USB drive
The msc example works for me to on the arduino-esp32 v2.0.3 after changing all LOGI to printf.
Which variant of the ota did you use for the updating?
I am currently testing with a mixture of the msc and sd_update example from arduino, but the update.h library can't use the fopen. I'll be looking into that later today.
Re: Update esp32s2 via USB drive
Since i dont know ArduinoOTA library and even with arduino i prefer to use esp-idf API whenever i can, i made PoC app with esp-idf ota API.
It is simple code, with no error handling etc, but works good.
It is simple code, with no error handling etc, but works good.
Re: Update esp32s2 via USB drive
I managed to get the code to begin and write the update to the partition, but no matter how i write it or what i do it keeps failing with the validation when calling esp_ota_end();
Anybody who knows what could be wrong? The update.bin file is created in the arduino ide by exporting it as a bin file. Reading the file works without any issue, but updating turned out to be more difficult.
The code i got until now: https://pastebin.com/q7yyES0v
Arduino esp32 v2.0.4
tinyusb v2.0.1
Anybody who knows what could be wrong? The update.bin file is created in the arduino ide by exporting it as a bin file. Reading the file works without any issue, but updating turned out to be more difficult.
The code i got until now: https://pastebin.com/q7yyES0v
Arduino esp32 v2.0.4
tinyusb v2.0.1
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: Update esp32s2 via USB drive
fgets() is used for strings and handles null bytes as the end of those. OTA files are binary; use fread() instead.
Re: Update esp32s2 via USB drive
Yes the code works now, i can update the esp32s2 now. The problem was indeed with fgets().
-
- Posts: 1
- Joined: Wed Jan 11, 2023 3:23 pm
Re: Update esp32s2 via USB drive
The link seems to be out of date. Any chance for an update?
On the same problem now and getting all kinds of strange errors.
ESP32-S3-DevKitC-1 v1.1
Arduino esp32 v2.0.4
Tinyusb v2.0.1
On the same problem now and getting all kinds of strange errors.
ESP32-S3-DevKitC-1 v1.1
Arduino esp32 v2.0.4
Tinyusb v2.0.1
_Rens_ wrote: ↑Wed Jul 13, 2022 2:43 pmI managed to get the code to begin and write the update to the partition, but no matter how i write it or what i do it keeps failing with the validation when calling esp_ota_end();
Anybody who knows what could be wrong? The update.bin file is created in the arduino ide by exporting it as a bin file. Reading the file works without any issue, but updating turned out to be more difficult.
The code i got until now: https://pastebin.com/q7yyES0v
Arduino esp32 v2.0.4
tinyusb v2.0.1
Who is online
Users browsing this forum: Google Feedfetcher and 42 guests