diff --git a/.github/scripts/on-release.sh b/.github/scripts/on-release.sh index 38f58e0b4be..8e594c2ca01 100755 --- a/.github/scripts/on-release.sh +++ b/.github/scripts/on-release.sh @@ -216,7 +216,7 @@ find "$PKG_DIR" -name '*.git*' -type f -delete # Replace tools locations in platform.txt echo "Generating platform.txt..." cat "$GITHUB_WORKSPACE/platform.txt" | \ -sed "s/version=.*/version=$ver$extent/g" | \ +sed "s/version=.*/version=$RELEASE_TAG/g" | \ sed 's/tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf/tools.xtensa-esp32-elf-gcc.path=\{runtime.tools.xtensa-esp32-elf-gcc.path\}/g' | \ sed 's/tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s2-elf/tools.xtensa-esp32s2-elf-gcc.path=\{runtime.tools.xtensa-esp32s2-elf-gcc.path\}/g' | \ sed 's/tools.xtensa-esp32s3-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32s3-elf/tools.xtensa-esp32s3-elf-gcc.path=\{runtime.tools.xtensa-esp32s3-elf-gcc.path\}/g' | \ diff --git a/boards.txt b/boards.txt index 54f16e0195c..1504a0d2f86 100644 --- a/boards.txt +++ b/boards.txt @@ -13579,6 +13579,7 @@ m5stack-cores3.upload.tool.network=esp_ota m5stack-cores3.upload.maximum_size=1310720 m5stack-cores3.upload.maximum_data_size=327680 +m5stack-cores3.upload.speed=921600 m5stack-cores3.upload.flags= m5stack-cores3.upload.extra_flags= m5stack-cores3.upload.use_1200bps_touch=false @@ -13596,21 +13597,20 @@ m5stack-cores3.build.variant=m5stack_cores3 m5stack-cores3.build.board=M5STACK_CORES3 m5stack-cores3.build.usb_mode=1 -m5stack-cores3.build.cdc_on_boot=0 +m5stack-cores3.build.cdc_on_boot=1 m5stack-cores3.build.msc_on_boot=0 m5stack-cores3.build.dfu_on_boot=0 m5stack-cores3.build.f_cpu=240000000L -m5stack-cores3.build.flash_size=4MB +m5stack-cores3.build.flash_size=16MB m5stack-cores3.build.flash_freq=80m m5stack-cores3.build.flash_mode=dio m5stack-cores3.build.boot=qio -m5stack-cores3.build.boot_freq=80m -m5stack-cores3.build.partitions=default -m5stack-cores3.build.defines= -m5stack-cores3.build.loop_core= -m5stack-cores3.build.event_core= +m5stack-cores3.build.partitions=default_16MB +m5stack-cores3.build.defines=-DBOARD_HAS_PSRAM m5stack-cores3.build.psram_type=qspi -m5stack-cores3.build.memory_type={build.boot}_{build.psram_type} +m5stack-cores3.build.memory_type=qio_qspi +m5stack-cores3.build.loop_core=-DARDUINO_RUNNING_CORE=1 +m5stack-cores3.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 m5stack-cores3.menu.JTAGAdapter.default=Disabled m5stack-cores3.menu.JTAGAdapter.default.build.copy_jtag_files=0 @@ -13624,46 +13624,14 @@ m5stack-cores3.menu.JTAGAdapter.bridge=ESP USB Bridge m5stack-cores3.menu.JTAGAdapter.bridge.build.openocdscript=esp32s3-bridge.cfg m5stack-cores3.menu.JTAGAdapter.bridge.build.copy_jtag_files=1 -m5stack-cores3.menu.PSRAM.disabled=Disabled -m5stack-cores3.menu.PSRAM.disabled.build.defines= -m5stack-cores3.menu.PSRAM.disabled.build.psram_type=qspi -m5stack-cores3.menu.PSRAM.enabled=QSPI PSRAM -m5stack-cores3.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -m5stack-cores3.menu.PSRAM.enabled.build.psram_type=qspi -m5stack-cores3.menu.PSRAM.opi=OPI PSRAM -m5stack-cores3.menu.PSRAM.opi.build.defines=-DBOARD_HAS_PSRAM -m5stack-cores3.menu.PSRAM.opi.build.psram_type=opi - -m5stack-cores3.menu.FlashMode.qio=QIO 80MHz -m5stack-cores3.menu.FlashMode.qio.build.flash_mode=dio -m5stack-cores3.menu.FlashMode.qio.build.boot=qio -m5stack-cores3.menu.FlashMode.qio.build.boot_freq=80m -m5stack-cores3.menu.FlashMode.qio.build.flash_freq=80m -m5stack-cores3.menu.FlashMode.qio120=QIO 120MHz -m5stack-cores3.menu.FlashMode.qio120.build.flash_mode=dio -m5stack-cores3.menu.FlashMode.qio120.build.boot=qio -m5stack-cores3.menu.FlashMode.qio120.build.boot_freq=120m -m5stack-cores3.menu.FlashMode.qio120.build.flash_freq=80m -m5stack-cores3.menu.FlashMode.dio=DIO 80MHz -m5stack-cores3.menu.FlashMode.dio.build.flash_mode=dio -m5stack-cores3.menu.FlashMode.dio.build.boot=dio -m5stack-cores3.menu.FlashMode.dio.build.boot_freq=80m -m5stack-cores3.menu.FlashMode.dio.build.flash_freq=80m -m5stack-cores3.menu.FlashMode.opi=OPI 80MHz -m5stack-cores3.menu.FlashMode.opi.build.flash_mode=dout -m5stack-cores3.menu.FlashMode.opi.build.boot=opi -m5stack-cores3.menu.FlashMode.opi.build.boot_freq=80m -m5stack-cores3.menu.FlashMode.opi.build.flash_freq=80m - +m5stack-cores3.menu.FlashSize.16M=16MB (128Mb) +m5stack-cores3.menu.FlashSize.16M.build.flash_size=16MB +m5stack-cores3.menu.FlashSize.16M.build.partitions=default_16MB m5stack-cores3.menu.FlashSize.4M=4MB (32Mb) m5stack-cores3.menu.FlashSize.4M.build.flash_size=4MB m5stack-cores3.menu.FlashSize.8M=8MB (64Mb) m5stack-cores3.menu.FlashSize.8M.build.flash_size=8MB m5stack-cores3.menu.FlashSize.8M.build.partitions=default_8MB -m5stack-cores3.menu.FlashSize.16M=16MB (128Mb) -m5stack-cores3.menu.FlashSize.16M.build.flash_size=16MB -#m5stack-cores3.menu.FlashSize.32M=32MB (256Mb) -#m5stack-cores3.menu.FlashSize.32M.build.flash_size=32MB m5stack-cores3.menu.LoopCore.1=Core 1 m5stack-cores3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 @@ -13677,13 +13645,17 @@ m5stack-cores3.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 m5stack-cores3.menu.USBMode.hwcdc=Hardware CDC and JTAG m5stack-cores3.menu.USBMode.hwcdc.build.usb_mode=1 -m5stack-cores3.menu.USBMode.default=USB-OTG (TinyUSB) +m5stack-cores3.menu.USBMode.hwcdc.upload.use_1200bps_touch=false +m5stack-cores3.menu.USBMode.hwcdc.upload.wait_for_upload_port=false +m5stack-cores3.menu.USBMode.default=USB-OTG m5stack-cores3.menu.USBMode.default.build.usb_mode=0 +m5stack-cores3.menu.USBMode.default.upload.use_1200bps_touch=true +m5stack-cores3.menu.USBMode.default.upload.wait_for_upload_port=true -m5stack-cores3.menu.CDCOnBoot.default=Disabled -m5stack-cores3.menu.CDCOnBoot.default.build.cdc_on_boot=0 m5stack-cores3.menu.CDCOnBoot.cdc=Enabled m5stack-cores3.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +m5stack-cores3.menu.CDCOnBoot.default=Disabled +m5stack-cores3.menu.CDCOnBoot.default.build.cdc_on_boot=0 m5stack-cores3.menu.MSCOnBoot.default=Disabled m5stack-cores3.menu.MSCOnBoot.default.build.msc_on_boot=0 @@ -13702,13 +13674,27 @@ m5stack-cores3.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB) m5stack-cores3.menu.UploadMode.cdc.upload.use_1200bps_touch=true m5stack-cores3.menu.UploadMode.cdc.upload.wait_for_upload_port=true -m5stack-cores3.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +m5stack-cores3.menu.PartitionScheme.default_16MB=Default 16MB with spiffs (2x 6.5 MB APP/3.6MB SPIFFS) +m5stack-cores3.menu.PartitionScheme.default_16MB.build.partitions=default_16MB +m5stack-cores3.menu.PartitionScheme.default_16MB.upload.maximum_size=6553600 +m5stack-cores3.menu.PartitionScheme.default=4MB with spiffs (2x 1.2MB APP/1.5MB SPIFFS) m5stack-cores3.menu.PartitionScheme.default.build.partitions=default -m5stack-cores3.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +m5stack-cores3.menu.PartitionScheme.defaultffat=4MB with ffat (2x 1.2MB APP/1.5MB FATFS) m5stack-cores3.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -m5stack-cores3.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS) +m5stack-cores3.menu.PartitionScheme.default_8MB=8M with spiffs (2x 3MB APP/1.5MB SPIFFS) m5stack-cores3.menu.PartitionScheme.default_8MB.build.partitions=default_8MB m5stack-cores3.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +m5stack-cores3.menu.PartitionScheme.large_spiffs=16MB with Large SPIFFS (2x 4MB APP/7MB SPIFFS) +m5stack-cores3.menu.PartitionScheme.large_spiffs.build.partitions=large_spiffs_16MB +m5stack-cores3.menu.PartitionScheme.large_spiffs.upload.maximum_size=4685824 +m5stack-cores3.menu.PartitionScheme.factory_4apps=16MB+Factory (4x 3MB APP/2MB SPIFFS) +m5stack-cores3.menu.PartitionScheme.factory_4apps.build.custom_partitions=partitions_16MB_factory_4_apps +# m5stack-cores3.menu.PartitionScheme.factory_4apps.upload.extra_flags=0xc10000 "{runtime.platform.path}/variants/{build.variant}/firmware.bin" +m5stack-cores3.menu.PartitionScheme.factory_4apps.upload.maximum_size=3145728 +m5stack-cores3.menu.PartitionScheme.factory_6apps=16MB+Factory (6x 2MB APP/2MB SPIFFS) +m5stack-cores3.menu.PartitionScheme.factory_6apps.build.custom_partitions=partitions_16MB_factory_6_apps +# m5stack-cores3.menu.PartitionScheme.factory_6apps.upload.extra_flags=0xc10000 "{runtime.platform.path}/variants/{build.variant}/firmware.bin" +m5stack-cores3.menu.PartitionScheme.factory_6apps.upload.maximum_size=2097152 m5stack-cores3.menu.CPUFreq.240=240MHz (WiFi) m5stack-cores3.menu.CPUFreq.240.build.f_cpu=240000000L @@ -13737,6 +13723,8 @@ m5stack-cores3.menu.UploadSpeed.460800.macosx=460800 m5stack-cores3.menu.UploadSpeed.460800.upload.speed=460800 m5stack-cores3.menu.UploadSpeed.512000.windows=512000 m5stack-cores3.menu.UploadSpeed.512000.upload.speed=512000 +m5stack-cores3.menu.UploadSpeed.1500000=1500000 +m5stack-cores3.menu.UploadSpeed.1500000.upload.speed=1500000 m5stack-cores3.menu.DebugLevel.none=None m5stack-cores3.menu.DebugLevel.none.build.code_debug=0 diff --git a/cores/esp32/HardwareSerial.cpp b/cores/esp32/HardwareSerial.cpp index 4655cf27a6f..27d48cf998b 100644 --- a/cores/esp32/HardwareSerial.cpp +++ b/cores/esp32/HardwareSerial.cpp @@ -133,7 +133,7 @@ void serialEventRun(void) #define HSERIAL_MUTEX_UNLOCK() #endif -HardwareSerial::HardwareSerial(int uart_nr) : +HardwareSerial::HardwareSerial(uint8_t uart_nr) : _uart_nr(uart_nr), _uart(NULL), _rxBufferSize(256), @@ -147,8 +147,6 @@ _eventTask(NULL) #if !CONFIG_DISABLE_HAL_LOCKS ,_lock(NULL) #endif -,_rxPin(-1) -,_txPin(-1) ,_ctsPin(-1) ,_rtsPin(-1) { @@ -161,6 +159,14 @@ _eventTask(NULL) } } #endif + // sets UART0 (default console) RX/TX pins as already configured in boot + if (uart_nr == 0) { + _rxPin = SOC_RX0; + _txPin = SOC_TX0; + } else { + _rxPin = -1; + _txPin = -1; + } } HardwareSerial::~HardwareSerial() @@ -330,7 +336,7 @@ void HardwareSerial::_uartEventTask(void *args) void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, int8_t txPin, bool invert, unsigned long timeout_ms, uint8_t rxfifo_full_thrhd) { - if(0 > _uart_nr || _uart_nr >= SOC_UART_NUM) { + if(_uart_nr >= SOC_UART_NUM) { log_e("Serial number is invalid, please use numers from 0 to %u", SOC_UART_NUM - 1); return; } @@ -348,23 +354,26 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in switch (_uart_nr) { case UART_NUM_0: if (rxPin < 0 && txPin < 0) { - rxPin = SOC_RX0; - txPin = SOC_TX0; + // do not change RX0/TX0 if it has already been set before + rxPin = _rxPin < 0 ? SOC_RX0 : _rxPin; + txPin = _txPin < 0 ? SOC_TX0 : _txPin; } break; #if SOC_UART_NUM > 1 // may save some flash bytes... case UART_NUM_1: if (rxPin < 0 && txPin < 0) { - rxPin = RX1; - txPin = TX1; + // do not change RX1/TX1 if it has already been set before + rxPin = _rxPin < 0 ? RX1 : _rxPin; + txPin = _txPin < 0 ? TX1 : _txPin; } break; #endif #if SOC_UART_NUM > 2 // may save some flash bytes... case UART_NUM_2: if (rxPin < 0 && txPin < 0) { - rxPin = RX2; - txPin = TX2; + // do not change RX2/TX2 if it has already been set before + rxPin = _rxPin < 0 ? RX2 : _rxPin; + txPin = _txPin < 0 ? TX2 : _txPin; } break; #endif @@ -424,9 +433,17 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in uartSetRxFIFOFull(_uart, fifoFull); _rxFIFOFull = fifoFull; } - - _rxPin = rxPin; - _txPin = txPin; + // detach previous attached RX/TX pins when it has changed + if (_uart != NULL) { + if (rxPin >= 0 && rxPin != _rxPin) { + uartDetachPins(_uart_nr, _rxPin, -1, -1, -1); + _rxPin = rxPin; + } + if (txPin >= 0 && txPin != _txPin) { + uartDetachPins(_uart_nr, -1, _txPin, -1, -1); + _txPin = txPin; + } + } HSERIAL_MUTEX_UNLOCK(); } @@ -449,11 +466,11 @@ void HardwareSerial::end(bool fullyTerminate) _rxFIFOFull = 0; - uartDetachPins(_uart, _rxPin, _txPin, _ctsPin, _rtsPin); + uartDetachPins(_uart_nr, _rxPin, _txPin, _ctsPin, _rtsPin); _rxPin = _txPin = _ctsPin = _rtsPin = -1; } - delay(10); + uartEnd(_uart); _uart = 0; _destroyEventTask(); @@ -554,11 +571,6 @@ void HardwareSerial::setRxInvert(bool invert) // negative Pin value will keep it unmodified bool HardwareSerial::setPins(int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) { - if(_uart == NULL) { - log_e("setPins() shall be called after begin() - nothing done\n"); - return false; - } - // map logical pins to GPIO numbers rxPin = digitalPinToGPIONumber(rxPin); txPin = digitalPinToGPIONumber(txPin); @@ -566,12 +578,18 @@ bool HardwareSerial::setPins(int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t r rtsPin = digitalPinToGPIONumber(rtsPin); // uartSetPins() checks if pins are valid for each function and for the SoC - bool retCode = uartSetPins(_uart, rxPin, txPin, ctsPin, rtsPin); + bool retCode = uartSetPins(_uart_nr, rxPin, txPin, ctsPin, rtsPin); if (retCode) { - _txPin = _txPin >= 0 ? txPin : _txPin; - _rxPin = _rxPin >= 0 ? rxPin : _rxPin; - _rtsPin = _rtsPin >= 0 ? rtsPin : _rtsPin; - _ctsPin = _ctsPin >= 0 ? ctsPin : _ctsPin; + // detach previous attached UART pins if not set as same as before + if (_rxPin >= 0 && rxPin >= 0 &&_rxPin != rxPin) uartDetachPins(_uart_nr, _rxPin, -1, -1, -1); + if (_txPin >= 0 && txPin >= 0 && _txPin != txPin) uartDetachPins(_uart_nr, -1, _txPin, -1, -1); + if (_ctsPin >= 0 && ctsPin >= 0 && _ctsPin != ctsPin) uartDetachPins(_uart_nr, -1, -1, _ctsPin, -1); + if (_rtsPin >= 0 && rtsPin >= 0 &&_rtsPin != rtsPin) uartDetachPins(_uart_nr, -1, -1, -1, _rtsPin); + // set new pins for a future end() or a setPins() + _txPin = txPin >= 0 ? txPin : _txPin; + _rxPin = rxPin >= 0 ? rxPin : _rxPin; + _rtsPin = rtsPin >= 0 ? rtsPin : _rtsPin; + _ctsPin = ctsPin >= 0 ? ctsPin : _ctsPin; } else { log_e("Error when setting Serial port Pins. Invalid Pin.\n"); } diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index d6516f06f3e..37d1fedd9bc 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -71,7 +71,7 @@ typedef std::function OnReceiveErrorCb; class HardwareSerial: public Stream { public: - HardwareSerial(int uart_nr); + HardwareSerial(uint8_t uart_nr); ~HardwareSerial(); // setRxTimeout sets the timeout after which onReceive callback will be called (after receiving data, it waits for this time of UART rx inactivity to call the callback fnc) @@ -170,7 +170,7 @@ class HardwareSerial: public Stream size_t setTxBufferSize(size_t new_size); protected: - int _uart_nr; + uint8_t _uart_nr; uart_t* _uart; size_t _rxBufferSize; size_t _txBufferSize; diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index ca212577891..c649c58ea94 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -79,13 +79,13 @@ static uart_t _uart_bus_array[] = { // be seen in the previous pins and new pins as well. // Valid pin UART_PIN_NO_CHANGE is defined to (-1) // Negative Pin Number will keep it unmodified, thus this function can detach individual pins -void uartDetachPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) +void uartDetachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) { - if(uart == NULL) { + if(uart_num >= SOC_UART_NUM) { + log_e("Serial number is invalid, please use numers from 0 to %u", SOC_UART_NUM - 1); return; } - UART_MUTEX_LOCK(); if (txPin >= 0) { gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[txPin], PIN_FUNC_GPIO); esp_rom_gpio_connect_out_signal(txPin, SIG_GPIO_OUT_IDX, false, false); @@ -93,7 +93,7 @@ void uartDetachPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int if (rxPin >= 0) { gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[rxPin], PIN_FUNC_GPIO); - esp_rom_gpio_connect_in_signal(GPIO_FUNC_IN_LOW, UART_PERIPH_SIGNAL(uart->num, SOC_UART_RX_PIN_IDX), false); + esp_rom_gpio_connect_in_signal(GPIO_FUNC_IN_LOW, UART_PERIPH_SIGNAL(uart_num, SOC_UART_RX_PIN_IDX), false); } if (rtsPin >= 0) { @@ -103,9 +103,8 @@ void uartDetachPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int if (ctsPin >= 0) { gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[ctsPin], PIN_FUNC_GPIO); - esp_rom_gpio_connect_in_signal(GPIO_FUNC_IN_LOW, UART_PERIPH_SIGNAL(uart->num, SOC_UART_CTS_PIN_IDX), false); + esp_rom_gpio_connect_in_signal(GPIO_FUNC_IN_LOW, UART_PERIPH_SIGNAL(uart_num, SOC_UART_CTS_PIN_IDX), false); } - UART_MUTEX_UNLOCK(); } // solves issue https://github.com/espressif/arduino-esp32/issues/6032 @@ -147,15 +146,15 @@ bool uartIsDriverInstalled(uart_t* uart) // Valid pin UART_PIN_NO_CHANGE is defined to (-1) // Negative Pin Number will keep it unmodified, thus this function can set individual pins -bool uartSetPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) +bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin) { - if(uart == NULL) { - return false; + if(uart_num >= SOC_UART_NUM) { + log_e("Serial number is invalid, please use numers from 0 to %u", SOC_UART_NUM - 1); + return; } - UART_MUTEX_LOCK(); + // IDF uart_set_pin() will issue necessary Error Message and take care of all GPIO Number validation. - bool retCode = uart_set_pin(uart->num, txPin, rxPin, rtsPin, ctsPin) == ESP_OK; - UART_MUTEX_UNLOCK(); + bool retCode = uart_set_pin(uart_num, txPin, rxPin, rtsPin, ctsPin) == ESP_OK; return retCode; } diff --git a/cores/esp32/esp32-hal-uart.h b/cores/esp32/esp32-hal-uart.h index c9cdd114909..886142ce23b 100644 --- a/cores/esp32/esp32-hal-uart.h +++ b/cores/esp32/esp32-hal-uart.h @@ -131,8 +131,8 @@ int uartGetDebug(); bool uartIsDriverInstalled(uart_t* uart); // Negative Pin Number will keep it unmodified, thus this function can set/reset individual pins -bool uartSetPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); -void uartDetachPins(uart_t* uart, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); +bool uartSetPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); +void uartDetachPins(uint8_t uart_num, int8_t rxPin, int8_t txPin, int8_t ctsPin, int8_t rtsPin); // Enables or disables HW Flow Control function -- needs also to set CTS and/or RTS pins bool uartSetHwFlowCtrlMode(uart_t *uart, uint8_t mode, uint8_t threshold); diff --git a/cores/esp32/esp_arduino_version.h b/cores/esp32/esp_arduino_version.h index bdc822b75a7..a8008486892 100644 --- a/cores/esp32/esp_arduino_version.h +++ b/cores/esp32/esp_arduino_version.h @@ -23,7 +23,7 @@ extern "C" { /** Minor version number (x.X.x) */ #define ESP_ARDUINO_VERSION_MINOR 0 /** Patch version number (x.x.X) */ -#define ESP_ARDUINO_VERSION_PATCH 11 +#define ESP_ARDUINO_VERSION_PATCH 13 /** * Macro to convert ARDUINO version number into an integer diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 166f212f3a7..418135d12b5 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -18,6 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "sdkconfig.h" +#ifdef CONFIG_ETH_ENABLED + #include "ETH.h" #include "esp_system.h" #if ESP_IDF_VERSION_MAJOR > 3 @@ -601,3 +604,5 @@ String ETHClass::macAddress(void) } ETHClass ETH; + +#endif // CONFIG_ETH_ENABLED \ No newline at end of file diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h index 7fc14f59cb3..420b427707e 100644 --- a/libraries/Ethernet/src/ETH.h +++ b/libraries/Ethernet/src/ETH.h @@ -21,6 +21,9 @@ #ifndef _ETH_H_ #define _ETH_H_ +#include "sdkconfig.h" +#ifdef CONFIG_ETH_ENABLED + #include "WiFi.h" #include "esp_system.h" #include "esp_eth.h" @@ -106,4 +109,6 @@ class ETHClass { extern ETHClass ETH; +#endif // CONFIG_ETH_ENABLED + #endif /* _ETH_H_ */ diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index 6f65a1833db..b1328c07316 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -1081,7 +1081,7 @@ void HTTPClient::collectHeaders(const char* headerKeys[], const size_t headerKey String HTTPClient::header(const char* name) { for(size_t i = 0; i < _headerKeysCount; ++i) { - if(_currentHeaders[i].key == name) { + if(_currentHeaders[i].key.equalsIgnoreCase(name)) { return _currentHeaders[i].value; } } @@ -1112,7 +1112,7 @@ int HTTPClient::headers() bool HTTPClient::hasHeader(const char* name) { for(size_t i = 0; i < _headerKeysCount; ++i) { - if((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) { + if((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0)) { return true; } } diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp index a930c308cb2..a94f2ab7ff3 100644 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ b/libraries/WiFi/src/WiFiGeneric.cpp @@ -426,6 +426,7 @@ static void _arduino_event_cb(void* arg, esp_event_base_t event_base, int32_t ev /* * ETH * */ +#ifdef CONFIG_ETH_ENABLED } else if (event_base == ETH_EVENT && event_id == ETHERNET_EVENT_CONNECTED) { log_v("Ethernet Link Up"); arduino_event.event_id = ARDUINO_EVENT_ETH_CONNECTED; @@ -446,6 +447,7 @@ static void _arduino_event_cb(void* arg, esp_event_base_t event_base, int32_t ev #endif arduino_event.event_id = ARDUINO_EVENT_ETH_GOT_IP; memcpy(&arduino_event.event_info.got_ip, event_data, sizeof(ip_event_got_ip_t)); +#endif // CONFIG_ETH_ENABLED /* * IPv6 @@ -594,10 +596,12 @@ static bool _start_network_event_task(){ return false; } +#ifdef CONFIG_ETH_ENABLED if(esp_event_handler_instance_register(ETH_EVENT, ESP_EVENT_ANY_ID, &_arduino_event_cb, NULL, NULL)){ log_e("event_handler_instance_register for ETH_EVENT Failed!"); return false; } +#endif // CONFIG_ETH_ENABLED if(esp_event_handler_instance_register(WIFI_PROV_EVENT, ESP_EVENT_ANY_ID, &_arduino_event_cb, NULL, NULL)){ log_e("event_handler_instance_register for WIFI_PROV_EVENT Failed!"); diff --git a/libraries/WiFi/src/WiFiGeneric.h b/libraries/WiFi/src/WiFiGeneric.h index 525f693a2eb..ec624629da4 100644 --- a/libraries/WiFi/src/WiFiGeneric.h +++ b/libraries/WiFi/src/WiFiGeneric.h @@ -92,7 +92,9 @@ typedef union { ip_event_got_ip_t got_ip; ip_event_got_ip6_t got_ip6; smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd; +#ifdef CONFIG_ETH_ENABLED esp_eth_handle_t eth_connected; +#endif wifi_sta_config_t prov_cred_recv; wifi_prov_sta_fail_reason_t prov_fail_reason; } arduino_event_info_t; diff --git a/package.json b/package.json index 4fe769c421c..bd4a1b92348 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "framework-arduinoespressif32", - "version": "2.0.11", + "version": "2.0.13", "description": "Arduino Wiring-based Framework for the Espressif ESP32, ESP32-S and ESP32-C series of SoCs", "keywords": [ "framework", diff --git a/platform.txt b/platform.txt index dcd24c54067..4bb53336e29 100644 --- a/platform.txt +++ b/platform.txt @@ -1,5 +1,5 @@ name=ESP32 Arduino -version=2.0.11 +version=2.0.13 tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf tools.xtensa-esp32s2-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32s2-elf diff --git a/variants/lilygo_t_display/pins_arduino.h.txt b/variants/lilygo_t_display/pins_arduino.h similarity index 98% rename from variants/lilygo_t_display/pins_arduino.h.txt rename to variants/lilygo_t_display/pins_arduino.h index e911f09b86c..87edf8ccd32 100644 --- a/variants/lilygo_t_display/pins_arduino.h.txt +++ b/variants/lilygo_t_display/pins_arduino.h @@ -64,4 +64,4 @@ static const uint8_t VBAT = 34; static const uint8_t RIGHT_BUTTON = 35; static const uint8_t LEFT_BUTTON = 0; -#endif /* Pins_Arduino_h */ \ No newline at end of file +#endif /* Pins_Arduino_h */ diff --git a/variants/m5stack_cores3/partitions_16MB_factory_4_apps.csv b/variants/m5stack_cores3/partitions_16MB_factory_4_apps.csv new file mode 100644 index 00000000000..f3781c2f423 --- /dev/null +++ b/variants/m5stack_cores3/partitions_16MB_factory_4_apps.csv @@ -0,0 +1,11 @@ +## 4 Apps + Factory +## Name, Type, SubType, Offset, Size +nvs, data, nvs, 0x9000, 0x5000 +otadata, data, ota, 0xe000, 0x2000 +ota_0, 0, ota_0, 0x10000, 0x300000 +ota_1, 0, ota_1, 0x310000, 0x300000 +ota_2, 0, ota_2, 0x610000, 0x300000 +ota_3, 0, ota_3, 0x910000, 0x300000 +firmware, app, factory, 0xC10000, 0x0F0000 +spiffs, data, spiffs, 0xD00000, 0x2F0000 +coredump, data, coredump, 0xFF0000, 0x10000 diff --git a/variants/m5stack_cores3/partitions_16MB_factory_6_apps.csv b/variants/m5stack_cores3/partitions_16MB_factory_6_apps.csv new file mode 100644 index 00000000000..899eb862802 --- /dev/null +++ b/variants/m5stack_cores3/partitions_16MB_factory_6_apps.csv @@ -0,0 +1,14 @@ +# 6 Apps + Factory +# Name, Type, SubType, Offset, Size +nvs, data, nvs, 0x9000, 0x5000 +otadata, data, ota, 0xe000, 0x2000 +ota_0, 0, ota_0, 0x10000, 0x200000 +ota_1, 0, ota_1, 0x210000, 0x200000 +ota_2, 0, ota_2, 0x410000, 0x200000 +ota_3, 0, ota_3, 0x610000, 0x200000 +ota_4, 0, ota_4, 0x810000, 0x200000 +ota_5, 0, ota_5, 0xA10000, 0x200000 +firmware, app, factory, 0xC10000, 0x0F0000 +spiffs, data, spiffs, 0xD00000, 0x2F0000 +coredump, data, coredump, 0xFF0000, 0x10000 +