github espressif/esp-idf v4.1-beta2
ESP-IDF Pre-release v4.1-beta2

latest releases: v5.4-beta1, v5.1.5, v5.2.3...
pre-release4 years ago

Documentation for pre-release v4.1-beta2 is available at https://docs.espressif.com/projects/esp-idf/en/v4.1-beta2/

ESP-IDF v4.1 is a minor update for ESP-IDF v4.0.

This is the list of changes since release v4.0:

Major New Features

  • Preview support for ESP32-S2 Beta SoC. This support will be replaced with ESP32-S2 SoC support in ESP-IDF v4.2. ESP32-S2 Beta firmware is not compatible with the ESP32-S2 production SoC, and not all features are supported.
  • New Python-based menuconfig tool
  • Networking: Added new esp_netif API to manage network interfaces, replaces tcpip_adapter which is now deprecated.
  • Classic Bluetooth: Added support for Hands Free Profile (HFP) Audio Gateway (AG)
  • DTLS support in libcoap using mbedTLS (#3977)
  • Secure Boot V2 support (RSA based) added for ESP32 V3

Known Issues

Bluetooth

Controller

  • Improved handling of calloc() failure
  • Fixed HCI timeout issues when using multiple cores and sleep is enabled
  • Fixed BLE crash issue triggered by BLE event interrupt missed
  • Fixed bugs related to role switch
  • Fall back to main XTAL as Bluetooth sleep clock source if the External 32kHz crystal is configured but not detected
  • Fixed a division by zero error in BT sleep clock cycle calculation
  • Fixed software assertion of invalid state when using HCI_Create_Connection_Cancel command

Bluedroid

  • Fixed bug with fixed_queue semaphore pointer dereference
  • Fixed potential memcpy buffer overflow problem
  • Fixed wrong complete Identity Address (Public Address) of the Privacy-enabled Bonded Device got after bonding
  • Fixed the issue with pointer type conversion in gattc
  • Added missing GATT descriptors 0x2909 (Number of Digitals) through 0x290E (Time Trigger Setting) (#4082, #4470)
  • Fixed some spurious uninitialized variable warnings when optimization level set to Performance

NimBLE

Classic Bluetooth

  • Added new esp_bt_gap_read_remote_name() function to get remote device's Bluetooth name at any time
  • Fixed error on EIR type in Config EIR event
  • Added support to enable Peripheral Preferred Parameters in GAP service
  • HFP: Added Audio Gateway (AG) support
  • HFP: Added AT+NREC=0 command for disabling AG echo cancellation (#3665)
  • HFP: Fixed crash on incoming audio
  • HFP: Fixed connection fail and crash when receiving unknown AT command
  • HFP: Fixed AG audio crash (change the return position)

Bluetooth Low Energy

  • Fixed BLE throughput wasting memory
  • Fixed the BLE throughput client crash when enable the CONFIG_GATTC_WRITE_THROUTHPUT option
  • Fixed client no BLE_AUTH_CMPL_EVT when client proactively initiate an encryption request after device restart
  • Fixed notify malloc failed when testing multi-connection notify performance
  • Fixed btc disable crash sometimes
  • Fixed don't dequeue the command queue after process the read_by_type_req
  • Added BLE API to set channel classification

Blufi

  • Fixed the wrong type from BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_MAX_CONN_NUM to BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_CHANNEL

ESP-BLE-Mesh

  • Synchronized Zephyr v1.14.0 & v2.0 BLE Mesh updates
  • Several newly added features, including:
    • Add separate advertising buffers for relay packets
    • Add heartbeat message receive callback
    • Add Low Power node APIs and events
    • Add Friend node events
    • Add BLE Mesh Proxy client functionality
    • Add BLE Mesh Generic/Sensor/Time and Scenes/Lighting server models
    • Add application events of Configuration server model
    • Update Health server Model callbacks
    • Update examples based on newly added server models
  • Fixed getting wrong timer remaining time
  • Checked mesh queue and task init status
  • Fixed client model invalid address access
  • Fixed not restoring mesh node cfg value
  • Fixed wrong device name in mesh proxy adv
  • Fixed mesh device with wrong name on iOS
  • Checked client model timer remaining time
  • Fixed memory leak when node is reset
  • Fixed adv buf unref issue and wrong link_id in exceptional list
  • Update lightness last state when actual state is changed
  • Fixed compile error when using release optimization level
  • Removed some useless CONFIG_BLE_MESH_NODE
  • Fixed Provisioner failed to send msg to 0xFFFF
  • Made RSSI value available to mesh applications
  • Fixed compile errors when including from C++ files
  • Fixed reset transport info when node is removed
  • Now allows sending maximum 377 octet payload
  • Unified client application and lower transport layer timeout
  • Removed timeout for client message to non-unicast address
  • Fixed timer start when sending client message
  • Calculates incomplete message timeout based on message info
  • Moved dev_role to the end of model_pub
  • Added check of buf->ref before decrementing buffer ref count
  • Fixed use-after-free issue when deinit mesh
  • Added BLE mesh deinit in btc task
  • Fixed not free beacon timer when deinit mesh
  • Now uses lock for mesh timer operations
  • Fixed deinit error when using NimBLE host
  • Renamed ble_mesh_vendor_models to common_vendor_models in examples
  • Added test function for an unprovisioned device to enter the mesh automatically
  • Added option to send normal BLE advertising packets while connected to mesh
  • Fixed client local parameters not initialized
  • Changed to continue node info restore even if failure happens
  • Removed some redundant functions
  • Now notifies unprovisioned device beacon to application layer
  • Added check if assigned node address is duplicated
  • Updated next alloc address when node info is added
  • Fixed Provisioner provisioning deadlock
  • Removed BLE_MESH_MAX_STORED_NODES option
  • Associates replay protection list size with nodes count
  • Fixed time scene wrong spelled macro name

Wi-Fi Coexistence

  • Fixed A2DP disconnect when Wi-Fi switches channels
  • Fixed A2DP stuck after creating another connection
  • Improve Wi-Fi TX & RX performance
  • Fixed wakeup delay when DFS is enabled
  • New API esp_coex_ble_conn_dynamic_prio_enable() allows configuring BLE/W-Fi relative priority in coexistence
  • Optimize WiFi/BT coexist sleep
  • Adjust coexist scheme when BT is in connected status

Wi-Fi

  • Added PMK caching feature for WPA2 Enterprise stations
  • Added support for Protected Management Frames (PMF)
  • Added SAE authentication support for WPA3 Personal
  • Wi-Fi now uses new esp_event library added in ESP-IDF v4.0
  • Fixed wpa_supplicant EAP re-authentication issue
  • Fixed wpa_supplicant assoc_ie_len setting based on generated RSN/WPA IE
  • Fixed EAPOL key used during reauthentication
  • Fixed wpa_supplicant memory leak on Wi-Fi stop
  • Added wpa_supplicant parsing support for WEP40 key
  • Disabled wpa_supplicant TLS 1.2 support by default due to issues with some Enterprise Authentication Servers. This option can be enabled in menuconfig.
  • Fixed bug for setting channel when in NULL mode.
  • Added check for Wi-Fi stop when calling esp_wifi_deinit
  • Now places the Vendor Specific element at the end according to the protocol
  • Fixed crash during WEP shared auth
  • Fixed WiFi buffer reload that WiFi receiving no longer works because internal buffer reloading fails
  • Fixed WiFi receiving that WiFi receiving no longer works because it writes the MAC registers when WiFi/BT common clock is disabled
  • Fixed WiFi performance, including AMPDU parameter negotiations, WiFi TX optimization etc
  • Fixed AMSDU decrypt that ESP32 can't decrypt the AMSDU if it's encrypted
  • Reduced Wi-Fi compiled binary size
  • Added TX packet length checking, Wi-Fi driver will drop a packet which is too long
  • Improved RSSI scan accuracy
  • Now returns an error if the setting AP's channel is out of range
  • Fixed sniffer during WiFi mode switching
  • Reduced Wi-Fi compiled binary size
  • Added TX packet length checking, Wi-Fi driver will drop a packet which is too long
  • Now returns an error if the setting AP's channel is out of range
  • Throughput improvements
  • Fixed Wi-Fi receive failure due to internal buffer reload failure
  • Fixed some Wi-Fi timer issues
  • Fix crash caused by too big of association request RSN information
  • Fixed setting channel when Wi-Fi is in NULL mode
  • Fixed the soft-AP incorrectly updates the second channel
  • Fixed AP switch to adjacent channel without disconnect
  • Added soft-AP example channel configuration
  • Fixed beacon timeout and station fails to connect to AP sometimes when WiFi and Bluetooth run together
  • Fixed the station can't get the IP address from China Mobile router

ESP-NOW

  • Fixed unicast packet TX failure
  • Fixed randomly crash (#4311)
  • Fixed modifying the channel info of peer node
  • Fixed the crash when modifying peer node between unencrypted and encrypted
  • Fixed the bug for fetch peer
  • Fixed the bug that the channel parameter doesn't work when adding peer node

Smartconfig

  • Airkiss: Fixed bug where connection would timeout but success was returned (#3362)

Ethernet

  • Fixed Ethernet interrupt crash when cache is disabled. New flag ETH_MAC_FLAG_WORK_WITH_CACHE_DISABLE introduced to support Ethernet MAC continuing to operate while cache is disabled.
  • Ensure that eth_driver handle is allocated in internal RAM (#4635)
  • Ensure that calling esp_eth_stop() stops the EMAC hardware layer
  • Improved reliability of ethernet driver start/stop/uninstall/install

Peripheral Drivers

  • Most drivers have been refactored internally, however public behaviour of existing APIs should be the same as in ESP-IDF V4.0
  • Added option to place UART ISR in IRAM
  • Added new ESP Serial Slave Link library to communicate with serial slave devices via SDIO or similar interfaces
  • CAN: Fixed can_reconfigure_alerts() function taking semaphore in a critical section
  • CAN: Fixed possible logging in critical sections
  • CAN: Added bitfields to can_message_t as an alternate way to set CAN message flags.
  • I2S: Fixed compile error if FreeRTOS header not included before I2S header (#4251)
  • LEDC: Added missing ledc_set_pin() function declaration
  • MCPWM: Fixed off-by-one error when setting period
  • SDSPI & SDMMC: Fixed gpio_pin_bit_mask truncation to max GPIO value 31
  • PSRAM: Added support for 2T mode
  • UART: Added simplified API to set threshold values for RX FIFO full and TX FIFO empty
  • SPI: Fixed bug where spihost handle could be allocated in PSRAM
  • SPI_SLAVE: Fixed assertion failure when spi_slave_initialize failed with DMA channel equals zero (#2740)
  • TIMER_GROUP: Fixes the interrupt enable/disable of timer groups
  • SIGMA_DELTA: Fixed the cpp guard in the header file

Core System

  • Added config option to retry 32 kHz external crystal calibration
  • Fixed DPORT ECO workaround register operation to improve workaround reliability. (Details of workaround in ECO document item 3.10 "When each CPU reads certain different address spaces simultaneously, a read error can occur")
  • Added likely & unlikely macros to help compiler produce optimized instruction sequences
  • bootloader_random: Added protected for shared CLK_EN & RST_EN registers when calling bootloader_random_enable()/_disable() in the app
  • esp_attr: Fixed multiple definition linker errors when using section attributes in C++ builds (#4021 )
  • esp_event: Fix a possible null pointer dereference (#4373)
  • esp_timer: Add parameter NULL checks to public API Return ESP_ERR_INVALID_ARG if the handle is NULL, instead of crashing.
  • heap: Added dedicated "aligned alloc" and "aligned free" functions functions (some restrictions apply, see linked documentation).
  • heap: Added new heap_caps_get_allocated_size() function
  • heap: Ensured malloc(0) will always return NULL
  • ipc: IPC now runs at priority of the caller's task, preventing priority inversion issue where one core commandeers the other core
  • log: Added option to log system time rather than RTOS time (#3958)
  • mac: Calling esp_base_mac_addr_set() now fails if MAC is not a unicast MAC (#4263)
  • pthread: Fixed pthread_once() possible race condition (#4561)
  • single core: Don't compile in unnecessary ipc code in single core configurations
  • startup: Clear RF PHY peripheral status during early startup
  • time: Added optional support for 64-bit time_t, depends on toolchain support which is not part of the default toolchain yet, this is planned for ESP-IDF v5.0.
  • toolchain: add new compiler optimization levels for "Performance" (-O2) and "None" (-O0)

Debugging

  • core dump: Default Core Dump data format is now ELF (configurable)
  • core dump: Disable core dump to flash if stack in PSRAM option is enabled
  • panic handler: Moved some panic handler code into flash to reduce IRAM usage, cache will be re-enabled in panic handler if necessary
  • panic handler: Fixed printing of ELF file if cache is disabled

FreeRTOS

  • Reduced interrupt cycle overhead by using window overflow and underflow exceptions to speed up Xtensa register spills to the stack
  • Added support for including FreeRTOS headers using the traditional header paths, instead of requiring freertos/ prefix

newlib libc

  • Fixed linking of newlib nano from ROM only if PSRAM cache workaround is disabled

LWIP

  • Added option to automatically resolve mDNS queries when looking up .local addresses
  • Added IPV6 stateless address autoconfiguration support
  • Cleaned up the TCP/IP stack port layer
  • Fixed crash when a netconn is marked as closed
  • Fix select_waiting() assert caused by UDP socket closing
  • Fix the crash caused by socket lock not initialized
  • Fixed issue with IPV6 TCP sending OK when STA disconnects
  • MLD6: Fixed error when attempting to join a non-multicast IPV6 address
  • Now includes hostname in DHCP discover packet, if set
  • PPPoS: Fixed power_down DCE immediately after getting IP
  • PPPoS: Allow esp_netif_ppp_set_auth set auth_type with NETIF_PPP_AUTHTYPE_NONE (#4639)
  • PPP client: Prevent rhostname array overflow (espressif/esp-lwip#14)
  • sntp: Added API to set the SNTP update interval (#4437)
  • Fixed assertion failure if killing a TCP connection not marked for closing yet
  • Fixed assertion failure if UDP socket is closed during select
  • Fixed issue with IPV6 TCP sending OK when STA disconnects
  • Fixed failure to set DHCP timeout during system initialization

mDNS

  • Added configuration values for mDNS task priority, affinity, internal service timeouts
  • Fixed missing "bye" packet if services removed with mdns_service_remove_all() or mdns_free() (#3660)

Provisioning

  • NimBLE: Fix bug in protocomm_nimble chararcteristic access callback
  • Unified Provisioning: Fixed BLE characteristics read response issue when read response length is a multiple of () length
  • Wifi_provisioning_softap: Allow applications to start webserver externally
  • Wifi_prov_manager: Fix to ensure that provisioning status is reliably conveyed to remote host
  • BLE: Change service_uuid to non-standard 128-bit UUID

OTA

  • Fixed bug where erase size could be one sector too long (#4953)
  • esp_https_ota: Added error checking functionalities. A few additional error checking mechanisms have been added which returns the control in case an invalid header is received, and a wrapper to the esp_http_client_is_complete_data_received() function of esp_http_client has been added.
  • esp_https_ota: Fixed OTA when using a server with chunked HTTP encoding
  • esp_https_ota: Added errno check for network disconnection when performing OTA

HTTP Client

  • Added esp_http_client_set_authtype() function (#4444)
  • Fixed HTTP client issue regarding message_complete callback invocation (fixes some issues with OTA failing with unexpected errors if the connection closes early)
  • Fixed memory leak in esp_http_client_set_username/password (#4444)

mbedTLS

  • Added new fast Montgomery exponentiation implementation for RSA accelerator. Significantly improves ESP32 RSA performance (especially public key operations)
  • Don't allow disabling ECDSA support in mbedTLS config if app image signature checking is enabled

ULP

  • Added some missing ULP macro functionality: stage counters, branch on stage counter, I2C operations. (#3580)
  • Added ULP macro MOVE <label> construct which helps when writing larger programs. (#3580)
  • Added a union member to allow getting the encoded ULP instruction from a macro result (#3759)

Bootloader

  • Added option to skip image validation when waking from deep sleep (incompatible with Secure Boot) (#3304)
  • Restructured bootloader initialization, moving target-specific initialization into separate source files

ESP-TLS

TCP Transport

  • Added API to use password protected client keys
  • Added functionality to use ALPN with SSL

Websocket

  • Added User-Agent and additional headers to websocket client (#4345)

ESP-MQTT

  • Added functionality to use ALPN with SSL

Storage

  • FATFS: handle the internal FR_INT_ERR error as "filesystem corrupted"
  • NVS: Add support to expose a NVS entry via a C++ smart pointer handle
  • NVS: Fixed iterator skipping version 1 blobs (#4954)
  • SPIFFS: Fixed bugs when CONFIG_SPIFFS_USE_MTIME is not defined
  • SPIFFS: Now follows symlinks in spiffsgen (#3778)
  • spi_flash: Fixed possible task watchdog timeout by adding vTaskDelay during long erase
  • spi_flash: Fixed over-allocation and possible OOM crash when reading from SPI Flash to PSRAM (#4769)
  • spi_flash: Fixed the inconsistency in clock between SPI0 and SPI1. (#5099)

VFS

  • VFS: Check in select() if the UART driver is installed or not

Modbus

  • Added support for Modbus ASCII master mode
  • Fixed issue re-initializing Modbus controller after call to mbc_master_destroy()

External Libraries

Tools

  • c++: Allow enabling RTTI
  • idf_monitor: Work around a Windows driver bug when using a USB-CDC device
  • idf_monitor: fix the bug that idf_monitor not blocked when no log printed (#3884)
  • idf_monitor: Fixed flashing encrypted binaries from IDF Monitor
  • idf_size: Added support to write size data to a JSON file
  • idf_size: Significantly improved performance (#4518)
  • openocd: Documented support for ARM architecture

Build System

  • Added PowerShell versions of "install.bat" and "export.bat" for Windows PowerShell users
  • Added idf.py --cache option and support for setting config variable IDF_ENABLE_CCACHE to permanently enable CCache
  • Added minor fixes for convert_to_cmake.py
  • Added new idf.py --version command
  • Allow idf.py and CMake build system to work on FreeBSD (not officially supported) (#2029)
  • Added new idf.py --monitor-baud option (can also set default with IDF_MONITOR_BAUD environment variable)
  • Fix IDF_PATH case mismatches on case insensitive filesystems
  • Fixed execution order for dependent tasks
  • Updated kconfiglib to the upstream version, switch to a Python-based menuconfig tool
  • ldgen linker script mapping rules order is now deterministic

Examples

  • http_request: Fixed some non-compliant parts of the HTTP request, made example configurable
  • Improved the example behaviour when esp_restart() is called and Wi-Fi is initialized
  • ping: Added new example
  • restful server: Added NetBIOS support for discovery
  • tcp_server: Fixed unnecessary reopening of listening socket
  • efuse: Added example demonstrating efuse API for writing efuses
  • ble throughput: Fixed intermittent crash when running the BLE throughput client
  • ble hid device: Fixed the wrong mask value based on the HID protocol
  • ble hid device: Fixed issue with security info restore when a paired BLE HID device disconnects and then reconnects after a BT Classic HID device has connected
  • BLE mesh: Update mesh console example
  • BLE mesh: Added BLE mesh vendor models examples
  • BLE mesh: Added BLE mesh sensor model examples
  • blufi: Changed the Wi-Fi storage mode to default WIFI_STORAGE_FLASH
  • bluetooth: Added HFP Audio Gateway example
  • ota: Fixed bug with failing OTA if the connection closed prematurely

Documentation

  • Translated more ESP-IDF Programming Guide pages into Chinese
  • Added basic C++ style guide
  • Encourage Python 3 rather than Python 2 for new users
  • Added Getting Started Guide for Ethernet Kit V1.1
  • Added some definitions removed during driver refactoring back to API reference
  • Included feedback link in footer of all documentation pages
  • Removed duplicate commands and invalid serial port information in description of examples

Obtaining v4.1-beta2

For full installation instructions, see the ESP-IDF Programming Guide.

The source files attached to this release will not work due to our use of git submodules. Use one of the following methods instead:

Using git

To get this release, use the following commands:

git clone -b v4.1-beta2 --recursive https://github.com/espressif/esp-idf.git esp-idf-v4.1-beta2
cd esp-idf-v4.1-beta2/

This is the recommended way of obtaining v4.1-beta2 of ESP-IDF.

Download an archive with submodules included

Attached to this release is an esp-idf-v4.1-beta2.zip archive. It includes .git directory and all the submodules, so can be used out of the box. This archive is provided for users who have connectivity issues preventing them from cloning from GitHub.

This archive can also be downloaded from Espressif's download server:
https://dl.espressif.com/dl/esp-idf/releases/esp-idf-v4.1-beta2.zip

Don't miss a new esp-idf release

NewReleases is sending notifications on new releases.