From 1870aa8cdb79869f50f19b4a75b1948362fc78be Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Thu, 19 Jun 2025 23:21:24 +0200 Subject: [PATCH] V5.5 arduino settings --- .github/workflows/push.yml | 2 +- configs/builds.json | 44 ++++++++----- configs/defconfig.esp32 | 9 +-- configs/defconfig.esp32c2 | 1 + configs/defconfig.esp32c3 | 2 + configs/defconfig.esp32c5 | 65 +++++++++++++++++++ configs/defconfig.esp32h2 | 2 + configs/defconfig.esp32s2 | 10 +-- configs/defconfig.esp32s3 | 2 + patches/lwip_max_tcp_pcb.diff | 118 ---------------------------------- tools/config.sh | 4 +- tools/copy-libs.sh | 6 +- tools/install-esp-idf.sh | 7 +- 13 files changed, 116 insertions(+), 156 deletions(-) create mode 100644 configs/defconfig.esp32c5 delete mode 100644 patches/lwip_max_tcp_pcb.diff diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 6fc2c1c0d..01b553051 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,4 +1,4 @@ -name: IDF v5.4 +name: IDF v5.5 on: workflow_dispatch: # Manually start a workflow diff --git a/configs/builds.json b/configs/builds.json index 026c8d23b..c0c1358cd 100644 --- a/configs/builds.json +++ b/configs/builds.json @@ -4,7 +4,7 @@ "file":"libspi_flash.a", "src":"build/esp-idf/spi_flash/libspi_flash.a", "out":"lib/libspi_flash.a", - "targets":["esp32","esp32c2","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2","esp32p4"] + "targets":["esp32","esp32c2","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2","esp32p4","esp32c5"] }, { "file":"libesp_psram.a", @@ -50,6 +50,34 @@ } ], "targets":[ + { + "target": "esp32c5", + "features":["qio_ram"], + "idf_libs":["qio","80m"], + "bootloaders":[ + ["qio","80m"], + ["dio","80m"], + ["qio","40m"], + ["dio","40m"] + ], + "mem_variants":[ + ["dio","80m"] + ] + }, + { + "target": "esp32p4", + "features":["qio_ram"], + "idf_libs":["qio","80m"], + "bootloaders":[ + ["qio","80m"], + ["dio","80m"], + ["qio","40m"], + ["dio","40m"] + ], + "mem_variants":[ + ["dio","80m"] + ] + }, { "target": "esp32c2", "features":[], @@ -92,20 +120,6 @@ ["dio","80m"] ] }, - { - "target": "esp32p4", - "features":["qio_ram"], - "idf_libs":["qio","80m"], - "bootloaders":[ - ["qio","80m"], - ["dio","80m"], - ["qio","40m"], - ["dio","40m"] - ], - "mem_variants":[ - ["dio","80m"] - ] - }, { "target": "esp32c3", "features":[], diff --git a/configs/defconfig.esp32 b/configs/defconfig.esp32 index ccd403ef6..8d68cb2ec 100644 --- a/configs/defconfig.esp32 +++ b/configs/defconfig.esp32 @@ -31,17 +31,12 @@ CONFIG_ETH_USE_ESP32_EMAC=y CONFIG_ETH_PHY_INTERFACE_RMII=y CONFIG_ETH_USE_SPI_ETHERNET=y -CONFIG_SPIRAM=y CONFIG_SPIRAM_OCCUPY_HSPI_HOST=y + # CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 is not set -# CONFIG_UNITY_ENABLE_FLOAT is not set -# CONFIG_UNITY_ENABLE_DOUBLE is not set -# CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER is not set # CONFIG_USE_WAKENET is not set # CONFIG_USE_MULTINET is not set -# CONFIG_VFS_SUPPORT_SELECT is not set -# CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT is not set -# CONFIG_VFS_SUPPORT_TERMIOS is not set + CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=y CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=y CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=y diff --git a/configs/defconfig.esp32c2 b/configs/defconfig.esp32c2 index 9357c8008..1dbc4941f 100644 --- a/configs/defconfig.esp32c2 +++ b/configs/defconfig.esp32c2 @@ -2,6 +2,7 @@ CONFIG_XTAL_FREQ_26=y CONFIG_XTAL_FREQ=26 CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB=y +CONFIG_NEWLIB_NANO_FORMAT=y # # Bluetooth diff --git a/configs/defconfig.esp32c3 b/configs/defconfig.esp32c3 index 304af275e..701c0b72d 100644 --- a/configs/defconfig.esp32c3 +++ b/configs/defconfig.esp32c3 @@ -1,3 +1,5 @@ +CONFIG_NEWLIB_NANO_FORMAT=y + # # Bluetooth # diff --git a/configs/defconfig.esp32c5 b/configs/defconfig.esp32c5 new file mode 100644 index 000000000..2884b0d13 --- /dev/null +++ b/configs/defconfig.esp32c5 @@ -0,0 +1,65 @@ +CONFIG_XTAL_FREQ_AUTO=y +CONFIG_XTAL_FREQ=0 +CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_SPIRAM=y + +CONFIG_NEWLIB_NANO_FORMAT=y + +# +# Bluetooth +# +CONFIG_BT_ENABLED=y +CONFIG_BT_STACK_NO_LOG=y +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BLE_MESH is not set +CONFIG_BT_NIMBLE_ENABLED=y +CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y +CONFIG_BT_NIMBLE_MAX_CONNECTIONS=2 +# CONFIG_BT_NIMBLE_NVS_PERSIST is not set +# CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS is not set +# CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY is not set +# CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY is not set +# CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT is not set + +CONFIG_BT_CTRL_MODEM_SLEEP=y +CONFIG_BT_CTRL_MODEM_SLEEP_MODE_1=y +CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL=y +# CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE=y +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE=y +CONFIG_RTC_CLK_CAL_CYCLES=576 +# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304 + +# This Enables RISCV LP - but it can't be used within Arduino at this time. +#CONFIG_ULP_COPROC_ENABLED=y +#CONFIG_ULP_COPROC_LP_CORE=y +#CONFIG_ULP_COPROC_RESERVE_MEM=4096 + +# +# Zigbee +# +CONFIG_ZB_ENABLED=y +CONFIG_ZB_ZED=y +CONFIG_ZB_RADIO_NATIVE=y +# end of Zigbee diff --git a/configs/defconfig.esp32h2 b/configs/defconfig.esp32h2 index bd5412692..5cd92e6bf 100644 --- a/configs/defconfig.esp32h2 +++ b/configs/defconfig.esp32h2 @@ -1,3 +1,5 @@ +CONFIG_NEWLIB_NANO_FORMAT=y + # # Bluetooth # diff --git a/configs/defconfig.esp32s2 b/configs/defconfig.esp32s2 index f3fca9b8f..274a7c46a 100644 --- a/configs/defconfig.esp32s2 +++ b/configs/defconfig.esp32s2 @@ -1,3 +1,5 @@ +CONFIG_NEWLIB_NANO_FORMAT=y + CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_SPIRAM=y CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y @@ -10,14 +12,6 @@ CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=4096 # CONFIG_USE_MULTINET is not set CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=n -# CONFIG_UNITY_ENABLE_FLOAT is not set -# CONFIG_UNITY_ENABLE_DOUBLE is not set -# CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER is not set -# CONFIG_USE_WAKENET is not set -# CONFIG_USE_MULTINET is not set -# CONFIG_VFS_SUPPORT_SELECT is not set -# CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT is not set -# CONFIG_VFS_SUPPORT_TERMIOS is not set # # PPP diff --git a/configs/defconfig.esp32s3 b/configs/defconfig.esp32s3 index 884c26f21..646b6ca1b 100644 --- a/configs/defconfig.esp32s3 +++ b/configs/defconfig.esp32s3 @@ -1,5 +1,7 @@ # CONFIG_IDF_EXPERIMENTAL_FEATURES=y +CONFIG_NEWLIB_NANO_FORMAT=y + CONFIG_ULP_COPROC_ENABLED=y CONFIG_ULP_COPROC_TYPE_RISCV=y CONFIG_ULP_COPROC_RESERVE_MEM=4096 diff --git a/patches/lwip_max_tcp_pcb.diff b/patches/lwip_max_tcp_pcb.diff deleted file mode 100644 index 6b9e73cb6..000000000 --- a/patches/lwip_max_tcp_pcb.diff +++ /dev/null @@ -1,118 +0,0 @@ -diff --git a/components/lwip/lwip/src/core/memp.c b/components/lwip/lwip/src/core/memp.c -index 352ce5a55127a658b6b3c9d8541298c42df332ff..39433cf476b3456b046e337e9b1f016299964a84 100644 ---- a/components/lwip/lwip/src/core/memp.c -+++ b/components/lwip/lwip/src/core/memp.c -@@ -240,6 +240,10 @@ memp_init(void) - #endif /* MEMP_OVERFLOW_CHECK >= 2 */ - } - -+#if MEMP_MEM_MALLOC && ESP_LWIP && LWIP_TCP -+static u32_t num_tcp_pcb = 0; -+#endif -+ - static void * - #if !MEMP_OVERFLOW_CHECK - do_memp_malloc_pool(const struct memp_desc *desc) -@@ -251,6 +255,16 @@ do_memp_malloc_pool_fn(const struct memp_desc *desc, const char *file, const int - SYS_ARCH_DECL_PROTECT(old_level); - - #if MEMP_MEM_MALLOC -+#if ESP_LWIP -+#if LWIP_TCP -+ if(desc == memp_pools[MEMP_TCP_PCB]){ -+ if(num_tcp_pcb >= MEMP_NUM_TCP_PCB){ -+ return NULL; -+ } -+ } -+#endif -+#endif -+ - memp = (struct memp *)mem_malloc(MEMP_SIZE + MEMP_ALIGN_SIZE(desc->size)); - SYS_ARCH_PROTECT(old_level); - #else /* MEMP_MEM_MALLOC */ -@@ -260,6 +274,12 @@ do_memp_malloc_pool_fn(const struct memp_desc *desc, const char *file, const int - #endif /* MEMP_MEM_MALLOC */ - - if (memp != NULL) { -+#if MEMP_MEM_MALLOC && ESP_LWIP && LWIP_TCP -+ if (desc == memp_pools[MEMP_TCP_PCB]) { -+ num_tcp_pcb++; -+ } -+#endif -+ - #if !MEMP_MEM_MALLOC - #if MEMP_OVERFLOW_CHECK == 1 - memp_overflow_check_element(memp, desc); -@@ -369,6 +389,12 @@ do_memp_free_pool(const struct memp_desc *desc, void *mem) - - SYS_ARCH_PROTECT(old_level); - -+#if MEMP_MEM_MALLOC && ESP_LWIP && LWIP_TCP -+ if (desc == memp_pools[MEMP_TCP_PCB]) { -+ num_tcp_pcb--; -+ } -+#endif -+ - #if MEMP_OVERFLOW_CHECK == 1 - memp_overflow_check_element(memp, desc); - #endif /* MEMP_OVERFLOW_CHECK */ -diff --git a/components/lwip/lwip/src/core/tcp.c b/components/lwip/lwip/src/core/tcp.c -index 3fbdd89ae07807208ff7466abb50f90b5e7727e4..fe6baaf250927cb4b89f8d1dbd41c73def88692b 100644 ---- a/components/lwip/lwip/src/core/tcp.c -+++ b/components/lwip/lwip/src/core/tcp.c -@@ -1765,7 +1765,9 @@ tcp_kill_state(enum tcp_state state) - struct tcp_pcb *pcb, *inactive; - u32_t inactivity; - -+#if !ESP_LWIP - LWIP_ASSERT("invalid state", (state == CLOSING) || (state == LAST_ACK)); -+#endif - - inactivity = 0; - inactive = NULL; -@@ -1870,17 +1872,41 @@ tcp_alloc(u8_t prio) - tcp_kill_state(CLOSING); - /* Try to allocate a tcp_pcb again. */ - pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); -+#if ESP_LWIP - if (pcb == NULL) { -- /* Try killing oldest active connection with lower priority than the new one. */ -- LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing oldest connection with prio lower than %d\n", prio)); -- tcp_kill_prio(prio); -- /* Try to allocate a tcp_pcb again. */ -+ /* Try killing oldest connection in FIN_WAIT_2. */ -+ LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest FIN_WAIT_2 connection\n")); -+ tcp_kill_state(FIN_WAIT_2); - pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); -+ if (pcb == NULL) { -+ /* Try killing oldest connection in FIN_WAIT_1. */ -+ LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing off oldest FIN_WAIT_1 connection\n")); -+ tcp_kill_state(FIN_WAIT_1); -+ pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); -+#endif -+ if (pcb == NULL) { -+ /* Try killing oldest active connection with lower priority than the new one. */ -+ LWIP_DEBUGF(TCP_DEBUG, ("tcp_alloc: killing oldest connection with prio lower than %d\n", prio)); -+ tcp_kill_prio(prio); -+ /* Try to allocate a tcp_pcb again. */ -+ pcb = (struct tcp_pcb *)memp_malloc(MEMP_TCP_PCB); -+ if (pcb != NULL) { -+ /* adjust err stats: memp_malloc failed multiple times before */ -+ MEMP_STATS_DEC(err, MEMP_TCP_PCB); -+ } -+ } -+#if ESP_LWIP -+ if (pcb != NULL) { -+ /* adjust err stats: memp_malloc failed multiple times before */ -+ MEMP_STATS_DEC(err, MEMP_TCP_PCB); -+ } -+ } - if (pcb != NULL) { - /* adjust err stats: memp_malloc failed multiple times before */ - MEMP_STATS_DEC(err, MEMP_TCP_PCB); - } - } -+#endif - if (pcb != NULL) { - /* adjust err stats: memp_malloc failed multiple times before */ - MEMP_STATS_DEC(err, MEMP_TCP_PCB); diff --git a/tools/config.sh b/tools/config.sh index 747689ae0..2baef8210 100755 --- a/tools/config.sh +++ b/tools/config.sh @@ -6,12 +6,12 @@ if [ -z $IDF_PATH ]; then fi if [ -z $IDF_BRANCH ]; then - export IDF_BRANCH="release/v5.4" + export IDF_BRANCH="release/v5.5" fi # Arduino branch to use if [ -z $AR_BRANCH ]; then - AR_BRANCH="main" + AR_BRANCH="release/v3.3.x" fi if [ -z $IDF_TARGET ]; then diff --git a/tools/copy-libs.sh b/tools/copy-libs.sh index f604ec54b..c2c82821e 100755 --- a/tools/copy-libs.sh +++ b/tools/copy-libs.sh @@ -75,6 +75,7 @@ LD_SCRIPT_DIRS="" PIO_CC_FLAGS="-flto=auto " PIO_C_FLAGS="-flto=auto " PIO_CXX_FLAGS="-flto=auto " +# PIO_CXX_FLAGS="-flto=auto -std=gnu++2a " PIO_AS_FLAGS="" PIO_LD_FLAGS="-flto " PIO_LD_FUNCS="" @@ -126,7 +127,7 @@ for item in "${@:2:${#@}-5}"; do DEFINES+="$item " fi elif [ "$prefix" = "-O" ]; then - PIO_CC_FLAGS+="$item " + PIO_CC_FLAGS+="$item " elif [[ "$item" != "-Wall" && "$item" != "-Werror=all" && "$item" != "-Wextra" ]]; then if [[ "${item:0:23}" != "-mfix-esp32-psram-cache" && "${item:0:18}" != "-fmacro-prefix-map" && "${item:0:20}" != "-fdiagnostics-color=" && "${item:0:19}" != "-fdebug-prefix-map=" && "${item:0:8}" != "-fno-lto" ]]; then C_FLAGS+="$item " @@ -312,6 +313,9 @@ for item; do fi done +# Remove -std=gnu++2b from PIO_CXX_FLAGS +# PIO_CXX_FLAGS="${PIO_CXX_FLAGS/-std=gnu++2b/}" + # # END OF DATA EXTRACTION FROM CMAKE # diff --git a/tools/install-esp-idf.sh b/tools/install-esp-idf.sh index ca0c46660..49dfa4e23 100755 --- a/tools/install-esp-idf.sh +++ b/tools/install-esp-idf.sh @@ -81,10 +81,9 @@ if [ ! -x $idf_was_installed ] || [ ! -x $commit_predefined ]; then # 1) Temporarily patch the ESP32-S2 I2C LL driver to keep the clock source # 2) Temporarily fix for mmu map and late init of psram https://github.com/espressif/arduino-esp32/issues/9936 - cd $IDF_PATH - patch -p1 -N -i $AR_PATCHES/esp32s2_i2c_ll_master_init.diff - patch -p1 -N -i $AR_PATCHES/lwip_max_tcp_pcb.diff - cd - + #cd $IDF_PATH + #patch -p1 -N -i $AR_PATCHES/esp32s2_i2c_ll_master_init.diff + #cd - # Get the exact IDF version from file "version.txt" cd $IDF_PATH