esptool.py in 'C'

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

esptool.py in 'C'

Postby PeterR » Wed Jan 30, 2019 1:44 pm

Does anyone have a port of esptool.py to C/C++?

I have a board with two micros. I have to (customer requirement) allow the ESP to be reprogrammed from the second micro.
I have a TTL serial port available and some spare I/O.
The obvious solution would be to port esptool.py to 'C' and run on the micro. The micro has limited RAM but has SD-CARD mass storage. Hopefully the solution would download from a stream rather than just malloc() & load a 4MB buffer - but I could wrap direct array access if needed.

Another option would be to use another serial bootloader if one is available. But then I would have to create partitions, check that checksums etc have been used and at the end of the day I would have a less secure loader.

I use Ethernet on the ESP and so would appreciate any thought on using RIO0 this way within a production design.
& I also believe that IDF CAN should be fixed.

JeppeB
Posts: 2
Joined: Tue Jan 29, 2019 9:37 pm

Re: esptool.py in 'C'

Postby JeppeB » Wed Jan 30, 2019 2:31 pm

Hi

I have the same problem and just asked in this thread:
https://www.esp32.com/viewtopic.php?t=6493

Hope Kolban have ported the ESPtool :)

Regards

mikemoy
Posts: 626
Joined: Fri Jan 12, 2018 9:10 pm

Re: esptool.py in 'C'

Postby mikemoy » Wed Jan 30, 2019 2:35 pm

I wonder if another way would be to use the uSD card for both your micro & the ESP32.
You could add a IC (there are many) that will switch an input pin from one source to another. So you could have the uSD as the source to this IC, and with one control like from your micro you could switch all uSD card signals from it to the ESP32. Then you micro could signal the ESP32 to read the .bin file and flash itself.

PeterR
Posts: 621
Joined: Mon Jun 04, 2018 2:47 pm

Re: esptool.py in 'C'

Postby PeterR » Wed Jan 30, 2019 4:02 pm

My bad, I was thinking about the data logger.
The program upload mass storage is USB pen (not SD) & USB would not be easy on the ESP.
USB pen is our customer's requirement. I agree that SD would be easier in many ways (as would copying the OTA example) but no dice.

SD would need at least 3 pins and we do not have any spare. We only have RX/TX available these are also used by the modem.
(I can mute the modem at power up BTW).

So I am really looking for a esptool port ideally.
Thanks.

EDIT: PS, it can be a partial port. Happy (& would be better) if any compression and/or conversion to .bin is done during the build process.
& I also believe that IDF CAN should be fixed.

cnlohr
Posts: 65
Joined: Sat Dec 03, 2016 5:39 am

Re: esptool.py in 'C'

Postby cnlohr » Sat Feb 03, 2024 3:06 am

I know I'm necroing a thread, but, because Google refuses to index the real project when you search for this and you get this thread instead, I wanted to post the link to this tool:

https://github.com/cpq/esputil

This is a C version of esptool.py, that has no dependencies and just works on OSX, Linux and Windows.

ESP_Sprite
Posts: 9711
Joined: Thu Nov 26, 2015 4:08 am

Re: esptool.py in 'C'

Postby ESP_Sprite » Sat Feb 03, 2024 8:29 am

You can also use our official C esp-serial-flasher project: https://github.com/espressif/esp-serial-flasher

Who is online

Users browsing this forum: No registered users and 74 guests