Skip to content

Commit 7c6f21d

Browse files
committed
IDF release/v4.4 6c5fb29c2c
1 parent 05b31c4 commit 7c6f21d

File tree

453 files changed

+3008
-2517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

453 files changed

+3008
-2517
lines changed

platform.txt

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

tools/platformio-build-esp32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@
326326
"UNITY_INCLUDE_CONFIG_H",
327327
"WITH_POSIX",
328328
"_GNU_SOURCE",
329-
("IDF_VER", '\\"v4.4.1-262-g5e6cffbb14\\"'),
329+
("IDF_VER", '\\"v4.4.1-405-g6c5fb29c2c\\"'),
330330
"ESP_PLATFORM",
331331
"_POSIX_READER_WRITER_LOCKS",
332332
"ARDUINO_ARCH_ESP32",

tools/platformio-build-esp32c3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@
320320
"UNITY_INCLUDE_CONFIG_H",
321321
"WITH_POSIX",
322322
"_GNU_SOURCE",
323-
("IDF_VER", '\\"v4.4.1-262-g5e6cffbb14\\"'),
323+
("IDF_VER", '\\"v4.4.1-405-g6c5fb29c2c\\"'),
324324
"ESP_PLATFORM",
325325
"_POSIX_READER_WRITER_LOCKS",
326326
"ARDUINO_ARCH_ESP32",

tools/platformio-build-esp32s2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@
308308
"UNITY_INCLUDE_CONFIG_H",
309309
"WITH_POSIX",
310310
"_GNU_SOURCE",
311-
("IDF_VER", '\\"v4.4.1-262-g5e6cffbb14\\"'),
311+
("IDF_VER", '\\"v4.4.1-405-g6c5fb29c2c\\"'),
312312
"ESP_PLATFORM",
313313
"_POSIX_READER_WRITER_LOCKS",
314314
"ARDUINO_ARCH_ESP32",

tools/platformio-build-esp32s3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@
325325
"UNITY_INCLUDE_CONFIG_H",
326326
"WITH_POSIX",
327327
"_GNU_SOURCE",
328-
("IDF_VER", '\\"v4.4.1-262-g5e6cffbb14\\"'),
328+
("IDF_VER", '\\"v4.4.1-405-g6c5fb29c2c\\"'),
329329
"ESP_PLATFORM",
330330
"_POSIX_READER_WRITER_LOCKS",
331331
"ARDUINO_ARCH_ESP32",
32 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
48 Bytes
Binary file not shown.
32 Bytes
Binary file not shown.
48 Bytes
Binary file not shown.

tools/sdk/esp32/include/bootloader_support/include/bootloader_flash.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <esp_spi_flash.h> /* including in bootloader for error values */
1010
#include "sdkconfig.h"
1111
#include "soc/soc_caps.h"
12+
#include "bootloader_flash_override.h"
1213

1314
#ifdef __cplusplus
1415
extern "C" {
@@ -32,20 +33,21 @@ uint32_t bootloader_read_flash_id(void);
3233
esp_err_t bootloader_flash_wrap_set(spi_flash_wrap_mode_t mode);
3334
#endif
3435

36+
/**
37+
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
38+
*
39+
* @return ESP_OK When startup successfully, otherwise ESP_FAIL (indiciating you should reboot before erase/write).
40+
*/
41+
esp_err_t bootloader_flash_xmc_startup(void);
42+
3543
/**
3644
* @brief Unlock Flash write protect.
3745
* Please do not call this function in SDK.
3846
*
3947
* @note This can be overridden because it's attribute weak.
4048
*/
41-
esp_err_t bootloader_flash_unlock(void);
49+
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
4250

43-
/**
44-
* @brief Startup flow recommended by XMC. Call at startup before any erase/write operation.
45-
*
46-
* @return ESP_OK When startup successfully, otherwise ESP_FAIL (indiciating you should reboot before erase/write).
47-
*/
48-
esp_err_t bootloader_flash_xmc_startup(void);
4951

5052
#ifdef __cplusplus
5153
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#pragma once
7+
8+
#include "esp_err.h"
9+
#include "esp_attr.h"
10+
11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
15+
typedef unsigned (*bootloader_flash_read_status_fn_t)(void);
16+
typedef void (*bootloader_flash_write_status_fn_t)(unsigned);
17+
18+
typedef struct __attribute__((packed))
19+
{
20+
const char *manufacturer;
21+
uint8_t mfg_id; /* 8-bit JEDEC manufacturer ID */
22+
uint16_t flash_id; /* 16-bit JEDEC flash chip ID */
23+
uint16_t id_mask; /* Bits to match on in flash chip ID */
24+
bootloader_flash_read_status_fn_t read_status_fn;
25+
bootloader_flash_write_status_fn_t write_status_fn;
26+
uint8_t status_qio_bit;
27+
} bootloader_qio_info_t;
28+
29+
/**
30+
* @brief Read 8 bit status using RDSR command
31+
*
32+
* @return Value of SR1.
33+
*/
34+
unsigned bootloader_read_status_8b_rdsr(void);
35+
36+
/**
37+
* @brief Read 8 bit status (second byte) using RDSR2 command
38+
*
39+
* @return Value of SR2
40+
*/
41+
unsigned bootloader_read_status_8b_rdsr2(void);
42+
43+
/**
44+
* @brief Read 16 bit status using RDSR & RDSR2 (low and high bytes)
45+
*
46+
* @return Value of SR2#SR1.
47+
*/
48+
unsigned bootloader_read_status_16b_rdsr_rdsr2(void);
49+
50+
/**
51+
* @brief Write 8 bit status using WRSR
52+
*/
53+
void bootloader_write_status_8b_wrsr(unsigned new_status);
54+
55+
/**
56+
* @brief Write 8 bit status (second byte) using WRSR2.
57+
*/
58+
void bootloader_write_status_8b_wrsr2(unsigned new_status);
59+
60+
/**
61+
* @brief Write 16 bit status using WRSR, (both write SR1 and SR2)
62+
*/
63+
void bootloader_write_status_16b_wrsr(unsigned new_status);
64+
65+
/**
66+
* @brief Read 8 bit status of XM25QU64A.
67+
*
68+
* @return Value of 8 bit SR.
69+
*/
70+
unsigned bootloader_read_status_8b_xmc25qu64a(void);
71+
72+
/**
73+
* @brief Write 8 bit status for XM25QU64A
74+
*/
75+
void bootloader_write_status_8b_xmc25qu64a(unsigned new_status);
76+
77+
/* Array of known flash chips and data to enable Quad I/O mode
78+
79+
Manufacturer & flash ID can be tested by running "esptool.py
80+
flash_id"
81+
82+
If manufacturer ID matches, and flash ID ORed with flash ID mask
83+
matches, enable_qio_mode() will execute "Read Cmd", test if bit
84+
number "QIE Bit" is set, and if not set it will call "Write Cmd"
85+
with this bit set.
86+
87+
Searching of this table stops when the first match is found.
88+
*/
89+
extern const bootloader_qio_info_t __attribute__((weak)) bootloader_flash_qe_support_list[];
90+
91+
/**
92+
* @brief Unlock Flash write protect.
93+
* Please do not call this function in SDK.
94+
*
95+
* @note This can be overridden because it's attribute weak.
96+
*/
97+
esp_err_t IRAM_ATTR __attribute__((weak)) bootloader_flash_unlock(void);
98+
99+
#ifdef __cplusplus
100+
}
101+
#endif

tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_bt_defs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ typedef uint8_t esp_link_key[ESP_BT_OCTET16_LEN]; /* Link Key */
6868
/// Default GATT interface id
6969
#define ESP_DEFAULT_GATT_IF 0xff
7070

71+
#define ESP_BLE_PRIM_ADV_INT_MIN 0x000020 /*!< Minimum advertising interval for undirected and low duty cycle directed advertising */
72+
#define ESP_BLE_PRIM_ADV_INT_MAX 0xFFFFFF /*!< Maximum advertising interval for undirected and low duty cycle directed advertising */
7173
#define ESP_BLE_CONN_INT_MIN 0x0006 /*!< relate to BTM_BLE_CONN_INT_MIN in stack/btm_ble_api.h */
7274
#define ESP_BLE_CONN_INT_MAX 0x0C80 /*!< relate to BTM_BLE_CONN_INT_MAX in stack/btm_ble_api.h */
7375
#define ESP_BLE_CONN_LATENCY_MAX 499 /*!< relate to ESP_BLE_CONN_LATENCY_MAX in stack/btm_ble_api.h */

tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gattc_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ typedef union {
220220
struct gattc_disconnect_evt_param {
221221
esp_gatt_conn_reason_t reason; /*!< disconnection reason */
222222
uint16_t conn_id; /*!< Connection id */
223+
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
223224
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
224225
} disconnect; /*!< Gatt client callback param of ESP_GATTC_DISCONNECT_EVT */
225226
/**

tools/sdk/esp32/include/bt/host/bluedroid/api/include/api/esp_gatts_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ typedef union {
206206
*/
207207
struct gatts_disconnect_evt_param {
208208
uint16_t conn_id; /*!< Connection id */
209+
uint8_t link_role; /*!< Link role : master role = 0 ; slave role = 1*/
209210
esp_bd_addr_t remote_bda; /*!< Remote bluetooth device address */
210211
esp_gatt_conn_reason_t reason; /*!< Indicate the reason of disconnection */
211212
} disconnect; /*!< Gatt server callback param of ESP_GATTS_DISCONNECT_EVT */

tools/sdk/esp32/include/driver/include/driver/gpio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ esp_err_t gpio_set_intr_type(gpio_num_t gpio_num, gpio_int_type_t intr_type);
9797
/**
9898
* @brief Enable GPIO module interrupt signal
9999
*
100-
* @note Please do not use the interrupt of GPIO36 and GPIO39 when using ADC or Wi-Fi with sleep mode enabled.
100+
* @note Please do not use the interrupt of GPIO36 and GPIO39 when using ADC or Wi-Fi and Bluetooth with sleep mode enabled.
101101
* Please refer to the comments of `adc1_get_raw`.
102102
* Please refer to section 3.11 of 'ECO_and_Workarounds_for_Bugs_in_ESP32' for the description of this issue.
103103
* As a workaround, call adc_power_acquire() in the app. This will result in higher power consumption (by ~1mA),

tools/sdk/esp32/include/driver/include/driver/i2c.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ esp_err_t i2c_master_stop(i2c_cmd_handle_t cmd_handle);
429429
/**
430430
* @brief Send all the queued commands on the I2C bus, in master mode.
431431
* The task will be blocked until all the commands have been sent out.
432-
* The I2C APIs are not thread-safe, if you want to use one I2C port in different tasks,
433-
* you need to take care of the multi-thread issue.
432+
* The I2C port is protected by mutex, so this function is thread-safe.
434433
* This function shall only be called in I2C master mode.
435434
*
436435
* @param i2c_num I2C port number

tools/sdk/esp32/include/esp-tls/esp_tls.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,16 @@ esp_err_t esp_tls_plain_tcp_connect(const char *host, int hostlen, int port, con
688688
* NULL on Failure
689689
*/
690690
esp_tls_client_session_t *esp_tls_get_client_session(esp_tls_t *tls);
691+
692+
/**
693+
* @brief Free the client session
694+
*
695+
* This function should be called after esp_tls_get_client_session().
696+
*
697+
* @param[in] client_session context as esp_tls_client_session_t
698+
*
699+
*/
700+
void esp_tls_free_client_session(esp_tls_client_session_t *client_session);
691701
#endif /* CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS */
692702
#ifdef __cplusplus
693703
}

tools/sdk/esp32/include/esp-tls/private_include/esp_tls_mbedtls.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls_cfg_t
104104
* Internal Callback for mbedtls_get_client_session
105105
*/
106106
esp_tls_client_session_t *esp_mbedtls_get_client_session(esp_tls_t *tls);
107+
108+
/**
109+
* Internal Callback for mbedtls_free_client_session
110+
*/
111+
void esp_mbedtls_free_client_session(esp_tls_client_session_t *client_session);
107112
#endif
108113

109114
/**

tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *l
9595
*/
9696
result = core_id;
9797

98-
#if defined(CONFIG_ESP32_SPIRAM_SUPPORT)
98+
#if (CONFIG_ESP32_SPIRAM_SUPPORT || CONFIG_ESP32S3_SPIRAM_SUPPORT)
9999
if (esp_ptr_external_ram(lock)) {
100100
compare_and_set_extram(&lock->owner, SPINLOCK_FREE, &result);
101101
} else {
102102
#endif
103103
compare_and_set_native(&lock->owner, SPINLOCK_FREE, &result);
104-
#if defined(CONFIG_ESP32_SPIRAM_SUPPORT)
104+
#if (CONFIG_ESP32_SPIRAM_SUPPORT || CONFIG_ESP32S3_SPIRAM_SUPPORT)
105105
}
106106
#endif
107107
if(result != other_core_id) {

tools/sdk/esp32/include/esp_phy/include/esp_phy_init.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,27 @@ void esp_phy_disable(void);
170170
*/
171171
void esp_phy_load_cal_and_init(void);
172172

173+
/**
174+
* @brief Initialize backup memory for Phy power up/down
175+
*/
176+
void esp_phy_pd_mem_init(void);
177+
178+
/**
179+
* @brief Deinitialize backup memory for Phy power up/down
180+
*/
181+
void esp_phy_pd_mem_deinit(void);
182+
173183
#if CONFIG_MAC_BB_PD
174184
/**
175185
* @brief Initialize backup memory for MAC and Baseband power up/down
176186
*/
177187
void esp_mac_bb_pd_mem_init(void);
178188

189+
/**
190+
* @brief Deinitialize backup memory for MAC and Baseband power up/down
191+
*/
192+
void esp_mac_bb_pd_mem_deinit(void);
193+
179194
/**
180195
* @brief Power up MAC and Baseband
181196
*/

tools/sdk/esp32/include/freertos/include/esp_additions/freertos/task_snapshot.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ TaskHandle_t pxTaskGetNext( TaskHandle_t pxTask );
8080
* @note This function should not be used while FreeRTOS is running (as it doesn't acquire any locks).
8181
* @param pxTask task handle.
8282
* @param pxTaskSnapshot address of TaskSnapshot_t structure to fill.
83+
* @return pdTRUE if operation was successful else pdFALSE
8384
*/
84-
void vTaskGetSnapshot( TaskHandle_t pxTask, TaskSnapshot_t *pxTaskSnapshot );
85+
BaseType_t vTaskGetSnapshot( TaskHandle_t pxTask, TaskSnapshot_t *pxTaskSnapshot );
8586

8687
#ifdef __cplusplus
8788
}

tools/sdk/esp32/include/hal/esp32/include/hal/cpu_ll.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static inline uint32_t IRAM_ATTR cpu_ll_get_core_id(void)
3939
return id;
4040
}
4141

42-
static inline uint32_t cpu_ll_get_cycle_count(void)
42+
static inline uint32_t IRAM_ATTR cpu_ll_get_cycle_count(void)
4343
{
4444
uint32_t result;
4545
RSR(CCOUNT, result);

tools/sdk/esp32/include/hal/esp32/include/hal/i2c_ll.h

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
1+
/*
2+
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
146

157
// The LL layer for I2C register operations
168

@@ -125,9 +117,28 @@ static inline void i2c_ll_cal_bus_clk(uint32_t source_clk, uint32_t bus_freq, i2
125117
*/
126118
static inline void i2c_ll_set_bus_timing(i2c_dev_t *hw, i2c_clk_cal_t *bus_cfg)
127119
{
128-
//scl period
129-
hw->scl_low_period.period = bus_cfg->scl_low;
130-
hw->scl_high_period.period = bus_cfg->scl_high;
120+
/* SCL period. According to the TRM, we should always subtract 1 to SCL low period */
121+
assert(bus_cfg->scl_low > 0);
122+
hw->scl_low_period.period = bus_cfg->scl_low - 1;
123+
/* Still according to the TRM, if filter is not enbled, we have to subtract 7,
124+
* if SCL filter is enabled, we have to subtract:
125+
* 8 if SCL filter is between 0 and 2 (included)
126+
* 6 + SCL threshold if SCL filter is between 3 and 7 (included)
127+
* to SCL high period */
128+
uint16_t scl_high = bus_cfg->scl_high;
129+
/* In the "worst" case, we will subtract 13, make sure the result will still be correct */
130+
assert(scl_high > 13);
131+
if (hw->scl_filter_cfg.en) {
132+
if (hw->scl_filter_cfg.thres <= 2) {
133+
scl_high -= 8;
134+
} else {
135+
assert(hw->scl_filter_cfg.thres <= 7);
136+
scl_high -= hw->scl_filter_cfg.thres + 6;
137+
}
138+
} else {
139+
scl_high -= 7;
140+
}
141+
hw->scl_high_period.period = scl_high;
131142
//sda sample
132143
hw->sda_hold.time = bus_cfg->sda_hold;
133144
hw->sda_sample.time = bus_cfg->sda_sample;

0 commit comments

Comments
 (0)