ESP32-S3 rebooting to DFU
ESP32-S3 rebooting to DFU
Using the default bootloader, is it possible to reboot to DFU?
The case is that I need to have the option of invoking the DFU mode without having to press any buttons.
The case is that I need to have the option of invoking the DFU mode without having to press any buttons.
Re: ESP32-S3 rebooting to DFU
From what I can understand, the docs say that bootloader mode can only be entered via the button press combination. So I can either use TinyUF2, which supports that mode, or use external circuit to force the boot pin low - is that correct?
Re: ESP32-S3 rebooting to DFU
In theory you should be able to install tinyusb with DFU interface to do it without buttons, but i didnt test it with S3 yet (on S2 it worked).
In addition to the docs from my previous post, you have to burn efuse USB_PHY_SEL to make it works with buttons.
On S3 DFU is not that user friendly as on S2, but we have JTAG over USB enabled by default.
In addition to the docs from my previous post, you have to burn efuse USB_PHY_SEL to make it works with buttons.
On S3 DFU is not that user friendly as on S2, but we have JTAG over USB enabled by default.
Re: ESP32-S3 rebooting to DFU
I've compiled tinyuf2 for my board, flashed it and the board appears as a storage drive.
Now I'm trying to build and flash a simple blinky app, using the partition table provided by tinyuf2, `and idf.py app-flash`. There are some things which are not clear to me:
- tinyuf2 exposes the board as a storage device, hence idf.py can't find it (it's not a serial port)
- I can force the board in bootloader mode using reset and GPIO0 combination, and then flash a Blinky app using `idf.py app-flash`, however that seems to erase tinyuf2
I need to be able to use idf.py for uploading code - is that possible? Also, the storage functionality is not needed - can it be removed?
Now I'm trying to build and flash a simple blinky app, using the partition table provided by tinyuf2, `and idf.py app-flash`. There are some things which are not clear to me:
- tinyuf2 exposes the board as a storage device, hence idf.py can't find it (it's not a serial port)
- I can force the board in bootloader mode using reset and GPIO0 combination, and then flash a Blinky app using `idf.py app-flash`, however that seems to erase tinyuf2
I need to be able to use idf.py for uploading code - is that possible? Also, the storage functionality is not needed - can it be removed?
Re: ESP32-S3 rebooting to DFU
As you already know tinyuf2 is not what you want.
Read more about adafruit implementation :
https://github.com/adafruit/tinyuf2#features
You can use it, but you have to embed it in every firmware you want to flash that way.
My suggestion was to use DFU, which is not the same as tinyuf2 (its not easy, since espressif does not provide implementation for it in tinyusb component). Same situation, it has to be embed in every firmware.
Probably it will be easier to just use idf.py. On board with CP210x it does not require to use buttons and when you want to use native USB pins, well, you will need reset and boot buttons.
Read more about adafruit implementation :
https://github.com/adafruit/tinyuf2#features
You can use it, but you have to embed it in every firmware you want to flash that way.
My suggestion was to use DFU, which is not the same as tinyuf2 (its not easy, since espressif does not provide implementation for it in tinyusb component). Same situation, it has to be embed in every firmware.
Probably it will be easier to just use idf.py. On board with CP210x it does not require to use buttons and when you want to use native USB pins, well, you will need reset and boot buttons.
Re: ESP32-S3 rebooting to DFU
You're right, I am back into looking for a way to reboot to bootloader from application, as I don't have any buttons exposed. Probably an one-shot timer could do the job - it would keep GPIO0 low for a period of time, starting from before issuing `esp_restart()` from the application.
The period can be made long enough to ensure the chip has started.
The above will not work if `esp-restart()` is not equivalent to pressing the reset button.
The period can be made long enough to ensure the chip has started.
The above will not work if `esp-restart()` is not equivalent to pressing the reset button.
Re: ESP32-S3 rebooting to DFU
Its not going to work, because level of GPIO0 wont survive the reset. Another thing is that timer state is reset on reboot.
As far as i remember adafruit is using external RC elements to make it works with tinyuf2, but i cant help much in this matter.
As far as i remember adafruit is using external RC elements to make it works with tinyuf2, but i cant help much in this matter.
Re: ESP32-S3 rebooting to DFU
Sorry, I didn't explain clear what I was thinking of doing.
When I need to reboot to DFU, I will use a GPIO (not GPIO0) to trigger an external circuit, which will then pull GPIO0 down for a period of time (not sure how long yet). After triggering, I'll issue an `esp_restart()`, and the chip wil reset, then come out of reset with GPIO0 still being pulled low. The circuit can be as simple as a diode, capacitor and N-channel MOSFET.
I'll give it a try and post the results.
When I need to reboot to DFU, I will use a GPIO (not GPIO0) to trigger an external circuit, which will then pull GPIO0 down for a period of time (not sure how long yet). After triggering, I'll issue an `esp_restart()`, and the chip wil reset, then come out of reset with GPIO0 still being pulled low. The circuit can be as simple as a diode, capacitor and N-channel MOSFET.
I'll give it a try and post the results.
-
- Posts: 9739
- Joined: Thu Nov 26, 2015 4:08 am
Re: ESP32-S3 rebooting to DFU
Note that the S2 and S3 actually have a bit to specifically reset into download mode - it's used for the ROM CDC driver in ESP-IDF. If you select 'cdc-acm' as a console, I think it does this by default. If you need to do this yourself, look here. Note that you do need to burn a fuse on the S3 to use the USB-OTG peripheral (and not USB-serial-JTAG) when in download mode to support DFU.
Who is online
Users browsing this forum: Bing [Bot] and 98 guests