diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 600a29e1..15361a6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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' }} @@ -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 }} diff --git a/.gitignore b/.gitignore index c0cc7b1e..eb12f527 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ sdk/ cache/ -user_config.h server-ca.crt sdkconfig sdkconfig.old* @@ -13,6 +12,7 @@ bin version.txt managed_components/ dependencies.lock +.idf_tools_installed #ignore Eclipse project files .cproject diff --git a/components/base_nodemcu/CMakeLists.txt b/components/base_nodemcu/CMakeLists.txt index 4df26aee..e589ccb8 100644 --- a/components/base_nodemcu/CMakeLists.txt +++ b/components/base_nodemcu/CMakeLists.txt @@ -2,6 +2,6 @@ idf_component_register( SRCS "ip_fmt.c" "user_main.c" INCLUDE_DIRS "include" REQUIRES "lua" - PRIV_REQUIRES "driver" "esp_netif" "esp_vfs_console" "nvs_flash" "vfs" + PRIV_REQUIRES "driver" "esp_netif" "esp_vfs_console" "nvs_flash" "vfs" "spiffs" LDFRAGMENTS "nodemcu.lf" ) diff --git a/components/base_nodemcu/user_main.c b/components/base_nodemcu/user_main.c index 13fb86b0..8d335493 100644 --- a/components/base_nodemcu/user_main.c +++ b/components/base_nodemcu/user_main.c @@ -15,6 +15,11 @@ #include "esp_system.h" #include "esp_event.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" diff --git a/components/modules/CMakeLists.txt b/components/modules/CMakeLists.txt index 3249dfc1..85e89739 100644 --- a/components/modules/CMakeLists.txt +++ b/components/modules/CMakeLists.txt @@ -114,6 +114,7 @@ idf_component_register( "esp_http_client" "esp_http_server" "esp_hw_support" + "esp_vfs_console" "fatfs" "libsodium" "lua" diff --git a/components/modules/console.c b/components/modules/console.c index d3b26453..30ff65c2 100644 --- a/components/modules/console.c +++ b/components/modules/console.c @@ -9,6 +9,7 @@ //#include "esp_vfs_cdcacm.h" #include "esp_vfs_usb_serial_jtag.h" #include "driver/usb_serial_jtag.h" +#include "driver/usb_serial_jtag_vfs.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" @@ -111,9 +112,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 @@ -135,20 +136,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 */ diff --git a/sdkconfig.ci.esp32c3 b/sdkconfig.ci.esp32c3 new file mode 100644 index 00000000..61f1cf16 --- /dev/null +++ b/sdkconfig.ci.esp32c3 @@ -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 diff --git a/sdkconfig.ci.esp32s2 b/sdkconfig.ci.esp32s2 new file mode 100644 index 00000000..9d21ad10 --- /dev/null +++ b/sdkconfig.ci.esp32s2 @@ -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 +