Compare commits

..

1083 Commits

Author SHA1 Message Date
Aditya Patwardhan
1b459d9c49 change(version): Update version to 5.3.4 2025-08-14 18:33:18 +05:30
Aditya Patwardhan
5276f0b443 Merge branch 'feature/support_ds_peripheral_rsa_decryption_v5.3' into 'release/v5.3'
feat(mbedtls): Add support for RSA decryption with DS peripheral (v5.3)

See merge request espressif/esp-idf!40451
2025-08-14 18:31:37 +05:30
Aditya Patwardhan
0e2511d3b4 Merge branch 'bugfix/fix_es7210_example_dependency_breaking_change_v5.3' into 'release/v5.3'
fix(i2s_es7210): fixed breaking change of dependency migration (v5.3)

See merge request espressif/esp-idf!41044
2025-08-13 19:14:51 +05:30
Jiang Jiang Jian
bea47a18d7 Merge branch 'bugfix/wifibug-1373' into 'release/v5.3'
backport v5.3: add hal interface to configure pau regdma wait timeout parameter

See merge request espressif/esp-idf!41079
2025-08-08 19:48:20 +08:00
Li Shuai
08c146b2ab change(hal): add hal interface to configure pau regdma wait timeout parameter 2025-08-06 19:42:35 +08:00
laokaiyao
70583758a8 fix(i2s_es7210): fixed breaking change of dependency migration 2025-08-05 11:24:31 +08:00
Jiang Jiang Jian
24bc87dbba Merge branch 'bugfix/fix_bt_hci_not_effective_08_v5.3' into 'release/v5.3'
Fixed bt hci event was not report to host when hci command was sent(v5.3)

See merge request espressif/esp-idf!40998
2025-08-01 22:55:31 +08:00
Jiang Jiang Jian
911fda0743 Merge branch 'bugfix/fixed_ble_dtm_err_v5.3' into 'release/v5.3'
Bugfix/fixed ble dtm err (v5.3)

See merge request espressif/esp-idf!40953
2025-08-01 22:49:15 +08:00
Jiang Jiang Jian
5a0dabc4da Merge branch 'fix/c6_phylib_for_modem_state_v5.3' into 'release/v5.3'
fix(esp_phy): fix c6 modem state (v5.3)

See merge request espressif/esp-idf!40870
2025-08-01 21:07:06 +08:00
zhanghaipeng
51fbec0a29 fix(bt/ble): Update esp32 libbtdm_app.a (65c26ad)
- Fixed bt hci event was not report to host when hci command was sent
2025-08-01 18:52:55 +08:00
wangtao@espressif.com
644275f8ca fix(phy): fix esp32c2 build issue 2025-08-01 11:24:57 +08:00
Zhao Wei Liang
ecf9e8ed7e fix(ble): fixed dtm function error on ESP32-H2
(cherry picked from commit 43c82b3b20)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-01 10:20:26 +08:00
Zhao Wei Liang
50cc13d97b fix(ble): fixed dtm function error on ESP32-C6
(cherry picked from commit ca0fdad4f2)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-01 10:20:23 +08:00
zwx
4f43ff7e79 fix(esp_phy): fix c6 modem state 2025-07-31 07:14:50 +00:00
Jiang Jiang Jian
8926bc489e Merge branch 'bugfix/fix_ble_aa_check_v2_v5.3' into 'release/v5.3'
Optimize check Access Address when receive connection request PDU (v5.3)

See merge request espressif/esp-idf!40748
2025-07-30 10:59:12 +08:00
zhanghaipeng
e61aefeeba fix(bt/ble): Update esp32 libbtdm_app.a (3a27e2e)
- Optimize check Access Address when receive connection request PDU
2025-07-29 15:38:33 +08:00
Jiang Jiang Jian
6045e49afd Merge branch 'bugfix/fix_phy_test_crash_v5.3' into 'release/v5.3'
fix(PHY): Fixed phy test example crash (v5.3)

See merge request espressif/esp-idf!40756
2025-07-29 11:58:06 +08:00
Jiang Jiang Jian
8bbe5001d3 Merge branch 'bugfix/wpa_eap_v1_connect_issue_v5.3' into 'release/v5.3'
Adjusted authentication mode for wpa-eap version 1 and add some fixes for wpa_supplicant(release/v5.3)

See merge request espressif/esp-idf!40700
2025-07-29 11:46:52 +08:00
Marius Vikhammer
5633354455 Merge branch 'fix/undefined-macro-usb-cdc' into 'release/v5.3'
fix(usb_cdc): Remove undefined macro USB_CDC_LOCAL_FD

See merge request espressif/esp-idf!40473
2025-07-25 10:18:27 +08:00
Zhi Wei Jian
16e2d33bed fix(rf/example): Fixed phy test example crash
(cherry picked from commit e2e5d4915b)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-07-23 11:23:22 +08:00
Guillaume Souchere
f49f023b79 fix(usb_cdc): Remove undefined macro USB_CDC_LOCAL_FD 2025-07-21 12:34:53 +02:00
Kapil Gupta
1699544639 fix (esp_wifi): Set default akm as eap for non AKM APs 2025-07-21 11:28:02 +05:30
Kapil Gupta
d0bf6f54bd fix(wpa_supplicant): Delay sending of EAP_START for EAP auth 2025-07-21 11:27:26 +05:30
tarun.kumar
3b8740860e fix(softAP): Adjusted authentication mode for wpa-eap version 1 2025-07-21 11:26:32 +05:30
Jiang Jiang Jian
a2ad5697df Merge branch 'bugfix/fix_memory_leak_on_http_header_fetch_failure_v5.3' into 'release/v5.3'
fix(esp_http_client): free header in case of ESP_ERR_HTTP_FETCH_HEADER (v5.3)

See merge request espressif/esp-idf!40664
2025-07-19 09:10:57 +08:00
Jiang Jiang Jian
7be9480d3c Merge branch 'fix/disconnect_sta_in_wps_start_v5.3' into 'release/v5.3'
fix(wifi): Disconnect station from previous AP in wps_start instead of wps_enable (Backport v5.3)

See merge request espressif/esp-idf!40645
2025-07-19 09:06:44 +08:00
Jiang Jiang Jian
2061f0c361 Merge branch 'feat/eap_method_limit_v5.3' into 'release/v5.3'
feat(esp_wifi): Add support to limit EAP methods (v5.3)

See merge request espressif/esp-idf!40504
2025-07-19 09:06:19 +08:00
Jiang Jiang Jian
30c47e8cef Merge branch 'bugfix/fix_pmksa_cache_expired_after_sntp_issue_v5.3' into 'release/v5.3'
Bugfix/fix pmksa cache expired after sntp issue v5.3(Backport v5.3)

See merge request espressif/esp-idf!40701
2025-07-19 09:06:03 +08:00
Kapil Gupta
fc106b3dbd fix(esp_wifi): Address review comments 2025-07-18 23:50:46 +08:00
Kapil Gupta
e47e4691b3 feat(esp_wifi): Add support to limit EAP methods
Added support to limit EAP method supported by device based on
user configuration.
2025-07-18 23:50:46 +08:00
Sarvesh Bodakhe
d7c76463f9 fix(wifi): Disconnect station in wps_start instead of wps_enable
Modifies changes from 784d4d63ef
2025-07-18 23:49:49 +08:00
wangtao@espressif.com
dfe0c15f90 fix(wifi): fix esp32c2 eco4 ld issue 2025-07-18 23:49:33 +08:00
muhaidong
e4d1588416 fix(wifi): fix pmksa cache expiration caused by sntp time synchronization issue 2025-07-18 23:49:33 +08:00
Jiang Jiang Jian
cb1f35027f Merge branch 'bugfix/enable_ipv6_if_nan_v5.3' into 'release/v5.3'
bugfix(wifi): Enable IPv6 support via LWIP_IPV6 when WiFi Aware(NAN) is enabled (Backport v5.3)

See merge request espressif/esp-idf!40489
2025-07-18 20:14:42 +08:00
Jiang Jiang Jian
a62046dd10 Merge branch 'docs/remove_incorrect_info_for_esp32p4_sdmmc_v5.3' into 'release/v5.3'
docs: Remove incorrect description for ESP32-P4 SDMMC (v5.3)

See merge request espressif/esp-idf!40675
2025-07-18 14:38:57 +08:00
Jiang Jiang Jian
077a8f242c Merge branch 'feat/extend_pip_user_option_check_v5.3' into 'release/v5.3'
feat(tools): Disabled pip 'user' option, when installing ESP-IDF python virtual environment (v5.3)

See merge request espressif/esp-idf!40572
2025-07-18 14:37:47 +08:00
Jiang Jiang Jian
2138198e1a Merge branch 'feat/add_timestamp_v5.3' into 'release/v5.3'
fix(nimble): Enhanced HCI logging by adding timestamp information (v5.3)

See merge request espressif/esp-idf!40635
2025-07-18 14:36:57 +08:00
Jiang Jiang Jian
103d5d14ef Merge branch 'contrib/github_pr_15767_v5.3' into 'release/v5.3'
fix(esp_http_server): WebSocket frame parsing errors (GitHub PR) (v5.3)

See merge request espressif/esp-idf!40619
2025-07-18 14:35:47 +08:00
Jiang Jiang Jian
5f970b722b Merge branch 'bugfix/ci_release_zip_base_image_v5.3' into 'release/v5.3'
Bump ubuntu version for release zips workflow (v5.3)

See merge request espressif/esp-idf!40648
2025-07-18 14:34:00 +08:00
Jiang Jiang Jian
9d031f25fb Merge branch 'bugfix/make_blufi_adv_custom_v5.3' into 'release/v5.3'
feat(nimble): Add a way to make blufi advertising customizable (v5.3)

See merge request espressif/esp-idf!40531
2025-07-18 14:33:01 +08:00
Marek Fiala
3588492623 feat(tools): Enforce pip 'user' option to no, when installing python env
Closes https://github.com/espressif/esp-idf/issues/16189
2025-07-18 13:02:48 +08:00
Ashish Sharma
6e28f15d67 fix(esp_http_client): fix memory leak in current_header_value buffer
Fixed memory leak in esp_http_client_cleanup() where current_header_value
buffer was not being freed when ESP_ERR_HTTP_FETCH_HEADER is returned
during header parsing failures.
2025-07-18 11:57:23 +08:00
Zhang Shuxian
53e1e55b6d docs: Remove incorrect description for ESP32-P4 SDMMC 2025-07-18 09:32:06 +08:00
Vincent Hamp
6421482fa1 fix(esp_http_server): WebSocket frame parsing errors
Fixes the Websocket frame pasring error, by making sure
that two bytes are read compulsary for length bytes 126.

Closes https://github.com/espressif/esp-idf/pull/15767
Closes https://github.com/espressif/esp-idf/issues/15235
2025-07-17 14:30:59 +05:30
Sergei Silnov
5e0d9ea302 ci: bump ubuntu version for release zips workflow 2025-07-17 10:16:41 +02:00
Rahul Tank
540935cd72 fix(nimble): Enhanced HCI logging by adding timestamp information 2025-07-17 10:19:30 +05:30
Jiang Jiang Jian
13d42ce9d4 Merge branch 'bugfix/crash_ap_mode_switch_v5.3' into 'release/v5.3'
fix(wifi): Fix crash due to BIP when ap mode change

See merge request espressif/esp-idf!40567
2025-07-17 12:12:40 +08:00
Shreyas Sheth
01640ff9da fix(wifi): Fix crash due to BIP when ap mode change 2025-07-16 19:14:38 +08:00
Jiang Jiang Jian
17264e6711 Merge branch 'fix/spi_master_p4_change_default_clk_pll_v5.3' into 'release/v5.3'
fix(driver_spi): master driver change esp32p4 default src to pll (v5.3)

See merge request espressif/esp-idf!40115
2025-07-16 17:30:28 +08:00
Jiang Jiang Jian
c04f7e0650 Merge branch 'fix/incorrect_unit_of_cpb_rx_clk_v5.3' into 'release/v5.3'
fix(bt): fixed the incorrect unit of clk in cpb rx event(backport v5.3)

See merge request espressif/esp-idf!40391
2025-07-16 17:28:51 +08:00
Jiang Jiang Jian
a42a69f220 Merge branch 'bugfix/fix_some_ble_bugs_250610_cjh_esp32c3_v5.3' into 'release/v5.3'
Fixed some BLE bugs 250610 on esp32c3(2edb0b0) (v5.3)

See merge request espressif/esp-idf!40429
2025-07-16 17:18:35 +08:00
Jiang Jiang Jian
82438be6dd Merge branch 'bugfix/handle_3e_rem_feat_read_name_v5.3' into 'release/v5.3'
fix(nimble): Handle 0x3e disconnect during rem feat/ read version (v5.3)

See merge request espressif/esp-idf!40176
2025-07-16 17:17:49 +08:00
Jiang Jiang Jian
0953c344f6 Merge branch 'bugfix/bt_sleep_log_consistent_v5.3' into 'release/v5.3'
fix(ble): keep the log of the bluetooth sleep clock source consistent(v5.3)

See merge request espressif/esp-idf!40357
2025-07-16 17:16:41 +08:00
Jiang Jiang Jian
7cdc3aeba8 Merge branch 'feat/update_mbedtls_3.6.4_v5.3' into 'release/v5.3'
feat(mbedtls): update to version 3.6.4 (v5.3)

See merge request espressif/esp-idf!40377
2025-07-16 17:13:59 +08:00
Jiang Jiang Jian
5221b8abf9 Merge branch 'doc/update_esp_https_ota_pre_encrypted_doc_v5.3' into 'release/v5.3'
docs(system/esp_https_ota): adds ECIES-256 to pre-enc ota design doc (v5.3)

See merge request espressif/esp-idf!40374
2025-07-16 17:09:32 +08:00
Jiang Jiang Jian
f256e57318 Merge branch 'doc/update_32b_addr_limit_in_flash_doc_v5.3' into 'release/v5.3'
flash: updated 32bit addr support related doc (v5.3)

See merge request espressif/esp-idf!40333
2025-07-16 17:08:53 +08:00
Jiang Jiang Jian
22e579da3f Merge branch 'fix/pcnt_miss_accum_value_when_overflow_v5.3' into 'release/v5.3'
fix(pcnt): fix the accum_value missing when overflow (v5.3)

See merge request espressif/esp-idf!40316
2025-07-16 17:08:26 +08:00
Jiang Jiang Jian
a9190297eb Merge branch 'bugfix/esp32s2_memprot_clear_v5.3' into 'release/v5.3'
fix(esp_hw_support): clear the memory protection interrupt status on boot (backport v5.3)

See merge request espressif/esp-idf!38053
2025-07-16 17:06:48 +08:00
Jiang Jiang Jian
4871de8eb5 Merge branch 'fix/fix_esp32_core1_access_rtc_fast_in_sleep_code_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix esp32 APP_CPU accessing RTCFAST memory in sleep code (v5.3)

See merge request espressif/esp-idf!40558
2025-07-16 17:06:14 +08:00
Jiang Jiang Jian
e61d219be9 Merge branch 'fix/fix_dhcp_server_main_dns_set_issue' into 'release/v5.3'
fix(lwip): fix dhcp server set main dns issue

See merge request espressif/esp-idf!40592
2025-07-16 17:05:52 +08:00
wangtao@espressif.com
1958f16749 fix(lwip): fix dhcp server set main dns issue 2025-07-15 15:34:09 +08:00
Jiang Jiang Jian
330340870f Merge branch 'bugfix/fix_second_scan_error_in_smartconfig_v5.3' into 'release/v5.3'
fix(wifi): fix duplicated offchan error (v5.3)

See merge request espressif/esp-idf!40496
2025-07-14 14:36:43 +08:00
wuzhenghui
7ac245d489 fix(esp_hw_support): fix esp32 APP_CPU accessing RTCFAST memory in sleep code 2025-07-14 14:07:55 +08:00
Island
c464a58954 Merge branch 'feat/ble_log_spi_out_dev_phase_4_v5.3' into 'release/v5.3'
BLE Log SPI Out Dev Phase 4 (v5.3)

See merge request espressif/esp-idf!40424
2025-07-14 11:48:25 +08:00
Rahul Tank
c05b43a907 fix(nimble): Add a way to make blufi advertising customizable
Based on changes in https://github.com/espressif/esp-idf/pull/8958
2025-07-11 15:30:14 +05:30
Island
45324d6ba9 Merge branch 'change/ble_update_lib_20250709_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250709 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!40469
2025-07-11 10:47:35 +08:00
zhangyanjiao
b995743aad fix(wifi): fix duplicated offchan error 2025-07-10 15:59:48 +08:00
akshat
76455646a0 bugfix(wifi): Define ETH_ALEN for IPV6 Communication Type 2025-07-10 09:56:52 +05:30
akshat
d39dd3a7b1 bugfix(wifi): Enable IPv6 support via LWIP_IPV6 when WiFi Aware(NAN) is enabled 2025-07-10 09:56:25 +05:30
Ashish Sharma
dfc4368a04 feat(mbedtls): adds support for RSA decryption with DS peripheral 2025-07-10 11:24:56 +08:00
Zhou Xiao
d0d314ae52 fix(ble): updated rom linker script for ESP32-C2
(cherry picked from commit f1838aeec1)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-09 13:14:31 +08:00
Zhou Xiao
2802c6d933 feat(ble): enable broker initialization on ESP32-C6
(cherry picked from commit 3d93ce37da)

Co-authored-by: cjin <jinchen@espressif.com>
2025-07-09 13:14:29 +08:00
Zhou Xiao
493e6431b7 feat(ble): enable broker initialization on ESP32-H2
(cherry picked from commit 64f216ae5a)

Co-authored-by: cjin <jinchen@espressif.com>
2025-07-09 13:14:26 +08:00
Zhou Xiao
3321892ee8 feat(ble): support memory allocation check debug feature on ESP32-H2
(cherry picked from commit 265a8746dc)

Co-authored-by: cjin <jinchen@espressif.com>
2025-07-09 13:14:24 +08:00
Zhou Xiao
825c55e5d0 feat(ble): support memory allocation check debug feature on ESP32-C6
(cherry picked from commit 027766e0c2)

Co-authored-by: cjin <jinchen@espressif.com>
2025-07-09 13:14:21 +08:00
Zhou Xiao
84151af576 feat(ble): support memory allocation check debug feature on ESP32-C2
(cherry picked from commit 7ef90d4113)

Co-authored-by: cjin <jinchen@espressif.com>
2025-07-09 13:14:19 +08:00
Zhou Xiao
15f2c4c907 change(ble): [AUTO_MR] Update lib_esp32c2 to c7732d48
(cherry picked from commit 3d45e8578e)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-09 13:14:16 +08:00
Zhou Xiao
545d4a88d6 change(ble): [AUTO_MR] Update lib_esp32c6 to ca6c20bc
(cherry picked from commit 1e236a1feb)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-09 13:14:14 +08:00
Zhou Xiao
5352ab9fdc change(ble): [AUTO_MR] Update lib_esp32h2 to ca6c20bc
(cherry picked from commit 6a650312d4)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-09 13:14:12 +08:00
Chen Jian Hua
377093b2d1 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(2edb0b0)
- Fixed TX issue when the event is aborted
- Fixed BLE assert llc_llcp.c 487
- Fixed BLE assert sch_prog.c 304
- Fixed anonymous extended adv reporting
- Support vendor HCI related params reset


(cherry picked from commit ad71a2cd33)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2025-07-08 13:33:28 +08:00
Zhou Xiao
c71c773b56 change(ble): upgraded spi log frame header
(cherry picked from commit 5f3ac91d63)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:54 +08:00
Zhou Xiao
44e22612c4 fix(ble): nimble host & hci log write race condition workaround
(cherry picked from commit 6e384644c8)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:52 +08:00
Zhou Xiao
63ef4e46a9 change(ble): support task buffer number configuration
(cherry picked from commit 4946a1fe8d)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:50 +08:00
Zhou Xiao
32d0cfecb4 fix(ble): update error code in controller init for ESP32-S3/ESP32-C3
(cherry picked from commit b8b7e153a7)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:48 +08:00
Zhou Xiao
fe4fe5c4d6 fix(ble): fixed controller log api call for ESP32-C3/ESP32-S3
(cherry picked from commit 6ac541aa4a)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:45 +08:00
Zhou Xiao
62af3ef98c change(ble): removed esp log to save code size
(cherry picked from commit 0088541f54)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:43 +08:00
Zhou Xiao
81ac2ad181 change(ble): enable hci log spi out for ESP chips
(cherry picked from commit c60dd1a10e)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:41 +08:00
Zhou Xiao
eceb1ff65b change(ble): enable bluedroid logs over debug level through spi output
(cherry picked from commit c0d2792b9d)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:38 +08:00
Zhou Xiao
f8f78642a8 feat(ble): support ble mesh log module
(cherry picked from commit 066e1d3f1b)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:36 +08:00
Zhou Xiao
aca983d55f feat(ble): support host & hci log module
(cherry picked from commit dd4cbe5e00)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:34 +08:00
Zhou Xiao
91dfe4b75f change(ble): replaced ul log codes with template
(cherry picked from commit d353bf2802)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:31 +08:00
Zhou Xiao
ad8f75b984 change(ble): replaced le audio log codes with template
(cherry picked from commit feaee0a6fe)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:29 +08:00
Zhou Xiao
77ad9c0311 change(ble): implemented log module template
(cherry picked from commit 8b2c176eff)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:26 +08:00
Zhou Xiao
c4ebf09077 change(ble): updated ble log spi out ts sync module
* use freertos ts instead of esp ts for better performance
* enable ts sync sleep support by default
* use esp ts as fallback of lc time getter


(cherry picked from commit 56e42be859)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:14:24 +08:00
gongyantao
eeb73d27ab fix(bt): fixed the incorrect unit of clk in cpb rx event 2025-07-07 14:53:17 +08:00
renpeiying
41d586a8f4 docs: Update CN translation for esp_http_ota.rst 2025-07-04 17:50:54 +08:00
Ashish Sharma
ed72c372a1 docs(system/esp_https_ota): adds ECIES-256 to pre-enc ota design doc 2025-07-04 17:50:54 +08:00
Ashish Sharma
256145a1fe feat(mbedtls): update to version 3.6.4 2025-07-04 17:36:31 +08:00
xiongweichao
b23cf5c696 fix(ble): keep the log of the bluetooth sleep clock source consistent 2025-07-04 10:31:11 +08:00
Rahul Tank
6ce12f688e fix(nimble): Handle 0x3e disconnect during rem feat/ read version 2025-07-03 12:54:19 +05:30
armando
f2629ca384 doc(flash): updated 32bit addr support doc 2025-07-03 14:07:49 +08:00
Jiang Jiang Jian
e3eeb9d79c Merge branch 'feat/remove-unecessray-condition-in-usj-read_v5.3' into 'release/v5.3'
fix(driver): remove unecessary if conditions in the read function (v5.3)

See merge request espressif/esp-idf!39945
2025-07-02 23:55:26 +08:00
Jiang Jiang Jian
6a4ab82bad Merge branch 'fix/tcm-mem-not-considered-in-esp_ptr_eexecutable_v5.3' into 'release/v5.3'
fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible (v5.3)

See merge request espressif/esp-idf!39985
2025-07-02 23:55:03 +08:00
Jiang Jiang Jian
37db553e7e Merge branch 'change/ble_update_lib_20250630_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250630 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!40299
2025-07-02 23:34:10 +08:00
Jiang Jiang Jian
19c46bdbf7 Merge branch 'feature/gcc-fanalyzer_v5.3' into 'release/v5.3'
feat(ci): add gnu static analyzer job (v5.3)

See merge request espressif/esp-idf!32982
2025-07-02 22:12:08 +08:00
Alexey Lapshin
47aaedeb94 fix(usb): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Alexey Lapshin
a4e827bedd fix(wpa_supplicant): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Alexey Lapshin
fa83f6dd4e fix(vfs): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Alexey Lapshin
a8ed9e4ce8 fix(heap): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Alexey Lapshin
6c4dac64a7 fix(esp_mm): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Alexey Lapshin
4a0c96beb1 fix(esp_hw_support): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Alexey Lapshin
ae892ccd5a fix(esp_driver_usb_serial_jtag): fix warnings found by GNU static analyzer 2025-07-02 20:30:30 +08:00
Jiang Jiang Jian
dcaef8f08c Merge branch 'feature/update-gdb-to-16.2_20250324_v5.3' into 'release/v5.3'
feat(tools): update gdb version to 16.2_20250324 (v5.3)

See merge request espressif/esp-idf!39336
2025-07-02 20:29:40 +08:00
Chen Jichang
ba0a08a1d0 fix(pcnt): fix the accum_value missing when overflow 2025-07-02 20:14:37 +08:00
Rahul Tank
e2c9605f72 Merge branch 'bugfix/add_missing_unlock_v5.3' into 'release/v5.3'
fix(nimble): Add missing ble_hs_unlock() call (v5.3)

See merge request espressif/esp-idf!40235
2025-07-02 16:24:06 +05:30
Zhao Wei Liang
0dba389a1c fix(ble): ensure ble controller disable safety for ESP32-C2
(cherry picked from commit cbe6f68d3c)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-02 15:14:04 +08:00
Zhao Wei Liang
f330a3c631 fix(ble): fixed occasional assert triggered during controller disable on ESP32-C2
(cherry picked from commit 7b1a7cc4c3)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-02 15:14:02 +08:00
Zhao Wei Liang
65b2b60aa2 change(ble): [AUTO_MR] Update lib_esp32c2 to 9af627ef
(cherry picked from commit 6fac09d0c3)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-02 15:13:59 +08:00
Zhao Wei Liang
49fbf68cf6 change(ble): [AUTO_MR] Update lib_esp32c6 to d2d70d40
(cherry picked from commit 736cd84967)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-02 15:13:57 +08:00
Zhao Wei Liang
09f0c98c38 change(ble): [AUTO_MR] Update lib_esp32h2 to d2d70d40
(cherry picked from commit 1671932345)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-02 15:13:55 +08:00
John Boiles
ab14bbaa00 fix(memory-utils): Use esp_ptr_in_tcm to check TCM range 2025-07-02 08:56:13 +02:00
John Boiles
0916afabae fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible
Modifies `esp_ptr_internal` and `esp_ptr_byte_accessible` to also check TCM
when `SOC_MEM_TCM_SUPPORTED`.
2025-07-02 08:56:13 +02:00
Guillaume Souchere
422dd808e4 feat(usb_serial_jtag): Update vfs read to be POSIX compliant
The function now returns with available data in blocking mode
instead of waiting for the requested size to be available before
returning.
2025-07-02 08:55:38 +02:00
Guillaume Souchere
d9c001cbc1 feat(usb_cdc): Update vfs read() to comply with POSIX standards 2025-07-02 08:55:38 +02:00
Guillaume Souchere
12427a8b21 feat(usb_serial_tag_vfs): Add test for read exit conditions
Add a test to make sure the VFS read does not return on reception
of the \n character
2025-07-02 08:55:38 +02:00
Guillaume Souchere
68042bbf4b fix(driver): remove unecessary if conditions in the read function
This changes affect usb_serial_jtag_vfs and cdcacm_vfs read functions.
This commit removes the exit condition on reception of \n character.
2025-07-02 08:55:38 +02:00
Jiang Jiang Jian
62e28e3c74 Merge branch 'contrib/github_pr_15057_v5.3' into 'release/v5.3'
feat(dhcps): Support for multiple DNS servers (GitHub PR) (v5.3)

See merge request espressif/esp-idf!39268
2025-07-02 14:32:31 +08:00
Jiang Jiang Jian
c7a31ce888 Merge branch 'bugfix/esp_flash_escape_checking_v5.3' into 'release/v5.3'
fix(esp_flash): fixed issue of escaping boundary check (v5.3)

See merge request espressif/esp-idf!40119
2025-07-02 14:29:59 +08:00
Jiang Jiang Jian
0de3c919c1 Merge branch 'fix/sdmmc_write_sectors_dma_always_send_cmd13_v5.3' into 'release/v5.3'
fix(sdmmc): sdmmc_write_sectors_dma always check card status after write (v5.3)

See merge request espressif/esp-idf!34341
2025-07-02 14:00:55 +08:00
Jiang Jiang Jian
39d5b3ce75 Merge branch 'fix/netif_ppp_dhcp_v5.3' into 'release/v5.3'
fix(esp_netif): Fix incorrect DHCP call for PPP interfaces (v5.3)

See merge request espressif/esp-idf!40240
2025-07-02 13:58:07 +08:00
Jiang Jiang Jian
8752e3fe80 Merge branch 'feat/enable_wakeup_tests_for_more_chips_v5.3' into 'release/v5.3'
feat(esp_hw_support): enable wakeup tests for more chips (v5.3)

See merge request espressif/esp-idf!40047
2025-07-02 13:57:48 +08:00
morris
a228b4c744 Merge branch 'feature/usb_dual_host_2_backport_v5.3' into 'release/v5.3'
feat(usb/host): Add option to choose peripheral for USB host library (backport v5.3)

See merge request espressif/esp-idf!39723
2025-07-02 12:09:57 +08:00
Alexey Lapshin
76fb19dde4 fix(gdbstub): remove QThreadEvents+ from qSupported 2025-07-02 10:11:45 +07:00
Alexey Lapshin
78dae867b5 feat(tools): update gdb version to 16.2_20250324 2025-07-02 10:56:40 +08:00
Jiang Jiang Jian
487e9e496e Merge branch 'bugfix/fix_dvp_recv_trans_buf_error_v5.3' into 'release/v5.3'
fix(esp_driver_cam): Fix DVP get trans buffer error (v5.3)

See merge request espressif/esp-idf!40138
2025-07-02 10:50:43 +08:00
Jiang Jiang Jian
fe631a74ab Merge branch 'fix/intr_alloc_level_bug_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix a bug in the interrupt allocator related to shared interrupts (backport v5.3)

See merge request espressif/esp-idf!35496
2025-07-02 10:45:36 +08:00
Jiang Jiang Jian
14fc801093 Merge branch 'fix/sdspi_cmd52_error_v5.3' into 'release/v5.3'
fix(sdmmc): fix sdmmc initialization issue caused by CMD52 CRC error (v5.3)

See merge request espressif/esp-idf!40284
2025-07-02 10:43:19 +08:00
Jiang Jiang Jian
8856e6ea01 Merge branch 'fix/ensure_internal_mem_for_ble_log_spi_out_v5.3' into 'release/v5.3'
fix(ble): ensure internal malloc in ble log spi out (v5.3)

See merge request espressif/esp-idf!40181
2025-07-02 10:34:31 +08:00
Jiang Jiang Jian
bf79937908 Merge branch 'feat/adding_hidden_config_for_dynamic_buffer_control_configuration_v5.3' into 'release/v5.3'
feat(esp_tls): Added hidden config in esp-tls for dynamic buffer strategy configuration (v5.3)

See merge request espressif/esp-idf!40267
2025-07-02 10:22:58 +08:00
Jiang Jiang Jian
c7f4ebdfa5 Merge branch 'bugfix/fix_some_wifi_bugs_250623_v5.3' into 'release/v5.3'
Bugfix/fix some wifi bugs 250623 v5.3

See merge request espressif/esp-idf!40188
2025-07-02 10:14:05 +08:00
Sergei Silnov
5131642da8 Merge branch 'ci/raise_macos_cache_to_50g_v5.3' into 'release/v5.3'
macOS runners - set CCACHE back to 50GB to help VMs (v5.3)

See merge request espressif/esp-idf!40277
2025-07-01 13:30:04 -03:00
Jiang Jiang Jian
f58d6da3ed Merge branch 'bugfix/add_the_cve_2025_52471_to_list_v5.3' into 'release/v5.3'
fix(wifi): Added CVE-2025-52471 to vulnerabilities list (v5.3)

See merge request espressif/esp-idf!40208
2025-07-01 20:36:33 +08:00
sonika.rathi
b9e276ff94 fix(sdmmc): fix sdmmc initialization issue in caused by CMD52 CRC error 2025-07-01 13:41:11 +02:00
Peter Macko
3b0c6b279c ci: macOS runners - set CCACHE back to 50GB to help VMs 2025-07-01 13:02:32 +02:00
Marius Vikhammer
62b365569d feat(lp_core): added support for LP-IO as LP-core wakeup source 2025-07-01 17:57:42 +08:00
Alexey Gerenkov
de2e218a3a Merge branch 'fix/apptrace_crc_calculation_v5.3' into 'release/v5.3'
fix(apptrace): calculate crc16 of the current block before swap (v5.3)

See merge request espressif/esp-idf!40250
2025-07-01 17:48:47 +08:00
Shu Chen
b9460c59c1 Merge branch 'fix_br_selfhosted_address_v5.3' into 'release/v5.3'
feat(openthread): move mesh local address judeging function to public (v5.3)

See merge request espressif/esp-idf!40258
2025-07-01 06:30:23 +00:00
hrushikesh.bhosale
22c26ac049 feat(esp_tls): Added hidden config in esp-tls for dynamic buffer strategy configuration
Added the hidden config in the esp-tls component for the dynamic buffer
strategy configuration feature. So that external components like ota
can findout whether this feature is supported or not
2025-07-01 11:53:09 +05:30
zhangyanjiao
240e9810c9 fix(wifi): Added CVE-2025-52471 to vulnerabilities list 2025-07-01 14:16:49 +08:00
zhangyanjiao
1f5abb42bc fix(wifi): Added CVE-2024-53845 to vulnerabilities list 2025-07-01 14:16:49 +08:00
Mahavir Jain
2979fc288b docs: add page to summarize the security vulnerabilities and advisories 2025-07-01 14:16:43 +08:00
Jiang Jiang Jian
b005bcc53b Merge branch 'feat/smaller_release_size_v5.3' into 'release/v5.3'
ci: Use new release-zips-action with shallow history (v5.3)

See merge request espressif/esp-idf!39940
2025-07-01 14:08:10 +08:00
Omar Chebib
59eae71414 fix(esp_hw_support): fix a bug in the interrupt allocator related to shared interrupts
On RISC-V targets, when allocating a shared interrupt, the provided level would
override the current level of the allocated interrupt. As such, a medium level
interrupt could become a low level one and vice versa.
2025-07-01 13:49:26 +08:00
Mahavir Jain
fd5af4bf69 Merge branch 'docs/fix_secure_download_mode_unsupported_esp32_v5.3' into 'release/v5.3'
fix(bootloader): Fix documentation as ESP32 does not support secure download mode (v5.3)

See merge request espressif/esp-idf!40215
2025-07-01 10:36:23 +05:30
wanckl
77eff50f99 fix(driver_spi): master driver change esp32p4 default src to pll 2025-07-01 11:35:21 +08:00
Chen Dejin
f0b9769955 fix(openthread/discovery): use mesh local for self-hosted service if OMR is not preferred
* esp-openthread: thread_zigbee/esp-openthread@f54481eb0
* openthread: espressif/openthread@b945928d7
* esp-idf: espressif/esp-idf@31fde3403
2025-07-01 02:58:21 +00:00
chendejin
31fde34037 feat(openthread): move mesh local address judeging function to public 2025-07-01 10:49:04 +08:00
Abhik Roy
b25ea94c45 fix(dhcps): Fixed DNS server handling for previous breaking changes 2025-07-01 10:29:11 +08:00
Lorenzo Consolaro
a5e37f8cdf feat(dhcps): Support for multiple DNS servers 2025-07-01 10:29:11 +08:00
Shu Chen
838a24e7f6 Merge branch 'feat/rcp_over_usb_v5.3' into 'release/v5.3'
feat(openthread): support rcp based on USB Serial JTAG (v5.3)

See merge request espressif/esp-idf!40247
2025-07-01 02:10:32 +00:00
Erhan Kurubas
4e18115483 fix(apptrace): calculate crc16 of the current block before swap 2025-06-30 14:38:19 +02:00
Simonas Kazlauskas
c400fb4ff6 feat(openthread): support rcp based on USB Serial JTAG 2025-06-30 20:17:03 +08:00
Roland Dobai
6ce783f89c Merge branch 'feat/update_ccache_to_4.11.2_v5.3' into 'release/v5.3'
feat(tools): Update ccache 4.10.2 -> 4.11.2 (v5.3)

See merge request espressif/esp-idf!39574
2025-06-30 13:20:04 +02:00
David Cermak
f8aa0fcb6a fix(esp_netif): Fix incorrect DHCP call for PPP interfaces
Closes https://github.com/espressif/esp-protocols/issues/800
2025-06-30 12:21:46 +02:00
sibeibei
74c3f70e8e fix(wifi): rx bcn failed when sta off channel under modem state 2025-06-30 18:10:05 +08:00
Rahul Tank
11f3b141b4 fix(nimble): Add missing ble_hs_unlock() call 2025-06-30 15:21:04 +05:30
Roland Dobai
4c68cdec62 Merge branch 'change/support_lowercase_kconfig_filename_v5.3' into 'release/v5.3'
Backport: Support misspelled Kconfig[.projbuild] files (v5.3)

See merge request espressif/esp-idf!39584
2025-06-30 11:49:37 +02:00
Marek Fiala
be7070611d feat(tools): Update ccache 4.10.2 -> 4.11.2
Closes https://github.com/espressif/idf-installer/issues/305
2025-06-30 17:48:00 +08:00
Li Shuai
72009edd6f fix(esp_hw_support): fix modem wakeup req always high caused by pmu min slp cycle update 2025-06-30 16:32:37 +08:00
Li Shuai
03ba1cfb8b change(esp_hw_support): add interface to calculate slow clock period by clock frequency 2025-06-30 16:32:37 +08:00
sibeibei
6da81c80c0 fix(wifi):fix modem state rx bcn failed when tbtt update, support modem state for coexist 2025-06-30 16:32:37 +08:00
liuning
c309d9e4d9 feat(docs): update connectionless module window syncronization documentation 2025-06-30 16:32:36 +08:00
wangtao@espressif.com
38a96587f2 fix(wifi): add check for esp_wifi_set_config 2025-06-30 16:32:36 +08:00
liuning
40fe7efe33 fix(wifi): fix cant sleep if connection breaks during sending probe 2025-06-30 16:32:36 +08:00
morris
86ccf6354f Merge branch 'change/remove_mmap_paddr_remap_warning_log_v5.3' into 'release/v5.3'
mmu: remove paddr remap warning log (v5.3)

See merge request espressif/esp-idf!40205
2025-06-30 16:06:57 +08:00
Zhang Shuxian
eda1becb44 docs: Update CN for usb_host.rst 2025-06-30 14:45:59 +08:00
Tomas Rezucha
4addf21286 feat(usb/host): Add option to choose peripheral for USB host library
Starting with ESP32-P4 we can have targets that have more than 1 USB-OTG peripheral.
This commit adds an option to choose which peripherals will be used by USB Host lib.

Internally, we will still have only 1 Root HUB but with multiple Root ports.

# Conflicts:
#	components/usb/host_test/usb_host_layer_test/main/usb_host_install_unit_test.cpp
#	components/usb/hub.c
#	components/usb/test_apps/common/phy_common.c
#	components/usb/test_apps/common/phy_common.h
#	components/usb/test_apps/hcd/main/test_hcd_common.c
#	components/usb/test_apps/usb_host/main/test_app_main.c
#	components/usb/usb_host.c
2025-06-30 14:45:59 +08:00
harshal.patil
748d29c394 fix(bootlaoder): Fix documentation as ESP32 does not support secure download mode 2025-06-30 10:27:30 +05:30
Jiang Jiang Jian
02447c9e0d Merge branch 'fix/improve_tcp_performance_v53' into 'release/v5.3'
fix(wifi): improve esp32c2 and esp32s2 tcp performance

See merge request espressif/esp-idf!40154
2025-06-30 11:08:36 +08:00
armando
55f91f78d8 change(mmu): remove paddr remap warning log 2025-06-30 10:51:25 +08:00
Jiang Jiang Jian
de842b0694 Merge branch 'feature/softAP_sae_ext_key_v5.3' into 'release/v5.3'
Add SAE-EXT-KEY feature on softAP (release/v5.3)

See merge request espressif/esp-idf!40080
2025-06-30 10:38:43 +08:00
Zhou Xiao
b1a7241a8a fix(ble): ensure internal malloc in ble log spi out 2025-06-30 10:32:37 +08:00
Adam Múdry
df1a14bd96 fix(sdmmc): Send status (CMD13) even if write/read command fails 2025-06-27 13:54:45 +08:00
Adam Múdry
9b3cebf741 fix(sdmmc): Improve SD card state checking after write/read command 2025-06-27 13:54:45 +08:00
Island
c5f689649e Merge branch 'change/ble_update_lib_20250613_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250613 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!40159
2025-06-27 11:10:12 +08:00
Kapil Gupta
7d3734065a fix(esp_wifi): Set default ap mgmt cipher 2025-06-26 15:46:33 +05:30
cjin
e6b5188f5f feat(ble): add sm count reserve cnt setting on ESP32-H2 2025-06-26 15:03:09 +08:00
cjin
84eb3f5821 feat(ble): add sm count reserve cnt setting on ESP32-C6 2025-06-26 15:03:09 +08:00
cjin
d06b73a2c4 change(ble): update lib_esp32c6 to ea6c58c7 2025-06-26 15:03:09 +08:00
cjin
dc67130238 change(ble): update lib_esp32h2 to ea6c58c7 2025-06-26 15:03:09 +08:00
Zhou Xiao
9a48a7e2bd change(ble): [AUTO_MR] Update lib_esp32c6 to b8770ab2 2025-06-26 15:03:09 +08:00
Zhou Xiao
07f78c01b5 change(ble): [AUTO_MR] Update lib_esp32c2 to e865b4f9 2025-06-26 15:03:09 +08:00
Zhou Xiao
20de9b641a change(ble): [AUTO_MR] Update lib_esp32h2 to b8770ab2 2025-06-26 15:03:09 +08:00
wangtao@espressif.com
c3798f5c7a fix(wifi): improve esp32c2 and esp32s2 tcp performance 2025-06-26 11:11:42 +08:00
tarun.kumar
6094d14616 fix(wifi): Made changes in api for sending bcast deauth frames 2025-06-25 16:14:13 +05:30
tarun.kumar
7dba716272 fix(wifi): Resolve out-of-bounds memory access in ieee80211w_kde_add 2025-06-25 16:14:13 +05:30
tarun.kumar
5c9d2bbc0d feat(wifi): Add SAE-EXT-KEY feature on softAP 2025-06-25 16:14:13 +05:30
Island
bcba4339d4 Merge branch 'feat/add_cte_iq_report_example_v5.3' into 'release/v5.3'
Add Bluetooth LE CTE connless example. (v5.3)

See merge request espressif/esp-idf!39781
2025-06-25 17:09:34 +08:00
Aditya Patwardhan
cddc6685f1 Merge branch 'feature/enable_support_for_deterministic_mode_and_ecdsa_192_v5.3' into 'release/v5.3'
Feature/enable support for deterministic mode and ecdsa 192 v5.3

See merge request espressif/esp-idf!40102
2025-06-25 14:37:58 +05:30
Island
d7ec47f336 Merge branch 'bugfix/fix_some_ble_build_fail_v5.3' into 'release/v5.3'
fix(ble/bluedroid): fix build failure when some BLE features are disabled (v5.3)

See merge request espressif/esp-idf!40129
2025-06-25 16:25:12 +08:00
Jiang Jiang Jian
abf31e3c1a Merge branch 'bugfix/wpa2_suiteb_192bit_reason_code_v5.3' into 'release/v5.3'
Sending disconnect event in connect fail and add enterprise check...

See merge request espressif/esp-idf!40098
2025-06-25 16:23:07 +08:00
Dong Heng
65c340e36f fix(esp_driver_cam): Fix DVP get trans buffer error 2025-06-25 15:53:34 +08:00
Island
118dd9cdc4 Merge branch 'docs/update_ble_feature_status_latest_v5.3' into 'release/v5.3'
Updated BLE feature status (v5.3)

See merge request espressif/esp-idf!38990
2025-06-25 14:35:05 +08:00
tarun.kumar
c8eeb28f5e fix(wifi): Sending disconnect event in connect fail and add enterprise check in Suite-B 192-bit certification 2025-06-25 11:59:17 +05:30
Zhang Shuxian
0378ed1cc1 docs: Update CN translation for ecdsa.rst 2025-06-25 10:51:13 +05:30
nilesh.kale
2a6e018ee8 feat: enable support for deterministic mode for esp32h2 2025-06-25 10:51:01 +05:30
Zhang Hai Peng
77a6c6c979 fix(ble/bluedroid): fix build failure when some BLE features are disabled
(cherry picked from commit a29cd4ad5f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-06-25 11:53:36 +08:00
Geng Yu Chao
e3bac054e3 feat(ble): Add Bluetooth LE CTE connectionless AoA/AoD examples
(cherry picked from commit d8631ed3db)

Co-authored-by: Geng Yuchao <gengyuchao@espressif.com>
2025-06-25 11:49:28 +08:00
Wei Yuhan
86beac2bca Update BLE feature status table 2025-06-25 11:45:14 +08:00
Mahavir Jain
abe692eeaf Merge branch 'feat/adding_different_strategy_to_perform_tls_using_dynamic_feature_v5.3' into 'release/v5.3'
Add configuration to control dynamic buffer strategy in mbedtls (v5.3)

See merge request espressif/esp-idf!39921
2025-06-25 08:58:08 +05:30
Jiang Jiang Jian
717be30714 Merge branch 'bugfix/scan_stop_when_conenct_v5.3' into 'release/v5.3'
fix(esp_wifi): Fix locking in incorrect state when stop_scan is called after connect

See merge request espressif/esp-idf!39483
2025-06-25 10:45:12 +08:00
Shu Chen
3b10897b38 Merge branch 'feat/call_meshcop_mdns_publish_in_idf_v5.3' into 'release/v5.3'
Handle MeshCoP mDNS service in state change callback, update OpenThread upstream (v5.3)

See merge request espressif/esp-idf!40084
2025-06-25 02:28:41 +00:00
Xiao Xufeng
0cb4e3dfe1 fix(esp_flash): fixed issue of escaping boundary check
Also patched corresponding ROM functions
2025-06-25 01:40:40 +08:00
Michael (XIAO Xufeng)
a81456e0d0 Merge branch 'fix/fix_c3_c2_cache_freeze_soc_caps_issue_v5.3' into 'release/v5.3'
cache: fixed SOC_CACHE_FREEZE_SUPPORTED not defined on C3 / C2 issue (v5.3)

See merge request espressif/esp-idf!39884
2025-06-24 23:14:11 +08:00
hrushikesh.bhosale
636eb4b62f feat(mbedtls): Add configuration to control dynamic buffer strategy in mbedtls
Problem:
1. In low-memory scenarios, the dynamic buffer feature can fail due to memory fragmentation.
2. It requires a contiguous 16KB heap chunk, but continuous allocation and deallocation of
the RX buffer can lead to fragmentation.
3. If another component allocates memory between these operations, it can break up the
available 16KB block, causing allocation failure.

Solution:
1. Introduce configurable strategy for using dynamic buffers in TLS connections.
2. For example, convert RX buffers to static after the TLS handshake.
3. Allow users to select the strategy via a new field in the esp_http_client_cfg_t structure.
4. The strategy can be controlled independently for each TLS session.
2025-06-24 17:44:04 +05:30
Jiang Jiang Jian
2bfcab5047 Merge branch 'bugfix/connect_before_connected_v5.3' into 'release/v5.3'
fix(conn): wifi connect before connected status (v5.3)

See merge request espressif/esp-idf!40101
2025-06-24 19:18:55 +08:00
Xu Si Yu
72ae6874f3 feat(openthread): update border router lib
* esp-openthread: thread_zigbee/esp-openthread@16bfed5ec
* openthread: espressif/openthread@b945928d7
* esp-idf: espressif/esp-idf@5ca96df4a
2025-06-24 10:53:29 +00:00
Xu Si Yu
5ca96df4a2 feat(openthread): update openthread upstream 2025-06-24 18:47:43 +08:00
Xu Si Yu
70a35ac19b feat(openthread): handle MeshCoP mDNS service in state change callback 2025-06-24 18:47:43 +08:00
Xu Si Yu
8142a4d318 feat(openthread): optimize trel reception 2025-06-24 18:47:43 +08:00
Shu Chen
d8d15f0491 Merge branch 'ci/fix-submodule-cache_v5.3' into 'release/v5.3'
ci: remove cached submodule metadata while checking with github (v5.3)

See merge request espressif/esp-idf!40095
2025-06-24 10:45:57 +00:00
Wang Meng Yang
b0781fe4eb Merge branch 'bugfix/auth_collision_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed bugs on LMP legacy and secure authentication collision (v5.3)

See merge request espressif/esp-idf!40012
2025-06-24 17:53:32 +08:00
nilesh.kale
19fcf0e073 feat: enabled ECDSA-P192 support for ESP32H2 2025-06-24 15:03:59 +05:30
ding huan
635c6520ef fix(conn): wifi connect before connected status 2025-06-24 17:07:06 +08:00
Fu Hanxi
f3b34988ea ci: remove cached submodule metadata while checking with github 2025-06-24 10:55:39 +02:00
Shreyas Sheth
04f68ec534 fix(esp_wifi): Fix locking in incorrect state when stop_scan is called after connect 2025-06-24 13:45:34 +05:30
armando
2784693977 fix(cache): fixed SOC_CACHE_FREEZE_SUPPORTED not defined on c3/c2 issue 2025-06-24 15:44:56 +08:00
liqigan
4b81bad597 fix(bt/controller): Fixed bugs on LMP legacy and secure authentication collision 2025-06-24 14:46:53 +08:00
morris
c60f52b724 Merge branch 'contrib/github_pr_16130_v5.3' into 'release/v5.3'
esp_adc: Release the peripheral after calibration (GitHub PR) (v5.3)

See merge request espressif/esp-idf!40003
2025-06-24 12:18:09 +08:00
morris
aed007c26a Merge branch 'camera/add_dvp_example_v5.3' into 'release/v5.3'
P4 DVP example and bugfix (v5.3)

See merge request espressif/esp-idf!39910
2025-06-24 11:53:11 +08:00
gaoxu
216cf17fc1 fix(adc): fix P4 ADC2 oneshot error and refactor apb claim macor 2025-06-24 10:33:59 +08:00
morris
f15d0e8bbb Merge branch 'refactor/migrate_i2c_driver_in_es7210_example_v5.3' into 'release/v5.3'
refactor(i2s_es7210): refactor es7210 example (v5.3)

See merge request espressif/esp-idf!40068
2025-06-23 21:55:15 +08:00
laokaiyao
d99b7f5701 refactor(i2s_es7210): refactor es7210 example 2025-06-23 20:39:26 +08:00
Jiang Jiang Jian
778e50116e Merge branch 'feat/impl_bt_coex_timer_event_v5.3' into 'release/v5.3'
feat(coex): impl bt coex timer event (Backport v5.3)

See merge request espressif/esp-idf!40028
2025-06-23 20:38:19 +08:00
Jiang Jiang Jian
4baebdcdc0 Merge branch 'bugfix/fix_some_external_coexist_issues_v5.3' into 'release/v5.3'
fix(coex): fix some external coexist issue(Backport v5.3)

See merge request espressif/esp-idf!40016
2025-06-23 19:55:18 +08:00
gaoxu
724c28c405 feat(cam): add cam sensor handle and deinit api 2025-06-23 16:17:59 +08:00
gaoxu
bdfcd6b2c1 docs(camera): add lcd_cam dvp driver docs for camera 2025-06-23 16:17:59 +08:00
gaoxu
1ba2bf3152 fix(cam): fix dvp do not generate clock 2025-06-23 16:17:59 +08:00
gaoxu
102d57f858 feat(cam): add esp32p4 dvp example 2025-06-23 16:17:57 +08:00
linruihao
c61ca564d7 fix(coex): Fix ble disconnect when coexisting wifi on esp32c2 2025-06-23 15:30:29 +08:00
linruihao
16436f5cd5 feat(coex): implement BT coex timer event 2025-06-23 15:30:16 +08:00
muhaidong
f6c0f937bd fix(coex): fix some external coexist issue 2025-06-23 15:15:03 +08:00
Jiang Jiang Jian
96b3442c6d Merge branch 'fix/retry_cnt_issue_for_non_pmf_sta_v5.3' into 'release/v5.3'
fix(failure_retry_cnt): Prevent NON-PMF STA retries if esp_wifi_disconnect() before handshake (Backport v5.3)

See merge request espressif/esp-idf!39545
2025-06-23 14:29:25 +08:00
Jiang Jiang Jian
792f5c177d Merge branch 'feat/socket_count_checks_v5.3' into 'release/v5.3'
feat(network/lwip): Add checks for maximum socket count (v5.3)

See merge request espressif/esp-idf!38866
2025-06-23 13:56:42 +08:00
morris
0e9e85f993 Merge branch 'refactor/upgrade_i2s_codec_example_dependency_v5.3' into 'release/v5.3'
refactor(i2s_es8311): refactor es8311 example (v5.3)

See merge request espressif/esp-idf!40051
2025-06-23 13:41:10 +08:00
laokaiyao
f5422fcf0b refactor(i2s_es8311): remove esp-box bsp support 2025-06-23 12:20:44 +08:00
laokaiyao
84e0c81583 refactor(i2s_es8311): refactor es8311 example 2025-06-23 12:03:19 +08:00
Jiang Jiang Jian
9a8d1bf38f Merge branch 'bugfix/incorrect_sae_pk_flag_v5.3' into 'release/v5.3'
Disable SAE-PK indication in Assoc Request when not configured (Backport v5.3)

See merge request espressif/esp-idf!39076
2025-06-23 11:18:25 +08:00
Jiang Jiang Jian
7d6c319945 Merge branch 'docs/fetch-all-tags-while-deploying_v5.3' into 'release/v5.3'
docs: fetch all tags while deploying (v5.3)

See merge request espressif/esp-idf!40007
2025-06-23 10:53:14 +08:00
Jiang Jiang Jian
95f455cd97 Merge branch 'feat/support_fallback_to_default_pattern_when_psram_id_not_match_v5.3' into 'release/v5.3'
psram: support fallback to use default driver pattern when id isn't match (v5.3)

See merge request espressif/esp-idf!39996
2025-06-23 10:52:35 +08:00
Jiang Jiang Jian
dc625ba12b Merge branch 'refactor/p4_touch_channel_increase_1_v5.3' into 'release/v5.3'
refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14 (v5.3)

See merge request espressif/esp-idf!39793
2025-06-23 10:50:12 +08:00
Jiang Jiang Jian
7597b556a0 Merge branch 'refactor/change_mmap_cache_lock_type_v5.3' into 'release/v5.3'
mmu: use cache freeze for mmap APIs (v5.3)

See merge request espressif/esp-idf!39787
2025-06-23 10:49:55 +08:00
Island
c0783d6f05 Merge branch 'bugfix/fixed_set_conn_mode_assert_on_esp32c2_v5.3' into 'release/v5.3'
fix(ble): fixed assertion issue in connection state on ESP32C2-ECO4 (v5.3)

See merge request espressif/esp-idf!40022
2025-06-23 10:48:23 +08:00
Jiang Jiang Jian
0c7bd3e961 Merge branch 'fix/lp_periph_use_int_raw_v5.3' into 'release/v5.3'
change(lp-core): Update LP I2C and LP UART drivers to use raw interrupt status (v5.3)

See merge request espressif/esp-idf!39250
2025-06-23 10:42:43 +08:00
Tomáš Rohlínek
f27f0b10c7 feat(network/lwip): Add checks for maximum socket count 2025-06-23 10:41:15 +08:00
wuzhenghui
bd79398ec6 feat(esp_hw_support): enable wakeup tests for more chips 2025-06-23 10:01:24 +08:00
wuzhenghui
34035452af fix(hal): fix pmu_ll_ext1_clear_wakeup_status API 2025-06-23 10:00:52 +08:00
Roland Dobai
5028d9e0fa Merge branch 'fix/idf_tools_install_tool_version_v5.3' into 'release/v5.3'
fix(tools): fixed command `idf_tools.py install tool@version` (v5.3)

See merge request espressif/esp-idf!40039
2025-06-20 16:05:54 +02:00
Roland Dobai
4b013690b2 Merge branch 'ci/add-kconfig-pre-commit_v5.3' into 'release/v5.3'
docs:fix spelling/"casing" of the word "Kconfig" (v5.3)

See merge request espressif/esp-idf!40018
2025-06-20 15:52:16 +02:00
Marek Fiala
17346297e6 fix(tools): idf_tools.py uninstall decide based on preferred tool version
idf_tools.py uninstall now doesn't take only recommended version, but
makes the decision based on preferred installed versions.
2025-06-20 13:25:51 +02:00
Marek Fiala
207d728348 test(tools): Added test for installing supported tool version
Added test_export_supported_version_cmake in `test_idf_tools.py`,
that installs and exports supported version of tool - cmake.
2025-06-20 13:25:51 +02:00
Marek Fiala
dd60e20ea0 fix(tools): idf_tools.py install tool@version 2025-06-20 13:25:51 +02:00
Jiang Jiang Jian
231ee11bab Merge branch 'fix/update_dfs_compensate_table_v5.3' into 'release/v5.3'
fix(esp_hw_support): update esp32 dfs table to make the timing drift always negative (v5.3)

See merge request espressif/esp-idf!39898
2025-06-20 17:21:12 +08:00
Sarvesh Bodakhe
3f23211fe4 fix(wif): Prevent NON-PMF STA retries if esp_wifi_disconnect() before handshake
Ensure that NON-PMF station does not attemp connection retries when
'esp_wifi_disconnect()' is called before the 4-way-handshake completes,
even if 'failure_retry_cnt' allows retries.
2025-06-20 13:23:02 +05:30
Zhao Wei Liang
e98fd57bea fix(ble): fixed assertion issue in connection state on ESP32C2-ECO4
(cherry picked from commit 83fd955f11)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-20 15:31:29 +08:00
Jan Beran
ec612efa03 docs: Fix spelling of the word "Kconfig" 2025-06-20 09:19:43 +02:00
Fu Hanxi
e0703dfec8 docs: fetch all tags while deploying 2025-06-20 08:19:59 +02:00
Jiang Jiang Jian
84ddb4101f Merge branch 'fix/bootloader_reserved_area_alignment_v5.3' into 'release/v5.3'
fix(esp_system): fix RTC reserved area alignment in the linker script (backport v5.3)

See merge request espressif/esp-idf!39252
2025-06-20 10:57:11 +08:00
Jiang Jiang Jian
d2b851d72c Merge branch 'bugfix/wps_pbc_overlap_uuid_v5.3' into 'release/v5.3'
fix(wpa_supplicant): Ensure pbc_overlap event is posted correctly (Backport v5.3)

See merge request espressif/esp-idf!39057
2025-06-20 10:41:15 +08:00
Deomid rojer Ryabkov
704a4fd610 fix(esp_adc): Release the peripheral after calibration 2025-06-20 10:14:38 +08:00
armando
df9659dda2 feat(psram): support fallback to use default driver pattern when id isn't match 2025-06-20 09:38:43 +08:00
Jan Beran
88fec757d1 change: detect misspelled Kconfig[.projbuild] file names
Original issue: https://github.com/espressif/esp-idf-kconfig/issues/14
2025-06-19 16:05:10 +08:00
Jiang Jiang Jian
575007a244 Merge branch 'bugfix/ag_data_callback_cleared_after_deinit_v5.3' into 'release/v5.3'
fix(bt): Fixed HFP AG data callback cleared after profile is re-initialized (v5.3)

See merge request espressif/esp-idf!39975
2025-06-19 10:31:52 +08:00
Jiang Jiang Jian
5545ae09e0 Merge branch 'bugfix/onewire_internal_pullup_v5.3' into 'release/v5.3'
fix(rmt): enable internal pull-up resistor for onewire bus (v5.3)

See merge request espressif/esp-idf!39931
2025-06-19 10:31:04 +08:00
akshat
784d4d63ef fix(wpa_supplicant): Disconnect from previous AP while initiating WPS 2025-06-19 10:29:18 +08:00
akshat
fa2769f428 fix(wpa_supplicant): Detect PBC overlap even when UUID is null 2025-06-19 10:29:18 +08:00
akshat
7522fbafe7 fix(wpa_supplicant): Ensure pbc_overlap event is posted correctly
Preserves the pbc_overlap flag to allow proper event posting.
This ensures that pbc overlap detection functions as expected.
2025-06-19 10:29:18 +08:00
akshat
aa81dc647b bugfix(wifi): Fix incorrect SAE-PK advertisement in assoc request 2025-06-19 10:27:21 +08:00
Wang Mengyang
c71431df1b fix(bt): Fixed HFP AG data callback cleared after profile is re-initialized 2025-06-19 07:30:45 +08:00
Shu Chen
32e479c20f Merge branch 'fix/rx_abort_next_op_v5.3' into 'release/v5.3'
fix(openthread): disable rx_abort events in next operation (v5.3)

See merge request espressif/esp-idf!39960
2025-06-18 12:32:15 +00:00
Rahul Tank
be58299dcd Merge branch 'fix/gatt_cache_peer_init_incl_svc_v5.3' into 'release/v5.3'
fix(nimble): Added parameter in peer_init for included service allocation (v5.3)

See merge request espressif/esp-idf!39914
2025-06-18 16:25:14 +05:30
Aditya Patwardhan
96567cb17b Merge branch 'bugfix/http_client_test_failure_v5.3' into 'release/v5.3'
fix: update root certificate for postman-echo endpoint (v5.3)

See merge request espressif/esp-idf!39848
2025-06-18 14:16:04 +05:30
Tan Yan Quan
83e7d5fbd8 feat(openthread): use apb_freq_max mode for esp_openthread_sleep pm lock 2025-06-18 15:35:15 +08:00
Xu Si Yu
f5f6a217a3 feat(openthread): add some configurations in Kconfig 2025-06-18 15:35:15 +08:00
Tan Yan Quan
0535298ef7 fix(openthread): disable rx_abort events in next operation 2025-06-18 15:35:15 +08:00
Island
a5e7c6c7a7 Merge branch 'feat/ble_mesh_micellaneous_fix_v5.3' into 'release/v5.3'
Feat/ble mesh micellaneous fix (v5.3)

See merge request espressif/esp-idf!39636
2025-06-18 10:17:04 +08:00
Sergei Silnov
d2cb5330ed ci: Use new release-zips-action with shallow history 2025-06-17 11:27:49 +02:00
Omar Chebib
9a3fa8be12 fix(esp_hw_support): clear the memory protection interrupt status on boot
Fixes https://github.com/espressif/esp-idf/issues/15359
2025-06-17 16:50:21 +08:00
Omar Chebib
67b64ce555 fix(esp_system): fix RTC reserved area alignment in the linker script
Make sure the size of the RTC reserved area complies with the alignment requirement.

Closes https://github.com/espressif/esp-idf/issues/13082
2025-06-17 16:50:10 +08:00
morris
99562576f1 fix(rmt): enable internal pull-up resistor for onewire bus 2025-06-17 15:32:54 +08:00
Astha Verma
8fecf4b1c2 fix(nimble): Added parameter in peer_init for included service allocation 2025-06-17 11:58:31 +05:30
Rahul Tank
fed967df46 Merge branch 'feat/auto_security_initiate_v5.3' into 'release/v5.3'
feat(nimble): Automatically initiate security if a GATT service request fails (v5.3)

See merge request espressif/esp-idf!39865
2025-06-17 11:47:02 +05:30
morris
9f5cea4dd9 Merge branch 'fix/jpeg_encode_msync_v5.3' into 'release/v5.3'
fix(jpeg): Fix wrong parameter in jpeg encoder msync ,eliminate random black line on jpeg decoder (backport v5.3)

See merge request espressif/esp-idf!39889
2025-06-17 10:33:07 +08:00
morris
074a7306d4 Merge branch 'docs/p4_eco1_usb_pins_backport_v5.3' into 'release/v5.3'
docs(usb): Update ESP32-P4 USB pins to MP version (backport to v5.3)

See merge request espressif/esp-idf!39904
2025-06-17 10:32:26 +08:00
gaoxu
6eaba4e3f7 fix(cam): fix dvp can not get cam_buffer 2025-06-17 09:33:34 +08:00
gaoxu
e48a4147a0 fix(cam): decrease i2c sccb frequency for camera 2025-06-17 09:33:34 +08:00
Tomas Rezucha
6d28c1a5ba docs(usb): Update ESP32-P4 USB pins to MP version
Closes https://github.com/espressif/esp-idf/issues/16136
2025-06-16 16:39:08 +02:00
Sumeet Singh
0cdcf41916 feat(nimble): Added two GATT features:
1. Automatically initiate security if a GATT service request fails
2. Encryption, Authentication, and Authorization requirement on CCCD
2025-06-16 17:00:47 +05:30
Rahul Tank
cf343ab4e8 Merge branch 'fix/nimble_pr_issues_v5.3' into 'release/v5.3'
fix(nimble): Add fixes for compilation issues in nimble (v5.3)

See merge request espressif/esp-idf!39843
2025-06-16 15:45:08 +05:30
Island
84bbb92b9f Merge branch 'feat/add_ble_dtm_on_cert_test_v5.3' into 'release/v5.3'
feat(ble): add dtm test code to cert test example on ESP32-C6 (v5.3)

See merge request espressif/esp-idf!39833
2025-06-16 17:40:48 +08:00
wuzhenghui
80267209c7 change(bt): increase BTDM_MODEM_WAKE_UP_DELAY 2025-06-16 17:27:08 +08:00
wuzhenghui
e25f0faf89 change(esp_timer): make esp_timer timming drift always be negative 2025-06-16 17:27:08 +08:00
wuzhenghui
cc10f1e54a fix(esp_hw_support): config lact in critical 2025-06-16 17:27:08 +08:00
C.S.M
b9364776e7 bugfix(jpeg): eliminate random black line on jpeg decoder 2025-06-16 14:37:30 +08:00
C.S.M
7409674b09 fix(jpeg): Fix wrong parameter in jpeg encoder msync 2025-06-16 14:37:30 +08:00
laokaiyao
cd3572c55a fix(touch): fixed touch interval freq unit convert issue 2025-06-13 19:44:38 +08:00
laokaiyao
2cd4640666 fix(touch): fixed incorrect interval clock source 2025-06-13 19:44:38 +08:00
laokaiyao
565267ca34 refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14 2025-06-13 19:44:38 +08:00
Rahul Tank
34868cf387 Merge branch 'bugfix/pawr_sync_v5.3' into 'release/v5.3'
fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports (v5.3)

See merge request espressif/esp-idf!39717
2025-06-13 15:24:59 +05:30
Marius Vikhammer
fd806756ac Merge branch 'change/update-esp-event-register-doxygen_v5.3' into 'release/v5.3'
change(esp-event): Update the doxygen comment of esp_event_handler_register (v5.3)

See merge request espressif/esp-idf!39855
2025-06-13 17:17:16 +08:00
Guillaume Souchere
ede772445f change(esp-event): Update the doxygen comment of esp_event_handler_register
Add a comment to specify what happens when registering a handler several times
to the same event.
2025-06-13 08:22:38 +02:00
Mahavir Jain
a9c62e02e4 fix: update root certificate for postman-echo endpoint
The certificate chain for postman-echo endpoint has switched to
Let's Encrypt root CA
2025-06-13 11:05:57 +05:30
zwl
f96430915e feat(ble): add dtm test code to cert test example on ESP32-C6 2025-06-13 11:46:39 +08:00
Island
96c50f997c Merge branch 'bugfix/fix_blecibr25_119_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed extended adv restart failure during reconnection (v5.3)

See merge request espressif/esp-idf!39776
2025-06-13 10:59:27 +08:00
morris
f2e7b746d6 Merge branch 'docs/fix_p4_usb_jtag_pins_v5.3' into 'release/v5.3'
docs(jtag): fix esp32p4 usb jtag pins (v5.3)

See merge request espressif/esp-idf!39158
2025-06-13 10:47:05 +08:00
morris
83b9e29158 Merge branch 'fix/fix_xip_psram_ptr_check_v5.3' into 'release/v5.3'
psram: fixed psram ptr check issue under xip_psram condition for ESP32P4 (v5.3)

See merge request espressif/esp-idf!39734
2025-06-13 10:44:40 +08:00
Rahul Tank
c3e556b510 fix(nimble): Add fixes for compilation issues in nimble
1. Fix compile failures when CSFCS is 0
2. Wrap BLE service API with extern "C"
2025-06-12 20:58:29 +05:30
Rahul Tank
42856071ea Merge branch 'bugfix/fix_kconfig_names_v5.3' into 'release/v5.3'
fix(nimble): Modified Kconfig information to make it more user friendly (v5.3)

See merge request espressif/esp-idf!39645
2025-06-12 20:28:49 +05:30
Rahul Tank
9fc65dca56 Merge branch 'feat/ram_optimization_v5.3' into 'release/v5.3'
fix(nimble): Add support to minimize ram consumption (v5.3)

See merge request espressif/esp-idf!39620
2025-06-12 20:23:45 +05:30
Island
4009aa6ed0 Merge branch 'feat/reduce_bin_size_and_iram_for_ble_rom_code_v5.3' into 'release/v5.3'
feat(ble/controller): Reduce bin size and IRAM for BLE rom code on ESP32-C3 and ESP32-S3 (v5.3)

See merge request espressif/esp-idf!39451
2025-06-12 21:51:51 +08:00
Roland Dobai
16dcf5012d Merge branch 'fix/enable_remove_requirements_file_v5.3' into 'release/v5.3'
fix(tools): handle missing `requirements.*.txt` files for enabled features (v5.3)

See merge request espressif/esp-idf!39804
2025-06-11 15:04:00 +02:00
Marek Fiala
aff708b067 fix(tools): Enabled removing requirements.* files 2025-06-11 11:15:33 +02:00
armando
7a7b1d2707 feat(mmu): use cache freeze for mmap apis 2025-06-11 14:50:45 +08:00
chenjianhua
18597b1139 feat(ble/bluedroid): Support anonymous address type for white list 2025-06-11 11:11:07 +08:00
chenjianhua
6a2e6d8d98 feat(ble/bluedroid): Add config for BLE vendor hci command and event 2025-06-11 11:11:01 +08:00
chenjianhua
7b613ab0a9 feat(ble/bluedroid): Support BLE vendor event reporting with params 2025-06-11 11:10:55 +08:00
chenjianhua
2e63a39e41 fix(bt/bluedroid): Fixed BLE connection active count getting 2025-06-11 11:10:48 +08:00
Chen Jian Hua
bfc8495686 fix(ble/bluedroid): Fixed extended adv restart failure during reconnection
(cherry picked from commit 6392180813)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2025-06-10 21:33:27 +08:00
Island
4a01630b37 Merge branch 'change/ble_update_lib_20250606_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250606 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!39738
2025-06-10 11:05:54 +08:00
zhanghaipeng
7eac7d773c fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(4713a69)
- Fixed double free exception during BLE init under low memory
2025-06-10 10:31:34 +08:00
Alexey Gerenkov
e64f3d7559 Merge branch 'ci/fix-custom-oocd-setting_v5.3' into 'release/v5.3'
ci: select OpenOCD binary based on runner (v5.3)

See merge request espressif/esp-idf!39378
2025-06-09 23:17:49 +08:00
Island
d1159f634d Merge branch 'bugfix/fix_ble_smp_fail_0x82_v5.3' into 'release/v5.3'
Bugfix/fix ble smp fail 0x82 (v5.3)

See merge request espressif/esp-idf!39661
2025-06-09 14:38:48 +08:00
morris
86cb813f1d Merge branch 'docs/add_doc_link_for_esp32p4_v5.3' into 'release/v5.3'
docs: Update hw-reference/index.rst for esp32p4 (v5.3)

See merge request espressif/esp-idf!39731
2025-06-09 11:50:50 +08:00
Zhao Wei Liang
bd57080585 fix(ble): change the default ble cca thresh on ESP32-C2
(cherry picked from commit a10696d7e1)

Co-authored-by: cjin <jinchen@espressif.com>
2025-06-09 11:04:17 +08:00
Zhao Wei Liang
37b2119b5d fix(ble): change the default ble cca thresh on ESP32-H2
(cherry picked from commit a2fab0ad60)

Co-authored-by: cjin <jinchen@espressif.com>
2025-06-09 11:04:15 +08:00
Zhao Wei Liang
5a2166c96b fix(ble): change the default ble cca thresh on ESP32-C6
(cherry picked from commit 581521526b)

Co-authored-by: cjin <jinchen@espressif.com>
2025-06-09 11:04:13 +08:00
Zhao Wei Liang
8807b30463 fix(ble): change ld file on ESP32-C2
(cherry picked from commit 6c5bff1bd8)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-09 11:04:11 +08:00
Zhao Wei Liang
4eca2abbaf fix(ble): fixed an occasional assertion issue during sync on ESP32-C6
(cherry picked from commit 3c8ba488e0)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-09 11:04:09 +08:00
Zhao Wei Liang
15b7fa98c1 change(ble): [AUTO_MR] Update lib_esp32c2 to 7f72c031
(cherry picked from commit 4be18a2469)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-09 11:04:07 +08:00
Zhao Wei Liang
65ea7eb2c8 change(ble): [AUTO_MR] Update lib_esp32c6 to 35fe65f4
(cherry picked from commit 57c8d23800)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-09 11:04:04 +08:00
Zhao Wei Liang
3f9a7589e1 change(ble): [AUTO_MR] Update lib_esp32h2 to 35fe65f4
(cherry picked from commit dbf7835a6b)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-09 11:04:02 +08:00
armando
29a7e5f35f fix(psram): fixed psram ptr check under xip_psram condition
Closes https://github.com/espressif/esp-idf/pull/15999
Closes https://github.com/espressif/esp-idf/issues/15997
2025-06-09 10:34:44 +08:00
John Boiles
9faf8c3a52 fix(memory-utils): Add _instruction_reserved_start/end to esp_psram_check_ptr_addr
Adds missing range check that can be used when SPIRAM_XIP_FROM_PSRAM is enabled.
2025-06-09 10:34:40 +08:00
John Boiles
a2b21a9070 fix(freertos): Use ESP_EARLY_LOGE in vPortTLSPointersDelCb for RISCV
Using ESP_LOG* in this function causes a crash
2025-06-09 10:34:37 +08:00
Zhang Shuxian
4611b10db7 docs: Update hw-reference/index.rst for esp32p4 2025-06-09 10:27:48 +08:00
Rahul Tank
f506bf2777 Merge branch 'bugfix/add_missing_deinit_call_v5.3' into 'release/v5.3'
fix(nimble): Add invocation for mempool_deinit (v5.3)

See merge request espressif/esp-idf!39672
2025-06-07 18:36:04 +05:30
Abhinav Kudnar
009ed01b68 fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports 2025-06-06 17:14:29 +05:30
Jiang Jiang Jian
37acb543a7 Merge branch 'bugfix/supplicant_analyzer_fixes_v5.3' into 'release/v5.3'
Bugfix/supplicant analyzer fixes (v5.3)

See merge request espressif/esp-idf!39456
2025-06-06 19:04:08 +08:00
luoxu
9b9b5c335f feat(ble_mesh): update lib to f15b27e2d2 2025-06-06 14:37:08 +08:00
luoxu
a99d369dc2 fix(ble_mesh): fixed issue with recv ntf before ccc done 2025-06-06 14:35:16 +08:00
luoxu
3fd78bf329 fix(ble_mesh): fixed proxy server might send segment message with incorrect format
refer commit: 7738bca124
2025-06-06 14:35:08 +08:00
Wang Meng Yang
7242379726 Merge branch 'change/opt_hid_device_connect_description_v5.3' into 'release/v5.3'
docs(bt/bluedroid): Updated HID Device connect API description (v5.3)

See merge request espressif/esp-idf!39605
2025-06-06 09:25:11 +08:00
Sergei Silnov
d8333672f0 Merge branch 'ci/disable-plugin-idf_ci_v5.3' into 'release/v5.3'
ci: disable idf-ci plugin (v5.3)

See merge request espressif/esp-idf!39667
2025-06-05 06:12:12 -03:00
morris
3c5910db24 Merge branch 'fix/s2_adc_cali_loss_resolution_v5.3' into 'release/v5.3'
fix(adc): fix s2 cali loss resolution (v5.3)

See merge request espressif/esp-idf!38596
2025-06-05 14:36:48 +08:00
gaoxu
a68af096e6 fix(adc): fix s2 cali loss resolution 2025-06-05 11:31:59 +08:00
morris
79cfb2630c Merge branch 'ci/fix_c5_related_build_failure' into 'release/v5.3'
ci(esp32c5): bypass the build failure

See merge request espressif/esp-idf!39504
2025-06-05 11:30:13 +08:00
Jiang Jiang Jian
b22ca79669 Merge branch 'bugfix/add_more_checks_when_receiving_espnow_v5.3' into 'release/v5.3'
fix(wifi): Added more check when receiving espnow data (v5.3)

See merge request espressif/esp-idf!39520
2025-06-05 11:07:53 +08:00
Rahul Tank
1a6c26d7b7 Merge branch 'feat/nimble_ancs_final_v5.3' into 'release/v5.3'
fix(nimble): Added support for ANCS in nimble (v5.3)

See merge request espressif/esp-idf!39657
2025-06-04 19:13:42 +05:30
Rahul Tank
2197b5b066 fix(nimble): Add invocation for mempool_deinit 2025-06-04 17:01:09 +05:30
Fu Hanxi
e97adbf002 ci: disable idf-ci plugin
this plugin will be re-enabled with compatible code in !38755
2025-06-04 13:18:40 +02:00
Zhang Hai Peng
c053f1d908 fix(ble/bluedroid): Fixed BLE SMP state machine inconsistency on disconnection
(cherry picked from commit 99121258d4)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-06-04 17:13:34 +08:00
Zhang Hai Peng
504818372c feat(ble/bluedroid): Include SMP state in BLE status reporting
(cherry picked from commit de9a367f13)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-06-04 17:13:32 +08:00
Astha Verma
722a42f6e4 fix(nimble): Added support for ANCS in nimble 2025-06-04 14:29:33 +05:30
Island
8ef869122d Merge branch 'bugfix/fix_ble_crash_when_check_send_pkts_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed null pointer assert in l2c_link_check_send_pkts (v5.3)

See merge request espressif/esp-idf!39597
2025-06-04 16:53:22 +08:00
Shu Chen
39515e2273 Merge branch 'feat/and_function_to_exit_ot_mainloop_v5.3' into 'release/v5.3'
feat(openthread): add a function to exit openthread mainloop safely (v5.3)

See merge request espressif/esp-idf!39612
2025-06-04 08:24:13 +00:00
Rahul Tank
daeca6d07b fix(nimble): Modified Kconfig information to make it more user friendly 2025-06-04 10:44:35 +05:30
Island
45ad092517 Merge branch 'fix/ble_log_spi_out_timer_delete_v5.3' into 'release/v5.3'
fix(ble): set timer handle to null after deletion (v5.3)

See merge request espressif/esp-idf!39558
2025-06-04 11:26:51 +08:00
laokaiyao
39591137c8 ci(esp32c5): bypass the build failure 2025-06-04 11:21:28 +08:00
morris
d11bc380ae Merge branch 'test/c61_disable_build_test_v5.3' into 'release/v5.3'
test(ci): disable c61 helloworld build

See merge request espressif/esp-idf!39629
2025-06-03 22:06:00 +08:00
Roland Dobai
bb24b4fdd5 Merge branch 'fix/gen_soc_caps_v5.3' into 'release/v5.3'
change: config options of the same name must have the same type (v5.3)

See merge request espressif/esp-idf!39571
2025-06-03 15:38:25 +02:00
wanckl
85e28b74aa test(ci): disable c61 helloworld build 2025-06-03 19:49:43 +08:00
Shreeyash
ba39a51377 fix(nimble): Add support to minimize ram consumption 2025-06-03 16:07:10 +05:30
Xu Si Yu
2be5e88549 feat(openthread): add a function to exit openthread main loop safely 2025-06-03 16:45:37 +08:00
Island
eb5c41678f Merge branch 'fix/ble_mesh_solic_tx_pdu_fix_v5.3' into 'release/v5.3'
fix(ble_mesh): fixed issues with proxy solic pdu adv (v5.3)

See merge request espressif/esp-idf!39526
2025-06-03 15:53:55 +08:00
liqigan
f20f53f153 docs(bt/bluedroid): Updated HID Device connect API description
Closes https://github.com/espressif/esp-idf/issues/16020
2025-06-03 15:38:17 +08:00
morris
15bc442a88 Merge branch 'feat/usb-explicit-fifo-config_v5.3' into 'release/v5.3'
feat(usb/hal): Add HAL API to configure custom FIFO layout (backport v5.3)

See merge request espressif/esp-idf!39264
2025-06-03 14:35:32 +08:00
Zhang Hai Peng
d9fd25fc94 fix(ble/bluedroid): Fixed null pointer assert in l2c_link_check_send_pkts
(cherry picked from commit 8150573012)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-06-03 12:13:32 +08:00
morris
fa230832a3 Merge branch 'feature/usb_host_ext_hub_collective_backport_v5.3' into 'release/v5.3'
feat(usb_host): External Hub collective backport to v5.3

See merge request espressif/esp-idf!39578
2025-06-03 11:40:26 +08:00
zhangyanjiao
d6ec5a5225 fix(wifi): Added more check when receiving espnow data 2025-06-03 11:07:59 +08:00
Jiang Jiang Jian
cb1e34073d Merge branch 'bugfix/fix_sta_connection_info_error_on_c5_c6_v5.3' into 'release/v5.3'
fix(wifi): fix the issue that sta connection info loss lr info on C5/C6 (v5.3)

See merge request espressif/esp-idf!39440
2025-06-03 10:57:54 +08:00
Roman Leonov
e550fb11c3 fix(ext_hub): Added processing waiting_release flag while dev changed to IDLE
11382a2a fix(ext_hub): Added processing waiting_release flag while dev changed to IDLE

Co-authored-by: Roman Leonov <roman.leonov@espressif.com>
2025-06-02 11:45:29 +02:00
Roman Leonov
59aa1cbaf8 refactor(ext_hub): Device release (allows to run usb_host test with ext hub)
754d357f refactor(ext_hub): Fixed device release, optimized the order of closing usbh device
fc61875a refactor(ext_hub): Pospone the device release, if device is not IDLE
3fd17b8b refactor(hub): Applied new ext_hub api, refactor func names
3003362b refactor(usb_host): Cancel hub porpagation to the user, rename non-critical func
19ce9ed6 refactor(test_usb_host_async): Added host_lib_task finish notification
f238d75b refactor(ext_port): Remove the error verification, as error will be handled in ext hub driver

Co-authored-by: Roman Leonov <roman.leonov@espressif.com>
2025-06-02 11:45:19 +02:00
Jan Beran
2ee0b6c4dd change(gen_soc_caps_kconfig): check if config options have the same type
Also introduce ignore pragma to prevent some #defines from .h files to
be translated to Kconfig files.
2025-06-02 10:21:36 +02:00
morris
da5f469d16 Merge branch 'refactor/improve_p4_psram_timing_tuning_point_selection_v5.3' into 'release/v5.3'
mspi: improve p4 psram timing tuning point selection (v5.3)

See merge request espressif/esp-idf!38193
2025-05-31 13:54:31 +08:00
Zhou Xiao
75c85605df fix(ble): set timer handle to null after deletion
(cherry picked from commit 1614e71eb6)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-30 19:53:33 +08:00
Wang Meng Yang
ede2d093bf Merge branch 'feat/add_avrcp_init_state_event_v5.3' into 'release/v5.3'
feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP(v5.3)

See merge request espressif/esp-idf!39536
2025-05-30 18:42:21 +08:00
Mahavir Jain
064a724466 Merge branch 'feat/httpd_register_uri_handler_strdup_failure_case_check_v5.3' into 'release/v5.3'
Handling httdp_register_uri_handler() strdup function failure case check (v5.3)

See merge request espressif/esp-idf!39513
2025-05-30 10:04:14 +05:30
luoxu
08852439ce fix(ble_mesh): fixed issues with proxy solic pdu adv 2025-05-30 11:09:29 +08:00
xiongweichao
00512cd39a feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP 2025-05-30 10:14:32 +08:00
Wang Meng Yang
ed87d1d3c7 Merge branch 'fix/incorrect_setting_of_sco_packet_type_mask_v5.3' into 'release/v5.3'
fix(bt): fixed incorrect mask was used to exclude sco packets (backport v5.3)

See merge request espressif/esp-idf!39501
2025-05-30 07:12:16 +08:00
Rahul Tank
62bedaceaa Merge branch 'bugfix/add_ci_files_v5.3' into 'release/v5.3'
fix(nimble): Add CI files for base configurations (v5.3)

See merge request espressif/esp-idf!39243
2025-05-29 14:06:27 +05:30
zhangyanjiao
d08c56a92f fix(wifi): fix the issue that sta connection info loss lr info on C5/C6 2025-05-29 14:25:36 +08:00
hrushikesh.bhosale
6559ae7ec2 feat(http_server): httpd register handler strdup failure case check
In httpd_register_uri_handler api, for the strdup function failure case was not
checked and not returned any error by freeing previously allocated memory, if the memory
allocation for strdup function did not gets successful.

Closes https://github.com/espressif/esp-idf/issues/15878
2025-05-29 11:50:27 +05:30
Mahavir Jain
d2f79c406b Merge branch 'fix/suppress_cert_bundle_serial_number_warning_v5.3' into 'release/v5.3'
fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning (v5.3)

See merge request espressif/esp-idf!39403
2025-05-29 10:29:03 +05:30
gongyantao
96b9efad27 fix(bt): fixed incorrect mask was used to exclude sco packets 2025-05-29 09:55:48 +08:00
Rahul Tank
1db2b14f40 fix(nimble): Added CI files for various configurations 2025-05-28 21:49:45 +05:30
Island
1dd628e4a0 Merge branch 'bugfix/fix_send_delete_link_key_cmd_1_v5.3' into 'release/v5.3'
Bugfix/fix send delete link key cmd 1 (v5.3)

See merge request espressif/esp-idf!39444
2025-05-28 10:58:42 +08:00
armando
4c0dcf94ed refactor(mspi): improve p4 timing tuning delayline configurations 2025-05-28 02:56:32 +00:00
armando
e8dc8b5388 refactor(mspi): improved timing tuning max consecutive success points calculation 2025-05-28 02:56:32 +00:00
Island
4e7e58f458 Merge branch 'fix/ble_mesh_micellaneous_update_v5.3' into 'release/v5.3'
Fix/ble mesh micellaneous update v5.3

See merge request espressif/esp-idf!39461
2025-05-28 10:37:40 +08:00
Island
61cc298f77 Merge branch 'feat/ble_log_spi_out_dev_phase_3_v5.3' into 'release/v5.3'
Feat/ble log spi out dev phase 3 (v5.3)

See merge request espressif/esp-idf!39354
2025-05-28 10:35:50 +08:00
Kapil Gupta
541628045a Merge branch 'fix/rrm_config_set_v5.3' into 'release/v5.3'
Set rrm config condition in case RRM monitoring is enabled

See merge request espressif/esp-idf!39432
2025-05-27 18:32:55 +05:30
luoxu
06992821d7 feat(ble_mesh): update lib to bbb57d10f9 2025-05-27 20:11:21 +08:00
luoxu
70d888ddb0 feat(ble_mesh): Change the type of rpl size from uint8 to uint16 2025-05-27 16:59:45 +08:00
luoxu
cf321a1647 fix(ble_mesh): update ble 50 macro on unsupported version 2025-05-27 16:59:45 +08:00
Kapil Gupta
7a07743ecc ci(esp_wifi): Extend eloop test to verify wifi deinit properly 2025-05-27 13:45:32 +05:30
Kapil Gupta
56b6b03e57 fix(esp_wifi): Fixed some concurrency issues in eloop deinit 2025-05-27 13:45:27 +05:30
Kapil Gupta
bc9d6c093f fix(esp_wifi): Add eloop blocking call API for public APIs 2025-05-27 13:45:20 +05:30
Kapil Gupta
7cfa2617af fix(esp_wifi): Fixed static analyzer issues 2025-05-27 13:39:46 +05:30
Kapil Gupta
4ab256a441 fix(esp_wifi): Disble IP renew skip by default 2025-05-27 13:39:46 +05:30
Zhi Wei Jian
ad523cf3ff feat(ble/controller): Reduce bin size and IRAM for BLE rom code
(cherry picked from commit 1d739291ca)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-05-27 16:03:29 +08:00
luoxu
bd4fee986c fix(ble_mesh): fixed issue where private beacon used incorrect adv type 2025-05-27 15:31:49 +08:00
luoxu
6df436f63c fix(ble_mesh): fixed some issues with ble50 2025-05-27 15:31:43 +08:00
luoxu
6ff7b65c34 feat(ble_mesh): Remote Provisioning Server UUID Matchs Supported 2025-05-27 15:31:31 +08:00
luoxu
876a4aac1f fix(ble_mesh): Remote Provisioning Client/Server bugs fixed 2025-05-27 15:28:46 +08:00
Zhang Hai Peng
9344c8873a fix(ble/bluedroid): Fixed clear BLE device recored
(cherry picked from commit 21391a45fd)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-27 15:13:46 +08:00
Zhang Hai Peng
37ac34cff0 fix(ble/bluedroid): Fixed issue with deleting link key when classic Bluetooth is not used
(cherry picked from commit 7c16bce827)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-27 15:13:43 +08:00
Jiang Jiang Jian
18b48329df Merge branch 'backport/backport_some_wifi_changes_250526_v5.3' into 'release/v5.3'
fix(wifi): fix some wifi bugs(backport v5.3)

See merge request espressif/esp-idf!39409
2025-05-27 14:36:27 +08:00
tarun.kumar
52040c6a77 fix(wifi) : Set rrm config condition in case RRM monitoring is enabled 2025-05-27 11:03:12 +05:30
Mahavir Jain
30630c6666 Merge branch 'change/exclude_cve-2023-53154_v5.3' into 'release/v5.3'
change: adds CVE-2023-53154 to cJSON sbom exclude list (v5.3)

See merge request espressif/esp-idf!39417
2025-05-27 10:52:07 +05:30
Jiang Jiang Jian
433f0ab716 Merge branch 'fix/nvs_logger_json_output_v5.3' into 'release/v5.3'
fix(nvs_flash/nvs_tool): Fix nvs_tool.py to output required values (v5.3)

See merge request espressif/esp-idf!38682
2025-05-26 20:03:37 +08:00
Jiang Jiang Jian
080ad8423c Merge branch 'bugfix/hwlp_coproc_saving_master_v5.3' into 'release/v5.3'
fix(freertos): workaround a hardware bug related to HWLP coprocessor (backport v5.3)

See merge request espressif/esp-idf!38060
2025-05-26 20:02:48 +08:00
Jiang Jiang Jian
c06e9d3a73 Merge branch 'fix/fix_esp32p4_retention_cost_v5.3' into 'release/v5.3'
fix(esp_hw_support): optimize retention cost and update sleep time compensation (v5.3)

See merge request espressif/esp-idf!38745
2025-05-26 20:01:56 +08:00
Jiang Jiang Jian
3f160107a3 Merge branch 'fix/fix_usj_pad_leakage_v5.3' into 'release/v5.3'
fix(esp_hw_support): always disable USJ pad in sleep to supress leakage (v5.3)

See merge request espressif/esp-idf!39107
2025-05-26 19:57:41 +08:00
Jiang Jiang Jian
96037e9cc3 Merge branch 'fix/fix_usb_hs_phy_leakage_on_deepsleep_v5.3' into 'release/v5.3'
fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy (v5.3)

See merge request espressif/esp-idf!39169
2025-05-26 19:56:41 +08:00
Jiang Jiang Jian
b7cdd6ead9 Merge branch 'fix/fix_esp32p4_stuck_in_pd_ana_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep (v5.3)

See merge request espressif/esp-idf!39284
2025-05-26 19:56:12 +08:00
Jiang Jiang Jian
b78ef76005 Merge branch 'fix/fix_esp_timer_accuracy_when_do_dfs_v5.3' into 'release/v5.3'
fix(esp_hw_support): improve esp timer accuracy on DFS for esp32 & esp32s2 (v5.3)

See merge request espressif/esp-idf!39341
2025-05-26 19:54:44 +08:00
Ashish Sharma
f8795b4e10 change: adds CVE-2023-53154 to cJSON sbom exclude list 2025-05-26 17:31:57 +08:00
yinqingzhao
7bcbc483c6 fix(wifi): fix some wifi bugs 2025-05-26 16:43:59 +08:00
harshal.patil
38452e4cc8 fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning
Co-authored-by: Mahavir Jain <mahavir.jain@espressif.com>
2025-05-26 13:55:08 +05:30
Zhou Xiao
154c162d99 change(ble): make falling edge when disabling ts sync 2025-05-26 15:35:07 +08:00
Zhou Xiao
8736c4c0a3 fix(ble): fixed spi log init failure return value for ESP32 2025-05-26 10:47:25 +08:00
Zhou Xiao
098d0a1e5f fix(ble): fixed ts sync sleep support trigger 2025-05-23 19:12:45 +08:00
morris
46ac830333 Merge branch 'bugfix/lp_uart_baudrate_limitation_v5.3' into 'release/v5.3'
fix(uart): LP UART does not have the pre-divider for its clock source (v5.3)

See merge request espressif/esp-idf!37595
2025-05-23 17:10:39 +08:00
morris
2e89dce260 Merge branch 'feature/add_uart_io_deinit_process_v5.3' into 'release/v5.3'
fix(uart): eliminate garbled data on TX/RX line in sleep (v5.3)

See merge request espressif/esp-idf!39281
2025-05-23 16:46:37 +08:00
Zhou Xiao
5872bf889f fix(ble): fixed printf va list cross function pass failure 2025-05-23 12:31:42 +08:00
Samuel Obuch
e75d5b9c46 ci: select OpenOCD binary based on runner 2025-05-23 00:42:49 +02:00
Rahul Tank
e4f973dcf3 Merge branch 'bugfix/coverity_fix_v5.3' into 'release/v5.3'
fix(nimble): Add changes for coverity reported issue (v5.3)

See merge request espressif/esp-idf!39315
2025-05-22 16:29:09 +05:30
Zhou Xiao
afbbf72002 fix(ble): fixed upper layer trans append failure bug
(cherry picked from commit 1e6bc70837)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:39 +08:00
Zhou Xiao
3105d10cbb feat(ble): support ts sync for sleep app
(cherry picked from commit e10460ce14)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:37 +08:00
Zhou Xiao
16383af1ae feat(ble): support controller raw log print out
(cherry picked from commit ed09e97c66)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:35 +08:00
Zhou Xiao
91ce842f01 feat(ble): refactored loss report module and represent frame using struct
(cherry picked from commit 9800d715a5)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:32 +08:00
Zhou Xiao
cc4744cffd feat(ble): support le audio log buffer separation
(cherry picked from commit cd3aa6527c)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:30 +08:00
Zhou Xiao
fb0bb82e1a feat(ble): optimized printf functions code size and speed
(cherry picked from commit e4be25ba63)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:28 +08:00
Zhou Xiao
4e8e6b7920 feat(ble): refactored flush module and provided public flush api
(cherry picked from commit 70792443c7)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:25 +08:00
Zhou Xiao
b9a06476f1 feat(ble): refactored ll isr buffer append and buffer flush using event handler
(cherry picked from commit bba90309e7)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:23 +08:00
Zhou Xiao
ac35a6e8f2 feat(ble): provided dynamic spi enable/disable api
(cherry picked from commit 3568f19fef)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:20 +08:00
Zhou Xiao
5558bef466 feat(ble): support hci log buffer separation
(cherry picked from commit 16a3b2c71b)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:18 +08:00
Zhou Xiao
43dfe06c05 feat(ble): optimized macros readability
(cherry picked from commit f8699785e9)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:54:16 +08:00
wuzhenghui
162681d8ea ci(esp_timer): add UT case for esp_timer period alarm with DFS 2025-05-22 15:14:44 +08:00
wuzhenghui
326b32bd74 feat(esp_hw_support): compensate the error introduced to LACT during APB frequency switching 2025-05-22 15:14:43 +08:00
wuzhenghui
bc1624879c fix(esp_hw_support): update systimer step immediately when XTAL changes on esp32s2 2025-05-22 15:14:43 +08:00
wuzhenghui
85aad225d0 fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32 2025-05-22 15:14:39 +08:00
Mahavir Jain
c0ab30f33c Merge branch 'feat/some_xip_psram_related_optimisations_and_fixes_v5.3' into 'release/v5.3'
feat(esp_psram): Add some wasted XIP PSRAM memory in heap and XIP PSRAM protection (v5.3)

See merge request espressif/esp-idf!38873
2025-05-22 12:00:14 +05:30
Song Ruo Jing
8baffe22cb fix(uart): LP UART does not have the pre-divider for its clock source
Closes https://github.com/espressif/esp-idf/issues/15427
2025-05-22 11:51:19 +08:00
Song Ruo Jing
6f9979451b fix(gpio): fix bad bit shift operation and OOB (h2) in io_mux.c 2025-05-22 11:51:19 +08:00
Song Ruo Jing
84f8be2e31 refactor(uart): increase test app memory leak tolerance 2025-05-22 11:51:19 +08:00
Island
ade43f3b00 Merge branch 'bugfix/fix_ble_scan_no_adv_report_when_connected_v5.3' into 'release/v5.3'
Fixed missing ADV reports after bonding and connection on ESP32-C3 and ESP32-S3 (v5.3)

See merge request espressif/esp-idf!39274
2025-05-21 18:19:24 +08:00
harshal.patil
5e15adfae9 fix(esp_psram): Add XIP PSRAM alignment gaps in heap only if PSRAM protection is enabled 2025-05-21 15:36:41 +05:30
harshal.patil
29f7654c2b feat(cpu_region_protect): Enable basic memory protection for SPIRAM 2025-05-21 15:36:41 +05:30
harshal.patil
8d42a711c4 feat(esp_psram): Add the gap created due to alignment of XIP segments in heap 2025-05-21 15:36:41 +05:30
harshal.patil
2cb93cd926 feat(esp_psram): Add some helper APIs to get usable PSRAM memory size 2025-05-21 15:36:41 +05:30
Armando
21bd94f116 fix(linker): fixed extern linker symbol type from int to char 2025-05-21 15:36:40 +05:30
morris
a2c53e5690 Merge branch 'fix/slot0_requires_all_pins_in_1bit_mode_issue_v5.3' into 'release/v5.3'
sd: fixed all pins need to be set when using slot0 on esp32p4 issue (v5.3)

See merge request espressif/esp-idf!39307
2025-05-21 15:11:13 +08:00
Song Ruo Jing
266c576d20 fix(ci): remove esp32c5 from the build template app for release/v5.3 2025-05-21 14:37:26 +08:00
Rahul Tank
ae995b34d7 fix(nimble): Add changes for coverity reported issue 2025-05-21 11:38:18 +05:30
Rahul Tank
95b3176fdd Merge branch 'bugfix/handle_flow_control_flag_v5.3' into 'release/v5.3'
fix(nimble): Add chip dependancy flag for Flow control feature (v5.3)

See merge request espressif/esp-idf!39295
2025-05-21 09:53:13 +05:30
armando
870e1f2204 fix(sd): fixed menuconfig multi pin definitions issue 2025-05-21 11:16:22 +08:00
armando
8c89c9b9d5 fix(sd): fixed slot0 requires all pins to be set when using 1bit iomux mode on p4 2025-05-21 11:13:28 +08:00
Rahul Tank
9a2a3d0d86 Merge branch 'feat/min_size_builds_v5.3' into 'release/v5.3'
fix(nimble): Add support for minimilistic builds (v5.3)

See merge request espressif/esp-idf!39100
2025-05-20 21:03:50 +05:30
igor.masar
d98a828c7e feat(usb/hal): Add support for explicit FIFO configuration
Introduce a new HAL API `usb_dwc_hal_set_fifo_config()` that allows advanced users
to manually configure RX, Non-Periodic TX, and Periodic TX FIFO sizes. This offers
fine-grained control beyond the previous bias-based sizing approach.

The HAL function no longer returns `esp_err_t`, and internal validations are enforced
via `HAL_ASSERT()`. Responsibility for input validation has been moved to the HCD layer.

FIFO configuration must be applied before any USB pipes are created or activated.
This feature is intended for use during `usb_host_install()`.

If no custom FIFO configuration is provided (i.e., all values are zero),
the driver falls back to a bias-based default layout based on Kconfig settings
(`CONFIG_USB_HOST_HW_BUFFER_BIAS_*`). Bias resolution is done inside `hcd_port_init()`.

The `port_obj_t` structure has been extended with a `fifo_config` field, which stores
the configuration to allow re-application after a USB port reset.

Obsolete FIFO bias enums (`usb_hal_fifo_bias_t`, `hcd_port_fifo_bias_t`) and related
APIs (`hcd_port_set_fifo_bias()`) have been removed in favor of the new structure-based mechanism.

The HCD initialization and port reset flow has been updated to use the explicit
FIFO configuration.

USB Host maintainer documentation (`maintainers.md`) has been updated accordingly.
Test cases were updated to remove the usage of removed bias API and now rely on default
or custom FIFO configuration.
2025-05-20 15:44:54 +02:00
Rahul Tank
f2c577ae51 fix(nimble): Add chip dependancy flag for Flow control feature 2025-05-20 18:10:35 +05:30
Song Ruo Jing
674113bfcc fix(gpio): add some detailed error log for gpio_pullup_en and gpio_pulldown_en 2025-05-20 16:49:47 +08:00
Song Ruo Jing
501fb2fab2 fix(uart): eliminate garbled data on UART TX/RX line in sleep 2025-05-20 16:49:47 +08:00
Song Ruo Jing
752df66332 feat(uart): add pin release process to uart driver 2025-05-20 16:49:39 +08:00
wuzhenghui
6866e9d40e fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep 2025-05-20 16:01:20 +08:00
Mahavir Jain
2be4cef6f2 Merge branch 'feat/cjson_update_to_upstream_v5.3' into 'release/v5.3'
feat(cjson): update to latest upstream (v5.3)

See merge request espressif/esp-idf!39227
2025-05-20 09:50:26 +05:30
Mahavir Jain
7d97a53953 Merge branch 'contrib/github_pr_15059_v5.3' into 'release/v5.3'
feat(https): Get TLS errors from http client (GitHub PR) (v5.3)

See merge request espressif/esp-idf!39143
2025-05-20 09:49:12 +05:30
Song Ruo Jing
74a496e3d0 fix(dedic_gpio): fix calloc to heap_caps_calloc 2025-05-20 11:54:44 +08:00
Song Ruo Jing
5383558bb9 fix(uart): fix nmea0183 example wrong knots to m/s unit conversion
Closes https://github.com/espressif/esp-idf/issues/15695
2025-05-20 11:54:26 +08:00
Song Ruo Jing
7c4a6bf9d6 fix(uart): correct C3/S3 module enable porcedure to avoid undesired line noise 2025-05-20 11:54:15 +08:00
Song Ruo Jing
52cd954e41 fix(sleep): uart suspend/flush should also check if port is enabled on esp32 2025-05-20 11:53:59 +08:00
Song Ruo Jing
3de0b669e7 docs(uart): improve set/get baud rate API docs
Closes https://github.com/espressif/esp-idf/issues/15449
2025-05-20 11:53:42 +08:00
Song Ruo Jing
96372d2091 fix(uart): fixed coverity ininitialized scalar variable in uart_tcgetattr 2025-05-20 11:52:22 +08:00
Island
88cb3027f5 Merge branch 'change/ble_update_lib_20250516_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250516 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!39236
2025-05-20 11:39:56 +08:00
Zhang Hai Peng
a689510a6c fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(4713205)
- Fix: Missing ADV reports after bonding and connection


(cherry picked from commit 244d4f8fa7)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-20 11:13:27 +08:00
Alexey Gerenkov
811fa4e9f1 Merge branch 'ci/enable_gcov_test_v5.3' into 'release/v5.3'
ci: enable gcov example for all chips (v5.3)

See merge request espressif/esp-idf!39173
2025-05-20 02:04:24 +08:00
Alexey Gerenkov
ef4c750d39 Merge branch 'feat/apptrace-crc16_v5.3' into 'release/v5.3'
Store CRC16 checksum value in the PERFMON1 reg (v5.3)

See merge request espressif/esp-idf!39210
2025-05-20 01:50:54 +08:00
zwl
75fcb6b5d5 fix(ble): fixed occasional assert issue in scan and connection scenarios on ESP32-C6 2025-05-19 20:37:37 +08:00
Sudeep Mohanty
ee995a79f3 change(lp-core): Update LP I2C and LP UART drivers to use raw interrupt status
This commit updates the LP I2C and LP UART drivers to use the raw
interrupt status without enabling the interrupts.
2025-05-19 10:38:07 +02:00
Rahul Tank
03dfb8e411 fix(nimble): Add support for minimilistic builds 2025-05-19 12:48:32 +05:30
Rahul Tank
7e99457c8f Merge branch 'fix/gattc_proc_comparison_v5.3' into 'release/v5.3'
fix(nimble): Fix proc rx entry comparison (v5.3)

See merge request espressif/esp-idf!39189
2025-05-19 12:32:58 +05:30
Zhao Wei Liang
d42c0c88ef fix(ble): added missed printf for ll log interface
(cherry picked from commit d12e072b35)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-19 12:04:01 +08:00
Zhao Wei Liang
6f73cb187c feat(ble): support creating connections during scanning process on ESP32-H2
(cherry picked from commit 207d85a5f7)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:03:59 +08:00
Zhao Wei Liang
3a52c0443c change(ble): [AUTO_MR] Update lib_esp32c2 to 664e4255
(cherry picked from commit 3cfd4d0166)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:03:56 +08:00
Zhao Wei Liang
e248ccd543 change(ble): [AUTO_MR] Update lib_esp32c6 to 1304a9d0
(cherry picked from commit 69158d5064)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:03:54 +08:00
Zhao Wei Liang
4ba0a8310b change(ble): [AUTO_MR] Update lib_esp32h2 to 1304a9d0
(cherry picked from commit 29f89efea6)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:03:52 +08:00
Ashish Sharma
ecc61d4e45 feat(cjson): update to latest upstream 2025-05-19 09:51:18 +08:00
morris
292114f622 Merge branch 'refactor/usb_dwc_buff_delay_on_p4_backport_v5.3' into 'release/v5.3'
refactor(hcd_dwc): Apply ls_via_fs_hub delay for all targets (backport to v5.3)

See merge request espressif/esp-idf!39150
2025-05-16 23:04:43 +08:00
Jiang Jiang Jian
df274a328e Merge branch 'bugfix/fix_twt_just_post_one_event_for_multiple_flow_v5.3' into 'release/v5.3'
fix(wifi): fix twt just post one event for multiple flow(Backport v5.3)

See merge request espressif/esp-idf!37758
2025-05-16 19:56:13 +08:00
Erhan Kurubas
6cafe499ed feat(apptrace): Store CRC16 checksum value of exposed block in the perfmon reg 2025-05-16 11:33:12 +02:00
morris
c590bc5beb Merge branch 'refactor/add_dfs_init_auto_test_v5.3' into 'release/v5.3'
fix(mcpwm): the wrong pm lock type on esp32 and esp32s3 (v5.3)

See merge request espressif/esp-idf!39194
2025-05-16 14:34:49 +08:00
morris
3260fd31cf fix(mcpwm): the wrong pm lock type on esp32 and esp32s3 2025-05-16 10:51:37 +08:00
morris
995b09e792 Merge branch 'fix/usbjtag_after_tinyusb_backport_v5.3' into 'release/v5.3'
fix(usb/phy): Fix ability to switch back to USB/JTAG after uninstalling TinyUSB (backport to v5.3)

See merge request espressif/esp-idf!39125
2025-05-16 10:23:04 +08:00
Sumeet Singh
e7e6577568 fix(nimble): Fix proc rx entry comparison (v5.3) 2025-05-15 19:51:00 +05:30
Samuel Obuch
64d8dfa024 ci: fix app_trace_basic test 2025-05-15 14:00:22 +02:00
Samuel Obuch
b1922f4de3 ci: enable gcov example for all chips 2025-05-15 14:00:18 +02:00
wuzhenghui
e0d1641281 fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy 2025-05-15 16:05:34 +08:00
Omar Chebib
8943314799 fix(freertos): optimize HWLP context switch by disabling it when unused 2025-05-15 15:48:45 +08:00
Omar Chebib
acd976161f fix(freertos): workaround a hardware bug related to HWLP coprocessor
This commit manually sets the HWLP context to dirty when a Task that needs it is scheduled it.
2025-05-15 15:48:45 +08:00
Alexey Gerenkov
087d7db455 Merge branch 'freertos_sysview_deadlock_fix_v5.3' into 'release/v5.3'
fix(app_trace): prevent deadlock on sysview start (v5.3)

See merge request espressif/esp-idf!39138
2025-05-15 15:46:22 +08:00
Anton Maklakov
3dba09b93f docs(jtag): fix esp32p4 usb jtag pins 2025-05-15 12:13:42 +07:00
morris
711836a6a0 Merge branch 'feat/usb_host_move_dma_cap_mem_to_psram_p4_backport_v5.3' into 'release/v5.3'
feat(usb_host): Move DMA capable memory to external ram on P4 (backport v5.3)

See merge request espressif/esp-idf!39081
2025-05-14 22:20:50 +08:00
Rahul Tank
4d86268751 Merge branch 'bugfix/fix_few_nimble_issues_10052025_v5.3' into 'release/v5.3'
fix(nimble): fix nimble issues 10052025(v5.3)

See merge request espressif/esp-idf!39015
2025-05-14 20:41:42 +08:00
Shu Chen
c16caab061 Merge branch 'feat/calibrate_bus_latency_v5.3' into 'release/v5.3'
Feat/calibrate bus latency v5.3

See merge request espressif/esp-idf!39132
2025-05-14 20:04:49 +08:00
Roman Leonov
bc7c612c1f refactor(hcd_dwc): Apply ls_via_fs_hub delay for all targets 2025-05-14 13:52:16 +02:00
nilesh.kale
7853142e6e fix(esp_http_client): update code format for API
This commit update code format as per IDF standard for API
esp_http_client_get_and_clear_last_tls_error().
2025-05-14 15:25:18 +05:30
Lorenzo Consolaro
81382d93a5 feat(https): Get TLS errors from http client
update PR

update mr

Update components/esp_http_client/esp_http_client.c

Co-authored-by: Nilesh Kale <nilesh.kale@espressif.com>
2025-05-14 15:25:18 +05:30
Island
60cd7f506c Merge branch 'bugfix/fix_some_ble_bugs_0422_v5.3' into 'release/v5.3'
Bugfix/fix some ble bugs 0422 (v5.3)

See merge request espressif/esp-idf!39071
2025-05-14 17:23:20 +08:00
Samuel Obuch
5281c04d97 fix(sysview): do not use freertos ticks to prevent deadlock 2025-05-14 11:22:30 +02:00
Tan Yan Quan
63a287101e feat(openthread): change border agent to kconfig option 2025-05-14 16:15:57 +08:00
Tan Yan Quan
964285f73b fix(openthread): handle SetTimeSyncState when ifconfig up or down 2025-05-14 16:15:51 +08:00
Tan Yan Quan
71d42ab61d feat(openthread): support bus_latency for dual-chip BR solution 2025-05-14 16:15:43 +08:00
Marius Vikhammer
83bac55998 Merge branch 'fix/memory-utils-ptr-executable_v5.3' into 'release/v5.3'
fix(memory-utils): Missing case in esp_ptr_executable logic (backport v5.3)

See merge request espressif/esp-idf!37100
2025-05-14 16:14:50 +08:00
Marius Vikhammer
49025e7140 Merge branch 'fix/memprot-config-used-in-memory-layouts_v5.3' into 'release/v5.3'
fix(heap): Fix wrong config to enable MALLOC_CAP_EXEC in memory_layout.c (backport v5.3)

See merge request espressif/esp-idf!35201
2025-05-14 14:32:22 +08:00
John Boiles
362cca224a fix(usb/phy): Fix ability to switch back to USB/JTAG after uninstalling TinyUSB
Fixes #15912. This is a revert of a change made in 005ae0554 that breaks the
ability to re-initalize the USB/JTAG device after uninstalling TinyUSB.

Closes https://github.com/espressif/esp-idf/issues/15912
2025-05-14 08:25:43 +02:00
Sumeet Singh
e17ed5d738 fix(nimble): Fixed async race condition with HCI outstanding packets counter 2025-05-14 10:29:40 +05:30
Rahul Tank
3e97fa00a2 fix(nimble): Extend support for allow connect during scan for more chips 2025-05-14 10:29:33 +05:30
Rahul Tank
577563840a fix(nimble): Add support for anonymous address type for whitelist 2025-05-14 10:29:25 +05:30
Rahul Tank
378216daf1 fix(nimble): Add configurable option to select ext adv v2 command 2025-05-14 10:29:21 +05:30
Shu Chen
4c8ebb9831 Merge branch 'feat/ot_br_esp32p4_v5.3' into 'release/v5.3'
feat(br): support ot_br example for esp32p4 (v5.3)

See merge request espressif/esp-idf!39009
2025-05-14 09:26:37 +08:00
Rahul Tank
37c0d836ab Merge branch 'fix/gatt_cache_inc_services_uuid_type_error_v5.3' into 'release/v5.3'
fix(nimble): Fixed UUID type error in gatt caching included service search (v5.3)

See merge request espressif/esp-idf!39089
2025-05-14 09:26:22 +08:00
wuzhenghui
ce414f6ca6 fix(esp_hw_support): always disable USJ pad in sleep to supress leakage 2025-05-13 20:13:42 +08:00
Sumeet Singh
8cab86decd fix(nimble): Fixed UUID type error in gatt caching included service search (v5.3) 2025-05-13 17:34:15 +05:30
peter.marcisovsky
196bc310e5 feat(usb_host): Move DMA capable memory to external ram on P4
- DWC-OTG internal DMA can access psram on esp32p4
    - Move DMA memory buffs to psram, to save internal ram
    - HCD tests and MSC example runs in CI with psram enabled
2025-05-13 13:32:38 +02:00
Zhang Hai Peng
0ac1d27ea7 fix(ble/bluedroid): Reduce Bluedroid host log output over SPI
(cherry picked from commit 0586d10317)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-13 16:13:59 +08:00
Zhang Hai Peng
31fecc616d fix(ble/bluedroid): Added value len check in esp_ble_gatts_send_indicate()
(cherry picked from commit bfa0fff2e5)

Co-authored-by: Nebojsa Cvetkovic <nebkat@gmail.com>
2025-05-13 16:13:56 +08:00
Zhang Hai Peng
9c282d6e12 fix(ble/bluedroid): Change maximum length of attribute value to 517
(cherry picked from commit df8c1f7a96)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-13 16:13:54 +08:00
Zhang Hai Peng
c27dbdf1a9 docs(ble): clarify meaning of 0 value for esp_ble_gap_start_ext_scan() parameters
(cherry picked from commit ebb76933d0)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-13 16:13:51 +08:00
Zhang Hai Peng
668739a675 fix(ble/bluedroid): Fixed BLE GAP appearance configuration check
(cherry picked from commit 6552854cb5)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-13 16:13:48 +08:00
yinqingzhao
ced26468d4 fix(wifi): fix some wifi bugs 2025-05-13 14:49:53 +08:00
Marius Vikhammer
acea1fc047 Merge branch 'contrib/github_pr_15132_v5.3' into 'release/v5.3'
fix(newlib): usleep returning early (GitHub PR) (v5.3)

See merge request espressif/esp-idf!38709
2025-05-13 14:38:55 +08:00
Guillaume Souchere
7ab1b601ad fix(heap): Fix wrong config to enable MALLOC_CAP_EXEC in memory_layout.c
In esp32c2 and esp32c61 memory_layout.c files, the config used to allow
MALLOC_CAP_EXEC was CONFIG_ESP_SYSTEM_MEMPROT_FEATURE when
CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT should be used.

Closes https://github.com/espressif/esp-idf/issues/14836
2025-05-13 08:17:28 +02:00
Guillaume Souchere
cb076f2097 fix(memory-utils): Missing case in esp_ptr_executable logic
esp_ptr_executable does not consider that the PSRAM and FLASH
memory mapping are not always matching.

Added a "pointer is in PSRAM" specific check in the logic to
fix the issue.
2025-05-13 08:16:59 +02:00
Rahul Tank
d56f1b5cb7 Merge branch 'feat/gatt_cache_info_v5.3' into 'release/v5.3'
fix(nimble): Added api's to fetch gatt cache info (v5.3)

See merge request espressif/esp-idf!39031
2025-05-13 13:54:44 +08:00
hrushikesh.bhosale
ad18796692 feat(nvs_tool): Test for print_minimal_json
Added the test for the print_minimal_json function
and setup_minimal_json function to setup the test.
2025-05-12 14:10:08 +02:00
hrushikesh.bhosale
b642feb67e fix(nvs_flash/nvs_tool): Fix nvs_tool.py to output required values
nvs_tool.py did not provide the minimal output support which outputs
the only necessary data.

nvs_tool.py minimal text ouptut, the deliminators were not handled
in the output

Closes https://github.com/espressif/esp-idf/issues/15274
2025-05-12 14:00:31 +02:00
Martin Vychodil
8db2dcca76 Merge branch 'feat/nvs_pytest_add_non_ascii_string_test_v5.3' into 'release/v5.3'
feat: Add NVS generator check test for CRC of non-ASCII strings (v5.3)

See merge request espressif/esp-idf!38843
2025-05-12 19:48:40 +08:00
morris
bc6a2359a4 Merge branch 'fix/rmt_race_condition_v5.3' into 'release/v5.3'
fix(rmt): fix race condition and add receive config error message (v5.3)

See merge request espressif/esp-idf!38999
2025-05-12 15:14:53 +08:00
Astha Verma
8e72311441 fix(nimble): Added api's for fetching gatt cache data and for discovering included service 2025-05-12 11:56:24 +05:30
Rahul Tank
d00ce57499 Merge branch 'bugfix/provide_user_option_delete_pair_v5.3' into 'release/v5.3'
fix(nimble): Added option to stack to handle repeat pairing internally (v5.3)

See merge request espressif/esp-idf!38960
2025-05-12 13:03:04 +08:00
morris
93953299c6 Merge branch 'bugfix/fixed_mismatch_of_tx_queue_statue_v5.3' into 'release/v5.3'
fix(i2s): fixed the false buf catenate while use preload (v5.3)

See merge request espressif/esp-idf!38968
2025-05-12 10:38:03 +08:00
Tan Yan Quan
d7ff344c4f fix(openthread): standardize disable_test to exclude certain targets 2025-05-12 10:37:50 +08:00
Rahul Tank
c15ce89435 fix(nimble): Added option to stack to handle repeat pairing internally 2025-05-10 20:26:11 +05:30
Tan Yan Quan
5f026d7533 feat(openthread/br): update thread-lib for esp32p4 and OT upstream ec2b0d487
* esp-openthread: thread_zigbee/esp-openthread@ac1715a6f
* openthread: espressif/openthread@ec2b0d487
* esp-idf: espressif/esp-idf@eb703e4f0
2025-05-09 11:51:20 +00:00
Tan Yan Quan
eb703e4f0f feat(openthread): update OT upstream to ec2b0d487 2025-05-09 19:41:59 +08:00
Tan Yan Quan
c975aa6aef feat(openthread): support esp32p4 as ot_br 2025-05-09 19:41:34 +08:00
morris
53ab7b89f8 Merge branch 'feat/customize_i2c_operation_transaction_v5.3' into 'release/v5.3'
feat(i2c): Add api for customize i2c transaction interface for un-standard i2c device (backport v5.3)

See merge request espressif/esp-idf!37416
2025-05-09 18:05:27 +08:00
Mahavir Jain
df74d2bc70 Merge branch 'fix/async_handler_example_stack_overflow_issue_v5.3' into 'release/v5.3'
fix(esp_http_server): Async handler example stack overflow fix (v5.3)

See merge request espressif/esp-idf!38997
2025-05-09 17:18:07 +08:00
Island
29c26da8d2 Merge branch 'change/ble_update_lib_20250430_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250430 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!38973
2025-05-09 14:05:19 +08:00
Island
f4b2885b22 Merge branch 'fix/ble_mesh_trans_pending_fix_v5.3' into 'release/v5.3'
fix(ble_mesh): remove tx pending assert (v5.3)

See merge request espressif/esp-idf!38939
2025-05-09 14:03:52 +08:00
Chen Jichang
46f81894b8 fix(rmt): fix race condition and add receive config error message
Closes https://github.com/espressif/esp-idf/issues/15842
Closes https://github.com/espressif/esp-idf/issues/15836
2025-05-09 13:44:29 +08:00
hrushikesh.bhosale
5722889fe3 fix(esp_http_server): Async handler example stack overflow fix
1. In async handler example, on hitting /long URI and closing the
connection forcefully from client (example ctrl + c) cause more stack
size (almost 200 bytes) than successfull request.
2. The connection should be closed from the server as soon as the client
closes the connect (i.e. handler should return ESP_FAIL to close the
connection)
2025-05-09 10:18:27 +05:30
Jiang Jiang Jian
fe6f2d08af Merge branch 'feat/add_svc_info_in_sdf_v5.3' into 'release/v5.3'
Add extended SSI support for NAN Services  (Backport v5.3)

See merge request espressif/esp-idf!38110
2025-05-09 12:14:05 +08:00
Wang Meng Yang
82b1690b10 Merge branch 'feat/add_sdkconfig_for_secure_connection_v5.3' into 'release/v5.3'
fix(bt): disable dm1 for acl-u when aes-ccm is on in peripheral(backport v5.3)

See merge request espressif/esp-idf!38976
2025-05-09 09:38:44 +08:00
Rahul Tank
9e99b2afa3 Merge branch 'feat/autopts_and_ssc_fixes_v5.3' into 'release/v5.3'
feat(nimble): Added fixes related to SSC and AutoPTS testing (v5.3)

See merge request espressif/esp-idf!38797
2025-05-08 21:45:07 +08:00
gongyantao
0de1fab085 fix(bt): disable dm1 for acl-u when aes-ccm is on in peripheral 2025-05-08 18:21:42 +08:00
Shen Wei Long
8f2c00f18a fix(ble): update ld file on ESP32-C2
(cherry picked from commit ee6607b489)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-08 14:54:01 +08:00
Shen Wei Long
4103766c1e change(ble): [AUTO_MR] Update lib_esp32c2 to 16e16586
(cherry picked from commit 26754d8e71)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2025-05-08 14:53:58 +08:00
Shen Wei Long
6494b57fe8 change(ble): [AUTO_MR] Update lib_esp32c6 to 9ecb81c8
(cherry picked from commit a477bfb140)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2025-05-08 14:53:56 +08:00
Shen Wei Long
396c10c618 change(ble): [AUTO_MR] Update lib_esp32h2 to 9ecb81c8
(cherry picked from commit a3cc91dbf0)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2025-05-08 14:53:53 +08:00
laokaiyao
c5ead79fce fix(i2s): fixed the false buf catenate while use preload
Closes https://github.com/espressif/esp-idf/issues/15775
2025-05-08 14:24:44 +08:00
Shu Chen
165bacc967 Merge branch 'feat/mtd_parent_search_v5.3' into 'release/v5.3'
feat(openthread): enable parent search function for MTD (v5.3)

See merge request espressif/esp-idf!38821
2025-05-08 14:12:44 +08:00
Shu Chen
0a3fd1aa02 Merge branch 'fix/calibrate_csl_rx_v5.3' into 'release/v5.3'
fix(openthread): calibrate CSL parameters (v5.3)

See merge request espressif/esp-idf!38534
2025-05-08 14:11:43 +08:00
akshat
3f27399ef4 feat(esp_wifi): Add extended SSI support for NAN Services 2025-05-08 11:14:57 +05:30
Mahavir Jain
fbcfce1f20 Merge branch 'feat/c6_v002_compatibility_v5.3' into 'release/v5.3'
hw_support: Add Kconfig option for c6 v0.2 (v5.3)

See merge request espressif/esp-idf!38943
2025-05-08 13:33:17 +08:00
C.S.M
87c6979b97 fix(i2c): Fix that fsm reset cause i2c scl frequency changed on esp32s2 2025-05-08 13:01:30 +08:00
C.S.M
debbb61451 fix(i2c): Fix some i2c coverity issue 2025-05-08 13:01:30 +08:00
C.S.M
0fdd061500 fix(i2c): I2C should not clear bus in a nack state 2025-05-08 13:01:30 +08:00
Jonathan Swoboda
5c7211ed3a fix(i2c): Fix clear bus issue in legacy i2c driver,
Closes https://github.com/espressif/esp-idf/pull/15638
2025-05-08 13:01:30 +08:00
C.S.M
31999770a6 fix(i2c): Fix i2c customize only read one byte issue 2025-05-08 13:01:30 +08:00
C.S.M
1ac593a956 docs(i2c): Add document for customize i2c transaction interface for un-standard i2c device 2025-05-08 13:01:30 +08:00
C.S.M
d5ceed3d96 feat(i2c): Add api for customize i2c transaction interface for un-standard i2c device 2025-05-08 13:01:30 +08:00
Jiang Jiang Jian
6389791949 Merge branch 'bugfix/espnow_send_issue_v53' into 'release/v5.3'
fix(esp_wifi): Fix for issue in esp_now_send when wifi tx callback registered(v5.3)

See merge request espressif/esp-idf!37944
2025-05-08 10:39:34 +08:00
Rahul Tank
c84c699166 Merge branch 'bugfix/conn_with_scan_c6_h2_v5.3' into 'release/v5.3'
fix(nimble): Enable support for Connect with scan for 32/ c6/ h2 chip (v5.3)

See merge request espressif/esp-idf!38853
2025-05-08 08:39:05 +08:00
Sumeet Singh
cbeef453a8 feat(nimble): Added some fixes for autopts testing (v5.3) 2025-05-07 17:02:56 +05:30
Island
44782e53b6 Merge branch 'bugfix/fix_scan_stopped_with_high_rtc_freq_v5.3' into 'release/v5.3'
fix(ble): fix rtc freq set too high on ESP32-C2 (v5.3)

See merge request espressif/esp-idf!38930
2025-05-07 18:47:17 +08:00
Martin Vychodil
a3aa438820 Merge branch 'feat/sdmmc_support_concurrent_use_v5.3' into 'release/v5.3'
feat(sdmmc): Concurrent use of SDMMC peripheral (v5.3)

See merge request espressif/esp-idf!32871
2025-05-07 18:43:43 +08:00
Xiao Xufeng
cdb0c79383 feat(soc): add config option for c6 v0.2 2025-05-07 16:47:31 +08:00
Island
c30b17ee80 Merge branch 'fix/ble_mesh_fixed_insufficient_link_close_v5.3' into 'release/v5.3'
fix(ble_mesh): fixed issue with insufficient link close transmit cnt (v5.3)

See merge request espressif/esp-idf!38897
2025-05-07 15:40:01 +08:00
Rahul Tank
63c0035225 fix(nimble): Enable support for Connect with scan for esp32/c6/ h2 chip 2025-05-07 12:45:38 +05:30
luoxu
92eb463704 fix(ble_mesh): remove tx pending assert 2025-05-07 14:54:39 +08:00
Aditi
f93379abcf fix(esp_wifi): Fix for issue in esp_now_send when wifi tx callback registered 2025-05-07 10:42:00 +05:30
Rahul Tank
207db463bf Merge branch 'fix/optimize_nimble_throughput_example_v5.3' into 'release/v5.3'
fix(nimble): Added support of Dynamic switching between different Phy modes. (v5.3)

See merge request espressif/esp-idf!38911
2025-05-07 12:39:08 +08:00
wuzhenghui
9321f7ef75 fix(esp_hw_support): specify optimize options to avoid dirtying L2 mem after L1D$ writeback 2025-05-07 11:42:36 +08:00
wuzhenghui
ad4f0a8708 fix(esp_hw_support): fix wrong APB clock freq on retenion 2025-05-07 11:42:35 +08:00
wuzhenghui
38d6e17516 feat(esp_hw_support): count pau backup time into sleep rejection judgment 2025-05-07 11:42:35 +08:00
wuzhenghui
61e32da02c feat(esp_hw_support): remeasure sleep_time_overhead_out if min_freq_mhz changed 2025-05-07 11:42:35 +08:00
wuzhenghui
1b47abed1b feat(esp_hw_support): use non-lock regi2c fast-up cpll/mpll enable process after sleep wakeup 2025-05-07 11:42:33 +08:00
Mahavir Jain
4d7f1a4b31 Merge branch 'change/secure_boot_config_description_v5.3' into 'release/v5.3'
Improve description of the config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS (v5.3)

See merge request espressif/esp-idf!38909
2025-05-07 11:38:19 +08:00
Jiang Jiang Jian
e65ad010ef Merge branch 'bugfix/tsens_read_abnormal_value_v5.3' into 'release/v5.3'
fix: tsens read abnormal value in esp32c2eco4(backport v5.3)

See merge request espressif/esp-idf!38902
2025-05-07 11:37:47 +08:00
wuzhenghui
50846c2595 feat(esp_hw_support): optimize esp32p4 GPIO retention link 2025-05-07 11:36:44 +08:00
wuzhenghui
86d68da4ed fix(esp_hw_support): iomux slp_sel is not avaliable to isolate mspi pin leakage on esp32p4 2025-05-07 11:36:44 +08:00
morris
52215a763f Merge branch 'feature/usb_host_ext_hub_collective_backport_v5.3' into 'release/v5.3'
feat(usb_host): External Hub collective backport to v5.3

See merge request espressif/esp-idf!37268
2025-05-07 10:49:46 +08:00
Jin Chen
2c782de873 fix(ble): fix rtc freq set too high on ESP32-C2
(cherry picked from commit 6a80deac03)

Co-authored-by: cjin <jinchen@espressif.com>
2025-05-07 10:18:33 +08:00
Roman Leonov
add4213c6b refactor(ext_port): Removed ext_hub dependency 2025-05-06 15:21:39 +02:00
Roman Leonov
166a79a764 refactor(ext_port): Changed the mechanism for hub class request
Merged all Hub Class specific request to one function.
Added a callback for the External Port Driver to break the dependency from ext_hub.h
2025-05-06 15:01:33 +02:00
Roman Leonov
02b96db4ae feat(ext_hub): Added device error handling 2025-05-06 14:54:58 +02:00
Roman Leonov
622eab9bad feat(usbh): Added uid presence check in USBH device object list 2025-05-06 14:54:58 +02:00
Shreeyash
d236459656 fix(nimble): Added support for 1m, 2m, coded phy channels and optimized throughput 2025-05-06 18:00:59 +05:30
Rahul Tank
a564be34c6 Merge branch 'bugfix/add_adv_type_parse_v5.3' into 'release/v5.3'
fix(nimble): Add API to parse adv report for given type (v5.3)

See merge request espressif/esp-idf!38790
2025-05-06 19:56:07 +08:00
Roland Dobai
318dbef100 Merge branch 'docs/fix-kconfserver-link_v5.3' into 'release/v5.3'
docs: Fix link to the kconfserver documentation (v5.3)

See merge request espressif/esp-idf!38906
2025-05-06 18:29:05 +08:00
Jiang Jiang Jian
0a0b9bf02d Merge branch 'bugfix/wps_msg_timeout_increase_v5.3' into 'release/v5.3'
fix(esp_wifi): Increase WPS message timeout (v5.3)

See merge request espressif/esp-idf!38876
2025-05-06 16:38:35 +08:00
harshal.patil
53321dd030 change(bootloader_support/secure_boot): Improve description of the config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS 2025-05-06 13:48:30 +05:30
Jan Beran
0fc301b94c docs: Fix link to the kconfserver documentation 2025-05-06 09:15:19 +02:00
sibeibei
8fe39c57cc fix: tsens read abnormal value in esp32c2eco4 2025-05-06 14:26:11 +08:00
morris
4066380f48 Merge branch 'fix/usb_host_hcd_dma_ls_via_fs_hubs_backport_v5.3' into 'release/v5.3'
fix(hcd): Added delay to slow down scatter-gather dma for ls device via fs hubs (backport v5.3)

See merge request espressif/esp-idf!38649
2025-05-06 13:40:40 +08:00
Luo Xu
29107a553d fix(ble_mesh): fixed issue with insufficient link close transmit cnt
(cherry picked from commit ad1073693e)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-05-06 12:23:28 +08:00
Jiang Jiang Jian
d63d26d580 Merge branch 'feature/add_ds_param_in_probe_req_v5.3' into 'release/v5.3'
Add DS parameter in probe requests from STA (Backport v5.3)

See merge request espressif/esp-idf!38173
2025-05-06 11:19:17 +08:00
Nachiket Kukade
e4b89c0de0 Merge branch 'feat/eap_domain_check_v5.3' into 'release/v5.3'
esp_wifi: Add EAP domain validation support (v5.3)

See merge request espressif/esp-idf!38279
2025-05-05 19:53:24 +08:00
Adam Múdry
f369caa5d2 fix(sdmmc): SDMMC concurrency change active slot only after the slot is initialized
Fixes counting of initialized slots
2025-05-05 18:58:58 +08:00
Adam Múdry
1e04e7cdbb fix(sdmmc): Fix SDMMC slot switch timing related issue on ESP32-P4 2025-05-05 18:58:58 +08:00
Ivan Grokhotkov
6773164b6a fix(sdmmc): don't disable SDIO interrupts when switching slots 2025-05-05 18:58:58 +08:00
Adam Múdry
d29f0f3e21 feat(sdmmc): Concurrent use of SDMMC peripheral
Host and device (card, etc.) initialization is not thread-safe.
After initialization transactions are serialized and guarded by mutex.
Changed `SDMMC_HOST_DEFAULT()` default deinit function to `sdmmc_host_deinit_slot`
which has a slot number as argument.
2025-05-05 18:58:58 +08:00
Adam Múdry
c81c37fe1e refactor(sdmmc): Allow sdmmc_host_init to be called multiple times
Along with slight refactor for sdmmc_host.c
2025-05-05 18:58:58 +08:00
Rahul Tank
7d3abe2c8c Merge branch 'bugfix/fix_ext_disc_example_usage_v5.3' into 'release/v5.3'
fix(nimble): Corrected structure field name usage in examples (v5.3)

See merge request espressif/esp-idf!38859
2025-05-05 13:44:46 +08:00
Aditya Patwardhan
c50e49dd0f Merge branch 'bugfix/esp32_c6_rev0_ecdsa_build_v5.3' into 'release/v5.3'
fix: Secure boot (ECDSA) build failure for C6 rev0 target (v5.3)

See merge request espressif/esp-idf!38835
2025-05-02 10:38:03 +08:00
morris
3a1bd70fea Merge branch 'fix/usb_comprehensive_heap_backport_v5.3' into 'release/v5.3'
fix(usb/host): Do not call heap_caps_get_allocated_size() in USB host driver (backport to v5.3)

See merge request espressif/esp-idf!38863
2025-05-01 07:59:30 +08:00
Kapil Gupta
c2560ed96d fix(esp_wifi): Flush PMK when EAP config is changed 2025-04-30 15:34:16 +05:30
Kapil Gupta
b3baf8c026 fix(esp_wifi): Code cleanup for PR#15550 PR#15551
Closes https://github.com/espressif/esp-idf/pull/15550
Closes https://github.com/espressif/esp-idf/pull/15551
2025-04-30 17:57:37 +08:00
Michael Stoll
05a6990049 fix: Force validate when using the default crt bundle 2025-04-30 17:57:37 +08:00
Michael Stoll
832bd03971 feat: Add domain match to wifi_enterprise example 2025-04-30 17:57:37 +08:00
Michael Stoll
90b7cd0971 feat(esp_wifi): Implement esp_eap_client_set_domain_match 2025-04-30 17:57:37 +08:00
akshat
2922213f7d bugfix(wpa_supplicant): Fix build errors when Supplicant logs are enabled 2025-04-30 15:25:10 +05:30
Kapil Gupta
b6cc3a4abc fix(esp_wifi): Increase WPS timeout 2025-04-30 15:25:10 +05:30
Roland Dobai
f640db4613 Merge branch 'ci/rename-packages_v5.3' into 'release/v5.3'
ci: rename local idf_ci folder, avoid name collision (v5.3)

See merge request espressif/esp-idf!38758
2025-04-30 17:17:53 +08:00
Shu Chen
da117743b2 Merge branch 'fix/fix_ot_set_mac_framecounter_v5.3' into 'release/v5.3'
backport: OpenThread features and bug fixes to v5.3

See merge request espressif/esp-idf!38817
2025-04-30 15:44:24 +08:00
morris
48deddea70 Merge branch 'fix/fix_image_check_16_mega_bytes_limit_v5.3' into 'release/v5.3'
bootloader: fixed image cannot exceed 16MB issue (v5.3)

See merge request espressif/esp-idf!38845
2025-04-30 14:49:51 +08:00
Tomas Rezucha
35e354c77f fix(usb/host): Do not call heap_caps_get_allocated_size() in USB host driver
It causes heap corruption if heap poisoning is enabled on ESP32-P4.
It returns incorrect size on ESP32-S3.

Closes https://github.com/espressif/esp-idf/issues/15815
2025-04-30 08:38:19 +02:00
akshat
199ec4c82b feat(esp_wifi): Add DS parameter in probe requests from STA
Parse the DS IE to get intended channel when softAP rx request,
send probe response only if request is intended for the channel
2025-04-30 11:27:54 +05:30
Mahavir Jain
8e825839dd Merge branch 'feat/configurable_mbedtls_sha1_v5.3' into 'release/v5.3'
feat(mbedtls): Make mbedtls SHA1 support configurable (v5.3)

See merge request espressif/esp-idf!37981
2025-04-30 12:42:19 +08:00
Island
6946068a0e Merge branch 'bugfix/fix_cble50y25_207_v5.3' into 'release/v5.3'
Fixed MIC error disconnection when pairing with iOS devices on ESP32-C3 and ESP32-S3(edf923e) (v5.3)

See merge request espressif/esp-idf!38763
2025-04-30 11:16:49 +08:00
armando
956d74a22b fix(bootloader): fixed image cannot exceed 16MB issue
flash 32-bit-addr is an experimental feature that has multiple
dependencies, e.g. flash chip vendor, etc.

If CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH can be enabled
successfully and tests are passed, we can allow images to be
placed on higher-than-16MB flash addresses
2025-04-30 10:34:55 +08:00
Rahul Tank
0675f2be27 fix(nimble): Corrected structure field name usage in examples 2025-04-29 21:48:12 +05:30
Adam Múdry
26bd3313aa feat: Add NVS generator check test for CRC of non-ASCII strings 2025-04-29 16:45:29 +02:00
Mahavir Jain
ffc4ceb1a5 fix: Secure boot (ECDSA) build failure for C6 rev0 target
Closes https://github.com/espressif/esp-idf/issues/15856
2025-04-29 18:06:08 +08:00
Alexey Gerenkov
d1af51f3fd Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20250422_v5.3' into 'release/v5.3'
feat(tools): update openocd version to v0.12.0-esp32-20250422 (v5.3)

See merge request espressif/esp-idf!38800
2025-04-29 16:20:21 +08:00
Rahul Tank
26ec118faf fix(nimble): Add API to parse adv report for given type 2025-04-29 12:24:59 +05:30
Tan Yan Quan
223ed69c9b feat(openthread): enable parent search function for MTD 2025-04-29 14:37:16 +08:00
Xu Si Yu
300a5ed9f4 feat(openthread): add a callback to handle rcp reset failure 2025-04-29 14:23:17 +08:00
Xu Si Yu
105fe8d804 feat(openthread): dns server of border router bind unspecified netif 2025-04-29 14:23:16 +08:00
Xu Si Yu
6aa0f96ae8 fix(openthread): use esp_netif_tcpip_exec when sending a trel message 2025-04-29 14:23:16 +08:00
Xu Si Yu
b6c5152231 feat(openthread): add a function to ensure monotonically increasing frame counter 2025-04-29 14:12:59 +08:00
Kapil Gupta
adfec6463d fix(esp_wifi): Use supplicant's internal SHA1 if not available from IDF 2025-04-29 11:21:34 +05:30
harshal.patil
5bd3fb9f0c fix(mbedtls): Fix config dependencies when ROM mbedtls is used 2025-04-29 11:20:25 +05:30
harshal.patil
031ca5cc9b fix(wpa_supplicant): Disable fastpbkdf2 when s/w and h/w SHA1 is disabled 2025-04-29 11:20:18 +05:30
Jiang Jiang Jian
eaf03eeca9 Merge branch 'refactor/sae_pt_flag_v5.3' into 'release/v5.3'
refactor(wifi): Optimize wifi bin size for station mode (Backport v5.3)

See merge request espressif/esp-idf!38307
2025-04-29 13:48:37 +08:00
harshal.patil
86fb48da77 fix(esp-tls): Fix build failure when CONFIG_MBEDTLS_SHA1_C is disabled 2025-04-29 11:17:27 +05:30
Kapil Gupta
502229f409 fix(esp_wifi): Add alternate SHA1 APIs in WiFi
Add alternate SHA1 APIs to handle cases when
`CONFIG_MBEDTLS_SHA1_C` is disabled.
2025-04-29 11:17:27 +05:30
harshal.patil
36e5d6c695 feat(mbedtls): Make mbedtls SHA1 support configurable 2025-04-29 11:17:27 +05:30
Sudeep Mohanty
5f5fc0882f test(newlib): Added unit tests for usleep and sleep_for functions
This commit adds unit tests to verify the basic functionality of
usleep() and this_thread::sleep_for() std functions.
2025-04-28 17:13:07 +02:00
Stephen Noonan
3dda3d2438 fix(newlib): usleep returning early
This commit updates usleep() to always sleep for the required sleep
period or more. This fixes a bug where the usleep() could sleep for less
than the request sleep period.

Closes https://github.com/espressif/esp-idf/pull/15132
2025-04-28 17:12:20 +02:00
Rahul Tank
9e042f6d71 Merge branch 'bugfix/blufi_add_missing_adv_stop_v5.3' into 'release/v5.3'
fix(nimble): Added code for missing adv stop in blufi (v5.3)

See merge request espressif/esp-idf!38719
2025-04-28 19:19:43 +08:00
Sajia
17427b5314 refactor(wifi): Optimize wifi bin size for station mode 2025-04-28 14:39:19 +05:30
chenjianhua
c82cabb576 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(edf923e)
- Fixed ble lib linkage issue
2025-04-28 14:11:25 +08:00
Chen Jian Hua
7f3f15f5f1 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(edf923e)
- Fixed MIC error disconnection when pairing with iOS devices


(cherry picked from commit 0df0b53b0a)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2025-04-28 14:11:11 +08:00
Jiang Jiang Jian
8e95ca2923 Merge branch 'bugfix/fix_some_wifi_bugs_250427_v5.3' into 'release/v5.3'
fix(phy): fix phy data partition restoring default fails issue(Backport v5.3)

See merge request espressif/esp-idf!38776
2025-04-28 11:42:08 +08:00
Jiang Jiang Jian
be21344c3c Merge branch 'fix/fix_usj_pad_retention_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix usj pad config bad retention (v5.3)

See merge request espressif/esp-idf!38747
2025-04-27 19:31:30 +08:00
Rahul Tank
4df0a64c83 Merge branch 'bugfix/ios_hid_failure_v5.3' into 'release/v5.3'
fix(nimble): Update hid device example in nimble to work with iOS (v5.3)

See merge request espressif/esp-idf!38677
2025-04-27 18:36:51 +08:00
muhaidong
3a6d14649a fix(wifi): fix association timeout timer issue for wep shared auth 2025-04-27 16:55:25 +08:00
muhaidong
57336f2a81 fix(phy): fix phy data partition restoring default fails issue
Closes https://github.com/espressif/esp-idf/issues/14698
2025-04-27 16:21:31 +08:00
Jiang Jiang Jian
d950dde7c1 Merge branch 'bugfix/crypto_reset_on_exit_v5.3' into 'release/v5.3'
fix(esp_system): reset crypto peripherals before device restart (v5.3)

See merge request espressif/esp-idf!38476
2025-04-27 14:26:47 +08:00
Jiang Jiang Jian
13091e4a14 Merge branch 'fix/remove-unnecessary-select_v5.3' into 'release/v5.3'
fix(esp_system): Remove unnecessary select from esp_system/Kconfig (v5.3)

See merge request espressif/esp-idf!37521
2025-04-27 14:22:29 +08:00
Jiang Jiang Jian
dcd92c96bf Merge branch 'fix/rmii_ref_ckl_v5.3' into 'release/v5.3'
fix(esp_eth): fixed ESP32P4 EMAC REF RMII CLK output mode (v5.3)

See merge request espressif/esp-idf!38040
2025-04-27 14:21:28 +08:00
Jiang Jiang Jian
7ca3e628e5 Merge branch 'contrib/github_pr_15637_v5.3' into 'release/v5.3'
fix(esp_eth): Fix order of fields in ETH_ESP32_EMAC_DEFAULT_CONFIG on P4 (GitHub PR) (v5.3)

See merge request espressif/esp-idf!38166
2025-04-27 14:20:55 +08:00
Jiang Jiang Jian
9b3e257d48 Merge branch 'fix/memory-utils-esp_ptr_in_rtc_dram_fast_v5.3' into 'release/v5.3'
fix(esp_hw_support): esp_ptr_in_rtc_iram_fast check to return false (backport v5.3)

See merge request espressif/esp-idf!36932
2025-04-27 14:20:10 +08:00
Jiang Jiang Jian
5eb2b8625e Merge branch 'fix/ulp_riscv_interrupt_bug_v5.3' into 'release/v5.3'
fix(ulp): fix ULP RISC-V interrupt handler corrupting the stack (backport v5.3)

See merge request espressif/esp-idf!35226
2025-04-27 14:19:20 +08:00
Island
b158614c9e Merge branch 'feat/add_sync_cte_type_in_pa_sync_v5.3' into 'release/v5.3'
Feat/add sync cte type in pa sync (v5.3)

See merge request espressif/esp-idf!38591
2025-04-27 14:11:50 +08:00
Island
e85aaaaf98 Merge branch 'feat/spi_ble_log_improvement_v5.3' into 'release/v5.3'
feat(ble): Improved SPI BLE Log functionality (v5.3)

See merge request espressif/esp-idf!38740
2025-04-27 14:05:28 +08:00
Jiang Jiang Jian
7615c09c60 Merge branch 'bugfix/pmf_enabled_sae_query_v5.3' into 'release/v5.3'
fix(wifi): SA Query responses not transmitted (Backport v5.3)

See merge request espressif/esp-idf!38244
2025-04-27 10:26:50 +08:00
Island
c854f7f1fd Merge branch 'feat/optimize_cble50y24_109_v5.3' into 'release/v5.3'
feat(bt/bluedroid): Added throughput mode for BLE SPP example (v5.3)

See merge request espressif/esp-idf!38692
2025-04-27 10:14:48 +08:00
Wang Meng Yang
c34c3feed6 Merge branch 'feat/add_api_get_avrc_status_v5.3' into 'release/v5.3'
feat(bt): Add API to get some information of Classic Bluetooth profile(v5.3)

See merge request espressif/esp-idf!38687
2025-04-27 09:52:58 +08:00
Alexey Gerenkov
585da85759 feat(tools): update openocd version to v0.12.0-esp32-20250422 2025-04-26 12:41:10 +02:00
akshat
2ec6169144 fix(wifi): Fix occasional dropping of SA Query responses by SoftAP 2025-04-25 17:46:43 +05:30
Jiang Jiang Jian
6a98af1fa0 Merge branch 'fix/update_os_time_struct_v5.3' into 'release/v5.3'
Modifying os_time_t datatype for platform and compiler independence

See merge request espressif/esp-idf!36718
2025-04-25 18:01:07 +08:00
Fu Hanxi
b27dd7c77a ci: rename local idf_ci folder, avoid name collision 2025-04-25 11:28:13 +02:00
Ivan Grokhotkov
f3782f6701 Merge branch 'fix/keep-got-sections-for-riscv_v5.3' into 'release/v5.3'
feat(esp_system): drop .got* sections and add hint (v5.3)

See merge request espressif/esp-idf!33370
2025-04-25 17:01:49 +08:00
morris
d68e22c828 Merge branch 'bugfix/remove_invalid_link_in_parlio_rx_example_v5.3' into 'release/v5.3'
fix(parlio_rx): remove invalid link in example readme (v5.3)

See merge request espressif/esp-idf!38751
2025-04-25 16:57:04 +08:00
laokaiyao
3455a47bd7 fix(parlio_rx): remove invalid link in example readme 2025-04-25 16:06:14 +08:00
wuzhenghui
c9946759dd fix(esp_hw_support): fix usj pad config bad retention
Closes https://github.com/espressif/esp-idf/issues/15797
2025-04-25 15:55:22 +08:00
tarun.kumar
f7ccfd2293 fix(wifi): Modify authmode to sta for sta connect event 2025-04-25 12:26:59 +05:30
tarun.kumar
155f41760a fix(esp_wifi): Modifying os_time_t datatype for platform and compiler independence 2025-04-25 12:26:38 +05:30
Zhou Xiao
ca8689dfdc feat(ble): Improved SPI BLE Log functionality
* Added checksum for every frame
* Added SPI slave transaction interval workaround
* Added SPI tx done isr issue workaround
* Turned buffer flush to a menuconfig and disabled by default
* Modified packet loss write operation and trigger condition
* Optimized buffer append efficiency for controller ISR


(cherry picked from commit 243705c143)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-04-25 14:53:41 +08:00
xiongweichao
60f188198b feat(bt): Add API to get some information of Classic Bluetooth profile 2025-04-25 14:47:57 +08:00
Wang Meng Yang
1977c705f4 Merge branch 'bugfix/l2cap_no_report_stop_server_evt_v5.3' into 'release/v5.3'
fix(bt): Fixed l2cap not reporting stop server completion event(v5.3)

See merge request espressif/esp-idf!38699
2025-04-25 12:04:22 +08:00
morris
d47c37f233 Merge branch 'test/parlio_rx_cache_safe_v5.3' into 'release/v5.3'
Reenable parlio rx cache safe test (v5.3)

See merge request espressif/esp-idf!38684
2025-04-24 18:47:42 +08:00
Rahul Tank
cc455c05d2 fix(nimble): Added code for missing adv stop in blufi 2025-04-24 14:22:11 +05:30
Alexey Lapshin
bbb257f893 feat(esp_system): drop .got* sections and add hint
Closes https://github.com/espressif/esp-idf/issues/14296
2025-04-24 16:36:31 +08:00
zwl
ae8047d36a feat(ble): add configuration command during RF testing 2025-04-24 16:08:05 +08:00
zhangbowen
3f6cc98495 feat(bt/bluedroid): Added throughput mode for BLE SPP example 2025-04-24 16:07:42 +08:00
xiongweichao
d909fe2156 fix(bt): Fixed l2cap not reporting stop server completion event 2025-04-24 15:14:45 +08:00
Marius Vikhammer
201b376200 Merge branch 'fix/freertos_tickless_idle_tick_jump_v5.3' into 'release/v5.3'
fix(freertos): Fixed tickless idle tick count accounting (v5.3)

See merge request espressif/esp-idf!38511
2025-04-24 13:35:26 +08:00
Marius Vikhammer
2f084e47c9 Merge branch 'fix/dram_dma_aligned_attr_for_p4_v5.3' into 'release/v5.3'
fix(esp_common): Fix DRAM_DMA_ALIGNED_ATTR for ESP32-P4 (v5.3)

See merge request espressif/esp-idf!38644
2025-04-24 13:34:35 +08:00
Marius Vikhammer
ae2b54430d Merge branch 'fix/multi_core_race_cond_in_panic_handler_v5.3' into 'release/v5.3'
fix(panic_handler): Prevent race condition in panic handler (v5.3)

See merge request espressif/esp-idf!38665
2025-04-24 11:34:47 +08:00
Shu Chen
0da8ecd5f3 Merge branch 'fix/meshcop_udp_port_v5.3' into 'release/v5.3'
fix(openthread/meshcop): get right udp port for publishing meshcop-e (v5.3)

See merge request espressif/esp-idf!38658
2025-04-24 11:06:14 +08:00
Shu Chen
0d1b3956cc Merge branch 'fix/ieee802154_tx_ack_timeout_crash_v5.3' into 'release/v5.3'
fix(802.15.4): fix 15.4 process for unsupported frame (v5.3)

See merge request espressif/esp-idf!38670
2025-04-24 10:59:08 +08:00
morris
fef5594966 fix(parlio): reenable parlio rx driver cache safe test 2025-04-24 10:47:11 +08:00
morris
fa3ee29633 fix(spi): allocate driver memory with caps explicitly 2025-04-24 10:47:11 +08:00
Jiang Jiang Jian
181aeb8245 Merge branch 'bugfix/fix_scan_info_error_in_lr_only_mode_v5.3' into 'release/v5.3'
fix(wifi): Fixed the scan information error in LR only mode (v5.3)

See merge request espressif/esp-idf!37809
2025-04-24 10:39:56 +08:00
Island
c367f335e5 Merge branch 'feat/support_136k_rc_clk_on_ble_sleep_v5.3' into 'release/v5.3'
Feat/support 136k rc clk on ble sleep (v5.3)

See merge request espressif/esp-idf!38620
2025-04-24 10:37:52 +08:00
morris
bbe8bfba44 Merge branch 'bugfix/fix_i2s_assign_and_check_sequence_v5.3' into 'release/v5.3'
fix(i2s): fixed i2s inappropriate check and assign sequence (v5.3)

See merge request espressif/esp-idf!38606
2025-04-24 10:34:09 +08:00
Jiang Jiang Jian
3a0d5d7854 Merge branch 'bugfix/fix_bt_access_ext_mem_in_intr_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed access external memory in isr context (v5.3)

See merge request espressif/esp-idf!38573
2025-04-24 10:22:13 +08:00
Martin Vychodil
2b1150c223 Merge branch 'fix/nvs_tool_false_duplicate_warning_v5.3' into 'release/v5.3'
fix(nvs): nvs_tool.py refactor, reduce false duplicate warnings, add a test (v5.3)

See merge request espressif/esp-idf!33775
2025-04-23 22:14:44 +08:00
Rahul Tank
eac2f08842 fix(nimble): Update hid device example in nimble to work with iOS 2025-04-23 17:19:41 +05:30
Rahul Tank
a11b8f79da Merge branch 'fix/pawr_docs_v5.3' into 'release/v5.3'
feat(nimble):Added tutorials for PAwR examples (v5.3)

See merge request espressif/esp-idf!38623
2025-04-23 19:45:02 +08:00
Rahul Tank
33eb5fc7d7 Merge branch 'feat/pawr_bugfix_v5.3' into 'release/v5.3'
fix(nimble): Fix sync handle assignment for pawr connection (v5.3)

See merge request espressif/esp-idf!38503
2025-04-23 19:36:33 +08:00
zwx
7105516bc1 fix(802.15.4): fix 15.4 process for unsupported frame 2025-04-23 19:01:45 +08:00
Sudeep Mohanty
3dfb9cec3f fix(panic_handler): Prevent race condition in panic handler
This commit updates all RTC WDT contexts to be local instead of global
to avoid race conditions when both cores enter the panic handler
simultaneously.
2025-04-23 12:53:50 +02:00
Tan Yan Quan
a54cc0f79f fix(openthread/meshcop): get right udp port for publishing meshcop-e
* esp-openthread: thread_zigbee/esp-openthread@ad81e1b23
* openthread: espressif/openthread@8c30b93fe
* esp-idf: espressif/esp-idf@aa5357ab7
2025-04-23 10:09:51 +00:00
Roman Leonov
c44f46751a fix(usb_host): Correctly initialize set pipe ep char 2025-04-23 09:59:28 +02:00
Roman Leonov
3750d02cb1 fix(hcd): Added delay to slow down scatter-gather dma for ls device via fs hubs 2025-04-23 09:59:16 +02:00
Konstantin Kondrashov
e89352080f fix(esp_common): Fix DRAM_DMA_ALIGNED_ATTR for P4 2025-04-23 10:37:19 +03:00
Island
aa5357ab70 Merge branch 'bugfix/fix_some_ble_bugs_250331_esp32c3_v5.3' into 'release/v5.3'
Fixed some BLE bugs 250331 on esp32c3 (v5.3)

See merge request espressif/esp-idf!38579
2025-04-23 10:32:45 +08:00
Island
ee7e35a3fc Merge branch 'feat/optimize_cble50y24_111_v5.3' into 'release/v5.3'
feat(bt/bluedroid): Added BLE eddystone sender example (v5.3)

See merge request espressif/esp-idf!38157
2025-04-23 10:32:26 +08:00
Abhinav Kudnar
2f56e5e490 feat(nimble):Added tutorials for PAwR examples 2025-04-22 19:18:45 +08:00
cjin
7d88bc78f9 feat(ble): support ble sleep using 136 kHz RC on ESP32-C6 2025-04-22 19:09:58 +08:00
Jin Chen
31269f3f44 feat(ble): support ble sleep using 136 kHz RC on ESP32-H2
(cherry picked from commit 6c8ee69151)

Co-authored-by: cjin <jinchen@espressif.com>
2025-04-22 19:05:37 +08:00
Jin Chen
e851ff6671 feat(ble): support ble sleep using 136 kHz RC on ESP32-C2
(cherry picked from commit 73f1084bf8)

Co-authored-by: cjin <jinchen@espressif.com>
2025-04-22 19:05:35 +08:00
morris
5bcebb94ed Merge branch 'bugfix/fix_esp32_touch_example_task_watchdog_issue_v5.3' into 'release/v5.3'
fix(legacy_touch): fixed touch read WDT issue on esp32 (v5.3)

See merge request espressif/esp-idf!38582
2025-04-22 18:37:21 +08:00
Sudeep Mohanty
6d9ed9f905 test(freertos): Added a unit test for tickless idle tick jump scenario
This commit adds a unit test to test that tickless idle mode does not
cause an unexpected jump in tick count after tickless idle mode is
exited.
2025-04-22 16:32:20 +08:00
Sudeep Mohanty
f69d77bcb6 fix(freertos): Fixed tickless idle tick count accounting
This commit fixes an issue where the FreeRTOS kernel does not account
for the pended ticks occuring during automatic light-sleep mode and
hence causing a jump in the tick count at a later stage in the
application lifetime.

Closes: https://github.com/espressif/esp-idf/issues/15642
2025-04-22 16:32:20 +08:00
laokaiyao
cdb6426d2e fix(i2s): add check for the minimum sample rate
Closes https://github.com/espressif/esp-idf/issues/15659
2025-04-22 15:41:56 +08:00
laokaiyao
fdcf1dcecc fix(i2s): reset the dma buf_size while allocation failed
Closes https://github.com/espressif/esp-idf/issues/15648
2025-04-22 15:19:51 +08:00
Mahavir Jain
635c4190f8 Merge branch 'feat/add_config_to_set_addrfamily_v5.3' into 'release/v5.3'
feat(tcp_transport): add an api to configure the addr family (v5.3)

See merge request espressif/esp-idf!37912
2025-04-22 12:21:34 +08:00
zhangyanjiao
bccec2b6c1 fix(wifi): update wifi lib for scan and connect issues 2025-04-22 11:59:30 +08:00
zhangyanjiao
e8c42bd62d fix(wifi): fix the noise floor error on ESP32C5
Closes https://github.com/espressif/esp-idf/issues/15594
2025-04-22 11:59:21 +08:00
zhangyanjiao
3f15dfa313 fix(wifi): Update the doc for espnow add peer 2025-04-22 11:52:18 +08:00
zhangyanjiao
63f167570d fix(wifi): Fixed the scan information error when AP in LR only mode 2025-04-22 11:52:01 +08:00
zhangyanjiao
b8a242abca fix(wifi): Fixed the max log level not work when it exceeds the default log level 2025-04-22 11:51:30 +08:00
zhangyanjiao
1c63e3e70c docs(wifi): update the description for esp_mesh_send() return value
Closes https://github.com/espressif/esp-idf/issues/14440
2025-04-22 11:51:17 +08:00
Island
9201b68d1b Merge branch 'fix/blemesh25-92_v5.3' into 'release/v5.3'
fix(ble_mesh): fixed issues with decrypt failed when resending messages (v5.3)

See merge request espressif/esp-idf!38559
2025-04-22 11:50:20 +08:00
Island
2216ed92a0 Merge branch 'bugfix/fix_some_ble_bugs_2503_v5.3' into 'release/v5.3'
Bugfix/fix some ble bugs 2503 (v5.3)

See merge request espressif/esp-idf!38290
2025-04-22 11:48:59 +08:00
Island
8c0f374926 Merge branch 'feat/support_read_periodic_adv_size_v5.3' into 'release/v5.3'
feat(ble/bluedroid): Support read periodic advertiser list size command (v5.3)

See merge request espressif/esp-idf!37503
2025-04-22 11:48:45 +08:00
Island
2a45026a41 Merge branch 'feat/ble_read_long_value_v5.3' into 'release/v5.3'
feat(ble/bluedroid): Add Read Long Characteristic Values example (v5.3)

See merge request espressif/esp-idf!37488
2025-04-22 11:48:32 +08:00
Island
f3dc80e9f6 Merge branch 'bugfix/fix_ble_kconfig_v5.3' into 'release/v5.3'
fix(ble/controller): Fix BLE Kconfig on ESP32 to avoid unexpected behavior (v5.3)

See merge request espressif/esp-idf!37421
2025-04-22 11:48:20 +08:00
Jiang Jiang Jian
0ac4b9a486 Merge branch 'bugfix/sae_send_confirm_v5.3' into 'release/v5.3'
fix(esp_wifi): Fix send_confirm according to specification provided by IEEE 802.11 (v5.3)

See merge request espressif/esp-idf!38435
2025-04-22 10:21:13 +08:00
Jiang Jiang Jian
9312c3595e Merge branch 'esp32/run_panic_debug_v5.3' into 'release/v5.3'
fix(esp32): Fixed qa program may fail issue when cpu 240m (v5.3)

See merge request espressif/esp-idf!37233
2025-04-22 10:20:30 +08:00
laokaiyao
781ccfbd0c fix(touch): fixed tie option take no effect 2025-04-21 20:46:33 +08:00
Chen Jian Hua
eea10e1039 feat(bt/bluedroid): Added BLE eddystone sender example
(cherry picked from commit 06366353d8)

Co-authored-by: zhangbowen <zhangbowen@espressif.com>
2025-04-21 20:24:03 +08:00
Abhinav Kudnar
7dce8f8ecd fix(nimble): Fix sync handle assignment for pawr connection 2025-04-21 18:04:20 +08:00
Zhi Wei Jian
77f5da2cb4 feat(ble/bluedroid): Add sync_cte_type in creat_periodic_adv_sync function
(cherry picked from commit eb647d10c6)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-21 17:03:27 +08:00
Zhi Wei Jian
31d8a68a0b fix(ble/bluedroid): Fixed BLE_FEAT_CREATE_SYNC_ENH define error in bluedroid host
(cherry picked from commit cf6135c990)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-21 17:03:25 +08:00
Roland Dobai
8b725deb56 Merge branch 'bugfix/esp32p4_linker_script_v5.3' into 'release/v5.3'
fix(esp_system): add missing `arrays` attribute in the ESP32-P4 linker script (backport v5.3)

See merge request espressif/esp-idf!36095
2025-04-21 15:54:05 +08:00
Roland Dobai
833adbc27c Merge branch 'fix/linux_std_flags_v5.3' into 'release/v5.3'
fix(build): don't call enable_language() before project() (v5.3)

See merge request espressif/esp-idf!37881
2025-04-21 15:53:28 +08:00
Roland Dobai
d618bb56e1 Merge branch 'fix/remove-unused-from-gdbinit_cmake_v5.3' into 'release/v5.3'
fix(tools): remove unused variables in gdbinit.cmake (v5.3)

See merge request espressif/esp-idf!38046
2025-04-21 15:53:06 +08:00
Roland Dobai
d73b3d8129 Merge branch 'fix/check_python_dependencies_v5.3' into 'release/v5.3'
fix(tools): handle packages with dots in their names during dependency checks (v5.3)

See merge request espressif/esp-idf!38063
2025-04-21 15:49:39 +08:00
Roland Dobai
81968004de Merge branch 'feat/deactivate_idf_env_every_run_v5.3' into 'release/v5.3'
feat(tools): Deactivate current ESP-IDF environment with every export run (v5.3)

See merge request espressif/esp-idf!38027
2025-04-21 15:49:13 +08:00
Roland Dobai
58c14765ae Merge branch 'fix/install_input_validation_v5.3' into 'release/v5.3'
fix(idf_tools): Validate input features (v5.3)

See merge request espressif/esp-idf!37890
2025-04-21 15:48:52 +08:00
Roland Dobai
3f2690aa78 Merge branch 'fix/extractall_deprecation_v5.3' into 'release/v5.3'
fix(idf_tools): Patch extractall() deprecation warning (v5.3)

See merge request espressif/esp-idf!37884
2025-04-21 15:48:34 +08:00
Roland Dobai
28b2914c95 Merge branch 'fix/fix_kconfig_files_v5.3' into 'release/v5.3'
fix(kconfig): Fix issues with Kconfig files (v5.3)

See merge request espressif/esp-idf!37576
2025-04-21 15:48:18 +08:00
Roland Dobai
65699a0bda Merge branch 'change/move_deprecated_kconfig_checker_v5.3' into 'release/v5.3'
change: move check_deprecated_configs.py logic to esp-idf-kconfig (v5.3)

See merge request espressif/esp-idf!37406
2025-04-21 15:48:00 +08:00
laokaiyao
be96ad682b fix(legacy_touch): fixed the concurrent issue in esp32 touch driver 2025-04-21 15:04:43 +08:00
laokaiyao
584092aec1 fix(touch): fixed touch read WDT issue on esp32
Closes https://github.com/espressif/esp-idf/issues/15629
2025-04-21 14:47:38 +08:00
Chen Jian Hua
3dbcb7b7f8 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(a684dd5)
- Fixed clear legacy adv error when adv not exist
- Disable anonymous extended adv reporting
- Fixed BLE assert lld_adv.c 2992
- Fixed heap assert due to adv data buffer double freeing
- Fixed BLE 0x08 disconnect when the win size is greater than half of the conn interval


(cherry picked from commit 4602665e5d)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2025-04-21 14:33:34 +08:00
linruihao
2d39af8aa0 fix(bt/controller): Fixed access external memory in isr context 2025-04-21 14:22:56 +08:00
Jin Cheng
4173a7f896 fix(bt/controller): update libbtdm_app.a
- fixed errors in the coexistance of ACL and SCO
- fixed dynamic priority config error in dual mode
2025-04-21 14:22:56 +08:00
Jiang Jiang Jian
a8381ef00d Merge branch 'bugfix/pmkid_password_mismatch_v5.3' into 'release/v5.3'
fix(wifi): Fix wrong PMKSA cache entry being used when wifi password is changed (Backport v5.3)

See merge request espressif/esp-idf!37472
2025-04-21 14:21:53 +08:00
Island
182b1583c7 Merge branch 'change/ble_update_lib_20250417_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250417 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!38544
2025-04-21 10:40:43 +08:00
Marius Vikhammer
9e2fe50fb0 Merge branch 'fix/lp_wakeup_cause_bits_accumulation_v5.3' into 'release/v5.3'
fix(ulp): Fix accumulation of wakeup cause bits in ULP (v5.3)

See merge request espressif/esp-idf!38562
2025-04-21 08:53:00 +08:00
morris
7356a99938 Merge branch 'bugfix/ppa_srm_scale_frag_yuv420_v5.3' into 'release/v5.3'
fix(ppa): fix ppa srm potentially get blocked when scaling to YUV420 (v5.3)

See merge request espressif/esp-idf!37593
2025-04-19 23:13:40 +08:00
Sarvesh Bodakhe
04a0e6304b fix(wifi): Fix wrong PMKSA cache entry being used when wifi password is changed
Co-authored-by: yinqingzhao <yinqingzhao@espressif.com>
2025-04-19 16:39:56 +05:30
Konstantin Kondrashov
d41fc36511 fix(ulp): Fix accumulation of wakeup cause bits in ULP
Closes https://github.com/espressif/esp-idf/issues/15794
2025-04-18 15:52:46 +03:00
Luo Xu
3679e52a89 fix(ble_mesh): fixed issues with decrypt failed when resending messages
(cherry picked from commit 4803cea3cc)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-04-18 20:23:43 +08:00
Wang Meng Yang
916f1992bd Merge branch 'fix/some_issues_in_bt_controller_v5.3' into 'release/v5.3'
fix(bt): fixed some issues in bt controller(backport v5.3)

See merge request espressif/esp-idf!38449
2025-04-18 17:51:23 +08:00
Shen Wei Long
758eeb45a7 change(ble): [AUTO_MR] Update lib_esp32c6 to cd6ba0ec
(cherry picked from commit a89916eef4)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2025-04-18 14:10:06 +08:00
Shen Wei Long
e6d2a5debb change(ble): [AUTO_MR] Update lib_esp32h2 to cd6ba0ec
(cherry picked from commit d48cc9ce2a)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2025-04-18 14:10:04 +08:00
Tan Yan Quan
0a0da0ce97 fix(openthread): check state for ot wake 2025-04-18 12:15:36 +08:00
Tan Yan Quan
b605247441 fix(openthread): relax CSL accuracy default value 2025-04-18 12:15:36 +08:00
Island
c399ca8fab Merge branch 'change/ble_update_lib_20250414_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250414 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!38493
2025-04-18 11:07:12 +08:00
morris
c4f2a9b192 Merge branch 'fix/usb_host_docs_host_num_chan_reference_backport_v5.3' into 'release/v5.3'
fix(usb_host): Fixing reference to OTG_NUM_HOST_CHAN in docs backport to v5.3

See merge request espressif/esp-idf!37390
2025-04-18 10:25:57 +08:00
morris
643a78d0c4 Merge branch 'docs/add_note_about_twai_instance_install_v5.3' into 'release/v5.3'
docs: Add a note about TWAI multiple instances install (v5.3)

See merge request espressif/esp-idf!37966
2025-04-18 10:25:49 +08:00
morris
950c9df5e5 Merge branch 'fix/fix_mmu_map_concurrent_issue_v5.3' into 'release/v5.3'
mmu: fix mmu map concurrent issue (v5.3)

See merge request espressif/esp-idf!38410
2025-04-17 21:13:28 +08:00
Jiang Jiang Jian
e63d13e0bd Merge branch 'change/allow_keep_sar_poweron_in_light_sleep_v5.3' into 'release/v5.3'
change(esp_hw_support): allow sar power keep on during lightsleep (v5.3)

See merge request espressif/esp-idf!38455
2025-04-17 17:19:22 +08:00
Jiang Jiang Jian
a34413811c Merge branch 'fix/fix_current_leakage_after_ext_osc_detect_failed_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix current leakage if ext32k slow clock source not exists (v5.3)

See merge request espressif/esp-idf!38440
2025-04-17 17:16:46 +08:00
Jiang Jiang Jian
0e84a52417 Merge branch 'fix/esp32p4_xtal_path_not_on_top_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix esp32p4 xtal_xpd depends on TOP power domain (v5.3)

See merge request espressif/esp-idf!38453
2025-04-17 17:14:56 +08:00
Rocha Euripedes
ba53fb402e Merge branch 'fix/fix-test-socks-transport_v5.3' into 'release/v5.3'
fix(tcp_transport): Fix test for socks transport (v5.3)

See merge request espressif/esp-idf!38294
2025-04-17 16:16:29 +08:00
Zhou Xiao
d1b7a2adbd change(ble): bugs fixed on spi ble log
* removed spi master in iram select for flash only firmware
* fixed memory issue in transaction init function
* fixed memory issue in transaction deinit function
2025-04-17 13:43:12 +08:00
Jiang Jiang Jian
a96e966f69 Merge branch 'fix/fix_uart_console_broken_after_sleep_v5.3' into 'release/v5.3'
fix(esp_hw_support): fixed gpio sleep switching filling junk data to the console UART FIFO (v5.3)

See merge request espressif/esp-idf!38445
2025-04-17 11:01:39 +08:00
chaijie@espressif.com
bb0dac0a72 fix(esp32): Fixed qa program may fail issue when cpu 240m (v5.3) 2025-04-17 10:58:51 +08:00
Jiang Jiang Jian
10a20f3388 Merge branch 'ci/add_test_for_ecos_wifi_enterprise_v53' into 'release/v5.3'
ci(c2/c3): add major eco version tests(v5.3)

See merge request espressif/esp-idf!37806
2025-04-17 10:56:45 +08:00
Zhou Xiao
2f511e9a87 fix(ble): remove null pointer assert in npl event deinit
(cherry picked from commit ece108c0bf)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-04-17 10:54:35 +08:00
Zhou Xiao
47ff853520 feat(ble): support configurable rxbuf opt feat on ESP32-C6
(cherry picked from commit 5fbbec8655)

Co-authored-by: cjin <jinchen@espressif.com>
2025-04-17 10:54:33 +08:00
Zhou Xiao
659d7ad3cc feat(ble): support configurable rxbuf opt feat on ESP32-H2
(cherry picked from commit 4937d3c883)

Co-authored-by: cjin <jinchen@espressif.com>
2025-04-17 10:54:31 +08:00
Zhou Xiao
c5ac5e42b3 feat(ble): use new section for ble sleep on ESP32-C2
(cherry picked from commit ce4e012c8b)

Co-authored-by: cjin <jinchen@espressif.com>
2025-04-17 10:54:29 +08:00
Zhou Xiao
246b1ca89d change(ble): [AUTO_MR] Update lib_esp32c2 to fca2b9ea
(cherry picked from commit 09467baed0)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-04-17 10:54:26 +08:00
Zhou Xiao
8c4a9675f7 change(ble): [AUTO_MR] Update lib_esp32c6 to 76549818
(cherry picked from commit e2d1a5509e)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-04-17 10:54:24 +08:00
Zhou Xiao
a666e3edbf change(ble): [AUTO_MR] Update lib_esp32h2 to 76549818
(cherry picked from commit c11bb1ddd0)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-04-17 10:54:22 +08:00
Wang Meng Yang
8b83368211 Merge branch 'feat/add_l2cap_register_event_v5.3' into 'release/v5.3'
feat(bt): Added events for l2cap register and unregister vfs(v5.3)

See merge request espressif/esp-idf!38422
2025-04-17 08:10:51 +08:00
Mahavir Jain
5b2e8f2b38 fix(esp_system): reset crypto peripherals before device restart
This change addresses a rare but critical issue observed on certain
ESP32-C3 and ESP32-S3 devices, where secure boot verification
intermittently fails due to improper cleanup of crypto peripherals
during a restart.

Background – Restart Behavior in IDF
------------------------------------
In ESP-IDF, when the device restarts (via `esp_restart()` or due to a
panic/exception), a partial peripheral reset is performed followed by a
CPU reset. However, until now, crypto-related peripherals were not
included in this selective reset sequence.

Problem Scenario
----------------
If a restart occurs while the application is in the middle of a bignum
operation (i.e., using the MPI/Bignum peripheral), the ROM code may
encounter an inconsistent peripheral state during the subsequent boot.
This leads to transient RSA-PSS secure boot verification failures.

Following such a failure, the ROM typically triggers a full-chip reset
via the watchdog timer (WDT). This full reset clears the crypto
peripheral state, allowing secure boot verification to succeed on the
next boot.

Risk with Aggressive Revocation
-------------------------------
If secure boot aggressive revocation is enabled (disabled by default in
IDF), this transient verification failure could mistakenly lead to
revocation of the secure boot digest.

If your product configuration has aggressive revocation enabled,
applying this fix is strongly recommended.

Frequency of Occurrence
-----------------------
The issue is rare and only occurs in corner cases involving
simultaneous use of the MPI peripheral and an immediate CPU reset.

Fix
---
This fix ensures that all crypto peripherals are explicitly reset prior
to any software-triggered restart (including panic scenarios),
guaranteeing a clean peripheral state for the next boot and preventing
incorrect secure boot behavior.
2025-04-16 20:31:44 +08:00
wuzhenghui
5ce6c51c28 fix(esp_hw_support): fix unused OSC source deinit breaks XTAL32K configuration 2025-04-16 17:19:08 +08:00
wuzhenghui
8d55741d32 fix(esp_hw_support): fix current leakage if ext32k slow clock source not exists 2025-04-16 17:19:04 +08:00
wuzhenghui
9131a6f556 change(esp_hw_support): allow sar power keep on during lightsleep
Closes https://github.com/espressif/esp-idf/issues/12426
2025-04-16 16:05:38 +08:00
wuzhenghui
d8e9167dcf fix(esp_hw_support): fix esp32p4 xtal_xpd depends on TOP power domain 2025-04-16 15:43:05 +08:00
Marius Vikhammer
b187b74bfc Merge branch 'fix/ringbuf_allow_split_receive_crash_v5.3' into 'release/v5.3'
fix(ringbuf): xRingbufferReceive() crashes for allow-split buffers (v5.3)

See merge request espressif/esp-idf!37923
2025-04-16 15:31:12 +08:00
gongyantao
fb5a67c1d3 fix(bt): fixed some issues in bt controller
- add check for Wi-Fi channel
- fix the incorrect unit of duration_min in cpb tx
- recalculate the channel map when afh is enabled
- fix incorrect vendor event count causing an assertion failure
2025-04-16 15:31:04 +08:00
wuzhenghui
1677013d7b fix(esp_hw_support): fixed gpio sleep switching filling junk data to the console UART FIFO 2025-04-16 15:24:52 +08:00
Island
5de769cba4 Merge branch 'change/ble_update_lib_20250313_v5.3' into 'release/v5.3'
change(ble): [AUTO_MR] 20250313 - Update ESP BLE Controller Lib (v5.3)

See merge request espressif/esp-idf!37821
2025-04-16 14:38:01 +08:00
Shreyas Sheth
d5b8462f5b ci(wifi): Add build test for with wpa3 disabled for station and softap 2025-04-16 11:56:31 +05:30
Shreyas Sheth
08993cd527 fix(esp_wifi): Fix send_confirm according to specification provided by IEEE 802.11 2025-04-16 11:56:31 +05:30
Rahul Tank
5ac3846998 Merge branch 'bugfix/fix_few_nimble_issues_15042025_v5.3' into 'release/v5.3'
fix(nimble): Fix few nimble issues_15042025 (v5.3)

See merge request espressif/esp-idf!38424
2025-04-16 14:20:13 +08:00
Song Ruo Jing
ca8c9a297f fix(ppa): fix ppa srm potentially get blocked when scaling to YUV420
YUV420 requires scale_x_frag, scale_y_frag be even
2025-04-16 11:33:26 +08:00
Song Ruo Jing
bf147686a7 fix(dma2d): dma2d_force_end should not crash when rx channel is idle 2025-04-16 11:33:20 +08:00
Island
9a97296876 Merge branch 'feat/support_blecrt_359_v5.3' into 'release/v5.3'
Support BLE vendor hci set rx sensie and max gain on esp32c3 (v5.3)

See merge request espressif/esp-idf!38129
2025-04-16 11:25:15 +08:00
Mahavir Jain
52b43b318d Merge branch 'feat/update_mbedtls_3.6.3_v5.3' into 'release/v5.3'
feat(component/mbedtls): update to upstream v3.6.3 (v5.3)

See merge request espressif/esp-idf!38179
2025-04-16 11:15:26 +08:00
Marius Vikhammer
ce31db18b8 Merge branch 'bugfix/heap_in_flash_v5.3' into 'release/v5.3'
fix(heap): fixed CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH not working together with CONFIG_HEAP_TLSF_USE_ROM_IMPL (v5.3)

See merge request espressif/esp-idf!38122
2025-04-16 11:11:43 +08:00
morris
a29e9974d0 Merge branch 'fix/flash_encryption_verify_write_etc_v5.3' into 'release/v5.3'
fix(spi_flash): Fix flash encryption write verify (backport v5.3)

See merge request espressif/esp-idf!38270
2025-04-16 10:29:13 +08:00
morris
94f6398f35 Merge branch 'fix/i2s_iram_safe_issue_while_use_psram_v5.3' into 'release/v5.3'
fix(i2s): fixed failure when dma is iram_safe but i2s not (v5.3)

See merge request espressif/esp-idf!38004
2025-04-16 10:27:59 +08:00
morris
3fc84fdbca Merge branch 'fix/usb-hal-dwc-host-channel-num_v5.3' into 'release/v5.3'
fix(usb/hal/dwc): Correct host channel number calculation (backport v5.3)

See merge request espressif/esp-idf!37373
2025-04-16 10:21:29 +08:00
morris
b4baef0e47 Merge branch 'fix/usb_phy_pull_override_backport_v5.3' into 'release/v5.3'
fix(usb_phy): Removed pad pull override config for Full-speed (backport to v5.3)

See merge request espressif/esp-idf!36775
2025-04-16 10:21:11 +08:00
morris
f1bc85de12 Merge branch 'fix/usb_host_enum_unchecked_return_coverity_backport_v5.3' into 'release/v5.3'
fix(usb_host): Fixed unchecked return value in enum driver (coverity) (backport to v5.3)

See merge request espressif/esp-idf!36670
2025-04-16 10:20:38 +08:00
morris
3f9d5cac2a Merge branch 'bugfix/clear_ledc_gamma_ram_v5.3' into 'release/v5.3'
fix(ledc): left-off gamma ram registers should be cleared (v5.3)

See merge request espressif/esp-idf!37573
2025-04-16 10:19:51 +08:00
morris
aa9900290a Merge branch 'fix/usb-host-device-close-err-give-semaphore_v5.3' into 'release/v5.3'
fix(usb_host): Give semaphore on attempted close of non-opened device (backport v5.3)

See merge request espressif/esp-idf!38152
2025-04-16 10:19:08 +08:00
morris
7c447b5525 Merge branch 'bugfix/gpio_dump_io_config_v5.3' into 'release/v5.3'
fix(gpio): fix pu, pd, drv value incorrect from gpio_dump_io_configuration on esp32 (v5.3)

See merge request espressif/esp-idf!37909
2025-04-16 10:17:44 +08:00
morris
ba27554f0c Merge branch 'feat/allow_rmt_tx_channel_to_switch_other_gpios_v5.3' into 'release/v5.3'
feat(rmt_tx): allow to switch gpio in tx channal (v5.3)

See merge request espressif/esp-idf!38395
2025-04-16 10:13:08 +08:00
Alexey Gerenkov
67d7cde1f1 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20250226_v5.3' into 'release/v5.3'
feat(tools): update openocd version to v0.12.0-esp32-20250226 (v5.3)

See merge request espressif/esp-idf!37527
2025-04-16 00:12:14 +08:00
Alexey Gerenkov
de7d36f0e9 Merge branch 'fix/apptrace_basic_tests_v5.3' into 'release/v5.3'
test(apptrace): run tests from custom OpenOCD class (v5.3)

See merge request espressif/esp-idf!37603
2025-04-16 00:11:05 +08:00
Alexey Gerenkov
7c1972c120 Merge branch 'fix/esp32p4_apptrace_v5.3' into 'release/v5.3'
fix(apptrace): replace ctrl block into noncache-able TCM  memory (v5.3)

See merge request espressif/esp-idf!38363
2025-04-16 00:08:16 +08:00
Alexey Gerenkov
17fea0dabe Merge branch 'fix/coredump_uart_checksum_error_v5.3' into 'release/v5.3'
Fix/coredump uart checksum error (v5.3)

See merge request espressif/esp-idf!38365
2025-04-15 23:58:21 +08:00
morris
430695b85d Merge branch 'fix/jpeg_dma_stuck_v5.3' into 'release/v5.3'
fix(jpeg): use dma2d empty rx desc event to avoid a stuck on bad quality image (backport v5.3)

See merge request espressif/esp-idf!38263
2025-04-15 21:52:55 +08:00
morris
d808131b51 Merge branch 'fix/i2c_race_condition_etc_v5.3' into 'release/v5.3'
fix(i2c_master): Fix i2c master race condition issue, etc. (backport v5.3)

See merge request espressif/esp-idf!38266
2025-04-15 21:44:29 +08:00
Jiang Jiang Jian
52331299e9 Merge branch 'feature/support_sco_coexist_v5.3' into 'release/v5.3'
feat(coex): Support BR/EDR (e)SCO and Wi-Fi coexistence

See merge request espressif/esp-idf!38134
2025-04-15 19:59:46 +08:00
Shreeyash
fc72283f48 fix(nimble): Fix incorrect OTA address assignment 2025-04-15 17:15:16 +05:30
Rahul Tank
e4da6e3155 fix(nimble): Fixed one missing ble_hs_unlock() 2025-04-15 17:15:01 +05:30
Rahul Tank
27a137cf43 fix(nimble): Handle connection posting condition 2025-04-15 17:14:35 +05:30
Rahul Tank
3182b8381f Merge branch 'bugfix/fix_sscanf_usage_v5.3' into 'release/v5.3'
fix(nimble): Updated sscanf usage in examples to work for all versions (v5.3)

See merge request espressif/esp-idf!38022
2025-04-15 19:24:10 +08:00
Shu Chen
7f7eaf8046 Merge branch 'feature/add_ot_cli_ci_case_v5.3' into 'release/v5.3'
feat(openthread): add openthread ci ssed case v5.3

See merge request espressif/esp-idf!38255
2025-04-15 19:20:13 +08:00
Rahul Tank
c0935d4208 Merge branch 'bugfix/replace_sizeof_with_strlen_v5.3' into 'release/v5.3'
fix(nimble): Replaced incorrect sizeof with strnlen (v5.3)

See merge request espressif/esp-idf!37798
2025-04-15 19:18:30 +08:00
Rahul Tank
84c416079f Merge branch 'fix/periodic_adv_example_v5.3' into 'release/v5.3'
fix(nimble):Fix conversion for min-max itvl of periodic adv param (v5.3)

See merge request espressif/esp-idf!38092
2025-04-15 19:17:14 +08:00
Rahul Tank
002c737d39 Merge branch 'feat/added_change_to_ble_spp_client_v5.3' into 'release/v5.3'
feat(nimble): Allow BLE SPP Client to subscribe to the server (v5.3)

See merge request espressif/esp-idf!37456
2025-04-15 19:16:42 +08:00
xiongweichao
a2d88bf700 fix(bt): fixed spp not reporting write event 2025-04-15 19:07:35 +08:00
xiongweichao
7e3efc45ad fix(bt): Fixed the issue with l2cap not using dynamic memory 2025-04-15 19:07:31 +08:00
xiongweichao
4a64e655de fix(bt): Fixed write_read task stack overflow in l2cap example 2025-04-15 19:07:26 +08:00
xiongweichao
259bc660b3 feat(bt): Added events for l2cap register and unregister vfs 2025-04-15 19:07:21 +08:00
Shu Chen
f8886ebb72 Merge branch 'fix/ldgen_section_name_v53' into 'release/v5.3'
fix(ldgen): extend section name regex to include '_' (v5.3)

See merge request espressif/esp-idf!38326
2025-04-15 14:56:36 +08:00
chenjianhua
2a30f64b71 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(566c8e3)
- Support BLE vendor hci set RX sensitivity and AGC gain command
- Fixed enhanced TX power setting and getting for legacy adv
- Fixed BLE assert lld_con.c 2387
- Fixed compatibility issues during the encryption procedure
- Support BLE vendor hci enable CCA command
2025-04-15 14:48:25 +08:00
morris
13cf4ba87c Merge branch 'bugfix/sdmmc_high_prio_timeout_v5.3' into 'release/v5.3'
fix(sdmmc): move DMA descriptor refilling into the ISR (v5.3)

See merge request espressif/esp-idf!37688
2025-04-15 14:47:50 +08:00
morris
4bab63dc26 Merge branch 'fix/pr_15513_psram_bss_noinit_calc_issue_v5.3' into 'release/v5.3'
psram: correct .bss and .noinit vaddr calculation (v5.3)

See merge request espressif/esp-idf!37663
2025-04-15 14:45:42 +08:00
Chen Jichang
392422573d feat(rmt_tx): allow to switch gpio in tx channal 2025-04-15 14:40:51 +08:00
armando
231694ac25 test(system): increased 200B memory leak thresh due to mmu mmap mutex
200B to extend the thresh, real increase to the memory usage will be smaller
2025-04-15 14:24:23 +08:00
armando
1b763ce920 test(mmu): added esp_mmu_map concurrency test 2025-04-15 14:23:59 +08:00
armando
17f3a1e353 fix(mmu): fixed esp_mmu_map concurrent issue and add related docs 2025-04-15 14:23:56 +08:00
baohongde
a90116fdd1 feat(coex): Support BR/EDR (e)SCO and Wi-Fi coexistence 2025-04-15 14:17:21 +08:00
Ashish Sharma
ededcccda5 feat(mbedtls): new config to allow weak cert verification 2025-04-15 13:10:26 +08:00
Ashish Sharma
45bf1239d6 feat(mbedtls): update to version 3.6.3 2025-04-15 13:10:26 +08:00
C.S.M
6efaf6b85c fix(i2c_master): Fix the stretch happen cause timeout in probe,
Closes https://github.com/espressif/esp-idf/issues/15589
2025-04-15 13:09:12 +08:00
C.S.M
e225e29196 fix(i2c): Fix i2c slave auto selection issue,
Closes https://github.com/espressif/esp-idf/issues/15644
2025-04-15 13:09:12 +08:00
C.S.M
3aeeb7585d fix(i2c): Fix the array size of static operation,
Closes https://github.com/espressif/esp-idf/issues/15583
2025-04-15 13:09:12 +08:00
C.S.M
7f37a6fd66 fix(i2c_master): Fix i2c master race condition issue,
Closes https://github.com/espressif/esp-idf/issues/15444
2025-04-15 13:09:12 +08:00
Mahavir Jain
352704257a Merge branch 'fix/examples_python3.13_ssl_conn_failure_v5.3' into 'release/v5.3'
Change in Python3.13's default ssl context caused SSL connection failure (v5.3)

See merge request espressif/esp-idf!38200
2025-04-15 12:37:07 +08:00
Rahul Tank
70c9a757c7 Merge branch 'fix/ble_issue_10032025_v5.3' into 'release/v5.3'
fix(nimble): Fix some nimble issues ble_issue_10032025_v5.3

See merge request espressif/esp-idf!37623
2025-04-15 12:32:44 +08:00
Shen Weilong
af828cc8f5 fix(ble): fixed a heap assertion issue when enabling BLE for esp32c2 v2.0 2025-04-15 12:21:25 +08:00
Shen Weilong
7856fefea1 feat(ble/controller): Added memory boundary check for ESP32-C2 2025-04-15 12:20:31 +08:00
Shen Weilong
353abd8d22 feat(ble/controller): Added memory boundary check for ESP32-C6 and ESP32-H2 2025-04-15 12:20:20 +08:00
Geng Yuchao
6b123e9cc7 fix(ble): Add link requires esp_phy for ble. 2025-04-15 12:17:03 +08:00
Zhou Xiao
9fc5f5c1ef fix(ble): fix ble log init failure mem leak for ESP32 2025-04-15 12:17:03 +08:00
Zhou Xiao
e4225026b5 fix(ble): fix ble log init failure mem leak for ESP32-C3 2025-04-15 12:17:03 +08:00
cjin
4ad5cebd84 fix(ble): remove macro in lpclk src get api on ESP32-C6 2025-04-15 12:17:03 +08:00
cjin
8e93f25f4d fix(ble): remove macro in lpclk src get api on ESP32-C5 2025-04-15 12:17:03 +08:00
zwl
87838acaed feat(ble): add enhanced connect function on ESP32-C2 2025-04-15 12:17:03 +08:00
Zhou Xiao
c3d2bc6302 feat(ble): support ble log simple output via SPI interface for ESP32-C6 2025-04-15 12:17:03 +08:00
Zhou Xiao
90954505ff feat(ble): support ble log simple output via SPI interface for ESP32-C5 2025-04-15 12:17:03 +08:00
Zhou Xiao
e22a8ff4fc feat(ble): support ble log simple output via SPI interface for ESP32-H2 2025-04-15 12:17:03 +08:00
Zhou Xiao
9c27284fd5 feat(ble): support ble log simple output via SPI interface for ESP32-C2 2025-04-15 12:17:03 +08:00
Zhou Xiao
1dac25fab7 fix(ble): add feed wdts during ble log dump for ESP32-C2 2025-04-15 12:17:03 +08:00
Zhou Xiao
e7dd876456 feat(ble): support ble log simple output via SPI interface 2025-04-15 12:17:03 +08:00
Shu Chen
935f66096f Merge branch 'feature/add_txrx_frame_dump_debugging_v5.3' into 'release/v5.3'
feat(802.15.4): supported tx/rx frame dumping (v5.3)

See merge request espressif/esp-idf!38235
2025-04-15 12:11:08 +08:00
Shu Chen
aa220e7b65 Merge branch 'fix/154_txpower_set_api_v5.3' into 'release/v5.3'
fix(802.15.4): fix the behavior of the `esp_ieee802154_set_txpower` (v5.3)

See merge request espressif/esp-idf!37737
2025-04-15 12:10:44 +08:00
Shu Chen
d84c417459 Merge branch 'feat/update_ot_upstream_v53' into 'release/v5.3'
feat(openthread): update openthread upstream submodule to support BR DNS resolution (v5.3)

See merge request espressif/esp-idf!38187
2025-04-15 12:09:54 +08:00
Shu Chen
4eddf0c42b Merge branch 'fix/csl_rx_off_when_idle_v5.3' into 'release/v5.3'
fix(openthread): turn off rx for SSED running CSL during idle (v5.3)

See merge request espressif/esp-idf!37993
2025-04-15 12:09:42 +08:00
Shu Chen
0ed17a246e Merge branch 'bugfix/fix_ot_ci_cases_avahi_service_issue_v5.3' into 'release/v5.3'
feat(openthread): fix ci avahi service cases issue (v5.3)

See merge request espressif/esp-idf!37862
2025-04-15 12:09:03 +08:00
Shu Chen
0161f5e59c Merge branch 'support/ieee802154_set_txon_delay_using_phylib_impl_v5.3' into 'release/v5.3'
feat(802.15.4): configure tx on delay using phylib implementation (v5.3)

See merge request espressif/esp-idf!37657
2025-04-15 12:07:54 +08:00
Island
97016c986c Merge branch 'feat/optimize_hci_data_recv_process_v5.3' into 'release/v5.3'
Feat/optimize hci data recv process (v5.3)

See merge request espressif/esp-idf!37833
2025-04-15 11:35:08 +08:00
Island
4615344118 Merge branch 'feat/support_bluedroid_host_iso_feature_master_v5.3' into 'release/v5.3'
Fixed controller flash only bug if hci-uart is enabled (v5.3)

See merge request espressif/esp-idf!38162
2025-04-15 11:34:53 +08:00
Marius Vikhammer
7fea3ef20f Merge branch 'bug/xtensa_cpu1_sys_lockup_v5.3' into 'release/v5.3'
fix(panic_handler): Updated panic handler to use RTC WDT (v5.3)

See merge request espressif/esp-idf!37115
2025-04-15 11:05:57 +08:00
morris
5ad0818c9f Merge branch 'refactor/ana_cmpr_driver_v5.3' into 'release/v5.3'
refactor(ana_cmpr): enhanced the driver implementation (v5.3)

See merge request espressif/esp-idf!38389
2025-04-15 10:57:27 +08:00
morris
3816f5f281 Merge branch 'fix/parlio_add_gdma_fifo_reset_v5.3' into 'release/v5.3'
fix(parlio_tx): add clock and fifo reset in disable function (v5.3)

See merge request espressif/esp-idf!36274
2025-04-15 10:47:25 +08:00
Jiang Jiang Jian
fe5e048a56 Merge branch 'fix/fix_sleep_reject_on_esp32_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix short duration sleep requests rejected in pd_flash lightsleep (v5.3)

See merge request espressif/esp-idf!38222
2025-04-15 10:33:19 +08:00
Jiang Jiang Jian
c1c257d47f Merge branch 'bugfix/remove_broken_link_for_wifi_expansion_v5.3' into 'release/v5.3'
bugfix: Remove the broken link in wifi-expansion.rst (v5.3)

See merge request espressif/esp-idf!38333
2025-04-15 10:32:30 +08:00
morris
949b0451d7 Merge branch 'bugfix/ledc_fade_stop_race_condition_v5.3' into 'release/v5.3'
fix(ledc): fix race condition in ledc_fade_stop causing assert failure (v5.3)

See merge request espressif/esp-idf!38081
2025-04-15 10:32:17 +08:00
Jiang Jiang Jian
ca42f3e1a2 Merge branch 'doc/add_wakeup_source_usage_precautions_v5.3' into 'release/v5.3'
change(doc): added more usage notes & warings about PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP (v5.3)

See merge request espressif/esp-idf!37392
2025-04-15 10:32:09 +08:00
Jiang Jiang Jian
71f774e3ca Merge branch 'update/version_5_3_3' into 'release/v5.3'
Update version to 5.3.3

See merge request espressif/esp-idf!38314
2025-04-15 10:30:48 +08:00
morris
086e129cd3 Merge branch 'bugfix/enable_additional_lp_io_wakeup_v5.3' into 'release/v5.3'
fix(lp_io): enable setting edge type wakeup sources for targets that support this (v5.3)

See merge request espressif/esp-idf!36012
2025-04-15 10:30:26 +08:00
morris
1eb1fad16d Merge branch 'bugfix/uart_async_rxtxtasks_example_stack_overflow_v5.3' into 'release/v5.3'
fix(uart): enlarged task stack size for uart_async_rxtxtasks example (v5.3)

See merge request espressif/esp-idf!37591
2025-04-15 10:27:53 +08:00
Jiang Jiang Jian
02dcf4f33d Merge branch 'feature/github_pull_15073_v5.3' into 'release/v5.3'
feat(wpa_supplicant): Add optimized PSK implementation (v5.3)

See merge request espressif/esp-idf!38105
2025-04-15 10:25:53 +08:00
morris
cff4d595e5 Merge branch 'fix/jpeg_decoder_collective_backport_v5.3' into 'release/v5.3'
fix(jpeg_decoder): JPEG Decoder collective backport to v5.3

See merge request espressif/esp-idf!37508
2025-04-15 10:24:04 +08:00
Marius Vikhammer
6d8f288bbc Merge branch 'bugfix/p4_lpwdt_efuse_v5.3' into 'release/v5.3'
fix(lpwdt): P4 LP-WDT now takes into account the EFUSE_WDT_DELAY for the timeout (v5.3)

See merge request espressif/esp-idf!38393
2025-04-15 10:22:09 +08:00
morris
befa9bb4d2 Merge branch 'doc/touch_element_support_esp32s3_v5.3' into 'release/v5.3'
docs(touch): build the touch element doc for esp32s3 (v5.3)

See merge request espressif/esp-idf!38391
2025-04-15 10:21:16 +08:00
morris
5a3ef8e515 Merge branch 'contrib/github_pr_15484_v5.3' into 'release/v5.3'
fix(twai): fixed twai assert fail during recover (GitHub PR) (v5.3)

See merge request espressif/esp-idf!37989
2025-04-15 10:20:15 +08:00
morris
9e58fe0004 Merge branch 'feat/unilc_psram_s3_v5.3' into 'release/v5.3'
psram: supported UnilC octal psram on s3 (v5.3)

See merge request espressif/esp-idf!37855
2025-04-15 10:16:44 +08:00
morris
1a79c5e1ad Merge branch 'bugfix/missing_kconfig_definition_v5.3' into 'release/v5.3'
fix(i2c): add Kconfig to skip driver conflict check (v5.3)

See merge request espressif/esp-idf!37762
2025-04-15 10:15:05 +08:00
morris
46e271ea7c Merge branch 'bugfix/usj_wrong_return_value_v5.3' into 'release/v5.3'
fix(usb_serial_jtag): wrong return value in usb_serial_jtag_write_bytes (v5.3)

See merge request espressif/esp-idf!37970
2025-04-15 10:14:40 +08:00
morris
d69f12a7aa Merge branch 'fix/fix_cam_iram_safe_compile_error_v5.3' into 'release/v5.3'
cam: fix cam iram safe compile error (v5.3)

See merge request espressif/esp-idf!37607
2025-04-15 10:13:57 +08:00
morris
b1c16b8382 Merge branch 'fix/rmt_lim_thres_incorrect_v5.3' into 'release/v5.3'
fix(rmt): fix the received symbols issue (v5.3)

See merge request espressif/esp-idf!37900
2025-04-15 10:13:13 +08:00
morris
227bae6fea Merge branch 'docs/update_i2c_static_v5.3' into 'release/v5.3'
docs: Update static for i2c.rst (v5.3)

See merge request espressif/esp-idf!37765
2025-04-15 10:12:14 +08:00
morris
8bb21fda7c Merge branch 'feat/enable_l2mem_burst_buffer_mode_v5.3' into 'release/v5.3'
improve AXI-ICM QoS function (v5.3)

See merge request espressif/esp-idf!37469
2025-04-15 10:10:52 +08:00
morris
220910fb7e Merge branch 'feat/can_bypass_buffer_align_check_v5.3' into 'release/v5.3'
feat(gdma): allow bypass the alignment check in the link driver (v5.3)

See merge request espressif/esp-idf!37424
2025-04-15 10:10:20 +08:00
morris
89c81ac2c8 Merge branch 'bugfix/rmt_simple_encoder_example_v5.3' into 'release/v5.3'
fix(example): wrong ws2812 reset duration (v5.3)

See merge request espressif/esp-idf!37467
2025-04-15 10:10:12 +08:00
morris
214ba70ed6 Merge branch 'refactor/spi_remove_unnecessary_dependency_v5.3' into 'release/v5.3'
fix(spi): removed PERIPH_CTRL_FUNC_IN_IRAM dependency (v5.3)

See merge request espressif/esp-idf!37564
2025-04-15 10:10:08 +08:00
morris
b4fd30cd5c Merge branch 'contrib/github_pr_15499_v5.3' into 'release/v5.3'
Add missing break statements to usb_serial_jtag_ll_phy_select (GitHub PR) (v5.3)

See merge request espressif/esp-idf!38125
2025-04-15 10:09:21 +08:00
Jiang Jiang Jian
6c1754a0a6 Merge branch 'bugfix/roaming_app_issues_v5.3' into 'release/v5.3'
fix(wifi): Fix some issues observed in roaming app (v5.3)

See merge request espressif/esp-idf!37415
2025-04-15 10:06:57 +08:00
Jiang Jiang Jian
72ae23c6f5 Merge branch 'fix/fix_dhcp_server_recv_decline_issue_v53' into 'release/v5.3'
fix(dhcp): fix dhcp server recv decline issue v53

See merge request espressif/esp-idf!38132
2025-04-15 10:03:39 +08:00
Marius Vikhammer
01a90d2175 fix(newlib): fixed newlib malloc wrappers IRAM/flash placement
If HEAP_PLACE_FUNCTION_INTO_FLASH = y then we should also place
the newlib wrappers for the heap in to flash.
2025-04-15 09:53:21 +08:00
Marius Vikhammer
046a26af5c fix(heap): fixed HEAP_PLACE_FUNCTION_INTO_FLASH disabled if heap impl in ROM 2025-04-15 09:53:21 +08:00
Wang Meng Yang
dd8d184f0a Merge branch 'bugfix/spp_mem_leak_v5.3' into 'release/v5.3'
fix(bt/bluedroid): fixed memory leaks in SPP callback mode (v5.3)

See merge request espressif/esp-idf!37386
2025-04-15 07:51:10 +08:00
Wang Meng Yang
5a011faf69 Merge branch 'feature/add_profile_stat_v5.3' into 'release/v5.3'
feat(bt): Add API to get profile status(v5.3)

See merge request espressif/esp-idf!38276
2025-04-15 07:50:13 +08:00
Wang Meng Yang
91a8ee9057 Merge branch 'bugfix/sec_service_record_conn_fail_v5.3' into 'release/v5.3'
fix(bt/bluedroid): fix the issue of connection failure when initializing multiple profiles(v5.3)

See merge request espressif/esp-idf!38075
2025-04-15 07:47:50 +08:00
Wang Meng Yang
4adf4003a2 Merge branch 'bugfix/err_disc_state_changed_evt_v5.3' into 'release/v5.3'
fix(bt/bluedroid): fixed other events being reported when disconnected(v5.3)

See merge request espressif/esp-idf!37937
2025-04-15 07:46:24 +08:00
Wang Meng Yang
60341250b4 Merge branch 'bugfix/spp_free_server_slot_err_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fixed freeing spp server memory when disconnected(v5.3)

See merge request espressif/esp-idf!37609
2025-04-15 07:46:14 +08:00
Tan Yan Quan
0573caeb54 feat(openthread): add esp_system dependency for SSED CI 2025-04-14 16:34:36 +08:00
Tan Yan Quan
1c019f6dff feat(openthread): relax conditions for trel case approval 2025-04-14 16:34:32 +08:00
Tan Yan Quan
fd0df9d04a feat(openthread): add openthread ci ssed case 2025-04-14 16:34:27 +08:00
Tan Yan Quan
2685cc10e0 feat(openthread): use freertos timer for debug logs 2025-04-14 16:34:21 +08:00
Marius Vikhammer
c15953acee fix(lpwdt): P4 LP-WDT now takes into account the EFUSE_WDT_DELAY forthe timeout 2025-04-14 14:52:23 +08:00
morris
50efd81fc5 docs(touch): build the touch element doc for esp32s3
Closes https://github.com/espressif/esp-idf/issues/15755
2025-04-14 14:51:35 +08:00
morris
f4968da7ce fix(ana_cmpr): ETM event not work for Unit 1 2025-04-14 14:42:21 +08:00
Erhan Kurubas
31b0956051 fix(coredump): make sure consistency with uart data and calculated checksum
Closes https://github.com/espressif/esp-idf-monitor/issues/23
2025-04-10 16:29:13 +02:00
Erhan Kurubas
0206d8442e fix(apptrace): replace esp32p4 ctrl block into noncache-able TCM memory 2025-04-10 16:22:07 +02:00
diplfranzhoepfinger
1d7d24b160 fix(twai): fixed twai assert fail when recover
driver try start new frame in ISR however already bus off

Closes https://github.com/espressif/esp-idf/issues/9697
2025-04-10 20:07:16 +08:00
Rahul Tank
517d3b1749 fix(nimble): Updated sscanf usage in examples to work for all versions 2025-04-09 18:29:44 +05:30
Zhang Shuxian
563c21f930 bugfix: Remove the broken link in wifi-expansion.rst 2025-04-09 19:05:23 +08:00
Alexey Lapshin
6bb3dce495 fix(ldgen): extend section name regex to include '_' (e.g.: used by picolibc) 2025-04-09 16:51:38 +08:00
C.S.M
2881da7024 fix(spi_flash): Add suspend check on esp32c6 and esp32h2 for some reason 2025-04-09 10:14:26 +08:00
Zhang Hai Peng
d72a674119 fix(ble/bluedroid): Fix potential uint32_t overflow in BLE btu_start_timer
(cherry picked from commit a9286567f0)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-04-08 16:42:27 +08:00
Zhang Hai Peng
4729fba793 fix(ble/bluedrooid): Fixed memory leak issue when deinit the host
(cherry picked from commit 6becf74cbb)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-04-08 16:42:27 +08:00
zhanghaipeng
4f136cca74 feat(bluedroid): Support get bt config path 2025-04-08 16:34:32 +08:00
zhanghaipeng
6886dc78c6 feat(ble/bluedroid): Implement BLE channel map reading API 2025-04-08 16:34:12 +08:00
luaijun
2f749a21e7 ci(c2/c3): add major eco version tests 2025-04-08 10:34:19 +08:00
xiongweichao
805543ce42 fix(bt): Fix ci failure due to code spelling errors 2025-04-08 10:05:51 +08:00
glmfe
94e26900cb fix(tcp_transport): Fix test for socks transport
- Removed out of scope stack acess
2025-04-07 12:09:50 -03:00
Zhang Hai Peng
6bdad836ea fix(ble/bluedroid): Fix missing event reporting in esp_ble_create_sc_oob_data
(cherry picked from commit f291725936)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-04-07 21:13:59 +08:00
Zhang Hai Peng
a5b43c72c8 fix(ble/bluedroid): Fixed BLE crash when disable bluedroid host
(cherry picked from commit 9dfa6ab0e9)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-04-07 21:13:57 +08:00
xiongweichao
3721a43afc feat(bt): Add API to get profile status 2025-04-07 19:17:01 +08:00
Kapil Gupta
d4151643ca fix(esp_wifi): Fix some compilation errors in roaming app 2025-04-07 18:58:08 +08:00
Kapil Gupta
ef9da59ea9 fix(esp_wifi): Removed unnecessary handlers to cleanup 2025-04-07 18:58:08 +08:00
Kapil Gupta
dc802d98d3 fix(esp_wifi): Roaming app, sync api naming 2025-04-07 18:58:08 +08:00
Kapil Gupta
2aa64cefae fix(esp_wifi): Some more cleanup for roaming app 2025-04-07 18:58:08 +08:00
Kapil Gupta
5deeaecdf4 fix(esp_wifi): moving around roaming app code a bit 2025-04-07 18:58:08 +08:00
Kapil Gupta
0b8775e1c7 fix(roaming_app): Add get set config params for the app 2025-04-07 18:58:08 +08:00
Kapil Gupta
b353ab7427 fix(wifi): Provide a config option to skip IP renew during roam 2025-04-07 18:58:08 +08:00
Kapil Gupta
a34e915a2a fix(esp_wifi): Set minimum scan time to 30ms in roaming app 2025-04-07 18:58:08 +08:00
Kapil Gupta
9e6700110a fix(wifi): Fix some issues observed in roaming app 2025-04-07 18:58:08 +08:00
Kapil Gupta
e7480577f0 fix(ci): Update UT to verify fast psk calculations
Also update some comments
2025-04-07 18:56:56 +08:00
Kapil Gupta
2a2f77b5b5 fix(esp_wifi): Add some comments in github PR 15073
Closes https://github.com/espressif/esp-idf/pull/15073
2025-04-07 18:56:56 +08:00
Chien Wong
06c2fd5ffe feat(wpa_supplicant): Add optimized PSK impl
Signed-off-by: Chien Wong <m@xv97.com>
2025-04-07 18:56:56 +08:00
zhiweijian
2fd56b7ed8 feat(ble/bluedroid): report cte_type in periodic adv report if CTE feature is enabled 2025-04-07 17:03:07 +08:00
zhiweijian
94ada16554 fix(bt/controller): Fixed controller flash only bug if hci-uart is enabled 2025-04-07 17:02:58 +08:00
C.S.M
0e7fa10217 fix(spi_flash): Return false directly in suspend caps check 2025-04-07 15:26:21 +08:00
C.S.M
e691cbef4d fix(spi_flash): Fix flash encryption write verify,
Closes https://github.com/espressif/esp-idf/issues/15380
2025-04-07 15:26:14 +08:00
C.S.M
acd6896872 fix(jpeg): use dma2d empty rx desc event to avoid a stuck 2025-04-07 13:48:35 +08:00
C.S.M
3ae39a039c feat(dma2d): Add a rx empty event callback 2025-04-07 13:40:57 +08:00
zwx
ee150dbf1c feat(802.15.4) add a build CI test for debugging feature 2025-04-03 17:30:59 +08:00
zwx
6e560ba1de feat(802.15.4): supported tx/rx frame dumping 2025-04-03 17:30:59 +08:00
harshal.patil
28e42429f4 fix(examples): Example CA certs must contain the Key Usage parameter
- Example CA certificates that are used for self-signed client certificates
need to include the Key Usage parameter.
- Python3.13 changed the default context of the SSL context that is
generated using ssl.create_default_context() by enabling the VERIFY_X509_STRICT
flag by default
2025-04-03 10:52:47 +05:30
Rahul Tank
b869b7fd87 fix(nimble): Replaced incorrect sizeof with strnlen 2025-04-03 10:25:53 +05:30
wuzhenghui
28882e9b29 fix(esp_hw_support): fix min sleep time calculation missmatch in powerdown flash decision 2025-04-03 11:44:31 +08:00
Tan Yan Quan
ba45546620 feat(openthread): increase CI timeout for dns CLI commands 2025-04-02 14:42:19 +08:00
Tan Yan Quan
2164e3e7db feat(openthread): update thread-lib to support BR DNS resolution 2025-04-02 14:41:46 +08:00
Tan Yan Quan
a823db9e5d feat(openthread): revert to OT upstream main branch 2025-04-02 14:32:12 +08:00
Tan Yan Quan
7af1de5a82 fix(openthread): change include statement to updated upstream path 2025-04-02 14:32:06 +08:00
Tan Yan Quan
7a84aa6623 fix(openthread): update openthread upstream to support BR DNS resolution 2025-04-02 14:31:13 +08:00
Ondrej Kosta
babd94dd66 ci(esp_eth): enabled Ethernet target tests 2025-04-01 12:42:11 +02:00
zwx
d756c7d25f fix(802.15.4) fix the behavior of the esp_ieee802154_set_txpower 2025-04-01 17:49:22 +08:00
Jonathan Swoboda
680989eb56 fix(esp_eth): Fix order of fields in ETH_ESP32_EMAC_DEFAULT_CONFIG on P4 2025-04-01 07:24:30 +00:00
Ondrej Kosta
87e77f3154 fix(esp_eth): fixed emac_ll_pause_frame_enable for ESP32P4 2025-04-01 08:34:45 +02:00
Ondrej Kosta
9f4acf245a fix(esp_eth): fixed ESP32P4 EMAC REF RMII CLK output mode
fixed units returned and used by periph_rtc_mpll_freq_set function
2025-04-01 08:34:45 +02:00
Zhi Wei Jian
4e24544d1c fix(ble/bluedroid): move setting host feature API to GAP
(cherry picked from commit 79b706ccb0)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-01 11:03:43 +08:00
Zhi Wei Jian
e145fe0566 feat(bt/bluedroid): Support ble bluedroid host connection subrating feature
(cherry picked from commit fc58f2f67d)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-01 11:03:41 +08:00
Zhi Wei Jian
6d44d49dd0 feat(bt/bluedroid): Support ble bluedroid host power control feature
(cherry picked from commit 4f05f6e280)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-01 11:03:39 +08:00
Zhi Wei Jian
7daadbcd90 feat(bt/bluedroid): Support BLE CTE in bluedroid host
(cherry picked from commit fcad8b7ebd)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-01 11:03:37 +08:00
Zhi Wei Jian
a025c1870a feat(bt/bluedroid): Support BLE iso in bluedroid host
(cherry picked from commit 7128087646)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-04-01 11:03:34 +08:00
igor.masar
ddd9d02794 fix(usb_host): Fix return code and description
Changed error code from ESP_ERR_INVALID_STATE to ESP_ERR_NOT_FOUND
when the client never opened the device.
Updated function documentation to correctly reflect return values.
2025-03-31 23:44:32 +02:00
Myk Melez
5750b151cf fix(usb_host): Give semaphore on attempted close of non-opened device
If you call *usb_host_device_close()* for a device that isn't open, the function exits early,
without giving back the semaphore it took, which causes any other call that tries to take
that semaphore to hang indefinitely.

Strangely, there's redundant handling of this condition, with two checks in a row that both handle
the case where `_check_client_opened_device(client_obj, dev_addr)` returns `false`:

```c
    HOST_CHECK_FROM_CRIT(_check_client_opened_device(client_obj, dev_addr), ESP_ERR_NOT_FOUND);
    if (!_check_client_opened_device(client_obj, dev_addr)) {
        // Client never opened this device
        ret = ESP_ERR_INVALID_STATE;
        HOST_EXIT_CRITICAL();
        goto exit;
    }
…
exit:
    xSemaphoreGive(p_host_lib_obj->constant.mux_lock);
    return ret;
```

The first line is the one that exits early, as HOST_CHECK_FROM_CRIT returns its second parameter
if its first parameter is false, without giving back the semaphore (although it does exit
the critical section).

The subsequent block handles the exact same case, except that it ensures the semaphore is given
back before returning. Currently, this block is never reached.

Perhaps the first check was added, then someone noticed the issue and added the second check,
but they forgot to remove the first one.

In any case, this PR removes the first check, so the second check can properly handle this case
by giving back the semaphore before returning.

This bug appears to have been present in the initial commit of the USB Host library to the ESP-IDF
repo: accbaee57c

Of course, if you never try to close a non-opened device, then you won't encounter it!
Unfortunately, I have some code that tried to do that, which is how I found the issue.
2025-03-31 23:44:32 +02:00
Frantisek Hrbata
b8d0de64f8 fix(build): don't call enable_language() before project()
For the Linux target, we currently attempt to fallback to older C/CXX
lagnuage standards in the __build_set_lang_version() function. The
language standard support is checked using CMake's language-specific
functions, such as check_c_compiler_flag(). These functions require the
language to be enabled[1] in CMake beforehand, which is done by calling
project() or by enabling the languages later with enable_language(). At
present, we use enable_language() to enable C and CXX languages in
CMake, allowing us to set the standard early, before invoking project().
However, newer CMake versions (>3.29) issue a warning[2] if
enable_language() is called before project(), as noted in CMP0165[3].

It should generally be acceptable to call __build_set_lang_version()
after __project(), but doing so would alter the behavior of the
COMPILE_OPTIONS also for non-Linux targets. Currently, users can
add to COMPILE_OPTIONS even before calling project() in the project's
CMakeLists.txt and the options will be in the desired order. In other
words, appending to COMPILE_OPTIONS can occur either before or after
calling project() in the project's CMakeLists.txt, with the outcome
remaining consistent. This means the user's settings will appear later
and take priority. However, if __build_set_lang_version() is called
after __project(), the user's COMPILE_OPTIONS settings would be
overridden if set before calling project(). Our documentation[4] explicitly
states that COMPILE_OPTIONS and similar properties should be modified
using idf_build_set_property() after calling project() to prevent
default values from overwriting them.

Even with this guidance, some existing components that modify
COMPILE_OPTIONS before invoking project() might be impacted by this
change. Therefore, separate the language standard settings for non-Linux
and Linux targets. For non-Linux targets, these settings are applied in
__build_set_default_build_specifications(), maintaining the current
behavior. For the Linux target, the language standard is set with
__linux_build_set_lang_version() after calling __project(), ensuring the
languages are already enabled in CMake and no warning is issued. Since the Linux
target is still in preview, this approach should be acceptable,
especially with the existing documentation[4].

Closes https://github.com/espressif/esp-idf/issues/15488

[1] https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#languages
[2] https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9396
[3] https://cmake.org/cmake/help/latest/policy/CMP0165.html#policy:CMP0165
[4] https://docs.espressif.com/projects/esp-idf/en/v5.4/esp32/api-guides/
    build-system.html#overriding-default-build-specifications

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-03-31 14:51:01 +08:00
wangtao@espressif.com
8e11fdf1fd fix(dhcp): fix dhcp server recv decline issue 2025-03-31 14:11:44 +08:00
Renze Nicolai
cb7cdb315e fix: add missing break statements to usb_serial_jtag_ll_phy_select,
Closes https://github.com/espressif/esp-idf/pull/15499
2025-03-31 10:39:18 +08:00
Abhinav Kudnar
3e4a0c2876 fix(nimble): Fix conversion for min-max itvl of periodic adv param 2025-03-28 14:19:40 +08:00
Song Ruo Jing
7b4ac061db fix(ledc): fix race condition in ledc_fade_stop causing assert failure
Closes https://github.com/espressif/esp-idf/issues/15580
2025-03-27 20:17:03 +08:00
xiongweichao
8d5543b191 fix(bt/bluedroid): fix the issue of connection failure when initializing multiple profiles
- Due to the number of service security records exceeding the maximum value, the connection failed
2025-03-27 19:56:52 +08:00
Frantisek Hrbata
99a08577b4 fix(tools): handle packages with dots in their names during dependency checks
The `setuptools` package starting with `v70.1.0`[1] contains built-in
`bdist_wheel` command. Before this version `setuptools` relied on the
`bdist_wheel` command implementation from the `wheel` package. Starting with
`setuptools` `v75.8.1` the `PEP 491`[3] restrictions on the distribution name
of a wheel package are enforced[4], replacting also `.` with `_`.  Note that
`PEP 491` actually allows `.` in the distribution name, but for some reason the
latest packaging docs[10][11] does not, stating that `.` should be replaced
with `_`. This was discussion here[12].

Also the `wheel` package starting with `v0.45.0`[5] is using the `bdist_wheel`
command from `setuptools`.  This means that any package which has `.` in its
distribution name, like `ruamel.yaml.clib`, can have different wheel name,
depending on which version of the `bdist_wheel` command was used.

The `bdist_wheel` command from setuptools prior `v75.8.1` or `wheel` prior
`v0.45.0` will keep the dots in distribution name preserved.  For exaple the
`ruamel.yaml.clib` package will have distribution name
`ruamel.yaml.clib-0.2.12.dist-info. Newer versions will replace the dots with
`_` according to [10][11], creating distribution like
`ruamel_yaml_clib-0.2.12.dist-info`.

From packaging point of view `ruamel.yaml.clib-0.2.12.dist-info` and
`ruamel_yaml_clib-0.2.12.dist-info` are the same packages, but this is not
reflected in `importlib.metadata` prior python 3.10[9], which does not perform
name normalization prior the distribution search. This causes the `version`
from `importlib.metadata` to fail on python prior the 3.10 version if the
package with dots in distribution name was generated with normalized paths with
newer `setuptools`. Note that the distribution name normalization was
backported to some later 3.9 python version.

Let's demonstrate this behavior on a simple package with the
`my.minimal.package` name.

```
my_minimal_package/
├── pkg
│   └── __init__.py
└── setup.py

from setuptools import setup, find_packages

setup(
    name='my.minimal.package',
    version='0.1.0',
    packages=find_packages(),
    install_requires=[],
    entry_points={},
)
```

With python 3.9.0 search for `my.minimal.package` fails because
of the missing name normalization.
```
docker run --rm -it --platform linux/x86_64 python:3.9.0 bash
python -m venv venv
. venv/bin/activate
pip install setuptools==v75.8.1
python setup.py bdist_wheel
pip install dist/my_minimal_package-0.1.0-py3-none-any.whl
python
Python 3.9.0 (default, Nov 18 2020, 13:28:38)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib.metadata import version as get_version
>>> get_version('my.minimal.package')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 551, in version
    return distribution(distribution_name).version
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 524, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 187, in from_name
    raise PackageNotFoundError(name)
importlib.metadata.PackageNotFoundError: my.minimal.package
>>> get_version('my_minimal_package')
'0.1.0'
```

With python 3.10.0 search for both `my.minimal.package` and
`my_minimal_package` succeeds.
```
docker run --rm -it --platform linux/x86_64 python:3.10.0 bash
python
Python 3.10.0 (default, Dec  3 2021, 00:21:30) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from importlib.metadata import version as get_version
>>> get_version('my.minimal.package')
'0.1.0'
>>> get_version('my_minimal_package')
'0.1.0'
```

In our `tools/check_python_dependencies.py` we cannot relay on the default
distribution finder, used in the `version` function from `importlib.metadata`,
to do name normalization on older python versions.  To cope with this,
implement a fallback version search. If `version` fails with
`PackageNotFoundError`, do the name normalization according to [10][11] and try
again.

Note: There is also a `wheel`[6][7] `v0.43.0` package embeded in `setuptools`
along with the new implementation[8].  This one seems to be used if the
external `wheel` package is not available but imported. TBH this is all kinda
messy and I may have overlooked something.

* [1] https://setuptools.pypa.io/en/stable/history.html#v70-1-0
* [2] https://setuptools.pypa.io/en/stable/history.html#v75-8-1
* [3] https://peps.python.org/pep-0491/#escaping-and-unicode
* [4] https://github.com/pypa/setuptools/pull/4766/files
* [5] https://wheel.readthedocs.io/en/stable/news.html
* [6] https://github.com/pypa/setuptools/blob/main/setuptools/_vendor/wheel/__init__.py
* [7] https://github.com/pypa/setuptools/issues/1386
* [8] https://github.com/pypa/setuptools/blob/main/setuptools/command/bdist_wheel.py
* [9] c6ca368867
* [10] https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization
* [11] https://packaging.python.org/en/latest/specifications/binary-distribution-format/
       #escaping-and-unicode
* [12] https://github.com/pypa/setuptools/issues/3777

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-03-27 08:05:07 +01:00
Alexey Lapshin
b64ddb1893 fix(tools): remove unused variables in gdbinit.cmake
Closes https://github.com/espressif/esp-idf/issues/15035
2025-03-26 19:51:33 +07:00
Marek Fiala
f6ddf27a90 feat(tools): Deactivate current ESP-IDF environment with every export run
Unix systems only
2025-03-25 14:20:52 +01:00
laokaiyao
26833a82dd fix(i2s): add check for i2s DMA buffer array allocation
Closes https://github.com/espressif/esp-idf/issues/15607
2025-03-25 15:24:06 +08:00
laokaiyao
8c9ed6c4e1 fix(i2s): fixed mismatch of the i2s and gdma iram-safe config
Closes https://github.com/espressif/esp-idf/issues/15533
2025-03-25 15:17:59 +08:00
Tan Yan Quan
f4d3a0396d fix(openthread): add some bugfixes to pass CI pipeline 2025-03-25 12:22:53 +08:00
Tan Yan Quan
59909d648d refactor(openthread): move isr_handle_timerX to esp_ieee802154_timer 2025-03-25 12:22:53 +08:00
Tan Yan Quan
70bbe45f32 fix(openthread): calibrate CSL tx parameters 2025-03-25 12:22:53 +08:00
Tan Yan Quan
dc2500bd08 fix(openthread): turn off rx for SSED running CSL during idle 2025-03-25 12:06:18 +08:00
Jan Beran
4b3d7a33f4 fix(kconfig): Fix issues with Kconfig files 2025-03-24 10:32:00 +01:00
Geng Yu Chao
c28b58a059 feat(ble): Add Kconfig support for direction finding feature
(cherry picked from commit 8c7af817d89c254714dc9c93414499fead3717d3)

Co-authored-by: Geng Yuchao <gengyuchao@espressif.com>
2025-03-24 11:56:05 +05:30
Geng Yuchao
31e4d7e31b feat(ble):Support Bluetooth LE 5.1 direction finding feature 2025-03-24 11:56:05 +05:30
Rahul Tank
2ebf77da91 fix(nimble): Fix SMP command allocation 2025-03-24 11:56:05 +05:30
Shreeyash
7a6f552df3 feat(nimble): support vendor event mask set and vendor HCI event on nimble host 2025-03-24 11:56:05 +05:30
Rahul Tank
c80e35cbbb fix(nimble): Fix incorrect event deinit in gatt caching discovery 2025-03-24 11:56:05 +05:30
Rahul Tank
27590a7c0c fix(nimble): Exposed the ble_gap_wl_tx_add API to add a device in whitelist 2025-03-24 11:56:05 +05:30
Shen Weilong
e05aee0fa4 feat(bt): support hardware ecc acceleration for bt tinycrypt 2025-03-24 11:56:05 +05:30
Shen Weilong
50d8535b4f change(bt): moved porting/ext/tinycrypt into common 2025-03-24 11:56:05 +05:30
Rahul Tank
fde9c35242 fix(nimble): Fix SC only pairing failure 2025-03-24 11:56:05 +05:30
morris
c15432fc79 fix(usb_serial_jtag): wrong return value in usb_serial_jtag_write_bytes
Closes https://github.com/espressif/esp-idf/issues/15620
2025-03-24 11:46:56 +08:00
Zhang Shuxian
288a133930 docs: Add a note about TWAI multiple instances install 2025-03-24 11:07:50 +08:00
xiongweichao
51591ba7b9 fix(bt/bluedroid): fixed other events being reported when disconnected
- Since no initial value is assigned, the variable evt is a random value,
causing the ESP_BT_GAP_DISC_STATE_CHANGED_EVT event to be reported when
the connection is disconnected.
2025-03-21 11:17:43 +08:00
Sudeep Mohanty
db9d88c0d4 fix(ringbuf): xRingbufferReceive() crashes for allow-split buffers
This commit adds an assert check to xRingbufferReceive() and
xRingbufferReceiveFromISR() functions to prevent them from being used to
retrieve items from an allow-split buffer. Corresponding documentation
has also been updated.
2025-03-20 11:49:14 +01:00
Song Ruo Jing
0077f642df fix(gpio): fix 8/16-bit gpio, rtc/lp_io register access 2025-03-20 17:09:36 +08:00
Song Ruo Jing
47f1a2c81b fix(gpio): fix pu, pd, drv value incorrect from gpio_dump_io_configuration on esp32
Closes https://github.com/espressif/esp-idf/issues/14931
2025-03-20 17:09:28 +08:00
Xu Si Yu
074be51f83 feat(tcp_transport): add an api to configure the addr family 2025-03-20 16:08:02 +08:00
Chen Jichang
0a063c4997 fix(rmt): fix the received symbols issue 2025-03-20 10:36:53 +08:00
morris
04dd4c7c47 fix(i2c): add Kconfig to skip driver conflict check 2025-03-20 10:11:58 +08:00
Radim Karniš
3c8d99d8ef fix(idf_tools): Validate input features 2025-03-19 21:44:43 +01:00
Radim Karniš
61f3968e91 fix(idf_tools): Patch extractall() deprecation warning 2025-03-19 13:48:36 +01:00
yiwenxiu
2fc3a282bb feat(openthread): fix ci avahi service cases issue 2025-03-19 18:07:11 +08:00
armando
d7eb89c7f7 feat(psram): supported new octal psram on s3 2025-03-19 10:23:07 +08:00
Zhao Wei Liang
7399bd6ca4 feat(ble): change nimble whitelist max size to 31
(cherry picked from commit 93357e8613)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:35 +08:00
Zhao Wei Liang
c70eac403d feat(ble): change whitelist max size to 31 on ESP32-C2
(cherry picked from commit 578f2358c6)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:33 +08:00
Zhao Wei Liang
a921ffacee feat(ble): change whitelist max size to 31 on ESP32-C6
(cherry picked from commit 2b435687b0)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:30 +08:00
Zhao Wei Liang
12453eac2b fix(ble): Fixed warning that the gpio is not usable when reconfig hci uart pin
(cherry picked from commit 57417ca30f)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:28 +08:00
Zhao Wei Liang
6c7416bc9a fix(ble): fixed hci driver stack protection fault issue on ESP32-C2
(cherry picked from commit afd44d14b9)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:26 +08:00
Zhao Wei Liang
c4d62abfe9 fix(ble): fixed hci driver stack protection fault issue on ESP32-C6
(cherry picked from commit ec4a1324f5)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:24 +08:00
Zhao Wei Liang
02dc949a8f fix(ble): delete ble_hci_trans header file
(cherry picked from commit 327182e3e6)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:21 +08:00
Zhao Wei Liang
234e604f27 fix(ble): fixed hci assertion issue when uart interference occurs
(cherry picked from commit 84f0b39e4d)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-03-18 16:04:19 +08:00
Zhang Shuxian
c0ba5274a9 docs: Update static for i2c.rst 2025-03-14 12:08:36 +08:00
morris
8a1c9e3cfa fix(axi_icm): qos can be applied to read and write independently 2025-03-12 21:37:29 +08:00
Ivan Grokhotkov
924ad0c3a9 test(sdmmc): add test for high-prio task busy while writing
Related to https://github.com/espressif/esp-idf/issues/13934
2025-03-12 13:06:57 +08:00
Ivan Grokhotkov
f824a827dc fix(sdmmc): move DMA descriptor refilling into the ISR
Previously, as DMA descriptors were processed, the task performing
SDMMC transfer would get woken up and would refill the descriptors.
This design didn't work correctly when higher priority tasks occupied
the CPU for too long, resulting in SDMMC transfer timing out.

This change moves DMA descriptor refilling into SDMMC ISR. Now the
"DMA done" interrupt is delivered back to task context only when
the entire transfer is completed.

Closes https://github.com/espressif/esp-idf/issues/13934
2025-03-12 13:06:57 +08:00
xiongweichao
d127ebb160 fix(bt/bluedroid): Fixed freeing spp server memory when disconnected 2025-03-11 12:03:19 +08:00
armando
9af8b5468c refactor(psram): rename .bss .noinit segments to sections
Closes https://github.com/espressif/esp-idf/pull/15513
2025-03-11 11:43:56 +08:00
Erki Aring
ed2b78e4ce fix(psram): correct heap vaddr calculation
- fixes https://github.com/espressif/esp-idf/issues/15496

Signed-off-by: armando <douyiwen@espressif.com>
2025-03-11 11:43:53 +08:00
zwx
17ae917039 feat(802.15.4): configure tx on delay using phylib impl 2025-03-11 11:37:19 +08:00
Omar Chebib
7721dd5d5d fix(ulp): fix ULP RISC-V interrupt handler corrupting the stack
* Closes https://github.com/espressif/esp-idf/issues/14930
2025-03-10 18:07:26 +08:00
armando
dbb06fb027 test(cam): added cache-safe build test 2025-03-10 10:39:28 +08:00
armando
737a858dab refactor(cam): rename IRAM-Safe to Cache-Safe 2025-03-10 10:38:40 +08:00
armando
241389134b fix(cam): fixed cam iram safe build error 2025-03-10 10:36:35 +08:00
Erhan Kurubas
cf53484fad test(apptrace): run tests from custom OpenOCD class 2025-03-09 17:34:43 +01:00
Song Ruo Jing
5f08f68aa6 docs(uart): aligned the config order in the programming guide with examples
Closes https://github.com/espressif/esp-idf/issues/13182
2025-03-07 21:01:26 +08:00
Song Ruo Jing
6b7c57b520 fix(uart): enlarged task stack size for uart_async_rxtxtasks example
Meanwhile, added CI pytest for some UART examples

Closes https://github.com/espressif/esp-idf/issues/15363
2025-03-07 21:01:26 +08:00
Song Ruo Jing
0ced5fbd21 fix(ledc): overflowed integer argument in ledc_hal_clear_left_off_fade_param 2025-03-07 20:30:20 +08:00
Chen Jichang
546b60f6f1 fix(parlio): fix non-free running test case 2025-03-07 19:44:23 +08:00
Guillaume Souchere
5c62675f45 fix(esp_hw_support): esp_ptr_in_rtc_iram_fast check to return false
esp_ptr_in_rtc_iram_fast logic should be executed if
SOC_RTC_FAST_MEM_SUPPORTED is set but it should also be executed
if IRAM and DRAM region mapping is the same. Remove the
SOC_RTC_IRAM_LOW != SOC_RTC_DRAM_LOW part of the check.

Update heap component to use the modify function appropriately.
2025-03-07 12:24:07 +01:00
igor.masar
e0679b5ba0 fix(usb/hal/dwc): Correct host channel number calculation
The hardware field `ghwcfg2.numhstchnl` is zero-based, meaning the actual
number of available host channels is `numhstchnl + 1`. This off-by-one
error caused the USB Host controller to report N-1 channels instead of N,
leading to premature "No more HCD channels available" errors when
connecting multiple devices.

This issue affects ESP32-S2, ESP32-S3, and ESP32-P4.
2025-03-07 18:30:44 +08:00
Song Ruo Jing
346d084a5d docs(ledc): add notes for ledc_set_fade_with_time API reference
Closes https://github.com/espressif/esp-idf/issues/15085
2025-03-07 17:30:40 +08:00
peter.marcisovsky
3e8d088748 fix(jpeg_decoder): Correctly handle invalid 0xffff JPEG marker 2025-03-07 10:30:10 +01:00
Song Ruo Jing
d173affef0 fix(ledc): left-off gamma ram registers should be cleared
Hardware reads in (range_number+1) fade parameter registers, which could
cause output waveform error.
2025-03-07 17:30:05 +08:00
peter.marcisovsky
1d99ad74fc feat(jpeg_decode): Add support for default Huffman tables
- In case of a missing Huffman table, while decoding a JPEG image
    - Define a default Huff table and add it to JPEG image header
2025-03-07 10:30:04 +01:00
Song Ruo Jing
a1bd7abd1d fix(ledc): updated docs for esp32h2 eco5 bugfix 2025-03-07 17:22:49 +08:00
morris
382466d03a fix(spi): removed PERIPH_CTRL_FUNC_IN_IRAM dependency 2025-03-07 15:45:09 +08:00
Roman Leonov
26ba099bd1 fix(usb_host): Fixed unchecked return value in enum driver (coverity) 2025-03-06 20:19:39 +08:00
Sudeep Mohanty
81109e8bdd fix(panic_handler): Updated panic handler to use RTC WDT
This commit updates the following:
- Updates the panic handler to use only the RTC WDT to reset the system.
- Refactors some of the panic handler code.
- Updates Bluetooth files where in they now feed the WDTs instead of
  reconfiguring them.
- Removes some unnecessary configuration of WDTs from various files.
- Added a unit test to verify that the system does not lock up when the
  panic handler is stuck.
- Updates the memprot unit tests to work with the refactored panic
  handler.

Closes https://github.com/espressif/esp-idf/issues/15166
Closes https://github.com/espressif/esp-idf/issues/15018
Closes https://github.com/espressif/esp-idf/issues/10110
2025-03-06 09:13:17 +01:00
Erhan Kurubas
5d442d0054 test(hmac_soft_jtag): check jtag connection status properly 2025-03-05 15:34:43 +01:00
Erhan Kurubas
47c014f117 feat(tools): update openocd version to v0.12.0-esp32-20250226 2025-03-05 15:34:43 +01:00
Jan Beran
2a401c768c fix(esp_system): Remove unnecessary select from esp_system/Kconfig 2025-03-05 15:09:25 +01:00
peter.marcisovsky
0f58c571cf feat(jpeg_decoder): Correctly set JPEG restart interval 2025-03-05 10:43:07 +01:00
Zhang Hai Peng
ca9ca7d021 feat(ble/bluedroid): Support read periodic advertiser list size command
(cherry picked from commit dcc26e3e4f)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-03-05 15:13:26 +08:00
Shreeyash
5c4ff82aeb feat(nimble): Allow BLE SPP Client to subscribe to the server 2025-03-05 11:40:11 +05:30
Zhang Hai Peng
587eae152f feat(ble/bluedroid): Add Read Long Characteristic Values example
(cherry picked from commit 32e4fb79e8)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-03-04 22:13:35 +08:00
morris
709fe57efd fix(example): wrong ws2812 reset duration
Closes https://github.com/espressif/esp-idf/issues/15498
2025-03-04 11:10:55 +08:00
Omar Chebib
105588b113 fix(esp_system): add missing arrays attribute in the ESP32-P4 linker script 2025-03-03 14:21:17 +08:00
morris
8062ad5a0c feat(gdma): allow bypass the alignment check in the link driver
Closes https://github.com/espressif/esp-idf/issues/15228
2025-03-03 11:21:31 +08:00
Zhang Hai Peng
a903c662db fix(ble/controller): Fix BLE Kconfig on ESP32 to avoid unexpected behavior
(cherry picked from commit 9496949132)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-03-03 11:13:40 +08:00
Jan Beran
94e61d005b change: move check_deprecated_configs.py file to esp-idf-kconfig 2025-02-28 14:51:23 +01:00
wuzhenghui
0d8c311296 change(doc): added more usage notes & warings about PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP 2025-02-28 16:45:51 +08:00
peter.marcisovsky
e638cb8845 fix(usb_host): Fixing dererence to OTG_NUM_HOST_CHAN in docs 2025-02-28 09:33:33 +01:00
Jin Cheng
f58c729e8a fix(bt/bluedroid): fixed memory leaks in SPP callback mode 2025-02-28 16:12:46 +08:00
Chen Jichang
f3eec647aa feat(parlio_tx): backport the clock change to v5.3 2025-02-28 15:03:11 +08:00
Tomas Rezucha
3b2c3cb854 fix(usb/phy): Fixed crash on external PHY init with speed != UNDEFINED
Also deprecated usb_phy_otg_dev_set_speed()
and usb_phy_action() which are no longer used in esp-idf
2025-02-27 15:10:13 +01:00
Roman Leonov
b937bd3a1e fix(usb_phy): Removed pad pull override config for Full-speed 2025-02-27 15:10:13 +01:00
Chen Jichang
25f35910a7 fix(parlio): fix rempty interrupt during resetting fifo
Move the fifo reset to after disabling the tx core clock.
And add external non-free running clock src test.
2025-02-27 15:12:33 +08:00
Marius Vikhammer
8d6d6957ce fix(lp_io): allow edge wakeup types for LP-IO on chips which support it 2025-02-27 14:31:00 +08:00
Chen Jichang
1ff5e64acd fix(parlio_tx): add clock and fifo reset in disable function 2025-02-26 18:41:49 +08:00
Adam Múdry
1d09158bb5 fix: test_nvs_gen_check.py support for read-only NVS partitions 2025-02-21 14:26:48 +01:00
Adam Múdry
14b8dc77a3 fix(nvs): Fix the nvs generator test (write_namespace safer behavior change) 2025-02-21 14:26:36 +01:00
Adam Múdry
9620508388 docs(nvs): Document nvs_check.py functions 2025-02-21 14:26:36 +01:00
Adam Múdry
1eacc6c2a8 feat(nvs): Add raw_data variable to NVS_Partition class in nvs_parser.py 2025-02-21 14:26:36 +01:00
Adam Múdry
eec8a3ab83 feat(nvs): Test nvs_partition_gen.py and nvs_check.py with pytest
Little fixes in nvs_check.py
2024-09-24 16:42:45 +02:00
Adam Múdry
a01257a976 fix(nvs): nvs_tool.py reduce false duplicate warnings 2024-09-24 10:02:11 +02:00
Adam Múdry
e0e131d246 refactor(nvs): nvs_tool.py integrity check refactor 2024-09-24 10:02:11 +02:00
1401 changed files with 47835 additions and 11267 deletions

View File

@@ -8,10 +8,11 @@ on:
jobs:
release_zips:
name: Create release zip file
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Create a recursive clone source zip
uses: espressif/github-actions/release_zips@master
env:
RELEASE_PROJECT_NAME: ESP-IDF
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: espressif/release-zips-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_project_name: ESP-IDF
git_extra_args: --shallow-since="1 year ago"

View File

@@ -219,7 +219,7 @@ pytest_build_system_macos:
PYENV_VERSION: "3.8"
# CCACHE_DIR: "/cache/idf_ccache". On macOS, you cannot write to this folder due to insufficient permissions.
CCACHE_DIR: "" # ccache will use "$HOME/Library/Caches/ccache".
CCACHE_MAXSIZE: "5G" # To preserve the limited Macbook storage. CCACHE automatically prunes old caches to fit the set limit.
build_docker:
extends:
- .before_script:minimal

View File

@@ -39,7 +39,7 @@ variables:
GIT_FETCH_EXTRA_FLAGS: "--no-recurse-submodules --prune --prune-tags"
# we're using .cache folder for caches
GIT_CLEAN_FLAGS: -ffdx -e .cache/
LATEST_GIT_TAG: v5.3.3
LATEST_GIT_TAG: v5.3.4
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
# by default we will fetch all submodules
@@ -177,13 +177,21 @@ variables:
fi
# Custom OpenOCD
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
wget $OOCD_DISTRO_URL
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
tar -x -f $ARCH_NAME
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
export PATH=$PWD/openocd-esp32/bin:$PATH
if [[ "$CI_JOB_STAGE" == "target_test" ]]; then
machine="$(uname -m)"
if [[ "$machine" == "armv7l" ]] ; then
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF"
elif [[ "$machine" == "aarch64" ]] ; then
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64"
fi
if [[ ! -z "$OOCD_DISTRO_URL" ]]; then
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
wget $OOCD_DISTRO_URL
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
tar -x -f $ARCH_NAME
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
export PATH=$PWD/openocd-esp32/bin:$PATH
fi
fi
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then

View File

@@ -19,6 +19,7 @@ check_submodule_sync:
dependencies: []
script:
- git submodule deinit --force .
- rm -rf .git/modules # remove all the cached metadata
# setting the default remote URL to the public one, to resolve relative location URLs
- git config remote.origin.url ${PUBLIC_IDF_URL}
# check if all submodules are correctly synced to public repository

View File

@@ -144,11 +144,16 @@ build_docs_html_partial:
variables:
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
PYTHONUNBUFFERED: 1
# ensure all tags are fetched, need to know the latest/stable tag for the docs
GIT_STRATEGY: clone
GIT_DEPTH: 0
stage: test_deploy
tags:
- deploy
- shiny
script:
# ensure all tags are fetched, need to know the latest/stable tag for the docs
- git fetch --tags --prune
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
- deploy-docs

View File

@@ -133,7 +133,8 @@ test_cli_installer:
script:
# Tools must be downloaded for testing
# We could use "idf_tools.py download all", but we don't want to install clang because of its huge size
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
# cmake@version that is supported
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
- cd ${IDF_PATH}/tools/test_idf_tools
- python3 -m pip install jsonschema
- python3 ./test_idf_tools.py -v
@@ -364,3 +365,17 @@ test_idf_pytest_plugin:
script:
- cd tools/ci/idf_pytest
- pytest --junitxml=${CI_PROJECT_DIR}/XUNIT_RESULT.xml
test_nvs_gen_check:
extends: .host_test_template
artifacts:
paths:
- XUNIT_RESULT.xml
- components/nvs_flash/nvs_partition_tool
reports:
junit: XUNIT_RESULT.xml
variables:
LC_ALL: C.UTF-8
script:
- cd ${IDF_PATH}/components/nvs_flash/nvs_partition_tool
- pytest --noconftest test_nvs_gen_check.py --junitxml=XUNIT_RESULT.xml

View File

@@ -160,6 +160,8 @@ pipeline_variables:
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
fi
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
- cat pipeline.env
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
artifacts:

View File

@@ -31,7 +31,8 @@ test_cli_installer_win:
IDF_PATH: "$CI_PROJECT_DIR"
script:
# Tools must be downloaded for testing
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
# cmake@version that is supported
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
- cd ${IDF_PATH}\tools\test_idf_tools
- python -m pip install jsonschema
- python .\test_idf_tools.py

4
.gitmodules vendored
View File

@@ -54,8 +54,10 @@
sbom-supplier = Person: Dave Gamble
sbom-url = https://github.com/DaveGamble/cJSON
sbom-description = Ultralightweight JSON parser in ANSI C
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
sbom-hash = 8f2beb57ddad1f94bed899790b00f46df893ccac
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
sbom-cve-exclude-list = CVE-2023-26819 Resolved in commit a328d65ad490b64da8c87523cbbfe16050ba5bf6
sbom-cve-exclude-list = CVE-2023-53154 Resolved in v1.7.18
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls

View File

@@ -70,11 +70,6 @@ repos:
language: python
pass_filenames: false
always_run: true
- id: check-deprecated-kconfigs-options
name: Check if any Kconfig Options Deprecated
entry: tools/ci/check_deprecated_kconfigs.py
language: python
files: 'sdkconfig\.ci$|sdkconfig\.rename$|sdkconfig.*$'
- id: cmake-lint
name: Check CMake Files Format
entry: cmakelint --linelength=120 --spaces=4 --filter=-whitespace/indent
@@ -236,6 +231,7 @@ repos:
name: Lint rST files in docs folder using Sphinx Lint
files: ^(docs/en|docs/zh_CN)/.*\.(rst|inc)$
- repo: https://github.com/espressif/esp-idf-kconfig.git
rev: v2.4.1
rev: v2.5.0
hooks:
- id: check-kconfig-files
- id: check-deprecated-kconfig-options

View File

@@ -655,5 +655,4 @@ mainmenu "Espressif IoT Development Framework Configuration"
- CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
- CONFIG_ESP_WIFI_EAP_TLS1_3
- CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
- CONFIG_USB_HOST_EXT_PORT_SUPPORT_LS
- CONFIG_USB_HOST_EXT_PORT_RESET_ATTEMPTS

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@@ -92,7 +92,7 @@ static esp_err_t esp_apptrace_membufs_swap(esp_apptrace_membufs_proto_data_t *pr
// switch to new block
proto->state.in_block++;
proto->hw->swap(new_block_num);
proto->hw->swap(new_block_num, proto->state.markers[prev_block_num]);
// handle data from host
esp_hostdata_hdr_t *hdr = (esp_hostdata_hdr_t *)proto->blocks[new_block_num].start;
@@ -148,6 +148,18 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
if (res != ESP_OK) {
break;
}
#if CONFIG_IDF_TARGET_ESP32S3
/*
* ESP32S3 has a serious data corruption issue with the transferred data to host.
* This delay helps reduce the failure rate by temporarily reducing heavy memory writes
* from RTOS-level tracing and giving OpenOCD more time to read trace memory before
* the current thread continues execution. While this doesn't completely prevent
* memory access from other threads/cores/ISRs, it has shown to significantly improve
* reliability when combined with CRC checks in OpenOCD. In practice, this reduces the
* number of retries needed to read an entire block without corruption.
*/
esp_rom_delay_us(100);
#endif
}
return res;
}
@@ -339,7 +351,7 @@ uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *p
esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_membufs_pkt_end(ptr);
// TODO: mark block as busy in order not to re-use it for other tracing calls until it is completely written
// TODO: mark block as busy in order not to reuse it for other tracing calls until it is completely written
// TODO: avoid potential situation when all memory is consumed by low prio tasks which can not complete writing due to
// higher prio tasks and the latter can not allocate buffers at all
// this is abnormal situation can be detected on host which will receive only uncompleted buffers

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@@ -50,14 +50,20 @@ static uint8_t *esp_apptrace_riscv_down_buffer_get(esp_apptrace_riscv_data_t *hw
static esp_err_t esp_apptrace_riscv_down_buffer_put(esp_apptrace_riscv_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static bool esp_apptrace_riscv_host_is_connected(esp_apptrace_riscv_data_t *hw_data);
static esp_err_t esp_apptrace_riscv_buffer_swap_start(uint32_t curr_block_id);
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id);
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len);
static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len);
static bool esp_apptrace_riscv_host_data_pending(void);
const static char *TAG = "esp_apptrace";
static esp_apptrace_riscv_ctrl_block_t s_tracing_ctrl[CONFIG_FREERTOS_NUMBER_OF_CORES];
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
#define APPTRACE_DRAM_ATTR TCM_DRAM_ATTR
#else
#define APPTRACE_DRAM_ATTR
#endif
static APPTRACE_DRAM_ATTR esp_apptrace_riscv_ctrl_block_t s_tracing_ctrl[CONFIG_FREERTOS_NUMBER_OF_CORES];
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
{
@@ -92,7 +98,7 @@ esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
}
/* Advertises apptrace control block address to host.
This function can be overriden with custom implementation,
This function can be overridden with custom implementation,
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) int esp_apptrace_advertise_ctrl_block(void *ctrl_block_addr)
{
@@ -103,7 +109,7 @@ __attribute__((weak)) int esp_apptrace_advertise_ctrl_block(void *ctrl_block_add
}
/* Returns up buffers config.
This function can be overriden with custom implementation,
This function can be overridden with custom implementation,
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) void esp_apptrace_get_up_buffers(esp_apptrace_mem_block_t mem_blocks_cfg[2])
{
@@ -165,7 +171,7 @@ static esp_err_t esp_apptrace_riscv_init(esp_apptrace_riscv_data_t *hw_data)
}
// notify host about control block address
int res = esp_apptrace_advertise_ctrl_block(&s_tracing_ctrl[core_id]);
assert(res == 0 && "Falied to send config to host!");
assert(res == 0 && "Failed to send config to host!");
return ESP_OK;
}
@@ -347,7 +353,7 @@ static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint3
return ESP_OK;
}
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id)
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
{
/* do nothing */
return ESP_OK;

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@@ -12,7 +12,7 @@
// ======================
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
// Exectution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
// Execution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
// trace memory via its registers by means of JTAG, APB or ERI transactions.
// ESP32 has two Xtensa cores with separate TRAX modules on them and provides two special memory regions to be used as trace memory.
// Chip allows muxing access to those trace memory blocks in such a way that while one block is accessed by CPUs another one can be accessed by host
@@ -47,7 +47,7 @@
// 2. TRAX Registers layout
// ========================
// This module uses two TRAX HW registers to communicate with host SW (OpenOCD).
// This module uses two TRAX HW registers and one Performance Monitor register to communicate with host SW (OpenOCD).
// - Control register uses TRAX_DELAYCNT as storage. Only lower 24 bits of TRAX_DELAYCNT are writable. Control register has the following bitfields:
// | 31..XXXXXX..24 | 23 .(host_connect). 23| 22..(block_id)..15 | 14..(block_len)..0 |
// 14..0 bits - actual length of user data in trace memory block. Target updates it every time it fills memory block and exposes it to host.
@@ -55,9 +55,15 @@
// 21..15 bits - trace memory block transfer ID. Block counter. It can overflow. Updated by target, host should not modify it. Actually can be 2 bits;
// 22 bit - 'host data present' flag. If set to one there is data from host, otherwise - no host data;
// 23 bit - 'host connected' flag. If zero then host is not connected and tracing module works in post-mortem mode, otherwise in streaming mode;
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
// See 'Targets Connection' setion for details.
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
// See 'Targets Connection' section for details.
// - CRC16 register uses ERI_PERFMON_PM1 as storage. This register is used to store CRC16 checksum of the exposed trace memory block.
// The register has the following format:
// | 31..16 (CRC indicator) | 15..0 (CRC16 value) |
// CRC indicator (0xA55A) is used to distinguish valid CRC values from other data that might be in the register.
// CRC16 is calculated over the entire exposed block and is updated every time a block is exposed to the host.
// This allows the host to verify data integrity of the received trace data.
// 3. Modes of operation
// =====================
@@ -127,7 +133,7 @@
// Access to internal module's data is synchronized with custom mutex. Mutex is a wrapper for portMUX_TYPE and uses almost the same sync mechanism as in
// vPortCPUAcquireMutex/vPortCPUReleaseMutex. The mechanism uses S32C1I Xtensa instruction to implement exclusive access to module's data from tasks and
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlaying mutex in cycle until
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlying mutex in cycle until
// it gets its ownership or timeout expires. The differences of application tracing module's mutex implementation from vPortCPUAcquireMutex/vPortCPUReleaseMutex are:
// - Support for timeouts.
// - Local IRQs for CPU which owns the mutex are disabled till the call to unlocking routine. This is made to avoid possible task's prio inversion.
@@ -142,9 +148,9 @@
// Timeout mechanism is based on xthal_get_ccount() routine and supports timeout values in microseconds.
// There are two situations when task/ISR can be delayed by tracing API call. Timeout mechanism takes into account both conditions:
// - Trace data are locked by another task/ISR. When wating on trace data lock.
// - Trace data are locked by another task/ISR. When waiting on trace data lock.
// - Current TRAX memory input block is full when working in streaming mode (host is connected). When waiting for host to complete previous block reading.
// When wating for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
// When waiting for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
// time exceeds specified timeout value operation is canceled and ESP_ERR_TIMEOUT code is returned.
#include "sdkconfig.h"
#include "soc/soc.h"
@@ -159,11 +165,15 @@
#include "esp_log.h"
#include "esp_app_trace_membufs_proto.h"
#include "esp_app_trace_port.h"
#include "esp_rom_crc.h"
// TRAX is disabled, so we use its registers for our own purposes
// | 31..XXXXXX..24 | 23 .(host_connect). 23 | 22 .(host_data). 22| 21..(block_id)..15 | 14..(block_len)..0 |
#define ESP_APPTRACE_TRAX_CTRL_REG ERI_TRAX_DELAYCNT
#define ESP_APPTRACE_TRAX_STAT_REG ERI_TRAX_TRIGGERPC
#define ESP_APPTRACE_TRAX_CRC16_REG ERI_PERFMON_PM1
#define ESP_APPTRACE_CRC_INDICATOR (0xA55AU << 16)
#define ESP_APPTRACE_TRAX_BLOCK_LEN_MSK 0x7FFFUL
#define ESP_APPTRACE_TRAX_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
@@ -198,7 +208,7 @@ static uint8_t *esp_apptrace_trax_down_buffer_get(esp_apptrace_trax_data_t *hw_d
static esp_err_t esp_apptrace_trax_down_buffer_put(esp_apptrace_trax_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static bool esp_apptrace_trax_host_is_connected(esp_apptrace_trax_data_t *hw_data);
static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id);
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id);
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len);
static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len);
static bool esp_apptrace_trax_host_data_pending(void);
@@ -498,7 +508,8 @@ static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
uint32_t acked_block = ESP_APPTRACE_TRAX_BLOCK_ID_GET(ctrl_reg);
uint32_t host_to_read = ESP_APPTRACE_TRAX_BLOCK_LEN_GET(ctrl_reg);
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)) {
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32, esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32,
esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
res = ESP_ERR_NO_MEM;
goto _on_err;
@@ -514,14 +525,22 @@ static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32
{
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(new_block_id) |
host_connected | ESP_APPTRACE_TRAX_BLOCK_LEN(prev_block_len));
esp_apptrace_trax_buffer_swap_unlock();
return ESP_OK;
}
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id)
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
{
/* Before switching to the new block, calculate CRC16 of the current block */
if (prev_block_len > 0) {
const uint8_t *prev_block_start = s_trax_blocks[!((new_block_id % 2))];
uint16_t crc16 = esp_rom_crc16_le(0, prev_block_start, prev_block_len);
eri_write(ESP_APPTRACE_TRAX_CRC16_REG, crc16 | ESP_APPTRACE_CRC_INDICATOR);
ESP_APPTRACE_LOGD("CRC16:%x %d @%x", crc16, prev_block_len, prev_block_start);
}
esp_apptrace_trax_select_memory_block(new_block_id);
return ESP_OK;
}

View File

@@ -29,7 +29,7 @@ typedef struct {
typedef struct {
esp_err_t (*swap_start)(uint32_t curr_block_id);
esp_err_t (*swap)(uint32_t new_block_id);
esp_err_t (*swap)(uint32_t new_block_id, uint32_t prev_block_len);
esp_err_t (*swap_end)(uint32_t new_block_id, uint32_t prev_block_len);
bool (*host_data_pending)(void);
} esp_apptrace_membufs_proto_hw_t;

View File

@@ -108,7 +108,7 @@ static void _cbSendTaskList(void) {
* Called from SystemView when asked by the host, returns the
* current system time in micro seconds.
*/
static U64 _cbGetTime(void) {
__attribute__((unused)) static U64 _cbGetTime(void) {
U64 Time;
Time = xTaskGetTickCountFromISR();
@@ -260,7 +260,10 @@ void SYSVIEW_SendTaskInfo(U32 TaskID, const char* sName, unsigned Prio, U32 Stac
*/
// Callbacks provided to SYSTEMVIEW by FreeRTOS
const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
_cbGetTime,
/* Callback _cbGetTime locks xKernelLock inside xTaskGetTickCountFromISR, this can cause deadlock on multi-core.
To prevent deadlock, always lock xKernelLock before s_sys_view_lock. Omitting the callback here results in sending
SYSVIEW_EVTID_SYSTIME_CYCLES events instead of SYSVIEW_EVTID_SYSTIME_US */
NULL,
_cbSendTaskList,
};

View File

@@ -801,6 +801,33 @@ menu "Security features"
This can lead to permanent bricking of the device, in case all keys are revoked
because of signature verification failure.
config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool "Do not disable the ability to further read protect eFuses"
depends on SECURE_BOOT_V2_ENABLED
default n
help
If not set (default, recommended), on first boot the bootloader will burn the WR_DIS_RD_DIS
efuse when Secure Boot is enabled. This prevents any more efuses from being read protected.
If this option is set, it will remain possible to write the EFUSE_RD_DIS efuse field after Secure
Boot is enabled. This may allow an attacker to read-protect the BLK2 efuse (for ESP32) and
BLOCK4-BLOCK10 (i.e. BLOCK_KEY0-BLOCK_KEY5)(for other chips) holding the secure boot public key digest,
causing an immediate denial of service and possibly allowing an additional fault injection attack to
bypass the signature protection.
The option must be set when you need to program any read-protected key type into the efuses,
e.g., HMAC, ECDSA etc. after secure boot has already been enabled on the device.
Please refer to secure boot V2 documentation guide for more details.
NOTE: Once a BLOCK is read-protected, the application will read all zeros from that block
NOTE: If "UART ROM download mode (Permanently disabled (recommended))" or
"UART ROM download mode (Permanently switch to Secure mode (recommended))" is set,
then it is __NOT__ possible to read/write efuses using espefuse.py utility.
However, efuse can be read/written from the application
Please refer to the Secure Boot V2 documentation guide for more information.
config SECURE_BOOT_FLASH_BOOTLOADER_DEFAULT
bool "Flash bootloader along with other artifacts when using the default flash command"
depends on SECURE_BOOT_V2_ENABLED && SECURE_BOOT_BUILD_SIGNED_BINARIES
@@ -981,26 +1008,6 @@ menu "Security features"
image to this length. It is generally not recommended to set this option, unless you have a legacy
partitioning scheme which doesn't support 64KB aligned partition lengths.
config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool "Allow additional read protecting of efuses"
depends on SECURE_BOOT_INSECURE && SECURE_BOOT_V2_ENABLED
help
If not set (default, recommended), on first boot the bootloader will burn the WR_DIS_RD_DIS
efuse when Secure Boot is enabled. This prevents any more efuses from being read protected.
If this option is set, it will remain possible to write the EFUSE_RD_DIS efuse field after Secure
Boot is enabled. This may allow an attacker to read-protect the BLK2 efuse (for ESP32) and
BLOCK4-BLOCK10 (i.e. BLOCK_KEY0-BLOCK_KEY5)(for other chips) holding the public key digest, causing an
immediate denial of service and possibly allowing an additional fault injection attack to
bypass the signature protection.
NOTE: Once a BLOCK is read-protected, the application will read all zeros from that block
NOTE: If "UART ROM download mode (Permanently disabled (recommended))" or
"UART ROM download mode (Permanently switch to Secure mode (recommended))" is set,
then it is __NOT__ possible to read/write efuses using espefuse.py utility.
However, efuse can be read/written from the application
config SECURE_BOOT_ALLOW_UNUSED_DIGEST_SLOTS
bool "Leave unused digest slots available (not revoke)"
depends on SECURE_BOOT_INSECURE && SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS
@@ -1220,7 +1227,7 @@ menu "Security features"
It is also possible to enable secure download mode at runtime by calling
esp_efuse_enable_rom_secure_download_mode()
Note: Secure Download mode is not available for ESP32 (includes revisions till ECO3).
Note: Secure Download mode is not available for ESP32.
config SECURE_INSECURE_ALLOW_DL_MODE
bool "UART ROM download mode (Enabled (not recommended))"

View File

@@ -36,6 +36,10 @@ if(CONFIG_APP_BUILD_TYPE_APP_2NDBOOT)
)
endif()
if(CONFIG_ESP_ROM_REV0_HAS_NO_ECDSA_INTERFACE)
list(APPEND srcs "src/${IDF_TARGET}/bootloader_ecdsa.c")
endif()
if(BOOTLOADER_BUILD OR CONFIG_APP_BUILD_TYPE_RAM)
set(include_dirs "include" "bootloader_flash/include"
"private_include")
@@ -50,10 +54,6 @@ if(BOOTLOADER_BUILD OR CONFIG_APP_BUILD_TYPE_RAM)
"src/${IDF_TARGET}/bootloader_${IDF_TARGET}.c"
)
list(APPEND priv_requires hal)
if(CONFIG_ESP_ROM_REV0_HAS_NO_ECDSA_INTERFACE)
list(APPEND srcs
"src/${IDF_TARGET}/bootloader_ecdsa.c")
endif()
else()
list(APPEND srcs
"src/idf/bootloader_sha.c")

View File

@@ -28,12 +28,21 @@ extern "C" {
*/
__attribute__((always_inline))
inline static bool esp_dram_match_iram(void) {
bool dram_match_iram = (SOC_DRAM_LOW == SOC_IRAM_LOW) &&
(SOC_DRAM_HIGH == SOC_IRAM_HIGH);
return ((SOC_DRAM_LOW == SOC_IRAM_LOW) && (SOC_DRAM_HIGH == SOC_IRAM_HIGH));
}
/**
* @brief Check if the RTC IRAM and RTC DRAM are separate or using the same memory space
*
* @return true if the RTC DRAM and RTC IRAM are sharing the same memory space, false otherwise
*/
__attribute__((always_inline))
inline static bool esp_rtc_dram_match_rtc_iram(void) {
#if SOC_RTC_FAST_MEM_SUPPORTED
dram_match_iram &= (SOC_RTC_IRAM_LOW == SOC_RTC_DRAM_LOW);
return ((SOC_RTC_IRAM_LOW == SOC_RTC_DRAM_LOW) && (SOC_RTC_IRAM_HIGH == SOC_RTC_DRAM_HIGH));
#else
return false;
#endif
return dram_match_iram;
}
/**
@@ -103,7 +112,7 @@ inline static bool esp_ptr_in_diram_iram(const void *p) {
*/
__attribute__((always_inline))
inline static bool esp_ptr_in_rtc_iram_fast(const void *p) {
#if SOC_RTC_FAST_MEM_SUPPORTED && (SOC_RTC_IRAM_LOW != SOC_RTC_DRAM_LOW)
#if SOC_RTC_FAST_MEM_SUPPORTED
return ((intptr_t)p >= SOC_RTC_IRAM_LOW && (intptr_t)p < SOC_RTC_IRAM_HIGH);
#else
(void)p;

View File

@@ -28,6 +28,7 @@
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
static const char* TAG = "boot_comm";
@@ -242,7 +243,10 @@ rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
#if ESP_ROM_HAS_LP_ROM
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_LOW)
#else
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
/* Since the structure containing the retain_mem_t is aligned on 8 by the linker, make sure we align this
* structure size here too */
#define RETAIN_MEM_SIZE ALIGN_UP(sizeof(rtc_retain_mem_t), 8)
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - RETAIN_MEM_SIZE)
#endif //ESP_ROM_HAS_LP_ROM
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
return s_bootloader_retain_mem;

View File

@@ -1,10 +1,11 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <strings.h>
#include "hal/ecdsa_ll.h"
#include "esp_flash_encrypt.h"
#include "esp_secure_boot.h"
#include "esp_efuse.h"
@@ -36,6 +37,12 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
if (ecdsa_ll_is_configurable_curve_supported()) {
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
}
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -47,7 +47,12 @@ static const char *TAG = "esp_image";
#define HASH_LEN ESP_IMAGE_HASH_LEN
#define SIXTEEN_MB 0x1000000
#if SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP
#define ESP_IMAGE_MAX_FLASH_ADDR_SIZE UINT32_MAX
#else
#define ESP_IMAGE_MAX_FLASH_ADDR_SIZE 0x1000000
#endif
#define ESP_ROM_CHECKSUM_INITIAL 0xEF
/* Headroom to ensure between stack SP (at time of checking) and data loaded from flash */
@@ -138,7 +143,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
verify_sha = (part->offset != ESP_BOOTLOADER_OFFSET) && do_verify;
#endif
if (part->size > SIXTEEN_MB) {
if (part->size > ESP_IMAGE_MAX_FLASH_ADDR_SIZE) {
err = ESP_ERR_INVALID_ARG;
FAIL_LOAD("partition size 0x%"PRIx32" invalid, larger than 16MB", part->size);
}
@@ -297,7 +302,7 @@ esp_err_t esp_image_verify(esp_image_load_mode_t mode, const esp_partition_pos_t
esp_err_t esp_image_get_metadata(const esp_partition_pos_t *part, esp_image_metadata_t *metadata)
{
esp_err_t err;
if (metadata == NULL || part == NULL || part->size > SIXTEEN_MB) {
if (metadata == NULL || part == NULL || part->size > ESP_IMAGE_MAX_FLASH_ADDR_SIZE) {
return ESP_ERR_INVALID_ARG;
}
@@ -751,7 +756,7 @@ static esp_err_t process_segment_data(int segment, intptr_t load_addr, uint32_t
static esp_err_t verify_segment_header(int index, const esp_image_segment_header_t *segment, uint32_t segment_data_offs, bool silent)
{
if ((segment->data_len & 3) != 0
|| segment->data_len >= SIXTEEN_MB) {
|| segment->data_len >= ESP_IMAGE_MAX_FLASH_ADDR_SIZE) {
if (!silent) {
ESP_LOGE(TAG, "invalid segment length 0x%"PRIx32, segment->data_len);
}

View File

@@ -12,6 +12,10 @@
#include "esp_secure_boot.h"
#include "hal/efuse_hal.h"
#ifdef SOC_ECDSA_SUPPORTED
#include "hal/ecdsa_ll.h"
#endif
#ifndef BOOTLOADER_BUILD
static __attribute__((unused)) const char *TAG = "secure_boot";
@@ -331,6 +335,23 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
}
#endif
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
if (ecdsa_ll_is_configurable_curve_supported()) {
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
if (!secure) {
uint8_t current_curve;
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, &current_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
if (err == ESP_OK) {
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
// If not P256 mode
result &= secure;
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
}
}
}
}
#endif
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
secure = esp_efuse_read_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
result &= secure;

View File

@@ -468,6 +468,19 @@ if(CONFIG_BT_ENABLED)
list(APPEND srcs "esp_ble_mesh/core/bluedroid_host/adapter.c")
endif()
if(CONFIG_BT_BLE_FEAT_ISO_EN)
list(APPEND srcs "host/bluedroid/stack/btm/btm_ble_iso.c"
"host/bluedroid/btc/profile/std/iso/btc_iso_ble.c"
"host/bluedroid/api/esp_ble_iso_api.c"
"host/bluedroid/hci/ble_hci_iso.c")
endif()
if(CONFIG_BT_BLE_FEAT_CTE_EN)
list(APPEND srcs "host/bluedroid/stack/btm/btm_ble_cte.c"
"host/bluedroid/btc/profile/std/cte/btc_ble_cte.c"
"host/bluedroid/api/esp_ble_cte_api.c")
endif()
endif()
if(CONFIG_BLE_MESH)
@@ -645,23 +658,25 @@ if(CONFIG_BT_ENABLED)
if(NOT (CONFIG_BT_LE_CRYPTO_STACK_MBEDTLS OR CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS))
list(APPEND include_dirs
porting/ext/tinycrypt/include
common/tinycrypt/include
common/tinycrypt/port
)
list(APPEND srcs "porting/ext/tinycrypt/src/utils.c"
"porting/ext/tinycrypt/src/sha256.c"
"porting/ext/tinycrypt/src/ecc.c"
"porting/ext/tinycrypt/src/ctr_prng.c"
"porting/ext/tinycrypt/src/ctr_mode.c"
"porting/ext/tinycrypt/src/aes_decrypt.c"
"porting/ext/tinycrypt/src/aes_encrypt.c"
"porting/ext/tinycrypt/src/ccm_mode.c"
"porting/ext/tinycrypt/src/ecc_dsa.c"
"porting/ext/tinycrypt/src/cmac_mode.c"
"porting/ext/tinycrypt/src/ecc_dh.c"
"porting/ext/tinycrypt/src/hmac_prng.c"
"porting/ext/tinycrypt/src/ecc_platform_specific.c"
"porting/ext/tinycrypt/src/hmac.c"
"porting/ext/tinycrypt/src/cbc_mode.c")
list(APPEND srcs "common/tinycrypt/src/utils.c"
"common/tinycrypt/src/sha256.c"
"common/tinycrypt/src/ecc.c"
"common/tinycrypt/src/ctr_prng.c"
"common/tinycrypt/src/ctr_mode.c"
"common/tinycrypt/src/aes_decrypt.c"
"common/tinycrypt/src/aes_encrypt.c"
"common/tinycrypt/src/ccm_mode.c"
"common/tinycrypt/src/ecc_dsa.c"
"common/tinycrypt/src/cmac_mode.c"
"common/tinycrypt/src/ecc_dh.c"
"common/tinycrypt/src/hmac_prng.c"
"common/tinycrypt/src/ecc_platform_specific.c"
"common/tinycrypt/src/hmac.c"
"common/tinycrypt/src/cbc_mode.c"
"common/tinycrypt/port/esp_tinycrypt_port.c")
endif()
if(CONFIG_BT_NIMBLE_ENABLED)
@@ -924,12 +939,15 @@ if(CONFIG_BT_ENABLED)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_panic_handler")
endif()
if(CONFIG_IDF_TARGET_ESP32C6)
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a")
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a"
REQUIRES esp_phy)
else()
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY AND CONFIG_IDF_TARGET_ESP32C2)
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app_flash.a")
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app_flash.a"
REQUIRES esp_phy)
else()
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a")
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a"
REQUIRES esp_phy)
endif()
endif()
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)

View File

@@ -12,6 +12,14 @@ config BT_BLE_LOG_SPI_OUT_ENABLED
help
Output ble logs to SPI bus
config BT_BLE_LOG_SPI_OUT_UL_TASK_BUF_SIZE
int "SPI transaction buffer size for upper layer task logs"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default 512
help
SPI transaction buffer size for upper layer task logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_HCI_ENABLED
bool "Enable HCI log output to SPI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
@@ -19,6 +27,21 @@ config BT_BLE_LOG_SPI_OUT_HCI_ENABLED
help
Enable logging of HCI packets to the SPI bus when BLE SPI log output is enabled.
config BT_BLE_LOG_SPI_OUT_HCI_BUF_SIZE
int "SPI transaction buffer size for HCI logs"
depends on BT_BLE_LOG_SPI_OUT_HCI_ENABLED
default 1024
help
SPI transaction buffer size for HCI logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_HCI_TASK_CNT
int "HCI task count"
depends on BT_BLE_LOG_SPI_OUT_HCI_ENABLED
default 1
help
HCI task count
config BT_BLE_LOG_SPI_OUT_HOST_ENABLED
bool "Enable Host log output to SPI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
@@ -27,51 +50,150 @@ config BT_BLE_LOG_SPI_OUT_HOST_ENABLED
This configuration applies to the logs of both Bluedroid Host and NimBLE Host.
When BLE SPI log output is enabled, this option allows host logs to be transmitted via SPI.
config BT_BLE_LOG_SPI_OUT_QUEUE_SIZE
int "Number of ble log async SPI output queues"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default 4
config BT_BLE_LOG_SPI_OUT_HOST_BUF_SIZE
int "SPI transaction buffer size for host logs"
depends on BT_BLE_LOG_SPI_OUT_HOST_ENABLED
default 1024
help
The number of ble log async SPI output queues
SPI transaction buffer size for host logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_TRANS_BUF_SIZE
int "Size of ble log async SPI output transaction buffer size"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default 2048
config BT_BLE_LOG_SPI_OUT_HOST_TASK_CNT
int "Host task count"
depends on BT_BLE_LOG_SPI_OUT_HOST_ENABLED
default 2
help
The size of ble log async SPI output transaction buffer size
Host task count.
config BT_BLE_LOG_SPI_OUT_LL_ENABLED
bool "Enable Controller log output to SPI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
depends on BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
default n
help
Enable controller log output to SPI bus.
config BT_BLE_LOG_SPI_OUT_LL_TASK_BUF_SIZE
int "SPI transaction buffer size for lower layer task logs"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 1024
help
SPI transaction buffer size for lower layer task logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
int "SPI transaction buffer size for lower layer ISR logs"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 512
help
SPI transaction buffer size for lower layer ISR logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_LL_HCI_BUF_SIZE
int "SPI transaction buffer size for lower layer HCI logs"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 512
help
SPI transaction buffer size for upper layer HCI logs.
There will be 2 SPI DMA buffers with the same size
config BT_BLE_LOG_SPI_OUT_MOSI_IO_NUM
int "GPIO number of SPI MOSI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default 0
help
GPIO number of SPI MOSI
GPIO number of SPI MOSI
config BT_BLE_LOG_SPI_OUT_SCLK_IO_NUM
int "GPIO number of SPI SCLK"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default 1
help
GPIO number of SPI SCLK
GPIO number of SPI SCLK
config BT_BLE_LOG_SPI_OUT_CS_IO_NUM
int "GPIO number of SPI CS"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default 2
help
GPIO number of SPI CS
GPIO number of SPI CS
config BT_BLE_LOG_SPI_OUT_TS_SYNC_ENABLED
bool "Enable ble log & logic analyzer log time sync"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default y
help
Enable ble log & logic analyzer log time sync
Enable ble log & logic analyzer log time sync
config BT_BLE_LOG_SPI_OUT_SYNC_IO_NUM
int "GPIO number of SYNC IO"
depends on BT_BLE_LOG_SPI_OUT_TS_SYNC_ENABLED
default 3
help
GPIO number of SYNC IO
GPIO number of SYNC IO
config BT_BLE_LOG_SPI_OUT_TS_SYNC_SLEEP_SUPPORT
bool "Enable ble log & logic analyzer log time sync sleep support"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default y
help
Enable ble log & logic analyzer log time sync sleep support
config BT_BLE_LOG_SPI_OUT_FLUSH_TIMER_ENABLED
bool "Enable periodic buffer flush out"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default n
help
Enable periodic buffer flush out
Not recommended when SPI receiver is unavailable
config BT_BLE_LOG_SPI_OUT_FLUSH_TIMEOUT
int "Buffer flush out period in unit of ms"
depends on BT_BLE_LOG_SPI_OUT_FLUSH_TIMER_ENABLED
default 1000
help
Buffer flush out period in unit of ms
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
bool "Enable LE Audio log output to SPI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default n
help
Enable LE Audio log output to SPI
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_BUF_SIZE
int "SPI transaction buffer size for LE Audio logs"
depends on BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
default 1024
help
SPI transaction buffer size for LE Audio logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_TASK_CNT
int "LE audio task count"
depends on BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
default 1
help
LE audio task count
config BT_BLE_LOG_SPI_OUT_MESH_ENABLED
bool "Enable BLE mesh log output to SPI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default n
help
Enable BLE mesh log output to SPI
config BT_BLE_LOG_SPI_OUT_MESH_BUF_SIZE
int "SPI transaction buffer size for BLE mesh logs"
depends on BT_BLE_LOG_SPI_OUT_MESH_ENABLED
default 1024
help
SPI transaction buffer size for BLE mesh logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_MESH_TASK_CNT
int "Mesh task count"
depends on BT_BLE_LOG_SPI_OUT_MESH_ENABLED
default 3
help
Mesh task count

File diff suppressed because it is too large Load Diff

View File

@@ -12,36 +12,53 @@
#include "driver/gpio.h"
#include "esp_timer.h"
#include "freertos/semphr.h"
#include "esp_heap_caps.h"
// Public typedefs
#define BLE_LOG_SPI_OUT_SOURCE_ESP 0
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY 1
#define BLE_LOG_SPI_OUT_SOURCE_BLUEDROID 2
#define BLE_LOG_SPI_OUT_SOURCE_NIMBLE 3
#define BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM 4
#define BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM 5
#define BLE_LOG_SPI_OUT_SOURCE_USER 0x10
#define BLE_LOG_SPI_OUT_SOURCE_SYNC 0xFE
#define BLE_LOG_SPI_OUT_SOURCE_LOSS 0xFF
// Public enums
enum {
BLE_LOG_SPI_OUT_SOURCE_ESP = 0,
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY,
BLE_LOG_SPI_OUT_SOURCE_BLUEDROID,
BLE_LOG_SPI_OUT_SOURCE_NIMBLE,
BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM,
BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM,
BLE_LOG_SPI_OUT_SOURCE_ESP_ISR,
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR,
BLE_LOG_SPI_OUT_SOURCE_LL_HCI,
BLE_LOG_SPI_OUT_SOURCE_LE_AUDIO,
BLE_LOG_SPI_OUT_SOURCE_MESH,
BLE_LOG_SPI_OUT_SOURCE_USER = 0x10,
BLE_LOG_SPI_OUT_SOURCE_SSC = 0xFD,
BLE_LOG_SPI_OUT_SOURCE_SYNC,
BLE_LOG_SPI_OUT_SOURCE_LOSS,
};
// SPI Log Level Definitions
#define BLE_LOG_SPI_OUT_LEVEL_NONE 0 /*!< No log output */
#define BLE_LOG_SPI_OUT_LEVEL_ERROR 1 /*!< Critical errors that SPI driver cannot recover from */
#define BLE_LOG_SPI_OUT_LEVEL_WARN 2 /*!< Recoverable error conditions in SPI communication */
#define BLE_LOG_SPI_OUT_LEVEL_INFO 3 /*!< Informational messages about SPI transactions */
#define BLE_LOG_SPI_OUT_LEVEL_DEBUG 4 /*!< Detailed debug information, such as SPI register values */
#define BLE_LOG_SPI_OUT_LEVEL_VERBOSE 5 /*!< Very detailed debugging logs, potentially flooding output */
#define BLE_LOG_SPI_OUT_LEVEL_MAX 6 /*!< Number of SPI log levels supported */
#define BLE_LOG_SPI_OUT_LEVEL_NONE 0
#define BLE_LOG_SPI_OUT_LEVEL_ERROR 1
#define BLE_LOG_SPI_OUT_LEVEL_WARN 2
#define BLE_LOG_SPI_OUT_LEVEL_INFO 3
#define BLE_LOG_SPI_OUT_LEVEL_DEBUG 4
#define BLE_LOG_SPI_OUT_LEVEL_VERBOSE 5
#define BLE_LOG_SPI_OUT_STR(x) #x
#define BLE_LOG_SPI_OUT_XSTR(x) BLE_LOG_SPI_OUT_STR(x)
#define BLE_LOG_SPI_OUT_BUILD_PREFIX(LEVEL, TAG) "[" BLE_LOG_SPI_OUT_XSTR(LEVEL) "][" TAG "]"
// Public functions
void ble_log_spi_out_init(void);
int ble_log_spi_out_init(void);
void ble_log_spi_out_deinit(void);
void ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_t len);
void ble_log_spi_out_write_esp(uint32_t len, const uint8_t *addr, bool end);
void ble_log_spi_out_timer_control(bool enable);
int ble_log_spi_out_write(uint8_t source, const uint8_t *addr, uint16_t len);
void ble_log_spi_out_ll_write(uint32_t len, const uint8_t *addr, uint32_t len_append,\
const uint8_t *addr_append, uint32_t flag);
void ble_log_spi_out_ll_log_ev_proc(void);
void ble_log_spi_out_ts_sync_start(void);
void ble_log_spi_out_ts_sync_stop(void);
int ble_log_spi_out_printf(uint8_t source, const char *format, ...);
int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...);
void ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len);
void ble_log_spi_out_dump_all(void);
void ble_log_spi_out_enable(bool enable);
void ble_log_spi_out_flush(void);
void ble_log_spi_out_le_audio_write(const uint8_t *addr, uint16_t len);
int ble_log_spi_out_host_write(uint8_t source, const char *prefix, const char *format, ...);
int ble_log_spi_out_hci_write(uint8_t source, const uint8_t *addr, uint16_t len);
int ble_log_spi_out_mesh_write(const char *prefix, const char *format, ...);
#endif // __BT_SPI_OUT_H__

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -16,6 +16,12 @@ void **btc_profile_cb_tab;
void esp_profile_cb_reset(void)
{
#if BTC_DYNAMIC_MEMORY == TRUE
if (btc_profile_cb_tab == NULL) {
return;
}
#endif
int i;
for (i = 0; i < BTC_PID_NUM; i++) {
@@ -25,6 +31,12 @@ void esp_profile_cb_reset(void)
int btc_profile_cb_set(btc_pid_t profile_id, void *cb)
{
#if BTC_DYNAMIC_MEMORY == TRUE
if (btc_profile_cb_tab == NULL) {
return -1;
}
#endif
if (profile_id < 0 || profile_id >= BTC_PID_NUM) {
return -1;
}
@@ -36,6 +48,12 @@ int btc_profile_cb_set(btc_pid_t profile_id, void *cb)
void *btc_profile_cb_get(btc_pid_t profile_id)
{
#if BTC_DYNAMIC_MEMORY == TRUE
if (btc_profile_cb_tab == NULL) {
return NULL;
}
#endif
if (profile_id < 0 || profile_id >= BTC_PID_NUM) {
return NULL;
}

View File

@@ -24,6 +24,8 @@
#include "btc_gattc.h"
#include "btc_gatt_common.h"
#include "btc_gap_ble.h"
#include "btc_iso_ble.h"
#include "btc_ble_cte.h"
#include "btc/btc_dm.h"
#include "bta/bta_gatt_api.h"
#if CLASSIC_BT_INCLUDED
@@ -210,7 +212,7 @@ static const btc_func_t profile_tab[BTC_PID_NUM] = {
[BTC_PID_RPR_CLIENT] = {btc_ble_mesh_rpr_client_call_handler, btc_ble_mesh_rpr_client_cb_handler },
#endif /* CONFIG_BLE_MESH_RPR_CLI */
#if CONFIG_BLE_MESH_RPR_SRV
[BTC_PID_RPR_SERVER] = {NULL, btc_ble_mesh_rpr_server_cb_handler },
[BTC_PID_RPR_SERVER] = {btc_ble_mesh_rpr_server_call_handler, btc_ble_mesh_rpr_server_cb_handler },
#endif /* CONFIG_BLE_MESH_RPR_SRV */
#if CONFIG_BLE_MESH_SAR_CLI
[BTC_PID_SAR_CLIENT] = {btc_ble_mesh_sar_client_call_handler, btc_ble_mesh_sar_client_cb_handler },
@@ -258,6 +260,12 @@ static const btc_func_t profile_tab[BTC_PID_NUM] = {
[BTC_PID_BLE_MESH_BLE_COEX] = {btc_ble_mesh_ble_call_handler, btc_ble_mesh_ble_cb_handler },
#endif /* CONFIG_BLE_MESH_BLE_COEX_SUPPORT */
#endif /* #if CONFIG_BLE_MESH */
#if (BLE_FEAT_ISO_EN == TRUE)
[BTC_PID_ISO_BLE] = {btc_iso_ble_call_handler, btc_iso_ble_cb_handler },
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
#if (BLE_FEAT_CTE_EN == TRUE)
[BTC_PID_BLE_CTE] = {btc_ble_cte_call_handler, btc_ble_cte_cb_handler },
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
};
/*****************************************************************************
@@ -476,10 +484,10 @@ static bt_status_t btc_init_mem(void) {
#endif
#if BTC_HF_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if ((hf_local_param_ptr = (hf_local_param_t *)osi_malloc(BTC_HF_NUM_CB * sizeof(hf_local_param_t))) == NULL) {
if ((hf_local_param_ptr = (hf_local_param_t *)osi_malloc(sizeof(hf_local_param_t))) == NULL) {
goto error_exit;
}
memset((void *)hf_local_param_ptr, 0, BTC_HF_NUM_CB * sizeof(hf_local_param_t));
memset((void *)hf_local_param_ptr, 0, sizeof(hf_local_param_t));
#endif
#if BTC_HF_CLIENT_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
@@ -522,9 +530,18 @@ bt_status_t btc_init(void)
return BT_STATUS_NOMEM;
}
#endif
#if BTC_GAP_BT_INCLUDED
btc_gap_bt_init();
#endif
#if (BLE_INCLUDED == TRUE)
btc_gap_callback_init();
#if (BLE_FEAT_ISO_EN == TRUE)
btc_iso_callback_init();
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
#if (BLE_FEAT_CTE_EN == TRUE)
btc_cte_callback_init();
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
btc_gap_ble_init();
#endif ///BLE_INCLUDED == TRUE
@@ -534,6 +551,9 @@ bt_status_t btc_init(void)
void btc_deinit(void)
{
#if BTC_GAP_BT_INCLUDED
btc_gap_bt_deinit();
#endif
#if BTC_DYNAMIC_MEMORY
btc_deinit_mem();
#endif

View File

@@ -105,6 +105,12 @@ typedef enum {
BTC_PID_MBT_SERVER,
BTC_PID_BLE_MESH_BLE_COEX,
#endif /* CONFIG_BLE_MESH */
#if (BLE_FEAT_ISO_EN == TRUE)
BTC_PID_ISO_BLE,
#endif // #if (BLE_FEAT_ISO_EN == TRUE)
#if (BLE_FEAT_CTE_EN == TRUE)
BTC_PID_BLE_CTE,
#endif // #if (BLE_FEAT_CTE_EN == TRUE)
BTC_PID_NUM,
} btc_pid_t; //btc profile id

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -298,7 +298,7 @@ int esp_blufi_gatt_svr_deinit(void)
return 0;
}
static int
int
esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
{
struct ble_gap_conn_desc desc;
@@ -331,7 +331,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
}
if (event->connect.status != 0) {
/* Connection failed; resume advertising. */
esp_blufi_adv_start();
((void(*)(void))arg)();
}
return 0;
case BLE_GAP_EVENT_DISCONNECT:
@@ -366,7 +366,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
case BLE_GAP_EVENT_ADV_COMPLETE:
ESP_LOGI(TAG, "advertise complete; reason=%d",
event->adv_complete.reason);
esp_blufi_adv_start();
((void(*)(void))arg)();
return 0;
case BLE_GAP_EVENT_SUBSCRIBE:
@@ -461,7 +461,7 @@ void esp_blufi_adv_start(void)
adv_params.conn_mode = BLE_GAP_CONN_MODE_UND;
adv_params.disc_mode = BLE_GAP_DISC_MODE_GEN;
rc = ble_gap_adv_start(own_addr_type, NULL, BLE_HS_FOREVER,
&adv_params, esp_blufi_gap_event, NULL);
&adv_params, esp_blufi_gap_event, esp_blufi_adv_start);
if (rc != 0) {
ESP_LOGE(TAG, "error enabling advertisement; rc=%d", rc);
return;
@@ -511,7 +511,10 @@ void esp_blufi_disconnect(void)
ble_gap_terminate(blufi_env.conn_id, BLE_ERR_REM_USER_CONN_TERM);
}
void esp_blufi_adv_stop(void) {}
void esp_blufi_adv_stop(void)
{
ble_gap_adv_stop();
}
void esp_blufi_send_encap(void *arg)
{

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -10,6 +10,7 @@
#include "bt_common.h"
#include "osi/mutex.h"
#include "esp_attr.h"
#include "esp_timer.h"
#if (BT_HCI_LOG_INCLUDED == TRUE)
#define BT_HCI_LOG_PRINT_TAG (1)
@@ -124,6 +125,11 @@ static char IRAM_ATTR *bt_data_type_to_str(uint8_t data_type)
// self-defining data
tag = "S";
break;
case HCI_LOG_DATA_TYPE_ISO_DATA:
// 5.2 iso data
tag = "I";
break;
break;
default:
// unknown data type
tag = "U";
@@ -203,6 +209,8 @@ esp_err_t IRAM_ATTR bt_hci_log_record_data(bt_hci_log_t *p_hci_log_ctl, char *st
{
osi_mutex_t mutex_lock;
uint8_t *g_hci_log_buffer;
int64_t ts;
uint8_t *temp_buf;
if (!p_hci_log_ctl->p_hci_log_buffer) {
return ESP_FAIL;
@@ -214,6 +222,16 @@ esp_err_t IRAM_ATTR bt_hci_log_record_data(bt_hci_log_t *p_hci_log_ctl, char *st
return ESP_FAIL;
}
ts = esp_timer_get_time();
temp_buf = (uint8_t *)malloc(data_len + 8);
memset(temp_buf, 0x0, data_len + 8);
memcpy(temp_buf, &ts, 8);
memcpy(temp_buf + 8, data, data_len);
data_len += 8;
mutex_lock = p_hci_log_ctl->mutex_lock;
osi_mutex_lock(&mutex_lock, OSI_MUTEX_MAX_TIMEOUT);
@@ -245,7 +263,7 @@ esp_err_t IRAM_ATTR bt_hci_log_record_data(bt_hci_log_t *p_hci_log_ctl, char *st
bt_hci_log_record_string(p_hci_log_ctl, str);
}
bt_hci_log_record_hex(p_hci_log_ctl, data, data_len);
bt_hci_log_record_hex(p_hci_log_ctl, temp_buf, data_len);
g_hci_log_buffer[p_hci_log_ctl->log_record_in] = '\n';
@@ -261,6 +279,8 @@ esp_err_t IRAM_ATTR bt_hci_log_record_data(bt_hci_log_t *p_hci_log_ctl, char *st
osi_mutex_unlock(&mutex_lock);
free(temp_buf);
return ESP_OK;
}

View File

@@ -21,6 +21,7 @@ extern "C" {
#define HCI_LOG_DATA_TYPE_ADV (5)
#define HCI_LOG_DATA_TYPE_SELF_DEFINE (6)
#define HCI_LOG_DATA_TYPE_C2H_ACL (7)
#define HCI_LOG_DATA_TYPE_ISO_DATA (8)
/**
*

View File

@@ -1,4 +1,8 @@
/* aes.h - TinyCrypt interface to an AES-128 implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* cbc_mode.h - TinyCrypt interface to a CBC mode implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* ccm_mode.h - TinyCrypt interface to a CCM mode implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* cmac_mode.h -- interface to a CMAC implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved

View File

@@ -1,4 +1,8 @@
/* constants.h - TinyCrypt interface to constants */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* ctr_mode.h - TinyCrypt interface to CTR mode */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* ctr_prng.h - TinyCrypt interface to a CTR-PRNG implementation */
/*

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* ecc.h - TinyCrypt interface to common ECC functions */
/* Copyright (c) 2014, Kenneth MacKay

View File

@@ -1,4 +1,8 @@
/* ecc_dh.h - TinyCrypt interface to EC-DH implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (c) 2014, Kenneth MacKay

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* ecc_dh.h - TinyCrypt interface to EC-DSA implementation */
/*

View File

@@ -1,4 +1,8 @@
/* uECC_platform_specific.h - Interface to platform specific functions*/
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* Copyright (c) 2014, Kenneth MacKay
* All rights reserved.

View File

@@ -1,4 +1,8 @@
/* hmac.h - TinyCrypt interface to an HMAC implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
@@ -124,7 +128,7 @@ int tc_hmac_update(TCHmacState_t ctx, const void *data,
* key == NULL or
* taglen != TC_SHA256_DIGEST_SIZE
* @note ctx is erased before exiting. This should never be changed/removed.
* @note Assumes the tag bufer is at least sizeof(hmac_tag_size(state)) bytes
* @note Assumes the tag buffer is at least sizeof(hmac_tag_size(state)) bytes
* state has been initialized by tc_hmac_init
* @param tag IN/OUT -- buffer to receive computed HMAC tag
* @param taglen IN -- size of tag in bytes

View File

@@ -1,4 +1,8 @@
/* hmac_prng.h - TinyCrypt interface to an HMAC-PRNG implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* sha256.h - TinyCrypt interface to a SHA-256 implementation */
/*

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* utils.h - TinyCrypt interface to platform-dependent run-time operations */
/*

View File

@@ -0,0 +1,87 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_tinycrypt_port.h"
#include "esp_crypto_lock.h"
#include "esp_private/esp_crypto_lock_internal.h"
#if SOC_ECC_SUPPORTED
#include "hal/ecc_hal.h"
#include "hal/ecc_ll.h"
#endif /* SOC_ECC_SUPPORTED */
#if SOC_ECC_SUPPORTED
static void esp_tinycrypt_acquire_ecc_hardware(void)
{
esp_crypto_ecc_lock_acquire();
ECC_RCC_ATOMIC() {
ecc_ll_enable_bus_clock(true);
ecc_ll_power_up();
ecc_ll_reset_register();
}
}
static void esp_tinycrypt_release_ecc_hardware(void)
{
ECC_RCC_ATOMIC() {
ecc_ll_enable_bus_clock(false);
ecc_ll_power_down();
}
esp_crypto_ecc_lock_release();
}
int esp_tinycrypt_verify_ecc_point(const uint8_t *pk_x, const uint8_t *pk_y, uint8_t length)
{
int result;
esp_tinycrypt_acquire_ecc_hardware();
ecc_hal_write_verify_param(pk_x, pk_y, length);
ecc_hal_set_mode(ECC_MODE_VERIFY);
ecc_hal_start_calc();
while (!ecc_hal_is_calc_finished());
result = ecc_hal_read_verify_result();
esp_tinycrypt_release_ecc_hardware();
if (result == 1) {
return 0;
} else {
return -1;
}
}
int esp_tinycrypt_calc_ecc_mult(const uint8_t *p_x, const uint8_t *p_y, const uint8_t *scalar,
uint8_t *r_x, uint8_t *r_y, uint8_t num_bytes, bool verify_first)
{
int ret = -1;
ecc_mode_t work_mode = verify_first ? ECC_MODE_VERIFY_THEN_POINT_MUL : ECC_MODE_POINT_MUL;
esp_tinycrypt_acquire_ecc_hardware();
ecc_hal_write_mul_param(scalar, p_x, p_y, num_bytes);
ecc_hal_set_mode(work_mode);
/*
* Enable constant-time point multiplication operations for the ECC hardware accelerator,
* if supported for the given target. This protects the ECC multiplication operation from
* timing attacks. This increases the time taken (by almost 50%) for some point
* multiplication operations performed by the ECC hardware accelerator.
*/
ecc_hal_enable_constant_time_point_mul(true);
ecc_hal_start_calc();
while (!ecc_hal_is_calc_finished());
ret = ecc_hal_read_mul_result(r_x, r_y, num_bytes);
esp_tinycrypt_release_ecc_hardware();
return ret;
}
#endif /* SOC_ECC_SUPPORTED */

View File

@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <stdbool.h>
#include "soc/soc_caps.h"
#if SOC_ECC_SUPPORTED
int esp_tinycrypt_verify_ecc_point(const uint8_t *pk_x, const uint8_t *pk_y, uint8_t length);
int esp_tinycrypt_calc_ecc_mult(const uint8_t *p_x, const uint8_t *p_y, const uint8_t *scalar,
uint8_t *r_x, uint8_t *r_y, uint8_t num_bytes, bool verify_first);
#endif /* SOC_ECC_SUPPORTED */

View File

@@ -1,4 +1,8 @@
/* aes_decrypt.c - TinyCrypt implementation of AES decryption procedure */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
@@ -30,6 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/* aes_decrypt.c - TinyCrypt implementation of AES decryption procedure */
#include <tinycrypt/aes.h>
#include <tinycrypt/constants.h>
#include <tinycrypt/utils.h>

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* aes_encrypt.c - TinyCrypt implementation of AES encryption procedure */
/*

View File

@@ -1,4 +1,8 @@
/* cbc_mode.c - TinyCrypt implementation of CBC mode encryption & decryption */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* ccm_mode.c - TinyCrypt implementation of CCM mode */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
@@ -30,6 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/* ccm_mode.c - TinyCrypt implementation of CCM mode */
#include <tinycrypt/ccm_mode.h>
#include <tinycrypt/constants.h>
#include <tinycrypt/utils.h>

View File

@@ -1,4 +1,8 @@
/* cmac_mode.c - TinyCrypt CMAC mode implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* ctr_mode.c - TinyCrypt CTR mode implementation */
/*

View File

@@ -1,4 +1,8 @@
/* ctr_prng.c - TinyCrypt implementation of CTR-PRNG */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (c) 2016, Chris Morrison

View File

@@ -1,4 +1,8 @@
/* ecc.c - TinyCrypt implementation of common ECC functions */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (c) 2014, Kenneth MacKay
@@ -55,6 +59,9 @@
#include <tinycrypt/ecc.h>
#include <tinycrypt/ecc_platform_specific.h>
#include <string.h>
#include <stdio.h>
#include "esp_tinycrypt_port.h"
/* IMPORTANT: Make sure a cryptographically-secure PRNG is set and the platform
* has access to enough entropy in order to feed the PRNG regularly. */
@@ -635,6 +642,7 @@ void apply_z(uECC_word_t * X1, uECC_word_t * Y1, const uECC_word_t * const Z,
uECC_vli_modMult_fast(Y1, Y1, t1, curve); /* y1 * z^3 */
}
#if !SOC_ECC_SUPPORTED
/* P = (x1, y1) => 2P, (x2, y2) => P' */
static void XYcZ_initial_double(uECC_word_t * X1, uECC_word_t * Y1,
uECC_word_t * X2, uECC_word_t * Y2,
@@ -658,31 +666,6 @@ static void XYcZ_initial_double(uECC_word_t * X1, uECC_word_t * Y1,
apply_z(X2, Y2, z, curve);
}
void XYcZ_add(uECC_word_t * X1, uECC_word_t * Y1,
uECC_word_t * X2, uECC_word_t * Y2,
uECC_Curve curve)
{
/* t1 = X1, t2 = Y1, t3 = X2, t4 = Y2 */
uECC_word_t t5[NUM_ECC_WORDS];
wordcount_t num_words = curve->num_words;
uECC_vli_modSub(t5, X2, X1, curve->p, num_words); /* t5 = x2 - x1 */
uECC_vli_modSquare_fast(t5, t5, curve); /* t5 = (x2 - x1)^2 = A */
uECC_vli_modMult_fast(X1, X1, t5, curve); /* t1 = x1*A = B */
uECC_vli_modMult_fast(X2, X2, t5, curve); /* t3 = x2*A = C */
uECC_vli_modSub(Y2, Y2, Y1, curve->p, num_words); /* t4 = y2 - y1 */
uECC_vli_modSquare_fast(t5, Y2, curve); /* t5 = (y2 - y1)^2 = D */
uECC_vli_modSub(t5, t5, X1, curve->p, num_words); /* t5 = D - B */
uECC_vli_modSub(t5, t5, X2, curve->p, num_words); /* t5 = D - B - C = x3 */
uECC_vli_modSub(X2, X2, X1, curve->p, num_words); /* t3 = C - B */
uECC_vli_modMult_fast(Y1, Y1, X2, curve); /* t2 = y1*(C - B) */
uECC_vli_modSub(X2, X1, t5, curve->p, num_words); /* t3 = B - x3 */
uECC_vli_modMult_fast(Y2, Y2, X2, curve); /* t4 = (y2 - y1)*(B - x3) */
uECC_vli_modSub(Y2, Y2, Y1, curve->p, num_words); /* t4 = y3 */
uECC_vli_set(X2, t5, num_words);
}
/* Input P = (x1, y1, Z), Q = (x2, y2, Z)
Output P + Q = (x3, y3, Z3), P - Q = (x3', y3', Z3)
@@ -725,12 +708,49 @@ static void XYcZ_addC(uECC_word_t * X1, uECC_word_t * Y1,
uECC_vli_set(X1, t7, num_words);
}
#endif /* !SOC_ECC_SUPPORTED */
void XYcZ_add(uECC_word_t * X1, uECC_word_t * Y1,
uECC_word_t * X2, uECC_word_t * Y2,
uECC_Curve curve)
{
/* t1 = X1, t2 = Y1, t3 = X2, t4 = Y2 */
uECC_word_t t5[NUM_ECC_WORDS];
wordcount_t num_words = curve->num_words;
uECC_vli_modSub(t5, X2, X1, curve->p, num_words); /* t5 = x2 - x1 */
uECC_vli_modSquare_fast(t5, t5, curve); /* t5 = (x2 - x1)^2 = A */
uECC_vli_modMult_fast(X1, X1, t5, curve); /* t1 = x1*A = B */
uECC_vli_modMult_fast(X2, X2, t5, curve); /* t3 = x2*A = C */
uECC_vli_modSub(Y2, Y2, Y1, curve->p, num_words); /* t4 = y2 - y1 */
uECC_vli_modSquare_fast(t5, Y2, curve); /* t5 = (y2 - y1)^2 = D */
uECC_vli_modSub(t5, t5, X1, curve->p, num_words); /* t5 = D - B */
uECC_vli_modSub(t5, t5, X2, curve->p, num_words); /* t5 = D - B - C = x3 */
uECC_vli_modSub(X2, X2, X1, curve->p, num_words); /* t3 = C - B */
uECC_vli_modMult_fast(Y1, Y1, X2, curve); /* t2 = y1*(C - B) */
uECC_vli_modSub(X2, X1, t5, curve->p, num_words); /* t3 = B - x3 */
uECC_vli_modMult_fast(Y2, Y2, X2, curve); /* t4 = (y2 - y1)*(B - x3) */
uECC_vli_modSub(Y2, Y2, Y1, curve->p, num_words); /* t4 = y3 */
uECC_vli_set(X2, t5, num_words);
}
void EccPoint_mult(uECC_word_t * result, const uECC_word_t * point,
const uECC_word_t * scalar,
const uECC_word_t * initial_Z,
bitcount_t num_bits, uECC_Curve curve)
{
#if SOC_ECC_SUPPORTED
wordcount_t num_words = curve->num_words;
/* Only p256r1 is supported currently. */
assert (curve == uECC_secp256r1());
esp_tinycrypt_calc_ecc_mult((const uint8_t *)&point[0], (const uint8_t *)&point[num_words],
(uint8_t *)scalar, (uint8_t *)&result[0], (uint8_t *)&result[num_words],
num_words * uECC_WORD_SIZE, false);
#else
/* R0 and R1 */
uECC_word_t Rx[2][NUM_ECC_WORDS];
uECC_word_t Ry[2][NUM_ECC_WORDS];
@@ -769,6 +789,7 @@ void EccPoint_mult(uECC_word_t * result, const uECC_word_t * point,
uECC_vli_set(result, Rx[0], num_words);
uECC_vli_set(result + num_words, Ry[0], num_words);
#endif /* SOC_ECC_SUPPORTED */
}
uECC_word_t regularize_k(const uECC_word_t * const k, uECC_word_t *k0,
@@ -862,8 +883,6 @@ int uECC_generate_random_int(uECC_word_t *random, const uECC_word_t *top,
int uECC_valid_point(const uECC_word_t *point, uECC_Curve curve)
{
uECC_word_t tmp1[NUM_ECC_WORDS];
uECC_word_t tmp2[NUM_ECC_WORDS];
wordcount_t num_words = curve->num_words;
/* The point at infinity is invalid. */
@@ -877,19 +896,34 @@ int uECC_valid_point(const uECC_word_t *point, uECC_Curve curve)
return -2;
}
#if SOC_ECC_SUPPORTED
/* Only p256r1 is supported currently. */
if (curve != uECC_secp256r1()) {
return -5;
}
if (esp_tinycrypt_verify_ecc_point((const uint8_t *)&point[0],
(const uint8_t *)&point[num_words],
num_words * uECC_WORD_SIZE)) {
return -3;
}
#else
uECC_word_t tmp1[NUM_ECC_WORDS];
uECC_word_t tmp2[NUM_ECC_WORDS];
uECC_vli_modSquare_fast(tmp1, point + num_words, curve);
curve->x_side(tmp2, point, curve); /* tmp2 = x^3 + ax + b */
/* Make sure that y^2 == x^3 + ax + b */
if (uECC_vli_equal(tmp1, tmp2, num_words) != 0)
return -3;
#endif /* SOC_ECC_SUPPORTED */
return 0;
}
int uECC_valid_public_key(const uint8_t *public_key, uECC_Curve curve)
{
uECC_word_t _public[NUM_ECC_WORDS * 2];
uECC_vli_bytesToNative(_public, public_key, curve->num_bytes);
@@ -908,7 +942,6 @@ int uECC_valid_public_key(const uint8_t *public_key, uECC_Curve curve)
int uECC_compute_public_key(const uint8_t *private_key, uint8_t *public_key,
uECC_Curve curve)
{
uECC_word_t _private[NUM_ECC_WORDS];
uECC_word_t _public[NUM_ECC_WORDS * 2];

View File

@@ -1,4 +1,8 @@
/* ec_dh.c - TinyCrypt implementation of EC-DH */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (c) 2014, Kenneth MacKay

View File

@@ -1,4 +1,8 @@
/* ec_dsa.c - TinyCrypt implementation of EC-DSA */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* Copyright (c) 2014, Kenneth MacKay
* All rights reserved.

View File

@@ -1,3 +1,9 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* uECC_platform_specific.c - Implementation of platform specific functions*/
/* Copyright (c) 2014, Kenneth MacKay

View File

@@ -1,4 +1,8 @@
/* hmac.c - TinyCrypt implementation of the HMAC algorithm */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* hmac_prng.c - TinyCrypt implementation of HMAC-PRNG */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
@@ -30,6 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/* hmac_prng.c - TinyCrypt implementation of HMAC-PRNG */
#include <tinycrypt/hmac_prng.h>
#include <tinycrypt/hmac.h>
#include <tinycrypt/constants.h>

View File

@@ -1,4 +1,8 @@
/* sha256.c - TinyCrypt SHA-256 crypto hash algorithm implementation */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.

View File

@@ -1,4 +1,8 @@
/* utils.c - TinyCrypt platform-dependent run-time operations */
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Copyright (C) 2017 by Intel Corporation, All Rights Reserved.
@@ -30,6 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
/* utils.c - TinyCrypt platform-dependent run-time operations */
#include <tinycrypt/utils.h>
#include <tinycrypt/constants.h>

View File

@@ -421,6 +421,7 @@ config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
config BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
bool "Enable enhanced Access Address check in CONNECT_IND"
depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM)
default n
help
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
@@ -497,7 +498,6 @@ config BTDM_BLE_PING_EN
This option is used for some compatibility problems related to LE ping procedure.
config BTDM_CTRL_CONTROLLER_DEBUG_MODE_1
visible if 0
bool "Enable Bluetooth controller debugging mode 1 (for internal use only)"
default n
depends on BT_ENABLED

View File

@@ -252,6 +252,7 @@ extern uint32_t _bt_controller_data_end;
extern void config_bt_funcs_reset(void);
extern void config_ble_funcs_reset(void);
extern void config_btdm_funcs_reset(void);
extern void btdm_aa_check_enhance_enable(void);
#ifdef CONFIG_BT_BLUEDROID_ENABLED
extern void bt_stack_enableSecCtrlVsCmd(bool en);
@@ -965,7 +966,7 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
// allow a maximum time uncertainty to be about 488ppm(1/2048) at least as clock drift
// and set the timer in advance
uint32_t uncertainty = (us_to_sleep >> 11);
uint32_t uncertainty = (us_to_sleep / 1000);
if (uncertainty < BTDM_MIN_TIMER_UNCERTAINTY_US) {
uncertainty = BTDM_MIN_TIMER_UNCERTAINTY_US;
}
@@ -1540,12 +1541,14 @@ static esp_err_t btdm_low_power_mode_init(void)
bool select_src_ret __attribute__((unused));
bool set_div_ret __attribute__((unused));
if (btdm_lpclk_sel == ESP_BT_SLEEP_CLOCK_MAIN_XTAL) {
ESP_LOGI(BTDM_LOG_TAG, "Using main XTAL as clock source");
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() * 2 / MHZ - 1);
assert(select_src_ret && set_div_ret);
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
} else { // btdm_lpclk_sel == BTDM_LPCLK_SEL_XTAL32K
ESP_LOGI(BTDM_LOG_TAG, "Using external 32.768 kHz crystal/oscillator as clock source");
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
set_div_ret = btdm_lpclk_set_div(0);
assert(select_src_ret && set_div_ret);
@@ -1699,7 +1702,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_init();
if (ble_log_spi_out_init() != 0) {
ESP_LOGE(BTDM_LOG_TAG, "BLE Log SPI output init failed");
err = ESP_ERR_NO_MEM;
goto error;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
btdm_cfg_mask = btdm_config_mask_load();
@@ -1728,6 +1735,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
error:
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
bt_controller_deinit_internal();
return err;
@@ -1841,6 +1852,10 @@ static void patch_apply(void)
#ifndef CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY
config_ble_funcs_reset();
#endif
#if BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED
btdm_aa_check_enhance_enable();
#endif
}
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)

View File

@@ -90,7 +90,7 @@ menu "HCI Config"
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
default 2048
help
This configures stack size of hci transport task
endmenu
@@ -281,94 +281,103 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Enable controller log
menu "Controller debug features"
menuconfig BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Enable controller log
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
bool "enable controller log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
bool "enable controller log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
bool "Output ble controller logs to SPI bus (Experimental)"
depends on BT_LE_CONTROLLER_LOG_ENABLED
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
select BT_BLE_LOG_SPI_OUT_ENABLED
default n
help
Output ble controller logs to SPI bus
config BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
bool "Output ble controller logs to SPI bus (Experimental)"
depends on BT_LE_CONTROLLER_LOG_ENABLED
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
select BT_BLE_LOG_SPI_OUT_ENABLED
default n
help
Output ble controller logs to SPI bus
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the first BLE controller LOG buffer.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the first BLE controller LOG buffer.
config BT_LE_LOG_CTRL_BUF2_SIZE
int "size of the second BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 1024
help
Configure the size of the second BLE controller LOG buffer.
config BT_LE_LOG_CTRL_BUF2_SIZE
int "size of the second BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 1024
help
Configure the size of the second BLE controller LOG buffer.
config BT_LE_LOG_HCI_BUF_SIZE
int "size of the BLE HCI LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the BLE HCI LOG buffer.
config BT_LE_LOG_HCI_BUF_SIZE
int "size of the BLE HCI LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default 4096
help
Configure the size of the BLE HCI LOG buffer.
config BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
bool "Enable wrap panic handler"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Wrap esp_panic_handler to get controller logs when PC pointer exception crashes.
config BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
bool "Enable wrap panic handler"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Wrap esp_panic_handler to get controller logs when PC pointer exception crashes.
config BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
bool "Enable esp_task_wdt_isr_user_handler implementation"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Implement esp_task_wdt_isr_user_handler to get controller logs when task wdt issue is triggered.
config BT_LE_MEM_CHECK_ENABLED
bool "Enable memory allocation check"
default n
help
Used in internal tests only. Enable the memory allocation check.
endmenu
config BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
bool "Enable esp_task_wdt_isr_user_handler implementation"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Implement esp_task_wdt_isr_user_handler to get controller logs when task wdt issue is triggered.
config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
range 1 5
@@ -424,7 +433,7 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
config BT_LE_WHITELIST_SIZE
int "BLE white list size"
range 1 15
range 1 31
default 12
depends on !BT_NIMBLE_ENABLED
@@ -445,6 +454,23 @@ config BT_LE_LL_SCA
help
Sleep clock accuracy of our device (in ppm)
config BT_LE_LL_PEER_SCA_SET_ENABLE
bool "Enable to set constant peer SCA"
default n
help
Enable setting of constant peer SCA, use this if peer device has SCA larger than 500 PPM.
Enable this option, the controller will always use BT_LE_LL_PEER_SCA as the peer SCA value
to calculate the window widening instead of the value received from peer device.
config BT_LE_LL_PEER_SCA
int "Constant peer sleep clock accuracy value"
range 0 10000
depends on BT_LE_LL_PEER_SCA_SET_ENABLE
default 0
help
Set the sleep clock accuracy of peer device
config BT_LE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
depends on !BT_NIMBLE_ENABLED
@@ -567,7 +593,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.
@@ -682,6 +708,11 @@ config BT_LE_PLACE_CONN_RELATED_INTO_IRAM
depends on BT_CTRL_RUN_IN_FLASH_ONLY
default n
config BT_LE_PLACE_SLEEP_RELATED_INTO_IRAM
bool
depends on BT_CTRL_RUN_IN_FLASH_ONLY && BT_LE_SLEEP_ENABLE
default y
config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
bool "Enable enhanced Access Address check in CONNECT_IND"
default n
@@ -689,3 +720,33 @@ config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
If disabled, only basic checks are applied, improving compatibility.
menu "BLE disconnects when Instant Passed (0x28) occurs"
config BT_LE_CTRL_LLCP_CONN_UPDATE
bool "BLE ACL connection update procedure"
default n
help
If this option is enabled, Controller will terminate the connection
when Instant Passed (0x28) error occurs during connection update procedure.
config BT_LE_CTRL_LLCP_CHAN_MAP_UPDATE
bool "BLE ACL channel map update procedure"
default n
help
If this option is enabled, Controller will terminate the connection
when Instant Passed (0x28) error occurs in channel map update procedure.
config BT_LE_CTRL_LLCP_PHY_UPDATE
bool "BLE ACL PHY update procedure"
default n
help
If this option is enabled, Controller will terminate the connection
when Instant Passed (0x28) error occurs in PHY update procedure.
endmenu
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
int "The value of upperlimitmax during scan backoff procedure"
range 1 256
default 32
help
The value of upperlimitmax needs to be a power of 2.

View File

@@ -12,9 +12,14 @@
************************************************************************
*/
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
void adv_stack_enableClearLegacyAdvVsCmd(bool en);
void scan_stack_enableAdvFlowCtrlVsCmd(bool en);
void adv_stack_enableClearLegacyAdvVsCmd(bool en);
void chanSel_stack_enableSetCsaVsCmd(bool en);
void hci_stack_enableSetVsEvtMaskVsCmd(bool en);
void adv_stack_enableScanReqRxdVsEvent(bool en);
void conn_stack_enableChanMapUpdCompVsEvent(bool en);
void sleep_stack_enableWakeupVsEvent(bool en);
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
/* Local functions definition
@@ -32,10 +37,18 @@ void ble_stack_enableVsCmds(bool en)
#endif // DEFAULT_BT_LE_ROLE_OBSERVER
chanSel_stack_enableSetCsaVsCmd(en);
hci_stack_enableSetVsEvtMaskVsCmd(en);
}
void ble_stack_enableVsEvents(bool en)
{
#if DEFAULT_BT_LE_ROLE_BROADCASTER
adv_stack_enableScanReqRxdVsEvent(en);
#endif // DEFAULT_BT_LE_ROLE_BROADCASTER
conn_stack_enableChanMapUpdCompVsEvent(en);
#if CONFIG_BT_LE_SLEEP_ENABLE
sleep_stack_enableWakeupVsEvent(en);
#endif // CONFIG_BT_LE_SLEEP_ENABLE
}
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)

View File

@@ -45,6 +45,7 @@
#include "soc/syscon_reg.h"
#include "soc/modem_clkrst_reg.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk_tree_common.h"
#include "bt_osi_mem.h"
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
@@ -65,11 +66,9 @@
#include "hal/efuse_ll.h"
#include "soc/rtc.h"
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
/* Macro definition
************************************************************************
@@ -119,7 +118,12 @@ struct ext_funcs_t {
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
@@ -128,14 +132,16 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int ble_log_deinit_async(void);
extern int ble_log_init_simple(interface_func_t interface, void *handler);
extern void ble_log_deinit_simple(void);
extern void ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
extern void esp_panic_handler_feed_wdts(void);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
extern int ble_controller_disable(void);
extern void ble_controller_disable(void);
extern int esp_register_ext_funcs (struct ext_funcs_t *);
extern void esp_unregister_ext_funcs (void);
extern int esp_ble_ll_set_public_addr(const uint8_t *addr);
@@ -151,6 +157,9 @@ extern void r_ble_rtc_wake_up_state_clr(void);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#if CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
extern void r_ble_ll_customize_peer_sca_set(uint16_t peer_sca);
#endif // CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
extern int os_msys_init(void);
extern void os_msys_buf_free(void);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
@@ -198,10 +207,12 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
@@ -211,50 +222,29 @@ void *g_ble_lll_rfmgmt_env_p;
#endif
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
LOG_SPI_OUT,
};
static bool log_is_inited = false;
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t log_output_mode = LOG_SPI_OUT;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
esp_err_t esp_bt_controller_log_init(void)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
return ESP_OK;
}
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
if (ble_log_spi_out_init() != 0) {
goto spi_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
if (ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
@@ -262,44 +252,41 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
case LOG_SPI_OUT:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ble_log_spi_out_init();
bt_controller_log_interface = ble_log_spi_out_write_esp;
bool task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
task_create = false;
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_ctrl_log_partition_get_and_erase_first_block();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
break;
default:
assert(0);
}
ret = ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
if (ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
goto log_init_failed;
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
return ret;
log_is_inited = true;
return ESP_OK;
log_init_failed:
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
spi_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
return ESP_FAIL;
}
void esp_bt_ontroller_log_deinit(void)
void esp_bt_controller_log_deinit(void)
{
ble_log_deinit_async();
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
#endif
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_is_inited = false;
}
@@ -392,13 +379,13 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
ble_log_async_output_dump_all(true);
esp_bt_controller_log_deinit();
stop_write = true;
esp_bt_ontroller_log_deinit();
portEXIT_CRITICAL_SAFE(&spinlock);
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_feed_wdts();
if (is_filled) {
read_index = next_erase_index;
} else {
@@ -410,7 +397,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
vTaskDelay(2);
esp_panic_handler_feed_wdts();
print_len = 0;
}
@@ -418,45 +405,57 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
err = esp_bt_controller_log_init();
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
esp_bt_read_ctrl_log_from_flash(output);
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
#endif
}
#if CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
void esp_task_wdt_isr_user_handler(void)
{
@@ -480,6 +479,13 @@ static bool s_ble_active = false;
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
#ifdef CONFIG_XTAL_FREQ_26
#define MAIN_XTAL_FREQ_HZ (26000000)
static DRAM_ATTR uint32_t s_bt_lpclk_freq = 40000;
#else
#define MAIN_XTAL_FREQ_HZ (40000000)
static DRAM_ATTR uint32_t s_bt_lpclk_freq = 32000;
#endif
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US (1800)
@@ -604,13 +610,6 @@ static int esp_intr_free_wrapper(void **ret_handle)
return rc;
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
esp_ble_set_wakeup_overhead(overhead);
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
@@ -618,6 +617,10 @@ modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return;
}
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
@@ -625,7 +628,28 @@ void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
uint32_t esp_bt_get_lpclk_freq(void)
{
return s_bt_lpclk_freq;
}
void esp_bt_set_lpclk_freq(uint32_t clk_freq)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return;
}
if (!clk_freq) {
return;
}
if (MAIN_XTAL_FREQ_HZ % clk_freq) {
return;
}
s_bt_lpclk_freq = clk_freq;
}
void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
return;
@@ -638,16 +662,23 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
s_ble_active = false;
}
IRAM_ATTR void controller_wakeup_cb(void *arg)
void controller_wakeup_cb(void *arg)
{
if (s_ble_active) {
return;
}
esp_phy_enable(PHY_MODEM_BT);
// need to check if need to call pm lock here
#ifdef CONFIG_PM_ENABLE
esp_pm_config_t pm_config;
esp_pm_lock_acquire(s_pm_lock);
esp_pm_get_configuration(&pm_config);
assert(esp_rom_get_cpu_ticks_per_us() == pm_config.max_freq_mhz);
#endif //CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
uint32_t *clk_freq = (uint32_t *)arg;
*clk_freq = esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED) / 5;
}
// need to check if need to call pm lock here
s_ble_active = true;
}
@@ -678,7 +709,7 @@ esp_err_t controller_sleep_init(modem_clock_lpclk_src_t slow_clk_src)
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
rc = esp_pm_register_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
rc = esp_pm_register_inform_out_light_sleep_overhead_callback(esp_ble_set_wakeup_overhead);
if (rc != ESP_OK) {
goto error;
}
@@ -688,7 +719,7 @@ esp_err_t controller_sleep_init(modem_clock_lpclk_src_t slow_clk_src)
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
esp_pm_unregister_inform_out_light_sleep_overhead_callback(esp_ble_set_wakeup_overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
@@ -705,7 +736,7 @@ void controller_sleep_deinit(void)
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
esp_pm_unregister_inform_out_light_sleep_overhead_callback(esp_ble_set_wakeup_overhead);
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#ifdef CONFIG_PM_ENABLE
/*lock should release first and then delete*/
@@ -724,11 +755,7 @@ static void esp_bt_rtc_slow_clk_select(modem_clock_lpclk_src_t slow_clk_src)
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 1, MODEM_CLKRST_LP_TIMER_SEL_XTAL_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_8M_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_RTC_SLOW_S);
#ifdef CONFIG_XTAL_FREQ_26
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 129, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
#else
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 249, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
#endif // CONFIG_XTAL_FREQ_26
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, (MAIN_XTAL_FREQ_HZ/(5 * s_bt_lpclk_freq) - 1), MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
break;
case MODEM_CLOCK_LPCLK_SRC_EXT32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using external 32.768 kHz XTAL as clock source");
@@ -738,6 +765,14 @@ static void esp_bt_rtc_slow_clk_select(modem_clock_lpclk_src_t slow_clk_src)
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_RTC_SLOW_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 0, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
break;
case MODEM_CLOCK_LPCLK_SRC_RC_SLOW:
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, use with caution as it may not maintain ACL or Sync process due to low clock accuracy!");
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_XTAL32K_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_XTAL_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_8M_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 1, MODEM_CLKRST_LP_TIMER_SEL_RTC_SLOW_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 0, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
break;
default:
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported slow clock");
assert(0);
@@ -753,23 +788,26 @@ static modem_clock_lpclk_src_t ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#endif // CONFIG_RTC_CLK_SRC_INT_RC
#endif // CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
#ifdef CONFIG_XTAL_FREQ_26
cfg->rtc_freq = 40000;
#else
cfg->rtc_freq = 32000;
#endif // CONFIG_XTAL_FREQ_26
cfg->rtc_freq = s_bt_lpclk_freq;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED) / 5;
cfg->ble_ll_sca = 3000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
return s_bt_lpclk_src;
@@ -872,11 +910,15 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto modem_deint;
}
#if CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
r_ble_ll_customize_peer_sca_set(CONFIG_BT_LE_LL_PEER_SCA);
#endif // CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble rom commit:[%s]", r_ble_controller_get_rom_compile_version());
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ret = esp_bt_controller_log_init(log_output_mode);
ret = esp_bt_controller_log_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto controller_init_err;
@@ -917,7 +959,7 @@ free_controller:
controller_sleep_deinit();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
controller_init_err:
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
modem_deint:
@@ -946,7 +988,7 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
@@ -1035,9 +1077,9 @@ esp_err_t esp_bt_controller_disable(void)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (ble_controller_disable() != 0) {
return ESP_FAIL;
}
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
ble_controller_disable();
ble_stack_disable();
if (s_ble_active) {
esp_phy_disable(PHY_MODEM_BT);
@@ -1049,7 +1091,6 @@ esp_err_t esp_bt_controller_disable(void)
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
return ESP_OK;
}
@@ -1532,3 +1573,10 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
#endif // (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED)
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
void ble_memory_count_limit_set(uint16_t count_limit)
{
bt_osi_mem_count_limit_set(count_limit);
}
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED

View File

@@ -226,6 +226,32 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS (0)
#endif
#ifdef CONFIG_BT_LE_CTRL_LLCP_CONN_UPDATE
#define BT_CTRL_BLE_LLCP_CONN_UPDATE (1<<0)
#else
#define BT_CTRL_BLE_LLCP_CONN_UPDATE (0<<0)
#endif
#ifdef CONFIG_BT_LE_CTRL_LLCP_CHAN_MAP_UPDATE
#define BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE (1<<1)
#else
#define BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE (0<<1)
#endif
#ifdef CONFIG_BT_LE_CTRL_LLCP_PHY_UPDATE
#define BT_CTRL_BLE_LLCP_PHY_UPDATE (1<<2)
#else
#define BT_CTRL_BLE_LLCP_PHY_UPDATE (0<<2)
#endif
#define BT_LE_CTRL_LLCP_DISC_FLAG (BT_CTRL_BLE_LLCP_CONN_UPDATE | BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE | BT_CTRL_BLE_LLCP_PHY_UPDATE)
#ifdef CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX (CONFIG_BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX)
#else
#define BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX (256)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else

View File

@@ -83,13 +83,16 @@ choice BT_BLE_CCA_MODE
default BT_BLE_CCA_MODE_NONE
help
Define BT BLE CCA mode
Note that if CCA feature is enabled, the hardware may not transmit packets due to channel busy.
Therefore, it may potentially lead to an increase in the time taken for scanning advertising packet
and establishing connections, or a decrease in the throughput rate of the connection.
config BT_BLE_CCA_MODE_NONE
bool "NONE"
config BT_BLE_CCA_MODE_HW
bool "Hardware"
config BT_BLE_CCA_MODE_SW
bool "Software"
bool "Software (experimental)"
endchoice
config BT_BLE_CCA_MODE
@@ -226,7 +229,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
depends on (!BT_CTRL_RUN_IN_FLASH_ONLY) || (BT_CTRL_RUN_IN_FLASH_ONLY && BT_CTRL_BLE_SCAN)
depends on BT_CTRL_BLE_SCAN
default y
help
The function is mainly used to enable flow control for advertising reports. When it is enabled,
@@ -411,10 +414,10 @@ menu "MODEM SLEEP Options"
modem sleep to be used with both DFS and light sleep.
config BT_CTRL_LPCLK_SEL_RTC_SLOW
bool "Internal 150kHz RC oscillator"
bool "Internal 136kHz RC oscillator"
depends on RTC_CLK_SRC_INT_RC
help
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
Internal 136kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
endchoice
@@ -525,30 +528,31 @@ config BT_CTRL_RUN_IN_FLASH_ONLY
impact on Bluetooth performance.
config BT_CTRL_DTM_ENABLE
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable direct test mode feature"
default n
config BT_CTRL_BLE_MASTER
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE master role feature"
default y
config BT_CTRL_BLE_MASTER
bool "Enable BLE connection feature"
default y
help
If this option is disabled, it is not recommended to use connectable ADV.
config BT_CTRL_BLE_TEST
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE QA test feature"
bool "Enable BLE QA test feature (Not Used)"
default n
config BT_CTRL_BLE_SCAN
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE scan feature"
default y
config BT_CTRL_BLE_SECURITY_ENABLE
depends on BT_CTRL_RUN_IN_FLASH_ONLY && BT_CONTROLLER_ONLY
bool "Enable BLE security feature"
default y
config BT_CTRL_BLE_ADV
bool "Enable BLE ADV feature"
default y
config BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
bool "Enable enhanced Access Address check in CONNECT_IND"
default n
@@ -593,6 +597,7 @@ menu "Controller debug log Options (Experimental)"
depends on BT_CTRL_LE_LOG_EN
depends on !BT_CTRL_LE_LOG_DUMP_ONLY
select BT_BLE_LOG_SPI_OUT_ENABLED
select BT_BLE_LOG_SPI_OUT_LL_ENABLED
default n
help
Output ble controller logs to SPI bus

View File

@@ -311,6 +311,17 @@ extern void advFilter_stack_enableDupExcListVsCmd(bool en);
extern void chanSel_stack_enableSetCsaVsCmd(bool en);
#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED)
extern void ble_dtm_funcs_reset(void);
extern void ble_scan_funcs_reset(void);
extern void ble_42_adv_funcs_reset(void);
extern void ble_init_funcs_reset(void);
extern void ble_con_funcs_reset(void);
extern void ble_cca_funcs_reset(void);
extern void ble_ext_adv_funcs_reset(void);
extern void ble_ext_scan_funcs_reset(void);
extern void ble_base_funcs_reset(void);
extern void ble_enc_funcs_reset(void);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _bt_controller_bss_start;
@@ -539,7 +550,7 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
#if CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
static IRAM_ATTR void esp_bt_controller_spi_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
return ble_log_spi_out_write(BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY, addr, len);
ble_log_spi_out_ll_write(len, addr, 0, NULL, 0);
}
#endif // CONFIG_BT_CTRL_LE_LOG_SPI_OUT_EN
@@ -1264,6 +1275,46 @@ static void btdm_funcs_table_ready_wrapper(void)
#if BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED
btdm_aa_check_enhance_enable();
#endif
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
// do nothing
#else
ESP_LOGI(BT_LOG_TAG, "Feature Config, ADV:%d, BLE_50:%d, DTM:%d, SCAN:%d, CCA:%d, SMP:%d, CONNECT:%d",
BT_CTRL_BLE_ADV, BT_CTRL_50_FEATURE_SUPPORT, BT_CTRL_DTM_ENABLE, BT_CTRL_BLE_SCAN,
BT_BLE_CCA_MODE, BLE_SECURITY_ENABLE, BT_CTRL_BLE_MASTER);
ble_base_funcs_reset();
#if CONFIG_BT_CTRL_BLE_ADV
ble_42_adv_funcs_reset();
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
ble_ext_adv_funcs_reset();
#endif //
#endif // CONFIG_BT_CTRL_BLE_ADV
#if CONFIG_BT_CTRL_DTM_ENABLE
ble_dtm_funcs_reset();
#endif // CONFIG_BT_CTRL_DTM_ENABLE
#if CONFIG_BT_CTRL_BLE_SCAN
ble_scan_funcs_reset();
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
ble_ext_scan_funcs_reset();
#endif // (BT_CTRL_50_FEATURE_SUPPORT == 1)
#endif // CONFIG_BT_CTRL_BLE_SCAN
#if (BT_BLE_CCA_MODE != 0)
ble_cca_funcs_reset();
#endif // (BT_BLE_CCA_MODE != 0)
#if CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
ble_enc_funcs_reset();
#endif // CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
#if CONFIG_BT_CTRL_BLE_MASTER
ble_init_funcs_reset();
ble_con_funcs_reset();
#endif // CONFIG_BT_CTRL_BLE_MASTER
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
}
bool bt_async_wakeup_request(void)
@@ -1598,15 +1649,11 @@ static esp_err_t btdm_low_power_mode_init(esp_bt_controller_config_t *cfg)
#endif
}
} else if (s_lp_cntl.lpclk_sel == ESP_BT_SLEEP_CLOCK_RTC_SLOW) { // Internal 136kHz RC oscillator
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
ESP_LOGW(BT_LOG_TAG, "Internal 136kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is "
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
} else {
if (rtc_clk_slow_src_get() != SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
ESP_LOGW(BT_LOG_TAG, "Internal 136kHz RC oscillator not detected.");
assert(0);
}
} else if (s_lp_cntl.lpclk_sel == ESP_BT_SLEEP_CLOCK_MAIN_XTAL) {
ESP_LOGI(BT_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
@@ -1618,6 +1665,7 @@ static esp_err_t btdm_low_power_mode_init(esp_bt_controller_config_t *cfg)
bool select_src_ret __attribute__((unused));
bool set_div_ret __attribute__((unused));
if (s_lp_cntl.lpclk_sel == ESP_BT_SLEEP_CLOCK_MAIN_XTAL) {
ESP_LOGI(BT_LOG_TAG, "Using main XTAL as clock source");
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
s_lp_cntl.main_xtal_pu = 1;
@@ -1628,6 +1676,7 @@ static esp_err_t btdm_low_power_mode_init(esp_bt_controller_config_t *cfg)
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
} else if (s_lp_cntl.lpclk_sel == ESP_BT_SLEEP_CLOCK_EXT_32K_XTAL) {
ESP_LOGI(BT_LOG_TAG, "Using external 32.768 kHz crystal/oscillator as clock source");
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
set_div_ret = btdm_lpclk_set_div(0);
assert(select_src_ret && set_div_ret);
@@ -1636,6 +1685,8 @@ static esp_err_t btdm_low_power_mode_init(esp_bt_controller_config_t *cfg)
(1000000 >> (15 - RTC_CLK_CAL_FRACT));
assert(btdm_lpcycle_us != 0);
} else if (s_lp_cntl.lpclk_sel == ESP_BT_SLEEP_CLOCK_RTC_SLOW) {
ESP_LOGW(BT_LOG_TAG, "Using 136 kHz RC as clock source. The accuracy of this clock is a lot larger than 500ppm which is "
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
set_div_ret = btdm_lpclk_set_div(0);
assert(select_src_ret && set_div_ret);
@@ -1755,7 +1806,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_init();
if (ble_log_spi_out_init() != 0) {
ESP_LOGE(BT_LOG_TAG, "BLE Log SPI output init failed");
err = ESP_ERR_NO_MEM;
goto error;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
periph_module_enable(PERIPH_BT_MODULE);
@@ -1790,6 +1845,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
error:
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
bt_controller_deinit_internal();
return err;

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -57,6 +57,11 @@
#include "hal/efuse_hal.h"
#include "soc/rtc.h"
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
/* Macro definition
************************************************************************
*/
@@ -100,7 +105,12 @@ struct ext_funcs_t {
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
@@ -109,11 +119,13 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_deinit_async(void);
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
extern void r_ble_log_deinit_simple(void);
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
extern void r_ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
extern void esp_panic_handler_feed_wdts(void);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_controller_deinit(void);
extern int r_ble_controller_enable(uint8_t mode);
@@ -173,15 +185,232 @@ static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
static bool log_is_inited = false;
esp_err_t esp_bt_controller_log_init(void)
{
if (log_is_inited) {
return ESP_OK;
}
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
if (ble_log_spi_out_init() != 0) {
goto spi_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
if (r_ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
task_create = false;
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_ctrl_log_partition_get_and_erase_first_block();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
goto log_init_failed;
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
if (r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH) != ESP_OK) {
goto ctrl_level_init_failed;
}
log_is_inited = true;
return ESP_OK;
ctrl_level_init_failed:
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_init_failed:
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
spi_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
return ESP_FAIL;
}
void esp_bt_controller_log_deinit(void)
{
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
r_ble_log_async_output_dump_all(true);
esp_bt_controller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_feed_wdts();
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_feed_wdts();
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init();
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
void esp_task_wdt_isr_user_handler(void)
{
esp_ble_controller_log_dump_all(true);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_TASK_WDT_USER_HANDLER_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
void __real_esp_panic_handler(void *info);
void __wrap_esp_panic_handler (void *info)
{
esp_ble_controller_log_dump_all(true);
__real_esp_panic_handler(info);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
@@ -664,20 +893,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = r_ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = r_ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
@@ -738,7 +954,7 @@ free_controller:
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_phy_modem_deinit();
// modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
@@ -774,7 +990,7 @@ esp_err_t esp_bt_controller_deinit(void)
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@@ -1092,26 +1308,47 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (end) {
esp_rom_printf("\n");
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
#endif
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

View File

@@ -1,6 +1,5 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM
@@ -108,7 +107,7 @@ menu "HCI Config"
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
default 2048
help
This configures stack size of hci transport task
@@ -228,6 +227,16 @@ config BT_LE_POWER_CONTROL_ENABLED
help
Set this option to enable the Power Control feature on controller
config BT_LE_CTE_FEATURE_ENABLED
bool "Enable Bluetooth LE Direction Finding (AoA/AoD)"
depends on BT_LE_50_FEATURE_SUPPORT && SOC_BLE_CTE_SUPPORTED
default n
help
Enable this option to activate Bluetooth LE Direction Finding (AoA/AoD) feature.
Note:
This feature allows devices to determine the direction of a Bluetooth CTE signal,
enabling Angle of Arrival (AoA) and Angle of Departure (AoD) functionality.
menu "Memory Settings"
depends on !BT_NIMBLE_ENABLED
@@ -434,6 +443,16 @@ menu "Controller debug features"
default n
help
Retain scene with GDB to capture info, requires disabling WDT (CONFIG_ESP_INT_WDT, CONFIG_ESP_TASK_WDT_EN).
config BT_LE_PTR_CHECK_ENABLED
bool "Enable boundary check for internal memory"
default n
config BT_LE_MEM_CHECK_ENABLED
bool "Enable memory allocation check"
default n
help
Used in internal tests only. Enable the memory allocation check.
endmenu
config BT_LE_LL_RESOLV_LIST_SIZE
@@ -491,7 +510,7 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
config BT_LE_WHITELIST_SIZE
int "BLE white list size"
range 1 15
range 1 31
default 12
depends on !BT_NIMBLE_ENABLED
@@ -512,6 +531,23 @@ config BT_LE_LL_SCA
help
Sleep clock accuracy of our device (in ppm)
config BT_LE_LL_PEER_SCA_SET_ENABLE
bool "Enable to set constant peer SCA"
default n
help
Enable setting of constant peer SCA, use this if peer device has SCA larger than 500 PPM.
Enable this option, the controller will always use BT_LE_LL_PEER_SCA as the peer SCA value
to calculate the window widening instead of the value received from peer device.
config BT_LE_LL_PEER_SCA
int "Constant peer sleep clock accuracy value"
range 0 10000
depends on BT_LE_LL_PEER_SCA_SET_ENABLE
default 0
help
Set the sleep clock accuracy of peer device
config BT_LE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
depends on !BT_NIMBLE_ENABLED
@@ -691,7 +727,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.
@@ -805,3 +841,49 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
When this option is enabled, auxiliary packets will be present in the events of
'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0.
If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0.
config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature"
default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.
menu "Reserved Memory Config"
config BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT
int "The value of reserved EXT ADV memory count at initialization"
range 0 4
default 2
help
This value sets the number the Controller will allocate for extended advertisement
instances at initialization process. If more extended advertisement instances are
enabled, those memory will be dynamically allocated.
Using reduced amount of reserved memory will save heap size at the cost of extra
time consumption at advertising start process and possible advertising start failure
due to memory shortage.
The actual reserved memory count will be the minimum value between the maximum
extended advertisement instances and the BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT.
config BT_LE_CONN_RESERVED_MEMORY_COUNT
int "The value of reserved CONN memory count at initialization"
range 0 70
default 2
help
This value sets the number the Controller will allocate for connection instances
at the initialization process. If more connection instances are enabled, those
memory will be dynamically allocated.
Using reduced amount of reserved memory will save heap size at the cost of extra
time consumption at connection establishment process and possible connection
establishment failure due to memory shortage.
The actual reserved memory count will be the minimum value between the maximum
connection instances and the BT_LE_CONN_RESERVED_MEMORY_COUNT.
endmenu
config BT_LE_DTM_ENABLED
bool "Enable Direct Test Mode (DTM) feature"
default n

View File

@@ -22,6 +22,28 @@ void conn_stack_deinitEnv(void);
int conn_stack_enable(void);
void conn_stack_disable(void);
int adv_stack_initEnv(void);
void adv_stack_deinitEnv(void);
int adv_stack_enable(void);
void adv_stack_disable(void);
int extAdv_stack_initEnv(void);
void extAdv_stack_deinitEnv(void);
int extAdv_stack_enable(void);
void extAdv_stack_disable(void);
int sync_stack_initEnv(void);
void sync_stack_deinitEnv(void);
int sync_stack_enable(void);
void sync_stack_disable(void);
#if CONFIG_BT_LE_DTM_ENABLED
int dtm_stack_initEnv(void);
void dtm_stack_deinitEnv(void);
int dtm_stack_enable(void);
void dtm_stack_disable(void);
#endif // CONFIG_BT_LE_DTM_ENABLED
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
int conn_errorSim_initEnv(void);
void conn_errorSim_deinitEnv(void);
@@ -38,10 +60,18 @@ void pcl_stack_enableSetRssiThreshVsCmd(bool en);
void chanSel_stack_enableSetCsaVsCmd(bool en);
void log_stack_enableLogsRelatedVsCmd(bool en);
void hci_stack_enableSetVsEvtMaskVsCmd(bool en);
void winWiden_stack_enableSetConstPeerScaVsCmd(bool en);
#if CONFIG_IDF_TARGET_ESP32C61_ECO3
void conn_stack_enableSetPrefTxRxCntVsCmd(bool en);
#endif // CONFIG_IDF_TARGET_ESP32C61_ECO3
void adv_stack_enableScanReqRxdVsEvent(bool en);
void conn_stack_enableChanMapUpdCompVsEvent(bool en);
void sleep_stack_enableWakeupVsEvent(bool en);
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
#if CONFIG_BT_LE_RXBUF_OPT_ENABLED
extern void mmgmt_enableRxbufOptFeature(void);
#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED
/* Local functions definition
***************************************************************************
@@ -57,12 +87,20 @@ void ble_stack_enableVsCmds(bool en)
chanSel_stack_enableSetCsaVsCmd(en);
log_stack_enableLogsRelatedVsCmd(en);
hci_stack_enableSetVsEvtMaskVsCmd(en);
winWiden_stack_enableSetConstPeerScaVsCmd(en);
#if CONFIG_IDF_TARGET_ESP32C61_ECO3
conn_stack_enableSetPrefTxRxCntVsCmd(en);
#endif // CONFIG_IDF_TARGET_ESP32C61_ECO3
}
void ble_stack_enableVsEvents(bool en)
{
adv_stack_enableScanReqRxdVsEvent(en);
conn_stack_enableChanMapUpdCompVsEvent(en);
#if CONFIG_BT_LE_SLEEP_ENABLE
sleep_stack_enableWakeupVsEvent(en);
#endif // CONFIG_BT_LE_SLEEP_ENABLE
}
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
@@ -88,6 +126,27 @@ int ble_stack_initEnv(void)
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
rc = adv_stack_initEnv();
if (rc) {
return rc;
}
rc = extAdv_stack_initEnv();
if (rc) {
return rc;
}
rc = sync_stack_initEnv();
if (rc) {
return rc;
}
#if CONFIG_BT_LE_DTM_ENABLED
rc = dtm_stack_initEnv();
if (rc) {
return rc;
}
#endif // CONFIG_BT_LE_DTM_ENABLED
return 0;
}
@@ -99,7 +158,12 @@ void ble_stack_deinitEnv(void)
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
conn_stack_deinitEnv();
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
#if CONFIG_BT_LE_DTM_ENABLED
dtm_stack_deinitEnv();
#endif // CONFIG_BT_LE_DTM_ENABLED
sync_stack_deinitEnv();
extAdv_stack_deinitEnv();
adv_stack_deinitEnv();
base_stack_deinitEnv();
}
@@ -112,6 +176,28 @@ int ble_stack_enable(void)
return rc;
}
rc = adv_stack_enable();
if (rc) {
return rc;
}
rc = extAdv_stack_enable();
if (rc) {
return rc;
}
rc = sync_stack_enable();
if (rc) {
return rc;
}
#if CONFIG_BT_LE_DTM_ENABLED
rc = dtm_stack_enable();
if (rc) {
return rc;
}
#endif // CONFIG_BT_LE_DTM_ENABLED
#if DEFAULT_BT_LE_MAX_CONNECTIONS
rc = conn_stack_enable();
if (rc) {
@@ -130,6 +216,10 @@ int ble_stack_enable(void)
ble_stack_enableVsEvents(true);
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
#if CONFIG_BT_LE_RXBUF_OPT_ENABLED
mmgmt_enableRxbufOptFeature();
#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED
return 0;
}
@@ -146,6 +236,11 @@ void ble_stack_disable(void)
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
conn_stack_disable();
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
#if CONFIG_BT_LE_DTM_ENABLED
dtm_stack_disable();
#endif // CONFIG_BT_LE_DTM_ENABLED
sync_stack_disable();
extAdv_stack_disable();
adv_stack_disable();
base_stack_disable();
}

View File

@@ -42,6 +42,7 @@
#include "esp_phy_init.h"
#endif
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk_tree_common.h"
#include "bt_osi_mem.h"
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
@@ -60,12 +61,11 @@
#include "hal/efuse_hal.h"
#include "soc/rtc.h"
#include "modem/modem_syscon_struct.h"
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
/* Macro definition
************************************************************************
@@ -74,7 +74,7 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
@@ -105,26 +105,40 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
#if CONFIG_IDF_TARGET_ESP32C6
void (* _esp_reset_modem)(uint8_t mdl_opts, uint8_t start);
#endif // CONFIG_IDF_TARGET_ESP32C6
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
extern void coex_hw_timer_set(uint8_t idx,uint8_t src, uint8_t pti,uint32_t latency, uint32_t perioidc);
extern void coex_hw_timer_enable(uint8_t idx);
extern void coex_hw_timer_disable(uint8_t idx);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_deinit_async(void);
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
extern void r_ble_log_deinit_simple(void);
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
extern void r_ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
extern void esp_panic_handler_feed_wdts(void);
extern int r_ble_log_ctrl_level_and_mod(uint8_t log_level, uint32_t mod_switch);
extern int r_ble_ctrl_mod_type(uint16_t mod, uint32_t mod_type_switch);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
@@ -152,7 +166,9 @@ extern void r_priv_sdk_config_insert_proc_time_set(uint16_t insert_proc_time);
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
#if CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
extern void r_ble_ll_customize_peer_sca_set(uint16_t peer_sca);
#endif // CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
@@ -185,65 +201,48 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
#if CONFIG_IDF_TARGET_ESP32C6
static void esp_reset_modem(uint8_t mdl_opts,uint8_t start);
#endif // CONFIG_IDF_TARGET_ESP32C6
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
LOG_SPI_OUT,
};
static bool log_is_inited = false;
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t log_output_mode = LOG_SPI_OUT;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
esp_err_t esp_bt_controller_log_init(void)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
return ESP_OK;
}
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
if (ble_log_spi_out_init() != 0) {
goto spi_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
if (r_ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
@@ -251,48 +250,50 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
case LOG_SPI_OUT:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ble_log_spi_out_init();
bt_controller_log_interface = ble_log_spi_out_write_esp;
bool task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
task_create = false;
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_ctrl_log_partition_get_and_erase_first_block();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
break;
default:
assert(0);
}
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret != ESP_OK) {
return ret;
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
goto log_init_failed;
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ret = r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH);
if (ret == ESP_OK) {
log_is_inited = true;
if (r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH) != ESP_OK) {
goto ctrl_level_init_failed;
}
return ret;
log_is_inited = true;
return ESP_OK;
ctrl_level_init_failed:
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_init_failed:
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
spi_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
return ESP_FAIL;
}
void esp_bt_ontroller_log_deinit(void)
void esp_bt_controller_log_deinit(void)
{
r_ble_log_deinit_async();
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
#endif
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_is_inited = false;
}
@@ -384,13 +385,13 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
r_ble_log_async_output_dump_all(true);
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
if (is_filled) {
read_index = next_erase_index;
} else {
@@ -402,7 +403,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
print_len = 0;
}
@@ -440,8 +441,12 @@ static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#endif // CONFIG_PM_ENABLE
#define MAIN_XTAL_FREQ_HZ (40000000)
#define MAIN_XTAL_FREQ_HZ_WORKROUND (500000)
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (2500)
static DRAM_ATTR uint32_t s_bt_lpclk_freq = 100000;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (3200)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (500)
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT|MALLOC_CAP_DMA)
@@ -476,15 +481,34 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
#if CONFIG_IDF_TARGET_ESP32C6
._esp_reset_modem = esp_reset_modem,
#endif // CONFIG_IDF_TARGET_ESP32C6
.magic = EXT_FUNC_MAGIC_VALUE,
};
static void IRAM_ATTR esp_reset_rpa_moudle(void)
#if CONFIG_IDF_TARGET_ESP32C6
static void IRAM_ATTR esp_reset_modem(uint8_t mdl_opts,uint8_t start)
{
if (mdl_opts == 0x05) {
if (start) {
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_hw_timer_set(0x04, 0x02, 15, 0, 5000);
coex_hw_timer_enable(0x04);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
MODEM_SYSCON.modem_rst_conf.val |= (BIT(16) | BIT(18));
MODEM_SYSCON.modem_rst_conf.val &= ~(BIT(16) | BIT(18));
} else {
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_hw_timer_disable(0x04);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
}
}
}
#endif // CONFIG_IDF_TARGET_ESP32C6
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
@@ -568,16 +592,21 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
/* Select slow clock source for BT momdule */
switch (slow_clk_src) {
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
#if SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND
uint32_t chip_version = efuse_hal_chip_revision();
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source, chip ver: %d", chip_version);
if (chip_version == 0) {
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (400 - 1));
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (MAIN_XTAL_FREQ_HZ/s_bt_lpclk_freq - 1));
} else{
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (MAIN_XTAL_FREQ_HZ_WORKROUND/s_bt_lpclk_freq - 1));
}
#else
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (MAIN_XTAL_FREQ_HZ/s_bt_lpclk_freq - 1));
#endif // SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND
break;
case MODEM_CLOCK_LPCLK_SRC_RC_SLOW:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, use with caution as it may not maintain ACL or Sync process due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_XTAL32K:
@@ -603,6 +632,10 @@ modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return;
}
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
@@ -610,6 +643,38 @@ void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
s_bt_lpclk_src = clk_src;
}
uint32_t esp_bt_get_lpclk_freq(void)
{
return s_bt_lpclk_freq;
}
void esp_bt_set_lpclk_freq(uint32_t clk_freq)
{
uint32_t xtal_freq;
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return;
}
if (!clk_freq) {
return;
}
xtal_freq = MAIN_XTAL_FREQ_HZ;
#if SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND
uint32_t chip_version = efuse_hal_chip_revision();
if (chip_version == 1) {
xtal_freq = MAIN_XTAL_FREQ_HZ_WORKROUND;
}
#endif // SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND
if (xtal_freq % clk_freq) {
return;
}
s_bt_lpclk_freq = clk_freq;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@@ -631,10 +696,17 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
return;
}
#ifdef CONFIG_PM_ENABLE
esp_pm_config_t pm_config;
esp_pm_lock_acquire(s_pm_lock);
esp_pm_get_configuration(&pm_config);
assert(esp_rom_get_cpu_ticks_per_us() == pm_config.max_freq_mhz);
r_ble_rtc_wake_up_state_clr();
#endif //CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
uint32_t *clk_freq = (uint32_t *)arg;
*clk_freq = esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED) / 5;
}
s_ble_active = true;
}
@@ -865,11 +937,12 @@ static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
cfg->rtc_freq = s_bt_lpclk_freq;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
cfg->rtc_freq = esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED) / 5;
cfg->ble_ll_sca = 3000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
@@ -948,7 +1021,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ret = esp_bt_controller_log_init(log_output_mode);
ret = esp_bt_controller_log_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
@@ -968,6 +1041,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto modem_deint;
}
#if CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
r_ble_ll_customize_peer_sca_set(CONFIG_BT_LE_LL_PEER_SCA);
#endif // CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
ret = ble_stack_initEnv();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_stack_initEnv failed %d", ret);
@@ -1020,7 +1097,7 @@ free_controller:
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_phy_modem_deinit();
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
@@ -1057,7 +1134,7 @@ esp_err_t esp_bt_controller_deinit(void)
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@@ -1405,42 +1482,47 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(1000);
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
if (end) {
esp_rom_printf("\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
esp_bt_read_ctrl_log_from_flash(output);
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
#endif
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
@@ -1661,7 +1743,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
int IRAM_ATTR
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
{
int i;
@@ -1688,3 +1770,10 @@ ble_capture_info_user_handler(uint8_t type, uint32_t reason)
}
return 0;
}
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
void ble_memory_count_limit_set(uint16_t count_limit)
{
bt_osi_mem_count_limit_set(count_limit);
}
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED

View File

@@ -40,6 +40,7 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT MYNEWT_VAL(BLE_TRANSPORT_EVT_COUNT)
#define DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT MYNEWT_VAL(BLE_TRANSPORT_EVT_DISCARDABLE_COUNT)
#define DEFAULT_BT_LE_POWER_CONTROL_ENABLED MYNEWT_VAL(BLE_POWER_CONTROL)
#define DEFAULT_BT_LE_SUBRATE_ENABLED MYNEWT_VAL(BLE_CONN_SUBRATING)
#if defined(CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT)
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (1)
#else
@@ -144,6 +145,8 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#define DEFAULT_BT_LE_SUBRATE_ENABLED 0
#endif
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
@@ -192,6 +195,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else
@@ -204,6 +213,12 @@ extern "C" {
#define DEFAULT_BT_LE_VHCI_ENABLED (0)
#endif
#ifdef CONFIG_BT_LE_PTR_CHECK_ENABLED
#define DEFAULT_BT_LE_PTR_CHECK_ENABLED (CONFIG_BT_LE_PTR_CHECK_ENABLED)
#else
#define DEFAULT_BT_LE_PTR_CHECK_ENABLED (0)
#endif
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
#define NIMBLE_SLEEP_ENABLE CONFIG_BT_LE_SLEEP_ENABLE
#else
@@ -268,6 +283,9 @@ extern "C" {
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
#define BLE_LL_ADV_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, CONFIG_BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT)
#define BLE_LL_CONN_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_CONNECTIONS, CONFIG_BT_LE_CONN_RESERVED_MEMORY_COUNT)
#define RUN_BQB_TEST (0)
#define RUN_QA_TEST (0)
#define NIMBLE_DISABLE_SCAN_BACKOFF (0)

View File

@@ -1,6 +1,5 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM
@@ -108,7 +107,7 @@ menu "HCI Config"
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
default 2048
help
This configures stack size of hci transport task
@@ -228,6 +227,19 @@ config BT_LE_POWER_CONTROL_ENABLED
help
Set this option to enable the Power Control feature on controller
config BT_LE_CTE_FEATURE_ENABLED
bool "Enable Bluetooth LE Direction Finding (AoA/AoD)"
depends on BT_LE_50_FEATURE_SUPPORT && SOC_BLE_CTE_SUPPORTED && !(BT_LE_SECURITY_ENABLE)
default n
help
Enable this option to activate Bluetooth LE Direction Finding (AoA/AoD) feature.
Note:
This feature allows devices to determine the direction of a Bluetooth CTE signal,
enabling Angle of Arrival (AoA) and Angle of Departure (AoD) functionality.
In chip esp32h2, Direction Finding is not supported in encrypted
communication scenarios. If you are using chip esp32h2, ensure that encryption is
disabled when using this feature.
menu "Memory Settings"
depends on !BT_NIMBLE_ENABLED
@@ -425,6 +437,16 @@ menu "Controller debug features"
default n
help
Retain scene with GDB to capture info, requires disabling WDT (CONFIG_ESP_INT_WDT, CONFIG_ESP_TASK_WDT_EN).
config BT_LE_PTR_CHECK_ENABLED
bool "Enable boundary check for internal memory"
default n
config BT_LE_MEM_CHECK_ENABLED
bool "Enable memory allocation check"
default n
help
Used in internal tests only. Enable the memory allocation check.
endmenu
config BT_LE_LL_RESOLV_LIST_SIZE
@@ -482,7 +504,7 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
config BT_LE_WHITELIST_SIZE
int "BLE white list size"
range 1 15
range 1 31
default 12
depends on !BT_NIMBLE_ENABLED
@@ -503,6 +525,23 @@ config BT_LE_LL_SCA
help
Sleep clock accuracy of our device (in ppm)
config BT_LE_LL_PEER_SCA_SET_ENABLE
bool "Enable to set constant peer SCA"
default n
help
Enable setting of constant peer SCA, use this if peer device has SCA larger than 500 PPM.
Enable this option, the controller will always use BT_LE_LL_PEER_SCA as the peer SCA value
to calculate the window widening instead of the value received from peer device.
config BT_LE_LL_PEER_SCA
int "Constant peer sleep clock accuracy value"
range 0 10000
depends on BT_LE_LL_PEER_SCA_SET_ENABLE
default 0
help
Set the sleep clock accuracy of peer device
config BT_LE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
depends on !BT_NIMBLE_ENABLED
@@ -683,7 +722,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.
@@ -806,3 +845,49 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
When this option is enabled, auxiliary packets will be present in the events of
'Non-Connectable and Non-Scannable' regardless of whether the advertising length is 0.
If this option is not enabled, auxiliary packets will only be present when the advertising length is not 0.
config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature"
default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.
menu "Reserved Memory Config"
config BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT
int "The value of reserved EXT ADV memory count at initialization"
range 0 4
default 2
help
This value sets the number the Controller will allocate for extended advertisement
instances at initialization process. If more extended advertisement instances are
enabled, those memory will be dynamically allocated.
Using reduced amount of reserved memory will save heap size at the cost of extra
time consumption at advertising start process and possible advertising start failure
due to memory shortage.
The actual reserved memory count will be the minimum value between the maximum
extended advertisement instances and the BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT.
config BT_LE_CONN_RESERVED_MEMORY_COUNT
int "The value of reserved CONN memory count at initialization"
range 0 70
default 2
help
This value sets the number the Controller will allocate for connection instances
at the initialization process. If more connection instances are enabled, those
memory will be dynamically allocated.
Using reduced amount of reserved memory will save heap size at the cost of extra
time consumption at connection establishment process and possible connection
establishment failure due to memory shortage.
The actual reserved memory count will be the minimum value between the maximum connection instances and
the BT_LE_CONN_RESERVED_MEMORY_COUNT.
endmenu
config BT_LE_DTM_ENABLED
bool "Enable Direct Test Mode (DTM) feature"
default n

View File

@@ -22,6 +22,28 @@ void conn_stack_deinitEnv(void);
int conn_stack_enable(void);
void conn_stack_disable(void);
int adv_stack_initEnv(void);
void adv_stack_deinitEnv(void);
int adv_stack_enable(void);
void adv_stack_disable(void);
int extAdv_stack_initEnv(void);
void extAdv_stack_deinitEnv(void);
int extAdv_stack_enable(void);
void extAdv_stack_disable(void);
int sync_stack_initEnv(void);
void sync_stack_deinitEnv(void);
int sync_stack_enable(void);
void sync_stack_disable(void);
#if CONFIG_BT_LE_DTM_ENABLED
int dtm_stack_initEnv(void);
void dtm_stack_deinitEnv(void);
int dtm_stack_enable(void);
void dtm_stack_disable(void);
#endif // CONFIG_BT_LE_DTM_ENABLED
#if CONFIG_BT_LE_ERROR_SIM_ENABLED
int conn_errorSim_initEnv(void);
void conn_errorSim_deinitEnv(void);
@@ -38,10 +60,15 @@ void pcl_stack_enableSetRssiThreshVsCmd(bool en);
void chanSel_stack_enableSetCsaVsCmd(bool en);
void log_stack_enableLogsRelatedVsCmd(bool en);
void hci_stack_enableSetVsEvtMaskVsCmd(bool en);
void winWiden_stack_enableSetConstPeerScaVsCmd(bool en);
void adv_stack_enableScanReqRxdVsEvent(bool en);
void conn_stack_enableChanMapUpdCompVsEvent(bool en);
void sleep_stack_enableWakeupVsEvent(bool en);
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
#if CONFIG_BT_LE_RXBUF_OPT_ENABLED
extern void mmgmt_enableRxbufOptFeature(void);
#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED
/* Local functions definition
***************************************************************************
@@ -57,12 +84,17 @@ void ble_stack_enableVsCmds(bool en)
chanSel_stack_enableSetCsaVsCmd(en);
log_stack_enableLogsRelatedVsCmd(en);
hci_stack_enableSetVsEvtMaskVsCmd(en);
winWiden_stack_enableSetConstPeerScaVsCmd(en);
}
void ble_stack_enableVsEvents(bool en)
{
adv_stack_enableScanReqRxdVsEvent(en);
conn_stack_enableChanMapUpdCompVsEvent(en);
#if CONFIG_BT_LE_SLEEP_ENABLE
sleep_stack_enableWakeupVsEvent(en);
#endif // CONFIG_BT_LE_SLEEP_ENABLE
}
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
@@ -75,6 +107,28 @@ int ble_stack_initEnv(void)
return rc;
}
rc = adv_stack_initEnv();
if (rc) {
return rc;
}
rc = extAdv_stack_initEnv();
if (rc) {
return rc;
}
rc = sync_stack_initEnv();
if (rc) {
return rc;
}
#if CONFIG_BT_LE_DTM_ENABLED
rc = dtm_stack_initEnv();
if (rc) {
return rc;
}
#endif // CONFIG_BT_LE_DTM_ENABLED
#if DEFAULT_BT_LE_MAX_CONNECTIONS
rc = conn_stack_initEnv();
if (rc) {
@@ -99,7 +153,12 @@ void ble_stack_deinitEnv(void)
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
conn_stack_deinitEnv();
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
#if CONFIG_BT_LE_DTM_ENABLED
dtm_stack_deinitEnv();
#endif // CONFIG_BT_LE_DTM_ENABLED
sync_stack_deinitEnv();
extAdv_stack_deinitEnv();
adv_stack_deinitEnv();
base_stack_deinitEnv();
}
@@ -112,6 +171,28 @@ int ble_stack_enable(void)
return rc;
}
rc = adv_stack_enable();
if (rc) {
return rc;
}
rc = extAdv_stack_enable();
if (rc) {
return rc;
}
rc = sync_stack_enable();
if (rc) {
return rc;
}
#if CONFIG_BT_LE_DTM_ENABLED
rc = dtm_stack_enable();
if (rc) {
return rc;
}
#endif // CONFIG_BT_LE_DTM_ENABLED
#if DEFAULT_BT_LE_MAX_CONNECTIONS
rc = conn_stack_enable();
if (rc) {
@@ -130,6 +211,10 @@ int ble_stack_enable(void)
ble_stack_enableVsEvents(true);
#endif // (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
#if CONFIG_BT_LE_RXBUF_OPT_ENABLED
mmgmt_enableRxbufOptFeature();
#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED
return 0;
}
@@ -146,6 +231,11 @@ void ble_stack_disable(void)
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
conn_stack_disable();
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
#if CONFIG_BT_LE_DTM_ENABLED
dtm_stack_disable();
#endif // CONFIG_BT_LE_DTM_ENABLED
sync_stack_disable();
extAdv_stack_disable();
adv_stack_disable();
base_stack_disable();
}

View File

@@ -51,14 +51,13 @@
#include "freertos/task.h"
#include "esp_private/periph_ctrl.h"
#include "esp_private/esp_clk_tree_common.h"
#include "esp_sleep.h"
#include "soc/rtc.h"
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
/* Macro definition
************************************************************************
@@ -67,7 +66,7 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
@@ -98,12 +97,16 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
@@ -112,11 +115,13 @@ extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_init_async(interface_func_t interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_deinit_async(void);
extern int r_ble_log_init_simple(interface_func_t interface, void *handler);
extern void r_ble_log_deinit_simple(void);
extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
extern void r_ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
extern void esp_panic_handler_feed_wdts(void);
extern int r_ble_log_ctrl_level_and_mod(uint8_t log_level, uint32_t mod_switch);
extern int r_ble_ctrl_mod_type(uint16_t mod, uint32_t mod_type_switch);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
@@ -147,7 +152,9 @@ extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#if CONFIG_PM_ENABLE
extern void r_esp_ble_stop_wakeup_timing(void);
#endif // CONFIG_PM_ENABLE
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
#if CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
extern void r_ble_ll_customize_peer_sca_set(uint16_t peer_sca);
#endif // CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
@@ -180,65 +187,45 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
LOG_SPI_OUT,
};
static bool log_is_inited = false;
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#elif CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t log_output_mode = LOG_SPI_OUT;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
esp_err_t esp_bt_controller_log_init(void)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
return ESP_OK;
}
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
if (ble_log_spi_out_init() != 0) {
goto spi_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
if (r_ble_log_init_simple(ble_log_spi_out_ll_write, ble_log_spi_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
@@ -246,48 +233,50 @@ esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
case LOG_SPI_OUT:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ble_log_spi_out_init();
bt_controller_log_interface = ble_log_spi_out_write_esp;
bool task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
task_create = false;
#elif CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_ctrl_log_partition_get_and_erase_first_block();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
break;
default:
assert(0);
}
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret != ESP_OK) {
return ret;
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
goto log_init_failed;
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
ret = r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH);
if (ret == ESP_OK) {
log_is_inited = true;
if (r_ble_log_ctrl_level_and_mod(CONFIG_BT_LE_CONTROLLER_LOG_OUTPUT_LEVEL, CONFIG_BT_LE_CONTROLLER_LOG_MOD_OUTPUT_SWITCH) != ESP_OK) {
goto ctrl_level_init_failed;
}
return ret;
log_is_inited = true;
return ESP_OK;
ctrl_level_init_failed:
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_init_failed:
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
spi_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
return ESP_FAIL;
}
void esp_bt_ontroller_log_deinit(void)
void esp_bt_controller_log_deinit(void)
{
r_ble_log_deinit_async();
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_deinit();
#endif
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_simple();
#else // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
log_is_inited = false;
}
@@ -379,13 +368,13 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
r_ble_log_async_output_dump_all(true);
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
if (is_filled) {
read_index = next_erase_index;
} else {
@@ -397,7 +386,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
print_len = 0;
}
@@ -408,7 +397,7 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
err = esp_bt_controller_log_init();
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
@@ -435,7 +424,9 @@ static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#endif // CONFIG_PM_ENABLE
#define MAIN_XTAL_FREQ_HZ (32000000)
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
static DRAM_ATTR uint32_t s_bt_lpclk_freq = 100000;
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT|MALLOC_CAP_DMA)
void *malloc_ble_controller_mem(size_t size)
@@ -472,15 +463,9 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE,
};
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
@@ -566,10 +551,10 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
switch (slow_clk_src) {
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (320 - 1));
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (MAIN_XTAL_FREQ_HZ/s_bt_lpclk_freq - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_RC_SLOW:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, use with caution as it may not maintain ACL or Sync process due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_XTAL32K:
@@ -595,6 +580,10 @@ modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return;
}
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
@@ -602,6 +591,28 @@ void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
s_bt_lpclk_src = clk_src;
}
uint32_t esp_bt_get_lpclk_freq(void)
{
return s_bt_lpclk_freq;
}
void esp_bt_set_lpclk_freq(uint32_t clk_freq)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return;
}
if (!clk_freq) {
return;
}
if (MAIN_XTAL_FREQ_HZ % clk_freq) {
return;
}
s_bt_lpclk_freq = clk_freq;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@@ -623,10 +634,17 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
return;
}
#ifdef CONFIG_PM_ENABLE
esp_pm_config_t pm_config;
esp_pm_lock_acquire(s_pm_lock);
esp_pm_get_configuration(&pm_config);
assert(esp_rom_get_cpu_ticks_per_us() == pm_config.max_freq_mhz);
r_ble_rtc_wake_up_state_clr();
#endif //CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
uint32_t *clk_freq = (uint32_t *)arg;
*clk_freq = esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED) / 5;
}
s_ble_active = true;
}
@@ -847,11 +865,12 @@ static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
cfg->rtc_freq = s_bt_lpclk_freq;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
cfg->rtc_freq = esp_clk_tree_lp_slow_get_freq_hz(ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED) / 5;
cfg->ble_ll_sca = 3000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
@@ -929,7 +948,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ret = esp_bt_controller_log_init(log_output_mode);
ret = esp_bt_controller_log_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
@@ -949,6 +968,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto modem_deint;
}
#if CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
r_ble_ll_customize_peer_sca_set(CONFIG_BT_LE_LL_PEER_SCA);
#endif // CONFIG_BT_LE_LL_PEER_SCA_SET_ENABLE
ret = ble_stack_initEnv();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_stack_initEnv failed %d", ret);
@@ -1001,7 +1024,7 @@ free_controller:
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
@@ -1036,7 +1059,7 @@ esp_err_t esp_bt_controller_deinit(void)
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_bt_ontroller_log_deinit();
esp_bt_controller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@@ -1242,7 +1265,6 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
return ret;
}
esp_bt_controller_status_t esp_bt_controller_get_status(void)
{
return ble_controller_status;
@@ -1384,41 +1406,47 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(1000);
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
if (end) {
esp_rom_printf("\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#else
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
esp_panic_handler_feed_wdts();
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
@@ -1638,7 +1666,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
int IRAM_ATTR
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
{
int i;
@@ -1665,3 +1693,10 @@ ble_capture_info_user_handler(uint8_t type, uint32_t reason)
}
return 0;
}
#if CONFIG_BT_LE_MEM_CHECK_ENABLED
void ble_memory_count_limit_set(uint16_t count_limit)
{
bt_osi_mem_count_limit_set(count_limit);
}
#endif // CONFIG_BT_LE_MEM_CHECK_ENABLED

View File

@@ -192,6 +192,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else
@@ -204,6 +210,12 @@ extern "C" {
#define DEFAULT_BT_LE_VHCI_ENABLED (0)
#endif
#ifdef CONFIG_BT_LE_PTR_CHECK_ENABLED
#define DEFAULT_BT_LE_PTR_CHECK_ENABLED (CONFIG_BT_LE_PTR_CHECK_ENABLED)
#else
#define DEFAULT_BT_LE_PTR_CHECK_ENABLED (0)
#endif
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
#define NIMBLE_SLEEP_ENABLE CONFIG_BT_LE_SLEEP_ENABLE
#else
@@ -268,6 +280,9 @@ extern "C" {
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
#define BLE_LL_ADV_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, CONFIG_BT_LE_EXT_ADV_RESERVED_MEMORY_COUNT)
#define BLE_LL_CONN_SM_RESERVE_CNT_N MIN(DEFAULT_BT_LE_MAX_CONNECTIONS, CONFIG_BT_LE_CONN_RESERVED_MEMORY_COUNT)
#define RUN_BQB_TEST (0)
#define RUN_QA_TEST (0)
#define NIMBLE_DISABLE_SCAN_BACKOFF (0)

View File

@@ -408,7 +408,7 @@ if BLE_MESH
int "Maximum capacity of solicitation replay protection list"
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
default 2
range 1 255
range 1 65536
help
This option specifies the maximum capacity of the solicitation replay
protection list. The solicitation replay protection list is used to

View File

@@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -190,12 +190,11 @@ static inline int adv_send(struct net_buf *buf)
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
struct bt_mesh_adv_data solic_ad[3] = {
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_FLAGS, (BLE_MESH_AD_GENERAL | BLE_MESH_AD_NO_BREDR)),
struct bt_mesh_adv_data solic_ad[2] = {
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
};
err = bt_le_adv_start(&param, solic_ad, 3, NULL, 0);
err = bt_le_adv_start(&param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
} else
#endif
{

View File

@@ -44,6 +44,7 @@ enum bt_mesh_adv_type {
BLE_MESH_ADV_URI,
BLE_MESH_ADV_BLE,
BLE_MESH_ADV_PROXY_SOLIC,
BLE_MESH_ADV_TYPES_NUM,
};
struct bt_mesh_adv {

View File

@@ -1599,8 +1599,10 @@ static void bt_mesh_bta_gattc_cb(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
for (i = 0; i < ARRAY_SIZE(bt_mesh_gattc_info); i++) {
if (bt_mesh_gattc_info[i].conn.handle == handle) {
if (bt_mesh_gattc_info[i].wr_desc_done == false) {
BT_DBG("Receive notification before finishing to write ccc");
BT_WARN("Receive notification before finishing to write ccc");
#if !CONFIG_BLE_MESH_BQB_TEST
return;
#endif
}
conn = &bt_mesh_gattc_info[i].conn;

View File

@@ -441,7 +441,9 @@ int bt_mesh_init(const struct bt_mesh_prov *prov,
if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) ||
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) {
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT) ||
(IS_ENABLED(CONFIG_BLE_MESH_RPR_SRV) &&
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT))) {
bt_mesh_proxy_client_init();
}
@@ -591,7 +593,9 @@ int bt_mesh_deinit(struct bt_mesh_deinit_param *param)
if ((IS_ENABLED(CONFIG_BLE_MESH_PROVISIONER) &&
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT)) ||
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT)) {
IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_CLIENT) ||
(IS_ENABLED(CONFIG_BLE_MESH_RPR_SRV) &&
IS_ENABLED(CONFIG_BLE_MESH_PB_GATT))) {
bt_mesh_proxy_client_deinit();
}

View File

@@ -147,7 +147,8 @@ void bt_mesh_hci_init(void)
static struct ble_gap_disc_params scan_param;
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT
CONFIG_BLE_MESH_GATT_PROXY_CLIENT || \
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)
static struct gattc_prov_info {
/* Service to be found depends on the type of adv pkt received */
struct bt_mesh_conn conn;
@@ -396,13 +397,16 @@ static int svc_disced(uint16_t conn_handle, const struct ble_gatt_error *error,
return rc;
}
#endif /* (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || CONFIG_BLE_MESH_GATT_PROXY_CLIENT */
#endif /* (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT ||
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT) */
static int disc_cb(struct ble_gap_event *event, void *arg)
{
struct ble_gap_disc_desc *desc;
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT
CONFIG_BLE_MESH_GATT_PROXY_CLIENT || \
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)
int rc, i;
uint8_t notif_data[100];
uint16_t notif_len;
@@ -425,7 +429,8 @@ static int disc_cb(struct ble_gap_event *event, void *arg)
break;
}
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT
CONFIG_BLE_MESH_GATT_PROXY_CLIENT || \
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)
case BLE_GAP_EVENT_CONNECT:
if (event->connect.status == 0) {
/* Connection successfully established. */
@@ -1357,7 +1362,8 @@ int bt_mesh_gatts_set_local_device_name(const char *name)
#endif /* CONFIG_BLE_MESH_NODE */
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT
CONFIG_BLE_MESH_GATT_PROXY_CLIENT || \
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)
void bt_mesh_gattc_conn_cb_register(struct bt_mesh_prov_conn_cb *cb)
{
bt_mesh_gattc_conn_cb = cb;
@@ -1598,7 +1604,10 @@ void bt_mesh_gattc_disconnect(struct bt_mesh_conn *conn)
* Mesh Proxy Data In: 0x2ADD
* Mesh PROXY Data Out: 0x2ADE
*/
#endif /* (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || CONFIG_BLE_MESH_GATT_PROXY_CLIENT */
#endif /* (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) ||
CONFIG_BLE_MESH_GATT_PROXY_CLIENT ||
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)*/
struct bt_mesh_conn *bt_mesh_conn_ref(struct bt_mesh_conn *conn)
{
@@ -1743,7 +1752,8 @@ void bt_mesh_gatt_init(void)
#endif /* CONFIG_BLE_MESH_NODE */
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT
CONFIG_BLE_MESH_GATT_PROXY_CLIENT || \
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)
for (int i = 0; i < ARRAY_SIZE(bt_mesh_gattc_info); i++) {
bt_mesh_gattc_info[i].conn.handle = 0xFFFF;
bt_mesh_gattc_info[i].mtu = BLE_ATT_MTU_DFLT;
@@ -1761,7 +1771,8 @@ void bt_mesh_gatt_deinit(void)
#endif
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_CLIENT
CONFIG_BLE_MESH_GATT_PROXY_CLIENT || \
(CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT)
for (int i = 0; i < ARRAY_SIZE(bt_mesh_gattc_info); i++) {
bt_mesh_gattc_info[i].conn.handle = 0xFFFF;
memset(&bt_mesh_gattc_info[i].addr, 0, sizeof(bt_mesh_addr_t));

View File

@@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -135,6 +135,9 @@ bool bt_mesh_prov_pdu_check(uint8_t type, uint16_t length, uint8_t *reason)
#define CLOSE_XMIT BLE_MESH_TRANSMIT(2, 20)
#define CLOSE_TIMEOUT K_MSEC(100)
#define CLOSE_RETRANS_CNT 3
#define CLOSE_RETRANS_WITH_REASON(cnt, rsn) (((cnt) << 4) | ((rsn) & 0x0f))
#define CLOSE_RETRANS_GET(rsn) ((rsn) >> 4)
#define BUF_TIMEOUT K_MSEC(400)
@@ -457,12 +460,19 @@ static void prov_retransmit(struct k_work *work)
if (link->pb_remote_close) {
link->pb_remote_close(link, link->reason);
}
return;
} else {
if (link->reset_adv_link) {
link->reset_adv_link(link, link->reason);
uint8_t retrans_cnt = CLOSE_RETRANS_GET(link->reason);
if (!retrans_cnt) {
if (link->reset_adv_link) {
link->reset_adv_link(link, link->reason);
}
return;
} else {
retrans_cnt--;
link->reason = CLOSE_RETRANS_WITH_REASON(retrans_cnt, link->reason);
}
}
return;
}
bt_mesh_mutex_lock(&link->buf_lock);
@@ -547,7 +557,14 @@ int bt_mesh_prov_bearer_ctl_send(struct bt_mesh_prov_link *link, uint8_t op,
if (op == LINK_CLOSE) {
bt_mesh_atomic_clear_bit(link->flags, LINK_ACTIVE);
bt_mesh_atomic_set_bit(link->flags, LINK_CLOSING);
link->reason = *((uint8_t *)data);
/** We can also use buf->ref and a flag to decide that
* link close has been sent 3 times.
* Here we use another way: use retransmit timer and need
* to make sure the timer is not cancelled during sending
* link close pdu, Therefore, use the higher four bits
* of reason as a retransmit count.
*/
link->reason = CLOSE_RETRANS_WITH_REASON(CLOSE_RETRANS_CNT, (*((uint8_t *)data)));
}
return 0;

View File

@@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -82,12 +82,12 @@ static void reset_state(void)
}
#endif /* CONFIG_BLE_MESH_PB_GATT */
#if CONFIG_BLE_MESH_PB_ADV
/* Clear everything except the retransmit and protocol timer
* delayed work objects.
*/
(void)memset(&prov_link, 0, offsetof(struct bt_mesh_prov_link, tx.retransmit));
#if CONFIG_BLE_MESH_PB_ADV
prov_link.pending_ack = PROV_XACT_NVAL;
prov_link.rx.prev_id = PROV_XACT_NVAL;
@@ -154,7 +154,7 @@ static int prov_send_gatt(struct bt_mesh_prov_link *link, struct net_buf_simple
/* Changed by Espressif, add provisioning timeout timer operations.
* When sending a provisioning PDU successfully, restart the 60s timer.
*/
#if CONFIG_BLE_MESH_GATT_PROXY_CLIENT && CONFIG_BLE_MESH_RPR_SRV
#if CONFIG_BLE_MESH_RPR_SRV
if (bt_mesh_atomic_test_bit(link->flags, PB_REMOTE)) {
err = bt_mesh_proxy_client_send(link->conn, BLE_MESH_PROXY_PROV, msg);
@@ -1075,10 +1075,19 @@ static void link_ack(struct prov_rx *rx, struct net_buf_simple *buf)
bt_mesh_prov_clear_tx(&prov_link, true);
bt_mesh_rpr_srv_recv_link_ack(prov_link.pb_remote_uuid, true);
} else {
BT_INFO("Link ACK for PB-Remote already received");
BT_DBG("Link ACK for PB-Remote already received");
return;
}
}
#endif /* CONFIG_BLE_MESH_RPR_SRV */
if (!k_delayed_work_remaining_get(&prov_link.prot_timer)) {
/**
* When the link is opened, the provisioner and the unprovisioned device
* shall start the link timer with the timeout value set to 60 seconds.
*/
k_delayed_work_submit(&prov_link.prot_timer, PROTOCOL_TIMEOUT);
}
}
static void link_close(struct prov_rx *rx, struct net_buf_simple *buf)
@@ -1434,6 +1443,11 @@ int bt_mesh_pb_gatt_open(struct bt_mesh_conn *conn)
{
BT_DBG("conn %p", conn);
/**
* It's necessary to determine if it is PB_REMOTE because when the
* node acts as an RPR server, LINK_ACTIVE has already been set upon
* receiving the link open from the RPR client.
*/
if (!bt_mesh_atomic_test_bit(prov_link.flags, PB_REMOTE) &&
bt_mesh_atomic_test_and_set_bit(prov_link.flags, LINK_ACTIVE)) {
BT_ERR("Link is busy");
@@ -1451,6 +1465,14 @@ int bt_mesh_pb_gatt_open(struct bt_mesh_conn *conn)
prov_link.expect = PROV_INVITE;
}
/**
* Just like ADV Link, start provision timeout timer after
* establishing the link to prevent the RPR server from
* being unable to recover to a configurable network state
* during remote provisioning.
*/
k_delayed_work_submit(&prov_link.prot_timer, PROTOCOL_TIMEOUT);
if (bt_mesh_prov_get()->link_open) {
bt_mesh_prov_get()->link_open(BLE_MESH_PROV_GATT);
}
@@ -1496,7 +1518,7 @@ static void protocol_timeout(struct k_work *work)
#if CONFIG_BLE_MESH_PB_GATT
if (prov_link.conn) {
#if CONFIG_BLE_MESH_GATT_PROXY_CLIENT && CONFIG_BLE_MESH_RPR_SRV
#if CONFIG_BLE_MESH_RPR_SRV
if (bt_mesh_atomic_test_bit(prov_link.flags, PB_REMOTE)) {
prov_link.pb_remote_reset = true;
bt_mesh_gattc_disconnect(prov_link.conn);

Some files were not shown because too many files have changed in this diff Show More