github espressif/esp-idf v4.0.2

latest releases: v5.4-dev, v5.2.1, v4.4.7...
3 years ago

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

ESP-IDF v4.0.2 is a bugfix update for ESP-IDF v4.0. ESP-IDF v4.1 is the latest stable release at time of writing.

ESP-IDF v4.0.x will be supported until October 2021, according to the ESP-IDF Support Policy. Since ESP-IDF v4.1, each ESP-IDF major and minor release (V4.1, V4.2, etc) is supported for 30 months after the initial stable release date.

Major Changes

  • Fixed potential live lock cache issue with ESP32 ECO3
  • Updated toolchain to esp-2020r3

Wi-Fi

  • PHY: improve the RX performance when ESP32 wakes up from sleep and CPUs work on 240MHz
  • Added API esp_wifi_ap_get_sta_aid to get aid, which can be used by esp_wifi_deauth_sta
  • Implemented ESPNOW + PMF Co-existence
  • Fixed the issue that the API esp_wifi_get_config didn’t return correct sta.listen_interval
  • Fixed the issue that bandwidth and phy mode not correctly stored into NVS
  • Fixed the failure to get IPV6 link-local address when AP forwarded multicast NS packets back to the station itself
  • Fixed the issue that setting TX DMA buffer above 32 would not take effect
  • Fixed the issue that Airkiss fail to find hidden APs
  • Fixed the issue that the first several AMPDU packets may be discarded by peer device
  • Fixed the issue that STA fail to connect an AP if it never disconnected from the AP
  • Fixed a crash in ESPNOW
  • Fixed a crash when wifi stop after deinit
  • Fixed the issue that wifi_scan_time_t type not correct, which may lead to wrong scan parameter
  • Fixed two issues in regulate domain information update
  • Fixed the issue that APs with WPA2-PSK-SHA256 key management categorised as Open during scan
  • SoftAP: Fixed the issue that the TSF of SoftAP would be reset when sending a CSA
  • SoftAP: Fixed the issue that the secondary channel of softAP not correctly updated
  • SoftAP: Fixed the issue that memory leak happens after SoftAP de-initialized
  • PMF: Fixed the issue that when PMF enabled in STA will cause SoftAP not work correctly
  • PMF: Skipped WPA-TKIP profile if PMF is required
  • PMF: Fixed crashes in receiving management packets
  • wpa_supplicant: Skipped & cleared Supplicant PMK Cache for mismatching AP config
  • wpa_supplicant: fixed some memory leaks and invalid memory access
  • wpa_supplicant: deinited wpa2 states in wifi deinit
  • WPA2-Enterprise: Fixed the issue that STA may try to connect to an open AP when
    configured to connect to a WPA2-Enterprise AP
  • WPA3: fixed WPA3 and WPA2 transition related failures
  • WPA3: fixed WPA3 connection timeout issue in coexistence scenario
  • WPS: allowed NULL-padded WPS attributes
  • WPS: bypassed WPS-Config method validation
  • Fixed SPIFFS conflicts with WIFI when using SPIRAM (#5629)
  • Moved Wi-Fi clock enable/disable code into IRAM
  • Improved esp_wifi_set_max_tx_power description
  • Improved document about security mode and reason code
  • Dump internal heap size instead of heap size in Wi-Fi log

Bluetooth

Classic Bluetooth

Controller

  • Fixed ASSERT for RXDESC and save the log for future debug
  • Fixed ASSERT in ld_acl at line 302 for clkoff1 and localval
  • Fixed ASSERT(64,0) in rwble.c
  • Fixed ASSERT(25,0) in lc_task.c
  • Fixed ASSERT in ld_pscan.c at line 1032
  • Fixed ld_acl schedule issue to parity shift
  • Fixed connection failure in Event Arbitory loop
  • Freed lmp_tx_buf in Exchange Memory in the procedure of handling LMP_detach_req PDU when not received the last acknowledge from the peer device
  • Fixed the issue that when slave initiate unsniff procedure and meet transaction collision, no mode change event is reported
  • Now reset AFH channel map in BTDM Task when WiFi channel changes
  • Fixed int_wdt due to disabling interrupts too long time
  • Disabled frequent warning log in ld_acl
  • Moved default log level to WARNING instead ERROR in BT Controller

Bluedroid

  • Improved description of esp_bt_gap_start_discovery and esp_bt_gap_cancel_discovery
  • Fixed BT Classic GAP bond list corrupt or invalid after removing bond (#5395)
  • Added API esp_spp_stop_srv() for SPP Acceptor
  • Now esp_spp_disconnect() transfers event ESP_SPP_CLOSE_EVT in BTU Task rather than just BTC Task
  • Optimized bta_jv_free_rfc_cb to make sure the spp server always has a listening port after reaching the maximum RFCOMM session number
  • Fixed the issue that when calling esp_spp_start_srv() without any SPP client connecting to the server, calling esp_spp_deinit() can not release the port
  • Now SPP uses NULL point with dynamic memory
  • Kconfig: Updated data type and the default value of the vendor-specific even

Bluetooth Low Energy

Controller

  • Fixed ASSERT(64,0) in rwble.c
  • Fixed assert(9, 10) when rx and evt_end interrupts exist at the same time and use RX information to determine the execution order
  • Fixed assert(10, 9) when missing evt_end or rx and evt_end come the same time
  • Fixed for HCI desync deadlock issue in BLE controller
  • Fiexed cache disable crash when connection parameters update
  • insert the contol packet to the top of the tx prog list
  • Added connect parameter check
  • Fixed assert(1024,0) in rwble.c
  • Fixed assert(512,0) in rwble.c
  • Fixed channel map update failed due to instant reverse
  • Changed tx default octets to 251

Bluedroid

  • Added api to query the number of available buffers for the current connection
  • Fixed the issue of receiving incomplete data packets caused by disordered acl data packets
  • Fixed memory leak when buff_semaphore was not released
  • Fixed cases having fallback to link up event
  • Fixed the state not synchronized between controller and host when disconnected
  • Fixed the watchdog timeout of btu task during multi-connection
  • Authentication fixes in Legacy and Secure Connection, prevent a remote device from doing a Bluetooth impersonation attack
  • Added support for more Bluetooth HID devices

NimBLE

  • Added Non Resolvable Private Address (NRPA) support to existing Host based Privacy (RPA) framework
  • Fixed repeated pairing failure in RPA framework
  • Reduced the size of the compiled binary (PR #6)
  • Allow the host to resolve peer RPA without using local RPA (PR #7)
  • Closing bracket conditional for C++ (PR #12)
  • Upstream fixes
    • Fix NULL pointer passed as a parameter (PR #701)
    • Fixed pairing procedure abort on unexpected pairing request (PR #710)
    • Fixed connection flags after pairing (PR #730)
    • Removed notification for update process timeout (Vol 6, Part B, section 5.2 ) (PR #782)
    • Fixed CCCD behavior in case of an overflow and while storing for bonded devices (PR #790)(PR #804)
    • Fix potential issue with strncpy in os_mempool.c (PR #843)

ESP-BLE-Mesh

  • Added functions for model subscribe/unsubscribe group address locally
  • Addded check of the result of creating timers
  • Updated the check of sensor model states during model initialization
  • Fixed node failed to restore information during initialization
  • Fixed node not erased information completely during node reset
  • Added length check for some mesh copy operations
  • Initialized device name during proxy server initialization
  • Added support of checking model status with variable length
  • Added support of getting node info with pre-configured node name
  • Added a function to get the entry of the nodes table
  • Added check if the subnet still exists before updating its "beacon_sent"
  • Associated replay protection list size with nodes count
  • Removed BLE_MESH_MAX_STORED_NODES option from menuconfig
  • Fixed Provisioner provisioning deadlock
  • Fixed the issue that Provisioner failed to publish
  • Updated next allocated address when node info is added
  • Added check if the assigned node address is duplicated
  • Removed some internal redundant functions
  • Provisioner continues restoring node info event if failure happened
  • Fixed uninitialized client local parameters
  • Fixed the misspelling of time scene macro name
  • Fixed compile error when -O2 (performance) is chosen
  • Fixed compile error when only proxy enabled
  • Fixed Provisioner unicast address not updated in fast provisioning
  • Fixed Provisioner ignored messages from nodes whose unicast addresses are not in the provisioning database when fast provisioning is enabled
  • Fixed Provisioner failed to send Secure Network Beacon if no device is provisioned
  • Fixed the issue Do not #define bool when compiling in C++ (PR #5100)
  • Fixed the issue that recv_rssi of received message is always 0 (PR #5505)
  • Fixed send_ttl is not updated in the received message context
  • Fixed node failed to send messages to fixed group addresses when RELAY is not supported
  • Removed the previously added patch for Bluetooth Mesh Android App from other vendor
  • Fixed wrong log output with bt_hex
  • Optimized a few BLE Mesh log output
  • Make the Kconfig options of using different memory for allocation more clear
  • Added check if the length of received proxy configuration pdu is valid
  • Added check if the input provisioning bearers is valid
  • Fixed handling the received Health Current Status incorrectly
  • Optimized the behavior of client model sending messages
  • Synchronized Zephyr BLE Mesh fixes
  • Updated BLE Mesh stack structure, including:
    • Rename mesh_kernel.* to mesh_timer.*
    • Split mesh mutex related into a separate file
    • Split mesh os related into a separate file
    • Split mesh_util.h into different header files
    • Move fast provisioning related into a separate file
    • Make Proxy server and client functions more clear

Blufi

  • When the format of the received data packet is wrong, reply with an error response
  • Fixed the issue that Blufi sending longer customer data will cause congestion

LWIP

  • Added LINGER to menuconfig
  • Added TCP RTO time default value to menuconfig
  • Fixed the issue that in IPv6 environment when IP fragmentation is turned off, packets exceeding MTU can still be sent and received
  • Fixed the issue of UDP packets in ARP queue lost during coexisting UDP TX performance testing
  • Fixed issue that IPv6 ND6 queues too much packets and causes memory out
  • Fixed the issue that IPv6 fails to send multicast data and ping packet when the source address is empty

Ethernet

  • Updated Ethernet PHY driver by not using latch register to detect link status
  • Added support of stopping emac hardware via esp_eth_stop
  • Added support of pinning emac task to core
  • Inserted minimal assertion time for PHY HW reset (PR #5528)

Peripheral Drivers

  • PSRAM: Fixed 16mbit PSRAM ID read error
  • SDMMC: Correctly check function parameters before using them (PR #5000)
  • SDMMC: Fixed the probe issue that forbid sdspi working in highspeed mode
  • UART: Fixed RXFIFO_CNT bug on ESP32
  • DAC: Fixed DAC influenced by ADC bug by disabling the synchronization operation from ADC1 to DAC
  • DAC: Fixed GPIO header missing while typedefs used in DAC header
  • SIGMA_DELTA: Fixed wrong cpp guard in sigmadelta.h
  • I2S: Fixed issue that i2s_start resetting I2S in incorrect order causes word-order error (#5410)
  • GPIO: Fixed issue gpio_wake_up_disable not working for RTC IO
  • GPIO: Fixed broken CONFIG_LEGACY_INCLUDE_COMMON_HEADERS of ROM header
  • TIMER_GROUP: Fixed timer group interrupt enable issue (#5103)
  • MCPWM: Fixed init MCPWM Fault line via config struct (PR #5491)
  • MCPWM: Fixed PWM-fault init function that read config incorrectly
  • Added reference counter in periph_ctrl
  • Moved esp_phy_common_clock_disable into periph_ctrl and put it into IRAM

Core System & FreeRTOS

  • Fixed potential live lock cache issue with ESP32 ECO3
  • heap: Fixed backtrace termination issue
  • heap: Only fill new heaps with FREE_FILL_PATTERN if Comprehensive poisoning is on, reducing initialization time in other cases
  • efuse: Reduced use of ESP_EARLY_LOGx and moved some code after stdout is initialized (#5343)
  • Bootloader: Fixed spi flash clock config error when using bootloader build with 40MHz mode and app build with 80MHz mode, the system can not start up correctly (#5099)

Build System & Tooling

  • Updated OpenOCD version to 'v0.10.0-esp32-20200709'
  • Updated toolchain to esp-2020r3
  • cmake: Fixed setting defaults in idf_build_process
  • kconfig: Fixed two cases of hex values being handled incorrectly
  • tools: Make Unicode from subprocess result in the CMake convert script
  • ldgen: Added determinism in mapping rule order in the output file
  • Updated Pre-compiled MSYS2 legacy build environment, uses Python 3 now (no more Python 2 in MSYS2)
  • partition_table: Fixed parttool.py crashes when retrieving partition info
  • Fixed the broken python lint on Github Action
  • idf.py: Cleaned Python bytecode files
  • tools: Mentioned ESPPORT and ESPBAUD in idf.py --help
  • export.sh: Better detection and checking of IDF_PATH
  • export.sh: Fixed compatibility with dash shell
  • coredump: Fixed data length calculation when task stack is corrupted
  • coredump: Fixed error reported for blank partition

Power Management

  • sleep: enable sleep reject when entering light sleep

Provisioning

  • BLE provisioning: Add check for valid ble read offset
  • WiFi provisioning: fixed the issue that Wi-Fi provisioning managager ignores subsequent Wi-Fi events if the first Wi-Fi connection attempt fails
  • protocomm_httpd: restart security session if request is received on a new session

HTTP Client

  • Fixed error handling in esp_http_client_read and esp_https_ota_perform
  • Added fix to return failure if (-1) is returned from esp_http_client_read (#4960)

HTTP Server

  • Fixed an issue which could cause issues with LRU purge
  • Updated LRU counter on accepting a new connection

ESP-TLS

  • Enabled TLS renegotiation using explicit API call

WebSocket Client

  • Fixed fragmented send setting proper opcodes by setting the opcode only for the first fragment and WS_FIN for the last one
  • Updated the client to abort the connection if send fails

MQTT

  • Added option to configure mqtt task priority (PR #4947)
  • Added support larger buffers and messages (PR esp-mqtt#145)
  • Added runtime selection of mqtt protocol version (#4448)
  • Fixed mqtt outbox to store timestamps in long-long format (espressif/esp-mqtt#144)
  • Fixed set_config to update ssl-transport configuration (espressif/esp-mqtt#146)
  • Fixed outbox_destroy() to correctly delete all queued messages (#4643, espressif/esp-mqtt#147, espressif/esp-mqtt#148)
  • Added queueing for oversized messaged even if not connected
  • Fixed possible double free of client config if init fails
  • Added setting for separate ssl connection properties before transport connect
  • Fixed compilation issue with IDF version 4.0 and lower (espressif/esp-mqtt#149)
  • Fixed locking if subscribe/unsubscribe message fails to be created (espressif/esp-mqtt#150)
  • Fixed C++ build failing on incorrect event enum conversion (#4787)
  • Fixed resending queued messages to set duplicate flag for both qos1 and qos2 (espressif/esp-mqtt#151)
  • Added config option to configure output buffer size (espressif/esp-mqtt#152)
  • Fixed an issue which could result in a race condition and subsequent crash
  • Changed an error print to use ESP_LOGE instead of ESP_LOGI
  • Moved Sending MQTT connect message log from Info to Debug level

Storage

  • spi_flash: Added Kconfig options to enable yield operation during flash erase
  • spi_flash: Fixed the write performance regression
  • spi_flash: Fixed the regression of non-quad mode by default chip driver, and bugs in add_device
  • nvs: convert string to bytes to fix TypeError
  • vfs: support vfs uart set line endings with specified uart number

Modbus

  • Fixed the issue with incorrect processing of the Modbus request longer than 120 bytes
  • Added comments for limitation in current version of freemodbus

External Libraries

  • coap: update libcoap to fix its broken submodule pointer (#5626)
  • Updated to mbedtls release v2.16.7

Documentation

  • Added a note about FreeRTOS versions ESP-IDF is based on
  • Added documentation for ble_hs_pvcy_rpa_config() API in its declaration
  • Bluetooth: improved the description of esp_bt_gap_start_discovery and esp_bt_gap_cancel_discovery
  • Bluetooth: added explanation of why ESP_BT_GAP_DISC_STATE_CHANGED_EVT is not reported
  • Bluetooth LE: improved 128-bit UUID description
  • BLE-MESH: updated architecture drawing and documents
  • MQTT: Make clear that publish API could block
  • Updated document regarding usage of WPA/WEP security modes
  • Boot Loader: added caveats about using JTAG debugging with hardware security features
  • Power Management: specified that sleep wakeup source restrictions apply to all current ESP32 revisions
  • Fixed incorrect redirect link in getting started guide
  • Fixed broken links in README of some examples
  • Fixed typos in some documents including SPI Master, Bluetooth LE and BLE-MESH

Examples

  • Renamed ble_mesh_vendor_models to common_vendor_models in examples
  • Moved the button & initialization of BLE Mesh examples into common components
  • Added BLE Mesh sensor model examples
  • Added NVS operations for some BLE Mesh examples
  • Fixed BLE Mesh example README & tutorial link error
  • Added result check of BLE Mesh initialization
  • ble_hid_device_demo: fix build if building with c++ (PR #5191)
  • Fixed issue in bt_spp_initiator (PR #5408)
  • Fixed the error parameter in example_spp_initiator_demo.c at line 119
  • Added softap example channel configuration
  • Updated IPv6 related examples to set correct scoped id
    • common-connect: updated Common Connect example code
    • socket: updated Socket examples

Obtaining v4.0.2

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.2 --recursive https://github.com/espressif/esp-idf.git esp-idf-v4.0.2
cd esp-idf-v4.0.2/

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

Download an archive with submodules included

Attached to this release is an esp-idf-v4.0.2.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/github_assets/espressif/esp-idf/releases/download/v4.0.2/esp-idf-v4.0.2.zip

Don't miss a new esp-idf release

NewReleases is sending notifications on new releases.