mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-01 02:09:57 +00:00
ESP32 native bootloader mode
This commit is contained in:
parent
4c97351187
commit
96a119cdd8
@ -352,7 +352,7 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
}
|
||||
case meshtastic_AdminMessage_enter_dfu_mode_request_tag: {
|
||||
LOG_INFO("Client requesting to enter DFU mode");
|
||||
#if defined(ARCH_NRF52) || defined(ARCH_RP2040)
|
||||
#if defined(ARCH_NRF52) || defined(ARCH_RP2040) || defined(ARDUINO_USB_CDC_ON_BOOT)
|
||||
enterDfuMode();
|
||||
#endif
|
||||
break;
|
||||
@ -1160,4 +1160,4 @@ void disableBluetooth()
|
||||
nrf52Bluetooth->shutdown();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
@ -248,3 +248,12 @@ void cpuDeepSleep(uint32_t msecToWake)
|
||||
esp_sleep_enable_timer_wakeup(msecToWake * 1000ULL); // call expects usecs
|
||||
esp_deep_sleep_start(); // TBD mA sleep current (battery)
|
||||
}
|
||||
|
||||
void enterDfuMode()
|
||||
{
|
||||
#if defined(ARDUINO_USB_CDC_ON_BOOT)
|
||||
// This is a no-op on the ESP32 normally, but on the ESP32-S3/C3 it will reboot to USB/JTAG mode
|
||||
REG_WRITE(RTC_CNTL_OPTION1_REG, RTC_CNTL_FORCE_DOWNLOAD_BOOT);
|
||||
esp_restart();
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user