Page 1 of 1

Is there a way to trigger download boot mode by software?

Posted: Sat Apr 15, 2023 2:03 pm
by fanhuanji
The only way to switch to download mode I've found was to pull some pin physically during power up.
Is there a method to trigger download mode by app?

Re: Is there a way to trigger download boot mode by software?

Posted: Mon Apr 17, 2023 1:42 am
by ESP_Sprite
On which chip? The ESP32 doesn't have this, later chips (S2/S3, C series) sometimes do.

Re: Is there a way to trigger download boot mode by software?

Posted: Fri Apr 21, 2023 2:40 pm
by fanhuanji
ESP_Sprite wrote:
Mon Apr 17, 2023 1:42 am
On which chip? The ESP32 doesn't have this, later chips (S2/S3, C series) sometimes do.
On ESP32 S3 and C3.
Thanks for reply. Could you give some example please?
Some code snippet will help a lot.

Re: Is there a way to trigger download boot mode by software?

Posted: Sat Apr 22, 2023 3:32 am
by ESP_Sprite
You can try:

Code: Select all

REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
esp_restart();
(Note you probably need to include some headers to make that work, I'll leave that to you.)

Re: Is there a way to trigger download boot mode by software?

Posted: Sat Apr 22, 2023 8:18 am
by fanhuanji
ESP_Sprite wrote:
Sat Apr 22, 2023 3:32 am
You can try:

Code: Select all

REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
esp_restart();
(Note you probably need to include some headers to make that work, I'll leave that to you.)
:D Thanks. It works linke a charm.

Code: Select all

#include "esp_system.h"
#include "soc/rtc_cntl_reg.h"
/**
 * @brief Software triggering download mode for ESP32 S3
 * 
 */
void GoToDownloadMode(void)
{
    REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
    esp_restart();
}