mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Compare commits
151 Commits
4d0db7045d
...
707d097b01
Author | SHA1 | Date | |
---|---|---|---|
|
707d097b01 | ||
|
22858c37c1 | ||
|
c302ea2e71 | ||
|
f9548c4b7d | ||
|
e3fdf3efe9 | ||
|
351e9208ee | ||
|
419b646d17 | ||
|
887c116f44 | ||
|
f8e4681ea0 | ||
|
17c29f773b | ||
|
d5e66b8196 | ||
|
1f68652c46 | ||
|
fbf7f2c031 | ||
|
5ff61c0913 | ||
|
2d65f53903 | ||
|
599419ab62 | ||
|
f4086e5f92 | ||
|
81c0ccfade | ||
|
a29f9c9b57 | ||
|
7c137656aa | ||
|
b74c02bcd7 | ||
|
e07d014b1d | ||
|
e6013c84da | ||
|
81d0122ede | ||
|
d4a69b5a3d | ||
|
1bde82470a | ||
|
10664a2e03 | ||
|
48088eceaf | ||
|
310e71e277 | ||
|
94ea3fd1de | ||
|
f41a395b78 | ||
|
fe0e852e0a | ||
|
5ccf21e236 | ||
|
ae4b955a0c | ||
|
5bedb0ed69 | ||
|
cd1ff31bba | ||
|
d15668f058 | ||
|
22912e4f21 | ||
|
0507cbaf14 | ||
|
98df0172ac | ||
|
cdef1308a4 | ||
|
d8ec774d96 | ||
|
ef1c1169e4 | ||
|
fd36173ac3 | ||
|
7d442f76f1 | ||
|
e6a551b88d | ||
|
3c3d05e97b | ||
|
a286bc32dd | ||
|
c48a47c341 | ||
|
bae4cf504a | ||
|
f1468c2ca3 | ||
|
01613ca01d | ||
|
7fbc78d4dc | ||
|
3b76633516 | ||
|
805ee5af90 | ||
|
05b9f85acc | ||
|
da31e4beb4 | ||
|
6a34742cb7 | ||
|
186d53427e | ||
|
8650436d6b | ||
|
50ba5891b5 | ||
|
0fe9ddd190 | ||
|
f1d14e7db5 | ||
|
1ae74c4dd4 | ||
|
dbfc55c111 | ||
|
a760bbc784 | ||
|
da77828786 | ||
|
3a8e4d8fa0 | ||
|
307df28d6e | ||
|
1de0308a65 | ||
|
0955c1aabe | ||
|
75e8a58a41 | ||
|
17aa8c7f4c | ||
|
0d3856e369 | ||
|
43515e0ccd | ||
|
fd98cf0594 | ||
|
9a6fcb836c | ||
|
a7fdf8d982 | ||
|
619db6b4c4 | ||
|
a7d487acc5 | ||
|
d97d579e6b | ||
|
b24d36a1cd | ||
|
62d9ebf9ec | ||
|
42fc27767c | ||
|
e6ee09b6a1 | ||
|
ee735d7dbf | ||
|
9011c4a3fd | ||
|
c9430ed953 | ||
|
d02281a90c | ||
|
2c621edab6 | ||
|
0c8074b318 | ||
|
4eac78f675 | ||
|
5eb49bab26 | ||
|
1c9ff00e50 | ||
|
3ded6819f3 | ||
|
7bb93a2b1e | ||
|
d712ae83ee | ||
|
df00c22439 | ||
|
29c39f5164 | ||
|
a9fcf0d57a | ||
|
03f54fe5b0 | ||
|
dfead07789 | ||
|
ce4e689be0 | ||
|
c72fec55dd | ||
|
5589d8cbf4 | ||
|
403bd86a21 | ||
|
7be3141195 | ||
|
189db78bec | ||
|
deb91c7abe | ||
|
561f46d989 | ||
|
230d0c7c5e | ||
|
3743d387a4 | ||
|
b7cbf82c14 | ||
|
ce822125e7 | ||
|
bf34e2547d | ||
|
8fb1a41da5 | ||
|
b63ac1ce9b | ||
|
2bf5856f06 | ||
|
b3a29daa8c | ||
|
04741d258a | ||
|
bb85aaf10c | ||
|
7c0c3fa104 | ||
|
bf487cc290 | ||
|
8bf4b5bbc0 | ||
|
d98a0a0979 | ||
|
243b01eccc | ||
|
5a3c22dc2b | ||
|
9e618fffcb | ||
|
fb9a435952 | ||
|
caca3c2bc3 | ||
|
0e80012fce | ||
|
4e41b73b04 | ||
|
c6f9d1b4cd | ||
|
a9f47ffd5e | ||
|
5ee415a5f5 | ||
|
d4c9710569 | ||
|
cc505fe27d | ||
|
c2691b94c8 | ||
|
aa3adb747e | ||
|
23852bd449 | ||
|
8c3a4fc1fe | ||
|
56c7b79253 | ||
|
a9f8f2576a | ||
|
71708508d6 | ||
|
9eb4ea32fe | ||
|
a3b60ecf51 | ||
|
e729453089 | ||
|
231247b0f5 | ||
|
7fdc327cc1 | ||
|
3110c94117 | ||
|
a4fbcae397 |
@ -1,4 +1,4 @@
|
||||
[codespell]
|
||||
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*
|
||||
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,ot
|
||||
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,ot,wel
|
||||
write-changes = true
|
||||
|
@ -8,7 +8,6 @@
|
||||
# This file should ONLY be used during bringup. Should be reset to empty after the bringup process
|
||||
extra_default_build_targets:
|
||||
- esp32p4
|
||||
- esp32c5
|
||||
|
||||
bypass_check_test_targets:
|
||||
- esp32c5
|
||||
|
@ -127,9 +127,15 @@ menu "Bootloader config"
|
||||
help
|
||||
This is a helper config for 32bits address flash. Invisible for users.
|
||||
|
||||
config BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH
|
||||
bool
|
||||
default y if BOOTLOADER_FLASH_NEEDS_32BIT_FEAT && SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP
|
||||
help
|
||||
This is a helper config for 32bits address quad flash. Invisible for users.
|
||||
|
||||
config BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
bool "Enable cache access to 32-bit-address (over 16MB) range of SPI Flash (READ DOCS FIRST)"
|
||||
depends on BOOTLOADER_FLASH_NEEDS_32BIT_FEAT && IDF_TARGET_ESP32S3 && IDF_EXPERIMENTAL_FEATURES
|
||||
depends on BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH && IDF_EXPERIMENTAL_FEATURES
|
||||
default n
|
||||
help
|
||||
Enabling this option allows the CPU to access 32-bit-address flash beyond 16M range.
|
||||
|
@ -136,6 +136,8 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "esp32s3/rom/opi_flash.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/opi_flash.h"
|
||||
#endif
|
||||
static const char *TAG = "bootloader_flash";
|
||||
|
||||
|
@ -99,6 +99,15 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
|
||||
case ESP_IMAGE_FLASH_SIZE_16MB:
|
||||
size = 16;
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_32MB:
|
||||
size = 32;
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_64MB:
|
||||
size = 64;
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_128MB:
|
||||
size = 128;
|
||||
break;
|
||||
default:
|
||||
size = 2;
|
||||
}
|
||||
@ -175,6 +184,15 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
|
||||
case ESP_IMAGE_FLASH_SIZE_16MB:
|
||||
str = "16MB";
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_32MB:
|
||||
str = "32MB";
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_64MB:
|
||||
str = "64MB";
|
||||
break;
|
||||
case ESP_IMAGE_FLASH_SIZE_128MB:
|
||||
str = "128MB";
|
||||
break;
|
||||
default:
|
||||
str = "2MB";
|
||||
break;
|
||||
@ -203,6 +221,9 @@ esp_err_t bootloader_init_spi_flash(void)
|
||||
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
|
||||
bootloader_enable_qio_mode();
|
||||
#endif
|
||||
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
|
||||
#endif
|
||||
|
||||
print_flash_info(&bootloader_image_hdr);
|
||||
|
||||
@ -271,6 +292,10 @@ void bootloader_flash_hardware_init(void)
|
||||
bootloader_spi_flash_resume();
|
||||
bootloader_flash_unlock();
|
||||
|
||||
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
|
||||
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
|
||||
#endif
|
||||
|
||||
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
update_flash_config(&hdr);
|
||||
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
|
||||
|
@ -41,11 +41,13 @@
|
||||
#include "hal/cache_hal.h"
|
||||
#include "hal/clk_tree_ll.h"
|
||||
#include "hal/lpwdt_ll.h"
|
||||
#include "hal/spimem_flash_ll.h"
|
||||
#include "soc/lp_wdt_reg.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/regi2c_syspll.h"
|
||||
#include "soc/regi2c_cpll.h"
|
||||
#include "soc/regi2c_bias.h"
|
||||
#include "esp_private/periph_ctrl.h"
|
||||
|
||||
static const char *TAG = "boot.esp32p4";
|
||||
|
||||
@ -90,6 +92,7 @@ static void bootloader_super_wdt_auto_feed(void)
|
||||
|
||||
static inline void bootloader_hardware_init(void)
|
||||
{
|
||||
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
|
||||
// regi2c is enabled by default on ESP32P4, do nothing
|
||||
unsigned chip_version = efuse_hal_chip_revision();
|
||||
if (!ESP_CHIP_REV_ABOVE(chip_version, 1)) {
|
||||
@ -101,6 +104,12 @@ static inline void bootloader_hardware_init(void)
|
||||
}
|
||||
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1, 10);
|
||||
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 10);
|
||||
|
||||
// IDF-10019 TODO: This is temporarily for ESP32P4-ECO0, please remove it when eco0 is not widly used.
|
||||
if (likely(ESP_CHIP_REV_ABOVE(chip_version, 1))) {
|
||||
spimem_flash_ll_select_clk_source(0, FLASH_CLK_SRC_SPLL);
|
||||
spimem_ctrlr_ll_set_core_clock(0, 6);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void bootloader_ana_reset_config(void)
|
||||
|
@ -5,6 +5,6 @@ components/bootloader_support/test_apps/rtc_custom_section:
|
||||
- if: SOC_RTC_MEM_SUPPORTED == 1
|
||||
reason: this feature is supported on chips that have RTC memory
|
||||
disable:
|
||||
- if: IDF_TARGET == "esp32c61"
|
||||
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
|
||||
temporary: true
|
||||
reason: IDF-9260
|
||||
reason: target(s) is not supported yet # IDF-9260
|
||||
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -872,7 +872,11 @@ if(CONFIG_BT_ENABLED)
|
||||
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
|
||||
elseif(CONFIG_BT_CONTROLLER_ENABLED)
|
||||
if(CONFIG_IDF_TARGET_ESP32C6)
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a")
|
||||
else()
|
||||
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a")
|
||||
endif()
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
|
||||
endif()
|
||||
|
||||
|
@ -295,8 +295,8 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
|
||||
/**
|
||||
* transfer an message to another module in the different task.
|
||||
* @param msg message
|
||||
* @param arg paramter
|
||||
* @param arg_len length of paramter
|
||||
* @param arg parameter
|
||||
* @param arg_len length of parameter
|
||||
* @param copy_func deep copy function
|
||||
* @param free_func deep free function
|
||||
* @return BT_STATUS_SUCCESS: success
|
||||
@ -342,7 +342,7 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
|
||||
}
|
||||
|
||||
/**
|
||||
* transfer an message to another module in tha same task.
|
||||
* transfer an message to another module in the same task.
|
||||
* @param msg message
|
||||
* @return BT_STATUS_SUCCESS: success
|
||||
* others: fail
|
||||
|
@ -442,8 +442,10 @@ uint8_t esp_blufi_init(void)
|
||||
void esp_blufi_deinit(void)
|
||||
{
|
||||
blufi_env.enabled = false;
|
||||
btc_msg_t msg;
|
||||
esp_blufi_cb_param_t param;
|
||||
btc_msg_t msg;
|
||||
memset (&msg, 0x0, sizeof (msg));
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_BLUFI;
|
||||
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
|
||||
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;
|
||||
|
@ -200,8 +200,8 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
|
||||
bool "+15dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
bool "+18dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
|
||||
bool "+21dBm"
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_P20
|
||||
bool "+20dBm"
|
||||
endchoice
|
||||
|
||||
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
|
||||
@ -221,7 +221,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
|
||||
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
|
||||
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
|
||||
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
|
||||
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
|
||||
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P20
|
||||
default 0
|
||||
|
||||
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit e652624750341aca124e9f850e261b0c1ac63529
|
||||
Subproject commit e5c7ef0bf701d02c2203e26081fdd348d45935e5
|
@ -1 +1 @@
|
||||
Subproject commit d874f55e1132416fe18293ae1aa9ac73c40b3261
|
||||
Subproject commit 061e70c319576bf28b5695f5478dbe01ad18b18d
|
@ -1 +1 @@
|
||||
Subproject commit f95513f22be7b21429b01ba05dbfbc98097b5e67
|
||||
Subproject commit 3f15aa1d602aedf510dd9c686b3f7e5ea8a44002
|
@ -1 +1 @@
|
||||
Subproject commit 58a293a2b4c305157723908ea29c2776f5803bbc
|
||||
Subproject commit 50f567fff506f63b4d06ebea80d0405fe9e39568
|
@ -1309,7 +1309,6 @@ int bt_mesh_gatts_service_stop(struct bt_mesh_gatt_service *svc)
|
||||
{
|
||||
int rc;
|
||||
uint16_t handle;
|
||||
const ble_uuid_t *uuid;
|
||||
|
||||
if (!svc) {
|
||||
BT_ERR("%s, Invalid parameter", __func__);
|
||||
@ -1317,12 +1316,11 @@ int bt_mesh_gatts_service_stop(struct bt_mesh_gatt_service *svc)
|
||||
}
|
||||
|
||||
if (BLE_MESH_UUID_16(svc->attrs[0].user_data)->val == BT_UUID_MESH_PROXY_VAL) {
|
||||
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL);
|
||||
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL), &handle);
|
||||
} else {
|
||||
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL);
|
||||
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL), &handle);
|
||||
}
|
||||
|
||||
rc = ble_gatts_find_svc(uuid, &handle);
|
||||
assert(rc == 0);
|
||||
ble_gatts_svc_set_visibility(handle, 0);
|
||||
|
||||
@ -1336,15 +1334,13 @@ int bt_mesh_gatts_service_start(struct bt_mesh_gatt_service *svc)
|
||||
{
|
||||
int rc;
|
||||
uint16_t handle;
|
||||
const ble_uuid_t *uuid;
|
||||
|
||||
if (BLE_MESH_UUID_16(svc->attrs[0].user_data)->val == BT_UUID_MESH_PROXY_VAL) {
|
||||
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL);
|
||||
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL), &handle);
|
||||
} else {
|
||||
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL);
|
||||
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL), &handle);
|
||||
}
|
||||
|
||||
rc = ble_gatts_find_svc(uuid, &handle);
|
||||
assert(rc == 0);
|
||||
ble_gatts_svc_set_visibility(handle, 1);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -8,6 +8,8 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "esp_log.h"
|
||||
|
||||
#if CONFIG_BT_BLUEDROID_ENABLED
|
||||
#include "bta/bta_api.h"
|
||||
#endif
|
||||
@ -190,6 +192,11 @@ void bt_mesh_ext_mem_swap(void *buf, size_t length)
|
||||
sys_mem_swap(buf, length);
|
||||
}
|
||||
|
||||
uint32_t bt_mesh_ext_log_timestamp(void)
|
||||
{
|
||||
return esp_log_timestamp();
|
||||
}
|
||||
|
||||
/* Net buf */
|
||||
void bt_mesh_ext_buf_simple_init(struct net_buf_simple *buf, size_t reserve_head)
|
||||
{
|
||||
@ -498,6 +505,11 @@ float bt_mesh_ext_log2(float num)
|
||||
return bt_mesh_log2(num);
|
||||
}
|
||||
|
||||
const char *bt_mesh_ext_hex(const void *buf, size_t len)
|
||||
{
|
||||
return bt_hex(buf, len);
|
||||
}
|
||||
|
||||
/* Crypto */
|
||||
bool bt_mesh_ext_s1(const char *m, uint8_t salt[16])
|
||||
{
|
||||
@ -3954,6 +3966,8 @@ void bt_mesh_ext_mbt_server_cb_evt_to_btc(uint8_t event, void *model, void *ctx)
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint64_t config_ble_mesh_stack_trace_level : 3;
|
||||
|
||||
uint64_t config_ble_mesh_use_duplicate_scan : 1;
|
||||
uint64_t config_ble_mesh_pb_adv : 1;
|
||||
uint64_t config_ble_mesh_pb_gatt : 1;
|
||||
@ -4116,6 +4130,8 @@ typedef struct {
|
||||
} bt_mesh_ext_config_t;
|
||||
|
||||
static const bt_mesh_ext_config_t bt_mesh_ext_cfg = {
|
||||
.config_ble_mesh_stack_trace_level = BLE_MESH_LOG_LEVEL,
|
||||
|
||||
.config_ble_mesh_use_duplicate_scan = IS_ENABLED(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN),
|
||||
.config_ble_mesh_pb_adv = IS_ENABLED(CONFIG_BLE_MESH_PB_ADV),
|
||||
.config_ble_mesh_pb_gatt = IS_ENABLED(CONFIG_BLE_MESH_PB_GATT),
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 4934ca903807dd74f7f808dadcd9a478e18fc6c3
|
||||
Subproject commit 590bd6e3d2b20327138a96e44cf3da6d43a8abdc
|
@ -244,7 +244,8 @@ static void time_get(struct bt_mesh_model *model,
|
||||
change.time_status.subsecond = srv->state->time.subsecond;
|
||||
change.time_status.uncertainty = srv->state->time.uncertainty;
|
||||
change.time_status.time_authority = srv->state->time.time_authority;
|
||||
change.time_status.tai_utc_delta_curr = srv->state->time.subsecond;
|
||||
change.time_status.tai_utc_delta_curr = srv->state->time.tai_utc_delta_curr;
|
||||
change.time_status.time_zone_offset_curr = srv->state->time.time_zone_offset_curr;
|
||||
bt_mesh_time_scene_server_cb_evt_to_btc(BTC_BLE_MESH_EVT_TIME_SCENE_SERVER_STATE_CHANGE,
|
||||
model, ctx, (const uint8_t *)&change, sizeof(change));
|
||||
|
||||
@ -386,7 +387,8 @@ static void time_set(struct bt_mesh_model *model,
|
||||
change.time_set.subsecond = srv->state->time.subsecond;
|
||||
change.time_set.uncertainty = srv->state->time.uncertainty;
|
||||
change.time_set.time_authority = srv->state->time.time_authority;
|
||||
change.time_set.tai_utc_delta_curr = srv->state->time.subsecond;
|
||||
change.time_set.tai_utc_delta_curr = srv->state->time.tai_utc_delta_curr;
|
||||
change.time_set.time_zone_offset_curr = srv->state->time.time_zone_offset_curr;
|
||||
break;
|
||||
case BLE_MESH_MODEL_OP_TIME_ZONE_SET:
|
||||
change.time_zone_set.time_zone_offset_new = srv->state->time.time_zone_offset_new;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -15,6 +15,24 @@
|
||||
|
||||
#if (defined BTC_SDP_INCLUDED && BTC_SDP_INCLUDED == TRUE)
|
||||
|
||||
static bool esp_sdp_record_integrity_check(esp_bluetooth_sdp_record_t *record)
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
if (record != NULL) {
|
||||
if (record->hdr.service_name_length > ESP_SDP_SERVER_NAME_MAX ||
|
||||
strlen(record->hdr.service_name) + 1 != record->hdr.service_name_length) {
|
||||
LOG_ERROR("Invalid server name!\n");
|
||||
ret = false;
|
||||
}
|
||||
} else {
|
||||
LOG_ERROR("record is NULL!\n");
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
esp_err_t esp_sdp_register_callback(esp_sdp_cb_t callback)
|
||||
{
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
@ -85,9 +103,7 @@ esp_err_t esp_sdp_create_record(esp_bluetooth_sdp_record_t *record)
|
||||
{
|
||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||
|
||||
if (record == NULL || record->hdr.service_name_length > ESP_SDP_SERVER_NAME_MAX
|
||||
|| strlen(record->hdr.service_name)+1 != record->hdr.service_name_length) {
|
||||
LOG_ERROR("Invalid server name!\n");
|
||||
if (!esp_sdp_record_integrity_check(record)) {
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
|
||||
@ -100,7 +116,7 @@ esp_err_t esp_sdp_create_record(esp_bluetooth_sdp_record_t *record)
|
||||
msg.act = BTC_SDP_ACT_CREATE_RECORD;
|
||||
|
||||
memset(&arg, 0, sizeof(btc_sdp_args_t));
|
||||
arg.creat_record.record = (bluetooth_sdp_record *)record;
|
||||
arg.create_record.record = (bluetooth_sdp_record *)record;
|
||||
|
||||
/* Switch to BTC context */
|
||||
stat = btc_transfer_context(&msg, &arg, sizeof(btc_sdp_args_t),
|
||||
|
@ -242,6 +242,7 @@ typedef union {
|
||||
*/
|
||||
struct gatts_rsp_evt_param {
|
||||
esp_gatt_status_t status; /*!< Operation status */
|
||||
uint16_t conn_id; /*!< Connection id */
|
||||
uint16_t handle; /*!< Attribute handle which send response */
|
||||
} rsp; /*!< Gatt server callback param of ESP_GATTS_RESPONSE_EVT */
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -17,6 +17,17 @@ extern "C" {
|
||||
#define ESP_SDP_SERVER_NAME_MAX 32 /*!< Service name max length */
|
||||
#define SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH 15 /*!< OPP supported format list maximum length */
|
||||
|
||||
#define ESP_SDP_UUID_MAP_MAS 0x1132 /*!< Message Access Service UUID */
|
||||
#define ESP_SDP_UUID_MAP_MNS 0x1133 /*!< Message Notification Service UUID */
|
||||
#define ESP_SDP_UUID_PBAP_PSE 0x112F /*!< Phone Book Server Equipment UUID */
|
||||
#define ESP_SDP_UUID_PBAP_PCE 0x112E /*!< Phone Book Client Equipment UUID */
|
||||
#define ESP_SDP_UUID_OPP 0x1105 /*!< Object Push Profile UUID */
|
||||
#define ESP_SDP_UUID_SAP 0x112D /*!< SIM Access Profile UUID */
|
||||
#define ESP_SDP_UUID_DIP 0x1200 /*!< Device Identification Profile UUID */
|
||||
|
||||
#define ESP_SDP_BUILD_BT_UUID16(uuid16_val) \
|
||||
(esp_bt_uuid_t) { .len = ESP_UUID_LEN_16, .uuid = {.uuid16 = (uint16_t)(uuid16_val),}, }
|
||||
|
||||
typedef enum {
|
||||
ESP_SDP_SUCCESS = 0, /*!< Successful operation. */
|
||||
ESP_SDP_FAILURE, /*!< Generic failure. */
|
||||
@ -31,7 +42,7 @@ typedef enum {
|
||||
*/
|
||||
typedef enum {
|
||||
ESP_SDP_INIT_EVT = 0, /*!< When SDP is initialized, the event comes */
|
||||
ESP_SDP_DEINIT_EVT = 1, /*!< When SDP is deinitialized, the event comes */
|
||||
ESP_SDP_DEINIT_EVT = 1, /*!< When SDP is de-initialized, the event comes */
|
||||
ESP_SDP_SEARCH_COMP_EVT = 2, /*!< When SDP search complete, the event comes */
|
||||
ESP_SDP_CREATE_RECORD_COMP_EVT = 3, /*!< When create SDP records complete, the event comes */
|
||||
ESP_SDP_REMOVE_RECORD_COMP_EVT = 4, /*!< When remove a SDP record complete, the event comes */
|
||||
@ -47,27 +58,24 @@ typedef enum {
|
||||
ESP_SDP_TYPE_PBAP_PSE, /*!< Phone Book Profile - Server */
|
||||
ESP_SDP_TYPE_PBAP_PCE, /*!< Phone Book Profile - Client */
|
||||
ESP_SDP_TYPE_OPP_SERVER, /*!< Object Push Profile */
|
||||
ESP_SDP_TYPE_SAP_SERVER /*!< SIM Access Profile */
|
||||
ESP_SDP_TYPE_SAP_SERVER, /*!< SIM Access Profile */
|
||||
} esp_bluetooth_sdp_types_t;
|
||||
|
||||
/**
|
||||
* @brief Some signals need additional pointers, hence we introduce a
|
||||
* generic way to handle these pointers.
|
||||
* @brief SDP header structure
|
||||
*/
|
||||
typedef struct bluetooth_sdp_hdr_overlay {
|
||||
esp_bluetooth_sdp_types_t type; /*!< SDP type */
|
||||
esp_bt_uuid_t uuid; /*!< UUID type, include uuid and uuid length */
|
||||
esp_bt_uuid_t uuid; /*!< UUID type, include uuid and uuid length, only needed to be set for RAW record creation */
|
||||
uint32_t service_name_length; /*!< Service name length */
|
||||
char *service_name; /*!< service name */
|
||||
int32_t rfcomm_channel_number; /*!< rfcomm channel number, if not used set to -1*/
|
||||
int32_t l2cap_psm; /*!< l2cap psm, if not used set to -1 */
|
||||
int32_t profile_version; /*!< profile version */
|
||||
|
||||
// User pointers, only used for some signals - see esp_bluetooth_sdp_ops_record_t
|
||||
int user1_ptr_len; /*!< see esp_bluetooth_sdp_ops_record_t */
|
||||
uint8_t *user1_ptr; /*!< see esp_bluetooth_sdp_ops_record_t */
|
||||
int user2_ptr_len; /*!< see esp_bluetooth_sdp_ops_record_t */
|
||||
uint8_t *user2_ptr; /*!< see esp_bluetooth_sdp_ops_record_t */
|
||||
char *service_name; /*!< Service name */
|
||||
int32_t rfcomm_channel_number; /*!< RFCOMM channel number, if not used set to -1*/
|
||||
int32_t l2cap_psm; /*!< L2CAP psm, if not used set to -1 */
|
||||
int32_t profile_version; /*!< Profile version */
|
||||
int user1_ptr_len; /*!< User data1 length, only used for searching RAW record */
|
||||
uint8_t *user1_ptr; /*!< User data1 pointer to the raw SDP response data, only used for searching RAW record */
|
||||
int user2_ptr_len; /*!< User data2 length, only used for searching RAW record */
|
||||
uint8_t *user2_ptr; /*!< User data2 pointer, only used for searching RAW record */
|
||||
} esp_bluetooth_sdp_hdr_overlay_t;
|
||||
|
||||
/**
|
||||
@ -93,7 +101,7 @@ typedef struct bluetooth_sdp_mns_record {
|
||||
*/
|
||||
typedef struct bluetooth_sdp_pse_record {
|
||||
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
|
||||
uint32_t supported_features; /*!< Pbap Supported Features */
|
||||
uint32_t supported_features; /*!< PBAP Supported Features */
|
||||
uint32_t supported_repositories; /*!< Supported Repositories */
|
||||
} esp_bluetooth_sdp_pse_record_t;
|
||||
|
||||
@ -141,23 +149,23 @@ typedef union {
|
||||
* @brief ESP_SDP_INIT_EVT
|
||||
*/
|
||||
struct sdp_init_evt_param {
|
||||
esp_sdp_status_t status; /*!< status */
|
||||
esp_sdp_status_t status; /*!< Status */
|
||||
} init; /*!< SDP callback param of ESP_SDP_INIT_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_SDP_DEINIT_EVT
|
||||
*/
|
||||
struct sdp_deinit_evt_param {
|
||||
esp_sdp_status_t status; /*!< status */
|
||||
esp_sdp_status_t status; /*!< Status */
|
||||
} deinit; /*!< SDP callback param of ESP_SDP_DEINIT_EVT */
|
||||
|
||||
/**
|
||||
* @brief ESP_SDP_SEARCH_COMP_EVT
|
||||
*/
|
||||
struct sdp_search_evt_param {
|
||||
esp_sdp_status_t status; /*!< status */
|
||||
esp_bd_addr_t remote_addr; /*!< remote device address */
|
||||
esp_bt_uuid_t sdp_uuid; /*!< service uuid */
|
||||
esp_sdp_status_t status; /*!< Status */
|
||||
esp_bd_addr_t remote_addr; /*!< Remote device address */
|
||||
esp_bt_uuid_t sdp_uuid; /*!< Service uuid */
|
||||
int record_count; /*!< Number of SDP records */
|
||||
esp_bluetooth_sdp_record_t *records; /*!< SDP records */
|
||||
} search; /*!< SDP callback param of ESP_SDP_SEARCH_COMP_EVT */
|
||||
@ -165,8 +173,8 @@ typedef union {
|
||||
/**
|
||||
* @brief ESP_SDP_CREATE_RECORD_COMP_EVT
|
||||
*/
|
||||
struct sdp_crate_record_evt_param {
|
||||
esp_sdp_status_t status; /*!< status */
|
||||
struct sdp_create_record_evt_param {
|
||||
esp_sdp_status_t status; /*!< Status */
|
||||
int record_handle; /*!< SDP record handle */
|
||||
} create_record; /*!< SDP callback param of ESP_SDP_CREATE_RECORD_COMP_EVT */
|
||||
|
||||
@ -174,11 +182,10 @@ typedef union {
|
||||
* @brief ESP_SDP_REMOVE_RECORD_COMP_EVT
|
||||
*/
|
||||
struct sdp_remove_record_evt_param {
|
||||
esp_sdp_status_t status; /*!< status */
|
||||
esp_sdp_status_t status; /*!< Status */
|
||||
} remove_record; /*!< SDP callback param of ESP_SDP_REMOVE_RECORD_COMP_EVT */
|
||||
|
||||
} esp_sdp_cb_param_t; /*!< SDP callback parameter union type */
|
||||
|
||||
} esp_sdp_cb_param_t;
|
||||
|
||||
/**
|
||||
* @brief SDP callback function type.
|
||||
|
@ -127,9 +127,6 @@ void bta_av_del_rc(tBTA_AV_RCB *p_rcb)
|
||||
}
|
||||
/* else ACP && connected. do not clear the handle yet */
|
||||
AVRC_Close(rc_handle);
|
||||
if (rc_handle == bta_av_cb.rc_acp_handle) {
|
||||
bta_av_cb.rc_acp_handle = BTA_AV_RC_HANDLE_NONE;
|
||||
}
|
||||
APPL_TRACE_EVENT("end del_rc handle: %d status=0x%x, rc_acp_handle:%d, lidx:%d",
|
||||
p_rcb->handle, p_rcb->status, bta_av_cb.rc_acp_handle, p_rcb->lidx);
|
||||
}
|
||||
@ -302,7 +299,7 @@ UINT8 bta_av_rc_create(tBTA_AV_CB *p_cb, UINT8 role, UINT8 shdl, UINT8 lidx)
|
||||
bda = p_scb->peer_addr;
|
||||
status = BTA_AV_RC_ROLE_INT;
|
||||
} else {
|
||||
if ((p_rcb = bta_av_get_rcb_by_shdl(shdl)) != NULL ) {
|
||||
if (shdl != 0 && ((p_rcb = bta_av_get_rcb_by_shdl(shdl)) != NULL)) {
|
||||
APPL_TRACE_ERROR("bta_av_rc_create ACP handle exist for shdl:%d", shdl);
|
||||
return p_rcb->handle;
|
||||
}
|
||||
@ -1143,7 +1140,7 @@ void bta_av_conn_chg(tBTA_AV_DATA *p_data)
|
||||
p_data->conn_chg.peer_addr[5]);
|
||||
if (p_lcb_rc->conn_msk && bdcmp(p_lcb_rc->addr, p_data->conn_chg.peer_addr) == 0) {
|
||||
/* AVRCP is already connected.
|
||||
* need to update the association betwen SCB and RCB */
|
||||
* need to update the association between SCB and RCB */
|
||||
p_lcb_rc->conn_msk = 0; /* indicate RC ONLY is not connected */
|
||||
p_lcb_rc->lidx = 0;
|
||||
p_scb->rc_handle = p_cb->rc_acp_handle;
|
||||
@ -1636,6 +1633,8 @@ void bta_av_rc_disc_done(tBTA_AV_DATA *p_data)
|
||||
}
|
||||
} else {
|
||||
p_cb->rcb[rc_handle].peer_features = peer_features;
|
||||
p_cb->rcb[rc_handle].peer_ct_features = peer_ct_features;
|
||||
p_cb->rcb[rc_handle].peer_tg_features = peer_tg_features;
|
||||
rc_feat.rc_handle = rc_handle;
|
||||
rc_feat.peer_features = peer_features;
|
||||
rc_feat.peer_ct_features = peer_ct_features;
|
||||
@ -1711,7 +1710,8 @@ void bta_av_rc_closed(tBTA_AV_DATA *p_data)
|
||||
bta_av_del_rc(p_rcb);
|
||||
|
||||
/* if the AVRCP is no longer listening, create the listening channel */
|
||||
if (bta_av_cb.rc_acp_handle == BTA_AV_RC_HANDLE_NONE && bta_av_cb.features & BTA_AV_FEAT_RCTG) {
|
||||
if (bta_av_cb.rc_acp_handle == p_msg->handle && bta_av_cb.features & BTA_AV_FEAT_RCTG) {
|
||||
bta_av_cb.rc_acp_handle = BTA_AV_RC_HANDLE_NONE;
|
||||
bta_av_rc_create(&bta_av_cb, AVCT_ACP, 0, BTA_AV_NUM_LINKS + 1);
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "stack/btm_api.h"
|
||||
#include "btm_int.h"
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include "bta/utl.h"
|
||||
#include "osi/allocator.h"
|
||||
|
||||
@ -1091,17 +1092,62 @@ tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
|
||||
if (bta_dm_di_cb.di_num < BTA_DI_NUM_MAX) {
|
||||
if (SDP_SetLocalDiRecord((tSDP_DI_RECORD *)p_device_info, p_handle) == SDP_SUCCESS) {
|
||||
if (!p_device_info->primary_record) {
|
||||
bta_dm_di_cb.di_handle[bta_dm_di_cb.di_num] = *p_handle;
|
||||
for (uint8_t i = 1; i < BTA_DI_NUM_MAX; i++) {
|
||||
if (!bta_dm_di_cb.di_handle[i]) {
|
||||
bta_dm_di_cb.di_handle[i] = *p_handle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
bta_dm_di_cb.di_num++;
|
||||
} else if (!bta_dm_di_cb.di_handle[0]) {
|
||||
bta_dm_di_cb.di_handle[0] = *p_handle;
|
||||
bta_dm_di_cb.di_num++;
|
||||
} else {
|
||||
assert(bta_dm_di_cb.di_handle[0] == (*p_handle));
|
||||
}
|
||||
|
||||
if (!bta_dm_di_cb.uuid_added) {
|
||||
bta_sys_add_uuid(UUID_SERVCLASS_PNP_INFORMATION);
|
||||
bta_dm_di_cb.uuid_added = TRUE;
|
||||
}
|
||||
|
||||
status = BTA_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmRemoveLocalDiRecord
|
||||
**
|
||||
** Description This function removes a DI record from the local SDP database.
|
||||
**
|
||||
** Returns BTA_SUCCESS if record is removed successfully, otherwise error code.
|
||||
**
|
||||
*******************************************************************************/
|
||||
tBTA_STATUS BTA_DmRemoveLocalDiRecord(UINT32 handle)
|
||||
{
|
||||
tBTA_STATUS status = BTA_FAILURE;
|
||||
|
||||
for (uint8_t i = 0; i < BTA_DI_NUM_MAX; i++) {
|
||||
if (bta_dm_di_cb.di_handle[i] == handle) {
|
||||
if (SDP_DeleteRecord(handle)) {
|
||||
bta_dm_di_cb.di_handle[i] = 0;
|
||||
bta_dm_di_cb.di_num--;
|
||||
status = BTA_SUCCESS;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bta_dm_di_cb.di_num == 0 && bta_dm_di_cb.uuid_added) {
|
||||
bta_sys_remove_uuid(UUID_SERVCLASS_PNP_INFORMATION);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif ///SDP_INCLUDED == TRUE
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
@ -1590,6 +1590,7 @@ typedef struct {
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
tSDP_DISCOVERY_DB *p_di_db; /* pointer to the DI discovery database */
|
||||
#endif ///SDP_INCLUDED == TRUE
|
||||
BOOLEAN uuid_added;
|
||||
UINT8 di_num; /* total local DI record number */
|
||||
UINT32 di_handle[BTA_DI_NUM_MAX]; /* local DI record handle, the first one is primary record */
|
||||
} tBTA_DM_DI_CB;
|
||||
|
@ -2190,6 +2190,17 @@ extern UINT16 BTA_DmGetConnectionState( BD_ADDR bd_addr );
|
||||
*******************************************************************************/
|
||||
extern tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
|
||||
UINT32 *p_handle );
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_DmRemoveLocalDiRecord
|
||||
**
|
||||
** Description This function removes a DI record from the local SDP database.
|
||||
**
|
||||
** Returns BTA_SUCCESS if record is removed successfully, otherwise error code.
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern tBTA_STATUS BTA_DmRemoveLocalDiRecord(UINT32 handle);
|
||||
#endif ///SDP_INCLUDED == TRUE
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
@ -41,7 +41,7 @@ typedef UINT8 tBTA_SDP_STATUS;
|
||||
/* SDP I/F callback events */
|
||||
/* events received by tBTA_SDP_DM_CBACK */
|
||||
#define BTA_SDP_ENABLE_EVT 0 /* SDP service enabled */
|
||||
#define BTA_SDP_DISENABLE_EVT 1 /* SDP service disenabled */
|
||||
#define BTA_SDP_DISABLE_EVT 1 /* SDP service disenabled */
|
||||
#define BTA_SDP_SEARCH_EVT 2 /* SDP search started */
|
||||
#define BTA_SDP_SEARCH_COMP_EVT 3 /* SDP search complete */
|
||||
#define BTA_SDP_CREATE_RECORD_USER_EVT 4 /* SDP create record complete */
|
||||
@ -67,10 +67,17 @@ typedef struct {
|
||||
int handle;
|
||||
} tBTA_SDP_CREATE_RECORD_USER;
|
||||
|
||||
/* data associated with BTA_SDP_REMOVE_RECORD_USER_EVT */
|
||||
typedef struct {
|
||||
tBTA_SDP_STATUS status;
|
||||
int handle;
|
||||
} tBTA_SDP_REMOVE_RECORD_USER;
|
||||
|
||||
typedef union {
|
||||
tBTA_SDP_STATUS status; /* BTA_SDP_SEARCH_EVT */
|
||||
tBTA_SDP_SEARCH_COMP sdp_search_comp; /* BTA_SDP_SEARCH_COMP_EVT */
|
||||
tBTA_SDP_CREATE_RECORD_USER sdp_create_record; /* BTA_SDP_CREATE_RECORD_USER_EVT */
|
||||
tBTA_SDP_REMOVE_RECORD_USER sdp_remove_record; /* BTA_SDP_REMOVE_RECORD_USER_EVT */
|
||||
} tBTA_SDP;
|
||||
|
||||
/* SDP DM Interface callback */
|
||||
@ -78,8 +85,10 @@ typedef void (tBTA_SDP_DM_CBACK)(tBTA_SDP_EVT event, tBTA_SDP *p_data, void *use
|
||||
|
||||
/* MCE configuration structure */
|
||||
typedef struct {
|
||||
UINT16 sdp_raw_size; /* The size of p_sdp_raw_data */
|
||||
UINT16 sdp_db_size; /* The size of p_sdp_db */
|
||||
#if (SDP_INCLUDED == TRUE)
|
||||
UINT8 *p_sdp_raw_data; /* The data buffer to keep raw data */
|
||||
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
|
||||
#endif ///SDP_INCLUDED == TRUE
|
||||
} tBTA_SDP_CFG;
|
||||
@ -108,14 +117,28 @@ extern tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback);
|
||||
**
|
||||
** Function BTA_SdpDisable
|
||||
**
|
||||
** Description Disable the SDP search I/F service.
|
||||
** Description This function is used to request a callback to perform disable
|
||||
** operation. The registered callback will be called with event
|
||||
** BTA_SDP_DISABLE_EVT.
|
||||
**
|
||||
** Returns BTA_SDP_SUCCESS, if the request is being processed.
|
||||
** BTA_SDP_FAILURE, otherwise.
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern tBTA_SDP_STATUS BTA_SdpDisable(void);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function BTA_SdpCleanup
|
||||
**
|
||||
** Description Cleanup the SDP search I/F service.
|
||||
** Free buffer for SDP configuration structure.
|
||||
**
|
||||
** Returns BTA_SDP_SUCCESS if successful.
|
||||
** BTA_SDP_FAIL if internal failure.
|
||||
**
|
||||
*******************************************************************************/
|
||||
extern tBTA_SDP_STATUS BTA_SdpDisable(void);
|
||||
extern tBTA_SDP_STATUS BTA_SdpCleanup(void);
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
|
@ -53,6 +53,7 @@ const tBTA_SDP_ACTION bta_sdp_action[] = {
|
||||
bta_sdp_search, /* BTA_SDP_API_SEARCH_EVT */
|
||||
bta_sdp_create_record, /* BTA_SDP_API_CREATE_RECORD_USER_EVT */
|
||||
bta_sdp_remove_record, /* BTA_SDP_API_REMOVE_RECORD_USER_EVT */
|
||||
bta_sdp_disable, /* BTA_SDP_API_DISABLE_EVT */
|
||||
};
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -363,8 +363,8 @@ static void bta_create_raw_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_RE
|
||||
|
||||
/* Try to extract a service name */
|
||||
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_NAME)) != NULL) {
|
||||
record->pse.hdr.service_name_length = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
|
||||
record->pse.hdr.service_name = (char *)p_attr->attr_value.v.array;
|
||||
record->hdr.service_name_length = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
|
||||
record->hdr.service_name = (char *)p_attr->attr_value.v.array;
|
||||
}
|
||||
|
||||
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_GOEP_L2CAP_PSM)) != NULL) {
|
||||
@ -373,9 +373,9 @@ static void bta_create_raw_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_RE
|
||||
|
||||
/* Try to extract an RFCOMM channel */
|
||||
if (SDP_FindProtocolListElemInRec(p_rec, UUID_PROTOCOL_RFCOMM, &pe)) {
|
||||
record->pse.hdr.rfcomm_channel_number = pe.params[0];
|
||||
record->hdr.rfcomm_channel_number = pe.params[0];
|
||||
}
|
||||
record->hdr.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_size;
|
||||
record->hdr.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_used;
|
||||
record->hdr.user1_ptr = p_bta_sdp_cfg->p_sdp_db->raw_data;
|
||||
}
|
||||
|
||||
@ -526,6 +526,10 @@ void bta_sdp_search(tBTA_SDP_MSG *p_data)
|
||||
SDP_InitDiscoveryDb (p_bta_sdp_cfg->p_sdp_db, p_bta_sdp_cfg->sdp_db_size, 1,
|
||||
bta_sdp_search_uuid, 0, NULL);
|
||||
|
||||
/* tell SDP to keep the raw data */
|
||||
p_bta_sdp_cfg->p_sdp_db->raw_size = p_bta_sdp_cfg->sdp_raw_size;
|
||||
p_bta_sdp_cfg->p_sdp_db->raw_data = p_bta_sdp_cfg->p_sdp_raw_data;
|
||||
|
||||
if (!SDP_ServiceSearchAttributeRequest2(p_data->get_search.bd_addr, p_bta_sdp_cfg->p_sdp_db,
|
||||
bta_sdp_search_cback, (void *)bta_sdp_search_uuid)) {
|
||||
bta_sdp_cb.sdp_active = BTA_SDP_ACTIVE_NONE;
|
||||
@ -558,7 +562,7 @@ void bta_sdp_create_record(tBTA_SDP_MSG *p_data)
|
||||
APPL_TRACE_DEBUG("%s() event: %d\n", __func__, p_data->record.hdr.event);
|
||||
tBTA_SDP_CREATE_RECORD_USER bta_sdp = {0};
|
||||
bta_sdp.status = BTA_SDP_SUCCESS;
|
||||
bta_sdp.handle = (int)p_data->record.user_data;
|
||||
bta_sdp.handle = -1;
|
||||
if (bta_sdp_cb.p_dm_cback) {
|
||||
bta_sdp_cb.p_dm_cback(BTA_SDP_CREATE_RECORD_USER_EVT, (tBTA_SDP *)&bta_sdp, p_data->record.user_data);
|
||||
}
|
||||
@ -576,10 +580,30 @@ void bta_sdp_create_record(tBTA_SDP_MSG *p_data)
|
||||
void bta_sdp_remove_record(tBTA_SDP_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_DEBUG("%s() event: %d\n", __func__, p_data->record.hdr.event);
|
||||
tBTA_SDP_REMOVE_RECORD_USER bta_sdp;
|
||||
bta_sdp.status = BTA_SDP_SUCCESS;
|
||||
bta_sdp.handle = -1;
|
||||
if (bta_sdp_cb.p_dm_cback) {
|
||||
bta_sdp_cb.p_dm_cback(BTA_SDP_REMOVE_RECORD_USER_EVT, (tBTA_SDP *)&bta_sdp, p_data->record.user_data);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
** Function bta_sdp_disable
|
||||
**
|
||||
** Description Removes an SDP record
|
||||
**
|
||||
** Returns void
|
||||
**
|
||||
*******************************************************************************/
|
||||
void bta_sdp_disable(tBTA_SDP_MSG *p_data)
|
||||
{
|
||||
APPL_TRACE_DEBUG("%s()\n", __func__);
|
||||
tBTA_SDP bta_sdp;
|
||||
bta_sdp.status = BTA_SDP_SUCCESS;
|
||||
if (bta_sdp_cb.p_dm_cback) {
|
||||
bta_sdp_cb.p_dm_cback(BTA_SDP_REMOVE_RECORD_USER_EVT, &bta_sdp, p_data->record.user_data);
|
||||
bta_sdp_cb.p_dm_cback(BTA_SDP_DISABLE_EVT, &bta_sdp, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,9 @@ tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback)
|
||||
#if BTA_DYNAMIC_MEMORY == TRUE
|
||||
/* Malloc buffer for SDP configuration structure */
|
||||
p_bta_sdp_cfg->p_sdp_db = (tSDP_DISCOVERY_DB *)osi_malloc(p_bta_sdp_cfg->sdp_db_size);
|
||||
if (p_bta_sdp_cfg->p_sdp_db == NULL) {
|
||||
p_bta_sdp_cfg->p_sdp_raw_data = (UINT8 *)osi_malloc(p_bta_sdp_cfg->sdp_raw_size);
|
||||
if (p_bta_sdp_cfg->p_sdp_db == NULL || p_bta_sdp_cfg->p_sdp_raw_data == NULL) {
|
||||
BTA_SdpCleanup();
|
||||
return BTA_SDP_FAILURE;
|
||||
}
|
||||
#endif
|
||||
@ -101,15 +103,34 @@ tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback)
|
||||
*******************************************************************************/
|
||||
tBTA_SDP_STATUS BTA_SdpDisable(void)
|
||||
{
|
||||
BT_HDR *p_buf = NULL;
|
||||
tBTA_SDP_STATUS status = BTA_SDP_SUCCESS;
|
||||
|
||||
if ((p_buf = (BT_HDR *)osi_malloc(sizeof(BT_HDR))) != NULL) {
|
||||
p_buf->event = BTA_SDP_API_DISABLE_EVT;
|
||||
bta_sys_sendmsg(p_buf);
|
||||
status = BTA_SDP_FAILURE;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
tBTA_SDP_STATUS BTA_SdpCleanup(void)
|
||||
{
|
||||
bta_sys_deregister(BTA_ID_SDP);
|
||||
#if BTA_DYNAMIC_MEMORY == TRUE
|
||||
/* Free buffer for SDP configuration structure */
|
||||
if (p_bta_sdp_cfg->p_sdp_db) {
|
||||
osi_free(p_bta_sdp_cfg->p_sdp_db);
|
||||
p_bta_sdp_cfg->p_sdp_db = NULL;
|
||||
}
|
||||
|
||||
if (p_bta_sdp_cfg->p_sdp_raw_data) {
|
||||
osi_free(p_bta_sdp_cfg->p_sdp_raw_data);
|
||||
p_bta_sdp_cfg->p_sdp_raw_data = NULL;
|
||||
}
|
||||
#endif
|
||||
return (status);
|
||||
return BTA_SDP_SUCCESS;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -30,16 +30,24 @@
|
||||
#define BTA_SDP_DB_SIZE 1500
|
||||
#endif
|
||||
|
||||
#ifndef BTA_SDP_RAW_DATA_SIZE
|
||||
#define BTA_SDP_RAW_DATA_SIZE 1024
|
||||
#endif
|
||||
|
||||
#if BTA_DYNAMIC_MEMORY == FALSE
|
||||
static UINT8 bta_sdp_raw_data[BTA_SDP_RAW_DATA_SIZE];
|
||||
static UINT8 __attribute__ ((aligned(4))) bta_sdp_db_data[BTA_SDP_DB_SIZE];
|
||||
#endif
|
||||
|
||||
/* SDP configuration structure */
|
||||
tBTA_SDP_CFG bta_sdp_cfg = {
|
||||
BTA_SDP_RAW_DATA_SIZE,
|
||||
BTA_SDP_DB_SIZE,
|
||||
#if BTA_DYNAMIC_MEMORY == FALSE
|
||||
bta_sdp_raw_data,
|
||||
(tSDP_DISCOVERY_DB *)bta_sdp_db_data /* The data buffer to keep SDP database */
|
||||
#else
|
||||
NULL,
|
||||
NULL
|
||||
#endif
|
||||
};
|
||||
|
@ -42,6 +42,7 @@ enum {
|
||||
BTA_SDP_API_SEARCH_EVT,
|
||||
BTA_SDP_API_CREATE_RECORD_USER_EVT,
|
||||
BTA_SDP_API_REMOVE_RECORD_USER_EVT,
|
||||
BTA_SDP_API_DISABLE_EVT,
|
||||
BTA_SDP_MAX_INT_EVT
|
||||
};
|
||||
|
||||
@ -105,6 +106,7 @@ extern void bta_sdp_enable (tBTA_SDP_MSG *p_data);
|
||||
extern void bta_sdp_search (tBTA_SDP_MSG *p_data);
|
||||
extern void bta_sdp_create_record(tBTA_SDP_MSG *p_data);
|
||||
extern void bta_sdp_remove_record(tBTA_SDP_MSG *p_data);
|
||||
extern void bta_sdp_disable(tBTA_SDP_MSG *p_data);
|
||||
|
||||
#endif ///SDP_INCLUDED == TRUE
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -40,7 +40,7 @@ static void btc_rc_upstreams_evt(UINT16 event, tAVRC_COMMAND *pavrc_cmd, UINT8 c
|
||||
** Static variables
|
||||
******************************************************************************/
|
||||
|
||||
/* flag indicating wheter TG/CT is initialized */
|
||||
/* flag indicating whether TG/CT is initialized */
|
||||
static uint32_t s_rc_ct_init;
|
||||
static uint32_t s_rc_tg_init;
|
||||
|
||||
@ -751,7 +751,7 @@ static void btc_rc_upstreams_evt(UINT16 event, tAVRC_COMMAND *pavrc_cmd, UINT8 c
|
||||
|
||||
btc_rc_cb.rc_ntf[event_id - 1].registered = TRUE;
|
||||
btc_rc_cb.rc_ntf[event_id - 1].label = label;
|
||||
BTC_TRACE_EVENT("%s: New registerd notification: event_id:0x%x, label:0x%x",
|
||||
BTC_TRACE_EVENT("%s: New register notification: event_id:0x%x, label:0x%x",
|
||||
__FUNCTION__, event_id, label);
|
||||
|
||||
// set up callback
|
||||
@ -947,7 +947,7 @@ void btc_rc_handler(tBTA_AV_EVT event, tBTA_AV *p_data)
|
||||
memset(¶m, 0, sizeof(esp_avrc_ct_cb_param_t));
|
||||
param.conn_stat.connected = true;
|
||||
memcpy(param.conn_stat.remote_bda, btc_rc_cb.rc_addr, sizeof(esp_bd_addr_t));
|
||||
btc_avrc_tg_cb_to_app(ESP_AVRC_CT_CONNECTION_STATE_EVT, ¶m);
|
||||
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_CONNECTION_STATE_EVT, ¶m);
|
||||
}
|
||||
} while (0);
|
||||
btc_rc_cb.rc_features = p_data->rc_feat.peer_features;
|
||||
@ -1041,7 +1041,7 @@ static void btc_avrc_ct_deinit(void)
|
||||
BTC_TRACE_API("## %s ##", __FUNCTION__);
|
||||
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT shuold deinit in advance of A2DP !!!");
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
|
||||
@ -1255,7 +1255,7 @@ static bt_status_t btc_avrc_ct_send_passthrough_cmd(uint8_t tl, uint8_t key_code
|
||||
BTA_AvRemoteCmd(btc_rc_cb.rc_handle, tl,
|
||||
(tBTA_AV_RC)key_code, (tBTA_AV_STATE)key_state);
|
||||
status = BT_STATUS_SUCCESS;
|
||||
BTC_TRACE_API("%s: succesfully sent passthrough command to BTA", __FUNCTION__);
|
||||
BTC_TRACE_API("%s: successfully sent passthrough command to BTA", __FUNCTION__);
|
||||
} else {
|
||||
status = BT_STATUS_FAIL;
|
||||
BTC_TRACE_DEBUG("%s: feature not supported", __FUNCTION__);
|
||||
@ -1298,7 +1298,7 @@ static void btc_avrc_tg_init(void)
|
||||
}
|
||||
|
||||
if (g_a2dp_on_init) {
|
||||
BTC_TRACE_WARNING("AVRC Taget is expected to be initialized in advance of A2DP !!!");
|
||||
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1320,7 +1320,7 @@ static void btc_avrc_tg_deinit(void)
|
||||
BTC_TRACE_API("## %s ##", __FUNCTION__);
|
||||
|
||||
if (g_a2dp_on_deinit) {
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG shuold deinit in advance of A2DP !!!");
|
||||
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
|
||||
}
|
||||
|
||||
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -469,7 +469,7 @@ static esp_gatt_status_t btc_gatts_check_valid_attr_tab(esp_gatts_attr_db_t *gat
|
||||
if(gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_16 &&
|
||||
gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_32 &&
|
||||
gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_128) {
|
||||
BTC_TRACE_ERROR("%s, The Charateristic uuid length = %d is invalid", __func__,\
|
||||
BTC_TRACE_ERROR("%s, The Characteristic uuid length = %d is invalid", __func__,\
|
||||
gatts_attr_db[i+1].att_desc.uuid_length);
|
||||
return ESP_GATT_INVALID_ATTR_LEN;
|
||||
}
|
||||
@ -481,7 +481,7 @@ static esp_gatt_status_t btc_gatts_check_valid_attr_tab(esp_gatts_attr_db_t *gat
|
||||
uuid == ESP_GATT_UUID_CHAR_SRVR_CONFIG || uuid == ESP_GATT_UUID_CHAR_PRESENT_FORMAT ||
|
||||
uuid == ESP_GATT_UUID_CHAR_AGG_FORMAT || uuid == ESP_GATT_UUID_CHAR_VALID_RANGE ||
|
||||
uuid == ESP_GATT_UUID_EXT_RPT_REF_DESCR || uuid == ESP_GATT_UUID_RPT_REF_DESCR) {
|
||||
BTC_TRACE_ERROR("%s, The charateristic value uuid = %d is invalid", __func__, uuid);
|
||||
BTC_TRACE_ERROR("%s, The characteristic value uuid = %d is invalid", __func__, uuid);
|
||||
return ESP_GATT_INVALID_PDU;
|
||||
}
|
||||
}
|
||||
@ -694,6 +694,7 @@ void btc_gatts_call_handler(btc_msg_t *msg)
|
||||
}
|
||||
|
||||
param.rsp.status = 0;
|
||||
param.rsp.conn_id = BTC_GATT_GET_CONN_ID(arg->send_rsp.conn_id);
|
||||
btc_gatts_cb_to_app(ESP_GATTS_RESPONSE_EVT, BTC_GATT_GET_GATT_IF(arg->send_rsp.conn_id), ¶m);
|
||||
break;
|
||||
}
|
||||
|
@ -34,37 +34,25 @@ typedef enum {
|
||||
SDP_TYPE_PBAP_PSE, // Phone Book Profile - Server
|
||||
SDP_TYPE_PBAP_PCE, // Phone Book Profile - Client
|
||||
SDP_TYPE_OPP_SERVER, // Object Push Profile
|
||||
SDP_TYPE_SAP_SERVER // SIM Access Profile
|
||||
SDP_TYPE_SAP_SERVER, // SIM Access Profile
|
||||
} bluetooth_sdp_types;
|
||||
|
||||
typedef struct _bluetooth_sdp_hdr {
|
||||
bluetooth_sdp_types type;
|
||||
esp_bt_uuid_t uuid;
|
||||
uint32_t service_name_length;
|
||||
char *service_name;
|
||||
int32_t rfcomm_channel_number;
|
||||
int32_t l2cap_psm;
|
||||
int32_t profile_version;
|
||||
} bluetooth_sdp_hdr;
|
||||
|
||||
/**
|
||||
* Some signals need additional pointers, hence we introduce a
|
||||
* generic way to handle these pointers.
|
||||
*/
|
||||
typedef struct _bluetooth_sdp_hdr_overlay {
|
||||
bluetooth_sdp_types type;
|
||||
esp_bt_uuid_t bt_uuid;
|
||||
esp_bt_uuid_t uuid;
|
||||
uint32_t service_name_length;
|
||||
char *service_name;
|
||||
int32_t rfcomm_channel_number;
|
||||
int32_t l2cap_psm;
|
||||
int32_t profile_version;
|
||||
|
||||
// User pointers, only used for some signals - see bluetooth_sdp_ops_record
|
||||
int user1_ptr_len;
|
||||
uint8_t *user1_ptr;
|
||||
int user2_ptr_len;
|
||||
uint8_t *user2_ptr;
|
||||
int user2_ptr_len; // not used
|
||||
uint8_t *user2_ptr; // not used
|
||||
} bluetooth_sdp_hdr_overlay;
|
||||
|
||||
typedef struct _bluetooth_sdp_mas_record {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -32,9 +32,9 @@ typedef union {
|
||||
} search;
|
||||
|
||||
//BTC_SDP_ACT_CREATE_RECORD
|
||||
struct creat_record_arg {
|
||||
struct create_record_arg {
|
||||
bluetooth_sdp_record *record;
|
||||
} creat_record;
|
||||
} create_record;
|
||||
|
||||
//BTC_SDP_ACT_REMOVE_RECORD
|
||||
struct remove_record_arg {
|
||||
|
@ -25,12 +25,14 @@ typedef enum {
|
||||
} sdp_state_t;
|
||||
|
||||
typedef struct {
|
||||
sdp_state_t state;
|
||||
uint8_t state;
|
||||
int sdp_handle;
|
||||
bluetooth_sdp_record* record_data;
|
||||
esp_bt_uuid_t uuid;
|
||||
void* record_data;
|
||||
} sdp_slot_t;
|
||||
|
||||
typedef struct {
|
||||
bool search_allowed;
|
||||
sdp_slot_t *sdp_slots[SDP_MAX_RECORDS];
|
||||
osi_mutex_t sdp_slot_mutex;
|
||||
} sdp_local_param_t;
|
||||
@ -48,6 +50,21 @@ static sdp_local_param_t *sdp_local_param_ptr;
|
||||
#define is_sdp_init() (&sdp_local_param != NULL && sdp_local_param.sdp_slot_mutex != NULL)
|
||||
#endif
|
||||
|
||||
static void btc_sdp_cleanup(void)
|
||||
{
|
||||
#if SDP_DYNAMIC_MEMORY == TRUE
|
||||
if (sdp_local_param_ptr) {
|
||||
#endif
|
||||
if (sdp_local_param.sdp_slot_mutex) {
|
||||
osi_mutex_free(&sdp_local_param.sdp_slot_mutex);
|
||||
sdp_local_param.sdp_slot_mutex = NULL;
|
||||
}
|
||||
#if SDP_DYNAMIC_MEMORY == TRUE
|
||||
osi_free(sdp_local_param_ptr);
|
||||
sdp_local_param_ptr = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void btc_sdp_cb_to_app(esp_sdp_cb_event_t event, esp_sdp_cb_param_t *param)
|
||||
{
|
||||
@ -57,46 +74,25 @@ static inline void btc_sdp_cb_to_app(esp_sdp_cb_event_t event, esp_sdp_cb_param_
|
||||
}
|
||||
}
|
||||
|
||||
static void sdp_disable_handler(void)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
bt_status_t status;
|
||||
|
||||
msg.sig = BTC_SIG_API_CB;
|
||||
msg.pid = BTC_PID_SDP;
|
||||
msg.act = BTA_SDP_DISENABLE_EVT;
|
||||
|
||||
status = btc_transfer_context(&msg, NULL, 0, NULL, NULL);
|
||||
|
||||
if (status != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
static int get_sdp_records_size(bluetooth_sdp_record* in_record, int count)
|
||||
static int get_sdp_record_size(bluetooth_sdp_record* in_record)
|
||||
{
|
||||
bluetooth_sdp_record *record = in_record;
|
||||
int records_size = 0;
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
record = &in_record[i];
|
||||
records_size += sizeof(bluetooth_sdp_record);
|
||||
records_size += record->hdr.service_name_length;
|
||||
if (record->hdr.service_name_length > 0) {
|
||||
records_size++; /* + '\0' termination of string */
|
||||
}
|
||||
records_size += record->hdr.user1_ptr_len;
|
||||
records_size += record->hdr.user2_ptr_len;
|
||||
}
|
||||
|
||||
return records_size;
|
||||
}
|
||||
|
||||
static void set_sdp_handle(int id, int handle)
|
||||
static void set_sdp_slot_info(int id, int sdp_handle, esp_bt_uuid_t *uuid)
|
||||
{
|
||||
sdp_slot_t *slot = NULL;
|
||||
|
||||
BTC_TRACE_DEBUG("%s() id=%d to handle=0x%08x", __func__, id, handle);
|
||||
BTC_TRACE_DEBUG("%s() id=%d to sdp_handle=0x%08x", __func__, id, sdp_handle);
|
||||
|
||||
if(id >= SDP_MAX_RECORDS) {
|
||||
BTC_TRACE_ERROR("%s() failed - id %d is invalid", __func__, id);
|
||||
@ -104,34 +100,64 @@ static void set_sdp_handle(int id, int handle)
|
||||
}
|
||||
|
||||
osi_mutex_lock(&sdp_local_param.sdp_slot_mutex, OSI_MUTEX_MAX_TIMEOUT);
|
||||
|
||||
do {
|
||||
slot = sdp_local_param.sdp_slots[id];
|
||||
if (slot == NULL) {
|
||||
osi_mutex_unlock(&sdp_local_param.sdp_slot_mutex);
|
||||
BTC_TRACE_ERROR("%s() id=%d to handle=0x%08x, set failed", __func__, id, handle);
|
||||
return;
|
||||
BTC_TRACE_ERROR("%s() id = %d ", __func__, id);
|
||||
break;
|
||||
}
|
||||
slot->sdp_handle = handle;
|
||||
|
||||
if (slot->state != SDP_RECORD_ALLOCED) {
|
||||
BTC_TRACE_ERROR("%s() failed - state for id %d is state = %d expected %d", __func__, id,
|
||||
sdp_local_param.sdp_slots[id]->state, SDP_RECORD_ALLOCED);
|
||||
break;
|
||||
}
|
||||
slot->sdp_handle = sdp_handle;
|
||||
slot->record_data = NULL;
|
||||
if (uuid) {
|
||||
memcpy(&slot->uuid, uuid, sizeof(esp_bt_uuid_t));
|
||||
} else {
|
||||
memset(&slot->uuid, 0, sizeof(esp_bt_uuid_t));
|
||||
}
|
||||
} while (0);
|
||||
|
||||
osi_mutex_unlock(&sdp_local_param.sdp_slot_mutex);
|
||||
}
|
||||
|
||||
|
||||
static bool get_sdp_record_by_handle(int handle, bluetooth_sdp_record* record)
|
||||
static void get_sdp_slot_info(int id, int *sdp_handle, esp_bt_uuid_t *uuid)
|
||||
{
|
||||
sdp_slot_t *slot = NULL;
|
||||
|
||||
if(id >= SDP_MAX_RECORDS) {
|
||||
BTC_TRACE_ERROR("%s() failed - id %d is invalid", __func__, id);
|
||||
return;
|
||||
}
|
||||
|
||||
osi_mutex_lock(&sdp_local_param.sdp_slot_mutex, OSI_MUTEX_MAX_TIMEOUT);
|
||||
|
||||
for (int i = 0; i < SDP_MAX_RECORDS; i++) {
|
||||
slot = sdp_local_param.sdp_slots[i];
|
||||
if ((slot != NULL) && (slot->sdp_handle == handle)) {
|
||||
memcpy(record, slot->record_data, sizeof(bluetooth_sdp_record));
|
||||
osi_mutex_unlock(&sdp_local_param.sdp_slot_mutex);
|
||||
return true;
|
||||
}
|
||||
do {
|
||||
slot = sdp_local_param.sdp_slots[id];
|
||||
if (slot == NULL) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (slot->state != SDP_RECORD_ALLOCED) {
|
||||
BTC_TRACE_ERROR("%s() failed - state for id %d is state = %d expected %d", __func__, id,
|
||||
sdp_local_param.sdp_slots[id]->state, SDP_RECORD_ALLOCED);
|
||||
break;
|
||||
}
|
||||
|
||||
if (sdp_handle) {
|
||||
*sdp_handle = slot->sdp_handle;
|
||||
}
|
||||
|
||||
if (uuid) {
|
||||
memcpy(uuid, &slot->uuid, sizeof(esp_bt_uuid_t));
|
||||
}
|
||||
} while (0);
|
||||
|
||||
osi_mutex_unlock(&sdp_local_param.sdp_slot_mutex);
|
||||
return false;
|
||||
}
|
||||
|
||||
static int get_sdp_slot_id_by_handle(int handle)
|
||||
@ -152,9 +178,10 @@ static int get_sdp_slot_id_by_handle(int handle)
|
||||
return -1;
|
||||
}
|
||||
|
||||
static sdp_slot_t *start_create_sdp(int id)
|
||||
static bluetooth_sdp_record *start_create_sdp(int id)
|
||||
{
|
||||
sdp_slot_t *sdp_slot = NULL;
|
||||
sdp_slot_t *slot = NULL;
|
||||
bluetooth_sdp_record* record_data = NULL;
|
||||
|
||||
if(id >= SDP_MAX_RECORDS) {
|
||||
BTC_TRACE_ERROR("%s() failed - id %d is invalid", __func__, id);
|
||||
@ -162,62 +189,58 @@ static sdp_slot_t *start_create_sdp(int id)
|
||||
}
|
||||
|
||||
osi_mutex_lock(&sdp_local_param.sdp_slot_mutex, OSI_MUTEX_MAX_TIMEOUT);
|
||||
sdp_slot = sdp_local_param.sdp_slots[id];
|
||||
if (sdp_slot == NULL) {
|
||||
|
||||
do {
|
||||
slot = sdp_local_param.sdp_slots[id];
|
||||
if (slot == NULL) {
|
||||
BTC_TRACE_ERROR("%s() id = %d ", __func__, id);
|
||||
} else if(sdp_slot->state != SDP_RECORD_ALLOCED) {
|
||||
BTC_TRACE_ERROR("%s() failed - state for id %d is state = %d expected %d", __func__,
|
||||
id, sdp_local_param.sdp_slots[id]->state, SDP_RECORD_ALLOCED);
|
||||
/* The record have been removed before this event occurred - e.g. deinit */
|
||||
sdp_slot = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (slot->state != SDP_RECORD_ALLOCED) {
|
||||
BTC_TRACE_ERROR("%s() failed - state for id %d is state = %d expected %d", __func__, id,
|
||||
sdp_local_param.sdp_slots[id]->state, SDP_RECORD_ALLOCED);
|
||||
break;
|
||||
}
|
||||
record_data = slot->record_data;
|
||||
} while (0);
|
||||
|
||||
osi_mutex_unlock(&sdp_local_param.sdp_slot_mutex);
|
||||
|
||||
return sdp_slot;
|
||||
return record_data;
|
||||
}
|
||||
|
||||
/* Deep copy all content of in_records into out_records.
|
||||
* out_records must point to a chunk of memory large enough to contain all
|
||||
* the data. Use getSdpRecordsSize() to calculate the needed size. */
|
||||
static void copy_sdp_records(bluetooth_sdp_record* in_records, bluetooth_sdp_record* out_records, int count)
|
||||
static void copy_sdp_record_common(bluetooth_sdp_record* in_record, bluetooth_sdp_record* out_record)
|
||||
{
|
||||
bluetooth_sdp_record *in_record;
|
||||
bluetooth_sdp_record *out_record;
|
||||
char *free_ptr = (char*)(&out_records[count]); /* set pointer to after the last entry */
|
||||
uint8_t *free_ptr = (uint8_t *)(out_record + 1); /* set pointer to after the last entry */
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
in_record = &in_records[i];
|
||||
out_record = &out_records[i];
|
||||
*out_record = *in_record;
|
||||
memcpy(out_record, in_record, sizeof(bluetooth_sdp_record));
|
||||
|
||||
if (in_record->hdr.service_name == NULL || in_record->hdr.service_name_length == 0) {
|
||||
out_record->hdr.service_name = NULL;
|
||||
out_record->hdr.service_name_length = 0;
|
||||
} else {
|
||||
out_record->hdr.service_name = free_ptr; // Update service_name pointer
|
||||
out_record->hdr.service_name = (char *)free_ptr; // Update service_name pointer
|
||||
// Copy string
|
||||
memcpy(free_ptr, in_record->hdr.service_name, in_record->hdr.service_name_length);
|
||||
free_ptr += in_record->hdr.service_name_length;
|
||||
*(free_ptr) = '\0'; // Set '\0' termination of string
|
||||
free_ptr++;
|
||||
}
|
||||
if(in_record->hdr.user1_ptr != NULL) {
|
||||
out_record->hdr.user1_ptr = (UINT8*)free_ptr; // Update pointer
|
||||
memcpy(free_ptr, in_record->hdr.user1_ptr, in_record->hdr.user1_ptr_len); // Copy content
|
||||
free_ptr += in_record->hdr.user1_ptr_len;
|
||||
}
|
||||
if(in_record->hdr.user2_ptr != NULL) {
|
||||
out_record->hdr.user2_ptr = (UINT8*)free_ptr; // Update pointer
|
||||
memcpy(free_ptr, in_record->hdr.user2_ptr, in_record->hdr.user2_ptr_len); // Copy content
|
||||
free_ptr += in_record->hdr.user2_ptr_len;
|
||||
}
|
||||
}
|
||||
|
||||
static void copy_sdp_record(bluetooth_sdp_record* in_record, bluetooth_sdp_record* out_record)
|
||||
{
|
||||
copy_sdp_record_common(in_record, out_record);
|
||||
}
|
||||
|
||||
static int alloc_sdp_slot(bluetooth_sdp_record* in_record)
|
||||
{
|
||||
int i;
|
||||
int record_size = get_sdp_records_size(in_record, 1);
|
||||
int record_size = get_sdp_record_size(in_record);
|
||||
bluetooth_sdp_record *record = NULL;
|
||||
sdp_slot_t **slot = NULL;
|
||||
|
||||
@ -227,11 +250,10 @@ static int alloc_sdp_slot(bluetooth_sdp_record* in_record)
|
||||
return -1;
|
||||
}
|
||||
|
||||
copy_sdp_records(in_record, record, 1);
|
||||
copy_sdp_record(in_record, record);
|
||||
|
||||
osi_mutex_lock(&sdp_local_param.sdp_slot_mutex, OSI_MUTEX_MAX_TIMEOUT);
|
||||
for(i = 0; i < SDP_MAX_RECORDS; i++)
|
||||
{
|
||||
for (i = 0; i < SDP_MAX_RECORDS; i++) {
|
||||
slot = &sdp_local_param.sdp_slots[i];
|
||||
if ((*slot) == NULL) {
|
||||
if (((*slot) = (sdp_slot_t *)osi_malloc(sizeof(sdp_slot_t))) == NULL) {
|
||||
@ -301,6 +323,7 @@ static int add_raw_sdp(const bluetooth_sdp_record* rec)
|
||||
UINT8 temp[LEN_UUID_128];
|
||||
UINT8* p_temp = temp;
|
||||
UINT32 sdp_handle = 0;
|
||||
const esp_bt_uuid_t *p_uuid = &rec->hdr.uuid;
|
||||
|
||||
BTC_TRACE_DEBUG("%s(): scn 0x%02x, psm = 0x%04x\n service name %s", __func__,
|
||||
rec->hdr.rfcomm_channel_number, rec->hdr.l2cap_psm, rec->hdr.service_name);
|
||||
@ -310,15 +333,15 @@ static int add_raw_sdp(const bluetooth_sdp_record* rec)
|
||||
return sdp_handle;
|
||||
}
|
||||
|
||||
if (rec->hdr.bt_uuid.len == ESP_UUID_LEN_16) {
|
||||
if (p_uuid->len == ESP_UUID_LEN_16) {
|
||||
UINT8_TO_BE_STREAM (p_temp, (UUID_DESC_TYPE << 3) | SIZE_TWO_BYTES);
|
||||
UINT16_TO_BE_STREAM (p_temp, rec->hdr.bt_uuid.uuid.uuid16);
|
||||
} else if (rec->hdr.bt_uuid.len == ESP_UUID_LEN_32) {
|
||||
UINT16_TO_BE_STREAM (p_temp, p_uuid->uuid.uuid16);
|
||||
} else if (p_uuid->len == ESP_UUID_LEN_32) {
|
||||
UINT8_TO_BE_STREAM (p_temp, (UUID_DESC_TYPE << 3) | SIZE_FOUR_BYTES);
|
||||
UINT32_TO_BE_STREAM (p_temp, rec->hdr.bt_uuid.uuid.uuid32);
|
||||
} else if (rec->hdr.bt_uuid.len == ESP_UUID_LEN_128) {
|
||||
UINT32_TO_BE_STREAM (p_temp, p_uuid->uuid.uuid32);
|
||||
} else if (p_uuid->len == ESP_UUID_LEN_128) {
|
||||
UINT8_TO_BE_STREAM (p_temp, (UUID_DESC_TYPE << 3) | SIZE_SIXTEEN_BYTES);
|
||||
ARRAY_TO_BE_STREAM (p_temp, rec->hdr.bt_uuid.uuid.uuid128, LEN_UUID_128);
|
||||
ARRAY_TO_BE_STREAM (p_temp, p_uuid->uuid.uuid128, LEN_UUID_128);
|
||||
} else {
|
||||
SDP_DeleteRecord(sdp_handle);
|
||||
sdp_handle = 0;
|
||||
@ -357,7 +380,7 @@ static int add_raw_sdp(const bluetooth_sdp_record* rec)
|
||||
UINT_DESC_TYPE, (UINT32)2, temp);
|
||||
}
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -365,12 +388,12 @@ static int add_raw_sdp(const bluetooth_sdp_record* rec)
|
||||
sdp_handle = 0;
|
||||
BTC_TRACE_ERROR("%s() FAILED, status = %d", __func__, status);
|
||||
} else {
|
||||
if (rec->hdr.bt_uuid.len == ESP_UUID_LEN_16) {
|
||||
bta_sys_add_uuid(rec->hdr.bt_uuid.uuid.uuid16);
|
||||
} else if (rec->hdr.bt_uuid.len == ESP_UUID_LEN_32) {
|
||||
bta_sys_add_uuid_32(rec->hdr.bt_uuid.uuid.uuid32);
|
||||
} else if (rec->hdr.bt_uuid.len == ESP_UUID_LEN_128) {
|
||||
bta_sys_add_uuid_128((UINT8 *)&rec->hdr.bt_uuid.uuid.uuid128);
|
||||
if (p_uuid->len == ESP_UUID_LEN_16) {
|
||||
bta_sys_add_uuid(p_uuid->uuid.uuid16);
|
||||
} else if (p_uuid->len == ESP_UUID_LEN_32) {
|
||||
bta_sys_add_uuid_32(p_uuid->uuid.uuid32);
|
||||
} else if (p_uuid->len == ESP_UUID_LEN_128) {
|
||||
bta_sys_add_uuid_128((UINT8 *)&p_uuid->uuid.uuid128);
|
||||
}
|
||||
BTC_TRACE_DEBUG("%s(): SDP Registered (handle 0x%08x)", __func__, sdp_handle);
|
||||
}
|
||||
@ -448,7 +471,7 @@ static int add_maps_sdp(const bluetooth_sdp_mas_record* rec)
|
||||
UINT_DESC_TYPE, (UINT32)2, temp);
|
||||
}
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -523,7 +546,7 @@ static int add_mapc_sdp(const bluetooth_sdp_mns_record* rec)
|
||||
UINT_DESC_TYPE, (UINT32)2, temp);
|
||||
}
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -603,7 +626,7 @@ static int add_pbaps_sdp(const bluetooth_sdp_pse_record* rec)
|
||||
UINT_DESC_TYPE, (UINT32)2, temp);
|
||||
}
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -649,7 +672,7 @@ static int add_pbapc_sdp(const bluetooth_sdp_pce_record* rec)
|
||||
UUID_SERVCLASS_PHONE_ACCESS,
|
||||
rec->hdr.profile_version);
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -736,7 +759,7 @@ static int add_opps_sdp(const bluetooth_sdp_ops_record* rec)
|
||||
UINT_DESC_TYPE, (UINT32)2, temp);
|
||||
}
|
||||
|
||||
/* Make the service browseable */
|
||||
/* Make the service browsable */
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -799,7 +822,7 @@ static int add_saps_sdp(const bluetooth_sdp_sap_record* rec)
|
||||
UUID_SERVCLASS_SAP,
|
||||
rec->hdr.profile_version);
|
||||
|
||||
// Make the service browseable
|
||||
// Make the service browsable
|
||||
status &= SDP_AddUuidSequence (sdp_handle, ATTR_ID_BROWSE_GROUP_LIST, 1, &browse);
|
||||
|
||||
if (!status) {
|
||||
@ -816,64 +839,183 @@ static int add_saps_sdp(const bluetooth_sdp_sap_record* rec)
|
||||
|
||||
static int btc_handle_create_record_event(int id)
|
||||
{
|
||||
int handle = -1;
|
||||
const sdp_slot_t *sdp_slot = NULL;
|
||||
int sdp_handle = 0;
|
||||
bluetooth_sdp_record *record = start_create_sdp(id);
|
||||
esp_bt_uuid_t service_uuid = {0};
|
||||
|
||||
BTC_TRACE_DEBUG("Sdp Server %s", __func__);
|
||||
|
||||
sdp_slot = start_create_sdp(id);
|
||||
if(sdp_slot != NULL) {
|
||||
bluetooth_sdp_record* record = sdp_slot->record_data;
|
||||
if (record != NULL) {
|
||||
switch (record->hdr.type) {
|
||||
case SDP_TYPE_RAW:
|
||||
handle = add_raw_sdp(record);
|
||||
sdp_handle = add_raw_sdp(record);
|
||||
memcpy(&service_uuid, &record->hdr.uuid, sizeof(esp_bt_uuid_t));
|
||||
break;
|
||||
case SDP_TYPE_MAP_MAS:
|
||||
handle = add_maps_sdp(&record->mas);
|
||||
sdp_handle = add_maps_sdp(&record->mas);
|
||||
service_uuid.len = ESP_UUID_LEN_16;
|
||||
service_uuid.uuid.uuid16 = UUID_SERVCLASS_MESSAGE_ACCESS;
|
||||
break;
|
||||
case SDP_TYPE_MAP_MNS:
|
||||
handle = add_mapc_sdp(&record->mns);
|
||||
sdp_handle = add_mapc_sdp(&record->mns);
|
||||
service_uuid.len = ESP_UUID_LEN_16;
|
||||
service_uuid.uuid.uuid16 = UUID_SERVCLASS_MESSAGE_NOTIFICATION;
|
||||
break;
|
||||
case SDP_TYPE_PBAP_PSE:
|
||||
handle = add_pbaps_sdp(&record->pse);
|
||||
sdp_handle = add_pbaps_sdp(&record->pse);
|
||||
service_uuid.len = ESP_UUID_LEN_16;
|
||||
service_uuid.uuid.uuid16 = UUID_SERVCLASS_PBAP_PSE;
|
||||
break;
|
||||
case SDP_TYPE_PBAP_PCE:
|
||||
handle = add_pbapc_sdp(&record->pce);
|
||||
sdp_handle = add_pbapc_sdp(&record->pce);
|
||||
service_uuid.len = ESP_UUID_LEN_16;
|
||||
service_uuid.uuid.uuid16 = UUID_SERVCLASS_PBAP_PCE;
|
||||
break;
|
||||
case SDP_TYPE_OPP_SERVER:
|
||||
handle = add_opps_sdp(&record->ops);
|
||||
sdp_handle = add_opps_sdp(&record->ops);
|
||||
service_uuid.len = ESP_UUID_LEN_16;
|
||||
service_uuid.uuid.uuid16 = UUID_SERVCLASS_OBEX_OBJECT_PUSH;
|
||||
break;
|
||||
case SDP_TYPE_SAP_SERVER:
|
||||
handle = add_saps_sdp(&record->sap);
|
||||
sdp_handle = add_saps_sdp(&record->sap);
|
||||
service_uuid.len = ESP_UUID_LEN_16;
|
||||
service_uuid.uuid.uuid16 = UUID_SERVCLASS_SAP;
|
||||
break;
|
||||
default:
|
||||
BTC_TRACE_DEBUG("Record type %d is not supported", record->hdr.type);
|
||||
break;
|
||||
}
|
||||
if(handle != -1) {
|
||||
set_sdp_handle(id, handle);
|
||||
|
||||
if(sdp_handle != 0) {
|
||||
set_sdp_slot_info(id, sdp_handle, &service_uuid);
|
||||
// free the record, since not use it anymore
|
||||
osi_free(record);
|
||||
} else {
|
||||
sdp_handle = -1;
|
||||
}
|
||||
} else {
|
||||
sdp_handle = -1;
|
||||
}
|
||||
|
||||
return handle;
|
||||
if (sdp_handle == -1) {
|
||||
free_sdp_slot(id);
|
||||
}
|
||||
|
||||
static bool btc_sdp_remove_record_event(int handle)
|
||||
return sdp_handle;
|
||||
}
|
||||
|
||||
static bool btc_sdp_remove_record_event(int id, int *p_sdp_handle)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
BTC_TRACE_DEBUG("Sdp Server %s", __func__);
|
||||
|
||||
if(handle != -1 && handle != 0) {
|
||||
result = SDP_DeleteRecord(handle);
|
||||
if(result == false) {
|
||||
BTC_TRACE_ERROR(" Unable to remove handle 0x%08x", handle);
|
||||
bool result = false;
|
||||
int sdp_handle = -1;
|
||||
esp_bt_uuid_t service_uuid = {0};
|
||||
|
||||
get_sdp_slot_info(id, &sdp_handle, &service_uuid);
|
||||
|
||||
if (sdp_handle > 0) {
|
||||
do {
|
||||
result = SDP_DeleteRecord(sdp_handle);
|
||||
if (!result) {
|
||||
BTC_TRACE_ERROR("Unable to remove handle 0x%08x", sdp_handle);
|
||||
break;
|
||||
}
|
||||
|
||||
if (service_uuid.len == ESP_UUID_LEN_16) {
|
||||
bta_sys_remove_uuid(service_uuid.uuid.uuid16);
|
||||
} else if (service_uuid.len == ESP_UUID_LEN_32) {
|
||||
bta_sys_remove_uuid_32(service_uuid.uuid.uuid32);
|
||||
} else if (service_uuid.len == ESP_UUID_LEN_128) {
|
||||
bta_sys_remove_uuid_128((UINT8 *)&service_uuid.uuid.uuid128);
|
||||
}
|
||||
} while (0);
|
||||
|
||||
if (p_sdp_handle) {
|
||||
*p_sdp_handle = sdp_handle;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void btc_sdp_cb_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
{
|
||||
switch (msg->act) {
|
||||
case BTA_SDP_SEARCH_COMP_EVT: {
|
||||
tBTA_SDP_SEARCH_COMP *src_search_comp = (tBTA_SDP_SEARCH_COMP *)p_src;
|
||||
tBTA_SDP_SEARCH_COMP *dest_search_comp = (tBTA_SDP_SEARCH_COMP *)p_dest;
|
||||
int record_count = src_search_comp->record_count;
|
||||
|
||||
for (int i = 0; i < record_count; i++) {
|
||||
bluetooth_sdp_record *src_record = &src_search_comp->records[i];
|
||||
bluetooth_sdp_record *dest_record = &dest_search_comp->records[i];
|
||||
// deep copy service name
|
||||
uint32_t src_service_name_length = src_record->hdr.service_name_length;
|
||||
char *src_service_name = src_record->hdr.service_name;
|
||||
dest_record->hdr.service_name_length = 0;
|
||||
dest_record->hdr.service_name = NULL;
|
||||
if (src_service_name && src_service_name_length) {
|
||||
char *service_name = (char *)osi_malloc(src_service_name_length + 1);
|
||||
if (service_name) {
|
||||
memcpy(service_name, src_service_name, src_service_name_length);
|
||||
service_name[src_service_name_length] = '\0';
|
||||
|
||||
dest_record->hdr.service_name_length = src_service_name_length;
|
||||
dest_record->hdr.service_name = service_name;
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s malloc service name failed, orig service name:%s", __func__, src_service_name);
|
||||
}
|
||||
}
|
||||
|
||||
// deep copy user1_ptr fow RAW type
|
||||
int src_user1_ptr_len = src_record->hdr.user1_ptr_len;
|
||||
uint8_t *src_user1_ptr = src_record->hdr.user1_ptr;
|
||||
dest_record->hdr.user1_ptr_len = 0;
|
||||
dest_record->hdr.user1_ptr = NULL;
|
||||
if (src_record->hdr.type == SDP_TYPE_RAW && src_user1_ptr && src_user1_ptr_len) {
|
||||
uint8_t *user1_ptr = (uint8_t *)osi_malloc(src_user1_ptr_len);
|
||||
if (user1_ptr) {
|
||||
memcpy(user1_ptr, src_user1_ptr, src_user1_ptr_len);
|
||||
|
||||
dest_record->hdr.user1_ptr_len = src_user1_ptr_len;
|
||||
dest_record->hdr.user1_ptr = user1_ptr;
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s malloc user1_ptr failed", __func__);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_sdp_cb_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
switch (msg->act) {
|
||||
case BTA_SDP_SEARCH_COMP_EVT: {
|
||||
tBTA_SDP_SEARCH_COMP *search_comp = (tBTA_SDP_SEARCH_COMP *)msg->arg;
|
||||
for (size_t i = 0; i < search_comp->record_count; i++) {
|
||||
bluetooth_sdp_record *record = &search_comp->records[i];
|
||||
if (record->hdr.service_name) {
|
||||
osi_free(record->hdr.service_name);
|
||||
}
|
||||
|
||||
if (record->hdr.user1_ptr) {
|
||||
osi_free(record->hdr.user1_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void btc_sdp_dm_cback(tBTA_SDP_EVT event, tBTA_SDP* p_data, void* user_data)
|
||||
{
|
||||
btc_msg_t msg;
|
||||
@ -881,18 +1023,18 @@ static void btc_sdp_dm_cback(tBTA_SDP_EVT event, tBTA_SDP* p_data, void* user_da
|
||||
|
||||
switch (event) {
|
||||
case BTA_SDP_CREATE_RECORD_USER_EVT: {
|
||||
if (p_data->status == BTA_SDP_SUCCESS) {
|
||||
if (p_data->sdp_create_record.status == BTA_SDP_SUCCESS) {
|
||||
p_data->sdp_create_record.handle = btc_handle_create_record_event((int)user_data);
|
||||
if (p_data->sdp_create_record.handle < 0) {
|
||||
p_data->status = BTA_SDP_FAILURE;
|
||||
p_data->sdp_create_record.status = BTA_SDP_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BTA_SDP_REMOVE_RECORD_USER_EVT: {
|
||||
if (p_data->status == BTA_SDP_SUCCESS) {
|
||||
if (btc_sdp_remove_record_event((int)user_data) == false) {
|
||||
p_data->status = BTA_SDP_FAILURE;
|
||||
if (p_data->sdp_remove_record.status == BTA_SDP_SUCCESS) {
|
||||
if (btc_sdp_remove_record_event((int)user_data, &p_data->sdp_remove_record.handle) == false) {
|
||||
p_data->sdp_remove_record.status = BTA_SDP_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -905,7 +1047,7 @@ static void btc_sdp_dm_cback(tBTA_SDP_EVT event, tBTA_SDP* p_data, void* user_da
|
||||
msg.pid = BTC_PID_SDP;
|
||||
msg.act = event;
|
||||
|
||||
status = btc_transfer_context(&msg, p_data, sizeof(tBTA_SDP), NULL, NULL);
|
||||
status = btc_transfer_context(&msg, p_data, sizeof(tBTA_SDP), btc_sdp_cb_arg_deep_copy, btc_sdp_cb_arg_deep_free);
|
||||
|
||||
if (status != BT_STATUS_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s btc_transfer_context failed", __func__);
|
||||
@ -930,23 +1072,27 @@ static void btc_sdp_init(void)
|
||||
ret = ESP_SDP_NO_RESOURCE;
|
||||
break;
|
||||
}
|
||||
memset((void *)sdp_local_param_ptr, 0, sizeof(sdp_local_param_t));
|
||||
#endif
|
||||
memset(&sdp_local_param, 0, sizeof(sdp_local_param_t));
|
||||
|
||||
if (osi_mutex_new(&sdp_local_param.sdp_slot_mutex) != 0) {
|
||||
#if SDP_DYNAMIC_MEMORY == TRUE
|
||||
osi_free(sdp_local_param_ptr);
|
||||
sdp_local_param_ptr = NULL;
|
||||
#endif
|
||||
BTC_TRACE_ERROR("%s osi_mutex_new failed\n", __func__);
|
||||
ret = ESP_SDP_NO_RESOURCE;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = BTA_SdpEnable(btc_sdp_dm_cback);
|
||||
if (ret != ESP_SDP_SUCCESS) {
|
||||
BTC_TRACE_ERROR("%s BTA_SdpEnable failed, ret = %d\n", __func__, ret);
|
||||
ret = ESP_SDP_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
sdp_local_param.search_allowed = true;
|
||||
} while(0);
|
||||
|
||||
if (ret != ESP_SDP_SUCCESS) {
|
||||
btc_sdp_cleanup();
|
||||
param.init.status = ret;
|
||||
btc_sdp_cb_to_app(ESP_SDP_INIT_EVT, ¶m);
|
||||
}
|
||||
@ -956,7 +1102,6 @@ static void btc_sdp_deinit(void)
|
||||
{
|
||||
esp_sdp_cb_param_t param;
|
||||
esp_sdp_status_t ret = ESP_SDP_SUCCESS;
|
||||
int handle;
|
||||
|
||||
do {
|
||||
if (!is_sdp_init()) {
|
||||
@ -966,12 +1111,13 @@ static void btc_sdp_deinit(void)
|
||||
}
|
||||
|
||||
for(int i = 0; i < SDP_MAX_RECORDS; i++) {
|
||||
handle = free_sdp_slot(i);
|
||||
if (handle > 0) {
|
||||
BTA_SdpRemoveRecordByUser((void*)handle);
|
||||
int sdp_handle = -1;
|
||||
get_sdp_slot_info(i, &sdp_handle, NULL);
|
||||
if (sdp_handle > 0) {
|
||||
BTA_SdpRemoveRecordByUser((void*)i);
|
||||
}
|
||||
}
|
||||
sdp_disable_handler();
|
||||
BTA_SdpDisable();
|
||||
} while(0);
|
||||
|
||||
if (ret != ESP_SDP_SUCCESS) {
|
||||
@ -982,7 +1128,7 @@ static void btc_sdp_deinit(void)
|
||||
|
||||
static void btc_sdp_create_record(btc_sdp_args_t *arg)
|
||||
{
|
||||
int handle;
|
||||
int slot_id;
|
||||
esp_sdp_cb_param_t param;
|
||||
esp_sdp_status_t ret = ESP_SDP_SUCCESS;
|
||||
|
||||
@ -993,13 +1139,13 @@ static void btc_sdp_create_record(btc_sdp_args_t *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
handle = alloc_sdp_slot(arg->creat_record.record);
|
||||
if (handle < 0) {
|
||||
slot_id = alloc_sdp_slot(arg->create_record.record);
|
||||
if (slot_id < 0) {
|
||||
ret = ESP_SDP_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
BTA_SdpCreateRecordByUser((void *) handle);
|
||||
BTA_SdpCreateRecordByUser((void *) slot_id);
|
||||
} while(0);
|
||||
|
||||
if (ret != ESP_SDP_SUCCESS) {
|
||||
@ -1011,7 +1157,6 @@ static void btc_sdp_create_record(btc_sdp_args_t *arg)
|
||||
|
||||
static void btc_sdp_remove_record(btc_sdp_args_t *arg)
|
||||
{
|
||||
int handle;
|
||||
esp_sdp_cb_param_t param;
|
||||
esp_sdp_status_t ret = ESP_SDP_SUCCESS;
|
||||
|
||||
@ -1022,42 +1167,16 @@ static void btc_sdp_remove_record(btc_sdp_args_t *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
bluetooth_sdp_record rec;
|
||||
if (get_sdp_record_by_handle(arg->remove_record.record_handle, &rec)) {
|
||||
if (rec.hdr.bt_uuid.len == ESP_UUID_LEN_16) {
|
||||
bta_sys_remove_uuid(rec.hdr.bt_uuid.uuid.uuid16);
|
||||
} else if (rec.hdr.bt_uuid.len == ESP_UUID_LEN_32) {
|
||||
bta_sys_remove_uuid_32(rec.hdr.bt_uuid.uuid.uuid32);
|
||||
} else if (rec.hdr.bt_uuid.len == ESP_UUID_LEN_128) {
|
||||
bta_sys_remove_uuid_128((UINT8 *)&rec.hdr.bt_uuid.uuid.uuid128);
|
||||
}
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s SDP record with handle %d not found",
|
||||
__func__, arg->remove_record.record_handle);
|
||||
ret = ESP_SDP_NO_CREATE_RECORD;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Get the Record handle, and free the slot */
|
||||
/* The application layer record_handle is equivalent to the id of the btc layer */
|
||||
int slot = get_sdp_slot_id_by_handle(arg->remove_record.record_handle);
|
||||
if (slot < 0) {
|
||||
int slot_id = get_sdp_slot_id_by_handle(arg->remove_record.record_handle);
|
||||
if (slot_id < 0) {
|
||||
BTC_TRACE_ERROR("%s SDP record with handle %d not found", __func__, arg->remove_record.record_handle);
|
||||
ret = ESP_SDP_NO_CREATE_RECORD;
|
||||
break;
|
||||
}
|
||||
|
||||
handle = free_sdp_slot(slot);
|
||||
|
||||
BTC_TRACE_DEBUG("Sdp Server %s id=%d to handle=0x%08x",
|
||||
__func__, arg->remove_record.record_handle, handle);
|
||||
|
||||
/* Pass the actual record handle */
|
||||
if(handle > 0) {
|
||||
BTA_SdpRemoveRecordByUser((void*) handle);
|
||||
} else {
|
||||
ret = ESP_SDP_NO_CREATE_RECORD;
|
||||
break;
|
||||
}
|
||||
BTA_SdpRemoveRecordByUser((void *)slot_id);
|
||||
} while(0);
|
||||
|
||||
if (ret != ESP_SDP_SUCCESS) {
|
||||
@ -1078,7 +1197,18 @@ static void btc_sdp_search(btc_sdp_args_t *arg)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!sdp_local_param.search_allowed) {
|
||||
BTC_TRACE_ERROR("%s SDP search is not allowed!", __func__);
|
||||
ret = ESP_SDP_NO_RESOURCE;
|
||||
break;
|
||||
}
|
||||
|
||||
BTA_SdpSearch(arg->search.bd_addr, &arg->search.sdp_uuid);
|
||||
/**
|
||||
* ESP_SDP_SEARCH_COMP_EVT will refer service name in BTA sdp database, so it is not allowed to be search until
|
||||
* the previous search is completed
|
||||
*/
|
||||
sdp_local_param.search_allowed = false;
|
||||
} while(0);
|
||||
|
||||
if (ret != ESP_SDP_SUCCESS) {
|
||||
@ -1089,26 +1219,21 @@ static void btc_sdp_search(btc_sdp_args_t *arg)
|
||||
|
||||
void btc_sdp_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
{
|
||||
btc_sdp_args_t *dst = (btc_sdp_args_t *)p_dest;
|
||||
btc_sdp_args_t *src = (btc_sdp_args_t *)p_src;
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_SDP_ACT_CREATE_RECORD:
|
||||
dst->creat_record.record = (bluetooth_sdp_record *)osi_calloc(sizeof(bluetooth_sdp_record));
|
||||
if (dst->creat_record.record) {
|
||||
memcpy(dst->creat_record.record, src->creat_record.record, sizeof(bluetooth_sdp_record));
|
||||
case BTC_SDP_ACT_CREATE_RECORD: {
|
||||
bluetooth_sdp_record **dst_record = &((btc_sdp_args_t *)p_dest)->create_record.record;
|
||||
bluetooth_sdp_record *src_record = ((btc_sdp_args_t *)p_src)->create_record.record;
|
||||
bluetooth_sdp_record *record = (bluetooth_sdp_record *)osi_calloc(get_sdp_record_size(src_record));
|
||||
if (record) {
|
||||
copy_sdp_record(src_record, record);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s %d osi_malloc failed\n", __func__, msg->act);
|
||||
break;
|
||||
}
|
||||
|
||||
dst->creat_record.record->hdr.service_name = (char *)osi_calloc(src->creat_record.record->hdr.service_name_length);
|
||||
if (dst->creat_record.record->hdr.service_name) {
|
||||
strcpy(dst->creat_record.record->hdr.service_name, src->creat_record.record->hdr.service_name);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s %d osi_malloc failed\n", __func__, msg->act);
|
||||
}
|
||||
*dst_record = record;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1116,17 +1241,15 @@ void btc_sdp_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
|
||||
|
||||
void btc_sdp_arg_deep_free(btc_msg_t *msg)
|
||||
{
|
||||
btc_sdp_args_t *arg = (btc_sdp_args_t *)msg->arg;
|
||||
|
||||
switch (msg->act) {
|
||||
case BTC_SDP_ACT_CREATE_RECORD:
|
||||
if (arg->creat_record.record) {
|
||||
osi_free(arg->creat_record.record);
|
||||
}
|
||||
if (arg->creat_record.record->hdr.service_name) {
|
||||
osi_free(arg->creat_record.record->hdr.service_name);
|
||||
case BTC_SDP_ACT_CREATE_RECORD: {
|
||||
btc_sdp_args_t *arg = (btc_sdp_args_t *)msg->arg;
|
||||
bluetooth_sdp_record *record = arg->create_record.record;
|
||||
if (record) {
|
||||
osi_free(record);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1172,35 +1295,22 @@ void btc_sdp_cb_handler(btc_msg_t *msg)
|
||||
param.init.status = p_data->status;
|
||||
btc_sdp_cb_to_app(ESP_SDP_INIT_EVT, ¶m);
|
||||
break;
|
||||
case BTA_SDP_DISENABLE_EVT:
|
||||
BTA_SdpDisable();
|
||||
osi_mutex_free(&sdp_local_param.sdp_slot_mutex);
|
||||
#if SDP_DYNAMIC_MEMORY == TRUE
|
||||
osi_free(sdp_local_param_ptr);
|
||||
sdp_local_param_ptr = NULL;
|
||||
#endif
|
||||
case BTA_SDP_DISABLE_EVT:
|
||||
BTA_SdpCleanup();
|
||||
btc_sdp_cleanup();
|
||||
param.deinit.status = ESP_SDP_SUCCESS;
|
||||
btc_sdp_cb_to_app(ESP_SDP_DEINIT_EVT, ¶m);
|
||||
break;
|
||||
case BTA_SDP_SEARCH_COMP_EVT:
|
||||
// SDP search completed, now can be searched again
|
||||
sdp_local_param.search_allowed = true;
|
||||
|
||||
param.search.status = p_data->sdp_search_comp.status;
|
||||
if (param.search.status == ESP_SDP_SUCCESS) {
|
||||
memcpy(param.search.remote_addr, p_data->sdp_search_comp.remote_addr, sizeof(BD_ADDR));
|
||||
memcpy(¶m.search.sdp_uuid, &p_data->sdp_search_comp.uuid, sizeof(tSDP_UUID));
|
||||
param.search.record_count = p_data->sdp_search_comp.record_count;
|
||||
param.search.records = osi_malloc(sizeof(esp_bluetooth_sdp_record_t)*p_data->sdp_search_comp.record_count);
|
||||
if (param.search.records != NULL) {
|
||||
memcpy(param.search.records, p_data->sdp_search_comp.records,
|
||||
sizeof(esp_bluetooth_sdp_record_t)*p_data->sdp_search_comp.record_count);
|
||||
} else {
|
||||
BTC_TRACE_ERROR("%s %d osi_malloc failed\n", __func__, event);
|
||||
param.search.status = ESP_SDP_NO_RESOURCE;
|
||||
}
|
||||
}
|
||||
param.search.records = (esp_bluetooth_sdp_record_t *)p_data->sdp_search_comp.records;
|
||||
btc_sdp_cb_to_app(ESP_SDP_SEARCH_COMP_EVT, ¶m);
|
||||
if (param.search.records != NULL) {
|
||||
osi_free(param.search.records);
|
||||
}
|
||||
break;
|
||||
case BTA_SDP_CREATE_RECORD_USER_EVT:
|
||||
param.create_record.status = p_data->sdp_create_record.status;
|
||||
@ -1208,13 +1318,25 @@ void btc_sdp_cb_handler(btc_msg_t *msg)
|
||||
btc_sdp_cb_to_app(ESP_SDP_CREATE_RECORD_COMP_EVT, ¶m);
|
||||
break;
|
||||
case BTA_SDP_REMOVE_RECORD_USER_EVT:
|
||||
param.remove_record.status = p_data->status;
|
||||
if (p_data->sdp_remove_record.status == BTA_SDP_SUCCESS) {
|
||||
int slot_id = get_sdp_slot_id_by_handle(p_data->sdp_remove_record.handle);
|
||||
if (slot_id < 0) {
|
||||
p_data->sdp_remove_record.status = ESP_SDP_NO_CREATE_RECORD;
|
||||
break;
|
||||
} else {
|
||||
free_sdp_slot(slot_id);
|
||||
}
|
||||
}
|
||||
|
||||
param.remove_record.status = p_data->sdp_remove_record.status;
|
||||
btc_sdp_cb_to_app(ESP_SDP_REMOVE_RECORD_COMP_EVT, ¶m);
|
||||
break;
|
||||
default:
|
||||
BTC_TRACE_DEBUG("%s: Unhandled event (%d)!", __func__, msg->act);
|
||||
break;
|
||||
}
|
||||
|
||||
btc_sdp_cb_arg_deep_free(msg);
|
||||
}
|
||||
|
||||
#endif ///defined BTC_SDP_INCLUDED && BTC_SDP_INCLUDED == TRUE
|
||||
|
@ -1287,7 +1287,7 @@
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
|
||||
#else
|
||||
#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
|
||||
#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 20}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@ -1295,7 +1295,7 @@
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
|
||||
#else
|
||||
#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
|
||||
#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 20}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -269,7 +269,7 @@ static void start_up(void)
|
||||
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE && BLE_42_FEATURE_SUPPORT == FALSE)
|
||||
if (HCI_LE_ENHANCED_PRIVACY_SUPPORTED(controller_param.features_ble.as_array)) {
|
||||
if (HCI_LE_EXT_ADV_SUPPORTED(controller_param.features_ble.as_array)) {
|
||||
response = AWAIT_COMMAND(controller_param.packet_factory->make_read_max_adv_data_len());
|
||||
controller_param.packet_parser->parse_ble_read_adv_max_len_response(
|
||||
response,
|
||||
|
@ -186,7 +186,9 @@ static void parse_ble_read_resolving_list_size_response(
|
||||
{
|
||||
|
||||
uint8_t *stream = read_command_complete_header(response, HCI_BLE_READ_RESOLVING_LIST_SIZE, 1 /* bytes after */);
|
||||
if (stream) {
|
||||
STREAM_TO_UINT8(*resolving_list_size_ptr, stream);
|
||||
}
|
||||
|
||||
osi_free(response);
|
||||
}
|
||||
@ -198,10 +200,14 @@ static void parse_ble_read_suggested_default_data_length_response(
|
||||
{
|
||||
|
||||
uint8_t *stream = read_command_complete_header(response, HCI_BLE_READ_DEFAULT_DATA_LENGTH, 2 /* bytes after */);
|
||||
if (stream) {
|
||||
STREAM_TO_UINT16(*ble_default_packet_length_ptr, stream);
|
||||
STREAM_TO_UINT16(*ble_default_packet_txtime_ptr, stream);
|
||||
}
|
||||
|
||||
osi_free(response);
|
||||
}
|
||||
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
static void parse_ble_read_adv_max_len_response(
|
||||
BT_HDR *response,
|
||||
@ -209,8 +215,10 @@ static void parse_ble_read_adv_max_len_response(
|
||||
{
|
||||
|
||||
uint8_t *stream = read_command_complete_header(response, HCI_BLE_RD_MAX_ADV_DATA_LEN, 1 /* bytes after */);
|
||||
if (stream) {
|
||||
// Size: 2 Octets ; Value: 0x001F – 0x0672 ; Maximum supported advertising data length
|
||||
STREAM_TO_UINT16(*adv_max_len_ptr, stream);
|
||||
}
|
||||
|
||||
osi_free(response);
|
||||
}
|
||||
@ -254,6 +262,7 @@ static uint8_t *read_command_complete_header(
|
||||
STREAM_TO_UINT8(status, stream);
|
||||
|
||||
if (status != HCI_SUCCESS) {
|
||||
HCI_TRACE_ERROR("%s failed: opcode 0x%04x, status 0x%02x", __func__, opcode, status);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -430,9 +430,9 @@ BOOLEAN avct_lcb_last_ccb(tAVCT_LCB *p_lcb, tAVCT_CCB *p_ccb_last)
|
||||
tAVCT_CCB *p_ccb = &avct_cb.ccb[0];
|
||||
int i;
|
||||
|
||||
AVCT_TRACE_WARNING("avct_lcb_last_ccb");
|
||||
AVCT_TRACE_DEBUG("avct_lcb_last_ccb");
|
||||
for (i = 0; i < AVCT_NUM_CONN; i++, p_ccb++) {
|
||||
AVCT_TRACE_WARNING("%x: aloc:%d, lcb:%p/%p, ccb:%p/%p",
|
||||
AVCT_TRACE_DEBUG("%x: aloc:%d, lcb:%p/%p, ccb:%p/%p",
|
||||
i, p_ccb->allocated, p_ccb->p_lcb, p_lcb, p_ccb, p_ccb_last);
|
||||
if (p_ccb->allocated && (p_ccb->p_lcb == p_lcb) && (p_ccb != p_ccb_last)) {
|
||||
return FALSE;
|
||||
|
@ -384,6 +384,10 @@ static BOOLEAN btm_ble_match_random_bda(tBTM_SEC_DEV_REC *p_dev_rec)
|
||||
void btm_ble_resolve_random_addr(BD_ADDR random_bda, tBTM_BLE_RESOLVE_CBACK *p_cback, void *p)
|
||||
{
|
||||
#if (SMP_INCLUDED == TRUE)
|
||||
if (btm_cb.addr_res_en == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
tBTM_LE_RANDOM_CB *p_mgnt_cb = &btm_cb.ble_ctr_cb.addr_mgnt_cb;
|
||||
list_node_t *p_node = NULL;
|
||||
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||
@ -458,6 +462,10 @@ tBTM_SEC_DEV_REC *btm_find_dev_by_identity_addr(BD_ADDR bd_addr, UINT8 addr_type
|
||||
BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type, BOOLEAN refresh)
|
||||
{
|
||||
#if BLE_PRIVACY_SPT == TRUE
|
||||
if (btm_cb.addr_res_en == FALSE) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev_by_identity_addr(bd_addr, *p_addr_type);
|
||||
|
||||
BTM_TRACE_EVENT ("%s", __func__);
|
||||
@ -491,6 +499,10 @@ BOOLEAN btm_identity_addr_to_random_pseudo(BD_ADDR bd_addr, UINT8 *p_addr_type,
|
||||
BOOLEAN btm_random_pseudo_to_identity_addr(BD_ADDR random_pseudo, UINT8 *p_static_addr_type)
|
||||
{
|
||||
#if BLE_PRIVACY_SPT == TRUE
|
||||
if (btm_cb.addr_res_en == FALSE) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (random_pseudo);
|
||||
|
||||
if (p_dev_rec != NULL) {
|
||||
|
@ -84,6 +84,7 @@ void btm_init (void)
|
||||
#if BLE_INCLUDED == TRUE
|
||||
btm_ble_lock_init();
|
||||
btm_ble_sem_init();
|
||||
btm_cb.addr_res_en = TRUE;
|
||||
#endif
|
||||
btm_sec_dev_init();
|
||||
#if (BLE_50_FEATURE_SUPPORT == TRUE)
|
||||
@ -133,3 +134,10 @@ uint8_t btm_acl_active_count(void)
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
void btm_ble_addr_resolve_enable(bool enable)
|
||||
{
|
||||
#if (BLE_INCLUDED == TRUE)
|
||||
btm_cb.addr_res_en = enable;
|
||||
#endif
|
||||
}
|
||||
|
@ -543,7 +543,7 @@ static tBTM_PM_MODE btm_pm_get_set_mode(UINT8 pm_id, tBTM_PM_MCB *p_cb, tBTM_PM_
|
||||
** Function btm_pm_snd_md_req
|
||||
** Description get the resulting mode and send the resuest to host controller
|
||||
** Returns tBTM_STATUS
|
||||
**, BOOLEAN *p_chg_ind
|
||||
**
|
||||
*******************************************************************************/
|
||||
static tBTM_STATUS btm_pm_snd_md_req(UINT8 pm_id, UINT16 link_hdl, tBTM_PM_PWR_MD *p_mode)
|
||||
{
|
||||
@ -565,6 +565,8 @@ static tBTM_STATUS btm_pm_snd_md_req(UINT8 pm_id, UINT16 link_hdl, tBTM_PM_PWR_M
|
||||
/* already in the resulting mode */
|
||||
if ( (mode == BTM_PM_MD_ACTIVE) ||
|
||||
((md_res.max >= p_cb->interval) && (md_res.min <= p_cb->interval)) ) {
|
||||
// Clear request change indication because already in result mode
|
||||
p_cb->chg_ind = FALSE;
|
||||
return BTM_CMD_STORED;
|
||||
}
|
||||
/* Otherwise, needs to wake, then sleep */
|
||||
@ -689,7 +691,7 @@ static void btm_pm_check_stored(void)
|
||||
** Description This function is called when an HCI command status event occurs
|
||||
** for power manager related commands.
|
||||
**
|
||||
** Input Parms status - status of the event (HCI_SUCCESS if no errors)
|
||||
** Input Params status - status of the event (HCI_SUCCESS if no errors)
|
||||
**
|
||||
** Returns none.
|
||||
**
|
||||
@ -717,7 +719,7 @@ void btm_pm_proc_cmd_status(UINT8 status)
|
||||
#if BTM_PM_DEBUG == TRUE
|
||||
BTM_TRACE_DEBUG( "btm_pm_proc_cmd_status new state:0x%x", p_cb->state);
|
||||
#endif // BTM_PM_DEBUG
|
||||
} else { /* the command was not successfull. Stay in the same state */
|
||||
} else { /* the command was not successful. Stay in the same state */
|
||||
pm_status = BTM_PM_STS_ERROR;
|
||||
}
|
||||
|
||||
@ -743,7 +745,7 @@ void btm_pm_proc_cmd_status(UINT8 status)
|
||||
**
|
||||
** Description This function is called when an HCI mode change event occurs.
|
||||
**
|
||||
** Input Parms hci_status - status of the event (HCI_SUCCESS if no errors)
|
||||
** Input Params hci_status - status of the event (HCI_SUCCESS if no errors)
|
||||
** hci_handle - connection handle associated with the change
|
||||
** mode - HCI_MODE_ACTIVE, HCI_MODE_HOLD, HCI_MODE_SNIFF, or HCI_MODE_PARK
|
||||
** interval - number of baseband slots (meaning depends on mode)
|
||||
|
@ -886,6 +886,7 @@ typedef struct {
|
||||
UINT16 ediv; /* received ediv value from LTK request */
|
||||
UINT8 key_size;
|
||||
tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
|
||||
BOOLEAN addr_res_en; /* internal use for test: address resolution enable/disable */
|
||||
#endif
|
||||
|
||||
/* Packet types supported by the local device */
|
||||
|
@ -1871,42 +1871,50 @@ typedef struct {
|
||||
#define HCI_PING_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_PING_OFF] & HCI_EXT_FEATURE_PING_MASK)
|
||||
|
||||
/*
|
||||
** LE features encoding - page 0 (the only page for now)
|
||||
** LE features encoding - page 0
|
||||
*/
|
||||
/* LE Encryption */
|
||||
/* LE Encryption: bit 0 */
|
||||
#define HCI_LE_FEATURE_LE_ENCRYPTION_MASK 0x01
|
||||
#define HCI_LE_FEATURE_LE_ENCRYPTION_OFF 0
|
||||
#define HCI_LE_ENCRYPTION_SUPPORTED(x) ((x)[HCI_LE_FEATURE_LE_ENCRYPTION_OFF] & HCI_LE_FEATURE_LE_ENCRYPTION_MASK)
|
||||
|
||||
/* Connection Parameters Request Procedure */
|
||||
/* Connection Parameters Request Procedure: bit 1 */
|
||||
#define HCI_LE_FEATURE_CONN_PARAM_REQ_MASK 0x02
|
||||
#define HCI_LE_FEATURE_CONN_PARAM_REQ_OFF 0
|
||||
#define HCI_LE_CONN_PARAM_REQ_SUPPORTED(x) ((x)[HCI_LE_FEATURE_CONN_PARAM_REQ_OFF] & HCI_LE_FEATURE_CONN_PARAM_REQ_MASK)
|
||||
|
||||
/* Extended Reject Indication */
|
||||
/* Extended Reject Indication: bit 2 */
|
||||
#define HCI_LE_FEATURE_EXT_REJ_IND_MASK 0x04
|
||||
#define HCI_LE_FEATURE_EXT_REJ_IND_OFF 0
|
||||
#define HCI_LE_EXT_REJ_IND_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_REJ_IND_OFF] & HCI_LE_FEATURE_EXT_REJ_IND_MASK)
|
||||
|
||||
/* Slave-initiated Features Exchange */
|
||||
/* Slave-initiated Features Exchange: bit 3 */
|
||||
#define HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_MASK 0x08
|
||||
#define HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_OFF 0
|
||||
#define HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(x) ((x)[HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_OFF] & HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_MASK)
|
||||
|
||||
/* LE Data Packet Length Extension: bit 5 */
|
||||
#define HCI_LE_FEATURE_DATA_LEN_EXT_MASK 0x20
|
||||
#define HCI_LE_FEATURE_DATA_LEN_EXT_OFF 0
|
||||
#define HCI_LE_DATA_LEN_EXT_SUPPORTED(x) ((x)[HCI_LE_FEATURE_DATA_LEN_EXT_OFF] & HCI_LE_FEATURE_DATA_LEN_EXT_MASK)
|
||||
|
||||
/* Enhanced privacy Feature: bit 6 */
|
||||
#define HCI_LE_FEATURE_ENHANCED_PRIVACY_MASK 0x40
|
||||
#define HCI_LE_FEATURE_ENHANCED_PRIVACY_OFF 0
|
||||
#define HCI_LE_ENHANCED_PRIVACY_SUPPORTED(x) ((x)[HCI_LE_FEATURE_ENHANCED_PRIVACY_OFF] & HCI_LE_FEATURE_ENHANCED_PRIVACY_MASK)
|
||||
|
||||
/* Extended scanner filter policy : 7 */
|
||||
/* Extended scanner filter policy: bit 7 */
|
||||
#define HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_MASK 0x80
|
||||
#define HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_OFF 0
|
||||
#define HCI_LE_EXT_SCAN_FILTER_POLICY_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_OFF] & HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_MASK)
|
||||
|
||||
/* Slave-initiated Features Exchange */
|
||||
#define HCI_LE_FEATURE_DATA_LEN_EXT_MASK 0x20
|
||||
#define HCI_LE_FEATURE_DATA_LEN_EXT_OFF 0
|
||||
#define HCI_LE_DATA_LEN_EXT_SUPPORTED(x) ((x)[HCI_LE_FEATURE_DATA_LEN_EXT_OFF] & HCI_LE_FEATURE_DATA_LEN_EXT_MASK)
|
||||
/*
|
||||
** LE features encoding - page 1
|
||||
*/
|
||||
/* LE Extended Advertising: bit 12 */
|
||||
#define HCI_LE_FEATURE_EXT_ADV_MASK 0x10
|
||||
#define HCI_LE_FEATURE_EXT_ADV_OFF 1
|
||||
#define HCI_LE_EXT_ADV_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_ADV_OFF] & HCI_LE_FEATURE_EXT_ADV_MASK)
|
||||
|
||||
/*
|
||||
** Local Supported Commands encoding
|
||||
|
@ -276,7 +276,7 @@ static int sdp_compose_proto_list( UINT8 *p, UINT16 num_elem,
|
||||
**
|
||||
** Description This function is called to create a record in the database.
|
||||
** This would be through the SDP database maintenance API. The
|
||||
** record is created empty, teh application should then call
|
||||
** record is created empty, the application should then call
|
||||
** "add_attribute" to add the record's attributes.
|
||||
**
|
||||
** Returns Record handle if OK, else 0.
|
||||
@ -321,10 +321,12 @@ UINT32 SDP_CreateRecord (void)
|
||||
4, buf);
|
||||
|
||||
return (p_rec->record_handle);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
SDP_TRACE_ERROR("SDP_CreateRecord fail, memory allocation failed\n");
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
SDP_TRACE_ERROR("SDP_CreateRecord fail, exceed maximum records:%d\n", SDP_MAX_RECORDS);
|
||||
}
|
||||
#endif
|
||||
|
@ -190,6 +190,11 @@ static void controller_rcv_pkt_ready(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void dummy_controller_rcv_pkt_ready(void)
|
||||
{
|
||||
/* Dummy function */
|
||||
}
|
||||
|
||||
void bt_record_hci_data(uint8_t *data, uint16_t len)
|
||||
{
|
||||
#if (BT_HCI_LOG_INCLUDED == TRUE)
|
||||
@ -203,6 +208,12 @@ void bt_record_hci_data(uint8_t *data, uint16_t len)
|
||||
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
|
||||
}
|
||||
|
||||
static int dummy_host_rcv_pkt(uint8_t *data, uint16_t len)
|
||||
{
|
||||
/* Dummy function */
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief: BT controller callback function, to transfer data packet to the host
|
||||
*/
|
||||
@ -264,6 +275,11 @@ static const esp_vhci_host_callback_t vhci_host_cb = {
|
||||
.notify_host_recv = host_rcv_pkt,
|
||||
};
|
||||
|
||||
static const esp_vhci_host_callback_t dummy_vhci_host_cb = {
|
||||
.notify_host_send_available = dummy_controller_rcv_pkt_ready,
|
||||
.notify_host_recv = dummy_host_rcv_pkt,
|
||||
};
|
||||
|
||||
|
||||
extern void ble_transport_init(void);
|
||||
extern esp_err_t ble_buf_alloc(void);
|
||||
@ -313,6 +329,8 @@ esp_err_t esp_nimble_hci_deinit(void)
|
||||
}
|
||||
ble_transport_deinit();
|
||||
|
||||
esp_vhci_host_register_callback(&dummy_vhci_host_cb);
|
||||
|
||||
ble_buf_free();
|
||||
|
||||
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit c55a6388a2c1d5984e3e7c489de5d0908af4d97c
|
||||
Subproject commit 03462b6686cf49bb0bb026461300fec593c6f4c5
|
@ -386,7 +386,8 @@ typedef enum {
|
||||
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
|
||||
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
|
||||
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
|
||||
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
|
||||
ESP_PWR_LVL_P20 = 15, /*!< Corresponding to +20dbm */
|
||||
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +20dbm, this enum variable has been deprecated */
|
||||
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
|
||||
} esp_power_level_t;
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "esp_log.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "esp_bt.h"
|
||||
#include "bt_osi_mem.h"
|
||||
|
||||
portMUX_TYPE ble_port_mutex = portMUX_INITIALIZER_UNLOCKED;
|
||||
|
||||
@ -95,7 +96,7 @@ IRAM_ATTR npl_freertos_event_init(struct ble_npl_event *ev, ble_npl_event_fn *fn
|
||||
}
|
||||
#else
|
||||
if(!ev->event) {
|
||||
ev->event = malloc(sizeof(struct ble_npl_event_freertos));
|
||||
ev->event = bt_osi_mem_malloc_internal(sizeof(struct ble_npl_event_freertos));
|
||||
}
|
||||
#endif
|
||||
event = (struct ble_npl_event_freertos *)ev->event;
|
||||
@ -113,7 +114,7 @@ IRAM_ATTR npl_freertos_event_deinit(struct ble_npl_event *ev)
|
||||
#if OS_MEM_ALLOC
|
||||
os_memblock_put(&ble_freertos_ev_pool,ev->event);
|
||||
#else
|
||||
free(ev->event);
|
||||
bt_osi_mem_free(ev->event);
|
||||
#endif
|
||||
ev->event = NULL;
|
||||
}
|
||||
@ -144,7 +145,7 @@ npl_freertos_eventq_init(struct ble_npl_eventq *evq)
|
||||
}
|
||||
#else
|
||||
if(!evq->eventq) {
|
||||
evq->eventq = malloc(sizeof(struct ble_npl_eventq_freertos));
|
||||
evq->eventq = bt_osi_mem_malloc_internal(sizeof(struct ble_npl_eventq_freertos));
|
||||
eventq = (struct ble_npl_eventq_freertos*)evq->eventq;
|
||||
BLE_LL_ASSERT(eventq);
|
||||
memset(eventq, 0, sizeof(*eventq));
|
||||
@ -167,7 +168,7 @@ npl_freertos_eventq_deinit(struct ble_npl_eventq *evq)
|
||||
#if OS_MEM_ALLOC
|
||||
os_memblock_put(&ble_freertos_evq_pool,eventq);
|
||||
#else
|
||||
free((void *)eventq);
|
||||
bt_osi_mem_free((void *)eventq);
|
||||
#endif
|
||||
evq->eventq = NULL;
|
||||
}
|
||||
@ -357,7 +358,7 @@ npl_freertos_mutex_init(struct ble_npl_mutex *mu)
|
||||
}
|
||||
#else
|
||||
if(!mu->mutex) {
|
||||
mu->mutex = malloc(sizeof(struct ble_npl_mutex_freertos));
|
||||
mu->mutex = bt_osi_mem_malloc_internal(sizeof(struct ble_npl_mutex_freertos));
|
||||
mutex = (struct ble_npl_mutex_freertos *)mu->mutex;
|
||||
|
||||
if (!mutex) {
|
||||
@ -388,7 +389,7 @@ npl_freertos_mutex_deinit(struct ble_npl_mutex *mu)
|
||||
#if OS_MEM_ALLOC
|
||||
os_memblock_put(&ble_freertos_mutex_pool,mutex);
|
||||
#else
|
||||
free((void *)mutex);
|
||||
bt_osi_mem_free((void *)mutex);
|
||||
#endif
|
||||
mu->mutex = NULL;
|
||||
|
||||
@ -494,7 +495,7 @@ npl_freertos_sem_init(struct ble_npl_sem *sem, uint16_t tokens)
|
||||
}
|
||||
#else
|
||||
if(!sem->sem) {
|
||||
sem->sem = malloc(sizeof(struct ble_npl_sem_freertos));
|
||||
sem->sem = bt_osi_mem_malloc_internal(sizeof(struct ble_npl_sem_freertos));
|
||||
semaphore = (struct ble_npl_sem_freertos *)sem->sem;
|
||||
|
||||
if (!semaphore) {
|
||||
@ -525,7 +526,7 @@ npl_freertos_sem_deinit(struct ble_npl_sem *sem)
|
||||
#if OS_MEM_ALLOC
|
||||
os_memblock_put(&ble_freertos_sem_pool,semaphore);
|
||||
#else
|
||||
free((void *)semaphore);
|
||||
bt_osi_mem_free((void *)semaphore);
|
||||
#endif
|
||||
sem->sem = NULL;
|
||||
|
||||
@ -684,7 +685,7 @@ npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq
|
||||
#else
|
||||
|
||||
if(!co->co) {
|
||||
co->co = malloc(sizeof(struct ble_npl_callout_freertos));
|
||||
co->co = bt_osi_mem_malloc_internal(sizeof(struct ble_npl_callout_freertos));
|
||||
callout = (struct ble_npl_callout_freertos *)co->co;
|
||||
if (!callout) {
|
||||
return -1;
|
||||
@ -704,7 +705,7 @@ npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq
|
||||
|
||||
if (esp_timer_create(&create_args, &callout->handle) != ESP_OK) {
|
||||
ble_npl_event_deinit(&callout->ev);
|
||||
free((void *)callout);
|
||||
bt_osi_mem_free((void *)callout);
|
||||
co->co = NULL;
|
||||
return -1;
|
||||
}
|
||||
@ -713,7 +714,7 @@ npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq
|
||||
|
||||
if (!callout->handle) {
|
||||
ble_npl_event_deinit(&callout->ev);
|
||||
free((void *)callout);
|
||||
bt_osi_mem_free((void *)callout);
|
||||
co->co = NULL;
|
||||
return -1;
|
||||
}
|
||||
@ -761,7 +762,7 @@ npl_freertos_callout_deinit(struct ble_npl_callout *co)
|
||||
#if OS_MEM_ALLOC
|
||||
os_memblock_put(&ble_freertos_co_pool,callout);
|
||||
#else
|
||||
free((void *)callout);
|
||||
bt_osi_mem_free((void *)callout);
|
||||
#endif // OS_MEM_ALLOC
|
||||
co->co = NULL;
|
||||
memset(co, 0, sizeof(struct ble_npl_callout));
|
||||
@ -1089,7 +1090,7 @@ struct npl_funcs_t * npl_freertos_funcs_get(void)
|
||||
|
||||
void npl_freertos_funcs_init(void)
|
||||
{
|
||||
npl_funcs = (struct npl_funcs_t *)malloc(sizeof(struct npl_funcs_t));
|
||||
npl_funcs = (struct npl_funcs_t *)bt_osi_mem_malloc_internal(sizeof(struct npl_funcs_t));
|
||||
if(!npl_funcs) {
|
||||
printf("npl funcs init failed\n");
|
||||
assert(0);
|
||||
@ -1123,7 +1124,7 @@ int npl_freertos_mempool_init(void)
|
||||
ble_freertos_total_event_cnt = ble_total_evt_count;
|
||||
|
||||
if (ble_total_evt_count) {
|
||||
ble_freertos_ev_buf = malloc(OS_MEMPOOL_SIZE(ble_total_evt_count,
|
||||
ble_freertos_ev_buf = bt_osi_mem_malloc_internal(OS_MEMPOOL_SIZE(ble_total_evt_count,
|
||||
sizeof (struct ble_npl_event_freertos)) *
|
||||
sizeof(os_membuf_t));
|
||||
if (!ble_freertos_ev_buf) {
|
||||
@ -1138,7 +1139,7 @@ int npl_freertos_mempool_init(void)
|
||||
}
|
||||
|
||||
if (ble_total_evtq_count) {
|
||||
ble_freertos_evq_buf = malloc(OS_MEMPOOL_SIZE(ble_total_evtq_count,
|
||||
ble_freertos_evq_buf = bt_osi_mem_malloc_internal(OS_MEMPOOL_SIZE(ble_total_evtq_count,
|
||||
sizeof (struct ble_npl_eventq_freertos)) *
|
||||
sizeof(os_membuf_t));
|
||||
if (!ble_freertos_evq_buf) {
|
||||
@ -1153,7 +1154,7 @@ int npl_freertos_mempool_init(void)
|
||||
}
|
||||
|
||||
if (ble_total_co_count) {
|
||||
ble_freertos_co_buf = malloc(OS_MEMPOOL_SIZE(ble_total_co_count,
|
||||
ble_freertos_co_buf = bt_osi_mem_malloc_internal(OS_MEMPOOL_SIZE(ble_total_co_count,
|
||||
sizeof (struct ble_npl_callout_freertos)) *
|
||||
sizeof(os_membuf_t));
|
||||
if (!ble_freertos_co_buf) {
|
||||
@ -1168,7 +1169,7 @@ int npl_freertos_mempool_init(void)
|
||||
}
|
||||
|
||||
if (ble_total_sem_count) {
|
||||
ble_freertos_sem_buf = malloc(OS_MEMPOOL_SIZE(ble_total_sem_count,
|
||||
ble_freertos_sem_buf = bt_osi_mem_malloc_internal(OS_MEMPOOL_SIZE(ble_total_sem_count,
|
||||
sizeof (struct ble_npl_sem_freertos)) *
|
||||
sizeof(os_membuf_t));
|
||||
if (!ble_freertos_sem_buf) {
|
||||
@ -1183,7 +1184,7 @@ int npl_freertos_mempool_init(void)
|
||||
}
|
||||
|
||||
if (ble_total_mutex_count) {
|
||||
ble_freertos_mutex_buf = malloc(OS_MEMPOOL_SIZE(ble_total_mutex_count,
|
||||
ble_freertos_mutex_buf = bt_osi_mem_malloc_internal(OS_MEMPOOL_SIZE(ble_total_mutex_count,
|
||||
sizeof (struct ble_npl_mutex_freertos)) *
|
||||
sizeof(os_membuf_t));
|
||||
if (!ble_freertos_mutex_buf) {
|
||||
@ -1200,27 +1201,27 @@ int npl_freertos_mempool_init(void)
|
||||
return 0;
|
||||
_error:
|
||||
if (ble_freertos_ev_buf) {
|
||||
free(ble_freertos_ev_buf);
|
||||
bt_osi_mem_free(ble_freertos_ev_buf);
|
||||
ble_freertos_ev_buf = NULL;
|
||||
}
|
||||
|
||||
if (ble_freertos_evq_buf) {
|
||||
free(ble_freertos_evq_buf);
|
||||
bt_osi_mem_free(ble_freertos_evq_buf);
|
||||
ble_freertos_evq_buf = NULL;
|
||||
}
|
||||
|
||||
if (ble_freertos_co_buf) {
|
||||
free(ble_freertos_co_buf);
|
||||
bt_osi_mem_free(ble_freertos_co_buf);
|
||||
ble_freertos_co_buf = NULL;
|
||||
}
|
||||
|
||||
if (ble_freertos_sem_buf) {
|
||||
free(ble_freertos_sem_buf);
|
||||
bt_osi_mem_free(ble_freertos_sem_buf);
|
||||
ble_freertos_sem_buf = NULL;
|
||||
}
|
||||
|
||||
if (ble_freertos_mutex_buf) {
|
||||
free(ble_freertos_mutex_buf);
|
||||
bt_osi_mem_free(ble_freertos_mutex_buf);
|
||||
ble_freertos_mutex_buf = NULL;
|
||||
}
|
||||
return -1;
|
||||
@ -1229,23 +1230,23 @@ _error:
|
||||
void npl_freertos_mempool_deinit(void)
|
||||
{
|
||||
if (ble_freertos_ev_buf) {
|
||||
free(ble_freertos_ev_buf);
|
||||
bt_osi_mem_free(ble_freertos_ev_buf);
|
||||
ble_freertos_ev_buf = NULL;
|
||||
}
|
||||
if (ble_freertos_evq_buf) {
|
||||
free(ble_freertos_evq_buf);
|
||||
bt_osi_mem_free(ble_freertos_evq_buf);
|
||||
ble_freertos_evq_buf = NULL;
|
||||
}
|
||||
if (ble_freertos_co_buf) {
|
||||
free(ble_freertos_co_buf);
|
||||
bt_osi_mem_free(ble_freertos_co_buf);
|
||||
ble_freertos_co_buf = NULL;
|
||||
}
|
||||
if (ble_freertos_sem_buf) {
|
||||
free(ble_freertos_sem_buf);
|
||||
bt_osi_mem_free(ble_freertos_sem_buf);
|
||||
ble_freertos_sem_buf = NULL;
|
||||
}
|
||||
if (ble_freertos_mutex_buf) {
|
||||
free(ble_freertos_mutex_buf);
|
||||
bt_osi_mem_free(ble_freertos_mutex_buf);
|
||||
ble_freertos_mutex_buf = NULL;
|
||||
}
|
||||
}
|
||||
@ -1253,7 +1254,7 @@ void npl_freertos_mempool_deinit(void)
|
||||
void npl_freertos_funcs_deinit(void)
|
||||
{
|
||||
if (npl_funcs) {
|
||||
free(npl_funcs);
|
||||
bt_osi_mem_free(npl_funcs);
|
||||
}
|
||||
npl_funcs = NULL;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ hci_driver_uart_deinit(void)
|
||||
|
||||
ESP_ERROR_CHECK(uart_driver_delete(s_hci_driver_uart_env.hci_uart_params->hci_uart_port));
|
||||
|
||||
if (!s_hci_driver_uart_env.tx_sem) {
|
||||
if (s_hci_driver_uart_env.tx_sem) {
|
||||
vSemaphoreDelete(s_hci_driver_uart_env.tx_sem);
|
||||
}
|
||||
|
||||
|
@ -684,7 +684,10 @@ static esp_err_t i2c_master_clear_bus(i2c_port_t i2c_num)
|
||||
gpio_set_level(sda_io, 1); // STOP, SDA low -> high while SCL is HIGH
|
||||
i2c_set_pin(i2c_num, sda_io, scl_io, 1, 1, I2C_MODE_MASTER);
|
||||
#else
|
||||
i2c_ll_master_clr_bus(i2c_context[i2c_num].hal.dev, I2C_CLR_BUS_SCL_NUM);
|
||||
i2c_ll_master_clr_bus(i2c_context[i2c_num].hal.dev, I2C_CLR_BUS_SCL_NUM, true);
|
||||
while (i2c_ll_master_is_bus_clear_done(i2c_context[i2c_num].hal.dev)) {
|
||||
}
|
||||
i2c_ll_update(i2c_context[i2c_num].hal.dev);
|
||||
#endif
|
||||
return ESP_OK;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <assert.h>
|
||||
#include "esp_efuse_table.h"
|
||||
|
||||
// md5_digest_table eb005412b657c9be0ce4bb699e5813c9
|
||||
// md5_digest_table 13b0a8106fd483a0fcfa8b2f7388a95f
|
||||
// This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY.
|
||||
// If you want to change some fields, you need to change esp_efuse_table.csv file
|
||||
// then run `efuse_common_table` or `efuse_custom_table` command it will generate this file.
|
||||
@ -23,6 +23,34 @@ static const esp_efuse_desc_t WR_DIS_RD_DIS[] = {
|
||||
{EFUSE_BLK0, 0, 1}, // [] wr_dis of RD_DIS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_DISABLE_DEPLOY_MODE[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_DISABLE_DEPLOY_MODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_RND_SWITCH_CYCLE[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_RND_SWITCH_CYCLE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_DEPLOY_ONLY_ONCE[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_DEPLOY_ONLY_ONCE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FORCE_USE_KEY_MANAGER_KEY[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of FORCE_USE_KEY_MANAGER_KEY,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FORCE_DISABLE_SW_INIT_KEY[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of FORCE_DISABLE_SW_INIT_KEY,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_XTS_KEY_LENGTH_256[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_XTS_KEY_LENGTH_256,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_LOCK_KM_KEY[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of LOCK_KM_KEY,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_ICACHE[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_ICACHE,
|
||||
};
|
||||
@ -35,6 +63,10 @@ static const esp_efuse_desc_t WR_DIS_DIS_FORCE_DOWNLOAD[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_FORCE_DOWNLOAD,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SPI_DOWNLOAD_MSPI_DIS[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of SPI_DOWNLOAD_MSPI_DIS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_TWAI[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_TWAI,
|
||||
};
|
||||
@ -51,6 +83,10 @@ static const esp_efuse_desc_t WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_DOWNLOAD_MANUAL_ENCRYPT,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_HYS_EN_PAD[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of HYS_EN_PAD,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_WDT_DELAY_SEL[] = {
|
||||
{EFUSE_BLK0, 3, 1}, // [] wr_dis of WDT_DELAY_SEL,
|
||||
};
|
||||
@ -99,6 +135,22 @@ static const esp_efuse_desc_t WR_DIS_SEC_DPA_LEVEL[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of SEC_DPA_LEVEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_XTS_DPA_PSEUDO_LEVEL[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of XTS_DPA_PSEUDO_LEVEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_XTS_DPA_CLK_ENABLE[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of XTS_DPA_CLK_ENABLE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_ECDSA_DISABLE_P192[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of ECDSA_DISABLE_P192,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_ECC_FORCE_CONST_TIME[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of ECC_FORCE_CONST_TIME,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SECURE_BOOT_EN[] = {
|
||||
{EFUSE_BLK0, 15, 1}, // [] wr_dis of SECURE_BOOT_EN,
|
||||
};
|
||||
@ -107,8 +159,12 @@ static const esp_efuse_desc_t WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[] = {
|
||||
{EFUSE_BLK0, 16, 1}, // [] wr_dis of SECURE_BOOT_AGGRESSIVE_REVOKE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SPI_DOWNLOAD_MSPI_DIS[] = {
|
||||
{EFUSE_BLK0, 17, 1}, // [] wr_dis of SPI_DOWNLOAD_MSPI_DIS,
|
||||
static const esp_efuse_desc_t WR_DIS_XTAL_48M_SEL[] = {
|
||||
{EFUSE_BLK0, 17, 1}, // [] wr_dis of XTAL_48M_SEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_XTAL_48M_SEL_MODE[] = {
|
||||
{EFUSE_BLK0, 17, 1}, // [] wr_dis of XTAL_48M_SEL_MODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_TPUW[] = {
|
||||
@ -148,7 +204,11 @@ static const esp_efuse_desc_t WR_DIS_SECURE_VERSION[] = {
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[] = {
|
||||
{EFUSE_BLK0, 19, 1}, // [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE,
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_HUK_GEN_STATE[] = {
|
||||
{EFUSE_BLK0, 19, 1}, // [] wr_dis of HUK_GEN_STATE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_BLK1[] = {
|
||||
@ -163,12 +223,76 @@ static const esp_efuse_desc_t WR_DIS_MAC_EXT[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of MAC_EXT,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_WAFER_VERSION_MINOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of WAFER_VERSION_MINOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_WAFER_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of WAFER_VERSION_MAJOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DISABLE_WAFER_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of DISABLE_WAFER_VERSION_MAJOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DISABLE_BLK_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of DISABLE_BLK_VERSION_MAJOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_BLK_VERSION_MINOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of BLK_VERSION_MINOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_BLK_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of BLK_VERSION_MAJOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_CAP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of FLASH_CAP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_VENDOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of FLASH_VENDOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PSRAM_CAP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of PSRAM_CAP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PSRAM_VENDOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of PSRAM_VENDOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_TEMP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of TEMP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PKG_VERSION[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of PKG_VERSION,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PA_TRIM_VERSION[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of PA_TRIM_VERSION,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_TRIM_N_BIAS[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of TRIM_N_BIAS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_TRIM_P_BIAS[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of TRIM_P_BIAS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SYS_DATA_PART1[] = {
|
||||
{EFUSE_BLK0, 21, 1}, // [] wr_dis of BLOCK2,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_BLOCK_SYS_DATA1[] = {
|
||||
{EFUSE_BLK0, 21, 1}, // [] wr_dis of BLOCK_SYS_DATA1,
|
||||
static const esp_efuse_desc_t WR_DIS_OPTIONAL_UNIQUE_ID[] = {
|
||||
{EFUSE_BLK0, 21, 1}, // [] wr_dis of OPTIONAL_UNIQUE_ID,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_OCODE[] = {
|
||||
{EFUSE_BLK0, 21, 1}, // [] wr_dis of OCODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_BLOCK_USR_DATA[] = {
|
||||
@ -464,8 +588,72 @@ static const esp_efuse_desc_t MAC_EXT[] = {
|
||||
{EFUSE_BLK1, 48, 16}, // [] Represents the extended bits of MAC address,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t BLOCK_SYS_DATA1[] = {
|
||||
{EFUSE_BLK2, 0, 256}, // [] System data part 1 (reserved),
|
||||
static const esp_efuse_desc_t WAFER_VERSION_MINOR[] = {
|
||||
{EFUSE_BLK1, 64, 4}, // [] Minor chip version,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WAFER_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK1, 68, 2}, // [] Minor chip version,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t DISABLE_WAFER_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK1, 70, 1}, // [] Disables check of wafer version major,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t DISABLE_BLK_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK1, 71, 1}, // [] Disables check of blk version major,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t BLK_VERSION_MINOR[] = {
|
||||
{EFUSE_BLK1, 72, 3}, // [] BLK_VERSION_MINOR of BLOCK2,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t BLK_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK1, 75, 2}, // [] BLK_VERSION_MAJOR of BLOCK2,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t FLASH_CAP[] = {
|
||||
{EFUSE_BLK1, 77, 3}, // [] Flash capacity,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t FLASH_VENDOR[] = {
|
||||
{EFUSE_BLK1, 80, 3}, // [] Flash vendor,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PSRAM_CAP[] = {
|
||||
{EFUSE_BLK1, 83, 3}, // [] Psram capacity,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PSRAM_VENDOR[] = {
|
||||
{EFUSE_BLK1, 86, 2}, // [] Psram vendor,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t TEMP[] = {
|
||||
{EFUSE_BLK1, 88, 2}, // [] Temp (die embedded inside),
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PKG_VERSION[] = {
|
||||
{EFUSE_BLK1, 90, 3}, // [] Package version,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PA_TRIM_VERSION[] = {
|
||||
{EFUSE_BLK1, 93, 3}, // [] PADC CAL PA trim version,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t TRIM_N_BIAS[] = {
|
||||
{EFUSE_BLK1, 96, 5}, // [] PADC CAL N bias,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t TRIM_P_BIAS[] = {
|
||||
{EFUSE_BLK1, 101, 5}, // [] PADC CAL P bias,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t OPTIONAL_UNIQUE_ID[] = {
|
||||
{EFUSE_BLK2, 0, 128}, // [] Optional unique 128-bit ID,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t OCODE[] = {
|
||||
{EFUSE_BLK2, 137, 8}, // [] ADC OCode,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t USER_DATA[] = {
|
||||
@ -518,6 +706,41 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_RD_DIS[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DISABLE_DEPLOY_MODE[] = {
|
||||
&WR_DIS_KM_DISABLE_DEPLOY_MODE[0], // [] wr_dis of KM_DISABLE_DEPLOY_MODE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_RND_SWITCH_CYCLE[] = {
|
||||
&WR_DIS_KM_RND_SWITCH_CYCLE[0], // [] wr_dis of KM_RND_SWITCH_CYCLE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DEPLOY_ONLY_ONCE[] = {
|
||||
&WR_DIS_KM_DEPLOY_ONLY_ONCE[0], // [] wr_dis of KM_DEPLOY_ONLY_ONCE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_USE_KEY_MANAGER_KEY[] = {
|
||||
&WR_DIS_FORCE_USE_KEY_MANAGER_KEY[0], // [] wr_dis of FORCE_USE_KEY_MANAGER_KEY
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_DISABLE_SW_INIT_KEY[] = {
|
||||
&WR_DIS_FORCE_DISABLE_SW_INIT_KEY[0], // [] wr_dis of FORCE_DISABLE_SW_INIT_KEY
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_XTS_KEY_LENGTH_256[] = {
|
||||
&WR_DIS_KM_XTS_KEY_LENGTH_256[0], // [] wr_dis of KM_XTS_KEY_LENGTH_256
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_LOCK_KM_KEY[] = {
|
||||
&WR_DIS_LOCK_KM_KEY[0], // [] wr_dis of LOCK_KM_KEY
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_ICACHE[] = {
|
||||
&WR_DIS_DIS_ICACHE[0], // [] wr_dis of DIS_ICACHE
|
||||
NULL
|
||||
@ -533,6 +756,11 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_FORCE_DOWNLOAD[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_DOWNLOAD_MSPI_DIS[] = {
|
||||
&WR_DIS_SPI_DOWNLOAD_MSPI_DIS[0], // [] wr_dis of SPI_DOWNLOAD_MSPI_DIS
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_TWAI[] = {
|
||||
&WR_DIS_DIS_TWAI[0], // [] wr_dis of DIS_TWAI
|
||||
NULL
|
||||
@ -553,6 +781,11 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HYS_EN_PAD[] = {
|
||||
&WR_DIS_HYS_EN_PAD[0], // [] wr_dis of HYS_EN_PAD
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WDT_DELAY_SEL[] = {
|
||||
&WR_DIS_WDT_DELAY_SEL[0], // [] wr_dis of WDT_DELAY_SEL
|
||||
NULL
|
||||
@ -613,6 +846,26 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SEC_DPA_LEVEL[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTS_DPA_PSEUDO_LEVEL[] = {
|
||||
&WR_DIS_XTS_DPA_PSEUDO_LEVEL[0], // [] wr_dis of XTS_DPA_PSEUDO_LEVEL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTS_DPA_CLK_ENABLE[] = {
|
||||
&WR_DIS_XTS_DPA_CLK_ENABLE[0], // [] wr_dis of XTS_DPA_CLK_ENABLE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ECDSA_DISABLE_P192[] = {
|
||||
&WR_DIS_ECDSA_DISABLE_P192[0], // [] wr_dis of ECDSA_DISABLE_P192
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ECC_FORCE_CONST_TIME[] = {
|
||||
&WR_DIS_ECC_FORCE_CONST_TIME[0], // [] wr_dis of ECC_FORCE_CONST_TIME
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_EN[] = {
|
||||
&WR_DIS_SECURE_BOOT_EN[0], // [] wr_dis of SECURE_BOOT_EN
|
||||
NULL
|
||||
@ -623,8 +876,13 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_DOWNLOAD_MSPI_DIS[] = {
|
||||
&WR_DIS_SPI_DOWNLOAD_MSPI_DIS[0], // [] wr_dis of SPI_DOWNLOAD_MSPI_DIS
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTAL_48M_SEL[] = {
|
||||
&WR_DIS_XTAL_48M_SEL[0], // [] wr_dis of XTAL_48M_SEL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTAL_48M_SEL_MODE[] = {
|
||||
&WR_DIS_XTAL_48M_SEL_MODE[0], // [] wr_dis of XTAL_48M_SEL_MODE
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -678,6 +936,11 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HUK_GEN_STATE[] = {
|
||||
&WR_DIS_HUK_GEN_STATE[0], // [] wr_dis of HUK_GEN_STATE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[] = {
|
||||
&WR_DIS_BLK1[0], // [] wr_dis of BLOCK1
|
||||
NULL
|
||||
@ -693,13 +956,93 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_MAC_EXT[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WAFER_VERSION_MINOR[] = {
|
||||
&WR_DIS_WAFER_VERSION_MINOR[0], // [] wr_dis of WAFER_VERSION_MINOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WAFER_VERSION_MAJOR[] = {
|
||||
&WR_DIS_WAFER_VERSION_MAJOR[0], // [] wr_dis of WAFER_VERSION_MAJOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DISABLE_WAFER_VERSION_MAJOR[] = {
|
||||
&WR_DIS_DISABLE_WAFER_VERSION_MAJOR[0], // [] wr_dis of DISABLE_WAFER_VERSION_MAJOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DISABLE_BLK_VERSION_MAJOR[] = {
|
||||
&WR_DIS_DISABLE_BLK_VERSION_MAJOR[0], // [] wr_dis of DISABLE_BLK_VERSION_MAJOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MINOR[] = {
|
||||
&WR_DIS_BLK_VERSION_MINOR[0], // [] wr_dis of BLK_VERSION_MINOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MAJOR[] = {
|
||||
&WR_DIS_BLK_VERSION_MAJOR[0], // [] wr_dis of BLK_VERSION_MAJOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CAP[] = {
|
||||
&WR_DIS_FLASH_CAP[0], // [] wr_dis of FLASH_CAP
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_VENDOR[] = {
|
||||
&WR_DIS_FLASH_VENDOR[0], // [] wr_dis of FLASH_VENDOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_CAP[] = {
|
||||
&WR_DIS_PSRAM_CAP[0], // [] wr_dis of PSRAM_CAP
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_VENDOR[] = {
|
||||
&WR_DIS_PSRAM_VENDOR[0], // [] wr_dis of PSRAM_VENDOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TEMP[] = {
|
||||
&WR_DIS_TEMP[0], // [] wr_dis of TEMP
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PKG_VERSION[] = {
|
||||
&WR_DIS_PKG_VERSION[0], // [] wr_dis of PKG_VERSION
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PA_TRIM_VERSION[] = {
|
||||
&WR_DIS_PA_TRIM_VERSION[0], // [] wr_dis of PA_TRIM_VERSION
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TRIM_N_BIAS[] = {
|
||||
&WR_DIS_TRIM_N_BIAS[0], // [] wr_dis of TRIM_N_BIAS
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TRIM_P_BIAS[] = {
|
||||
&WR_DIS_TRIM_P_BIAS[0], // [] wr_dis of TRIM_P_BIAS
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SYS_DATA_PART1[] = {
|
||||
&WR_DIS_SYS_DATA_PART1[0], // [] wr_dis of BLOCK2
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLOCK_SYS_DATA1[] = {
|
||||
&WR_DIS_BLOCK_SYS_DATA1[0], // [] wr_dis of BLOCK_SYS_DATA1
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_OPTIONAL_UNIQUE_ID[] = {
|
||||
&WR_DIS_OPTIONAL_UNIQUE_ID[0], // [] wr_dis of OPTIONAL_UNIQUE_ID
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_OCODE[] = {
|
||||
&WR_DIS_OCODE[0], // [] wr_dis of OCODE
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -1068,8 +1411,88 @@ const esp_efuse_desc_t* ESP_EFUSE_MAC_EXT[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_BLOCK_SYS_DATA1[] = {
|
||||
&BLOCK_SYS_DATA1[0], // [] System data part 1 (reserved)
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WAFER_VERSION_MINOR[] = {
|
||||
&WAFER_VERSION_MINOR[0], // [] Minor chip version
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WAFER_VERSION_MAJOR[] = {
|
||||
&WAFER_VERSION_MAJOR[0], // [] Minor chip version
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_DISABLE_WAFER_VERSION_MAJOR[] = {
|
||||
&DISABLE_WAFER_VERSION_MAJOR[0], // [] Disables check of wafer version major
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_DISABLE_BLK_VERSION_MAJOR[] = {
|
||||
&DISABLE_BLK_VERSION_MAJOR[0], // [] Disables check of blk version major
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MINOR[] = {
|
||||
&BLK_VERSION_MINOR[0], // [] BLK_VERSION_MINOR of BLOCK2
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MAJOR[] = {
|
||||
&BLK_VERSION_MAJOR[0], // [] BLK_VERSION_MAJOR of BLOCK2
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_FLASH_CAP[] = {
|
||||
&FLASH_CAP[0], // [] Flash capacity
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_FLASH_VENDOR[] = {
|
||||
&FLASH_VENDOR[0], // [] Flash vendor
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_PSRAM_CAP[] = {
|
||||
&PSRAM_CAP[0], // [] Psram capacity
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_PSRAM_VENDOR[] = {
|
||||
&PSRAM_VENDOR[0], // [] Psram vendor
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_TEMP[] = {
|
||||
&TEMP[0], // [] Temp (die embedded inside)
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_PKG_VERSION[] = {
|
||||
&PKG_VERSION[0], // [] Package version
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_PA_TRIM_VERSION[] = {
|
||||
&PA_TRIM_VERSION[0], // [] PADC CAL PA trim version
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_TRIM_N_BIAS[] = {
|
||||
&TRIM_N_BIAS[0], // [] PADC CAL N bias
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_TRIM_P_BIAS[] = {
|
||||
&TRIM_P_BIAS[0], // [] PADC CAL P bias
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_OPTIONAL_UNIQUE_ID[] = {
|
||||
&OPTIONAL_UNIQUE_ID[0], // [] Optional unique 128-bit ID
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_OCODE[] = {
|
||||
&OCODE[0], // [] ADC OCode
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -9,17 +9,26 @@
|
||||
# this will generate new source files, next rebuild all the sources.
|
||||
# !!!!!!!!!!! #
|
||||
|
||||
# This file was generated by regtools.py based on the efuses.yaml file with the version: 64acd55d57b7452dbb6838b7237c795b
|
||||
# This file was generated by regtools.py based on the efuses.yaml file with the version: b09fa417de505238a601eddce188b696
|
||||
|
||||
WR_DIS, EFUSE_BLK0, 0, 32, [] Disable programming of individual eFuses
|
||||
WR_DIS.RD_DIS, EFUSE_BLK0, 0, 1, [] wr_dis of RD_DIS
|
||||
WR_DIS.KM_DISABLE_DEPLOY_MODE, EFUSE_BLK0, 1, 1, [] wr_dis of KM_DISABLE_DEPLOY_MODE
|
||||
WR_DIS.KM_RND_SWITCH_CYCLE, EFUSE_BLK0, 1, 1, [] wr_dis of KM_RND_SWITCH_CYCLE
|
||||
WR_DIS.KM_DEPLOY_ONLY_ONCE, EFUSE_BLK0, 1, 1, [] wr_dis of KM_DEPLOY_ONLY_ONCE
|
||||
WR_DIS.FORCE_USE_KEY_MANAGER_KEY, EFUSE_BLK0, 1, 1, [] wr_dis of FORCE_USE_KEY_MANAGER_KEY
|
||||
WR_DIS.FORCE_DISABLE_SW_INIT_KEY, EFUSE_BLK0, 1, 1, [] wr_dis of FORCE_DISABLE_SW_INIT_KEY
|
||||
WR_DIS.KM_XTS_KEY_LENGTH_256, EFUSE_BLK0, 1, 1, [] wr_dis of KM_XTS_KEY_LENGTH_256
|
||||
WR_DIS.LOCK_KM_KEY, EFUSE_BLK0, 1, 1, [] wr_dis of LOCK_KM_KEY
|
||||
WR_DIS.DIS_ICACHE, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_ICACHE
|
||||
WR_DIS.DIS_USB_JTAG, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_USB_JTAG
|
||||
WR_DIS.DIS_FORCE_DOWNLOAD, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_FORCE_DOWNLOAD
|
||||
WR_DIS.SPI_DOWNLOAD_MSPI_DIS, EFUSE_BLK0, 2, 1, [] wr_dis of SPI_DOWNLOAD_MSPI_DIS
|
||||
WR_DIS.DIS_TWAI, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_TWAI
|
||||
WR_DIS.JTAG_SEL_ENABLE, EFUSE_BLK0, 2, 1, [] wr_dis of JTAG_SEL_ENABLE
|
||||
WR_DIS.DIS_PAD_JTAG, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_PAD_JTAG
|
||||
WR_DIS.DIS_DOWNLOAD_MANUAL_ENCRYPT, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_DOWNLOAD_MANUAL_ENCRYPT
|
||||
WR_DIS.HYS_EN_PAD, EFUSE_BLK0, 2, 1, [] wr_dis of HYS_EN_PAD
|
||||
WR_DIS.WDT_DELAY_SEL, EFUSE_BLK0, 3, 1, [] wr_dis of WDT_DELAY_SEL
|
||||
WR_DIS.SPI_BOOT_CRYPT_CNT, EFUSE_BLK0, 4, 1, [] wr_dis of SPI_BOOT_CRYPT_CNT
|
||||
WR_DIS.SECURE_BOOT_KEY_REVOKE0, EFUSE_BLK0, 5, 1, [] wr_dis of SECURE_BOOT_KEY_REVOKE0
|
||||
@ -32,9 +41,14 @@ WR_DIS.KEY_PURPOSE_3, EFUSE_BLK0, 11, 1, [WR_DIS.K
|
||||
WR_DIS.KEY_PURPOSE_4, EFUSE_BLK0, 12, 1, [WR_DIS.KEY4_PURPOSE] wr_dis of KEY_PURPOSE_4
|
||||
WR_DIS.KEY_PURPOSE_5, EFUSE_BLK0, 13, 1, [WR_DIS.KEY5_PURPOSE] wr_dis of KEY_PURPOSE_5
|
||||
WR_DIS.SEC_DPA_LEVEL, EFUSE_BLK0, 14, 1, [] wr_dis of SEC_DPA_LEVEL
|
||||
WR_DIS.XTS_DPA_PSEUDO_LEVEL, EFUSE_BLK0, 14, 1, [] wr_dis of XTS_DPA_PSEUDO_LEVEL
|
||||
WR_DIS.XTS_DPA_CLK_ENABLE, EFUSE_BLK0, 14, 1, [] wr_dis of XTS_DPA_CLK_ENABLE
|
||||
WR_DIS.ECDSA_DISABLE_P192, EFUSE_BLK0, 14, 1, [] wr_dis of ECDSA_DISABLE_P192
|
||||
WR_DIS.ECC_FORCE_CONST_TIME, EFUSE_BLK0, 14, 1, [] wr_dis of ECC_FORCE_CONST_TIME
|
||||
WR_DIS.SECURE_BOOT_EN, EFUSE_BLK0, 15, 1, [] wr_dis of SECURE_BOOT_EN
|
||||
WR_DIS.SECURE_BOOT_AGGRESSIVE_REVOKE, EFUSE_BLK0, 16, 1, [] wr_dis of SECURE_BOOT_AGGRESSIVE_REVOKE
|
||||
WR_DIS.SPI_DOWNLOAD_MSPI_DIS, EFUSE_BLK0, 17, 1, [] wr_dis of SPI_DOWNLOAD_MSPI_DIS
|
||||
WR_DIS.XTAL_48M_SEL, EFUSE_BLK0, 17, 1, [] wr_dis of XTAL_48M_SEL
|
||||
WR_DIS.XTAL_48M_SEL_MODE, EFUSE_BLK0, 17, 1, [] wr_dis of XTAL_48M_SEL_MODE
|
||||
WR_DIS.FLASH_TPUW, EFUSE_BLK0, 18, 1, [] wr_dis of FLASH_TPUW
|
||||
WR_DIS.DIS_DOWNLOAD_MODE, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_DOWNLOAD_MODE
|
||||
WR_DIS.DIS_DIRECT_BOOT, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_DIRECT_BOOT
|
||||
@ -44,12 +58,29 @@ WR_DIS.ENABLE_SECURITY_DOWNLOAD, EFUSE_BLK0, 18, 1, [] wr_dis
|
||||
WR_DIS.UART_PRINT_CONTROL, EFUSE_BLK0, 18, 1, [] wr_dis of UART_PRINT_CONTROL
|
||||
WR_DIS.FORCE_SEND_RESUME, EFUSE_BLK0, 18, 1, [] wr_dis of FORCE_SEND_RESUME
|
||||
WR_DIS.SECURE_VERSION, EFUSE_BLK0, 18, 1, [] wr_dis of SECURE_VERSION
|
||||
WR_DIS.SECURE_BOOT_DISABLE_FAST_WAKE, EFUSE_BLK0, 19, 1, [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE
|
||||
WR_DIS.SECURE_BOOT_DISABLE_FAST_WAKE, EFUSE_BLK0, 18, 1, [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE
|
||||
WR_DIS.HUK_GEN_STATE, EFUSE_BLK0, 19, 1, [] wr_dis of HUK_GEN_STATE
|
||||
WR_DIS.BLK1, EFUSE_BLK0, 20, 1, [] wr_dis of BLOCK1
|
||||
WR_DIS.MAC, EFUSE_BLK0, 20, 1, [WR_DIS.MAC_FACTORY] wr_dis of MAC
|
||||
WR_DIS.MAC_EXT, EFUSE_BLK0, 20, 1, [] wr_dis of MAC_EXT
|
||||
WR_DIS.WAFER_VERSION_MINOR, EFUSE_BLK0, 20, 1, [] wr_dis of WAFER_VERSION_MINOR
|
||||
WR_DIS.WAFER_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis of WAFER_VERSION_MAJOR
|
||||
WR_DIS.DISABLE_WAFER_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis of DISABLE_WAFER_VERSION_MAJOR
|
||||
WR_DIS.DISABLE_BLK_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis of DISABLE_BLK_VERSION_MAJOR
|
||||
WR_DIS.BLK_VERSION_MINOR, EFUSE_BLK0, 20, 1, [] wr_dis of BLK_VERSION_MINOR
|
||||
WR_DIS.BLK_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis of BLK_VERSION_MAJOR
|
||||
WR_DIS.FLASH_CAP, EFUSE_BLK0, 20, 1, [] wr_dis of FLASH_CAP
|
||||
WR_DIS.FLASH_VENDOR, EFUSE_BLK0, 20, 1, [] wr_dis of FLASH_VENDOR
|
||||
WR_DIS.PSRAM_CAP, EFUSE_BLK0, 20, 1, [] wr_dis of PSRAM_CAP
|
||||
WR_DIS.PSRAM_VENDOR, EFUSE_BLK0, 20, 1, [] wr_dis of PSRAM_VENDOR
|
||||
WR_DIS.TEMP, EFUSE_BLK0, 20, 1, [] wr_dis of TEMP
|
||||
WR_DIS.PKG_VERSION, EFUSE_BLK0, 20, 1, [] wr_dis of PKG_VERSION
|
||||
WR_DIS.PA_TRIM_VERSION, EFUSE_BLK0, 20, 1, [] wr_dis of PA_TRIM_VERSION
|
||||
WR_DIS.TRIM_N_BIAS, EFUSE_BLK0, 20, 1, [] wr_dis of TRIM_N_BIAS
|
||||
WR_DIS.TRIM_P_BIAS, EFUSE_BLK0, 20, 1, [] wr_dis of TRIM_P_BIAS
|
||||
WR_DIS.SYS_DATA_PART1, EFUSE_BLK0, 21, 1, [] wr_dis of BLOCK2
|
||||
WR_DIS.BLOCK_SYS_DATA1, EFUSE_BLK0, 21, 1, [] wr_dis of BLOCK_SYS_DATA1
|
||||
WR_DIS.OPTIONAL_UNIQUE_ID, EFUSE_BLK0, 21, 1, [] wr_dis of OPTIONAL_UNIQUE_ID
|
||||
WR_DIS.OCODE, EFUSE_BLK0, 21, 1, [] wr_dis of OCODE
|
||||
WR_DIS.BLOCK_USR_DATA, EFUSE_BLK0, 22, 1, [WR_DIS.USER_DATA] wr_dis of BLOCK_USR_DATA
|
||||
WR_DIS.CUSTOM_MAC, EFUSE_BLK0, 22, 1, [WR_DIS.MAC_CUSTOM WR_DIS.USER_DATA_MAC_CUSTOM] wr_dis of CUSTOM_MAC
|
||||
WR_DIS.BLOCK_KEY0, EFUSE_BLK0, 23, 1, [WR_DIS.KEY0] wr_dis of BLOCK_KEY0
|
||||
@ -127,7 +158,23 @@ MAC, EFUSE_BLK1, 40, 8, [MAC_FACT
|
||||
, EFUSE_BLK1, 8, 8, [MAC_FACTORY] MAC address
|
||||
, EFUSE_BLK1, 0, 8, [MAC_FACTORY] MAC address
|
||||
MAC_EXT, EFUSE_BLK1, 48, 16, [] Represents the extended bits of MAC address
|
||||
BLOCK_SYS_DATA1, EFUSE_BLK2, 0, 256, [] System data part 1 (reserved)
|
||||
WAFER_VERSION_MINOR, EFUSE_BLK1, 64, 4, [] Minor chip version
|
||||
WAFER_VERSION_MAJOR, EFUSE_BLK1, 68, 2, [] Minor chip version
|
||||
DISABLE_WAFER_VERSION_MAJOR, EFUSE_BLK1, 70, 1, [] Disables check of wafer version major
|
||||
DISABLE_BLK_VERSION_MAJOR, EFUSE_BLK1, 71, 1, [] Disables check of blk version major
|
||||
BLK_VERSION_MINOR, EFUSE_BLK1, 72, 3, [] BLK_VERSION_MINOR of BLOCK2
|
||||
BLK_VERSION_MAJOR, EFUSE_BLK1, 75, 2, [] BLK_VERSION_MAJOR of BLOCK2
|
||||
FLASH_CAP, EFUSE_BLK1, 77, 3, [] Flash capacity
|
||||
FLASH_VENDOR, EFUSE_BLK1, 80, 3, [] Flash vendor
|
||||
PSRAM_CAP, EFUSE_BLK1, 83, 3, [] Psram capacity
|
||||
PSRAM_VENDOR, EFUSE_BLK1, 86, 2, [] Psram vendor
|
||||
TEMP, EFUSE_BLK1, 88, 2, [] Temp (die embedded inside)
|
||||
PKG_VERSION, EFUSE_BLK1, 90, 3, [] Package version
|
||||
PA_TRIM_VERSION, EFUSE_BLK1, 93, 3, [] PADC CAL PA trim version
|
||||
TRIM_N_BIAS, EFUSE_BLK1, 96, 5, [] PADC CAL N bias
|
||||
TRIM_P_BIAS, EFUSE_BLK1, 101, 5, [] PADC CAL P bias
|
||||
OPTIONAL_UNIQUE_ID, EFUSE_BLK2, 0, 128, [] Optional unique 128-bit ID
|
||||
OCODE, EFUSE_BLK2, 137, 8, [] ADC OCode
|
||||
USER_DATA, EFUSE_BLK3, 0, 256, [BLOCK_USR_DATA] User data
|
||||
USER_DATA.MAC_CUSTOM, EFUSE_BLK3, 200, 48, [MAC_CUSTOM CUSTOM_MAC] Custom MAC
|
||||
KEY0, EFUSE_BLK4, 0, 256, [BLOCK_KEY0] Key0 or user data
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 53.
|
@ -10,7 +10,7 @@ extern "C" {
|
||||
|
||||
#include "esp_efuse.h"
|
||||
|
||||
// md5_digest_table eb005412b657c9be0ce4bb699e5813c9
|
||||
// md5_digest_table 13b0a8106fd483a0fcfa8b2f7388a95f
|
||||
// This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY.
|
||||
// If you want to change some fields, you need to change esp_efuse_table.csv file
|
||||
// then run `efuse_common_table` or `efuse_custom_table` command it will generate this file.
|
||||
@ -19,13 +19,22 @@ extern "C" {
|
||||
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_RD_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DISABLE_DEPLOY_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_RND_SWITCH_CYCLE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DEPLOY_ONLY_ONCE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_USE_KEY_MANAGER_KEY[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_DISABLE_SW_INIT_KEY[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_XTS_KEY_LENGTH_256[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_LOCK_KM_KEY[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_ICACHE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_JTAG[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_FORCE_DOWNLOAD[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_DOWNLOAD_MSPI_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_TWAI[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_JTAG_SEL_ENABLE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_PAD_JTAG[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HYS_EN_PAD[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WDT_DELAY_SEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_BOOT_CRYPT_CNT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_KEY_REVOKE0[];
|
||||
@ -44,9 +53,14 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY_PURPOSE_4[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY_PURPOSE_5[];
|
||||
#define ESP_EFUSE_WR_DIS_KEY5_PURPOSE ESP_EFUSE_WR_DIS_KEY_PURPOSE_5
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SEC_DPA_LEVEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTS_DPA_PSEUDO_LEVEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTS_DPA_CLK_ENABLE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ECDSA_DISABLE_P192[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ECC_FORCE_CONST_TIME[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_EN[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_DOWNLOAD_MSPI_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTAL_48M_SEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTAL_48M_SEL_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TPUW[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DIRECT_BOOT[];
|
||||
@ -57,12 +71,29 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_UART_PRINT_CONTROL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_SEND_RESUME[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HUK_GEN_STATE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_MAC[];
|
||||
#define ESP_EFUSE_WR_DIS_MAC_FACTORY ESP_EFUSE_WR_DIS_MAC
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_MAC_EXT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WAFER_VERSION_MINOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WAFER_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DISABLE_WAFER_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DISABLE_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MINOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PKG_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PA_TRIM_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TRIM_N_BIAS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TRIM_P_BIAS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SYS_DATA_PART1[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLOCK_SYS_DATA1[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_OPTIONAL_UNIQUE_ID[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_OCODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLOCK_USR_DATA[];
|
||||
#define ESP_EFUSE_WR_DIS_USER_DATA ESP_EFUSE_WR_DIS_BLOCK_USR_DATA
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_CUSTOM_MAC[];
|
||||
@ -159,7 +190,23 @@ extern const esp_efuse_desc_t* ESP_EFUSE_ECC_FORCE_CONST_TIME[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_MAC[];
|
||||
#define ESP_EFUSE_MAC_FACTORY ESP_EFUSE_MAC
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_MAC_EXT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_BLOCK_SYS_DATA1[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WAFER_VERSION_MINOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WAFER_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_WAFER_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MINOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PSRAM_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PSRAM_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PKG_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PA_TRIM_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_TRIM_N_BIAS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_TRIM_P_BIAS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_OPTIONAL_UNIQUE_ID[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_OCODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_USER_DATA[];
|
||||
#define ESP_EFUSE_BLOCK_USR_DATA ESP_EFUSE_USER_DATA
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_USER_DATA_MAC_CUSTOM[];
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include <assert.h>
|
||||
#include "esp_efuse_table.h"
|
||||
|
||||
// md5_digest_table 2eb36a43d52e9922e08cf545d0e23381
|
||||
// md5_digest_table 0d4e1f49db99de4dd9d3eac8d8e6078b
|
||||
// This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY.
|
||||
// If you want to change some fields, you need to change esp_efuse_table.csv file
|
||||
// then run `efuse_common_table` or `efuse_custom_table` command it will generate this file.
|
||||
@ -23,6 +23,98 @@ static const esp_efuse_desc_t WR_DIS_RD_DIS[] = {
|
||||
{EFUSE_BLK0, 0, 1}, // [] wr_dis of RD_DIS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_RND_SWITCH_CYCLE[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_RND_SWITCH_CYCLE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_DEPLOY_ONLY_ONCE[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_DEPLOY_ONLY_ONCE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FORCE_USE_KEY_MANAGER_KEY[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of FORCE_USE_KEY_MANAGER_KEY,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FORCE_DISABLE_SW_INIT_KEY[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of FORCE_DISABLE_SW_INIT_KEY,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_XTS_KEY_LENGTH_256[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of XTS_KEY_LENGTH_256,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_LOCK_KM_KEY[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of LOCK_KM_KEY,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_DISABLE_DEPLOY_MODE[] = {
|
||||
{EFUSE_BLK0, 1, 1}, // [] wr_dis of KM_DISABLE_DEPLOY_MODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_USB_JTAG[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_USB_JTAG,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_FORCE_DOWNLOAD[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_FORCE_DOWNLOAD,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SPI_DOWNLOAD_MSPI_DIS[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of SPI_DOWNLOAD_MSPI_DIS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_TWAI[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_TWAI,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_JTAG_SEL_ENABLE[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of JTAG_SEL_ENABLE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_PAD_JTAG[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_PAD_JTAG,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_DOWNLOAD_MANUAL_ENCRYPT,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_WDT_DELAY_SEL[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of WDT_DELAY_SEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_HYS_EN_PAD[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of HYS_EN_PAD,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PXA0_TIEH_SEL_0[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of PXA0_TIEH_SEL_0,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PXA0_TIEH_SEL_1[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of PXA0_TIEH_SEL_1,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PXA0_TIEH_SEL_2[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of PXA0_TIEH_SEL_2,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PXA0_TIEH_SEL_3[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of PXA0_TIEH_SEL_3,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_WDT[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_WDT,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_SWD[] = {
|
||||
{EFUSE_BLK0, 2, 1}, // [] wr_dis of DIS_SWD,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_HP_PWR_SRC_SEL[] = {
|
||||
{EFUSE_BLK0, 3, 1}, // [] wr_dis of HP_PWR_SRC_SEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SPI_BOOT_CRYPT_CNT[] = {
|
||||
{EFUSE_BLK0, 4, 1}, // [] wr_dis of SPI_BOOT_CRYPT_CNT,
|
||||
};
|
||||
@ -63,10 +155,86 @@ static const esp_efuse_desc_t WR_DIS_KEY_PURPOSE_5[] = {
|
||||
{EFUSE_BLK0, 13, 1}, // [WR_DIS.KEY5_PURPOSE] wr_dis of KEY_PURPOSE_5,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SEC_DPA_LEVEL[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of SEC_DPA_LEVEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_CRYPT_DPA_ENABLE[] = {
|
||||
{EFUSE_BLK0, 14, 1}, // [] wr_dis of CRYPT_DPA_ENABLE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SECURE_BOOT_EN[] = {
|
||||
{EFUSE_BLK0, 15, 1}, // [] wr_dis of SECURE_BOOT_EN,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[] = {
|
||||
{EFUSE_BLK0, 16, 1}, // [] wr_dis of SECURE_BOOT_AGGRESSIVE_REVOKE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_ECDSA_ENABLE_SOFT_K[] = {
|
||||
{EFUSE_BLK0, 17, 1}, // [] wr_dis of ECDSA_ENABLE_SOFT_K,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_TYPE[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of FLASH_TYPE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_PAGE_SIZE[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of FLASH_PAGE_SIZE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_ECC_EN[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of FLASH_ECC_EN,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_USB_OTG_DOWNLOAD_MODE[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of DIS_USB_OTG_DOWNLOAD_MODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_TPUW[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of FLASH_TPUW,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_DOWNLOAD_MODE[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of DIS_DOWNLOAD_MODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_DIRECT_BOOT[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of DIS_DIRECT_BOOT,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_USB_SERIAL_JTAG_ROM_PRINT[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of DIS_USB_SERIAL_JTAG_ROM_PRINT,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_ENABLE_SECURITY_DOWNLOAD[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of ENABLE_SECURITY_DOWNLOAD,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_UART_PRINT_CONTROL[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of UART_PRINT_CONTROL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FORCE_SEND_RESUME[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of FORCE_SEND_RESUME,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SECURE_VERSION[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of SECURE_VERSION,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[] = {
|
||||
{EFUSE_BLK0, 18, 1}, // [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_KM_HUK_GEN_STATE[] = {
|
||||
{EFUSE_BLK0, 19, 1}, // [] wr_dis of KM_HUK_GEN_STATE,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_BLK1[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of BLOCK1,
|
||||
};
|
||||
@ -99,24 +267,12 @@ static const esp_efuse_desc_t WR_DIS_BLK_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of BLK_VERSION_MAJOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_CAP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of FLASH_CAP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_TEMP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of FLASH_TEMP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_FLASH_VENDOR[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of FLASH_VENDOR,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PSRAM_CAP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of PSRAM_CAP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PSRAM_TEMP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of PSRAM_TEMP,
|
||||
static const esp_efuse_desc_t WR_DIS_TEMP[] = {
|
||||
{EFUSE_BLK0, 20, 1}, // [] wr_dis of TEMP,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_PSRAM_VENDOR[] = {
|
||||
@ -171,6 +327,22 @@ static const esp_efuse_desc_t WR_DIS_BLOCK_SYS_DATA2[] = {
|
||||
{EFUSE_BLK0, 29, 1}, // [WR_DIS.SYS_DATA_PART2] wr_dis of BLOCK_SYS_DATA2,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_USB_DEVICE_EXCHG_PINS[] = {
|
||||
{EFUSE_BLK0, 30, 1}, // [] wr_dis of USB_DEVICE_EXCHG_PINS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_USB_OTG11_EXCHG_PINS[] = {
|
||||
{EFUSE_BLK0, 30, 1}, // [] wr_dis of USB_OTG11_EXCHG_PINS,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_USB_PHY_SEL[] = {
|
||||
{EFUSE_BLK0, 30, 1}, // [] wr_dis of USB_PHY_SEL,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t WR_DIS_SOFT_DIS_JTAG[] = {
|
||||
{EFUSE_BLK0, 31, 1}, // [] wr_dis of SOFT_DIS_JTAG,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t RD_DIS[] = {
|
||||
{EFUSE_BLK0, 32, 7}, // [] Disable reading from BlOCK4-10,
|
||||
};
|
||||
@ -476,32 +648,20 @@ static const esp_efuse_desc_t BLK_VERSION_MAJOR[] = {
|
||||
{EFUSE_BLK1, 75, 2}, // [] BLK_VERSION_MAJOR of BLOCK2,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t FLASH_CAP[] = {
|
||||
{EFUSE_BLK1, 77, 3}, // [] Flash capacity,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t FLASH_TEMP[] = {
|
||||
{EFUSE_BLK1, 80, 2}, // [] Flash temperature,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t FLASH_VENDOR[] = {
|
||||
{EFUSE_BLK1, 82, 3}, // [] Flash vendor,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PSRAM_CAP[] = {
|
||||
{EFUSE_BLK1, 85, 2}, // [] PSRAM capacity,
|
||||
{EFUSE_BLK1, 77, 3}, // [] PSRAM capacity,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PSRAM_TEMP[] = {
|
||||
{EFUSE_BLK1, 87, 2}, // [] PSRAM temperature,
|
||||
static const esp_efuse_desc_t TEMP[] = {
|
||||
{EFUSE_BLK1, 80, 2}, // [] Operating temperature of the ESP chip,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PSRAM_VENDOR[] = {
|
||||
{EFUSE_BLK1, 89, 2}, // [] PSRAM vendor,
|
||||
{EFUSE_BLK1, 82, 2}, // [] PSRAM vendor,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t PKG_VERSION[] = {
|
||||
{EFUSE_BLK1, 91, 3}, // [] Package version,
|
||||
{EFUSE_BLK1, 84, 3}, // [] Package version,
|
||||
};
|
||||
|
||||
static const esp_efuse_desc_t OPTIONAL_UNIQUE_ID[] = {
|
||||
@ -558,6 +718,121 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_RD_DIS[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_RND_SWITCH_CYCLE[] = {
|
||||
&WR_DIS_KM_RND_SWITCH_CYCLE[0], // [] wr_dis of KM_RND_SWITCH_CYCLE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DEPLOY_ONLY_ONCE[] = {
|
||||
&WR_DIS_KM_DEPLOY_ONLY_ONCE[0], // [] wr_dis of KM_DEPLOY_ONLY_ONCE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_USE_KEY_MANAGER_KEY[] = {
|
||||
&WR_DIS_FORCE_USE_KEY_MANAGER_KEY[0], // [] wr_dis of FORCE_USE_KEY_MANAGER_KEY
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_DISABLE_SW_INIT_KEY[] = {
|
||||
&WR_DIS_FORCE_DISABLE_SW_INIT_KEY[0], // [] wr_dis of FORCE_DISABLE_SW_INIT_KEY
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTS_KEY_LENGTH_256[] = {
|
||||
&WR_DIS_XTS_KEY_LENGTH_256[0], // [] wr_dis of XTS_KEY_LENGTH_256
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_LOCK_KM_KEY[] = {
|
||||
&WR_DIS_LOCK_KM_KEY[0], // [] wr_dis of LOCK_KM_KEY
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DISABLE_DEPLOY_MODE[] = {
|
||||
&WR_DIS_KM_DISABLE_DEPLOY_MODE[0], // [] wr_dis of KM_DISABLE_DEPLOY_MODE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_JTAG[] = {
|
||||
&WR_DIS_DIS_USB_JTAG[0], // [] wr_dis of DIS_USB_JTAG
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_FORCE_DOWNLOAD[] = {
|
||||
&WR_DIS_DIS_FORCE_DOWNLOAD[0], // [] wr_dis of DIS_FORCE_DOWNLOAD
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_DOWNLOAD_MSPI_DIS[] = {
|
||||
&WR_DIS_SPI_DOWNLOAD_MSPI_DIS[0], // [] wr_dis of SPI_DOWNLOAD_MSPI_DIS
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_TWAI[] = {
|
||||
&WR_DIS_DIS_TWAI[0], // [] wr_dis of DIS_TWAI
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_JTAG_SEL_ENABLE[] = {
|
||||
&WR_DIS_JTAG_SEL_ENABLE[0], // [] wr_dis of JTAG_SEL_ENABLE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_PAD_JTAG[] = {
|
||||
&WR_DIS_DIS_PAD_JTAG[0], // [] wr_dis of DIS_PAD_JTAG
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[] = {
|
||||
&WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[0], // [] wr_dis of DIS_DOWNLOAD_MANUAL_ENCRYPT
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WDT_DELAY_SEL[] = {
|
||||
&WR_DIS_WDT_DELAY_SEL[0], // [] wr_dis of WDT_DELAY_SEL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HYS_EN_PAD[] = {
|
||||
&WR_DIS_HYS_EN_PAD[0], // [] wr_dis of HYS_EN_PAD
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_0[] = {
|
||||
&WR_DIS_PXA0_TIEH_SEL_0[0], // [] wr_dis of PXA0_TIEH_SEL_0
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_1[] = {
|
||||
&WR_DIS_PXA0_TIEH_SEL_1[0], // [] wr_dis of PXA0_TIEH_SEL_1
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_2[] = {
|
||||
&WR_DIS_PXA0_TIEH_SEL_2[0], // [] wr_dis of PXA0_TIEH_SEL_2
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_3[] = {
|
||||
&WR_DIS_PXA0_TIEH_SEL_3[0], // [] wr_dis of PXA0_TIEH_SEL_3
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_WDT[] = {
|
||||
&WR_DIS_DIS_WDT[0], // [] wr_dis of DIS_WDT
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_SWD[] = {
|
||||
&WR_DIS_DIS_SWD[0], // [] wr_dis of DIS_SWD
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HP_PWR_SRC_SEL[] = {
|
||||
&WR_DIS_HP_PWR_SRC_SEL[0], // [] wr_dis of HP_PWR_SRC_SEL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_BOOT_CRYPT_CNT[] = {
|
||||
&WR_DIS_SPI_BOOT_CRYPT_CNT[0], // [] wr_dis of SPI_BOOT_CRYPT_CNT
|
||||
NULL
|
||||
@ -608,11 +883,106 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY_PURPOSE_5[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SEC_DPA_LEVEL[] = {
|
||||
&WR_DIS_SEC_DPA_LEVEL[0], // [] wr_dis of SEC_DPA_LEVEL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_CRYPT_DPA_ENABLE[] = {
|
||||
&WR_DIS_CRYPT_DPA_ENABLE[0], // [] wr_dis of CRYPT_DPA_ENABLE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_EN[] = {
|
||||
&WR_DIS_SECURE_BOOT_EN[0], // [] wr_dis of SECURE_BOOT_EN
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[] = {
|
||||
&WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[0], // [] wr_dis of SECURE_BOOT_AGGRESSIVE_REVOKE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ECDSA_ENABLE_SOFT_K[] = {
|
||||
&WR_DIS_ECDSA_ENABLE_SOFT_K[0], // [] wr_dis of ECDSA_ENABLE_SOFT_K
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TYPE[] = {
|
||||
&WR_DIS_FLASH_TYPE[0], // [] wr_dis of FLASH_TYPE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_PAGE_SIZE[] = {
|
||||
&WR_DIS_FLASH_PAGE_SIZE[0], // [] wr_dis of FLASH_PAGE_SIZE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_ECC_EN[] = {
|
||||
&WR_DIS_FLASH_ECC_EN[0], // [] wr_dis of FLASH_ECC_EN
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_OTG_DOWNLOAD_MODE[] = {
|
||||
&WR_DIS_DIS_USB_OTG_DOWNLOAD_MODE[0], // [] wr_dis of DIS_USB_OTG_DOWNLOAD_MODE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TPUW[] = {
|
||||
&WR_DIS_FLASH_TPUW[0], // [] wr_dis of FLASH_TPUW
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MODE[] = {
|
||||
&WR_DIS_DIS_DOWNLOAD_MODE[0], // [] wr_dis of DIS_DOWNLOAD_MODE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DIRECT_BOOT[] = {
|
||||
&WR_DIS_DIS_DIRECT_BOOT[0], // [] wr_dis of DIS_DIRECT_BOOT
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_SERIAL_JTAG_ROM_PRINT[] = {
|
||||
&WR_DIS_DIS_USB_SERIAL_JTAG_ROM_PRINT[0], // [] wr_dis of DIS_USB_SERIAL_JTAG_ROM_PRINT
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE[] = {
|
||||
&WR_DIS_DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE[0], // [] wr_dis of DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ENABLE_SECURITY_DOWNLOAD[] = {
|
||||
&WR_DIS_ENABLE_SECURITY_DOWNLOAD[0], // [] wr_dis of ENABLE_SECURITY_DOWNLOAD
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_UART_PRINT_CONTROL[] = {
|
||||
&WR_DIS_UART_PRINT_CONTROL[0], // [] wr_dis of UART_PRINT_CONTROL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_SEND_RESUME[] = {
|
||||
&WR_DIS_FORCE_SEND_RESUME[0], // [] wr_dis of FORCE_SEND_RESUME
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_VERSION[] = {
|
||||
&WR_DIS_SECURE_VERSION[0], // [] wr_dis of SECURE_VERSION
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[] = {
|
||||
&WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[0], // [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_HUK_GEN_STATE[] = {
|
||||
&WR_DIS_KM_HUK_GEN_STATE[0], // [] wr_dis of KM_HUK_GEN_STATE
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[] = {
|
||||
&WR_DIS_BLK1[0], // [] wr_dis of BLOCK1
|
||||
NULL
|
||||
@ -653,28 +1023,13 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MAJOR[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CAP[] = {
|
||||
&WR_DIS_FLASH_CAP[0], // [] wr_dis of FLASH_CAP
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TEMP[] = {
|
||||
&WR_DIS_FLASH_TEMP[0], // [] wr_dis of FLASH_TEMP
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_VENDOR[] = {
|
||||
&WR_DIS_FLASH_VENDOR[0], // [] wr_dis of FLASH_VENDOR
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_CAP[] = {
|
||||
&WR_DIS_PSRAM_CAP[0], // [] wr_dis of PSRAM_CAP
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_TEMP[] = {
|
||||
&WR_DIS_PSRAM_TEMP[0], // [] wr_dis of PSRAM_TEMP
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TEMP[] = {
|
||||
&WR_DIS_TEMP[0], // [] wr_dis of TEMP
|
||||
NULL
|
||||
};
|
||||
|
||||
@ -743,6 +1098,26 @@ const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLOCK_SYS_DATA2[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_DEVICE_EXCHG_PINS[] = {
|
||||
&WR_DIS_USB_DEVICE_EXCHG_PINS[0], // [] wr_dis of USB_DEVICE_EXCHG_PINS
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_OTG11_EXCHG_PINS[] = {
|
||||
&WR_DIS_USB_OTG11_EXCHG_PINS[0], // [] wr_dis of USB_OTG11_EXCHG_PINS
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_PHY_SEL[] = {
|
||||
&WR_DIS_USB_PHY_SEL[0], // [] wr_dis of USB_PHY_SEL
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SOFT_DIS_JTAG[] = {
|
||||
&WR_DIS_SOFT_DIS_JTAG[0], // [] wr_dis of SOFT_DIS_JTAG
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_RD_DIS[] = {
|
||||
&RD_DIS[0], // [] Disable reading from BlOCK4-10
|
||||
NULL
|
||||
@ -1123,28 +1498,13 @@ const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MAJOR[] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_FLASH_CAP[] = {
|
||||
&FLASH_CAP[0], // [] Flash capacity
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_FLASH_TEMP[] = {
|
||||
&FLASH_TEMP[0], // [] Flash temperature
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_FLASH_VENDOR[] = {
|
||||
&FLASH_VENDOR[0], // [] Flash vendor
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_PSRAM_CAP[] = {
|
||||
&PSRAM_CAP[0], // [] PSRAM capacity
|
||||
NULL
|
||||
};
|
||||
|
||||
const esp_efuse_desc_t* ESP_EFUSE_PSRAM_TEMP[] = {
|
||||
&PSRAM_TEMP[0], // [] PSRAM temperature
|
||||
const esp_efuse_desc_t* ESP_EFUSE_TEMP[] = {
|
||||
&TEMP[0], // [] Operating temperature of the ESP chip
|
||||
NULL
|
||||
};
|
||||
|
||||
|
@ -9,10 +9,33 @@
|
||||
# this will generate new source files, next rebuild all the sources.
|
||||
# !!!!!!!!!!! #
|
||||
|
||||
# This file was generated by regtools.py based on the efuses.yaml file with the version: 6b72374c237a3473c8832aadee437405
|
||||
# This file was generated by regtools.py based on the efuses.yaml file with the version: d4a48929387e281bd05db8cfb3a85f60
|
||||
|
||||
WR_DIS, EFUSE_BLK0, 0, 32, [] Disable programming of individual eFuses
|
||||
WR_DIS.RD_DIS, EFUSE_BLK0, 0, 1, [] wr_dis of RD_DIS
|
||||
WR_DIS.KM_RND_SWITCH_CYCLE, EFUSE_BLK0, 1, 1, [] wr_dis of KM_RND_SWITCH_CYCLE
|
||||
WR_DIS.KM_DEPLOY_ONLY_ONCE, EFUSE_BLK0, 1, 1, [] wr_dis of KM_DEPLOY_ONLY_ONCE
|
||||
WR_DIS.FORCE_USE_KEY_MANAGER_KEY, EFUSE_BLK0, 1, 1, [] wr_dis of FORCE_USE_KEY_MANAGER_KEY
|
||||
WR_DIS.FORCE_DISABLE_SW_INIT_KEY, EFUSE_BLK0, 1, 1, [] wr_dis of FORCE_DISABLE_SW_INIT_KEY
|
||||
WR_DIS.XTS_KEY_LENGTH_256, EFUSE_BLK0, 1, 1, [] wr_dis of XTS_KEY_LENGTH_256
|
||||
WR_DIS.LOCK_KM_KEY, EFUSE_BLK0, 1, 1, [] wr_dis of LOCK_KM_KEY
|
||||
WR_DIS.KM_DISABLE_DEPLOY_MODE, EFUSE_BLK0, 1, 1, [] wr_dis of KM_DISABLE_DEPLOY_MODE
|
||||
WR_DIS.DIS_USB_JTAG, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_USB_JTAG
|
||||
WR_DIS.DIS_FORCE_DOWNLOAD, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_FORCE_DOWNLOAD
|
||||
WR_DIS.SPI_DOWNLOAD_MSPI_DIS, EFUSE_BLK0, 2, 1, [] wr_dis of SPI_DOWNLOAD_MSPI_DIS
|
||||
WR_DIS.DIS_TWAI, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_TWAI
|
||||
WR_DIS.JTAG_SEL_ENABLE, EFUSE_BLK0, 2, 1, [] wr_dis of JTAG_SEL_ENABLE
|
||||
WR_DIS.DIS_PAD_JTAG, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_PAD_JTAG
|
||||
WR_DIS.DIS_DOWNLOAD_MANUAL_ENCRYPT, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_DOWNLOAD_MANUAL_ENCRYPT
|
||||
WR_DIS.WDT_DELAY_SEL, EFUSE_BLK0, 2, 1, [] wr_dis of WDT_DELAY_SEL
|
||||
WR_DIS.HYS_EN_PAD, EFUSE_BLK0, 2, 1, [] wr_dis of HYS_EN_PAD
|
||||
WR_DIS.PXA0_TIEH_SEL_0, EFUSE_BLK0, 2, 1, [] wr_dis of PXA0_TIEH_SEL_0
|
||||
WR_DIS.PXA0_TIEH_SEL_1, EFUSE_BLK0, 2, 1, [] wr_dis of PXA0_TIEH_SEL_1
|
||||
WR_DIS.PXA0_TIEH_SEL_2, EFUSE_BLK0, 2, 1, [] wr_dis of PXA0_TIEH_SEL_2
|
||||
WR_DIS.PXA0_TIEH_SEL_3, EFUSE_BLK0, 2, 1, [] wr_dis of PXA0_TIEH_SEL_3
|
||||
WR_DIS.DIS_WDT, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_WDT
|
||||
WR_DIS.DIS_SWD, EFUSE_BLK0, 2, 1, [] wr_dis of DIS_SWD
|
||||
WR_DIS.HP_PWR_SRC_SEL, EFUSE_BLK0, 3, 1, [] wr_dis of HP_PWR_SRC_SEL
|
||||
WR_DIS.SPI_BOOT_CRYPT_CNT, EFUSE_BLK0, 4, 1, [] wr_dis of SPI_BOOT_CRYPT_CNT
|
||||
WR_DIS.SECURE_BOOT_KEY_REVOKE0, EFUSE_BLK0, 5, 1, [] wr_dis of SECURE_BOOT_KEY_REVOKE0
|
||||
WR_DIS.SECURE_BOOT_KEY_REVOKE1, EFUSE_BLK0, 6, 1, [] wr_dis of SECURE_BOOT_KEY_REVOKE1
|
||||
@ -23,7 +46,26 @@ WR_DIS.KEY_PURPOSE_2, EFUSE_BLK0, 10, 1, [WR_DIS.K
|
||||
WR_DIS.KEY_PURPOSE_3, EFUSE_BLK0, 11, 1, [WR_DIS.KEY3_PURPOSE] wr_dis of KEY_PURPOSE_3
|
||||
WR_DIS.KEY_PURPOSE_4, EFUSE_BLK0, 12, 1, [WR_DIS.KEY4_PURPOSE] wr_dis of KEY_PURPOSE_4
|
||||
WR_DIS.KEY_PURPOSE_5, EFUSE_BLK0, 13, 1, [WR_DIS.KEY5_PURPOSE] wr_dis of KEY_PURPOSE_5
|
||||
WR_DIS.SEC_DPA_LEVEL, EFUSE_BLK0, 14, 1, [] wr_dis of SEC_DPA_LEVEL
|
||||
WR_DIS.CRYPT_DPA_ENABLE, EFUSE_BLK0, 14, 1, [] wr_dis of CRYPT_DPA_ENABLE
|
||||
WR_DIS.SECURE_BOOT_EN, EFUSE_BLK0, 15, 1, [] wr_dis of SECURE_BOOT_EN
|
||||
WR_DIS.SECURE_BOOT_AGGRESSIVE_REVOKE, EFUSE_BLK0, 16, 1, [] wr_dis of SECURE_BOOT_AGGRESSIVE_REVOKE
|
||||
WR_DIS.ECDSA_ENABLE_SOFT_K, EFUSE_BLK0, 17, 1, [] wr_dis of ECDSA_ENABLE_SOFT_K
|
||||
WR_DIS.FLASH_TYPE, EFUSE_BLK0, 18, 1, [] wr_dis of FLASH_TYPE
|
||||
WR_DIS.FLASH_PAGE_SIZE, EFUSE_BLK0, 18, 1, [] wr_dis of FLASH_PAGE_SIZE
|
||||
WR_DIS.FLASH_ECC_EN, EFUSE_BLK0, 18, 1, [] wr_dis of FLASH_ECC_EN
|
||||
WR_DIS.DIS_USB_OTG_DOWNLOAD_MODE, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_USB_OTG_DOWNLOAD_MODE
|
||||
WR_DIS.FLASH_TPUW, EFUSE_BLK0, 18, 1, [] wr_dis of FLASH_TPUW
|
||||
WR_DIS.DIS_DOWNLOAD_MODE, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_DOWNLOAD_MODE
|
||||
WR_DIS.DIS_DIRECT_BOOT, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_DIRECT_BOOT
|
||||
WR_DIS.DIS_USB_SERIAL_JTAG_ROM_PRINT, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_USB_SERIAL_JTAG_ROM_PRINT
|
||||
WR_DIS.DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE, EFUSE_BLK0, 18, 1, [] wr_dis of DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE
|
||||
WR_DIS.ENABLE_SECURITY_DOWNLOAD, EFUSE_BLK0, 18, 1, [] wr_dis of ENABLE_SECURITY_DOWNLOAD
|
||||
WR_DIS.UART_PRINT_CONTROL, EFUSE_BLK0, 18, 1, [] wr_dis of UART_PRINT_CONTROL
|
||||
WR_DIS.FORCE_SEND_RESUME, EFUSE_BLK0, 18, 1, [] wr_dis of FORCE_SEND_RESUME
|
||||
WR_DIS.SECURE_VERSION, EFUSE_BLK0, 18, 1, [] wr_dis of SECURE_VERSION
|
||||
WR_DIS.SECURE_BOOT_DISABLE_FAST_WAKE, EFUSE_BLK0, 18, 1, [] wr_dis of SECURE_BOOT_DISABLE_FAST_WAKE
|
||||
WR_DIS.KM_HUK_GEN_STATE, EFUSE_BLK0, 19, 1, [] wr_dis of KM_HUK_GEN_STATE
|
||||
WR_DIS.BLK1, EFUSE_BLK0, 20, 1, [] wr_dis of BLOCK1
|
||||
WR_DIS.MAC, EFUSE_BLK0, 20, 1, [WR_DIS.MAC_FACTORY] wr_dis of MAC
|
||||
WR_DIS.WAFER_VERSION_MINOR, EFUSE_BLK0, 20, 1, [] wr_dis of WAFER_VERSION_MINOR
|
||||
@ -32,11 +74,8 @@ WR_DIS.DISABLE_WAFER_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis
|
||||
WR_DIS.DISABLE_BLK_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis of DISABLE_BLK_VERSION_MAJOR
|
||||
WR_DIS.BLK_VERSION_MINOR, EFUSE_BLK0, 20, 1, [] wr_dis of BLK_VERSION_MINOR
|
||||
WR_DIS.BLK_VERSION_MAJOR, EFUSE_BLK0, 20, 1, [] wr_dis of BLK_VERSION_MAJOR
|
||||
WR_DIS.FLASH_CAP, EFUSE_BLK0, 20, 1, [] wr_dis of FLASH_CAP
|
||||
WR_DIS.FLASH_TEMP, EFUSE_BLK0, 20, 1, [] wr_dis of FLASH_TEMP
|
||||
WR_DIS.FLASH_VENDOR, EFUSE_BLK0, 20, 1, [] wr_dis of FLASH_VENDOR
|
||||
WR_DIS.PSRAM_CAP, EFUSE_BLK0, 20, 1, [] wr_dis of PSRAM_CAP
|
||||
WR_DIS.PSRAM_TEMP, EFUSE_BLK0, 20, 1, [] wr_dis of PSRAM_TEMP
|
||||
WR_DIS.TEMP, EFUSE_BLK0, 20, 1, [] wr_dis of TEMP
|
||||
WR_DIS.PSRAM_VENDOR, EFUSE_BLK0, 20, 1, [] wr_dis of PSRAM_VENDOR
|
||||
WR_DIS.PKG_VERSION, EFUSE_BLK0, 20, 1, [] wr_dis of PKG_VERSION
|
||||
WR_DIS.SYS_DATA_PART1, EFUSE_BLK0, 21, 1, [] wr_dis of BLOCK2
|
||||
@ -50,6 +89,10 @@ WR_DIS.BLOCK_KEY3, EFUSE_BLK0, 26, 1, [WR_DIS.K
|
||||
WR_DIS.BLOCK_KEY4, EFUSE_BLK0, 27, 1, [WR_DIS.KEY4] wr_dis of BLOCK_KEY4
|
||||
WR_DIS.BLOCK_KEY5, EFUSE_BLK0, 28, 1, [WR_DIS.KEY5] wr_dis of BLOCK_KEY5
|
||||
WR_DIS.BLOCK_SYS_DATA2, EFUSE_BLK0, 29, 1, [WR_DIS.SYS_DATA_PART2] wr_dis of BLOCK_SYS_DATA2
|
||||
WR_DIS.USB_DEVICE_EXCHG_PINS, EFUSE_BLK0, 30, 1, [] wr_dis of USB_DEVICE_EXCHG_PINS
|
||||
WR_DIS.USB_OTG11_EXCHG_PINS, EFUSE_BLK0, 30, 1, [] wr_dis of USB_OTG11_EXCHG_PINS
|
||||
WR_DIS.USB_PHY_SEL, EFUSE_BLK0, 30, 1, [] wr_dis of USB_PHY_SEL
|
||||
WR_DIS.SOFT_DIS_JTAG, EFUSE_BLK0, 31, 1, [] wr_dis of SOFT_DIS_JTAG
|
||||
RD_DIS, EFUSE_BLK0, 32, 7, [] Disable reading from BlOCK4-10
|
||||
RD_DIS.BLOCK_KEY0, EFUSE_BLK0, 32, 1, [RD_DIS.KEY0] rd_dis of BLOCK_KEY0
|
||||
RD_DIS.BLOCK_KEY1, EFUSE_BLK0, 33, 1, [RD_DIS.KEY1] rd_dis of BLOCK_KEY1
|
||||
@ -130,13 +173,10 @@ DISABLE_WAFER_VERSION_MAJOR, EFUSE_BLK1, 70, 1, [] Disabl
|
||||
DISABLE_BLK_VERSION_MAJOR, EFUSE_BLK1, 71, 1, [] Disables check of blk version major
|
||||
BLK_VERSION_MINOR, EFUSE_BLK1, 72, 3, [] BLK_VERSION_MINOR of BLOCK2
|
||||
BLK_VERSION_MAJOR, EFUSE_BLK1, 75, 2, [] BLK_VERSION_MAJOR of BLOCK2
|
||||
FLASH_CAP, EFUSE_BLK1, 77, 3, [] Flash capacity
|
||||
FLASH_TEMP, EFUSE_BLK1, 80, 2, [] Flash temperature
|
||||
FLASH_VENDOR, EFUSE_BLK1, 82, 3, [] Flash vendor
|
||||
PSRAM_CAP, EFUSE_BLK1, 85, 2, [] PSRAM capacity
|
||||
PSRAM_TEMP, EFUSE_BLK1, 87, 2, [] PSRAM temperature
|
||||
PSRAM_VENDOR, EFUSE_BLK1, 89, 2, [] PSRAM vendor
|
||||
PKG_VERSION, EFUSE_BLK1, 91, 3, [] Package version
|
||||
PSRAM_CAP, EFUSE_BLK1, 77, 3, [] PSRAM capacity
|
||||
TEMP, EFUSE_BLK1, 80, 2, [] Operating temperature of the ESP chip
|
||||
PSRAM_VENDOR, EFUSE_BLK1, 82, 2, [] PSRAM vendor
|
||||
PKG_VERSION, EFUSE_BLK1, 84, 3, [] Package version
|
||||
OPTIONAL_UNIQUE_ID, EFUSE_BLK2, 0, 128, [] Optional unique 128-bit ID
|
||||
USER_DATA, EFUSE_BLK3, 0, 256, [BLOCK_USR_DATA] User data
|
||||
USER_DATA.MAC_CUSTOM, EFUSE_BLK3, 200, 48, [MAC_CUSTOM CUSTOM_MAC] Custom MAC
|
||||
|
Can't render this file because it contains an unexpected character in line 8 and column 53.
|
@ -10,7 +10,7 @@ extern "C" {
|
||||
|
||||
#include "esp_efuse.h"
|
||||
|
||||
// md5_digest_table 2eb36a43d52e9922e08cf545d0e23381
|
||||
// md5_digest_table 0d4e1f49db99de4dd9d3eac8d8e6078b
|
||||
// This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY.
|
||||
// If you want to change some fields, you need to change esp_efuse_table.csv file
|
||||
// then run `efuse_common_table` or `efuse_custom_table` command it will generate this file.
|
||||
@ -19,6 +19,29 @@ extern "C" {
|
||||
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_RD_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_RND_SWITCH_CYCLE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DEPLOY_ONLY_ONCE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_USE_KEY_MANAGER_KEY[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_DISABLE_SW_INIT_KEY[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_XTS_KEY_LENGTH_256[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_LOCK_KM_KEY[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_DISABLE_DEPLOY_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_JTAG[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_FORCE_DOWNLOAD[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_DOWNLOAD_MSPI_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_TWAI[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_JTAG_SEL_ENABLE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_PAD_JTAG[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MANUAL_ENCRYPT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_WDT_DELAY_SEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HYS_EN_PAD[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_0[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_1[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_2[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PXA0_TIEH_SEL_3[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_WDT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_SWD[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_HP_PWR_SRC_SEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SPI_BOOT_CRYPT_CNT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_KEY_REVOKE0[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_KEY_REVOKE1[];
|
||||
@ -35,7 +58,26 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY_PURPOSE_4[];
|
||||
#define ESP_EFUSE_WR_DIS_KEY4_PURPOSE ESP_EFUSE_WR_DIS_KEY_PURPOSE_4
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY_PURPOSE_5[];
|
||||
#define ESP_EFUSE_WR_DIS_KEY5_PURPOSE ESP_EFUSE_WR_DIS_KEY_PURPOSE_5
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SEC_DPA_LEVEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_CRYPT_DPA_ENABLE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_EN[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_AGGRESSIVE_REVOKE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ECDSA_ENABLE_SOFT_K[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TYPE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_PAGE_SIZE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_ECC_EN[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_OTG_DOWNLOAD_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TPUW[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DOWNLOAD_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_DIRECT_BOOT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_SERIAL_JTAG_ROM_PRINT[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_USB_SERIAL_JTAG_DOWNLOAD_MODE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_ENABLE_SECURITY_DOWNLOAD[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_UART_PRINT_CONTROL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FORCE_SEND_RESUME[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SECURE_BOOT_DISABLE_FAST_WAKE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KM_HUK_GEN_STATE[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK1[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_MAC[];
|
||||
#define ESP_EFUSE_WR_DIS_MAC_FACTORY ESP_EFUSE_WR_DIS_MAC
|
||||
@ -45,11 +87,8 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DISABLE_WAFER_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DISABLE_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MINOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_FLASH_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PSRAM_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_PKG_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SYS_DATA_PART1[];
|
||||
@ -73,6 +112,10 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLOCK_KEY5[];
|
||||
#define ESP_EFUSE_WR_DIS_KEY5 ESP_EFUSE_WR_DIS_BLOCK_KEY5
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_BLOCK_SYS_DATA2[];
|
||||
#define ESP_EFUSE_WR_DIS_SYS_DATA_PART2 ESP_EFUSE_WR_DIS_BLOCK_SYS_DATA2
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_DEVICE_EXCHG_PINS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_OTG11_EXCHG_PINS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_PHY_SEL[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SOFT_DIS_JTAG[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_BLOCK_KEY0[];
|
||||
#define ESP_EFUSE_RD_DIS_KEY0 ESP_EFUSE_RD_DIS_BLOCK_KEY0
|
||||
@ -162,11 +205,8 @@ extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_WAFER_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_DISABLE_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MINOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_BLK_VERSION_MAJOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_FLASH_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PSRAM_CAP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PSRAM_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_TEMP[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PSRAM_VENDOR[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_PKG_VERSION[];
|
||||
extern const esp_efuse_desc_t* ESP_EFUSE_OPTIONAL_UNIQUE_ID[];
|
||||
|
@ -46,8 +46,11 @@ static const char *TAG = "i2c.master";
|
||||
#define I2C_FIFO_LEN(port_num) (SOC_I2C_FIFO_LEN)
|
||||
#endif
|
||||
|
||||
#define I2C_CLR_BUS_TIMEOUT_MS (50) // 50ms is sufficient for clearing the bus
|
||||
|
||||
static esp_err_t s_i2c_master_clear_bus(i2c_bus_handle_t handle)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
#if !SOC_I2C_SUPPORT_HW_CLR_BUS
|
||||
const int scl_half_period = 5; // use standard 100kHz data rate
|
||||
int i = 0;
|
||||
@ -74,9 +77,23 @@ static esp_err_t s_i2c_master_clear_bus(i2c_bus_handle_t handle)
|
||||
i2c_common_set_pins(handle);
|
||||
#else
|
||||
i2c_hal_context_t *hal = &handle->hal;
|
||||
i2c_ll_master_clr_bus(hal->dev, I2C_LL_RESET_SLV_SCL_PULSE_NUM_DEFAULT);
|
||||
i2c_ll_master_clr_bus(hal->dev, I2C_LL_RESET_SLV_SCL_PULSE_NUM_DEFAULT, true);
|
||||
// If the i2c master clear bus state machine got disturbed when its work, it would go into error state.
|
||||
// The solution here is to use freertos tick counter to set time threshold. If its not return on time,
|
||||
// return invalid state and turn off the state machine for avoiding its always wrong.
|
||||
TickType_t start_tick = xTaskGetTickCount();
|
||||
const TickType_t timeout_ticks = pdMS_TO_TICKS(I2C_CLR_BUS_TIMEOUT_MS);
|
||||
while (i2c_ll_master_is_bus_clear_done(hal->dev)) {
|
||||
if ((xTaskGetTickCount() - start_tick) > timeout_ticks) {
|
||||
ESP_LOGE(TAG, "clear bus failed.");
|
||||
i2c_ll_master_clr_bus(hal->dev, 0, false);
|
||||
ret = ESP_ERR_INVALID_STATE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
i2c_ll_update(hal->dev);
|
||||
#endif
|
||||
return ESP_OK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -88,6 +105,7 @@ static esp_err_t s_i2c_master_clear_bus(i2c_bus_handle_t handle)
|
||||
*/
|
||||
static esp_err_t s_i2c_hw_fsm_reset(i2c_master_bus_handle_t i2c_master)
|
||||
{
|
||||
esp_err_t ret = ESP_OK;
|
||||
i2c_hal_context_t *hal = &i2c_master->base->hal;
|
||||
#if !SOC_I2C_SUPPORT_HW_FSM_RST
|
||||
i2c_hal_timing_config_t timing_config;
|
||||
@ -97,7 +115,7 @@ static esp_err_t s_i2c_hw_fsm_reset(i2c_master_bus_handle_t i2c_master)
|
||||
i2c_ll_master_get_filter(hal->dev, &filter_cfg);
|
||||
|
||||
//to reset the I2C hw module, we need re-enable the hw
|
||||
s_i2c_master_clear_bus(i2c_master->base);
|
||||
ret = s_i2c_master_clear_bus(i2c_master->base);
|
||||
I2C_RCC_ATOMIC() {
|
||||
i2c_ll_reset_register(i2c_master->base->port_num);
|
||||
}
|
||||
@ -109,9 +127,9 @@ static esp_err_t s_i2c_hw_fsm_reset(i2c_master_bus_handle_t i2c_master)
|
||||
i2c_ll_master_set_filter(hal->dev, filter_cfg);
|
||||
#else
|
||||
i2c_ll_master_fsm_rst(hal->dev);
|
||||
s_i2c_master_clear_bus(i2c_master->base);
|
||||
ret = s_i2c_master_clear_bus(i2c_master->base);
|
||||
#endif
|
||||
return ESP_OK;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void s_i2c_err_log_print(i2c_master_event_t event, bool bypass_nack_log)
|
||||
@ -540,7 +558,7 @@ static esp_err_t s_i2c_transaction_start(i2c_master_dev_handle_t i2c_dev, int xf
|
||||
// Sometimes when the FSM get stuck, the ACK_ERR interrupt will occur endlessly until we reset the FSM and clear bus.
|
||||
esp_err_t ret = ESP_OK;
|
||||
if (i2c_master->status == I2C_STATUS_TIMEOUT || i2c_ll_is_bus_busy(hal->dev)) {
|
||||
s_i2c_hw_fsm_reset(i2c_master);
|
||||
ESP_RETURN_ON_ERROR(s_i2c_hw_fsm_reset(i2c_master), TAG, "reset hardware failed");
|
||||
}
|
||||
|
||||
if (i2c_master->base->pm_lock) {
|
||||
@ -554,23 +572,13 @@ static esp_err_t s_i2c_transaction_start(i2c_master_dev_handle_t i2c_dev, int xf
|
||||
i2c_master->rx_cnt = 0;
|
||||
i2c_master->read_len_static = 0;
|
||||
|
||||
i2c_hal_master_set_scl_timeout_val(hal, i2c_dev->scl_wait_us, i2c_master->base->clk_src_freq_hz);
|
||||
|
||||
if (!i2c_master->base->is_lp_i2c) {
|
||||
I2C_CLOCK_SRC_ATOMIC() {
|
||||
i2c_ll_set_source_clk(hal->dev, i2c_master->base->clk_src);
|
||||
}
|
||||
}
|
||||
#if SOC_LP_I2C_SUPPORTED
|
||||
else {
|
||||
LP_I2C_SRC_CLK_ATOMIC() {
|
||||
lp_i2c_ll_set_source_clk(hal->dev, i2c_master->base->clk_src);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
I2C_CLOCK_SRC_ATOMIC() {
|
||||
i2c_hal_set_bus_timing(hal, i2c_dev->scl_speed_hz, i2c_master->base->clk_src, i2c_master->base->clk_src_freq_hz);
|
||||
}
|
||||
|
||||
// Set the timeout value
|
||||
i2c_hal_master_set_scl_timeout_val(hal, i2c_dev->scl_wait_us, i2c_master->base->clk_src_freq_hz);
|
||||
|
||||
i2c_ll_master_set_fractional_divider(hal->dev, 0, 0);
|
||||
i2c_ll_update(hal->dev);
|
||||
|
||||
@ -909,6 +917,19 @@ esp_err_t i2c_new_master_bus(const i2c_master_bus_config_t *bus_config, i2c_mast
|
||||
}
|
||||
ESP_GOTO_ON_ERROR(i2c_param_master_config(i2c_master->base, bus_config), err, TAG, "i2c configure parameter failed");
|
||||
|
||||
if (!i2c_master->base->is_lp_i2c) {
|
||||
I2C_CLOCK_SRC_ATOMIC() {
|
||||
i2c_ll_set_source_clk(hal->dev, i2c_master->base->clk_src);
|
||||
}
|
||||
}
|
||||
#if SOC_LP_I2C_SUPPORTED
|
||||
else {
|
||||
LP_I2C_SRC_CLK_ATOMIC() {
|
||||
lp_i2c_ll_set_source_clk(hal->dev, i2c_master->base->clk_src);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
i2c_master->bus_lock_mux = xSemaphoreCreateBinaryWithCaps(I2C_MEM_ALLOC_CAPS);
|
||||
ESP_GOTO_ON_FALSE(i2c_master->bus_lock_mux, ESP_ERR_NO_MEM, err, TAG, "No memory for binary semaphore");
|
||||
xSemaphoreGive(i2c_master->bus_lock_mux);
|
||||
|
@ -32,6 +32,7 @@ typedef struct {
|
||||
Note that, the valid signal will always occupy the MSB data bit */
|
||||
size_t trans_queue_depth; /*!< Depth of internal transaction queue */
|
||||
size_t max_transfer_size; /*!< Maximum transfer size in one transaction, in bytes. This decides the number of DMA nodes will be used for each transaction */
|
||||
size_t dma_burst_size; /*!< DMA burst size, in bytes */
|
||||
parlio_sample_edge_t sample_edge; /*!< Parallel IO sample edge */
|
||||
parlio_bit_pack_order_t bit_pack_order; /*!< Set the order of packing the bits into bytes (only works when `data_width` < 8) */
|
||||
struct {
|
||||
|
@ -52,6 +52,8 @@ typedef struct parlio_tx_unit_t {
|
||||
gdma_channel_handle_t dma_chan; // DMA channel
|
||||
gdma_link_list_handle_t dma_link; // DMA link list handle
|
||||
size_t dma_nodes_num; // number of DMA descriptor nodes
|
||||
size_t int_mem_align; // Alignment for internal memory
|
||||
size_t ext_mem_align; // Alignment for external memory
|
||||
#if CONFIG_PM_ENABLE
|
||||
char pm_lock_name[PARLIO_PM_LOCK_NAME_LEN_MAX]; // pm lock name
|
||||
#endif
|
||||
@ -178,7 +180,7 @@ static esp_err_t parlio_tx_unit_configure_gpio(parlio_tx_unit_t *tx_unit, const
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t parlio_tx_unit_init_dma(parlio_tx_unit_t *tx_unit)
|
||||
static esp_err_t parlio_tx_unit_init_dma(parlio_tx_unit_t *tx_unit, const parlio_tx_unit_config_t *config)
|
||||
{
|
||||
gdma_channel_alloc_config_t dma_chan_config = {
|
||||
.direction = GDMA_CHANNEL_DIRECTION_TX,
|
||||
@ -191,6 +193,14 @@ static esp_err_t parlio_tx_unit_init_dma(parlio_tx_unit_t *tx_unit)
|
||||
};
|
||||
gdma_apply_strategy(tx_unit->dma_chan, &gdma_strategy_conf);
|
||||
|
||||
// configure DMA transfer parameters
|
||||
gdma_transfer_config_t trans_cfg = {
|
||||
.max_data_burst_size = config->dma_burst_size ? config->dma_burst_size : 16, // Enable DMA burst transfer for better performance,
|
||||
.access_ext_mem = true, // support transmit PSRAM buffer
|
||||
};
|
||||
ESP_RETURN_ON_ERROR(gdma_config_transfer(tx_unit->dma_chan, &trans_cfg), TAG, "config DMA transfer failed");
|
||||
gdma_get_alignment_constraints(tx_unit->dma_chan, &tx_unit->int_mem_align, &tx_unit->ext_mem_align);
|
||||
|
||||
// create DMA link list
|
||||
size_t dma_nodes_num = tx_unit->dma_nodes_num;
|
||||
gdma_link_list_config_t dma_link_config = {
|
||||
@ -244,6 +254,8 @@ static esp_err_t parlio_select_periph_clock(parlio_tx_unit_t *tx_unit, const par
|
||||
tx_unit->out_clk_freq_hz = hal_utils_calc_clk_div_integer(&clk_info, &clk_div.integer);
|
||||
#endif
|
||||
PARLIO_CLOCK_SRC_ATOMIC() {
|
||||
// turn on the tx module clock to sync the register configuration to the module
|
||||
parlio_ll_tx_enable_clock(hal->regs, true);
|
||||
parlio_ll_tx_set_clock_source(hal->regs, clk_src);
|
||||
// set clock division
|
||||
parlio_ll_tx_set_clock_div(hal->regs, &clk_div);
|
||||
@ -312,7 +324,7 @@ esp_err_t parlio_new_tx_unit(const parlio_tx_unit_config_t *config, parlio_tx_un
|
||||
ESP_GOTO_ON_ERROR(ret, err, TAG, "install interrupt failed");
|
||||
|
||||
// install DMA service
|
||||
ESP_GOTO_ON_ERROR(parlio_tx_unit_init_dma(unit), err, TAG, "install tx DMA failed");
|
||||
ESP_GOTO_ON_ERROR(parlio_tx_unit_init_dma(unit, config), err, TAG, "install tx DMA failed");
|
||||
|
||||
// reset fifo and core clock domain
|
||||
PARLIO_RCC_ATOMIC() {
|
||||
@ -343,8 +355,8 @@ esp_err_t parlio_new_tx_unit(const parlio_tx_unit_config_t *config, parlio_tx_un
|
||||
parlio_ll_tx_set_sample_clock_edge(hal->regs, config->sample_edge);
|
||||
|
||||
#if SOC_PARLIO_TX_SIZE_BY_DMA
|
||||
// Always use DMA EOF as the Parlio TX EOF
|
||||
parlio_ll_tx_set_eof_condition(hal->regs, PARLIO_LL_TX_EOF_COND_DMA_EOF);
|
||||
// Always use DATA LEN EOF as the Parlio TX EOF
|
||||
parlio_ll_tx_set_eof_condition(hal->regs, PARLIO_LL_TX_EOF_COND_DATA_LEN);
|
||||
#endif // SOC_PARLIO_TX_SIZE_BY_DMA
|
||||
|
||||
// clear any pending interrupt
|
||||
@ -527,6 +539,21 @@ esp_err_t parlio_tx_unit_transmit(parlio_tx_unit_handle_t tx_unit, const void *p
|
||||
ESP_RETURN_ON_FALSE((payload_bits % 8) == 0, ESP_ERR_INVALID_ARG, TAG, "payload bit length must be multiple of 8");
|
||||
#endif // !SOC_PARLIO_TRANS_BIT_ALIGN
|
||||
|
||||
size_t cache_line_size = 0;
|
||||
size_t alignment = 0;
|
||||
uint8_t cache_type = 0;
|
||||
esp_ptr_external_ram(payload) ? (alignment = tx_unit->ext_mem_align, cache_type = CACHE_LL_LEVEL_EXT_MEM) : (alignment = tx_unit->int_mem_align, cache_type = CACHE_LL_LEVEL_INT_MEM);
|
||||
// check alignment
|
||||
ESP_RETURN_ON_FALSE(((uint32_t)payload & (alignment - 1)) == 0, ESP_ERR_INVALID_ARG, TAG, "payload address not aligned");
|
||||
ESP_RETURN_ON_FALSE((payload_bits & (alignment - 1)) == 0, ESP_ERR_INVALID_ARG, TAG, "payload size not aligned");
|
||||
cache_line_size = cache_hal_get_cache_line_size(cache_type, CACHE_TYPE_DATA);
|
||||
|
||||
if (cache_line_size > 0) {
|
||||
// Write back to cache to synchronize the cache before DMA start
|
||||
ESP_RETURN_ON_ERROR(esp_cache_msync((void *)payload, (payload_bits + 7) / 8,
|
||||
ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED), TAG, "cache sync failed");
|
||||
}
|
||||
|
||||
TickType_t queue_wait_ticks = portMAX_DELAY;
|
||||
if (config->flags.queue_nonblocking) {
|
||||
queue_wait_ticks = 0;
|
||||
@ -545,11 +572,6 @@ esp_err_t parlio_tx_unit_transmit(parlio_tx_unit_handle_t tx_unit, const void *p
|
||||
t->payload = payload;
|
||||
t->payload_bits = payload_bits;
|
||||
t->idle_value = config->idle_value & tx_unit->idle_value_mask;
|
||||
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
// Write back to cache to synchronize the cache before DMA start
|
||||
ESP_RETURN_ON_ERROR(esp_cache_msync((void *)payload, (payload_bits + 7) / 8,
|
||||
ESP_CACHE_MSYNC_FLAG_DIR_C2M | ESP_CACHE_MSYNC_FLAG_UNALIGNED), TAG, "cache sync failed");
|
||||
#endif // SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
|
||||
|
||||
// send the transaction descriptor to progress queue
|
||||
ESP_RETURN_ON_FALSE(xQueueSend(tx_unit->trans_queues[PARLIO_TX_QUEUE_PROGRESS], &t, 0) == pdTRUE,
|
||||
|
@ -62,13 +62,11 @@ menu "Ethernet"
|
||||
bool "Output RMII clock from GPIO0 (Experimental!)"
|
||||
default n
|
||||
help
|
||||
GPIO0 can be set to output a pre-divided PLL clock (test only!).
|
||||
Enabling this option will configure GPIO0 to output a 50MHz clock.
|
||||
In fact this clock doesn't have directly relationship with EMAC peripheral.
|
||||
Sometimes this clock won't work well with your PHY chip. You might need to
|
||||
add some extra devices after GPIO0 (e.g. inverter).
|
||||
Note that outputting RMII clock on GPIO0 is an experimental practice.
|
||||
If you want the Ethernet to work with WiFi, don't select GPIO0 output mode for stability.
|
||||
GPIO0 can be set to output a pre-divided PLL clock. Enabling this option will configure
|
||||
GPIO0 to output a 50MHz clock. In fact this clock doesn't have directly relationship with
|
||||
EMAC peripheral. Sometimes this clock may not work well with your PHY chip.
|
||||
WARNING: If you want the Ethernet to work with WiFi, don’t select ESP32 as RMII CLK output
|
||||
as it would result in clock instability!
|
||||
|
||||
if !ETH_RMII_CLK_OUTPUT_GPIO0
|
||||
config ETH_RMII_CLK_OUT_GPIO
|
||||
@ -78,6 +76,8 @@ menu "Ethernet"
|
||||
default 17
|
||||
help
|
||||
Set the GPIO number to output RMII Clock.
|
||||
WARNING: If you want the Ethernet to work with WiFi, don’t select ESP32 as RMII CLK output
|
||||
as it would result in clock instability!
|
||||
endif # !ETH_RMII_CLK_OUTPUT_GPIO0
|
||||
endif # ETH_RMII_CLK_OUTPUT
|
||||
|
||||
|
@ -51,6 +51,8 @@ typedef enum {
|
||||
/**
|
||||
* @brief RMII Clock GPIO number Options for ESP32
|
||||
*
|
||||
* @warning If you want the Ethernet to work with WiFi, don’t select ESP32 as RMII CLK output as it would result in clock instability.
|
||||
*
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
@ -64,10 +66,8 @@ typedef enum {
|
||||
/**
|
||||
* @brief Output RMII Clock from internal APLL Clock available at GPIO0
|
||||
*
|
||||
* @note GPIO0 can be set to output a pre-divided PLL clock (test only!). Enabling this option will configure GPIO0 to output a 50MHz clock.
|
||||
* In fact this clock doesn’t have directly relationship with EMAC peripheral. Sometimes this clock won’t work well with your PHY chip.
|
||||
* You might need to add some extra devices after GPIO0 (e.g. inverter). Note that outputting RMII clock on GPIO0 is an experimental practice.
|
||||
* If you want the Ethernet to work with WiFi, don’t select GPIO0 output mode for stability.
|
||||
* @note GPIO0 can be set to output a pre-divided PLL clock. Enabling this option will configure GPIO0 to output a 50MHz clock.
|
||||
* In fact this clock doesn’t have directly relationship with EMAC peripheral. Sometimes this clock may not work well with your PHY chip.
|
||||
*
|
||||
*/
|
||||
EMAC_APPL_CLK_OUT_GPIO = 0,
|
||||
|
@ -236,6 +236,21 @@ esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, es
|
||||
int esp_https_ota_get_image_len_read(esp_https_ota_handle_t https_ota_handle);
|
||||
|
||||
|
||||
/**
|
||||
* @brief This function returns the HTTP status code of the last HTTP response.
|
||||
*
|
||||
* @note This API should be called only after esp_https_ota_begin() has been called.
|
||||
* This can be used to check the HTTP status code of the OTA download process.
|
||||
*
|
||||
* @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure
|
||||
*
|
||||
* @return
|
||||
* - -1 On failure
|
||||
* - HTTP status code
|
||||
*/
|
||||
int esp_https_ota_get_status_code(esp_https_ota_handle_t https_ota_handle);
|
||||
|
||||
|
||||
/**
|
||||
* @brief This function returns OTA image total size.
|
||||
*
|
||||
|
@ -718,6 +718,15 @@ esp_err_t esp_https_ota_abort(esp_https_ota_handle_t https_ota_handle)
|
||||
return err;
|
||||
}
|
||||
|
||||
int esp_https_ota_get_status_code(esp_https_ota_handle_t https_ota_handle)
|
||||
{
|
||||
esp_https_ota_t *handle = (esp_https_ota_t *) https_ota_handle;
|
||||
if (handle == NULL || handle->http_client == NULL) {
|
||||
return -1;
|
||||
}
|
||||
return esp_http_client_get_status_code(handle->http_client);
|
||||
}
|
||||
|
||||
int esp_https_ota_get_image_len_read(esp_https_ota_handle_t https_ota_handle)
|
||||
{
|
||||
esp_https_ota_t *handle = (esp_https_ota_t *)https_ota_handle;
|
||||
|
@ -16,6 +16,10 @@ if(${target} STREQUAL "esp32c6")
|
||||
list(APPEND priv_requires hal)
|
||||
endif()
|
||||
|
||||
if(CONFIG_RTC_CLK_SRC_INT_RC32K)
|
||||
message(WARNING "Internal RC32K clock is unstable at extreme temperatures and is not recommended for use.")
|
||||
endif()
|
||||
|
||||
set(srcs "cpu.c" "port/${IDF_TARGET}/esp_cpu_intr.c" "esp_memory_utils.c" "port/${IDF_TARGET}/cpu_region_protect.c")
|
||||
if(NOT BOOTLOADER_BUILD)
|
||||
list(APPEND srcs "esp_clk.c"
|
||||
|
@ -25,10 +25,10 @@ extern "C" {
|
||||
* @note This macro will increase the reference lock of that peripheral.
|
||||
* You can get the value before the increment from the `rc_name` local variable
|
||||
*/
|
||||
#define PERIPH_RCC_ACQUIRE_ATOMIC(periph, rc_name) \
|
||||
for (uint8_t rc_name, i = 1, __DECLARE_RCC_RC_ATOMIC_ENV; \
|
||||
i ? (rc_name = periph_rcc_acquire_enter(periph), 1) : 0; \
|
||||
periph_rcc_acquire_exit(periph, rc_name), i--)
|
||||
#define PERIPH_RCC_ACQUIRE_ATOMIC(rc_periph, rc_name) \
|
||||
for (uint8_t rc_name, _rc_cnt = 1, __DECLARE_RCC_RC_ATOMIC_ENV; \
|
||||
_rc_cnt ? (rc_name = periph_rcc_acquire_enter(rc_periph), 1) : 0; \
|
||||
periph_rcc_acquire_exit(rc_periph, rc_name), _rc_cnt--)
|
||||
|
||||
/**
|
||||
* @brief Release the RCC lock for a peripheral module
|
||||
@ -37,10 +37,10 @@ extern "C" {
|
||||
* @note This macro will decrease the reference lock of that peripheral.
|
||||
* You can get the value after the decrease from the `rc_name` local variable
|
||||
*/
|
||||
#define PERIPH_RCC_RELEASE_ATOMIC(periph, rc_name) \
|
||||
for (uint8_t rc_name, i = 1, __DECLARE_RCC_RC_ATOMIC_ENV; \
|
||||
i ? (rc_name = periph_rcc_release_enter(periph), 1) : 0; \
|
||||
periph_rcc_release_exit(periph, rc_name), i--)
|
||||
#define PERIPH_RCC_RELEASE_ATOMIC(rc_periph, rc_name) \
|
||||
for (uint8_t rc_name, _rc_cnt = 1, __DECLARE_RCC_RC_ATOMIC_ENV; \
|
||||
_rc_cnt ? (rc_name = periph_rcc_release_enter(rc_periph), 1) : 0; \
|
||||
periph_rcc_release_exit(rc_periph, rc_name), _rc_cnt--)
|
||||
|
||||
/**
|
||||
* @brief A simplified version of `PERIPH_RCC_ACQUIRE/RELEASE_ATOMIC`, without a reference count
|
||||
@ -48,9 +48,9 @@ extern "C" {
|
||||
* @note User code protected by this macro should be as short as possible, because it's a critical section
|
||||
*/
|
||||
#define PERIPH_RCC_ATOMIC() \
|
||||
for (int i = 1, __DECLARE_RCC_ATOMIC_ENV; \
|
||||
i ? (periph_rcc_enter(), 1) : 0; \
|
||||
periph_rcc_exit(), i--)
|
||||
for (int _rc_cnt = 1, __DECLARE_RCC_ATOMIC_ENV; \
|
||||
_rc_cnt ? (periph_rcc_enter(), 1) : 0; \
|
||||
periph_rcc_exit(), _rc_cnt--)
|
||||
|
||||
/** @cond */
|
||||
// The following functions are not intended to be used directly by the developers
|
||||
|
@ -69,13 +69,15 @@ static inline void __attribute__((always_inline)) spinlock_initialize(spinlock_t
|
||||
* function reenables interrupts once the spinlock is acquired). For critical
|
||||
* sections, use the interface provided by the operating system.
|
||||
* @param lock - target spinlock object
|
||||
* @param timeout - cycles to wait, passing SPINLOCK_WAIT_FOREVER blocs indefinitely
|
||||
* @param timeout - cycles to wait, passing SPINLOCK_WAIT_FOREVER blocks indefinitely
|
||||
*/
|
||||
static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *lock, int32_t timeout)
|
||||
{
|
||||
#if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE && !BOOTLOADER_BUILD
|
||||
uint32_t irq_status;
|
||||
uint32_t core_owner_id, other_core_owner_id;
|
||||
uint32_t core_owner_id;
|
||||
// Unused if asserts are disabled
|
||||
uint32_t __attribute__((unused)) other_core_owner_id;
|
||||
bool lock_set;
|
||||
esp_cpu_cycle_count_t start_count;
|
||||
|
||||
@ -132,7 +134,7 @@ static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *l
|
||||
break;
|
||||
}
|
||||
// Keep looping if we are waiting forever, or check if we have timed out
|
||||
} while ((timeout == SPINLOCK_WAIT_FOREVER) || (esp_cpu_get_cycle_count() - start_count) <= timeout);
|
||||
} while ((timeout == SPINLOCK_WAIT_FOREVER) || (esp_cpu_get_cycle_count() - start_count) <= (esp_cpu_cycle_count_t)timeout);
|
||||
|
||||
exit:
|
||||
if (lock_set) {
|
||||
@ -173,7 +175,8 @@ static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *l
|
||||
{
|
||||
#if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE && !BOOTLOADER_BUILD
|
||||
uint32_t irq_status;
|
||||
uint32_t core_owner_id;
|
||||
// Return value unused if asserts are disabled
|
||||
uint32_t __attribute__((unused)) core_owner_id;
|
||||
|
||||
assert(lock);
|
||||
#if __XTENSA__
|
||||
|
@ -13,12 +13,15 @@ choice ESP32C2_REV_MIN
|
||||
bool "Rev v1.0 (ECO1)"
|
||||
config ESP32C2_REV_MIN_1_1
|
||||
bool "Rev v1.1 (ECO2)"
|
||||
config ESP32C2_REV_MIN_200
|
||||
bool "Rev v2.0 (ECO4)"
|
||||
endchoice
|
||||
|
||||
config ESP32C2_REV_MIN_FULL
|
||||
int
|
||||
default 100 if ESP32C2_REV_MIN_1
|
||||
default 101 if ESP32C2_REV_MIN_1_1
|
||||
default 200 if ESP32C2_REV_MIN_200
|
||||
|
||||
config ESP_REV_MIN_FULL
|
||||
int
|
||||
|
@ -14,6 +14,9 @@ choice RTC_CLK_SRC
|
||||
select ESP_SYSTEM_RTC_EXT_OSC
|
||||
config RTC_CLK_SRC_INT_RC32K
|
||||
bool "Internal 32kHz RC oscillator"
|
||||
help
|
||||
Internal RC32K clock is unstable at extreme temperatures and is not recommended for use.
|
||||
This option will be removed in IDF v6.0.
|
||||
endchoice
|
||||
|
||||
config RTC_CLK_CAL_CYCLES
|
||||
|
@ -14,6 +14,9 @@ choice RTC_CLK_SRC
|
||||
select ESP_SYSTEM_RTC_EXT_OSC
|
||||
config RTC_CLK_SRC_INT_RC32K
|
||||
bool "Internal 32kHz RC oscillator"
|
||||
help
|
||||
Internal RC32K clock is unstable at extreme temperatures and is not recommended for use.
|
||||
This option will be removed in IDF v6.0.
|
||||
endchoice
|
||||
|
||||
config RTC_CLK_CAL_CYCLES
|
||||
|
@ -11,6 +11,9 @@ choice RTC_CLK_SRC
|
||||
select ESP_SYSTEM_RTC_EXT_XTAL
|
||||
config RTC_CLK_SRC_INT_RC32K
|
||||
bool "Internal 32kHz RC oscillator"
|
||||
help
|
||||
Internal RC32K clock is unstable at extreme temperatures and is not recommended for use.
|
||||
This option will be removed in IDF v6.0.
|
||||
endchoice
|
||||
|
||||
config RTC_CLK_CAL_CYCLES
|
||||
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -506,6 +506,13 @@ static BaseType_t prvCheckItemAvail(Ringbuffer_t *pxRingbuffer)
|
||||
return pdFALSE; //Byte buffers do not allow multiple retrievals before return
|
||||
}
|
||||
if ((pxRingbuffer->xItemsWaiting > 0) && ((pxRingbuffer->pucRead != pxRingbuffer->pucWrite) || (pxRingbuffer->uxRingbufferFlags & rbBUFFER_FULL_FLAG))) {
|
||||
// If the ring buffer is a no-split buffer, the read pointer must point to an item that has been written to.
|
||||
if ((pxRingbuffer->uxRingbufferFlags & (rbBYTE_BUFFER_FLAG | rbALLOW_SPLIT_FLAG)) == 0) {
|
||||
ItemHeader_t *pxHeader = (ItemHeader_t *)pxRingbuffer->pucRead;
|
||||
if ((pxHeader->uxItemFlags & rbITEM_WRITTEN_FLAG) == 0) {
|
||||
return pdFALSE;
|
||||
}
|
||||
}
|
||||
return pdTRUE; //Items/data available for retrieval
|
||||
} else {
|
||||
return pdFALSE; //No items/data available for retrieval
|
||||
@ -989,9 +996,6 @@ BaseType_t xRingbufferSendAcquire(RingbufHandle_t xRingbuffer, void **ppvItem, s
|
||||
if (xItemSize > pxRingbuffer->xMaxItemSize) {
|
||||
return pdFALSE; //Data will never ever fit in the queue.
|
||||
}
|
||||
if ((pxRingbuffer->uxRingbufferFlags & rbBYTE_BUFFER_FLAG) && xItemSize == 0) {
|
||||
return pdTRUE; //Sending 0 bytes to byte buffer has no effect
|
||||
}
|
||||
|
||||
return prvSendAcquireGeneric(pxRingbuffer, NULL, ppvItem, xItemSize, xTicksToWait);
|
||||
}
|
||||
@ -1384,6 +1388,11 @@ RingbufHandle_t xRingbufferCreateWithCaps(size_t xBufferSize, RingbufferType_t x
|
||||
StaticRingbuffer_t *pxStaticRingbuffer;
|
||||
uint8_t *pucRingbufferStorage;
|
||||
|
||||
//Allocate memory
|
||||
if (xBufferType != RINGBUF_TYPE_BYTEBUF) {
|
||||
xBufferSize = rbALIGN_SIZE(xBufferSize); //xBufferSize is rounded up for no-split/allow-split buffers
|
||||
}
|
||||
|
||||
pxStaticRingbuffer = heap_caps_malloc(sizeof(StaticRingbuffer_t), (uint32_t)uxMemoryCaps);
|
||||
pucRingbufferStorage = heap_caps_malloc(xBufferSize, (uint32_t)uxMemoryCaps);
|
||||
|
||||
|
@ -806,6 +806,7 @@ TEST_CASE("Test ring buffer ISR", "[esp_ringbuf][qemu-ignore]")
|
||||
* Every permutation of core pinning of the sending and receiving task will be
|
||||
* tested.
|
||||
*/
|
||||
#if !CONFIG_FREERTOS_UNICORE
|
||||
|
||||
#define SRAND_SEED 3 //Arbitrarily chosen srand() seed
|
||||
#define SMP_TEST_ITERATIONS 4
|
||||
@ -1021,6 +1022,7 @@ TEST_CASE("Test static ring buffer SMP", "[esp_ringbuf]")
|
||||
cleanup();
|
||||
}
|
||||
#endif
|
||||
#endif //!CONFIG_FREERTOS_UNICORE
|
||||
|
||||
#if !CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH && !CONFIG_RINGBUF_PLACE_ISR_FUNCTIONS_INTO_FLASH
|
||||
/* -------------------------- Test ring buffer IRAM ------------------------- */
|
||||
@ -1030,7 +1032,7 @@ static IRAM_ATTR __attribute__((noinline)) bool iram_ringbuf_test(void)
|
||||
bool result = true;
|
||||
uint8_t item[4];
|
||||
size_t item_size;
|
||||
RingbufHandle_t handle = xRingbufferCreate(CONT_DATA_TEST_BUFF_LEN, RINGBUF_TYPE_NOSPLIT);
|
||||
RingbufHandle_t handle = xRingbufferCreate(BUFFER_SIZE, RINGBUF_TYPE_NOSPLIT);
|
||||
result = result && (handle != NULL);
|
||||
spi_flash_guard_get()->start(); // Disables flash cache
|
||||
|
||||
@ -1123,3 +1125,80 @@ TEST_CASE("Test ringbuffer with caps", "[esp_ringbuf]")
|
||||
// Free the ring buffer
|
||||
vRingbufferDeleteWithCaps(rb_handle);
|
||||
}
|
||||
|
||||
/* ---------------------------- Test no-split ring buffer SendAquire and SendComplete ---------------------------
|
||||
* The following test case tests the SendAquire and SendComplete functions of the no-split ring buffer.
|
||||
*
|
||||
* The test case will do the following...
|
||||
* 1) Create a no-split ring buffer.
|
||||
* 2) Acquire space on the buffer to send an item.
|
||||
* 3) Send the item to the buffer.
|
||||
* 4) Verify that the item is received correctly.
|
||||
* 5) Acquire space on the buffer until the buffer is full.
|
||||
* 6) Send the items out-of-order to the buffer.
|
||||
* 7) Verify that the items are not received until the first item is sent.
|
||||
* 8) Send the first item.
|
||||
* 9) Verify that the items are received in the correct order.
|
||||
*/
|
||||
TEST_CASE("Test no-split buffers always receive items in order", "[esp_ringbuf]")
|
||||
{
|
||||
// Create buffer
|
||||
RingbufHandle_t buffer_handle = xRingbufferCreate(BUFFER_SIZE, RINGBUF_TYPE_NOSPLIT);
|
||||
TEST_ASSERT_MESSAGE(buffer_handle != NULL, "Failed to create ring buffer");
|
||||
|
||||
// Acquire space on the buffer to send an item and write to the item
|
||||
void *item1;
|
||||
TEST_ASSERT_EQUAL(pdTRUE, xRingbufferSendAcquire(buffer_handle, &item1, MEDIUM_ITEM_SIZE, TIMEOUT_TICKS));
|
||||
*(uint32_t *)item1 = 0x123;
|
||||
|
||||
// Send the item to the buffer
|
||||
TEST_ASSERT_EQUAL(pdTRUE, xRingbufferSendComplete(buffer_handle, item1));
|
||||
|
||||
// Verify that the item is received correctly
|
||||
size_t item_size;
|
||||
uint32_t *received_item = xRingbufferReceive(buffer_handle, &item_size, TIMEOUT_TICKS);
|
||||
TEST_ASSERT_NOT_NULL(received_item);
|
||||
TEST_ASSERT_EQUAL(item_size, MEDIUM_ITEM_SIZE);
|
||||
TEST_ASSERT_EQUAL(*(uint32_t *)received_item, 0x123);
|
||||
|
||||
// Return the space to the buffer after receiving the item
|
||||
vRingbufferReturnItem(buffer_handle, received_item);
|
||||
|
||||
// At this point, the buffer should be empty
|
||||
UBaseType_t items_waiting;
|
||||
vRingbufferGetInfo(buffer_handle, NULL, NULL, NULL, NULL, &items_waiting);
|
||||
TEST_ASSERT_MESSAGE(items_waiting == 0, "Incorrect items waiting");
|
||||
|
||||
// Acquire space on the buffer until the buffer is full
|
||||
#define MAX_NUM_ITEMS ( BUFFER_SIZE / ( MEDIUM_ITEM_SIZE + ITEM_HDR_SIZE ) )
|
||||
void *items[MAX_NUM_ITEMS];
|
||||
for (int i = 0; i < MAX_NUM_ITEMS; i++) {
|
||||
TEST_ASSERT_EQUAL(pdTRUE, xRingbufferSendAcquire(buffer_handle, &items[i], MEDIUM_ITEM_SIZE, TIMEOUT_TICKS));
|
||||
TEST_ASSERT_NOT_NULL(items[i]);
|
||||
*(uint32_t *)items[i] = (0x100 + i);
|
||||
}
|
||||
|
||||
// Verify that the buffer is full by attempting to acquire space for another item
|
||||
void *another_item;
|
||||
TEST_ASSERT_EQUAL(pdFALSE, xRingbufferSendAcquire(buffer_handle, &another_item, MEDIUM_ITEM_SIZE, TIMEOUT_TICKS));
|
||||
|
||||
// Send the items out-of-order to the buffer. Verify that the items are not received until the first item is sent.
|
||||
// In this case, we send the items in the reverse order until the first item is sent.
|
||||
for (int i = MAX_NUM_ITEMS - 1; i > 0; i--) {
|
||||
TEST_ASSERT_EQUAL(pdTRUE, xRingbufferSendComplete(buffer_handle, items[i]));
|
||||
TEST_ASSERT_NULL(xRingbufferReceive(buffer_handle, &item_size, 0));
|
||||
}
|
||||
|
||||
// Send the first item
|
||||
TEST_ASSERT_EQUAL(pdTRUE, xRingbufferSendComplete(buffer_handle, items[0]));
|
||||
|
||||
// Verify that the items are received in the correct order
|
||||
for (int i = 0; i < MAX_NUM_ITEMS; i++) {
|
||||
received_item = xRingbufferReceive(buffer_handle, &item_size, TIMEOUT_TICKS);
|
||||
TEST_ASSERT_EQUAL(*(uint32_t *)received_item, (0x100 + i));
|
||||
vRingbufferReturnItem(buffer_handle, received_item);
|
||||
}
|
||||
|
||||
// Cleanup
|
||||
vRingbufferDelete(buffer_handle);
|
||||
}
|
||||
|
@ -180,6 +180,11 @@ else() # Regular app build
|
||||
# For ESP32S2, inclusion of ROM driver do not depend on CONFIG_SPI_FLASH_ROM_IMPL
|
||||
rom_linker_script("spiflash_legacy")
|
||||
|
||||
elseif(target STREQUAL "esp32c2")
|
||||
if(CONFIG_ESP32C2_REV_MIN_FULL GREATER_EQUAL 200)
|
||||
rom_linker_script("eco4")
|
||||
endif()
|
||||
|
||||
elseif(target STREQUAL "esp32c3")
|
||||
|
||||
if(CONFIG_ESP32C3_REV_MIN_FULL GREATER_EQUAL 3)
|
||||
@ -241,6 +246,10 @@ else() # Regular app build
|
||||
|
||||
if(CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL)
|
||||
rom_linker_script("mbedtls")
|
||||
# For ESP32C2(ECO4), mbedTLS in ROM has been updated to v3.6.0-LTS
|
||||
if(CONFIG_ESP32C2_REV_MIN_FULL GREATER_EQUAL 200)
|
||||
rom_linker_script("mbedtls.eco4")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
|
||||
|
1433
components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld
Normal file
1433
components/esp_rom/esp32c2/ld/esp32c2.rom.eco4.ld
Normal file
File diff suppressed because it is too large
Load Diff
221
components/esp_rom/esp32c2/ld/esp32c2.rom.mbedtls.eco4.ld
Normal file
221
components/esp_rom/esp32c2/ld/esp32c2.rom.mbedtls.eco4.ld
Normal file
@ -0,0 +1,221 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/***************************************
|
||||
Group eco4_rom_mbedtls
|
||||
***************************************/
|
||||
|
||||
/* Functions */
|
||||
mbedtls_mpi_init = 0x400026dc;
|
||||
mbedtls_mpi_free = 0x400026e0;
|
||||
mbedtls_mpi_grow = 0x400026e4;
|
||||
mbedtls_mpi_shrink = 0x400026e8;
|
||||
mbedtls_mpi_copy = 0x400026ec;
|
||||
mbedtls_mpi_safe_cond_assign = 0x400026f0;
|
||||
mbedtls_mpi_safe_cond_swap = 0x400026f4;
|
||||
mbedtls_mpi_lset = 0x400026f8;
|
||||
mbedtls_mpi_get_bit = 0x400026fc;
|
||||
mbedtls_mpi_set_bit = 0x40002700;
|
||||
mbedtls_mpi_lsb = 0x40002704;
|
||||
mbedtls_mpi_bitlen = 0x40002708;
|
||||
mbedtls_mpi_size = 0x4000270c;
|
||||
mbedtls_mpi_read_binary = 0x40002710;
|
||||
mbedtls_mpi_write_binary = 0x40002714;
|
||||
mbedtls_mpi_shift_l = 0x40002718;
|
||||
mbedtls_mpi_shift_r = 0x4000271c;
|
||||
mbedtls_mpi_cmp_abs = 0x40002720;
|
||||
mbedtls_mpi_cmp_mpi = 0x40002724;
|
||||
mbedtls_mpi_lt_mpi_ct = 0x40002728;
|
||||
mbedtls_mpi_cmp_int = 0x4000272c;
|
||||
mbedtls_mpi_add_abs = 0x40002730;
|
||||
mbedtls_mpi_sub_abs = 0x40002734;
|
||||
mbedtls_mpi_add_mpi = 0x40002738;
|
||||
mbedtls_mpi_sub_mpi = 0x4000273c;
|
||||
mbedtls_mpi_add_int = 0x40002740;
|
||||
mbedtls_mpi_sub_int = 0x40002744;
|
||||
mbedtls_mpi_mul_mpi = 0x40002748;
|
||||
mbedtls_mpi_mul_int = 0x4000274c;
|
||||
mbedtls_mpi_div_mpi = 0x40002750;
|
||||
mbedtls_mpi_div_int = 0x40002754;
|
||||
mbedtls_mpi_mod_mpi = 0x40002758;
|
||||
mbedtls_mpi_mod_int = 0x4000275c;
|
||||
mbedtls_mpi_exp_mod = 0x40002760;
|
||||
mbedtls_mpi_fill_random = 0x40002764;
|
||||
mbedtls_mpi_gcd = 0x40002768;
|
||||
mbedtls_mpi_inv_mod = 0x4000276c;
|
||||
mbedtls_mpi_is_prime_ext = 0x40002770;
|
||||
|
||||
/***************************************
|
||||
Group eco4_rom_mbedtls
|
||||
***************************************/
|
||||
|
||||
/* Functions */
|
||||
rom_mbedtls_threading_set_alt = 0x40002c0c;
|
||||
mbedtls_aes_crypt_cfb8 = 0x40002c10;
|
||||
mbedtls_mpi_swap = 0x40002c14;
|
||||
mbedtls_mpi_read_string = 0x40002c18;
|
||||
mbedtls_mpi_write_string = 0x40002c1c;
|
||||
mbedtls_mpi_read_binary_le = 0x40002c20;
|
||||
mbedtls_mpi_write_binary_le = 0x40002c24;
|
||||
mbedtls_mpi_random = 0x40002c28;
|
||||
mbedtls_mpi_gen_prime = 0x40002c2c;
|
||||
mbedtls_ecp_check_budget = 0x40002c30;
|
||||
mbedtls_ecp_set_max_ops = 0x40002c34;
|
||||
mbedtls_ecp_restart_is_enabled = 0x40002c38;
|
||||
mbedtls_ecp_get_type = 0x40002c3c;
|
||||
mbedtls_ecp_curve_list = 0x40002c40;
|
||||
mbedtls_ecp_grp_id_list = 0x40002c44;
|
||||
mbedtls_ecp_curve_info_from_grp_id = 0x40002c48;
|
||||
mbedtls_ecp_curve_info_from_tls_id = 0x40002c4c;
|
||||
mbedtls_ecp_curve_info_from_name = 0x40002c50;
|
||||
mbedtls_ecp_point_init = 0x40002c54;
|
||||
mbedtls_ecp_group_init = 0x40002c58;
|
||||
mbedtls_ecp_keypair_init = 0x40002c5c;
|
||||
mbedtls_ecp_point_free = 0x40002c60;
|
||||
mbedtls_ecp_group_free = 0x40002c64;
|
||||
mbedtls_ecp_keypair_free = 0x40002c68;
|
||||
mbedtls_ecp_restart_init = 0x40002c6c;
|
||||
mbedtls_ecp_restart_free = 0x40002c70;
|
||||
mbedtls_ecp_copy = 0x40002c74;
|
||||
mbedtls_ecp_group_copy = 0x40002c78;
|
||||
mbedtls_ecp_set_zero = 0x40002c7c;
|
||||
mbedtls_ecp_is_zero = 0x40002c80;
|
||||
mbedtls_ecp_point_cmp = 0x40002c84;
|
||||
mbedtls_ecp_point_read_string = 0x40002c88;
|
||||
mbedtls_ecp_point_write_binary = 0x40002c8c;
|
||||
mbedtls_ecp_point_read_binary = 0x40002c90;
|
||||
mbedtls_ecp_tls_read_point = 0x40002c94;
|
||||
mbedtls_ecp_tls_write_point = 0x40002c98;
|
||||
mbedtls_ecp_group_load = 0x40002c9c;
|
||||
mbedtls_ecp_tls_read_group = 0x40002ca0;
|
||||
mbedtls_ecp_tls_read_group_id = 0x40002ca4;
|
||||
mbedtls_ecp_tls_write_group = 0x40002ca8;
|
||||
mbedtls_ecp_mul = 0x40002cac;
|
||||
mbedtls_ecp_mul_restartable = 0x40002cb0;
|
||||
mbedtls_ecp_muladd = 0x40002cb4;
|
||||
mbedtls_ecp_muladd_restartable = 0x40002cb8;
|
||||
mbedtls_ecp_check_pubkey = 0x40002cbc;
|
||||
mbedtls_ecp_check_privkey = 0x40002cc0;
|
||||
mbedtls_ecp_gen_privkey = 0x40002cc4;
|
||||
mbedtls_ecp_gen_keypair_base = 0x40002cc8;
|
||||
mbedtls_ecp_gen_keypair = 0x40002ccc;
|
||||
mbedtls_ecp_gen_key = 0x40002cd0;
|
||||
mbedtls_ecp_read_key = 0x40002cd4;
|
||||
mbedtls_ecp_write_key_ext = 0x40002cd8;
|
||||
mbedtls_ecp_check_pub_priv = 0x40002cdc;
|
||||
mbedtls_ecp_export = 0x40002ce0;
|
||||
mbedtls_asn1_get_enum = 0x40002ce4;
|
||||
mbedtls_asn1_sequence_free = 0x40002ce8;
|
||||
mbedtls_asn1_traverse_sequence_of = 0x40002cec;
|
||||
mbedtls_asn1_find_named_data = 0x40002cf0;
|
||||
mbedtls_asn1_free_named_data_list = 0x40002cf4;
|
||||
mbedtls_asn1_free_named_data_list_shallow = 0x40002cf8;
|
||||
mbedtls_asn1_write_raw_buffer = 0x40002cfc;
|
||||
mbedtls_asn1_write_null = 0x40002d00;
|
||||
mbedtls_asn1_write_oid = 0x40002d04;
|
||||
mbedtls_asn1_write_algorithm_identifier = 0x40002d08;
|
||||
mbedtls_asn1_write_bool = 0x40002d0c;
|
||||
mbedtls_asn1_write_int = 0x40002d10;
|
||||
mbedtls_asn1_write_enum = 0x40002d14;
|
||||
mbedtls_asn1_write_tagged_string = 0x40002d18;
|
||||
mbedtls_asn1_write_printable_string = 0x40002d1c;
|
||||
mbedtls_asn1_write_utf8_string = 0x40002d20;
|
||||
mbedtls_asn1_write_ia5_string = 0x40002d24;
|
||||
mbedtls_asn1_write_bitstring = 0x40002d28;
|
||||
mbedtls_asn1_write_named_bitstring = 0x40002d2c;
|
||||
mbedtls_asn1_write_octet_string = 0x40002d30;
|
||||
mbedtls_asn1_store_named_data = 0x40002d34;
|
||||
mbedtls_ccm_starts = 0x40002d38;
|
||||
mbedtls_ccm_set_lengths = 0x40002d3c;
|
||||
mbedtls_ccm_update_ad = 0x40002d40;
|
||||
mbedtls_ccm_update = 0x40002d44;
|
||||
mbedtls_ccm_finish = 0x40002d48;
|
||||
mbedtls_cipher_list = 0x40002d4c;
|
||||
mbedtls_cipher_info_from_string = 0x40002d50;
|
||||
mbedtls_cipher_info_from_type = 0x40002d54;
|
||||
mbedtls_cipher_info_from_values = 0x40002d58;
|
||||
mbedtls_cipher_free = 0x40002d5c;
|
||||
mbedtls_cipher_setup = 0x40002d60;
|
||||
mbedtls_cipher_setkey = 0x40002d64;
|
||||
mbedtls_cipher_set_iv = 0x40002d68;
|
||||
mbedtls_cipher_update_ad = 0x40002d6c;
|
||||
mbedtls_cipher_update = 0x40002d70;
|
||||
mbedtls_cipher_write_tag = 0x40002d74;
|
||||
mbedtls_cipher_check_tag = 0x40002d78;
|
||||
mbedtls_cipher_auth_encrypt_ext = 0x40002d7c;
|
||||
mbedtls_cipher_auth_decrypt_ext = 0x40002d80;
|
||||
mbedtls_cipher_cmac_reset = 0x40002d84;
|
||||
mbedtls_cipher_cmac = 0x40002d88;
|
||||
mbedtls_aes_cmac_prf_128 = 0x40002d8c;
|
||||
mbedtls_ctr_drbg_set_prediction_resistance = 0x40002d90;
|
||||
mbedtls_ctr_drbg_set_entropy_len = 0x40002d94;
|
||||
mbedtls_ctr_drbg_set_nonce_len = 0x40002d98;
|
||||
mbedtls_ctr_drbg_set_reseed_interval = 0x40002d9c;
|
||||
mbedtls_ctr_drbg_update = 0x40002da0;
|
||||
mbedtls_base64_encode = 0x40002da4;
|
||||
mbedtls_rsa_init = 0x40002da8;
|
||||
mbedtls_rsa_set_padding = 0x40002dac;
|
||||
mbedtls_rsa_get_padding_mode = 0x40002db0;
|
||||
mbedtls_rsa_get_md_alg = 0x40002db4;
|
||||
mbedtls_rsa_import = 0x40002db8;
|
||||
mbedtls_rsa_import_raw = 0x40002dbc;
|
||||
mbedtls_rsa_complete = 0x40002dc0;
|
||||
mbedtls_rsa_export = 0x40002dc4;
|
||||
mbedtls_rsa_export_raw = 0x40002dc8;
|
||||
mbedtls_rsa_export_crt = 0x40002dcc;
|
||||
mbedtls_rsa_get_len = 0x40002dd0;
|
||||
mbedtls_rsa_gen_key = 0x40002dd4;
|
||||
mbedtls_rsa_check_pubkey = 0x40002dd8;
|
||||
mbedtls_rsa_check_privkey = 0x40002ddc;
|
||||
mbedtls_rsa_check_pub_priv = 0x40002de0;
|
||||
mbedtls_rsa_public = 0x40002de4;
|
||||
mbedtls_rsa_private = 0x40002de8;
|
||||
mbedtls_rsa_pkcs1_encrypt = 0x40002dec;
|
||||
mbedtls_rsa_rsaes_pkcs1_v15_encrypt = 0x40002df0;
|
||||
mbedtls_rsa_rsaes_oaep_encrypt = 0x40002df4;
|
||||
mbedtls_rsa_pkcs1_decrypt = 0x40002df8;
|
||||
mbedtls_rsa_rsaes_pkcs1_v15_decrypt = 0x40002dfc;
|
||||
mbedtls_rsa_rsaes_oaep_decrypt = 0x40002e00;
|
||||
mbedtls_rsa_pkcs1_sign = 0x40002e04;
|
||||
mbedtls_rsa_rsassa_pkcs1_v15_sign = 0x40002e08;
|
||||
mbedtls_rsa_rsassa_pss_sign_ext = 0x40002e0c;
|
||||
mbedtls_rsa_rsassa_pss_sign = 0x40002e10;
|
||||
mbedtls_rsa_pkcs1_verify = 0x40002e14;
|
||||
mbedtls_rsa_rsassa_pkcs1_v15_verify = 0x40002e18;
|
||||
mbedtls_rsa_rsassa_pss_verify = 0x40002e1c;
|
||||
mbedtls_rsa_rsassa_pss_verify_ext = 0x40002e20;
|
||||
mbedtls_rsa_copy = 0x40002e24;
|
||||
mbedtls_rsa_free = 0x40002e28;
|
||||
mbedtls_ecdh_can_do = 0x40002e2c;
|
||||
mbedtls_ecdh_gen_public = 0x40002e30;
|
||||
mbedtls_ecdh_compute_shared = 0x40002e34;
|
||||
mbedtls_ecdh_init = 0x40002e38;
|
||||
mbedtls_ecdh_setup = 0x40002e3c;
|
||||
mbedtls_ecdh_free = 0x40002e40;
|
||||
mbedtls_ecdh_make_params = 0x40002e44;
|
||||
mbedtls_ecdh_read_params = 0x40002e48;
|
||||
mbedtls_ecdh_get_params = 0x40002e4c;
|
||||
mbedtls_ecdh_make_public = 0x40002e50;
|
||||
mbedtls_ecdh_read_public = 0x40002e54;
|
||||
mbedtls_ecdh_calc_secret = 0x40002e58;
|
||||
mbedtls_ecdh_enable_restart = 0x40002e5c;
|
||||
mbedtls_ecdsa_can_do = 0x40002e60;
|
||||
mbedtls_ecdsa_sign = 0x40002e64;
|
||||
mbedtls_ecdsa_sign_det_ext = 0x40002e68;
|
||||
mbedtls_ecdsa_sign_restartable = 0x40002e6c;
|
||||
mbedtls_ecdsa_sign_det_restartable = 0x40002e70;
|
||||
mbedtls_ecdsa_verify = 0x40002e74;
|
||||
mbedtls_ecdsa_verify_restartable = 0x40002e78;
|
||||
mbedtls_ecdsa_write_signature = 0x40002e7c;
|
||||
mbedtls_ecdsa_write_signature_restartable = 0x40002e80;
|
||||
mbedtls_ecdsa_read_signature = 0x40002e84;
|
||||
mbedtls_ecdsa_read_signature_restartable = 0x40002e88;
|
||||
mbedtls_ecdsa_genkey = 0x40002e8c;
|
||||
mbedtls_ecdsa_from_keypair = 0x40002e90;
|
||||
mbedtls_ecdsa_init = 0x40002e94;
|
||||
mbedtls_ecdsa_free = 0x40002e98;
|
||||
mbedtls_ecdsa_restart_init = 0x40002e9c;
|
||||
mbedtls_ecdsa_restart_free = 0x40002ea0;
|
@ -74,7 +74,7 @@ mbedtls_sha512_clone = 0x40002a50;
|
||||
mbedtls_sha512_starts = 0x40002a54;
|
||||
mbedtls_sha512_update = 0x40002a58;
|
||||
mbedtls_sha512_finish = 0x40002a5c;
|
||||
mbedtls_internal_sha512_process = 0x40002a60;
|
||||
/*mbedtls_internal_sha512_process = 0x40002a60;*/
|
||||
mbedtls_sha512 = 0x40002a64;
|
||||
mbedtls_aes_xts_init = 0x40002b68;
|
||||
mbedtls_aes_xts_free = 0x40002b6c;
|
||||
@ -95,7 +95,7 @@ mbedtls_md5_clone = 0x40002be0;
|
||||
mbedtls_md5_starts = 0x40002be4;
|
||||
mbedtls_md5_update = 0x40002be8;
|
||||
mbedtls_md5_finish = 0x40002bec;
|
||||
mbedtls_internal_md5_process = 0x40002bf0;
|
||||
/*mbedtls_internal_md5_process = 0x40002bf0;*/
|
||||
mbedtls_md5 = 0x40002bf4;
|
||||
mbedtls_sha1 = 0x40002c08;
|
||||
/* Data (.data, .bss, .rodata) */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -14,6 +14,9 @@
|
||||
#elif CONFIG_IDF_TARGET_ESP32S3
|
||||
#include "esp32s3/rom/spi_flash.h"
|
||||
#include "esp32s3/rom/opi_flash.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
#include "esp32p4/rom/spi_flash.h"
|
||||
#include "esp32p4/rom/opi_flash.h"
|
||||
#endif
|
||||
|
||||
#define SPI_IDX 1
|
||||
@ -725,6 +728,36 @@ void esp_rom_opiflash_cache_mode_config(esp_rom_spiflash_read_mode_t mode, const
|
||||
}
|
||||
}
|
||||
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
extern void esp_rom_spi_set_address_bit_len(int spi, int addr_bits);
|
||||
void esp_rom_opiflash_cache_mode_config(esp_rom_spiflash_read_mode_t mode, const esp_rom_opiflash_spi0rd_t *cache)
|
||||
{
|
||||
esp_rom_spi_set_op_mode(0, mode);
|
||||
|
||||
if (cache) {
|
||||
esp_rom_spi_set_address_bit_len(0, cache->addr_bit_len);
|
||||
// Patch for ROM function `esp_rom_opiflash_cache_mode_config`, because when dummy is 0,
|
||||
// `SPI_MEM_USR_DUMMY` should be 0. `esp_rom_opiflash_cache_mode_config` doesn't handle this
|
||||
// properly.
|
||||
if (cache->dummy_bit_len == 0) {
|
||||
REG_CLR_BIT(SPI_MEM_C_USER_REG, SPI_MEM_C_USR_DUMMY);
|
||||
} else {
|
||||
REG_SET_BIT(SPI_MEM_C_USER_REG, SPI_MEM_C_USR_DUMMY);
|
||||
REG_SET_FIELD(SPI_MEM_C_USER1_REG, SPI_MEM_C_USR_DUMMY_CYCLELEN, cache->dummy_bit_len - 1 + rom_spiflash_legacy_data->dummy_len_plus[0]);
|
||||
}
|
||||
REG_SET_FIELD(SPI_MEM_C_USER2_REG, SPI_MEM_C_USR_COMMAND_VALUE, cache->cmd);
|
||||
REG_SET_FIELD(SPI_MEM_C_USER2_REG, SPI_MEM_C_USR_COMMAND_BITLEN, cache->cmd_bit_len - 1);
|
||||
REG_SET_FIELD(SPI_MEM_C_DDR_REG, SPI_MEM_C_FMEM__VAR_DUMMY, cache->var_dummy_en);
|
||||
|
||||
// Make sure CACHE-FLASH control dummy always be high level
|
||||
REG_SET_BIT(SPI_MEM_C_CTRL_REG, SPI_MEM_C_FDUMMY_RIN);
|
||||
REG_SET_BIT(SPI_MEM_C_CTRL_REG, SPI_MEM_C_WP_REG);
|
||||
REG_SET_BIT(SPI_MEM_C_CTRL_REG, SPI_MEM_C_D_POL);
|
||||
REG_SET_BIT(SPI_MEM_C_CTRL_REG, SPI_MEM_C_Q_POL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif // IDF_TARGET
|
||||
|
||||
#endif // CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
#if CONFIG_HAL_SYSTIMER_USE_ROM_IMPL
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C2
|
||||
#if CONFIG_IDF_TARGET_ESP32C2 && (CONFIG_ESP32C2_REV_MIN_FULL < 200)
|
||||
void systimer_hal_init(systimer_hal_context_t *hal)
|
||||
{
|
||||
hal->dev = &SYSTIMER;
|
||||
@ -62,7 +62,7 @@ void systimer_hal_counter_value_advance(systimer_hal_context_t *hal, uint32_t co
|
||||
systimer_ll_set_counter_value(hal->dev, counter_id, new_count.val);
|
||||
systimer_ll_apply_counter_value(hal->dev, counter_id);
|
||||
}
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C2
|
||||
#endif // CONFIG_IDF_TARGET_ESP32C2 && (CONFIG_ESP32C2_REV_MIN_FULL < 200)
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32P4 || CONFIG_IDF_TARGET_ESP32C5
|
||||
void systimer_hal_init(systimer_hal_context_t *hal)
|
||||
|
@ -1,2 +1,2 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 7f021d55ddb302b090846746123a3a727c017a08
|
||||
Subproject commit 2c8e353382102a11afa17cfe4820eb2bc5387efe
|
@ -72,4 +72,13 @@ if(BOOTLOADER_BUILD)
|
||||
BOOTLOADER_BINARY_PATH "${build_dir}/${PROJECT_BIN}"
|
||||
RESULT bootloader_check_size_command)
|
||||
add_dependencies(app bootloader_check_size) # note: in the subproject, so the target is 'app'...
|
||||
|
||||
if(CONFIG_SECURE_BOOT_V2_ENABLED AND CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)
|
||||
# Check the size of the bootloader + signature block.
|
||||
partition_table_add_check_bootloader_size_target(bootloader_check_size_signed
|
||||
DEPENDS gen_signed_bootloader
|
||||
BOOTLOADER_BINARY_PATH "${build_dir}/${PROJECT_BIN}"
|
||||
RESULT bootloader_check_size_signed_command)
|
||||
add_dependencies(app bootloader_check_size_signed) # note: in the subproject, so the target is 'app'...
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,5 +1,5 @@
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|
||||
|
||||
This test app runs a few FATFS test cases in a wear levelling FAT partition.
|
||||
|
||||
|
@ -1,2 +1,3 @@
|
||||
CONFIG_FATFS_IMMEDIATE_FSYNC=y
|
||||
CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
|
||||
CONFIG_FATFS_VFS_FSTAT_BLKSIZE=2048
|
||||
|
@ -106,7 +106,7 @@ static inline void i2c_ll_master_set_bus_timing(i2c_dev_t *hw, i2c_hal_clk_confi
|
||||
/* SCL period. According to the TRM, we should always subtract 1 to SCL low period */
|
||||
HAL_ASSERT(bus_cfg->scl_low > 0);
|
||||
hw->scl_low_period.period = bus_cfg->scl_low - 1;
|
||||
/* Still according to the TRM, if filter is not enbled, we have to subtract 7,
|
||||
/* Still according to the TRM, if filter is not enabled, we have to subtract 7,
|
||||
* if SCL filter is enabled, we have to subtract:
|
||||
* 8 if SCL filter is between 0 and 2 (included)
|
||||
* 6 + SCL threshold if SCL filter is between 3 and 7 (included)
|
||||
@ -547,7 +547,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -612,7 +612,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief Reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@ -633,11 +633,23 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
;//ESP32 do not support
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set I2C source clock
|
||||
*
|
||||
@ -875,7 +887,7 @@ static inline void i2c_ll_get_scl_clk_timing(i2c_dev_t *hw, int *high_period, in
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL high period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -1058,7 +1070,7 @@ static inline uint32_t i2c_ll_get_hw_version(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in APB cycle)
|
||||
* @param hight_period The I2C SCL high period (in APB cycle)
|
||||
* @param low_period The I2C SCL low period (in APB cycle)
|
||||
*
|
||||
* @return None.
|
||||
|
@ -583,7 +583,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -647,7 +647,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@ -667,18 +667,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardward will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value.
|
||||
while (hw->scl_sp_conf.scl_rst_slv_en);
|
||||
hw->scl_sp_conf.scl_rst_slv_en = enable;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardware will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value after this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return hw->scl_sp_conf.scl_rst_slv_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -756,7 +767,8 @@ static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
@ -791,7 +803,7 @@ typedef enum {
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -906,7 +918,7 @@ static inline void i2c_ll_master_disable_rx_it(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param hight_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
*
|
||||
* @return None.
|
||||
|
@ -663,7 +663,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -698,7 +698,7 @@ static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ram_offset Offset value of I2C RAM.
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*/
|
||||
static inline void i2c_ll_write_by_nonfifo(i2c_dev_t *hw, uint8_t ram_offset, const uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
@ -770,7 +770,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@ -790,18 +790,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardward will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value.
|
||||
while (hw->scl_sp_conf.scl_rst_slv_en);
|
||||
hw->scl_sp_conf.scl_rst_slv_en = enable;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardware will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value after this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return hw->scl_sp_conf.scl_rst_slv_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -929,7 +940,8 @@ static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
@ -968,7 +980,7 @@ typedef enum {
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -1155,7 +1167,7 @@ static inline void i2c_ll_slave_disable_rx_it(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param hight_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
*
|
||||
* @return None.
|
||||
|
@ -59,38 +59,38 @@ __attribute__((always_inline)) static inline bool efuse_ll_get_secure_boot_v2_en
|
||||
// use efuse_hal_get_major_chip_version() to get major chip version
|
||||
__attribute__((always_inline)) static inline uint32_t efuse_ll_get_chip_wafer_version_major(void)
|
||||
{
|
||||
return (uint32_t)0;
|
||||
return EFUSE.rd_mac_sys2.wafer_version_major;
|
||||
}
|
||||
|
||||
// use efuse_hal_get_minor_chip_version() to get minor chip version
|
||||
__attribute__((always_inline)) static inline uint32_t efuse_ll_get_chip_wafer_version_minor(void)
|
||||
{
|
||||
return (uint32_t)0;
|
||||
return EFUSE.rd_mac_sys2.wafer_version_minor;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline bool efuse_ll_get_disable_wafer_version_major(void)
|
||||
{
|
||||
return (bool)0;
|
||||
return EFUSE.rd_mac_sys2.disable_wafer_version_major;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t efuse_ll_get_blk_version_major(void)
|
||||
{
|
||||
return (uint32_t)0;
|
||||
return EFUSE.rd_mac_sys2.blk_version_major;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t efuse_ll_get_blk_version_minor(void)
|
||||
{
|
||||
return (uint32_t)0;
|
||||
return EFUSE.rd_mac_sys2.blk_version_minor;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline bool efuse_ll_get_disable_blk_version_major(void)
|
||||
{
|
||||
return (bool)0;
|
||||
return EFUSE.rd_mac_sys2.disable_blk_version_major;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline uint32_t efuse_ll_get_chip_ver_pkg(void)
|
||||
{
|
||||
return (uint32_t)0;
|
||||
return EFUSE.rd_mac_sys2.pkg_version;
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) static inline void efuse_ll_set_ecdsa_key_blk(int efuse_blk)
|
||||
|
@ -611,7 +611,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -646,7 +646,7 @@ static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ram_offset Offset value of I2C RAM.
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*/
|
||||
static inline void i2c_ll_write_by_nonfifo(i2c_dev_t *hw, uint8_t ram_offset, const uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
@ -738,18 +738,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardward will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value.
|
||||
while (hw->scl_sp_conf.scl_rst_slv_en);
|
||||
hw->scl_sp_conf.scl_rst_slv_en = enable;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardware will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value after this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return hw->scl_sp_conf.scl_rst_slv_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -790,8 +801,8 @@ static inline void i2c_ll_master_init(i2c_dev_t *hw)
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.ms_mode = 1;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
}
|
||||
|
||||
@ -806,8 +817,8 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw)
|
||||
{
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
hw->fifo_conf.fifo_addr_cfg_en = 0;
|
||||
}
|
||||
@ -863,7 +874,8 @@ static inline void i2c_ll_slave_clear_stretch(i2c_dev_t *dev)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
@ -902,7 +914,7 @@ typedef enum {
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL high period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -1090,7 +1102,7 @@ static inline void i2c_ll_slave_disable_rx_it(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param hight_period The I2C SCL high period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
*
|
||||
* @return None.
|
||||
|
@ -734,7 +734,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@ -754,18 +754,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = enable;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardware will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value.
|
||||
while (hw->scl_sp_conf.scl_rst_slv_en);
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// and we should set conf_upgate bit to synchronize register value after this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return hw->scl_sp_conf.scl_rst_slv_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -885,8 +896,8 @@ static inline void i2c_ll_master_init(i2c_dev_t *hw)
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.ms_mode = 1;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
}
|
||||
|
||||
@ -901,8 +912,8 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw)
|
||||
{
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
hw->fifo_conf.fifo_addr_cfg_en = 0;
|
||||
}
|
||||
@ -972,7 +983,8 @@ static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
|
@ -613,7 +613,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -648,7 +648,7 @@ static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ram_offset Offset value of I2C RAM.
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*/
|
||||
static inline void i2c_ll_write_by_nonfifo(i2c_dev_t *hw, uint8_t ram_offset, const uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
@ -720,7 +720,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@ -740,18 +740,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardward will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value.
|
||||
while (hw->scl_sp_conf.scl_rst_slv_en);
|
||||
hw->scl_sp_conf.scl_rst_slv_en = enable;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardware will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value after this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return hw->scl_sp_conf.scl_rst_slv_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -792,8 +803,8 @@ static inline void i2c_ll_master_init(i2c_dev_t *hw)
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.ms_mode = 1;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
}
|
||||
|
||||
@ -808,8 +819,8 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw)
|
||||
{
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
hw->fifo_conf.fifo_addr_cfg_en = 0;
|
||||
}
|
||||
@ -879,7 +890,8 @@ static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
@ -918,7 +930,7 @@ typedef enum {
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -1106,7 +1118,7 @@ static inline void i2c_ll_slave_disable_rx_it(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param hight_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
*
|
||||
* @return None.
|
||||
|
@ -615,7 +615,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -650,7 +650,7 @@ static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ram_offset Offset value of I2C RAM.
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*/
|
||||
static inline void i2c_ll_write_by_nonfifo(i2c_dev_t *hw, uint8_t ram_offset, const uint8_t *ptr, uint8_t len)
|
||||
{
|
||||
@ -722,7 +722,7 @@ static inline void i2c_ll_master_get_filter(i2c_dev_t *hw, uint8_t *filter_conf)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Reste I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
* @brief reset I2C master FSM. When the master FSM is stuck, call this function to reset the FSM
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
@ -742,18 +742,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardward will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value.
|
||||
while (hw->scl_sp_conf.scl_rst_slv_en);
|
||||
hw->scl_sp_conf.scl_rst_slv_en = enable;
|
||||
hw->ctr.conf_upgate = 1;
|
||||
// hardware will clear scl_rst_slv_en after sending SCL pulses,
|
||||
// and we should set conf_upgate bit to synchronize register value after this function.
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return hw->scl_sp_conf.scl_rst_slv_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -889,8 +900,8 @@ static inline void i2c_ll_master_init(i2c_dev_t *hw)
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.ms_mode = 1;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
}
|
||||
|
||||
@ -905,8 +916,8 @@ static inline void i2c_ll_slave_init(i2c_dev_t *hw)
|
||||
{
|
||||
typeof(hw->ctr) ctrl_reg;
|
||||
ctrl_reg.val = 0;
|
||||
ctrl_reg.sda_force_out = 1;
|
||||
ctrl_reg.scl_force_out = 1;
|
||||
ctrl_reg.sda_force_out = 0;
|
||||
ctrl_reg.scl_force_out = 0;
|
||||
hw->ctr.val = ctrl_reg.val;
|
||||
hw->fifo_conf.fifo_addr_cfg_en = 0;
|
||||
}
|
||||
@ -976,7 +987,8 @@ static inline bool i2c_ll_master_is_cmd_done(i2c_dev_t *hw, int cmd_idx)
|
||||
static inline uint32_t i2c_ll_calculate_timeout_us_to_reg_val(uint32_t src_clk_hz, uint32_t timeout_us)
|
||||
{
|
||||
uint32_t clk_cycle_num_per_us = src_clk_hz / (1 * 1000 * 1000);
|
||||
return 31 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
// round up to an integer
|
||||
return 32 - __builtin_clz(clk_cycle_num_per_us * timeout_us);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////Deprecated Functions//////////////////////////////////////////////////////////
|
||||
@ -1015,7 +1027,7 @@ typedef enum {
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -1203,7 +1215,7 @@ static inline void i2c_ll_slave_disable_rx_it(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param hight_period The I2C SCL height period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
*
|
||||
* @return None.
|
||||
|
@ -64,7 +64,8 @@ typedef union {
|
||||
#define spi_flash_ll_set_dummy(dev, dummy) gpspi_flash_ll_set_dummy((spi_dev_t*)dev, dummy)
|
||||
#define spi_flash_ll_set_hold(dev, hold_n) gpspi_flash_ll_set_hold((spi_dev_t*)dev, hold_n)
|
||||
#define spi_flash_ll_set_cs_setup(dev, cs_setup_time) gpspi_flash_ll_set_cs_setup((spi_dev_t*)dev, cs_setup_time)
|
||||
#define spi_flash_ll_set_extra_address(dev, extra_addr) { /* Not supported on gpspi on ESP32-C6*/ }
|
||||
#define spi_flash_ll_set_extra_address(dev, extra_addr) { /* Not supported on gpspi on ESP32-P4*/ }
|
||||
#define spi_flash_ll_set_dummy_out(dev, en, lev) gpspi_flash_ll_set_dummy_out((spi_dev_t*)dev, en, lev)
|
||||
#else
|
||||
#define spi_flash_ll_reset(dev) spimem_flash_ll_reset((spi_mem_dev_t*)dev)
|
||||
#define spi_flash_ll_cmd_is_done(dev) spimem_flash_ll_cmd_is_done((spi_mem_dev_t*)dev)
|
||||
@ -93,6 +94,7 @@ typedef union {
|
||||
#define spi_flash_ll_set_cs_setup(dev, cs_setup_time) spimem_flash_ll_set_cs_setup((spi_mem_dev_t*)dev, cs_setup_time)
|
||||
#define spi_flash_ll_set_extra_address(dev, extra_addr) spimem_flash_ll_set_extra_address((spi_mem_dev_t*)dev, extra_addr)
|
||||
#define spi_flash_ll_get_ctrl_val(dev) spimem_flash_ll_get_ctrl_val((spi_mem_dev_t*)dev)
|
||||
#define spi_flash_ll_set_dummy_out(dev, en, lev) spimem_flash_ll_set_dummy_out((spi_mem_dev_t*)dev, en, lev)
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -22,10 +22,13 @@
|
||||
#include "soc/spi_periph.h"
|
||||
#include "soc/spi1_mem_c_struct.h"
|
||||
#include "soc/spi1_mem_c_reg.h"
|
||||
#include "soc/hp_sys_clkrst_struct.h"
|
||||
#include "hal/assert.h"
|
||||
#include "hal/spi_types.h"
|
||||
#include "hal/spi_flash_types.h"
|
||||
#include "hal/misc.h"
|
||||
#include "hal/efuse_hal.h"
|
||||
#include "soc/chip_revision.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -221,10 +224,9 @@ static inline void spimem_flash_ll_set_read_sus_status(spi_mem_dev_t *dev, uint3
|
||||
*/
|
||||
static inline void spimem_flash_ll_set_sus_delay(spi_mem_dev_t *dev, uint32_t dly_val)
|
||||
{
|
||||
// dev->ctrl1.cs_hold_dly_res = dly_val;
|
||||
// dev->sus_status.pes_dly_128 = 1;
|
||||
// dev->sus_status.per_dly_128 = 1;
|
||||
abort();
|
||||
dev->ctrl1.cs_hold_dly_res = dly_val;
|
||||
dev->sus_status.flash_pes_dly_128 = 1;
|
||||
dev->sus_status.flash_per_dly_128 = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -235,8 +237,7 @@ static inline void spimem_flash_ll_set_sus_delay(spi_mem_dev_t *dev, uint32_t dl
|
||||
*/
|
||||
static inline void spimem_flash_set_cs_hold_delay(spi_mem_dev_t *dev, uint32_t cs_hold_delay)
|
||||
{
|
||||
// SPIMEM0.ctrl2.cs_hold_delay = cs_hold_delay;
|
||||
abort();
|
||||
SPIMEM0.ctrl2.cs_hold_delay = cs_hold_delay;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -290,9 +291,8 @@ static inline bool spimem_flash_ll_sus_status(spi_mem_dev_t *dev)
|
||||
*/
|
||||
static inline void spimem_flash_ll_sus_set_spi0_lock_trans(spi_mem_dev_t *dev, uint32_t lock_time)
|
||||
{
|
||||
// dev->sus_status.spi0_lock_en = 1;
|
||||
// SPIMEM0.fsm.cspi_lock_delay_time = lock_time;
|
||||
abort();
|
||||
dev->sus_status.spi0_lock_en = 1;
|
||||
SPIMEM0.fsm.lock_delay_time = lock_time;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -303,14 +303,13 @@ static inline void spimem_flash_ll_sus_set_spi0_lock_trans(spi_mem_dev_t *dev, u
|
||||
*/
|
||||
static inline uint32_t spimem_flash_ll_get_tsus_unit_in_cycles(spi_mem_dev_t *dev)
|
||||
{
|
||||
// uint32_t tsus_unit = 0;
|
||||
// if (dev->sus_status.pes_dly_128 == 1) {
|
||||
// tsus_unit = 128;
|
||||
// } else {
|
||||
// tsus_unit = 4;
|
||||
// }
|
||||
// return tsus_unit;
|
||||
abort();
|
||||
uint32_t tsus_unit = 0;
|
||||
if (dev->sus_status.flash_pes_dly_128 == 1) {
|
||||
tsus_unit = 128;
|
||||
} else {
|
||||
tsus_unit = 4;
|
||||
}
|
||||
return tsus_unit;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -554,6 +553,10 @@ static inline int spimem_flash_ll_get_addr_bitlen(spi_mem_dev_t *dev)
|
||||
*/
|
||||
static inline void spimem_flash_ll_set_addr_bitlen(spi_mem_dev_t *dev, uint32_t bitlen)
|
||||
{
|
||||
unsigned chip_version = efuse_hal_chip_revision();
|
||||
if (ESP_CHIP_REV_ABOVE(chip_version, 1)) {
|
||||
dev->cache_fctrl.cache_usr_addr_4byte = (bitlen == 32) ? 1 : 0;
|
||||
}
|
||||
dev->user1.usr_addr_bitlen = (bitlen - 1);
|
||||
dev->user.usr_addr = bitlen ? 1 : 0;
|
||||
}
|
||||
@ -684,6 +687,73 @@ static inline uint32_t spimem_flash_ll_get_ctrl_val(spi_mem_dev_t *dev)
|
||||
return dev->ctrl.val;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set D/Q output level during dummy phase
|
||||
*
|
||||
* @param dev Beginning address of the peripheral registers.
|
||||
* @param out_en whether to enable IO output for dummy phase
|
||||
* @param out_level dummy output level
|
||||
*/
|
||||
static inline void spimem_flash_ll_set_dummy_out(spi_mem_dev_t *dev, uint32_t out_en, uint32_t out_lev)
|
||||
{
|
||||
dev->ctrl.fdummy_rin = out_en;
|
||||
dev->ctrl.q_pol = out_lev;
|
||||
dev->ctrl.d_pol = out_lev;
|
||||
dev->ctrl.wp_reg = out_lev;
|
||||
}
|
||||
|
||||
/*
|
||||
* @brief Select FLASH clock source
|
||||
*
|
||||
* @param mspi_id mspi_id
|
||||
* @param clk_src clock source, see valid sources in type `soc_periph_flash_clk_src_t`
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline void spimem_flash_ll_select_clk_source(uint32_t mspi_id, soc_periph_flash_clk_src_t clk_src)
|
||||
{
|
||||
(void)mspi_id;
|
||||
uint32_t clk_val = 0;
|
||||
switch (clk_src) {
|
||||
case FLASH_CLK_SRC_XTAL:
|
||||
clk_val = 0;
|
||||
break;
|
||||
case FLASH_CLK_SRC_SPLL:
|
||||
clk_val = 1;
|
||||
break;
|
||||
case FLASH_CLK_SRC_CPLL:
|
||||
clk_val = 2;
|
||||
break;
|
||||
default:
|
||||
HAL_ASSERT(false);
|
||||
break;
|
||||
}
|
||||
|
||||
HP_SYS_CLKRST.peri_clk_ctrl00.reg_flash_pll_clk_en = 1;
|
||||
HP_SYS_CLKRST.peri_clk_ctrl00.reg_flash_clk_src_sel = clk_val;
|
||||
}
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
|
||||
#define spimem_flash_ll_select_clk_source(...) (void)__DECLARE_RCC_ATOMIC_ENV; spimem_flash_ll_select_clk_source(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* @brief Set FLASH core clock
|
||||
*
|
||||
* @param mspi_id mspi_id
|
||||
* @param freqdiv Divider value
|
||||
*/
|
||||
__attribute__((always_inline))
|
||||
static inline void spimem_ctrlr_ll_set_core_clock(uint8_t mspi_id, uint32_t freqdiv)
|
||||
{
|
||||
(void)mspi_id;
|
||||
HP_SYS_CLKRST.peri_clk_ctrl00.reg_flash_core_clk_en = 1;
|
||||
HAL_FORCE_MODIFY_U32_REG_FIELD(HP_SYS_CLKRST.peri_clk_ctrl00, reg_flash_core_clk_div_num, freqdiv - 1);
|
||||
}
|
||||
|
||||
/// use a macro to wrap the function, force the caller to use it in a critical section
|
||||
/// the critical section needs to declare the __DECLARE_RCC_ATOMIC_ENV variable in advance
|
||||
#define spimem_ctrlr_ll_set_core_clock(...) (void)__DECLARE_RCC_ATOMIC_ENV; spimem_ctrlr_ll_set_core_clock(__VA_ARGS__)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -573,7 +573,7 @@ static inline void i2c_ll_get_stop_timing(i2c_dev_t *hw, int *setup_time, int *h
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param ptr Pointer to data buffer
|
||||
* @param len Amount of data needs to be writen
|
||||
* @param len Amount of data needs to be written
|
||||
*
|
||||
* @return None.
|
||||
*/
|
||||
@ -658,16 +658,29 @@ static inline void i2c_ll_master_fsm_rst(i2c_dev_t *hw)
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param slave_pulses When I2C master is IDLE, the number of pulses will be sent out.
|
||||
* @param enable True to start the state machine, otherwise, false
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses)
|
||||
static inline void i2c_ll_master_clr_bus(i2c_dev_t *hw, uint32_t slave_pulses, bool enable)
|
||||
{
|
||||
hw->scl_sp_conf.scl_rst_slv_num = slave_pulses;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 0;
|
||||
hw->scl_sp_conf.scl_rst_slv_en = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the clear bus state
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
*
|
||||
* @return true: the clear bus not finish, otherwise, false.
|
||||
*/
|
||||
static inline bool i2c_ll_master_is_bus_clear_done(i2c_dev_t *hw)
|
||||
{
|
||||
return false; // not supported on esp32s2
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set I2C source clock
|
||||
*
|
||||
@ -717,7 +730,7 @@ static inline void i2c_ll_master_init(i2c_dev_t *hw)
|
||||
* Otherwise it is not needed.
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param internal_od_ena Set true to enble internal open-drain, otherwise, set it false.
|
||||
* @param internal_od_ena Set true to enable internal open-drain, otherwise, set it false.
|
||||
*
|
||||
* @return None
|
||||
*/
|
||||
@ -908,7 +921,7 @@ typedef enum {
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param high_period The I2C SCL hight period (in core clock cycle, hight_period > 2)
|
||||
* @param high_period The I2C SCL high period (in core clock cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in core clock cycle, low_period > 1)
|
||||
* @param wait_high_period The I2C SCL wait rising edge period.
|
||||
*
|
||||
@ -1096,7 +1109,7 @@ static inline void i2c_ll_slave_disable_rx_it(i2c_dev_t *hw)
|
||||
* @brief Configure I2C SCL timing
|
||||
*
|
||||
* @param hw Beginning address of the peripheral registers
|
||||
* @param hight_period The I2C SCL hight period (in APB cycle, hight_period > 2)
|
||||
* @param hight_period The I2C SCL high period (in APB cycle, hight_period > 2)
|
||||
* @param low_period The I2C SCL low period (in APB cycle, low_period > 1)
|
||||
*
|
||||
* @return None.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user