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

fanhuanji
Posts: 9
Joined: Tue Feb 13, 2018 6:55 am

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

Postby fanhuanji » Sat Apr 15, 2023 2:03 pm

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?

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

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

Postby ESP_Sprite » Mon Apr 17, 2023 1:42 am

On which chip? The ESP32 doesn't have this, later chips (S2/S3, C series) sometimes do.

fanhuanji
Posts: 9
Joined: Tue Feb 13, 2018 6:55 am

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

Postby fanhuanji » Fri Apr 21, 2023 2:40 pm

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.

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

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

Postby ESP_Sprite » 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.)

fanhuanji
Posts: 9
Joined: Tue Feb 13, 2018 6:55 am

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

Postby fanhuanji » Sat Apr 22, 2023 8:18 am

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();
}

Who is online

Users browsing this forum: Basalt, Google [Bot] and 330 guests