-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reboot into UART download mode without external wiring or interaction #7854
Conversation
This PR seems to include a bunch of NONOS binaries, too. Maybe they got pulled in by accident? Can you pull them out of the PR? Also, can you explain why this would be useful? esptool is quite capable of resetting/uploading already w/o extra code in IRAM/etc., so I don't understand the rationale. |
Hello @earlephilhower,
This PR is not adding new binaries. It is only modifying them:
I have changed https://github.com/esp8266/Arduino/blob/master/tools/sdk/lib/fix_sdk_libs.sh and therefore I have applied this modification already to the libraries. This modification is required because no symbol name is set for a function I need to call.
I am interested in building a quite small and chip board which is water proofed. Therefore I do not want to have any additional connectors/wiring to the outside. The only connector attached is a USB plug for power supply. But I am also connecting the UART Tx and Rx line to D+ and D- of the USB plug. Therefore UART is accessible but there is no place for any additional wiring (connected to reset and GPIO2). In the past also others were asking for such a solution: |
ccd5dbe
to
af404b3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation in the PR.
Overall seems like a fine idea and useful in some circumstances, but a little polish would help make it maintainable later on.
af404b3
to
256d87b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the add'l comments and cleanup. LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the cleanup and add'l comments. LGTM!
256d87b
to
b113626
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Regular builds are unmodified according to a quick test when this new API is not used.
without any external wiring. This patch introduces the new method Esp.rebootIntoUartDownloadMode() When the user calls this method the ESP8266 reboots into the UART download mode. In this mode the user can use esptool.py to flash a new firmware file. The following command was used to test it: $ esptool.py --before no_reset --after soft_reset --chip esp8266 \ --port /dev/ttyUSB0 --baud 460800 write_flash 0x0 firmware.bin The implementation is based on the original implementation in the boot ROM. Some parts of the original implementation can be found in [1]. This patch is a squashed and simplified version of [2]. The non squashed version might be helpful in case of debugging issues. [1] https://github.com/twischer/xtensa-subjects/blob/master/reversed/bootrom.c [2] https://github.com/twischer/Arduino/tree/reboot_uart_download_full Signed-off-by: Timo Wischer <twischer@freenet.de>
3ef1772
to
c7efc35
Compare
This patch introduces the new method
Esp.reboot_uart_dwnld()
.With this method the UART download mode can be selected by software only.
When the user calls this method the ESP8266 reboots into the UART
download mode. In this mode the user can use esptool.py to flash a new
firmware file.
This patch was tested with the following command:
The implementation is based on the original implementation in the
boot ROM. Some parts of the original implementation can be found in
https://github.com/twischer/xtensa-subjects/tree/reversed/reversed