From a37b9efc902a5951b748dd5c7fc509b6ceeae425 Mon Sep 17 00:00:00 2001 From: JiangGuangMing Date: Fri, 5 Jun 2026 15:59:04 +0800 Subject: [PATCH] feat: support esp32s31 dfu feature --- components/soc/esp32s31/include/soc/Kconfig.soc_caps.in | 4 ++++ components/soc/esp32s31/include/soc/soc_caps.h | 1 + tools/cmake/dfu.cmake | 4 ++-- tools/cmakev2/dfu.cmake | 2 ++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in index 023070cf68a..8f5a78dfdf7 100644 --- a/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in +++ b/components/soc/esp32s31/include/soc/Kconfig.soc_caps.in @@ -107,6 +107,10 @@ config SOC_USB_OTG_SUPPORTED bool default y +config SOC_USB_DFU_SUPPORTED + bool + default y + config SOC_TEMP_SENSOR_SUPPORTED bool default y diff --git a/components/soc/esp32s31/include/soc/soc_caps.h b/components/soc/esp32s31/include/soc/soc_caps.h index f0549b97bc7..41fcf330ffc 100644 --- a/components/soc/esp32s31/include/soc/soc_caps.h +++ b/components/soc/esp32s31/include/soc/soc_caps.h @@ -49,6 +49,7 @@ #define SOC_PARLIO_LCD_SUPPORTED 1 #define SOC_ASYNC_MEMCPY_SUPPORTED 1 #define SOC_USB_OTG_SUPPORTED 1 +#define SOC_USB_DFU_SUPPORTED 1 #define SOC_TEMP_SENSOR_SUPPORTED 1 #define SOC_USB_SERIAL_JTAG_SUPPORTED 1 // #define SOC_SUPPORTS_SECURE_DL_MODE 1 // TODO: [ESP32S31] IDF-14629 diff --git a/tools/cmake/dfu.cmake b/tools/cmake/dfu.cmake index 68dfa5f3210..fcafeb7930b 100644 --- a/tools/cmake/dfu.cmake +++ b/tools/cmake/dfu.cmake @@ -25,10 +25,10 @@ function(__add_dfu_targets) return() elseif("${target}" STREQUAL "esp32h4") return() - elseif("${target}" STREQUAL "esp32s31") - return() elseif("${target}" STREQUAL "esp32p4") set(dfu_pid "12") + elseif("${target}" STREQUAL "esp32s31") + set(dfu_pid "20") elseif("${target}" STREQUAL "linux") return() else() diff --git a/tools/cmakev2/dfu.cmake b/tools/cmakev2/dfu.cmake index c1dc96a1065..7b1d116b8b2 100644 --- a/tools/cmakev2/dfu.cmake +++ b/tools/cmakev2/dfu.cmake @@ -65,6 +65,8 @@ function(idf_create_dfu binary) set(dfu_pid "9") elseif("${target}" STREQUAL "esp32p4") set(dfu_pid "12") + elseif("${target}" STREQUAL "esp32s31") + set(dfu_pid "20") else() # DFU not supported on this target idf_msg("DFU not supported on ${target}, skipping DFU target creation")