Flash through host and Esptool
Flash through host and Esptool
Hi ,
The scenario is to download ESP fw through some medium to host and flash through it but not seeing any custom implementation.
Also ,if somebody has tried this approach and any issues associated with the same?
Esptool as python script might not be used as some platforms might not support it.
Also , is there C/C++/C# port of the tool (even just flashing part) ?
Thanks in advance.
rgds,
Shar_tkt
The scenario is to download ESP fw through some medium to host and flash through it but not seeing any custom implementation.
Also ,if somebody has tried this approach and any issues associated with the same?
Esptool as python script might not be used as some platforms might not support it.
Also , is there C/C++/C# port of the tool (even just flashing part) ?
Thanks in advance.
rgds,
Shar_tkt
Re: Flash through host and Esptool
One idea would be to write a REST server that handles POST requests. The firmware could then be posted to that REST server which writes the image as a temporary file and then invoked esptool.py via a "System" like call and finally deletes the file. For a task like this that one wanted done quickly, I'd probably suggest using Node.js. Alternatives might include Servlets (Tomcat).
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Flash through host and Esptool
Why not update OTA?
Re: Flash through host and Esptool
Thanks both,
@kolban : I was specifically looking for c# as Compact Framework does not support any form of python.
@f.h-f.s.: The requirement is non-ota method as fail-safe method if esp has issues with connection to router or vice-versa.
This is in accordance with existing solution for other flashing devices.
@kolban : I was specifically looking for c# as Compact Framework does not support any form of python.
@f.h-f.s.: The requirement is non-ota method as fail-safe method if esp has issues with connection to router or vice-versa.
This is in accordance with existing solution for other flashing devices.
Re: Flash through host and Esptool
Does the host pc have wifi?
You could put your ESP32 into AP mode and connect with host, then OTA.
**EDIT** also you can create pre-compiled binaries of esptool viewtopic.php?t=1029
You could put your ESP32 into AP mode and connect with host, then OTA.
**EDIT** also you can create pre-compiled binaries of esptool viewtopic.php?t=1029
Re: Flash through host and Esptool
Sorry it need to flash from host silicon to which ESP is exposed as module via ftdi as COM port.
Re: Flash through host and Esptool
You could use ymodem protocol to transfer the new firmware via serial port to ESP32, there are ymodem implementations in C/C++ & C#, for ESP32 implementation look at viewtopic.php?f=18&t=2148shar_tkt wrote:Sorry it need to flash from host silicon to which ESP is exposed as module via ftdi as COM port.
Re: Flash through host and Esptool
esptool-ck (written in C) used to be able to flash ESP32, although I may have removed that support in recent commits seeing that this isn't being used. You may take a look at commit history and grab the version which still has ESP32 flashing support though.
Re: Flash through host and Esptool
Thanks both ,
@ESP_igrr
I took the esp32 support on the esptool-ck repo but seems some issues.
Commit Used:
Commits on Jan 25, 2016
@igrr
Update readme to mention ESP32
edb91368984ee13576667b8b7a865bea9f5035ee
Setup:
Trying as if using esptool.py , connect Wroom-23 to Linux VM , connection seems to be fine with no issue.
Command:
sudo ./esptool -cp /dev/ttyUSB0 -cd ck -cc esp32 -ca 0x10000 -cf esp-at.bin -v 4
Output:
Seems some issue during (FLASH_DOWNLOAD_BEGIN) , no response seen from module and exiting.
Let me know if customization required or if it is known issue (could not find in issue section).
I assume this is C port of esptool.py and has equivalent features of same.
Attaching verbose log.
esptool v0.4.6-9-gedb9136 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting port from /dev/ttyUSB0 to /dev/ttyUSB0
setting board to ck
setting chip to esp32
setting address from 0x00000000 to 0x00010000
espcomm_upload_file
stat esp-at.bin success
opening port /dev/ttyUSB0 at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: didn't receive command response
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x55201207
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_open
Uploading 825696 bytes from esp-at.bin to flash at 0x00010000
erasing flash
size: 0c9960 address: 010000
espcomm_set_flash_params: 0 1000000 10000 1000 100 ffff
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
erase_size: 0c9960
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting timeout 15000
setting character timeout 150
done
setting timeout 1
setting character timeout 1
done
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
closing bootloader
@ESP_igrr
I took the esp32 support on the esptool-ck repo but seems some issues.
Commit Used:
Commits on Jan 25, 2016
@igrr
Update readme to mention ESP32
edb91368984ee13576667b8b7a865bea9f5035ee
Setup:
Trying as if using esptool.py , connect Wroom-23 to Linux VM , connection seems to be fine with no issue.
Command:
sudo ./esptool -cp /dev/ttyUSB0 -cd ck -cc esp32 -ca 0x10000 -cf esp-at.bin -v 4
Output:
Seems some issue during (FLASH_DOWNLOAD_BEGIN) , no response seen from module and exiting.
Let me know if customization required or if it is known issue (could not find in issue section).
I assume this is C port of esptool.py and has equivalent features of same.
Attaching verbose log.
esptool v0.4.6-9-gedb9136 - (c) 2014 Ch. Klippel <ck@atelier-klippel.de>
setting port from /dev/ttyUSB0 to /dev/ttyUSB0
setting board to ck
setting chip to esp32
setting address from 0x00000000 to 0x00010000
espcomm_upload_file
stat esp-at.bin success
opening port /dev/ttyUSB0 at 115200
tcgetattr
tcsetattr
serial open
opening bootloader
resetting board
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: didn't receive command response
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x55201207
trying to connect
setting character timeout 0
done
setting character timeout 1
done
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
espcomm_open
Uploading 825696 bytes from esp-at.bin to flash at 0x00010000
erasing flash
size: 0c9960 address: 010000
espcomm_set_flash_params: 0 1000000 10000 1000 100 ffff
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
espcomm_send_command: receiving 4 bytes of data
espcomm_send_command: received 4 bytes:
0x00
0x00
0x00
0x00
espcomm_send_command: response 0x20120707
erase_size: 0c9960
espcomm_send_command: sending command header
espcomm_send_command: sending command payload
setting timeout 15000
setting character timeout 150
done
setting timeout 1
setting character timeout 1
done
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
closing bootloader
-
- Posts: 1
- Joined: Wed Jun 28, 2017 4:07 pm
Re: Flash through host and Esptool
Hello!
I find myself in a similar situation. I also need an over the wire firmware update solution in C/C++. The reason, also being that the host can only run C/C++. I tried using esptool-ck, but without any luck. The .bin files can be created using the esptool.py, I "just" need a way to flash the .bin files on the esp32 using C/C++. @shar_tkt, any luck in achieving something similar to this?
Thanks for the help!
P.S. It has been really fun playing with the esp32!
I find myself in a similar situation. I also need an over the wire firmware update solution in C/C++. The reason, also being that the host can only run C/C++. I tried using esptool-ck, but without any luck. The .bin files can be created using the esptool.py, I "just" need a way to flash the .bin files on the esp32 using C/C++. @shar_tkt, any luck in achieving something similar to this?
Thanks for the help!
P.S. It has been really fun playing with the esp32!
Who is online
Users browsing this forum: No registered users and 98 guests