Skip to content

Commit

Permalink
Upgrade to IDF 5.3.2 (#3664)
Browse files Browse the repository at this point in the history
* Upgrade IDF to 5.3.1

* Add chip-specific build defaults to CI

To help compile-test the different console options, for starters.

* Update IDF to v5.3.2

Having gone through the changelog from 5.3.1, this looks safe enough...
  • Loading branch information
jmattsson authored Dec 18, 2024
1 parent 7b21778 commit 3dc3dac
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ jobs:
shell: bash
- name: Prepare default sdkconfig
run: |
# Compose sdkconfig manually rather than overwrite checked in files
cp sdkconfig.defaults sdkconfig
[ -e "sdkconfig.defaults.${{ matrix.target }}" ] && cat "sdkconfig.defaults.${{ matrix.target }}" >> sdkconfig || true
[ -e "sdkconfig.ci.${{ matrix.target }}" ] && cat "sdkconfig.ci.${{ matrix.target }}" >> sdkconfig || true
shell: bash
- name: Update config for Lua 5.1
if: ${{ matrix.lua_ver == '5.1' }}
Expand All @@ -54,6 +57,10 @@ jobs:
echo CONFIG_LUA_NUMBER_INT64=y >> sdkconfig
echo CONFIG_LUA_NUMBER_DOUBLE=y >> sdkconfig
shell: bash
- name: Show resulting sdkconfig
shell: bash
run: |
cat sdkconfig
- name: Build firmware
run: |
make IDF_TARGET=${{ matrix.target }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
sdk/
cache/
user_config.h
server-ca.crt
sdkconfig
sdkconfig.old*
Expand All @@ -13,6 +12,7 @@ bin
version.txt
managed_components/
dependencies.lock
.idf_tools_installed

#ignore Eclipse project files
.cproject
Expand Down
2 changes: 1 addition & 1 deletion components/base_nodemcu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ idf_component_register(
SRCS "ip_fmt.c" "user_main.c"
INCLUDE_DIRS "include"
REQUIRES "lua"
PRIV_REQUIRES "nvs_flash" "spiffs" "esp_netif" "driver" "vfs"
PRIV_REQUIRES "nvs_flash" "spiffs" "esp_netif" "driver" "vfs" "esp_vfs_console"
LDFRAGMENTS "nodemcu.lf"
)
5 changes: 5 additions & 0 deletions components/base_nodemcu/user_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
#include "esp_event.h"
#include "esp_spiffs.h"
#include "esp_netif.h"
#include "esp_vfs_dev.h"
#include "esp_vfs_cdcacm.h"
#include "esp_vfs_usb_serial_jtag.h"
#include "driver/uart_vfs.h"
#include "driver/usb_serial_jtag.h"
#include "nvs_flash.h"

#include "task/task.h"
Expand Down
1 change: 1 addition & 0 deletions components/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ idf_component_register(
"esp_http_client"
"esp_http_server"
"esp_hw_support"
"esp_vfs_console"
"fatfs"
"libsodium"
"lua"
Expand Down
16 changes: 8 additions & 8 deletions components/modules/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "serial_common.h"
#include "task/task.h"

#include "esp_vfs_dev.h"
#include "esp_vfs_cdcacm.h"
#include "esp_vfs_usb_serial_jtag.h"
#include "driver/uart_vfs.h"
#include "driver/usb_serial_jtag.h"
#include "driver/usb_serial_jtag_vfs.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

Expand Down Expand Up @@ -111,9 +111,9 @@ static void console_init(void)
#if CONFIG_ESP_CONSOLE_UART_DEFAULT || CONFIG_ESP_CONSOLE_UART_CUSTOM
/* Based on console/advanced example */

esp_vfs_dev_uart_port_set_rx_line_endings(
uart_vfs_dev_port_set_rx_line_endings(
CONFIG_ESP_CONSOLE_UART_NUM, RX_LINE_ENDINGS_CFG);
esp_vfs_dev_uart_port_set_tx_line_endings(
uart_vfs_dev_port_set_tx_line_endings(
CONFIG_ESP_CONSOLE_UART_NUM, TX_LINE_ENDINGS_CFG);

/* Configure UART. Note that REF_TICK is used so that the baud rate remains
Expand All @@ -135,20 +135,20 @@ static void console_init(void)
uart_param_config(CONFIG_ESP_CONSOLE_UART_NUM, &uart_config);

/* Tell VFS to use UART driver */
esp_vfs_dev_uart_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);
uart_vfs_dev_use_driver(CONFIG_ESP_CONSOLE_UART_NUM);

#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
/* Based on @pjsg's work */

esp_vfs_dev_usb_serial_jtag_set_rx_line_endings(RX_LINE_ENDINGS_CFG);
esp_vfs_dev_usb_serial_jtag_set_tx_line_endings(TX_LINE_ENDINGS_CFG);
usb_serial_jtag_vfs_set_rx_line_endings(RX_LINE_ENDINGS_CFG);
usb_serial_jtag_vfs_set_tx_line_endings(TX_LINE_ENDINGS_CFG);

usb_serial_jtag_driver_config_t usb_serial_jtag_config =
USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT();
/* Install USB-SERIAL-JTAG driver for interrupt-driven reads and write */
usb_serial_jtag_driver_install(&usb_serial_jtag_config);

esp_vfs_usb_serial_jtag_use_driver();
usb_serial_jtag_vfs_use_driver();
#elif CONFIG_ESP_CONSOLE_USB_CDC
/* Based on console/advanced_usb_cdc */

Expand Down
4 changes: 2 additions & 2 deletions components/modules/eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ static int leth_init( lua_State *L )

eth_esp32_emac_config_t emac_cfg = ETH_ESP32_EMAC_DEFAULT_CONFIG();

emac_cfg.smi_mdc_gpio_num =
emac_cfg.smi_gpio.mdc_num =
opt_checkint_range( L, "mdc", -1, GPIO_NUM_0, GPIO_NUM_MAX-1 );
emac_cfg.smi_mdio_gpio_num =
emac_cfg.smi_gpio.mdio_num =
opt_checkint_range( L, "mdio", -1, GPIO_NUM_0, GPIO_NUM_MAX-1 );

eth_mac_config_t mac_cfg = ETH_MAC_DEFAULT_CONFIG();
Expand Down
7 changes: 5 additions & 2 deletions components/modules/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static int node_bootreason( lua_State *L)
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32C6)
case SDIO_RESET:
#endif
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32H2)
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3)
case GLITCH_RTC_RESET:
#endif
#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
Expand All @@ -122,6 +122,9 @@ static int node_bootreason( lua_State *L)
#if defined(CONFIG_IDF_TARGET_ESP32C6)
case JTAG_RESET:
#endif
#if defined(CONFIG_IDF_TARGET_ESP32H2)
case JTAG_CPU_RESET:
#endif
#if defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32H2)
case USB_UART_CHIP_RESET:
case USB_JTAG_CHIP_RESET:
Expand All @@ -131,7 +134,7 @@ static int node_bootreason( lua_State *L)
#endif
case TG0WDT_SYS_RESET:
case TG1WDT_SYS_RESET:
#if !defined(CONFIG_IDF_TARGET_ESP32C6)
#if !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2)
case INTRUSION_RESET:
#endif
case RTCWDT_BROWN_OUT_RESET:
Expand Down
1 change: 1 addition & 0 deletions components/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ menu "NodeMCU platform config"
bool
default y if IDF_TARGET_ESP32
default y if IDF_TARGET_ESP32S3
default y if IDF_TARGET_ESP32C6

config NODEMCU_UART_DRIVER_BUF_SIZE_RX0
int "RX buffer size for UART0"
Expand Down
2 changes: 1 addition & 1 deletion components/platform/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ uint32_t platform_uart_setup( unsigned id, uint32_t baud, int databits, int pari
uart_config_t cfg = {
.baud_rate = baud,
.flow_ctrl = flow_control,
.rx_flow_ctrl_thresh = UART_FIFO_LEN - 16,
.rx_flow_ctrl_thresh = UART_HW_FIFO_LEN(id) - 16,
.source_clk = UART_SCLK_DEFAULT,
};

Expand Down
2 changes: 1 addition & 1 deletion sdk/esp32-esp-idf
Submodule esp32-esp-idf updated 10434 files
7 changes: 7 additions & 0 deletions sdkconfig.ci.esp32c3
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y
# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y
# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
# CONFIG_ESP_CONSOLE_NONE is not set
CONFIG_ESP_CONSOLE_SECONDARY_NONE=y
CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y
6 changes: 6 additions & 0 deletions sdkconfig.ci.esp32s2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CONFIG_ESP_CONSOLE_UART_DEFAULT is not set
CONFIG_ESP_CONSOLE_USB_CDC=y
# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set
# CONFIG_ESP_CONSOLE_NONE is not set
CONFIG_ESP_CONSOLE_USB_CDC_RX_BUF_SIZE=512

0 comments on commit 3dc3dac

Please sign in to comment.