Enter download (bootloader) mode from software on ESP32-C3

blanchehermine
Posts: 16
Joined: Wed Mar 22, 2023 8:11 am

Enter download (bootloader) mode from software on ESP32-C3

Postby blanchehermine » Wed Apr 19, 2023 6:01 pm

Hello.

Is there a way to enter bootloader/download mode by calling a certain function in the user app?
For example, I'm aware of a function

Code: Select all

esp_restart()
which will simply reset CPU and it will boot back to the user app.
But what I need is a another function or a piece of code that resets CPU and makes so that it wouldn't jump to the user app and instead would stay in the bootloader.
I searched, but couldn't find any information on that. I tried configuring GPIO9 strapping pin as output, writing 0 to it and calling esp_restart() function, but that didn't work, probably because strapping pins are not sampled after software reset.

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

Re: Enter download (bootloader) mode from software on ESP32-C3

Postby ESP_Sprite » Thu Apr 20, 2023 2:48 am

Probably. Note that this register is normally intended for DWC-OTG use, and as the C3 does not have this, I'm not sure if we tested the functionality there, but you can try the following:

Code: Select all

REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
esp_restart();

blanchehermine
Posts: 16
Joined: Wed Mar 22, 2023 8:11 am

Re: Enter download (bootloader) mode from software on ESP32-C3

Postby blanchehermine » Thu Apr 20, 2023 4:45 am

That worked, thank you.

Who is online

Users browsing this forum: No registered users and 68 guests