Skip to content

ESP-IDF Release v3.1

Compare
Choose a tag to compare
@projectgus projectgus released this 07 Sep 07:53
· 30769 commits to master since this release

Documentation for release v3.1 is available at http://docs.espressif.com/projects/esp-idf/en/v3.1/.

Changes Since v3.0

This is the list of changes since release v3.0. ESP-IDF v3.1 is compatible with apps written for v3.0 (apart from one breaking change in esp_ping, see below).

Known Issues

  • When modem sleep is enabled, multicast packets can be delayed - more than 80% received after more than 250ms delay. Can be an issue for mDNS/Bonjour discovery.
  • When Wi-Fi & BLE are used with software coexistence enabled, BLE scan intervals should be 200ms or less to avoid truncated BLE scan time.
  • When Wi-Fi & BLE are used with software coexistence enabled, BLE sometimes fails to send advertisements.
  • Occasional exception when BLE creates more than 3 connections as master.

Breaking Changes

  • esp_ping units are now milliseconds (in v3.0 ping units were undocumented but they were treated as seconds)

Major Changes

  • Wi-Fi and Bluetooth modem sleep support
  • Wi-Fi and Bluetooth coexistence support
  • Bluetooth Hands Free Profile (HFP)
  • Bluetooth Serial Port Profile (SPP)
  • Bluetooth A2DP source support
  • Automatic Light Sleep feature to reduce overall power consumption (including Tickless FreeRTOS). Average current in Wi-Fi Station mode, when connected to AP (DTIM=1) is 3.1mA. This is 10x lower than the average current in modem sleep mode under the same scenario (30mA).
  • Multiple antenna support (automatic using external RF antenna switch)
  • Wi-Fi mesh functionality (ESP-MESH)
    • Autonomous self-organizing Wi-Fi-based networking protocol
    • Self-healing mesh topology
    • Can connect to external IP network via a "root node" and route packets to external network
    • Supports mesh network data encryption via WPA2-PSK
    • Guide and API Reference
  • OS adapter layer for Wi-Fi functionality (allows Wi-Fi libraries to run on other RTOS implementations)
  • SDIO Slave peripheral driver
  • Bootloader refactoring, configurable factory reset and test app trigger functionality
  • Partition table can be relocated to allow a larger bootloader binary
  • esp_https_ota: New simplified HTTPS OTA client feature
  • Initial Experimental support for alternative CMake build system.

Bluetooth Low Energy

Link Layer

  • Fix the smartphone compatibility bug caused by LL Feature Exchange timing issue
  • New configuration option to deal with BLE queue congestion
  • Send an L2CAP error response if an invalid GATT request is received
  • Fix get incorrect adv packet sometimes
  • Fix crash during BLE connection and disconnection stress testing

GATT Client

  • Save GATTC cache in NVS and add an option to configure it through menuconfig
  • A new parameter incl_srvc_e_handle is added to the struct esp_gattc_incl_svc_elem_t while getting include service information
  • Fix the incorrect PID key result of the ESP_GAP_BLE_GET_BOND_DEV_COMPLETE_EVT event
  • Fix advertising stopped during connection
  • Fix error when advertising stops

GATT Server

  • Fix a probable memory leak for BTA_GATTS_CONF_EVT event

GAP

  • Fix the bug where the start/stop advertising completed events sometimes are not accurate
  • Add the duplicate scan feature and add an option to configure the duplicate scan cache size through menuconfig
  • New API esp_ble_gap_config_local_icon to set the local GAP appearance icon
  • New API esp_ble_gap_get_local_used_addr to get the local address used (e.g. current random address used)
  • Add a completed event ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT for esp_ble_gap_set_rand_addr()

Security Manager Protocol (SMP)

  • Fix slave cannot receive long packets when using SMP
  • Fix the bug that lead to crash when deinit bluetooth with SMP disabled
  • Fix the incorrect results of the esp_ble_get_bond_device_list which is called after reboot
  • Fix Security Manager Protocol bonding failure with iPhones
  • Fix memory leak in security server

Blufi

  • New "get wifi list" command
  • New "report internal error report to phone" command
  • New "send/receive custom data" command

Examples

  • Add A2DP and BLE GATTS coex Demo
  • Add BLE Throughput Demo
  • Add HID Device Demo
  • Fix ble_spp_clientdemo error when SUPPORT_HEARTBEAT is enabled
  • Fix crash when http2_request example send/recv fails

Performance optimization

  • BLE throughput optimizations
  • Automatic registration of GATTC service change notify

Bluetooth Common Parts

  • Wi-Fi and Bluetooth coexistence support
  • Bluetooth modem sleep mode
  • Controller to Host Flow Control support
  • Fix CVE-2018-5383 ("Bluetooth implementations may not sufficiently validate elliptic curve parameters during Diffie-Hellman key exchange")
  • Fix incorrectly enabled erroneous data reporting in HCI layer
  • Fixes for removing bonded devices on BLE and Classic BT
  • Fix conflict reading RSSI in dual mode
  • Fix for BT timer oneshot mode sometimes triggering twice

Classic BT

  • HFP (Hands Free Profile) support
  • GAP device and sevice discovery
  • SPP profile (including VFS support to return a file descriptor)
  • dynamic memory allocation
  • A2DP: Source and sink functionality can be enabled/disabled at runtime (both cannot be enabled concurrently)
  • A2DP: Performance improvements
  • Allow setting BR/EDR TX power level
  • Check support of AFH in remote slave device's LM feature when determine whether to send LMP_set_AFH
  • Fix incorrect computation of PCM data buffer size in A2DP sink

Wi-Fi

New Functionality

  • Wi-Fi and Bluetooth coexistence support
  • Mesh feature
  • Throughput optimizations
  • Support for Channel State Information (CSI)
  • Support to sniffer Wi-Fi control packets
  • Add parts of WPA Supplicant source to ESP-IDF
  • Fix some memory issues in WPA2 Enterprise support
  • WPA2 Enterprise API is now thread safe
  • New event mask API
  • New esp_wifi_80211_tx function for sending 802.11 frames
  • WPS: Support WPS in APSTA mode
  • WPS: Add "set factory information" feature
  • Allow creating the Wi-Fi task pinned to either core
  • Internal refactor for Smartconfig

Bug Fixes

  • Fix issue where esp_wifi_stop never returns if start/stop is run repeatedly
  • Fix for connecting to WEP APs
  • Fix for de-authing station if Soft AP already has maximum connected
  • Thread safety fixes in Wi-Fi library
  • Fix issue that smartconfig crashes when switching channel
  • Fix smartconfig crash issue with SPI RAM
  • Fix the issue that esp_wifi_connect returns ESP_OK, but no system event posted (ap_loss) ([#1797](esp_wifi_connect returns ESP_OK, but no system event posted (ap_loss)))
  • WPA2 Enterprise PEAP connection fixes ([#1887](Enterprise PEAP connection issue))
  • Fix ESPNOW bug when add node in AP+STA mode
  • Fix for scanning during connect process
  • Fix Wi-Fi RX STBC issue, the fix improves the stability of STBC packet receiving
  • Fix Wi-Fi TX bug which improves the Wi-Fi TX stability
  • Reorder MPDU as AMPDU (fixes situation where AP alternates between sending each type)
  • Fix for receiving duplicating MPDU and AMPDU frames
  • Fix for soft-AP de-authes the wrong station when station's inactivity timer is expired
  • Fix for Wi-Fi asserts the system when receiving empty MCS in association response frame
  • Fix for Wi-Fi crashes when receiving invalid beacon in Modem sleep
  • Fix for Wi-Fi scan causes Wi-Fi re-connect not work
  • Fix for beacon information doesn't update after user scan
  • Fix for the station may connect to wrong AP in all channel scan
  • Fix for Wi-Fi ap loss ([#1797](esp_wifi_connect() returns ESP_OK, but no system event posted (ap_loss)))
  • Add country code into scan result ([#1483](Country code in scan result))
  • Add scan_method, sort_method and threshold when invoke esp_wifi_get_config ([#1723](esp_wifi_get_config not setting necessary parameters / documentation unclear about how to use))
  • Add RSSI of each station in soft-AP list ([#1095](Enhance esp_wifi_ap_get_sta_list / wifi_sta_info_t to include RSSI, protocol))
  • Add noise floor info in sniffer receiving packets
  • Fix CCMP encryption compatibility issue
  • Mark esp_wifi_set_auto_connect as deprecated
  • Fix for esp_wifi_disconnect() error when wifi is not started or initialized
  • ESPNOW: Fix for ESPNOW watchdog when modify it's configured parameters
  • Examples: Remove performance example since they are replaced by iperf example
  • Examples: Replace simple_wifi example with two new examples: the station example and soft-AP example ([#1433](Simple Wi-Fi examples))

LWIP

New Functionality

  • Add VFS file descriptors in select
  • Add event SYSTEM_EVENT_AP_STAIPASSIGNED
  • By default don't automatically trust MAC entries of received IP packets, always send an ARP request (configurable)
  • Port LWIP timer implementation from LWIP v2.0.3
  • Add source IP based route for unicast packet

Bug Fixes

  • Fix the issue that TCP connections don't abort when IP address is changed
  • Modify default value of MTU in dhcp offer to 1500
  • Fix the assertion issue caused by tcp_pcb_purge()
  • Fix assertion when closing a non-blocking socket
  • Fix compilation with AutoIP enabled

RF PHY

  • Fix for full calibration accidentally running twice
  • PHY performance improvements

Ethernet

Bug Fixes

  • Set direction of SMI MDC and MDIO pins correctly

Network Functionality

  • New esp-tls library (on top of mbedTLS) for high level TLS (SSL) functionality
  • New esp_http_client library for HTTP/S client functionality
  • mbedTLS: Update to v2.9.0
  • dhcpserver: Fix maximum number of leases (was one less than configured)
  • dhcpserver: Increase DHCP offer MTU size to 1500

Smartconfig

  • Moved to its own component (no longer part of 'esp32')
  • Make smartconfig channel timer thread safe

Soc-Level Functionality

New Functionality

  • Power Management: Support for automatic light sleep
  • Dump stack of both cores when Interrupt watchdog timeout occurs
  • New macros DMA_ATTR and WORD_ALIGNED_ATTR for declaring DMA-capable static buffers
  • Add option to continue running if PSRAM was enabled but not detected at boot
  • Support maximum CPU frequency rating efuse bits, if set from factory.
  • Power Management: Allow disabling a deep sleep wakeup source
  • Improve performance of DPORT access workaround
  • Support __NOINIT_ATTR and RTC_NOINIT_ATTR for static memory not cleared on reset

Bug Fixes

  • Power management: Dynamic frequency scaling stability improvements
  • Fix for runtime configuration of PSRAM (improves stability for 80MHz PSRAM)
  • Fix starting 32kHz crystal in some cases where crystal performance is borderline
  • Fix loss of precision when estimating XTAL frequency
  • Prevent Interrupt WDT from re-triggering in panic handler
  • Heap: Fix tracing of newlib internal allocations (not all of these were being included in the trace)
  • Link pure math functions from libgcc from ROM to reduce code size
  • Fix incorrect pad reported in esp_sleep_get_touchpad_wakeup_status() for touchpad wakeup

Core System Libraries

New Functionality

  • freeRTOS: Support tickless idle (works with Light Sleep)
  • newlib: Add support for adjtime()
  • New esp_err_to_name() function to look up error messages from esp_err_t codes.
  • New API esp_intr_set_in_iram() to change interrupt "in IRAM" status
  • pthreads: Allow configuring thread priority and stack size on creation
  • C11 Thread Local Storage support
  • Heap: New "record task" option for heap tracing
  • esp_timer: Add a function to get next alarm time

Bug Fixes

  • freeRTOS: Queue Sets are now multi-CPU safe
  • Remove debug logging from pthread conditional variables
  • Remove duplicate definition of system_restore
  • Increase default event task stack size by 256 bytes (prevent stack overflow at Debug log level)
  • Fix for idle task stack overflow under some circumstances
  • Refactors and stability fixes for ESP-IDF RingBuffers
  • Fix busy loop in esp_timer_impl_set_alarm (could trigger interrupt watchdog)
  • Mark XTHAL_GET_INTERRUPT and XTHAL_GET_CCOUNT as volatile
  • spi_flash_mmap(): Allocate mmap pages array in internal memory (fixes crash when using SPIRAM)
  • Improve spinlock performance when assertions are enabled

Bootloader

New Functionality

  • More modular bootloader. Minimal code in the bootloader component itself makes it easy to copy this component into a project to implement custom bootloader functionality.
  • New "reset to factory" and "start test app" config options to watch a GPIO and trigger behaviour on reset
  • Partition table can be relocated to allow a larger bootloader binary
  • Partition table now generated with MD5 checksum, checked on boot
  • Support QIO mode for XM25QU64A flash chip

Bug Fixes

  • Fix flash QIO mode configuration for some flash chips

Secure Boot

New functionality

  • Partition table no longer has its signature verified as part of Secure Boot
  • Pad app images to a 64KB boundary to ensure no unverified data is mapped into the address space

Drivers

New Functionality

  • esp_adc_cal: Read factory calibration data from eFuse if present in chip
  • GPIO: Support digital pad hold function
  • I2S: Support "fixed_mclk" configuration
  • I2S: Support for expanding bit width for multi-data-bit input and output (not standard I2S)
  • LEDC: New thread-safe duty cycle and fade API
  • PCNT: Allow each unit to have its own interrupt handler
  • RMT: New function rmt_register_tx_end_callback(). Called when RMT ISR has queued all outgoing items
  • RMT: New API for sending generic uint8_t-typed data.
  • SDIO Slave: New driver
  • SDMMC: SDIO support at protocol layer
  • SDMMC: Add support for reading CD and WP pins in driver
  • SPI Master: Configuration item to place SPI send/receive code into IRAM for performance
  • Touchpad: New API touch_pad_get_wakeup_status()

Bug Fixes

  • Always reset various communication peripherals (UART, I2C, etc) on CPU reset
  • ADC: Fix bug where some peripherals (DAC, HALL) needed to be disabled before ADC conversion
  • esp_adc_cal: Simplify lookup table mode, due to inferior performance compared to linear mode for attenuations 0-2
  • GPIO: modify return value when gpio ISR service already exists.
  • GPIO: Fix bitmask overflow in gpio_reset_pin for pin > 31
  • GPIO: Fix bug clearing interrupt status when enabling interrupts for GPIO numbers > 31
  • I2C: Concurrency fixes
  • I2C: Add xQueue and xSemaphore static allocation support when intr_alloc_flag set to ESP_INTR_FLAG_IRAM.
  • I2S: Fix I2S ADC mode
  • LEDC: Fix duty cycle and fade overflow issues
  • LEDC: Fix ledc_set_freq() for low speed mode
  • PCNT: Add some additional parameter checks and improve example
  • SPI master: perform clock calculations in initialization not ISR
  • SPI master: Don't reconfigure peripheral if settings are unchanged
  • SPI master: Fix issue using GPIO0
  • SPI master: Fix issue with variable command and address flag
  • SPI master: Fix typo in LSBFIRST macro value
  • SPI master: Allow using GPIO34-39 as MISO
  • RMT: Remove logging which skewed timing
  • RMT: Fix for LoadProhibited crash
  • RMT: Fix TX stop API issue
  • RMT: Reduce rmt_mem_num memory block limit to 8 (correct value)
  • SDMMC: Fix for slave sometimes falling into SPI mode
  • SDMMC: Fix init sequence ordering
  • SDMMC: Improve host clock generation (set highest possible clock divider)
  • SDMMC: Initializers are now C++ compatible
  • SDMMC: Various other command-related fixes
  • SDMMC: Disable all pulldowns used by SDMMC host
  • SDMMC: Enable host auto stop only for certain commands
  • SDSPI: Handle error flags for R3 and R7 responses, and delayed R1 responses
  • SDSPI: Fix compatibility issues with multi-block reads
  • SDSPI: Initializers are now C++ compatible
  • SPI: Fix issue that SPI cannot be used when flash is disabled.
  • UART: Remove unnecessary call to xSemaphoreGive()
  • UART: Fix UART FIFO overflow bug
  • UART: New pattern detect function
  • UART: Fix uart_get_baudrate incorrect return value when using ref_tick
  • UART: Fix UART tx_empty interrupt wdt timeout bug
  • UART: Fix timeout bug when UART clock source is ref_tick
  • Touch: Fix default touch channels enabled on startup
  • Touch: Improve the touchpad filter mode

Virtual Filesystem

  • Support for VFS file descriptors in select() (currently support mixing UART and socket fds in a single select() call)
  • Support access() function
  • UART driver: Support O_NONBLOCK flag

mDNS

  • Send "Goodbye" packet when removing service as "Authoritative"
  • Fix a portion of queries are issued with the wildcard query

External Libraries

  • AWS IoT: Update AWS IoT SDK to v2.2.1
  • AWS IoT: Allow setting Thing Shadow settings via menuconfig
  • AWS IoT: Fine tune stack size for aws_iot examples
  • AWS IoT: Fix compilation when "Override Shadow RX buffer size" is enabled in menuconfig
  • micro-ecc: Update to version 1.0 (no code changes from previously used version)
  • mbedTLS: Updated to v2.12.0

Storage Subsystems

New Functionality

  • fatfs: Configurable allocation unit size
  • fatfs: Character encoding configurations
  • fatfs: Support for mounting read-only fatfs volumes without wear levelling
  • nvs: New host-side utility to create a prepopulated NVS partition
  • nvs: New functions for returning used/free entry counts
  • nvs: Fix for NVS sometimes leaving free chunks unwritten in a page
  • nvs_flash: Add version compatibility checks for NVS storage
  • spiffs: New config option for logical page size

Bug Fixes

  • nvs: Fix recovery from power off during erase or free cycle
  • spiffs: Verify OBJ_NAME_LEN + OBJ_META_LEN is within limits
  • spiffs: Fix esp_spiffs_format() if partition is not mounted
  • spiffs: Fix stackoverflow due to recursion in vfs_spiffs_readdir_r

ULP

  • Expand documentation for JUMPS instruction, ULP binary format
  • Add missing include in ulp.h header
  • Fix calculation of ulp_run argument
  • ULP example: Fix RTC IOs

Documentation

Build System

  • Initial Experimental support for alternative CMake-based build system.
  • New hooks to remove build-time requirement for 'git' to be installed
  • Support for EXCLUDE_COMPONENTS project level variable
  • Build-time check that configured flash size fits in the partition table

Host-Side Tools

  • idf-monitor: Improve gdb session cleanup on Linux
  • idf-monitor: Fix cases where monitor would crash writing to console on WSL
  • espefuse: Support for reading ADC calibration data, where provided
  • idf-size: Sort output by total size
  • idf-size: Report per-symbol sizes from map file (new target make size-symbols)
  • JTAG: Support software breakpoints set in flash (pending release of openocd support)
  • gcov: Add GCOV debug stub support

Getting This Release

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

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

Download an archive with submodules included

Attached to this release is an esp-idf-v3.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-v3.1.zip