ESP-IDF Release v4.0.1
Documentation for release v4.0.1 is available at https://docs.espressif.com/projects/esp-idf/en/v4.0.1/
ESP-IDF v4.0.1 is a bugfix update for ESP-IDF v4.0. v4.0.1 is the latest stable release of ESP-IDF at time of writing.
ESP-IDF v4.0.x will be supported until October 2021, according to the ESP-IDF Support Policy. The current Long Term Support release is v3.3.2, v3.3.x will be supported until March 2022.
Major Changes
- Wi-Fi: Support for PMF and WPA3-Personal has been added. WPA3 will become mandatory for new Wi-Fi certifications starting in June 2020
Known Issues:
- If configuration option mbedtls: Enable hardware MPI (bignum) acceleration is disabled and wpa_supplicant: Use mbedtls crypto is enabled, the project will fail to build. Changing either configuration item will work around this problem. The default is for both options to be enabled. (#5321)
Known issues will be fixed in the next ESP-IDF bugfix release.
This is the list of changes since release v4.0:
Wi-Fi
- Fixed the vendor specific IE is not at the end of beacon
- Fixed the station can't get the IP address from China Mobile router
- Fixed beacon timeout and station fails to connect to AP sometimes when WiFi and Bluetooth run together
- Fixed an issue parsing the
WPS_CONFIG_INIT_DEFAULT()
initializer macro in C++ - Throughput improvements
- Fixed Wi-Fi receive failure due to internal buffer reload failure
- Fixed AMSDU decrypt that ESP32 can't decrypt the AMSDU if it's encrypted
- Fixed some Wi-Fi timer issues
- Fix crash caused by too big of association request RSN information
- Fixed crash caused by block scan
- Fixed bug for getting channel and bandwidth
- Fixed sniffer during Wi-Fi mode switching
- Added additional documentation about limitations of using
esp_wifi_set_channel()
(#4311) - Now places the Vendor Specific element at the end according to the protocol
- 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
- Added check for Wi-Fi stop when calling esp_wifi_deinit
- Now returns an error if the setting AP's channel is out of range
- Fixed bug for setting channel when in NULL mode.
- Fixed Wi-Fi log print level
- Fixed
esp_wifi_stop()
crash if Wi-Fi not initialized - Fixed possible
esp_wifi_stop()
memory leak esp_wifi_sta_get_ap_info()
now returns actual values of group ciphers- wpa_supplicant: Fixed some TLS 1.2 issues
- Added support for WPA2-enterprise re-authentication
- wpa_supplicant: Added support for PMK caching
ESP-NOW
- Fixed bug when modifying the channel info of peer node
- Fixed crash when modifying peer node between unencrypted and encrypted
- Fixed bug when fetching peer
- Fixed the bug that the channel parameter doesn't work when adding peer node
- Updated documentation about format of ESP-NOW Wi-Fi frame (#2833)
SmartConfig
- Fixed an AirKiss bug with IP address length
ESP-MESH (Wi-Fi Mesh)
- Cleared ie.child field when fully associated or the ie.child was connected
- Fixed
esp_mesh_send
returns unexpectedESP_ERR_MESH_TIMEOUT
- Fixed a lock error in
esp_mesh_deinit
- Fixed incorrect ie.assoc field
- Increased roots_window_close_time from 60 seconds to 120 seconds
- Modified mesh packets to use AC_VI instead of AC_BE
- Fixed ie.rc_rssi field is not updated when receiving internal roots direct/forward events
Bluetooth
- OSI: Added length check for snprintf in osi config
Bluetooth Classic
Controller
- Fixed Bluetooth event scheduling when Wi-Fi is also enabled.
- Fixed A2DP stuck issue when BLE interval is too small, new auto latency configuration controls priority.
- Fixed the incorrect timing of FHS and POLL packet during role switch
- Fixed that EDR packets are not accepted after role switch.
- Fall back to main XTAL as Bluetooth sleep clock source if the External 32 kHz crystal is configured but not detected
- Fixed a division by zero error in BT sleep clock cycle calculation
- Fixed assertion failure when a create connection operation is cancelled
Bluedroid
- Fixed HFP/A2DP coex bug with iPhone and disabled initiating sniff request when HFP is in use
- Fixed error EIR type in config EIR event
- Fixed Audio Gateway crash
- Changed or removed unnecessary logs in SCO code
Bluetooth Low Energy
Controller
- Fixed send ACL pkt after BLE has sent terminate ind
Bluedroid
- Fixed GATTC triggering open event multiple times
- Fixed the issue with pointer type conversion in gattc
- Fixed security info restore bug
- Modified minimum advertising interval to 10ms
- Added handling of osi memory calloc failure
- 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
NimBLE
- Added config option to enable host flow control
- Added host based privacy (RPA) feature support
- Added ble_hs_lock in ble_gap_unpair (from upstream PR)
- Fixed ble_hs_hci_rx_evt (from upstream PR)
- NimBLE stack buffers are now allocated dynamically instead of .bss. Added a config option to choose the allocation strategy
- Fixed check for static random address
- Reset master and slave states on host reset
ESP-BLE-Mesh
- Added Zephyr v2.0 BLE Mesh fixes, including:
- Fixed Previous Address endianess in Friend Request
- Fixed next_period computation
- Made model publication struct more compact
- Fixed Provisioner not supporting friend feature
- Fixed wrong subnet info used for Friend Clear
- Fixed virtual addr wrong return value
- Made persistent storage of Virtual Address
- Now proxies forwards to ALL_NODES addr
- Added model message macros
- Added use of net_buf_simple_clone
- Now skips local messages in rx
- Added checks for seqnum match in app/net
- Exposed app key get function
- Exposed header parsing outside net
- Removed unused macro FRIEND_BUF_SIZE
- Fixed encrypting friend packets on send
- 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 memory leak when node is reset
- 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 applicaton 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
- Fixed use of right netkey during iv update
- Fixed use of right net_idx & app_idx for publish
- 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
- Now frees beacon timer when deinit mesh
- Now uses lock for mesh timer operations
- Fixed deinit error when using NimBLE host
- Renamed
ble_mesh_vendor_models
tocommon_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
Blufi
- Fixed invalid prepare write buffer value
Wi-Fi Coexistence
- Fixed A2DP stuck after creating another connection
- Improved Wi-Fi throughput in some Classic BT coexistence scenarios (idle, inquire scan, connected, sniff, a2dp pause, etc)
- Supports coexistence with Wi-Fi + Classic BT + BLE mesh concurrently enabled
- Improved Wi-Fi scan and connection success ratio when coexistence enabled
- Improved throughput in some circumstances when coexistence enabled
- Fixed incorrect wakeup delay when DFS is enabled
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)
LWIP
- Added IPV6 stateless address autoconfiguration support
- Increase TCP send buffer and receive window limitation when TCP window scale is enabled
- Fixed a bug when inputting the wrong broadcast for v4.0
- Now drops packets larger than MTU, but outgoing IP fragmentation is now enabled by default
- Fixed crash when a netconn is marked as closed
- Fixed
select_waiting()
assert caused by UDP socket closing - Added a check in
sys_arch_protect()
that mutex is created before use, and allow creating on demand - Fixed issue with IPV6 TCP sending OK when STA disconnects
- Fixed DHCP client issue with some China Mobile routers
Event library
- Fixed crash when unregistering a handler instance from itself (#4139)
- Fixed potential safety issue when iterating nodes
Core System
- Added config option to retry 32 kHz external crystal calibration
- esp_timer: Fixed case when alarm_reg > counter_reg but
FRC_TIMER_INT_STATUS
is not set (#2954) - Perform a digital reset on panic if the cache error interrupt is set (resets cache)
- Fixed
esp_ptr_executable()
result for single core ESP32 cache memory - heap: Ensure
malloc(0)
returns a NULL pointer regardless of heap posioning configuration - intr_alloc: Fixed calling of ESP_LOG from inside a critical section
- log: Check for ISR context and use proper API to get Tick Count
- startup: Clear RF PHY peripheral status during early startup
- single core: Don't compile in unnecessary
ipc
code in single core configurations - efuse: Fixed call to
esp_efuse_get_coding_scheme()
if flash encryption is enabled and log level is Debug. (#4862) - Fixed case where panic handler tries to print ELF SHA-256 value but cache is disabled
Debugging Tools
- Core dump: Core dump to flash is now disabled if task stacks in PSRAM are allowed
Storage
- spi_flash: Fixed over-allocation and possible OOM crash when reading from SPI Flash to PSRAM (#4769)
- spi_flash: Reduced maxmimum memory overhead when reading large buffer from SPI Flash to PSRAM, temporary buffer size now scales to available internal RAM
- vfs: Check in select() if the UART driver is installed or not (#4627)
Security Features
- Fixed bad config where Secure Boot signature checks are enabled but ECDSA not enabled in mbedTLS configuration
Peripheral Drivers
- LEDC: Added missing
ledc_set_pin()
function declaration - MCPWM: Corrected fault signal 3 for unit 2
- MCPWM:
mcpwm_fault_set_oneshot_mode
now clears the status before setting the mode, no longer necessary to reset the peripheral first - MCPWM: Fixed a bug where
mcpwm_capture_enable
did not work correctly if a PWM channel had not already been enabled by a call tomcpwm_init
(as enabling PWM channel had set the prescaler) - SPI Master: Fixed crash when host handle was allocated into PSRAM (#4635)
- SDSPI & SDMMC: Fixed
gpio_pin_bit_mask
truncation to max GPIO value 31
WebSocket Client
- Fixed locking mechanism in client task when sending data (#4169)
- Fixed handling of received messages longer than the receive buffer
HTTP Client
- Added support to check the binary length of the recieved stream and compare it with the size mentioned in the header. (#3004)
- Fixed HTTP client issue regarding message_complete callback invocation (fixes some issues with OTA failing with unexpected errors if the connection closes early)
OTA
- Fixed size calculation when erasing partition range for OTA image (would try to over-erase by one sector if the length was already sector aligned)
ESP HTTPS OTA
- Added check for network disconnection socket result while performing OTA
mbedTLS
- Updated to upstream release v2.16.5
- Fixed hardware accelerated big number multiplication (MPI/RSA) if operand and result overlap in memory
Provisioning
- BLE: Change serverice_uuid to non-standard 128-bit UUID
ESP-TLS
- Added timeout support for blocking connections
- Fixed bug determining connection active state based on whether timeout is enabled
MQTT
- Fixed too early publishing
- Fixed potential mutex memory leak
- Fixed waiting for entire connack message before returning
- Fixed event loop not getting cleaned up when closing
Build System
- idf.py: Added an environment variable to enable ccache by default
- idf.py: Added support for changing monitor baud rate (via config or environment variable)
- idf.py: Replaced
defconfig
withreconfigure
in docs (#3965) - Escape special CMake characters when generating
sdkconfig.cmake
file - CMake: Make
esptool_py_custom_target
callable from other directories - CMake: Added error if cmake is run in the
IDF_PATH
root directory - kconfiglib: Fixed a Unicode error in kconfiglib while opening files (#4977)
Host Tools
- idf_monitor: Work around a
usbser.sys
bug when using USB-CDC device on Windows - idf_monitor: Fixed flashing encrypted binaries
- idf_tools.py: Fixed virtualenv issue in macOS with Homebrew
- idf_tools.py: Fixed virtualenv installation when using virtualenv 20.0.0
- idf_tools.py: When guessing
IDF_PATH
set it in the environment - parttool: Removed unnecessary exception backtrace when a legitimate error is found in input
- parttool: Fixed regression when parsing binary partition data
- parttool: Fixed parsing of subtype (#4723)
Third Party Libraries
- cJSON: Exclude test file from the component build
Documentation
- Encourage use of Python 3 (Python 2 is officially no longer supported upstream and ESP-IDF support will be removed in a future version.)
- Added official documentation links for Eclipse plugin installation
- A feedback link is now included at the bottom of all ESP-IDF Programming Guide pages
Examples
- ble_throughput: Fixed memory leak, packet loss and crashing bugs
- ble hid device: Fixed the wrong mask value based on the HID protocol
- ble throughput: Fixed intermittent crash when running the BLE throughput client
- ble nimble: Corrected connection handle in update and enc_change events
- blufi: Changed the Wi-Fi storage mode to default
WIFI_STORAGE_FLASH
- blufi: Check if ble is connected before sending a ble message
- bluetooth hfp: Fixed the error macro name and error return
- OTA example: Fixed handling for case of incomplete OTA data
Obtaining v4.0.1
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.0.1 --recursive https://github.com/espressif/esp-idf.git esp-idf-v4.0.1
cd esp-idf-v4.0.1/
This is the recommended way of obtaining v4.0.1 of ESP-IDF.
Download an archive with submodules included
Attached to this release is an esp-idf-v4.0.1.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.0.1.zip