Compare commits

...

864 Commits

Author SHA1 Message Date
Xiao Xufeng
fcae32885b change(version): Update version to 5.5.1 2025-08-30 21:42:28 +08:00
Michael (XIAO Xufeng)
ca77450feb Merge branch 'feat/add_c5_c61_supported' into 'release/v5.5'
feat(tools): add c5, c61 into supported targets list

See merge request espressif/esp-idf!41629
2025-08-30 21:39:07 +08:00
Xiao Xufeng
6049a4a1c2 feat(tools): add c5, c61 into supported targets list 2025-08-30 01:23:15 +08:00
Jiang Jiang Jian
d544ed0d21 Merge branch 'bugfix/fixed_c5_rx_data_err_v5.5' into 'release/v5.5'
feat(ble): fixed ble rx pdu error issue on ESP32-C5 (v5.5)

See merge request espressif/esp-idf!41573
2025-08-29 10:58:55 +08:00
Zhao Wei Liang
7f4dd43626 feat(ble): fixed ble rx pdu error issue on ESP32-C5
(cherry picked from commit eaf12518af)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-27 20:12:05 +08:00
Jiang Jiang Jian
ae2b5af875 Merge branch 'bugfix/add_phy_calibration_independent_support_v5.5' into 'release/v5.5'
feat(phy): add phy calibration independent support(backport v5.5)

See merge request espressif/esp-idf!41416
2025-08-22 17:52:32 +08:00
Jiang Jiang Jian
0ef3fb4961 Merge branch 'fix/fix_psram_cross_page_issue_v5.5' into 'release/v5.5'
psram: fixed psram cross page issue on c5 / c61 (v5.5)

See merge request espressif/esp-idf!41403
2025-08-22 12:36:29 +08:00
yinqingzhao
5714153832 feat(phy): add phy calibration independent support 2025-08-22 10:49:23 +08:00
armando
17a23d1ddb fix(psram): fixed psram cross page issue 2025-08-22 00:02:06 +08:00
Jiang Jiang Jian
92df7573a4 Merge branch 'bugfix/fix_esp32c5_ersu_compatibility_issue_v5.5' into 'release/v5.5'
fix(wifi): fix ersu compatibility issue(Backport v5.5)

See merge request espressif/esp-idf!41385
2025-08-21 20:02:13 +08:00
Jiang Jiang Jian
492c534d49 Merge branch 'fix/increase_c61_sleep_wakeup_ahead_time_v5.5' into 'release/v5.5'
change(esp_hw_support): increase esp32c61 s2a_work_time_us (v5.5)

See merge request espressif/esp-idf!41392
2025-08-21 18:02:48 +08:00
wuzhenghui
76f3aea6ea change(esp_hw_support): increase s2a_work_time_us 2025-08-21 11:52:44 +08:00
Jiang Jiang Jian
02c5f2dbb9 Merge branch 'fix/disable_efuse_xts_aes_256_esp32c5_v5.5' into 'release/v5.5'
Disable XTS-AES-256 using efuse key for ESP32-C5 (v5.5)

See merge request espressif/esp-idf!41364
2025-08-21 10:31:37 +08:00
muhaidong
8fe3d573d2 fix(ci): increase the bin size of esp-mqtt ssl example with psk verification 2025-08-21 10:11:09 +08:00
Marius Vikhammer
d20fb2604a Merge branch 'docs/misc_c5_c61_v5.5' into 'release/v5.5'
docs(misc): cleanup docs for C5 and C61 (v5.5)

See merge request espressif/esp-idf!41329
2025-08-21 07:00:48 +08:00
muhaidong
12e1db7753 fix(ci): increased app partition size in mqtt5 example 2025-08-20 19:52:49 +08:00
Jiang Jiang Jian
7b478f3ec8 Merge branch 'fix/fix_psram_incr16_v5.5' into 'release/v5.5'
fix(dma): add burst size check when dma access psram (v5.5)

See merge request espressif/esp-idf!41107
2025-08-20 14:01:36 +08:00
Jiang Jiang Jian
4f8f9748f6 Merge branch 'bugfix/psram_enc_workaround_v5.5' into 'release/v5.5'
fix(psram): provide boot warning about PSRAM encryption issue on C5/C61 (v5.5)

See merge request espressif/esp-idf!41163
2025-08-20 10:21:43 +08:00
harshal.patil
4213e41bbd fix(soc): Disable XTS-AES-256 using efuse key for ESP32-C5 2025-08-19 21:59:34 +05:30
Jiang Jiang Jian
0f07209abb Merge branch 'enhancement/protect_from_odd_phy_disable_operations_by_single_modem_v5.5' into 'release/v5.5'
esp_phy: Add protection of consecutive disable operations by single modem source (v5.5)

See merge request espressif/esp-idf!41291
2025-08-19 20:52:02 +08:00
muhaidong
b26c24ac02 fix(wifi): fix ersu compatibility issue 2025-08-19 19:49:29 +08:00
Jiang Jiang Jian
10d07d1a2b Merge branch 'feat/update_phylib_for_c5_v5.5' into 'release/v5.5'
feat(esp_phy): update phylib for C5(backport v5.5)

See merge request espressif/esp-idf!41202
2025-08-19 19:47:50 +08:00
morris
290a454500 Merge branch 'fix/rmt_simple_encoder_done_with_mem_full_v5.5' into 'release/v5.5'
fix(rmt): fix the state of simple encoder with mem full (v5.5)

See merge request espressif/esp-idf!41243
2025-08-19 15:06:01 +08:00
morris
de8d13360a Merge branch 'bugfix/twai_driver_cxx_test_v5.5' into 'release/v5.5'
fix(twai): fixed build errors in cxx environment (v5.5)

See merge request espressif/esp-idf!41223
2025-08-19 14:59:22 +08:00
Marius Vikhammer
ee777b0387 docs(misc): cleanup docs for C5 and C61 2025-08-18 14:16:22 +08:00
Marius Vikhammer
a3ca8669f2 Merge branch 'doc/update_docs_c61_v5.5' into 'release/v5.5'
doc: update docs (v5.5)

See merge request espressif/esp-idf!41250
2025-08-18 10:53:59 +08:00
morris
2be55b580c fix(twai): fixed build errors in cxx environment
Closes https://github.com/espressif/esp-idf/issues/16999
2025-08-15 18:28:38 +08:00
Chen Jichang
333858e57b fix(dma): add burst size check when dma access psram 2025-08-15 15:37:52 +08:00
Island
ad6904db25 Merge branch 'fix/specify_scan_channel_for_esp32c2_v5.5' into 'release/v5.5'
fix(ble): wrapped specify scan channel vs cmd (v5.5)

See merge request espressif/esp-idf!41155
2025-08-15 14:09:54 +08:00
Island
335bfd874e Merge branch 'fix/spi_ble_log_get_lc_ts_ceva_v5.5' into 'release/v5.5'
fix(ble): disabled get lc ts for ESP32-C3 and ESP32-S3 (v5.5)

See merge request espressif/esp-idf!41231
2025-08-15 14:09:44 +08:00
Wang Mengyang
6891970c49 fix(esp_phy): Add protection of consecutive disable operations by single modem source 2025-08-15 07:20:52 +08:00
armando
9fa874b1ce doc: update docs 2025-08-14 15:17:56 +08:00
Chen Jichang
e159e69c56 fix(rmt): fix the state of the simple encoder with mem full
Closes https://github.com/espressif/esp-idf/issues/17244
2025-08-14 12:49:33 +08:00
Zhou Xiao
1b48a697c4 fix(ble): disabled get lc ts for ESP32-C3 and ESP32-S3
(cherry picked from commit c17bf63874)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-08-14 11:14:08 +08:00
zwx
831a0e8193 feat(esp_phy): update phylib for C5 2025-08-13 10:37:08 +08:00
Mahavir Jain
29df7286c8 fix(esp_psram): make SPIRAM_USE_MEMMAP depend on ESP32 target 2025-08-11 13:46:39 +05:30
Mahavir Jain
2829481eb6 fix(psram): provide boot warning about PSRAM encryption issue on C5/C61
For C5/C61 revision 1.0, PSRAM encryption has hardware issue. This will
be addressed in future silicon version. Add explicit warning about this.
2025-08-11 13:46:38 +05:30
Zhou Xiao
27fee88e26 fix(ble): wrapped specify scan channel vs cmd
(cherry picked from commit 33febd990c)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-08-11 13:13:18 +08:00
Jiang Jiang Jian
1191f4c4f9 Merge branch 'bugfix/update_librtc_v5.5' into 'release/v5.5'
fix(esp_phy): update esp32 librtc.a for coex problems

See merge request espressif/esp-idf!41142
2025-08-09 09:12:30 +08:00
Jiang Jiang Jian
950ac4cff4 Merge branch 'fix/fix_esp32c5_mac_link_bad_tigger_v5.5' into 'release/v5.5'
fix(hal): fix esp32c5 mac link bad trigger (v5.5)

See merge request espressif/esp-idf!41117
2025-08-09 08:10:27 +08:00
Jiang Jiang Jian
6d012bbefe Merge branch 'bugfix/fix_scan_done_event_miss_issue_v5.5' into 'release/v5.5'
fix(wifi): fix scan done event miss issue(Backport v5.5)

See merge request espressif/esp-idf!41036
2025-08-09 08:10:18 +08:00
Jiang Jiang Jian
dbc243657d Merge branch 'change/ble_update_lib_20250806_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250806 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!41141
2025-08-09 00:07:53 +08:00
Jiang Jiang Jian
79ce2ccd07 Merge branch 'patch/ets_delay_us_v5.5' into 'release/v5.5'
fix(esp_tee): Patch the `esp_rom_delay_us` API to use U-mode cycle CSR (v5.5)

See merge request espressif/esp-idf!41017
2025-08-09 00:05:27 +08:00
JinCheng
ccd0d369aa fix(esp_phy): update esp32 librtc.a for coex problems
- ESP32 phy_version: 4861, b71b5ad, Aug, 5 2025
- ESP32 librtc version: 6758f983, Mar 22 2024, 13:39:26
2025-08-08 23:14:47 +08:00
Zhao Wei Liang
d1f47fba23 change(ble): enabled specify scan channel vs hci cmd for ESP32-C2
(cherry picked from commit 2818eb91f1)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-08-08 21:14:38 +08:00
Zhao Wei Liang
d5fc1a61fa change(ble): [AUTO_MR] updated rom linker script for ESP32-C2
(cherry picked from commit 7f7c8e2c85)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-08 21:14:35 +08:00
Zhao Wei Liang
c3f0eceffa change(ble): [AUTO_MR] Update lib_esp32c2 to dbd33ef2
(cherry picked from commit 043143ab8b)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-08 21:14:32 +08:00
Zhao Wei Liang
d18a5f2ddc change(ble): [AUTO_MR] Update lib_esp32c6 to 898f73cb
(cherry picked from commit fe22519bb5)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-08 21:14:30 +08:00
Zhao Wei Liang
865fe36a1d change(ble): [AUTO_MR] Update lib_esp32c5 to 898f73cb
(cherry picked from commit 3abfca1e2c)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-08 21:14:27 +08:00
Zhao Wei Liang
65f0804deb change(ble): [AUTO_MR] Update lib_esp32h2 to 898f73cb
(cherry picked from commit 4990dfdd23)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-08 21:14:24 +08:00
Jiang Jiang Jian
ceb11cd57e Merge branch 'feat/support_11ax_rate_for_cert_test_v5.5' into 'release/v5.5'
Feat/support 11ax rate for cert test v5.5(Backport v5.5)

See merge request espressif/esp-idf!41106
2025-08-08 20:07:20 +08:00
Jiang Jiang Jian
a8721f74cf Merge branch 'fix/regression_issue_in_digest_auth_v5.5' into 'release/v5.5'
fix(esp_http_client): fixed regression issue during enabling digest auth in client (v5.5)

See merge request espressif/esp-idf!41116
2025-08-08 20:07:13 +08:00
Jiang Jiang Jian
201b9178bd Merge branch 'bugfix/correct_attr_count_in_get_db_api_v5.5' into 'release/v5.5'
fix(nimble): Updating the count parameter when fetching the gatt db (v5.5)

See merge request espressif/esp-idf!41030
2025-08-08 20:05:57 +08:00
Jiang Jiang Jian
6acf4e3ae5 Merge branch 'bugfix/fix_touch_isr_safe_issue_v5.5' into 'release/v5.5'
fix(legacy_touch): fixed touch read API can't be called in ISR context (v5.5)

See merge request espressif/esp-idf!41077
2025-08-08 20:05:28 +08:00
yinqingzhao
32b4723cb2 fix(wifi): fix ht20 state check incorrect 2025-08-08 20:00:31 +08:00
yinqingzhao
de8e1c7c06 feat(wifi): improve iperf performance of esp32c61 2025-08-08 20:00:21 +08:00
liuning
5a2c7b2180 fix(wifi): fix some esp-now issues and lightsleep issues
1. fix tbtt issues when wifi_slp_iram_opt is not enabled and light sleep
   enabled
2. support espnow rx all the time at coexistence default mode, fix some
   coexist perfermance issue with coexistence default mode.
3. support connectionless ps with enhanced_light_sleep
4. fix espnow coexist issue when switching to coexistence mode
5. fix concurrent issue of connectionless_interval_set API
2025-08-08 19:59:37 +08:00
Jiang Jiang Jian
a33bff6773 Merge branch 'bugfix/fix_bt_hci_not_effective_v5.5' into 'release/v5.5'
Fixed bt hci event was not report to host when hci command was sent (v5.5)

See merge request espressif/esp-idf!41013
2025-08-08 19:56:00 +08:00
wuzhenghui
521c7fb951 fix(hal): fix esp32c5 mac link bad trigger 2025-08-08 17:00:46 +08:00
nilesh.kale
01481f08f9 fix(esp_http_client): fixed regression issue during enabling digest auth in client
This commit solved the issue introduced in commit a0bcffcce9
for enabling digest auth for esp_http_client.

Closes https://github.com/espressif/esp-idf/issues/17238
2025-08-08 09:47:36 +05:30
Mahavir Jain
942a9bfbe4 Merge branch 'fix(esp_http_client)/fix_potential_double_free' into 'release/v5.5'
fix(esp_http_client): fix possible double memory free

See merge request espressif/esp-idf!40965
2025-08-08 09:46:48 +05:30
Mahavir Jain
2795fae32c Merge branch 'fix/update_postman_root_certificate_v5.5' into 'release/v5.5'
Updated postman root certificate (v5.5)

See merge request espressif/esp-idf!41051
2025-08-08 09:46:08 +05:30
muhaidong
ab6fdc801f feat(phy): update 11ax rate for cert test 2025-08-08 11:26:48 +08:00
muhaidong
7c17a0e1e8 feat(phy): add 11ax rate for cert test 2025-08-08 11:26:48 +08:00
muhaidong
2357ae7621 fix(wifi): fix scan done event miss issue 2025-08-08 11:18:11 +08:00
morris
3132e50cc9 Merge branch 'bugfix/fix_es7210_example_dependency_breaking_change_v5.5' into 'release/v5.5'
fix(i2s_es7210): fixed breaking change of dependency migration (v5.5)

See merge request espressif/esp-idf!41042
2025-08-07 12:04:46 +08:00
laokaiyao
422c123124 fix(legacy_touch): fixed touch read API can't be called in ISR context
Closes https://github.com/espressif/esp-idf/issues/17045
2025-08-06 21:46:28 +08:00
hrushikesh.bhosale
2ac79a842c fix(esp_http_client): Moved httpd_async request from cert_pem to crt_bundle
Moved the httpd_async request from cert_pem to esp_crt_bundle. As cert_pem
is alredy tested for howmyssl URL
2025-08-05 16:25:40 +05:30
Astha Verma
a1a9bf60ae fix(nimble): Handle count correctly by considering offset. 2025-08-05 14:37:04 +05:30
Astha Verma
2fa78fa42e fix(nimble): Updating the count parameter when fetching gatt db 2025-08-05 14:08:00 +05:30
laokaiyao
43b5d206aa fix(i2s_es7210): fixed breaking change of dependency migration 2025-08-05 11:23:41 +08:00
chenjianxing
a3a1b42577 fix(wifi): fix wifi rom code using ets_delay_us for C5 and C61 2025-08-04 11:34:08 +05:30
Laukik Hase
c011bcb0dc fix(esp_rom): Patch the esp_rom_delay_us API to use U-mode cycle CSR 2025-08-04 11:34:07 +05:30
Zhang Hai Peng
c64d9bc3e3 fix(bt/ble): Update esp32 libbtdm_app.a (722c907a)
- Fixed bt hci event was not report to host when hci command was sent


(cherry picked from commit 155c32be20)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-08-04 11:53:35 +08:00
Jiang Jiang Jian
adfa52c442 Merge branch 'feat/chip_esp32c61_update_libphy_v5.5' into 'release/v5.5'
feat(phy): update libphy for esp32c61/esp32c5/esp32h2(backport v5.5)

See merge request espressif/esp-idf!40976
2025-08-02 01:59:47 +08:00
Jiang Jiang Jian
250f248421 Merge branch 'fix/backport_some_wifi_fixes_v5.5' into 'release/v5.5'
fix(wifi): backport some wifi fixes to v5.5

See merge request espressif/esp-idf!40966
2025-08-02 01:40:03 +08:00
Jiang Jiang Jian
14ae516680 Merge branch 'fix/wpsreg_crash_due_to_double_reset_v5.5' into 'release/v5.5'
fix(wifi): Fix crash in WPS-registrar due to nested 'eap_wsc_reset()' calls  (backport v5.5)

See merge request espressif/esp-idf!40957
2025-08-02 01:05:46 +08:00
Jiang Jiang Jian
27452eac70 Merge branch 'bugfix/fixed_ble_dtm_err_v5.5' into 'release/v5.5'
Bugfix/fixed ble dtm err (v5.5)

See merge request espressif/esp-idf!40955
2025-08-01 23:18:44 +08:00
yinqingzhao
0f9ce655c6 feat(phy): update libphy for esp32c61/esp32c5/esp32h2 2025-08-01 20:17:05 +08:00
Jiang Jiang Jian
6fd9c5414c Merge branch 'bugfix/remove_lcd_signals_on_delete_v5.5' into 'release/v5.5'
fix(lcd): reserve the GPIOs used by RGB LCD and disconnect the LCD signals when the dirver is uninstalled. (v5.5)

See merge request espressif/esp-idf!40897
2025-08-01 20:13:17 +08:00
Jiang Jiang Jian
27bd10f821 Merge branch 'bugfix/brownout_log_v5.5' into 'release/v5.5'
fix: change brownout log from INFO to ERROR (v5.5)

See merge request espressif/esp-idf!40959
2025-08-01 20:12:14 +08:00
Michael (XIAO Xufeng)
0be09bc38e Merge branch 'feat/c5_flash_timing_tuning_v5.5' into 'release/v5.5'
flash: flash timing tuning support on c5 (v5.5)

See merge request espressif/esp-idf!40879
2025-08-01 17:20:08 +08:00
Ashish Sharma
8a8d01565e fix(esp_http_client): fix possible double memory free 2025-08-01 14:22:10 +08:00
tarun.kumar
b543181384 fix(wifi): Get operating class in dual band 2025-08-01 11:48:05 +08:00
Sarvesh Bodakhe
e5ccbe2e58 fix(wifi): add GCMP-128 cipher support for SoftAP mode
GCMP-256 SoftAP support was previously added as part of SAE Extended Key handling.
2025-08-01 11:47:49 +08:00
Shreyas Sheth
ab1e547429 fix(esp_wifi): Fix incorrect values for negotiated bandwidth for 2040 coex cases 2025-08-01 11:47:31 +08:00
zhangyanjiao
6c34b02356 fix(wifi/esptouch): fixed the esptouch v2 fail on 5g router 2025-08-01 11:47:12 +08:00
Mahavir Jain
995c2f38ee fix: change brownout log from INFO to ERROR 2025-08-01 08:48:05 +05:30
Sarvesh Bodakhe
4ed18496c4 fix(wifi): prevent crash in WPS-registrar due to nested 'eap_wsc_reset()' calls
When a WPS handshake is already in progress and the enrollee sends another EAPOL-Start
(e.g., due to missed packets or timeout), the registrar resets its state by calling
'eap_wsc_reset()'. This function frees 'sm->eap_method_priv' and then calls
'esp_wifi_ap_wps_disable()', which internally triggers another call to 'eap_wsc_reset()'.

This results in a double reset where the second invocation accesses the already freed
'sm->eap_method_priv', leading to a crash.

This fix sets 'sm->eap_method_priv' to NULL immediately after freeing it to ensure
any subsequent calls to eap_wsc_reset() do not access an invalid pointer.
2025-08-01 08:42:53 +05:30
Jiang Jiang Jian
aa4faf57ef Merge branch 'ci/enable_sysview_tests_v5.5' into 'release/v5.5'
ci: enable sysview example tests for all chips (v5.5)

See merge request espressif/esp-idf!39472
2025-08-01 11:07:46 +08:00
Jiang Jiang Jian
148c36d8aa Merge branch 'bugfix/classic_bt-safe-string-handling_v5.5' into 'release/v5.5'
Bugfix/classic bt safe string handling v5.5

See merge request espressif/esp-idf!40946
2025-08-01 10:43:15 +08:00
Jiang Jiang Jian
1f132a7460 Merge branch 'feat/ide_requirements_v5.5' into 'release/v5.5'
feat(tools/requirements): Add IDE requirements files (v5.5)

See merge request espressif/esp-idf!40940
2025-08-01 10:38:38 +08:00
Jiang Jiang Jian
7704a9e93e Merge branch 'change/ble_update_lib_20250728_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250728 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!40912
2025-08-01 10:37:34 +08:00
Jiang Jiang Jian
f66e21cdfc Merge branch 'feat/support_ble_log_uart_dma_out_v5.5' into 'release/v5.5'
Feat/support ble log uart dma out (v5.5)

See merge request espressif/esp-idf!40657
2025-08-01 10:37:16 +08:00
Jiang Jiang Jian
c8251d3800 Merge branch 'feat/extend_shell_classes_uppercase_v5.5' into 'release/v5.5'
feat(tools): Normalize detected shell name to lowercase on Windows (v5.5)

See merge request espressif/esp-idf!40921
2025-08-01 10:30:20 +08:00
Jiang Jiang Jian
160883a48f Merge branch 'bugfix/fix_compilation_issue_v5.5' into 'release/v5.5'
fix(nimble): Fixed compilation issue with BLE_GATTS flag (v5.5)

See merge request espressif/esp-idf!40809
2025-08-01 10:29:26 +08:00
Jiang Jiang Jian
032b6d802d Merge branch 'bugfix/fix_find_the_oldest_device_v5.5' into 'release/v5.5'
Bugfix/fix find the oldest device (v5.5)

See merge request espressif/esp-idf!40838
2025-08-01 10:29:10 +08:00
Jiang Jiang Jian
59af142586 Merge branch 'opt/opt_ble_hid_example_pair_fail_v5.5' into 'release/v5.5'
fix(ble/bluedroid): set sec_conn only on successful pairing in ble_hid_device_demo (v5.5)

See merge request espressif/esp-idf!40903
2025-08-01 10:28:51 +08:00
Jiang Jiang Jian
5b05fe3495 Merge branch 'bugfix/minor_update_readme_v5.5' into 'release/v5.5'
fix(nimble): Documentation update in btsnoop script README (v5.5)

See merge request espressif/esp-idf!40880
2025-08-01 10:28:28 +08:00
Jiang Jiang Jian
7a317c8d17 Merge branch 'fix/c6_phylib_for_modem_state_v5.5' into 'release/v5.5'
fix(esp_phy): fix c6 modem state (v5.5)

See merge request espressif/esp-idf!40919
2025-08-01 10:21:08 +08:00
Zhao Wei Liang
eb784e3021 fix(ble): fixed dtm function error on ESP32-C5
(cherry picked from commit 6f0a61ab0d)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-08-01 10:20:44 +08:00
Zhao Wei Liang
6b6d193b36 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:41 +08:00
Zhao Wei Liang
49079d23b6 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:39 +08:00
morris
686af2df4f Merge branch 'ci/c61_enable_multi_dev_runner_v5.5' into 'release/v5.5'
ci(esp32c61): enable multi dut runner for c61 eco3 (v5.5)

See merge request espressif/esp-idf!40895
2025-08-01 10:03:51 +08:00
Michael (XIAO Xufeng)
c02e1edce4 Merge branch 'feat/support_rmt_on_h4_v5.5' into 'release/v5.5'
fix(rmt): add pll and rcfast clock src on c5 (v5.5)

See merge request espressif/esp-idf!40915
2025-07-31 21:28:02 +08:00
Jiang Jiang Jian
dafdf1205d Merge branch 'feat/secure_boot_ecdsa_p384_v5.5' into 'release/v5.5'
Support Secure Boot using ECDSA-P384 curve (v5.5)

See merge request espressif/esp-idf!40822
2025-07-31 21:24:55 +08:00
JinCheng
f0f7ec705e fix(bt/bluedroid): safe string returns and cleanups for bt_discovery example 2025-07-31 21:08:24 +08:00
Nikheel Savant
7bd5212e09 fix(bt/bluedroid): safe string returns and cleanups 2025-07-31 21:08:24 +08:00
Peter Dragun
45c26fd5a4 feat(tools/requirements): Add IDE requirements files 2025-07-31 12:05:46 +02:00
Jiang Jiang Jian
f997e42e56 Merge branch 'feat/support_gd55_v5.5' into 'release/v5.5'
feat(spi_flash): Add support for gd55f flash chip (backport v5.5)

See merge request espressif/esp-idf!40916
2025-07-31 15:30:37 +08:00
Jiang Jiang Jian
f365dbe2ac Merge branch 'feat/c61_psram_timing_tuning_v5.5' into 'release/v5.5'
psram: psram 80M timing tuning on c61 (v5.5)

See merge request espressif/esp-idf!40914
2025-07-31 15:30:18 +08:00
armando
7b1c92d371 change(ci): use largeapp partition csv 2025-07-31 15:24:23 +08:00
wuzhenghui
c5893aac53 fix(esp_system): LOGD for the log printing in sleep process 2025-07-31 14:35:49 +08:00
morris
6e9fca80c8 fix(lcd): reserve the GPIOs used by RGB LCD
and disconnect the LCD signals when the dirver is uninstalled.
2025-07-31 13:08:38 +08:00
Michael (XIAO Xufeng)
3fcd7b1ba5 Merge branch 'feat/lcd_cam_dvp_driver_s3_v5.5' into 'release/v5.5'
DVP support and example for ESP32S3 (v5.5)

See merge request espressif/esp-idf!40329
2025-07-31 11:48:18 +08:00
Michael (XIAO Xufeng)
4d19e6be9c Merge branch 'fix/fix_dvp_loss_isr_v5.5' into 'release/v5.5'
Cam: fixed dvp lose frame issue (v5.5)

See merge request espressif/esp-idf!40885
2025-07-31 11:38:10 +08:00
Michael (XIAO Xufeng)
64e9fb0b88 Merge branch 'c61_adc_calibration_5.5' into 'release/v5.5'
feat(adc): support ADC calibration on ESP32C61 (v5.5)

See merge request espressif/esp-idf!40717
2025-07-31 11:37:56 +08:00
Marek Fiala
050620c264 feat(tools): Normalized detected shell names to lowercase on Windows
Closes https://github.com/espressif/esp-idf/issues/16868
2025-07-30 16:31:39 +02:00
Marek Fiala
94ea741e2d change(tools): shell_types.py ruff formatting 2025-07-30 16:31:39 +02:00
zwx
1b6d3194d1 fix(esp_phy): fix c6 modem state 2025-07-30 20:43:50 +08:00
Zhou Xiao
801c578926 feat(ble): support ble log uart dma out for ESP32-C5 2025-07-30 17:39:06 +08:00
Zhou Xiao
a59065d07c feat(ble): support ble log uart dma out for ESP32-H2 2025-07-30 17:39:06 +08:00
Zhou Xiao
803a94f574 feat(ble): support ble log uart dma out for ESP32-C6 2025-07-30 17:39:06 +08:00
Zhou Xiao
1665cac638 feat(ble): support ble log uart dma out 2025-07-30 17:39:01 +08:00
C.S.M
cfe8d1fb66 feat(spi_flash): Add support for gd55f flash chip 2025-07-30 17:31:16 +08:00
Chen Jichang
b28bc7aeae fix(rmt): add pll and rcfast clock src on c5 2025-07-30 17:26:58 +08:00
armando
4b36b0a1ff feat(psram): psram 80M timing tuning on c61 2025-07-30 16:55:01 +08:00
Rahul Tank
13c4f14bbc fix(nimble): Added code under correct flags to fix compilation warnings 2025-07-30 11:05:47 +05:30
Zhou Xiao
0421e10396 feat(ble): ble log spi out dev phase 5
* supported ts sync for light sleep
* removed controller event queue dependency
* supported get lc ts for ESP32-C3/S3
* optimized ble log spi out code size


(cherry picked from commit f99389e00d)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-30 13:14:58 +08:00
Zhou Xiao
1a6798ee7b feat(ble): add flash only param config api on ESP32-C5
(cherry picked from commit 312de57214)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-30 13:14:56 +08:00
Zhou Xiao
6428e942dd feat(ble): add flash only param config api on ESP32-H2
(cherry picked from commit 4c8258ca38)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-30 13:14:53 +08:00
Zhou Xiao
f405d019a6 feat(ble): add flash only param config api on ESP32-C6
(cherry picked from commit dc65875e57)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-07-30 13:14:51 +08:00
Zhou Xiao
a4e40465c9 change(ble): [AUTO_MR] updated rom linker script for ESP32-C2
(cherry picked from commit ac6acf3629)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-30 13:14:49 +08:00
Zhou Xiao
0bab63a1f1 change(ble): [AUTO_MR] Update lib_esp32c2 to 4556045f
(cherry picked from commit 0a7660d0f3)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-30 13:14:46 +08:00
Zhou Xiao
4275a70d61 change(ble): [AUTO_MR] Update lib_esp32c6 to 499c41fb
(cherry picked from commit f2741f1932)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-30 13:14:44 +08:00
Zhou Xiao
a063764468 change(ble): [AUTO_MR] Update lib_esp32c5 to 499c41fb
(cherry picked from commit 7b921c71b3)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-30 13:14:41 +08:00
Zhou Xiao
6e7751482e change(ble): [AUTO_MR] Update lib_esp32h2 to 499c41fb
(cherry picked from commit ee48ef2167)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-30 13:14:39 +08:00
Jiang Jiang Jian
92a09ce7f0 Merge branch 'fix/fix_submode_assert_in_slowck_changed_ota_v5.5' into 'release/v5.5'
fix(esp_hw_support): fix assert when changing 8MD256 RTC slow clock source during OTA  (v5.5)

See merge request espressif/esp-idf!40820
2025-07-30 10:46:31 +08:00
Jiang Jiang Jian
d74a625d20 Merge branch 'fix/clear_gatt_svc_len_v5.5' into 'release/v5.5'
fix(nimble): Clear GATT service entries counter upon GATT deinit (v5.5)

See merge request espressif/esp-idf!40545
2025-07-30 10:46:13 +08:00
wanckl
7bc929997e ci(esp32c61): enable multi dut runner for c61 2025-07-30 09:32:09 +08:00
Zhang Hai Peng
315cc8f503 fix(ble/bluedroid): set sec_conn only on successful pairing in ble_hid_device_demo
(cherry picked from commit 50fe55ca59)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-29 21:53:41 +08:00
gaoxu
360a813524 fix(dvp): fix dvp loss frame error 2025-07-29 14:48:02 +08:00
armando
18ff6750cc feat(flash): flash 80M timing tuning on c5 2025-07-29 14:10:28 +08:00
Rahul Tank
cff75e2960 fix(nimble): Minor documentation update in btsnoop script usage 2025-07-28 17:05:28 +05:30
gaoxu
e6e0f672ec feat(cam): add camera buffer alloc function 2025-07-26 21:15:05 +08:00
gaoxu
e2929b78ef feat(lcd_cam): add lc_dma_int value atomic protect for lcd and cam 2025-07-26 21:15:02 +08:00
gaoxu
a5bf227ff3 fix(cam): fix camera kconfig about dw_gdma 2025-07-26 21:15:00 +08:00
gaoxu
9da2594b68 feat(cam): add dvp example for ESP32S3-EYE 2025-07-26 21:14:57 +08:00
gaoxu
ac941daa4e feat(cam): add esp32s3 dvp cam support 2025-07-26 21:14:53 +08:00
gaoxu
4b46a16922 feat(adc): support ADC calibration on ESP32C61 2025-07-26 20:59:51 +08:00
Jiang Jiang Jian
8f36e23cc4 Merge branch 'fix/backport_some_wifi_fixes_v5.5' into 'release/v5.5'
fix(wifi): backport some wifi fixes to v5.5

See merge request espressif/esp-idf!40815
2025-07-25 23:33:52 +08:00
Jiang Jiang Jian
731f11766c Merge branch 'bugfix/fix_some_ble_bugs_250628_cjh_esp32_v5.5' into 'release/v5.5'
Fixed some BLE bugs 250628 on esp32(d9a3de0) (v5.5)

See merge request espressif/esp-idf!40798
2025-07-25 23:15:59 +08:00
Jiang Jiang Jian
c5383e2718 Merge branch 'fix/tcm-mem-not-considered-in-esp_ptr_eexecutable_v5.5' into 'release/v5.5'
fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible (v5.5)

See merge request espressif/esp-idf!39983
2025-07-25 22:48:50 +08:00
Shu Chen
e00fa1de52 Merge branch 'fix_ot_src_addr_select_v5.5' into 'release/v5.5'
Fix ot src addr select (v5.5)

See merge request espressif/esp-idf!40828
2025-07-25 14:44:34 +00:00
Zhang Hai Peng
5cf3be2eae fix(ble/bluedroid): Fixed fail to disconnect when device record is cleared
(cherry picked from commit b6dc79af47)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:54:16 +08:00
Zhang Hai Peng
e95dfc2964 fix(ble/bluedroid): fix incorrect resolving_list_avail_size update
(cherry picked from commit ac385530af)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:54:14 +08:00
Zhang Hai Peng
24ea9693ce fix(ble/bluedroid): ensure resolving list is updated when the oldest device is removed
(cherry picked from commit 61606a6f95)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:54:11 +08:00
Zhang Hai Peng
7c757b7f45 fix(ble/bluedroid): Fix issue causing BTM_GetSecurityFlags failed
(cherry picked from commit 48235c7b25)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-25 21:54:09 +08:00
Jiang Jiang Jian
cc2147238b Merge branch 'feature/p4_add_3bit_for_wafer_major_v5.5' into 'release/v5.5'
feat(efuse): Adds 3-bit field for wafer major version in ESP32-P4 (v5.5)

See merge request espressif/esp-idf!40513
2025-07-25 21:20:57 +08:00
Jiang Jiang Jian
b9d7aacd1d Merge branch 'change/ble_update_lib_20250709_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250709 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!40471
2025-07-25 20:28:49 +08:00
Jiang Jiang Jian
9316e840a7 Merge branch 'c61_sdio_v5.5' into 'release/v5.5'
feat(sdio): support sdio on esp32c61 (v5.5)

See merge request espressif/esp-idf!40716
2025-07-25 20:27:30 +08:00
Jiang Jiang Jian
8840072320 Merge branch 'fix/spi_master_p4_change_default_clk_pll_v5.5' into 'release/v5.5'
fix(driver_spi): master driver change esp32p4 default src to pll (v5.5)

See merge request espressif/esp-idf!40113
2025-07-25 20:04:03 +08:00
Jiang Jiang Jian
6041ee302d Merge branch 'fix/twai_fix_clock_c5_errata_and_test_v5.5' into 'release/v5.5'
fix(driver_twai): fixed clock enable and errata and test (v5.5)

See merge request espressif/esp-idf!40263
2025-07-25 20:03:00 +08:00
Shu Chen
31a72abd57 Merge branch 'fix/ieee802154_example_rx_v5.5' into 'release/v5.5'
fix(ieee802154): set rx_when_idle to false when Rx stop (v5.5)

See merge request espressif/esp-idf!40823
2025-07-25 12:01:33 +00:00
Jiang Jiang Jian
b5944c8f34 Merge branch 'feature/iram_esp_system_v5.5' into 'release/v5.5'
feat(esp_system): Adds Kconfigs to place code in IRAM (v5.5)

See merge request espressif/esp-idf!40516
2025-07-25 19:45:26 +08:00
muhaidong
9c18324a72 fix(wifi): fix pmksa cache expiration caused by sntp time synchronization issue 2025-07-25 18:05:25 +08:00
Roland Dobai
a49402e12c Merge branch 'contrib/github_pr_15974_v5.5' into 'release/v5.5'
fix(tools/idf-qemu): Append qemu_extra_args after monitor -serial not before (GitHub PR) (v5.5)

See merge request espressif/esp-idf!40816
2025-07-25 11:51:03 +02:00
zwx
72c92aaebd fix(openthread): use OpenThread API in lwIP source address selection hook 2025-07-25 17:42:31 +08:00
zwx
bc79dc06a3 fix(openthread): fix the preference of the ip6 address set to lwip 2025-07-25 17:42:20 +08:00
Tan Yan Quan
268af25a10 fix(ieee802154): set rx_when_idle to false when Rx stop 2025-07-25 17:22:24 +08:00
Tan Yan Quan
7bde153d0a fix(ieee802154): initialize nvs before enable ieee802154 2025-07-25 17:22:24 +08:00
Peter Dragun
01f8074a3d change: Fix linting errors in serial_ext.py 2025-07-25 14:43:56 +05:30
Zhang Shuxian
ff5fea1186 docs: Update CN translation for secure boot 2025-07-25 14:43:56 +05:30
harshal.patil
12393745c2 fix(esp_system): Remove redundant crypto clock source selection 2025-07-25 14:43:56 +05:30
harshal.patil
6a03c8ffee ci(security): Security test app updated yml
- Also fixes the errors generated by the check-test-scripts command
2025-07-25 14:43:56 +05:30
harshal.patil
3d6423a251 docs(secure-boot-v2): Update the signature verification timings
- THe timings are calculated for the ROM verifying the bootloader's signature
2025-07-25 14:43:56 +05:30
harshal.patil
c473b3deee docs(secure_boot_v2): Add documentation for Secure Boot V2 using ECDSA-P384 2025-07-25 14:43:56 +05:30
harshal.patil
9822c6f199 test(secure_boot): Add tests for ECDSA-based secure boot scheme 2025-07-25 14:43:46 +05:30
harshal.patil
96f11e01bf test(examples/efuse): Add test for secure boot v2 using ecdsa-p384 2025-07-25 14:25:33 +05:30
harshal.patil
476f8f6f51 feat(bootloader_support): Support Secure Boot using ECDSA-P384 curve 2025-07-25 14:25:31 +05:30
harshal.patil
55f693d4dd change(bootloader_support/secure_boot): Allow NULL as verified_digest for app build
The esp_secure_boot_verify_sbv2_signature_block() and esp_secure_boot_verify_rsa_signature_block()
APIs need and use the verified_digest argument only for BOOTLOADER_BUILD, but the argument is
not used in the application code, and the value present in verified_digest is considered invalid.
Thus, allow passing NULL as the verified_digest parameter to help some save space.
2025-07-25 14:23:02 +05:30
harshal.patil
1b3eb8f93e fix(bootloader_support/secure_boot): Fix incorrect usage of ESP_SECURE_BOOT_KEY_DIGEST_LEN 2025-07-25 14:23:02 +05:30
wuzhenghui
ddbf8391d9 fix(esp_hw_support): enable ESP_SLEEP_RTC_FAST_USE_XTAL_MODE only once in RTC_FAST selection 2025-07-25 16:49:16 +08:00
wuzhenghui
d4a67c9957 fix(esp_hw_support): fix assert when changing 8MD256 RTC slow clock source during OTA 2025-07-25 16:49:04 +08:00
Aditya Patwardhan
96836ab1f3 Merge branch 'fix/gcm_fallback_must_depend_on_software_gcm_symbol_v5.5' into 'release/v5.5'
fix(mbedtls/gcm): Allow enabling GCM fallback only if software GCM is available (v5.5)

See merge request espressif/esp-idf!40806
2025-07-25 13:39:02 +05:30
Ivan Grokhotkov
c930763a8a change(qemu_ext): ruff pre-commit fixes
Fixup of https://github.com/espressif/esp-idf/pull/15974
2025-07-25 09:01:41 +02:00
Rohan Fletcher
db72fac86b fix(tools/idf-qemu): Add qemu_extra_args after monitor stdio -serial 2025-07-25 09:01:40 +02:00
Jiang Jiang Jian
aa2c410b62 Merge branch 'bugfix/fix_ble_aa_check_v2_v5.5' into 'release/v5.5'
Optimize check Access Address when receive connection request PDU (v5.5)

See merge request espressif/esp-idf!40750
2025-07-25 15:00:32 +08:00
wangtao@espressif.com
1bce41e63f fix(wifi): fix esp32c2 eco4 ld issue 2025-07-25 14:27:56 +08:00
Shreyas Sheth
33936f0064 fix(wifi): Fix issues discovered by customer for offchannel 2025-07-25 14:27:02 +08:00
yinqingzhao
bad80d35ee fix(wifi): fix crash issue and tx error 0xa1 2025-07-25 14:26:20 +08:00
akshat
05fd283bb5 fix(wifi): Add suport for FTM in ESP32C61
Resolve FTM failure in 40M Bandwidth
2025-07-25 14:25:38 +08:00
yinqingzhao
a69266ec8b fix(wifi): fix inactive time reset when wifi disconnect 2025-07-25 14:24:19 +08:00
muhaidong
7b6a6531a4 fix(wifi): fix open mode rx fragment fail issue 2025-07-25 14:23:21 +08:00
Sumeet Singh
6896432dca fix(nimble): Clear GATT service entries counter upon GATT deinit (v5.5) 2025-07-25 10:38:25 +05:30
harshal.patil
61b0b072f9 fix(mbedtls/gcm): Allow enabling GCM fallback only if software GCM is available 2025-07-25 08:48:00 +05:30
Jiang Jiang Jian
05a22bfd80 Merge branch 'bugfix/fix_external_codec_build_issue_v5.5' into 'release/v5.5'
fix(bt/bluedroid): Fix build issue when using external sbc codec (v5.5)

See merge request espressif/esp-idf!40760
2025-07-25 02:02:16 +08:00
Zhou Xiao
ae97379c9a fix(ble): updated rom linker script for ESP32-C2 2025-07-25 00:01:49 +08:00
cjin
ff7830f45b feat(ble): enable broker initialization on ESP32-C6 2025-07-25 00:01:44 +08:00
cjin
947e79f03d feat(ble): enable broker initialization on ESP32-C5 2025-07-25 00:01:39 +08:00
cjin
6f4ec5f3a6 feat(ble): enable broker initialization on ESP32-H2 2025-07-25 00:01:32 +08:00
cjin
e70bf20bba feat(ble): support memory allocation check debug feature on ESP32-H2 2025-07-25 00:01:26 +08:00
cjin
4b347bc75a feat(ble): support memory allocation check debug feature on ESP32-C6 2025-07-25 00:01:22 +08:00
cjin
dbb5069423 feat(ble): support memory allocation check debug feature on ESP32-C5 2025-07-25 00:01:17 +08:00
cjin
e313f56b30 feat(ble): support memory allocation check debug feature on ESP32-C2 2025-07-25 00:01:11 +08:00
Zhou Xiao
6d5aa29358 change(ble): [AUTO_MR] Update lib_esp32c2 to c7732d48 2025-07-25 00:01:07 +08:00
Zhou Xiao
ad7c681583 change(ble): [AUTO_MR] Update lib_esp32c6 to ca6c20bc 2025-07-25 00:01:03 +08:00
Zhou Xiao
a091cb0046 change(ble): [AUTO_MR] Update lib_esp32c5 to ca6c20bc 2025-07-25 00:00:58 +08:00
Zhou Xiao
957104bb31 change(ble): [AUTO_MR] Update lib_esp32h2 to ca6c20bc 2025-07-25 00:00:53 +08:00
Jiang Jiang Jian
28eee20b5b Merge branch 'bugfix/fix_phy_test_crash_v5.5' into 'release/v5.5'
fix(PHY): Fixed phy test example crash (v5.5)

See merge request espressif/esp-idf!40758
2025-07-24 23:54:02 +08:00
Jiang Jiang Jian
f7d3562271 Merge branch 'change/ble_update_lib_20250630_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250630 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!40301
2025-07-24 23:51:46 +08:00
Jiang Jiang Jian
3fa646e58a Merge branch 'feat/add_cte_iq_report_example_v5.5' into 'release/v5.5'
Add Bluetooth LE CTE connless example. (v5.5)

See merge request espressif/esp-idf!39783
2025-07-24 23:43:56 +08:00
Mahavir Jain
e34b8ecf8f Merge branch 'docs/update_bootloader_max_size_v5.5' into 'release/v5.5'
Update the maximum supported bootloader size (v5.5)

See merge request espressif/esp-idf!40789
2025-07-24 19:10:35 +05:30
Chen Jian Hua
7af79ac92c fix(bt): Update bt lib for ESP32(d9a3de0)
- Support BLE vendor HCI related params reset
- Support multi conn optimization vendor hci command
- Fixed the issue where rssi of conn is incorrect when latency is no zero
- Fixed prio setting for BLE events
- Fixed disconnection issue when coexisting with other BLE events
- Fixed crash due to bandwidth full when updating conn params


(cherry picked from commit f20c6a2813)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2025-07-24 21:33:38 +08:00
Jiang Jiang Jian
60d0aa3cb8 Merge branch 'update_mqtt_pre_refactor_v5.5' into 'release/v5.5'
Update esp-mqtt submodule to 6af4446a (v5.5)

See merge request espressif/esp-idf!39358
2025-07-24 20:18:59 +08:00
Jiang Jiang Jian
81c01383e7 Merge branch 'feat/support_disable_pll_track_v5.5' into 'release/v5.5'
Support disable pll track (v5.5)

See merge request espressif/esp-idf!40339
2025-07-24 20:18:09 +08:00
Jiang Jiang Jian
9aa8a1674f Merge branch 'feat/perf_benchmark_support_esp32p4_v5.5' into 'release/v5.5'
feat(storage): Update emmc and perf_benchmark example to work with ESP32-P4 (v5.5)

See merge request espressif/esp-idf!40715
2025-07-24 20:17:17 +08:00
harshal.patil
1c0b86e00c docs(bootloader): Change the default value of maximum supported bootloader size 2025-07-24 17:18:19 +05:30
Zhang Hai Peng
6434f7f82e fix(bt/ble): Update esp32 libbtdm_app.a (3a27e2e)
- Optimize check Access Address when receive connection request PDU


(cherry picked from commit a663a87fe0)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-07-24 19:44:09 +08:00
Jiang Jiang Jian
c2c08767db Merge branch 'fix/spi_slave_dma_stop_unexpectly_when_start_v5.5' into 'release/v5.5'
fix(driver_spi): fixed esp32c5 spi slave dma potential rx error (v5.5)

See merge request espressif/esp-idf!40696
2025-07-24 19:28:32 +08:00
Jiang Jiang Jian
1e8b07ecc6 Merge branch 'fix/incorrect_unit_of_cpb_rx_clk_v5.5' into 'release/v5.5'
fix(bt): fixed the incorrect unit of clk in cpb rx event(backport v5.5)

See merge request espressif/esp-idf!40784
2025-07-24 19:27:01 +08:00
gongyantao
9987ce610b fix(bt): fixed the incorrect unit of clk in cpb rx event 2025-07-24 16:26:44 +08:00
gaoxu
62b9e1620d feat(sdio): support sdio on esp32c61 2025-07-24 14:13:23 +08:00
Mahavir Jain
c9f92e84a4 Merge branch 'feature/support_rng_sampling_v5.5' into 'release/v5.5'
Feature/support rng sampling (v5.5)

See merge request espressif/esp-idf!40600
2025-07-24 10:43:30 +05:30
morris
5faf1a0ceb Merge branch 'feature/lcd_cam_dvp_driver_only_gen_clock_v5.5' into 'release/v5.5'
feat(esp_driver_cam): DVP driver supports only initializing the clock and XCLK pin to generate a clock for the external device (v5.5)

See merge request espressif/esp-idf!40447
2025-07-24 13:07:24 +08:00
Rahul Tank
75e4f8dbb4 Merge branch 'bugfix/retry_packet_alloc_v5.5' into 'release/v5.5'
fix(nimble): Add packet allocation retry for limited iteration (v5.5)

See merge request espressif/esp-idf!40683
2025-07-24 10:13:08 +05:30
Geng Yu Chao
8842c6577b feat(esp32c5): Enable Bluetooth LE CTE feature
(cherry picked from commit aa4489a879)

Co-authored-by: Geng Yuchao <gengyuchao@espressif.com>
2025-07-24 10:33:54 +08:00
Geng Yu Chao
2b1ce17ea6 feat(ble): Add Bluetooth LE CTE connectionless AoA/AoD examples
(cherry picked from commit d8631ed3db)

Co-authored-by: Geng Yuchao <gengyuchao@espressif.com>
2025-07-24 10:33:52 +08:00
wanckl
1d3cd76432 fix(driver_spi): fixed esp32c5 spi slave dma potential rx error 2025-07-24 10:06:52 +08:00
Marius Vikhammer
9c0903a5e8 Merge branch 'bugfix/esp_idf_c5_idfci-3010_v5.5' into 'release/v5.5'
feat(esp_hw_support): support xtal as RTC FAST CLK during sleep for esp32c5 (v5.5)

See merge request espressif/esp-idf!40770
2025-07-24 10:04:18 +08:00
Marius Vikhammer
aafabaf854 Merge branch 'bugfix/c61_systimer_etm_v5.5' into 'release/v5.5'
fix(systimer): fixed ETM not working with systimer on C61 ECO3

See merge request espressif/esp-idf!40672
2025-07-24 09:51:25 +08:00
Zhou Xiao
e184fe297b fix(ble): ensure ble controller disable safety for ESP32-C2 2025-07-24 00:46:18 +08:00
zwl
479346ff1f fix(ble): fixed occasional assert triggered during controller disable on ESP32-C2 2025-07-24 00:46:18 +08:00
zwl
ad53477921 change(ble): [AUTO_MR] Update lib_esp32c2 to 9af627ef 2025-07-24 00:46:18 +08:00
zwl
3e008eac89 change(ble): [AUTO_MR] Update lib_esp32c6 to d2d70d40 2025-07-24 00:46:18 +08:00
zwl
6e6bea3967 change(ble): [AUTO_MR] Update lib_esp32c5 to d2d70d40 2025-07-24 00:46:18 +08:00
zwl
06b9e8804f change(ble): [AUTO_MR] Update lib_esp32h2 to d2d70d40 2025-07-24 00:46:18 +08:00
yinqingzhao
93b2cf899a feat(wifi): set phy pll track disable default 2025-07-24 00:42:53 +08:00
Zhangwx
5deab445d3 feat(phy): add a config for pll track feature 2025-07-24 00:42:53 +08:00
John Boiles
5a94539374 fix(memory-utils): Use esp_ptr_in_tcm to check TCM range 2025-07-24 00:42:22 +08:00
John Boiles
502b26e2cd 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-24 00:42:22 +08:00
wanckl
cc54f04f96 fix(driver_spi): master driver change esp32p4 default src to pll 2025-07-24 00:41:57 +08:00
Marius Vikhammer
89f919a96f fix(systimer): fixed ETM not working with systimer on C61 ECO3 2025-07-24 00:41:33 +08:00
Euripedes Rocha
47917e7a01 change(mqtt): Adds retry on publish connect test case
This test case fails mostly for network related issues, with retrys we
might avoid the failure of the whole job.
2025-07-24 00:37:13 +08:00
Euripedes Rocha
e30d7143ce change(mqtt): Update submodule to 6af4446a
git log --oneline cac1552e..6af4446a

Detailed description of the changes:
* Multiple event data
  - See merge request espressif/esp-mqtt!240
  - fix: Multiple event data (espressif/esp-mqtt@9c76b70)
* Updated the idf version check for ECDSA support
  - See merge request espressif/esp-mqtt!239
  - fix(mqtt): Updated the idf version check for ECDSA support (espressif/esp-mqtt@7d9a384)
* Added the support for the ECDSA signing
  - See merge request espressif/esp-mqtt!238
  - feat(mqtt): Add support for ECDSA signing (espressif/esp-mqtt@b35a691)
* fix: pubrel message resending when pubcomp not received
  - See merge request espressif/esp-mqtt!236
  - See commit https://github.com/espressif/esp-mqtt/commit/f38a5fc
* Change error message to fix warning.
  - fix: Change error message to fix warning. (espressif/esp-mqtt@c395c2f)
* Small cleanu
  - See merge request espressif/esp-mqtt!231
  - fix: Adds all IDF versions under support (espressif/esp-mqtt@bb85b20)
  - fix: Update badges url to reflect current status (espressif/esp-mqtt@263c167)
* feat(mqtt5): Add parsing of DISCONNECT packet to mqtt5 client
  - mqtt_client: Manage disconnect packet (espressif/esp-mqtt@470cb93)
* feat(mqtt5): Reduce log verbosity for MQTT ACK
  - Reduce log verbosity for MQTT v5 ACKs (espressif/esp-mqtt@6b7b9c3)
* PR: workflows: fix update actions to v4
  - workflows: fix update actions to v4 (espressif/esp-mqtt@06b8923)
* When MQTT_REPORT_DELETED_MESSAGES, delete QOS messages with id 0
  - doc: Clarify deleted message event to cover QoS=0 case (espressif/esp-mqtt@ea036a5)
  - See commit https://github.com/espressif/esp-mqtt/commit/b82c8f6
* fix: Race condition when using destroy
  - See merge request espressif/esp-mqtt!223
  - See commit https://github.com/espressif/esp-mqtt/commit/44292cc
* feat: Add TCP keepalive configuration
  - See commit https://github.com/espressif/esp-mqtt/commit/7c3227a
* feat: Include message topic in all chunks
  - feat: Include message topic in all data events for big messages. (espressif/esp-mqtt@82017e9)
* fix: set TCP transport every time when setting the config
  - See merge request espressif/esp-mqtt!218
  - See commit https://github.com/espressif/esp-mqtt/commit/c3c4cb9
* feat: Allow users to get the transport in use
  - See merge request espressif/esp-mqtt!216
  - See commit https://github.com/espressif/esp-mqtt/commit/97dc85a
* clean: Remove expired deletion from publish
  - See merge request espressif/esp-mqtt!217
  - See commit https://github.com/espressif/esp-mqtt/commit/2285726
2025-07-24 00:37:13 +08:00
wanckl
0b87e896b0 fix(driver_twai): fixed clock source enable/disable 2025-07-24 00:36:26 +08:00
wanckl
a8d4196a3b fix(driver_twai): add rx buffer check and c5 errata doc 2025-07-24 00:36:26 +08:00
wanckl
59274a818f test(driver_twai): new driver add interctive test 2025-07-24 00:36:26 +08:00
Konstantin Kondrashov
5d946e6ec0 feat(efuse): Adds 3-bit field for wafer major version in ESP32-P4 2025-07-24 00:35:28 +08:00
Konstantin Kondrashov
e72ea712e7 feat(esp_system): Adds Kconfigs to place code in IRAM 2025-07-24 00:34:58 +08:00
Zhi Wei Jian
a33995c0e9 fix(rf/example): Fixed phy test example crash
(cherry picked from commit e2e5d4915b)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
2025-07-24 00:26:39 +08:00
Jiang Jiang Jian
9c4aa443b0 Merge branch 'bugfix/enable_ipv6_if_nan_v5.5' into 'release/v5.5'
bugfix(wifi): Enable IPv6 support via LWIP_IPV6 when WiFi Aware(NAN) is enabled (Backport v5.5)

See merge request espressif/esp-idf!40486
2025-07-24 00:18:29 +08:00
Aditya Patwardhan
a002a04332 feat(soc): Added soc capabilities related to RNG 2025-07-23 18:24:46 +05:30
hebinglin
4272a54397 feat(esp_hw_support): support xtal as RTC FAST CLK during sleep in esp32c5 2025-07-23 20:14:39 +08:00
Jack
48336d423b mqtt/ssl_ds: use larger partition table in the example 2025-07-23 19:53:54 +08:00
Fu Hanxi
c93ef4ecd9 ci: use fixed telnetlib since python 3.13 removed this from stdlib 2025-07-23 13:19:52 +02:00
Samuel Obuch
628ba3aa3c fix(sysview): fix timestamp freq when not using APB clock 2025-07-23 13:19:52 +02:00
Samuel Obuch
c01e1a7153 ci: enable example tests for esp32p4 2025-07-23 13:19:52 +02:00
Erhan Kurubas
f4db15bc60 feat(tools): add esp32c3 rev1.1 rom version string 2025-07-23 13:19:52 +02:00
Samuel Obuch
9b8e989a16 ci: use shared OpenOCD class for GDB test app 2025-07-23 13:19:52 +02:00
Samuel Obuch
6ec881a5c7 ci: OpenOCD class as fixture 2025-07-23 13:19:52 +02:00
Samuel Obuch
67bf1e1bb8 ci: enable sysview examples for all chips 2025-07-23 13:19:52 +02:00
Aditya Patwardhan
2ae3455d12 Merge branch 'fix/mqtt_ssl_ds_build_failure_v5.5' into 'release/v5.5'
fix(mqtt): Increased partition size to fix build failure (v5.5)

See merge request espressif/esp-idf!40766
2025-07-23 16:30:20 +05:30
Rahul Tank
e9b7c632a6 Merge branch 'bugfix/add_old_btsnoop_hci_py_v5.5' into 'release/v5.5'
fix(nimble): Updated parser script for HCI log creation (v5.5)

See merge request espressif/esp-idf!40727
2025-07-23 16:21:29 +05:30
Aditya Patwardhan
a519699588 fix(mqtt): Increased partition size to fix build failure 2025-07-23 15:38:33 +05:30
Shu Chen
c4ac82fc3a Merge branch 'fix_br_selfhosted_address_v5.5' into 'release/v5.5'
feat(openthread): move mesh local address judeging function to public (v5.5)

See merge request espressif/esp-idf!40256
2025-07-23 09:56:10 +00:00
Jiang Jiang Jian
8c21713e25 Merge branch 'feat/add-ws-redir_v5.5' into 'release/v5.5'
feat(tcp_transport): Add websocket HTTP redirect (v5.5)

See merge request espressif/esp-idf!39182
2025-07-23 14:48:07 +08:00
linruihao
8657cb7fc5 fix(bt/bluedroid): Fix build issue when using external sbc codec 2025-07-23 14:13:19 +08:00
Jiang Jiang Jian
4eb565defb Merge branch 'fix/disconnect_sta_in_wps_start_v5.5' into 'release/v5.5'
fix(wifi): Disconnect station in wps_start instead of wps_enable

See merge request espressif/esp-idf!40649
2025-07-23 14:11:14 +08:00
Chen Dejin
f8935bd088 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@ee975ba05
2025-07-23 03:36:22 +00:00
chendejin
ee975ba05d feat(openthread): move mesh local address judeging function to public 2025-07-23 11:26:34 +08:00
Shu Chen
97e07a01e3 Merge branch 'feat/call_meshcop_mdns_publish_in_idf_v5.5' into 'release/v5.5'
Handle MeshCoP mDNS service in state change callback, update OpenThread upstream (v5.5)

See merge request espressif/esp-idf!40082
2025-07-23 03:25:18 +00:00
Jiang Jiang Jian
050ca52e1c Merge branch 'bugfix/fix_kconfig_names_v5.5' into 'release/v5.5'
fix(nimble): Modified Kconfig information to make it more user friendly (v5.5)

See merge request espressif/esp-idf!39628
2025-07-23 10:51:01 +08:00
Jiang Jiang Jian
f9ce2bf598 Merge branch 'bugfix/make_blufi_adv_custom_v5.5' into 'release/v5.5'
feat(nimble): Add a way to make blufi advertising customizable (v5.5)

See merge request espressif/esp-idf!40529
2025-07-23 10:50:13 +08:00
Sarvesh Bodakhe
e72a3de4b9 fix(wifi): Disconnect station in wps_start instead of wps_enable
Modifies changes from 84e62daedc
2025-07-23 10:47:18 +08:00
Jiang Jiang Jian
95e3ea8f50 Merge branch 'feat/eap_method_limit_v5.5' into 'release/v5.5'
feat(esp_wifi): Add support to limit EAP methods (v5.5)

See merge request espressif/esp-idf!40502
2025-07-23 10:36:04 +08:00
Mahavir Jain
8d0b576c1e Merge branch 'contrib/github_pr_16076_v5.5' into 'release/v5.5'
fix(esp_http_client): fix spurious async open error (GitHub PR) (v5.5)

See merge request espressif/esp-idf!40740
2025-07-23 08:05:45 +05:30
Jiang Jiang Jian
aea3d880d7 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20250707_v5.5' into 'release/v5.5'
feat(tools): update openocd version to v0.12.0-esp32-20250707 (v5.5)

See merge request espressif/esp-idf!40459
2025-07-23 10:29:29 +08:00
glmfe
97e6f4ab0f feat(tcp_transport): Add websocket HTTP redirect
- Add and expose URI parser from HTTP when received a 301 status
2025-07-23 10:23:26 +08:00
Rahul Tank
b410db2b63 fix(nimble): Add support to parser script to parse logs with/without ts
Introduced a new "--has-ts" input parameter to script to detect if logs
has timestamp information or not
2025-07-22 15:48:11 +05:30
Jiang Jiang Jian
9f523adfe9 Merge branch 'feat/add_timestamp_v5.5' into 'release/v5.5'
fix(nimble): Enhanced HCI logging by adding timestamp information (v5.5)

See merge request espressif/esp-idf!40633
2025-07-22 17:50:47 +08:00
Jiang Jiang Jian
210c667848 Merge branch 'docs/update_ble_feature_status_latest_v5.5' into 'release/v5.5'
Update BLE feature support status (v5.5)

See merge request espressif/esp-idf!40071
2025-07-22 17:50:10 +08:00
Jiang Jiang Jian
dd511077e1 Merge branch 'feature/hosted_examples_v5_5' into 'release/v5.5'
feat(hosted_examples_v5_5): Added ESP-Hosted to Wi-Fi examples

See merge request espressif/esp-idf!39485
2025-07-22 17:49:35 +08:00
Xu Si Yu
adfb879541 feat(openthread): update border router lib
* esp-openthread: thread_zigbee/esp-openthread@16bfed5ec
* openthread: espressif/openthread@b945928d7
* esp-idf: espressif/esp-idf@a18fb7583
2025-07-22 09:43:46 +00:00
Jiang Jiang Jian
0291ab0dfb Merge branch 'feature/support_chip912_pvt_auto_dbias_360m_backport_v5.5' into 'release/v5.5'
feat(esp_hw_support): use pvt to auto control digital ldo and rtc ldo for esp32p4_backport_v5.5

See merge request espressif/esp-idf!40676
2025-07-22 17:36:09 +08:00
Jiang Jiang Jian
32a7b6a30c Merge branch 'bugfix/fix_memory_leak_on_http_header_fetch_failure_v5.5' into 'release/v5.5'
fix(esp_http_client): free header in case of ESP_ERR_HTTP_FETCH_HEADER (v5.5)

See merge request espressif/esp-idf!40662
2025-07-22 17:35:29 +08:00
Jiang Jiang Jian
6dcd234495 Merge branch 'contrib/github_pr_16202_v5.5' into 'release/v5.5'
fix(esp_http_server): Fix regression in httpd_cookie_key_value introduced by commit 4a47cf8 (GitHub PR) (v5.5)

See merge request espressif/esp-idf!40455
2025-07-22 17:32:27 +08:00
Jiang Jiang Jian
79d842dfa1 Merge branch 'fix/sdspi_cmd52_error_v5.5' into 'release/v5.5'
fix(sdmmc): fix sdmmc initialization issue caused by CMD52 CRC error (v5.5)

See merge request espressif/esp-idf!40282
2025-07-22 17:31:44 +08:00
Jiang Jiang Jian
ec5d4c5959 Merge branch 'feat/bump_littlefs_to_1.20.0_v5.5' into 'release/v5.5'
feat(storage): Bump LittleFS to 1.20.0 and fix storage readmes mentioning esptool (v5.5)

See merge request espressif/esp-idf!40226
2025-07-22 17:31:05 +08:00
Jiang Jiang Jian
3a242eae01 Merge branch 'fix/bridge_test_ssh_v5.5' into 'release/v5.5'
fix(esp_eth): bridge test to use SSH key when connect to endnode (v5.5)

See merge request espressif/esp-idf!40622
2025-07-22 17:29:05 +08:00
Jiang Jiang Jian
fddb9be1e3 Merge branch 'fix/linenoise-arrow-usage_v5.5' into 'release/v5.5'
fix(linenoise): Read escape sequences one character at a time (v5.5)

See merge request espressif/esp-idf!40690
2025-07-22 17:27:24 +08:00
Jiang Jiang Jian
cff19bffbf Merge branch 'contrib/github_pr_15767_v5.5' into 'release/v5.5'
fix(esp_http_server): WebSocket frame parsing errors (GitHub PR) (v5.5)

See merge request espressif/esp-idf!40617
2025-07-22 17:26:55 +08:00
Jiang Jiang Jian
f1c646a3c5 Merge branch 'docs/remove_incorrect_info_for_esp32p4_sdmmc_v5.5' into 'release/v5.5'
docs: Remove incorrect description for ESP32-P4 SDMMC (v5.5)

See merge request espressif/esp-idf!40673
2025-07-22 17:24:26 +08:00
Jiang Jiang Jian
7d9ee328d9 Merge branch 'fix/apptrace_crc_calculation_v5.5' into 'release/v5.5'
fix(apptrace): calculate crc16 of the current block before swap (v5.5)

See merge request espressif/esp-idf!40248
2025-07-22 17:23:26 +08:00
Jiang Jiang Jian
41cb6701ad Merge branch 'ci/reenable_c5_lp_core_test_v5.5' into 'release/v5.5'
test(lp_core): re-enabled C5 lp-core test (v5.5)

See merge request espressif/esp-idf!40602
2025-07-22 17:22:20 +08:00
Jiang Jiang Jian
813b67082a Merge branch 'fix_mqtt_test_app_broker_v5.5' into 'release/v5.5'
fix(mqtt): Adds sdkconfig to use test broker (v5.5)

See merge request espressif/esp-idf!40584
2025-07-22 17:21:48 +08:00
Jiang Jiang Jian
0f043029e8 Merge branch 'ci/raise_macos_cache_to_50g_v5.5' into 'release/v5.5'
macOS runners - set CCACHE back to 50GB to help VMs (v5.5)

See merge request espressif/esp-idf!40275
2025-07-22 17:21:22 +08:00
Jiang Jiang Jian
b8936385d3 Merge branch 'bugfix/clic_mapping_mask_v5.5' into 'release/v5.5'
fix(hal): make CLIC interrupt routing function to only write related bits (backport v5.5)

See merge request espressif/esp-idf!39936
2025-07-22 17:20:17 +08:00
Mahavir Jain
0b0e7b23ff Merge branch 'doc/update_esp_https_ota_pre_encrypted_doc_v5.5' into 'release/v5.5'
docs(system/esp_https_ota): adds ECIES-256 to pre-enc ota design doc (v5.5)

See merge request espressif/esp-idf!40372
2025-07-22 14:49:56 +05:30
Jiang Jiang Jian
71eeea29bc Merge branch 'ci/fix-submodule-cache_v5.5' into 'release/v5.5'
ci: remove cached submodule metadata while checking with github (v5.5)

See merge request espressif/esp-idf!40093
2025-07-22 17:19:34 +08:00
Mahavir Jain
fa02f84c3e Merge branch 'docs/fix_secure_download_mode_unsupported_esp32_v5.5' into 'release/v5.5'
fix(bootloader): Fix documentation as ESP32 does not support secure download mode (v5.5)

See merge request espressif/esp-idf!40213
2025-07-22 14:49:14 +05:30
Mahavir Jain
b458016805 Merge branch 'feat/adding_different_strategy_to_perform_tls_using_dynamic_feature_v5.5' into 'release/v5.5'
Add configuration to control dynamic buffer strategy in mbedtls (v5.5)

See merge request espressif/esp-idf!39919
2025-07-22 14:48:44 +05:30
Mahavir Jain
c76d8c49ee Merge branch 'feat/adding_hidden_config_for_dynamic_buffer_control_configuration_v5.5' into 'release/v5.5'
feat(esp_tls): Added hidden config in esp-tls for dynamic buffer strategy configuration (v5.5)

See merge request espressif/esp-idf!40265
2025-07-22 14:48:21 +05:30
Jiang Jiang Jian
ff0afa250f Merge branch 'ci/disable-plugin-idf_ci_v5.5' into 'release/v5.5'
ci: disable idf-ci plugin (v5.5)

See merge request espressif/esp-idf!39665
2025-07-22 17:18:07 +08:00
Jiang Jiang Jian
536a807665 Merge branch 'bugfix/esp_flash_escape_checking_v5.5' into 'release/v5.5'
fix(esp_flash): fixed issue of escaping boundary check (v5.5)

See merge request espressif/esp-idf!40117
2025-07-22 17:16:49 +08:00
Jiang Jiang Jian
c4d3791311 Merge branch 'ci/test_i2s_with_psram_config_v5.5' into 'release/v5.5'
ci: test ana_cmpr, dac, i2s, touch with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 (v5.5)

See merge request espressif/esp-idf!40059
2025-07-22 17:16:32 +08:00
Shu Chen
3e94cf120e Merge branch 'feat/rcp_over_usb_v5.5' into 'release/v5.5'
feat(openthread): support rcp based on USB Serial JTAG (v5.5)

See merge request espressif/esp-idf!40245
2025-07-22 08:58:34 +00:00
Xu Si Yu
a18fb75839 feat(openthread): update openthread upstream 2025-07-22 16:55:02 +08:00
Xu Si Yu
5bfd50ca37 feat(openthread): handle MeshCoP mDNS service in state change callback 2025-07-22 16:55:02 +08:00
Xu Si Yu
a83147ddb0 feat(openthread): optimize trel reception 2025-07-22 16:55:02 +08:00
zwx
08d1c5d696 feat(openthread): support openthread cli console command register 2025-07-22 16:55:02 +08:00
Dong Heng
a5c374c88e feat(esp_driver_cam): DVP driver supports only initializing the clock and XCLK pin to generate a clock for the external device 2025-07-22 16:06:12 +08:00
morris
350da2b11a Merge branch 'refactor/migrate_i2c_driver_in_es7210_example_v5.5' into 'release/v5.5'
refactor(i2s_es7210): refactor es7210 example (v5.5)

See merge request espressif/esp-idf!40066
2025-07-22 15:37:53 +08:00
Island
da257a9690 Merge branch 'change/ble_update_lib_20250613_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250613 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!40161
2025-07-22 15:16:06 +08:00
Island
338dc154dc Merge branch 'feat/ble_log_spi_out_dev_phase_4_v5.5' into 'release/v5.5'
BLE Log SPI Out Dev Phase 4 (v5.5)

See merge request espressif/esp-idf!40426
2025-07-22 15:16:00 +08:00
Roland Dobai
23aab0fda3 Merge branch 'feat/update_ccache_to_4.11.2_v5.5' into 'release/v5.5'
feat(tools): Update ccache 4.10.2 -> 4.11.2 (v5.5)

See merge request espressif/esp-idf!39572
2025-07-22 09:15:36 +02:00
Roland Dobai
c2e1405362 Merge branch 'ci/add-kconfig-pre-commit_v5.5' into 'release/v5.5'
docs:fix spelling/"casing" of the word "Kconfig" (v5.5)

See merge request espressif/esp-idf!40015
2025-07-22 09:15:09 +02:00
Roland Dobai
5ec370b75c Merge branch 'fix/create_project_read_only_v5.5' into 'release/v5.5'
fix(tools): idf.py create-project works in read-only ESP-IDF (v5.5)

See merge request espressif/esp-idf!40035
2025-07-22 09:14:53 +02:00
Roland Dobai
c25d78180d Merge branch 'fix/idf_tools_install_tool_version_v5.5' into 'release/v5.5'
fix(tools): fixed command `idf_tools.py install tool@version` (v5.5)

See merge request espressif/esp-idf!40037
2025-07-22 09:14:30 +02:00
Roland Dobai
a6b0f61822 Merge branch 'fix/username_special_characters_v5.5' into 'release/v5.5'
feat(tools): Added encoding when special characters used with username (v5.5)

See merge request espressif/esp-idf!40568
2025-07-22 09:14:16 +02:00
Roland Dobai
415aae12c7 Merge branch 'feat/extend_pip_user_option_check_v5.5' into 'release/v5.5'
feat(tools): Disabled pip 'user' option, when installing ESP-IDF python virtual environment (v5.5)

See merge request espressif/esp-idf!40570
2025-07-22 09:13:46 +02:00
Roland Dobai
0ad62114a4 Merge branch 'change/support_lowercase_kconfig_filename_v5.5' into 'release/v5.5'
Backport: Support misspelled Kconfig[.projbuild] files (v5.5)

See merge request espressif/esp-idf!39582
2025-07-22 09:12:40 +02:00
morris
6c56c4d584 Merge branch 'change/remove_mmap_paddr_remap_warning_log_v5.5' into 'release/v5.5'
mmu: remove paddr remap warning log (v5.5)

See merge request espressif/esp-idf!40202
2025-07-22 14:53:14 +08:00
Kapil Gupta
3b21679be9 fix(esp_wifi): Address review comments 2025-07-22 14:53:13 +08:00
Kapil Gupta
f794af38c2 feat(esp_wifi): Add support to limit EAP methods
Added support to limit EAP method supported by device based on
user configuration.
2025-07-22 14:53:13 +08:00
Jiang Jiang Jian
4c38f2c864 Merge branch 'fix/fix_esp32_core1_access_rtc_fast_in_sleep_code_v5.5' into 'release/v5.5'
fix(esp_hw_support): fix esp32 APP_CPU accessing RTCFAST memory in sleep code (v5.5)

See merge request espressif/esp-idf!40556
2025-07-22 14:48:35 +08:00
Jiang Jiang Jian
307c3f0ee6 Merge branch 'bugfix/roam_event_scan_failure_v5.5' into 'release/v5.5'
bugfix(wifi): Reset scan_ongoing flag in scan done event to allow scan trigger post roam (Backport v5.5)

See merge request espressif/esp-idf!40432
2025-07-22 14:47:52 +08:00
akshat
74ffc556cb bugfix(wifi): Define ETH_ALEN for IPV6 Communication Type 2025-07-22 14:47:42 +08:00
akshat
696d65c7b4 bugfix(wifi): Enable IPv6 support via LWIP_IPV6 when WiFi Aware(NAN) is enabled 2025-07-22 14:47:42 +08:00
Jiang Jiang Jian
9c2e03ba74 Merge branch 'bugfix/ag_data_callback_cleared_after_deinit_v5.5' into 'release/v5.5'
fix(bt): Fixed HFP AG data callback cleared after profile is re-initialized (v5.5)

See merge request espressif/esp-idf!39973
2025-07-22 14:46:15 +08:00
Jiang Jiang Jian
f3d0418fc5 Merge branch 'fix/example_iperf_with_wifi_remote' into 'release/v5.5'
fix: update wifi-cmd/esp_hosted of iperf example

See merge request espressif/esp-idf!40110
2025-07-22 14:45:43 +08:00
Wang Meng Yang
87e8895083 Merge branch 'bugfix/bt_sleep_log_consistent_v5.5' into 'release/v5.5'
fix(ble): keep the log of the bluetooth sleep clock source consistent(v5.5)

See merge request espressif/esp-idf!40355
2025-07-22 14:45:07 +08:00
Jiang Jiang Jian
bcd56c749b Merge branch 'fix/lwip_dhcp_option_len_assert_v5.5' into 'release/v5.5'
fix(lwip): Fix appending DHCP option with HW-ID (v5.5)

See merge request espressif/esp-idf!40231
2025-07-22 14:44:53 +08:00
Jiang Jiang Jian
79aedfd229 Merge branch 'fix/netif_ppp_dhcp_v5.5' into 'release/v5.5'
fix(esp_netif): Fix incorrect DHCP call for PPP interfaces (v5.5)

See merge request espressif/esp-idf!40238
2025-07-22 14:44:43 +08:00
Wang Meng Yang
5e1cb0fcaa Merge branch 'feat/add_handl_in_sdp_evt_v5.5' into 'release/v5.5'
feat(bt): Add record_handle in ESP_SDP_REMOVE_RECORD_COMP_EVT(v5.5)

See merge request espressif/esp-idf!40718
2025-07-22 14:44:40 +08:00
Jiang Jiang Jian
05db51c485 Merge branch 'feat/enable_wakeup_tests_for_more_chips_v5.5' into 'release/v5.5'
feat(esp_hw_support): enable wakeup tests for more chips (v5.5)

See merge request espressif/esp-idf!40045
2025-07-22 14:43:49 +08:00
morris
31fd483c25 Merge branch 'feature/usb_dual_host_2_backport_v5.5' into 'release/v5.5'
feat(usb/host): Add option to choose peripheral for USB host library (backport v5.5)

See merge request espressif/esp-idf!39721
2025-07-22 14:43:02 +08:00
Jiang Jiang Jian
75848acbd9 Merge branch 'bugfix/connect_before_connected_v5.5' into 'release/v5.5'
fix(conn): wifi connect before connected status (v5.5)

See merge request espressif/esp-idf!40104
2025-07-22 14:41:37 +08:00
Jiang Jiang Jian
2045b1206b Merge branch 'bugfix/auth_collision_v5.5' into 'release/v5.5'
fix(bt/controller): Fixed bugs on LMP legacy and secure authentication collision (v5.5)

See merge request espressif/esp-idf!40010
2025-07-22 14:40:57 +08:00
morris
031ed78aa1 Merge branch 'feat/support_fallback_to_default_pattern_when_psram_id_not_match_v5.5' into 'release/v5.5'
psram: support fallback to use default driver pattern when id isn't match (v5.5)

See merge request espressif/esp-idf!40000
2025-07-22 14:40:37 +08:00
Jiang Jiang Jian
1d9e3dfaf9 Merge branch 'bugfix/fix_bt_avrcp_build_issue_v5.5' into 'release/v5.5'
fix(bt/bluedroid): Fix AVRCP build issue when disable Cover Art (v5.5)

See merge request espressif/esp-idf!40033
2025-07-22 14:40:21 +08:00
Jiang Jiang Jian
73bdf0acc8 Merge branch 'feat/remove-unecessray-condition-in-usj-read_v5.5' into 'release/v5.5'
fix(driver): remove unecessary if conditions in the read function (v5.5)

See merge request espressif/esp-idf!39943
2025-07-22 14:39:02 +08:00
Jiang Jiang Jian
66f5d2653b Merge branch 'docs/add_security_v5.5' into 'release/v5.5'
docs: Provide CN translation for security v5.5

See merge request espressif/esp-idf!39988
2025-07-22 14:38:47 +08:00
Jiang Jiang Jian
e2d5f85804 Merge branch 'feat/call_start_in_flash_v5.5' into 'release/v5.5'
esp_system: move call_start_cpu* into flash to save IRAM (v5.5)

See merge request espressif/esp-idf!39926
2025-07-22 14:38:14 +08:00
Jiang Jiang Jian
be8feb977f Merge branch 'fix/rx_abort_next_op_v5.5' into 'release/v5.5'
fix(openthread): disable rx_abort events in next operation (v5.5)

See merge request espressif/esp-idf!39958
2025-07-22 14:37:39 +08:00
morris
cbf01d9e29 Merge branch 'doc/update_32b_addr_limit_in_flash_doc_v5.5' into 'release/v5.5'
flash: updated 32bit addr support related doc (v5.5)

See merge request espressif/esp-idf!40334
2025-07-22 14:34:59 +08:00
Rahul Tank
8b0ce97f4e fix(nimble): Modified Kconfig information to make it more user friendly 2025-07-22 12:04:07 +05:30
Island
c168ca3fd7 Merge branch 'bugfix/fix_some_ble_build_fail_v5.5' into 'release/v5.5'
fix(ble/bluedroid): fix build failure when some BLE features are disabled (v5.5)

See merge request espressif/esp-idf!40131
2025-07-22 14:33:29 +08:00
Rahul Tank
8d5203d4ae fix(nimble): Add a way to make blufi advertising customizable
Based on changes in https://github.com/espressif/esp-idf/pull/8958
2025-07-22 12:03:11 +05:30
Island
4bb1ad7246 Merge branch 'bugfix/fix_some_ble_bugs_250610_cjh_esp32c3_v5.5' into 'release/v5.5'
Fixed some BLE bugs 250610 on esp32c3(2edb0b0) (v5.5)

See merge request espressif/esp-idf!40431
2025-07-22 14:32:13 +08:00
Rahul Tank
941d98710b Merge branch 'fix/ble_ancs_adding_entry_for_chip_v5.5' into 'release/v5.5'
fix(nimble): Add ble_ancs example to build-test-rules.yml (v5.5)

See merge request espressif/esp-idf!40443
2025-07-22 12:00:15 +05:30
morris
ebc3390df3 Merge branch 'camera/add_dvp_example_v5.5' into 'release/v5.5'
P4 DVP example and bugfix (v5.5)

See merge request espressif/esp-idf!39908
2025-07-22 14:29:17 +08:00
Rahul Tank
76a7dd5aa4 Merge branch 'bugifx/fix_nimble_issues_8072025_v5.5' into 'release/v5.5'
fix(nimble): Fix nimble issues_08072025 (v5.5)

See merge request espressif/esp-idf!40434
2025-07-22 11:58:28 +05:30
Mahavir Jain
570ecdc1cc Merge branch 'feature/support_ds_peripheral_rsa_decryption_v5.5' into 'release/v5.5'
feat(mbedtls): Add support for RSA decryption with DS peripheral (v5.5)

See merge request espressif/esp-idf!40449
2025-07-22 11:57:15 +05:30
morris
782ffe1a7a Merge branch 'fix/pcnt_miss_accum_value_when_overflow_v5.5' into 'release/v5.5'
fix(pcnt): fix the accum_value missing when overflow (v5.5)

See merge request espressif/esp-idf!40313
2025-07-22 14:26:13 +08:00
Mahavir Jain
5c02c6fc1e Merge branch 'feat/update_mbedtls_3.6.4_v5.5' into 'release/v5.5'
feat(mbedtls): update to version 3.6.4 (v5.5)

See merge request espressif/esp-idf!40375
2025-07-22 11:52:29 +05:30
Soh Kam Yung
ae561069b0 feat(hosted_examples_v5_5): Added ESP-Hosted to Wi-Fi examples
- add ESP32-P4 and ESP32-H2 as Supported Targets to following
  examples, using ESP-Hosted and Wi-Fi Remote as components:
  - iperf (H2)
  - getting_started/softAP
  - getting_started/station
  - scan
  - fast_scan
  - softap_sta
- updated .build-test-rules.yml to enable pre-commit to accept ESP32-P4
  and ESP32-H2 as Supported Targets
- updated top level `README.md` to add references to ESP-Hosted
2025-07-22 14:15:04 +08:00
Richard Allen
784547465f fix(esp_http_client): fix spurious async open error
Fix esp_http_client_open() often triggering a
spurious HTTP_EVENT_ERROR when is_async=true.

Fixes https://github.com/espressif/esp-idf/issues/16075
2025-07-22 11:37:00 +05:30
Jiang Jiang Jian
589c8b82d9 Merge branch 'chip/support_esp32c61_v5.5' into 'release/v5.5'
Chip/support esp32c61 v5.5

See merge request espressif/esp-idf!40388
2025-07-22 12:21:36 +08:00
Jiang Jiang Jian
3c39b32195 Chip/support esp32c61 v5.5 2025-07-22 12:21:36 +08:00
Michael (XIAO Xufeng)
b66b5448e0 Merge branch 'update/version_5_5_0' into 'release/v5.5'
Update version to 5.5.0

See merge request espressif/esp-idf!40712
2025-07-22 11:02:34 +08:00
wuzhenghui
ae1914398a feat(esp_hw_support): add core1 enter deepsleep test case 2025-07-21 14:16:01 +08:00
wuzhenghui
5ff3d1f32b fix(esp_hw_support): fix esp32 APP_CPU accessing RTCFAST memory in sleep code
Closes https://github.com/espressif/esp-idf/issues/16243
2025-07-21 14:16:01 +08:00
xiongweichao
a42532c3d7 feat(bt): Add record_handle in ESP_SDP_REMOVE_RECORD_COMP_EVT 2025-07-21 10:23:52 +08:00
Ashish Sharma
163db6a8a5 feat(mbedtls): adds support for RSA decryption with DS peripheral 2025-07-21 09:27:06 +08:00
Adam Múdry
5f4eb68c79 feat(storage): Update emmc and perf_benchmark example to work with ESP32-P4 2025-07-21 01:31:12 +02:00
Adam Múdry
8226972997 feat(sdmmc): Add ESP32-P4 eMMC test board definition 2025-07-21 01:31:12 +02:00
Wei Yuhan
8c750b088c change(version): Update version to 5.5.0 2025-07-18 20:47:27 +08:00
Jiang Jiang Jian
25c7c11970 Merge branch 'docs/added_release_5.5_readme_v5.5' into 'release/v5.5'
Updated ESP-IDF SoC Compatibility for v5.5 (v5.5)

See merge request espressif/esp-idf!40689
2025-07-18 17:10:44 +08:00
Wei Yu Han
280a2f9307 Removed v5.0 from SoC Compatibility in README
(cherry picked from commit bc893d155dd7c6a782e430d5c0be8aedb7866c75)

Co-authored-by: Wei Yuhan <weiyuhan@espressif.com>
2025-07-18 15:24:18 +08:00
Guillaume Souchere
570bc5e02e fix(linenoise): Read escape sequences one character at a time 2025-07-18 08:58:21 +02:00
Wei Yu Han
94c643ba87 Updated ESP-IDF SoC Compatibility for v5.5
(cherry picked from commit 7f350a69640fa78679a252d27a0ba7383851c885)

Co-authored-by: Wei Yuhan <weiyuhan@espressif.com>
2025-07-18 14:39:49 +08:00
Rahul Tank
51b3ff46f9 fix(nimble): Add packet allocation retry for limited iteration 2025-07-18 10:56:49 +05:30
Marek Fiala
df57c2de6c 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:19 +08:00
Ashish Sharma
ab8770fe5a 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 12:01:39 +08:00
yanzihan@espressif.com
3d3731965c feat(esp_hw_support): use pvt to auto control digital ldo and rtc ldo for esp32p4 2025-07-18 09:54:31 +08:00
Ivan Grokhotkov
b43b2001a2 Merge branch 'feat/support_kconfig_in_pacman_v5.5' into 'release/v5.5'
feat: support kconfig in component manager (v5.5)

See merge request espressif/esp-idf!40492
2025-07-18 03:39:04 +02:00
Zhang Shuxian
bf0c01434c docs: Remove incorrect description for ESP32-P4 SDMMC 2025-07-18 09:31:47 +08:00
Fu Hanxi
ddfb59657c ci: mark test_cli_installer_win as allow_failure: true 2025-07-17 15:32:20 +02:00
Fu Hanxi
e67274f0ff feat: support kconfig in component manager 2025-07-17 15:30:40 +02:00
Jiang Jiang Jian
7bed0d3937 Merge branch 'bugfix/crash_ap_mode_switch_v5.5' into 'release/v5.5'
fix(wifi): Fix crash due to BIP when ap mode change

See merge request espressif/esp-idf!40566
2025-07-17 16:19:29 +08:00
Jiang Jiang Jian
b8f555c16b Merge branch 'bugfix/add_the_cve_2025_52471_to_list_v5.5' into 'release/v5.5'
fix(wifi): Added CVE-2025-52471 to vulnerabilities list (v5.5)

See merge request espressif/esp-idf!40207
2025-07-17 16:19:26 +08:00
Rahul Tank
34a7996314 fix(nimble): Enhanced HCI logging by adding timestamp information 2025-07-17 10:18:30 +05:30
Ondrej Kosta
f7bd635a5a fix(esp_eth): bridge test to use SSH key when connect to endnode 2025-07-16 15:04:00 +02:00
Vincent Hamp
4ab1ec36ea 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-16 14:14:54 +05:30
Alexey Lapshin
f6826dda7e fix(esp_wifi): fix test app diff threshold 2025-07-16 14:47:33 +08:00
Marius Vikhammer
da2c5b1228 test(lp_core): re-enabled C5 lp-core test 2025-07-16 08:47:24 +08:00
Ivan Grokhotkov
11bbb25dc4 Merge branch 'feat/smaller_release_size_v5.5' into 'release/v5.5'
ci: Use new release-zips-action with shallow history (v5.5)

See merge request espressif/esp-idf!39938
2025-07-15 16:23:52 +02:00
Euripedes Rocha
67fe133b3c fix(mqtt): Adds sdkconfig to use test broker
Changes the configuration to make test to use internal broker on CI
runs.
2025-07-15 08:47:49 +02:00
Wei Yuhan
b585ee174e Update BLE feature support status 2025-07-15 09:06:55 +08:00
Marek Fiala
4c4c954dd6 change(tools): ruff formatting shell_types.py 2025-07-14 13:59:25 +02:00
Marek Fiala
bcdb78ab13 feat(tools): Added encoding when special characters used with username
Closes https://github.com/espressif/esp-idf/issues/16229
2025-07-14 13:16:24 +02:00
Shreyas Sheth
8755edfb3a fix(wifi): Fix crash due to BIP when ap mode change 2025-07-14 14:29:08 +05:30
Martin Vychodil
8f6e0f4cc3 Merge branch 'update/version_5_5_0' into 'release/v5.5'
Update version to 5.5.0

See merge request espressif/esp-idf!40483
2025-07-11 22:53:21 +08:00
Martin Vychodil
9f19124bd8 change(version): Update version to 5.5.0 2025-07-09 22:09:01 +02:00
Rahul Tank
50fd0a7006 fix(nimble): Fix compilation issues when gatt caching is enabled in server only mode 2025-07-08 17:11:03 +05:30
Erhan Kurubas
ad8f2a7547 change(sysview): drop ESP mcore extension 2025-07-08 13:08:46 +02:00
Erhan Kurubas
8317419aed feat(sysview): update multicore files for testing 2025-07-08 13:08:46 +02:00
Erhan Kurubas
915610e0b6 change(sysview): set default core name as core0 2025-07-08 13:08:46 +02:00
Erhan Kurubas
9a7bd0fb1a feat(sysview): Add SEGGER multicore trace file support 2025-07-08 13:08:46 +02:00
Erhan Kurubas
71fb89eb85 change(docs): replace deprecated openocd cfg files 2025-07-08 13:08:46 +02:00
Erhan Kurubas
6104d8dfe0 feat(tools): update openocd version to v0.12.0-esp32-20250707 2025-07-08 13:08:45 +02:00
iranl
665338d526 fix(esp_http_server): Fix regression in httpd_cookie_key_value
Fix regression in httpd_cookie_key_value introduced by commit 4a47cf8
2025-07-08 16:15:28 +05:30
Astha Verma
d98d21423a fix(nimble): Add ble_ancs example to build-test-rules.yml 2025-07-08 14:13:49 +05:30
Rahul Tank
ccf23d3da7 fix(nimble): Handle 0x3e disconnect during rem feat/ read version 2025-07-08 11:50:56 +05:30
Rahul Tank
1b98cf48b1 fix(nimble): Add missing ble_hs_unlock() call 2025-07-08 11:50:26 +05:30
Astha Verma
0582ee32dc fix(nimble): Added parameter in peer_init for included service allocation 2025-07-08 11:49:20 +05:30
Sumeet Singh
557308bf3a 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-07-08 11:48:01 +05:30
akshat
e9814452bc bugfix(wifi): Reset scan_ongoing flag in scan done event to allow scan trigger post roam 2025-07-08 11:05:09 +05:30
Chen Jian Hua
2157ab84e2 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:40 +08:00
Zhou Xiao
e9f096a079 change(ble): upgraded spi log frame header
(cherry picked from commit 5f3ac91d63)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:16:09 +08:00
Zhou Xiao
9e286cb5c3 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:16:07 +08:00
Zhou Xiao
8d2710c3b6 change(ble): support task buffer number configuration
(cherry picked from commit 4946a1fe8d)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:16:04 +08:00
Zhou Xiao
8f586ecfd9 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:16:02 +08:00
Zhou Xiao
6501cea942 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:15:59 +08:00
Zhou Xiao
1d0be054ec 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:15:57 +08:00
Zhou Xiao
be801fab66 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:15:54 +08:00
Zhou Xiao
83db5c722e 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:15:52 +08:00
Zhou Xiao
fe6be04970 feat(ble): support ble mesh log module
(cherry picked from commit 066e1d3f1b)

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

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:15:47 +08:00
Zhou Xiao
5b0776ab2d 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:15:44 +08:00
Zhou Xiao
c33b69e073 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:15:42 +08:00
Zhou Xiao
26a592f8a2 change(ble): implemented log module template
(cherry picked from commit 8b2c176eff)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-07-08 13:15:39 +08:00
Zhou Xiao
79f8537eb2 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:15:37 +08:00
Sergei Silnov
e8052de6b4 ci: Use new release-zips-action with shallow history 2025-07-07 15:51:50 +02:00
Jiang Jiang Jian
c66052e5dd Merge branch 'bugfix/fix_11a_rate_index_incorrect_and_twt_sleep_issue_v5.5' into 'release/v5.5'
Bugfix/fix 11a rate index incorrect and twt sleep issue v5.5

See merge request espressif/esp-idf!40383
2025-07-06 15:10:33 +08:00
Jiang Jiang Jian
12191f266f Merge branch 'bugfix/fix_softap_tx_bcn_failed_v5.5' into 'release/v5.5'
fix(pm): fix c5 tx pkt failed v5.5

See merge request espressif/esp-idf!40350
2025-07-06 01:19:43 +08:00
Jack
b7887b052e use 240MHz PLL when necessary 2025-07-05 23:52:55 +08:00
Song Ruo Jing
a441cad4b7 fix(sleep): Fix CPU clk src when restoring CPU frequency after wakeup for c5 2025-07-05 23:52:38 +08:00
sibeibei
d5ff5d3f46 fix(pm): fix c5 tx pkt failed 2025-07-05 22:27:30 +08:00
yinqingzhao
4451649760 fix(twt): fix some issus related itwt 2025-07-04 19:52:04 +08:00
yinqingzhao
66ddf66e64 fix(wifi): update ld files of esp32c5 2025-07-04 19:47:38 +08:00
Ashish Sharma
a3af8972ae feat(mbedtls): update to version 3.6.4 2025-07-04 17:34:00 +08:00
renpeiying
b124ac7455 docs: Update CN translation for esp_http_ota.rst 2025-07-04 17:29:24 +08:00
Ashish Sharma
3a9cce2a92 docs(system/esp_https_ota): adds ECIES-256 to pre-enc ota design doc 2025-07-04 17:29:24 +08:00
Jiang Jiang Jian
7a329d5e91 Merge branch 'bugfix/delay_eap_start_v5.5' into 'release/v5.5'
fix(esp_wifi): Add some WFA issue fixes (v5.5)

See merge request espressif/esp-idf!40360
2025-07-04 16:40:21 +08:00
Jiang Jiang Jian
ebaece4dff Merge branch 'fix/force_enable_uart0_sclk_in_esp_restart_v5.5' into 'release/v5.5'
fix(esp_system): force enable uart0 sclk in esp_restart (v5.5)

See merge request espressif/esp-idf!40346
2025-07-04 15:24:59 +08:00
Kapil Gupta
97888e2152 fix (esp_wifi): Set default akm as eap for non AKM APs 2025-07-04 09:21:45 +05:30
Kapil Gupta
8588446859 fix(wpa_supplicant): Delay sending of EAP_START for EAP auth 2025-07-04 09:21:14 +05:30
Jiang Jiang Jian
cf8dad0746 Merge branch 'fix/esp_netif_reassign_static_ip_v5.5' into 'release/v5.5'
fix(esp_netif): Fix reasigning static IP after netif down -> up (v5.5)

See merge request espressif/esp-idf!40169
2025-07-04 11:28:41 +08:00
xiongweichao
71956c72e0 fix(ble): keep the log of the bluetooth sleep clock source consistent 2025-07-04 10:25:07 +08:00
wuzhenghui
577d650d83 fix(esp_system): LOGD for the log printing in sleep process 2025-07-03 19:14:22 +08:00
wuzhenghui
c844ba4f7f fix(esp_system): force enable uart0 sclk in esp_restart 2025-07-03 19:13:41 +08:00
armando
7cef1a5720 doc(flash): updated 32bit addr support doc 2025-07-03 11:46:17 +08:00
Chen Jichang
fc7f5bed4c fix(pcnt): fix the accum_value missing when overflow 2025-07-02 19:08:17 +08:00
sonika.rathi
78c8434d4e fix(sdmmc): fix sdmmc initialization issue in caused by CMD52 CRC error 2025-07-01 13:40:45 +02:00
Peter Macko
d7ac3c7c80 ci: macOS runners - set CCACHE back to 50GB to help VMs 2025-07-01 12:57:20 +02:00
hrushikesh.bhosale
b6d0a8a24e 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:51:26 +05:30
Erhan Kurubas
986a55c3d2 fix(apptrace): calculate crc16 of the current block before swap 2025-06-30 14:36:34 +02:00
Simonas Kazlauskas
c910986317 feat(openthread): support rcp based on USB Serial JTAG 2025-06-30 20:18:45 +08:00
David Cermak
c8c10214f8 fix(esp_netif): Fix incorrect DHCP call for PPP interfaces
Closes https://github.com/espressif/esp-protocols/issues/800
2025-06-30 12:21:26 +02:00
David Cermak
1ad41e589f fix(lwip): Fix appending DHCP option with HW-ID 2025-06-30 12:12:45 +02:00
Marek Fiala
7905dad525 feat(tools): Update ccache 4.10.2 -> 4.11.2
Closes https://github.com/espressif/idf-installer/issues/305
2025-06-30 17:48:29 +08:00
Adam Múdry
4035c8418a fix(storage): Fix storage examples readmes mentioning espotool 2025-06-30 11:19:31 +02:00
Adam Múdry
917755af70 feat(storage): Bump LittleFS to 1.20.0 2025-06-30 11:19:31 +02:00
Zhang Shuxian
7bb638c946 docs: Update CN for usb_host.rst 2025-06-30 08:47:45 +02:00
Tomas Rezucha
ab5e48b026 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.
2025-06-30 08:47:45 +02:00
harshal.patil
0644f453be fix(bootlaoder): Fix documentation as ESP32 does not support secure download mode 2025-06-30 10:26:36 +05:30
zhangyanjiao
65d4e3f06f fix(wifi): Added CVE-2025-52471 to vulnerabilities list 2025-06-30 10:59:58 +08:00
armando
28fff33de3 change(mmu): remove paddr remap warning log 2025-06-30 10:50:25 +08:00
Jiang Jiang Jian
adb3f2a580 Merge branch 'fix/ensure_internal_mem_for_ble_log_spi_out_v5.5' into 'release/v5.5'
fix(ble): ensure internal malloc in ble log spi out (v5.5)

See merge request espressif/esp-idf!40183
2025-06-27 12:07:28 +08:00
Jiang Jiang Jian
d2299ef3c6 Merge branch 'bugfix/fix_the_mesh_crash_issue_when_changing_authmode_v5.5' into 'release/v5.5'
fix(wifi/mesh): fixed the mesh crash issue when changing mesh AP's authmode (v5.5)

See merge request espressif/esp-idf!40171
2025-06-27 10:57:26 +08:00
Zhou Xiao
aae5e12d77 fix(ble): ensure internal malloc in ble log spi out
(cherry picked from commit d300617aa6)

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-06-26 20:33:29 +08:00
zhangyanjiao
d468522078 fix(wifi/mesh): fixed the mesh crash issue when changing mesh AP's authmode
fix(wifi/mesh): fixed the esp_mesh_scan_get_ap_record() error in chain topology
Closes https://github.com/espressif/esp-idf/issues/16041
2025-06-26 17:41:13 +08:00
David Cermak
a6f092516a fix(esp_netif): Fix reasigning static IP after netif down -> up
Fixes regression from 307f45d5 (ip_info should be cleaned, but only if we're running DHCP client on that netif)
2025-06-26 11:37:57 +02:00
Jiang Jiang Jian
3fcb964577 Merge branch 'bugfix/ignore_duplicated_offchan_error_v5.5' into 'release/v5.5'
fix(wifi): ignore duplicated offchan error, add coex wifi event imm

See merge request espressif/esp-idf!40065
2025-06-26 17:36:05 +08:00
cjin
9e1b2d1741 feat(ble): add sm count reserve cnt setting on ESP32-H2 2025-06-26 15:06:13 +08:00
cjin
dc5b3de0ea feat(ble): add sm count reserve cnt setting on ESP32-C6 and ESP32-C61 2025-06-26 15:06:13 +08:00
cjin
f77271e701 feat(ble): add sm count reserve cnt setting on ESP32-C5 2025-06-26 15:06:13 +08:00
cjin
58b5a76153 change(ble): update lib_esp32c6 and esp32c61 to ea6c58c7 2025-06-26 15:06:13 +08:00
cjin
51c803915e change(ble): update lib_esp32h2 to ea6c58c7 2025-06-26 15:06:13 +08:00
cjin
43232d25d8 change(ble): update lib_esp32c5 to ea6c58c7 2025-06-26 15:06:13 +08:00
Zhou Xiao
1ce5e59715 change(ble): [AUTO_MR] Update lib_esp32c2 to e865b4f9 2025-06-26 15:06:13 +08:00
Zhou Xiao
df0243732f change(ble): [AUTO_MR] Update lib_esp32c6 to b8770ab2 2025-06-26 15:06:13 +08:00
Zhou Xiao
e5d17a7f8e change(ble): [AUTO_MR] Update lib_esp32c5 to b8770ab2 2025-06-26 15:06:13 +08:00
Zhou Xiao
af84a63d6b change(ble): [AUTO_MR] Update lib_esp32h2 to b8770ab2 2025-06-26 15:06:13 +08:00
Kapil Gupta
f3579cee33 fix(esp_wifi): Set default ap mgmt cipher 2025-06-25 17:47:50 +08:00
liuning
a714eb84b5 fix(wifi): fix duplicated offchan error, add coex wifi event imm 2025-06-25 17:47:50 +08:00
yinqingzhao
7c79d6e663 feat(wifi): add support for country EU 2025-06-25 17:47:45 +08:00
yinqingzhao
fbc18b2c1d fix(wifi): comment out some functions for esp32c5 2025-06-25 17:47:45 +08:00
Dong Heng
39ea58f5a2 fix(esp_driver_cam): Fix DVP get trans buffer error 2025-06-25 15:50:07 +08:00
Zhang Hai Peng
4e6f18cfe2 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:47 +08:00
Xiao Xufeng
da939fa729 fix(esp_flash): fixed issue of escaping boundary check
Also patched corresponding ROM functions
2025-06-25 01:35:21 +08:00
ding huan
359cc34720 fix(conn): wifi connect before connected status 2025-06-24 17:29:12 +08:00
Fu Hanxi
68d4a55205 ci: remove cached submodule metadata while checking with github 2025-06-24 10:54:57 +02:00
Chen Yudong
a787505813 fix: update wifi-cmd/esp_hosted of iperf example
Related https://github.com/espressif/esp-hosted-mcu/issues/52
2025-06-23 21:16:11 +08:00
laokaiyao
70bb876802 refactor(i2s_es7210): refactor es7210 example 2025-06-23 20:39:00 +08:00
Omar Chebib
1b698f0997 fix(hal): make CLIC interrupt routing function to only write related bits 2025-06-23 17:45:08 +08:00
morris
4ef1493355 fix(ana_cmpr): regression in the cache safe test 2025-06-23 16:42:42 +08:00
laokaiyao
7d61ed7c51 ci: test i2s, touch, ana_cmpr with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 2025-06-23 16:41:44 +08:00
laokaiyao
b9aedbb1c2 fix(ana_cmpr): fixed FUNC_IN_IRAM option involves flash data 2025-06-23 16:41:44 +08:00
laokaiyao
020941c943 ci: test i2s, touch, ana_cmpr with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 2025-06-23 16:41:44 +08:00
Island
cbe9388f45 Merge branch 'bugfix/fixed_set_conn_mode_assert_on_esp32c2_v5.5' into 'release/v5.5'
fix(ble): fixed assertion issue in connection state on ESP32C2-ECO4 (v5.5)

See merge request espressif/esp-idf!40024
2025-06-23 10:22:44 +08:00
armando
44eba53113 feat(psram): support fallback to use default driver pattern when id isn't match 2025-06-23 10:15:59 +08:00
wuzhenghui
2a484d8b43 feat(esp_hw_support): enable wakeup tests for more chips 2025-06-23 09:51:29 +08:00
wuzhenghui
40a3b0cb23 fix(hal): fix pmu_ll_ext1_clear_wakeup_status API 2025-06-23 09:51:29 +08:00
Marek Fiala
52badb9186 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 11:54:12 +02:00
Marek Fiala
1313fe8edc 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 11:54:12 +02:00
Marek Fiala
820a7fd21c fix(tools): idf_tools.py install tool@version 2025-06-20 11:54:12 +02:00
Marek Fiala
70d12d61e9 fix(tools): idf.py create-project works in read-only ESP-IDF
As the native copy function shutil.copyfile preserves directories metadata
such as file permissions, we need to ensure the copied destination
is writable for owner.

Closes https://github.com/espressif/esp-idf/issues/15964
Closes https://github.com/espressif/esp-idf/pull/16021
2025-06-20 11:52:27 +02:00
Marek Fiala
ccfb41895d feat(tools): adjusted create_ext.py by ruff formatter 2025-06-20 11:52:27 +02:00
linruihao
b710539e3f ci(bt/bluedroid): Add CI build test for A2DP Sink example with Caver Art disabled 2025-06-20 17:31:21 +08:00
linruihao
a43ce166d5 fix(bt/bluedroid): Fix AVRCP build issue when disable Cover Art
Closes https://github.com/espressif/esp-idf/issues/16155
2025-06-20 17:31:21 +08:00
Zhao Wei Liang
1d9e0ac834 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:41 +08:00
Jan Beran
a70fa7804e docs: Fix spelling of the word "Kconfig" 2025-06-20 09:08:48 +02:00
liqigan
d33e716a32 fix(bt/controller): Fixed bugs on LMP legacy and secure authentication collision 2025-06-20 14:57:13 +08:00
shenmengjing
dee75b97e2 docs: Provide CN translation for security v5.5 2025-06-19 17:49:01 +08:00
Marek Fiala
d46f3f8801 fix(test): Temporarily disable test_cli_installer_win 2025-06-19 16:12:21 +08:00
Jan Beran
bbb810e70b change: detect misspelled Kconfig[.projbuild] file names
Original issue: https://github.com/espressif/esp-idf-kconfig/issues/14
2025-06-19 16:12:21 +08:00
Wang Mengyang
8521ce42c3 fix(bt): Fixed HFP AG data callback cleared after profile is re-initialized 2025-06-19 07:18:58 +08:00
Jiang Jiang Jian
b37d4b338c Merge branch 'feat/support_sha512_for_esp32c5_v5.5' into 'release/v5.5'
Support SHA 512 for ESP32-C5 (v5.5)

See merge request espressif/esp-idf!39762
2025-06-19 01:16:08 +08:00
Jiang Jiang Jian
5986566708 Merge branch 'fix/bootloader_reserved_area_alignment_v5.5' into 'release/v5.5'
fix(esp_system): fix RTC reserved area alignment in the linker script (backport v5.5)

See merge request espressif/esp-idf!39251
2025-06-18 22:55:16 +08:00
Omar Chebib
20ec15edff 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-18 20:11:47 +08:00
Jiang Jiang Jian
60e884b438 Merge branch 'fix/backport_some_wifi_bugs_v5.5_0617' into 'release/v5.5'
fix: backport some wifi bugs v5.5 0617

See merge request espressif/esp-idf!39953
2025-06-18 19:49:38 +08:00
Jiang Jiang Jian
589c2516c8 Merge branch 'feat/chip_esp32c5_eco2_update_libphy_v5.5' into 'release/v5.5'
feat(phy): update phylib for esp32c5 (v5.5)

See merge request espressif/esp-idf!39957
2025-06-18 19:35:25 +08:00
harshal.patil
5210e576d5 feat(mbedtls/sha): New API for setting SHA mode 2025-06-18 16:46:39 +05:30
harshal.patil
e7a76ff71e feat(soc): Update ESP32-C5 ECO2 to support SHA512 2025-06-18 16:46:39 +05:30
hrushikesh.bhosale
2bfeb41d90 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-18 15:01:17 +05:30
Michael (XIAO Xufeng)
8694f893ea Merge branch 'bugfix/onewire_internal_pullup_v5.5' into 'release/v5.5'
fix(rmt): enable internal pull-up resistor for onewire bus (v5.5)

See merge request espressif/esp-idf!39930
2025-06-18 16:53:41 +08:00
Jiang Jiang Jian
5c6701aad0 Merge branch 'feat/reduce_bin_size_and_iram_for_ble_rom_code_v5.5' into 'release/v5.5'
feat(ble/controller): Reduce bin size and IRAM for BLE rom code on ESP32-C3 and ESP32-S3 (v5.5)

See merge request espressif/esp-idf!39453
2025-06-18 16:09:20 +08:00
Tan Yan Quan
278a26213d feat(openthread): use apb_freq_max mode for esp_openthread_sleep pm lock 2025-06-18 15:34:57 +08:00
Xu Si Yu
b6dd6f1b93 feat(openthread): add some configurations in Kconfig 2025-06-18 15:34:57 +08:00
Tan Yan Quan
dd13871b8a fix(openthread): disable rx_abort events in next operation 2025-06-18 15:34:57 +08:00
yinqingzhao
4d06a6ec9d feat(phy): update phylib for esp32c5 2025-06-18 14:56:18 +08:00
Xiao Xufeng
6cb9214520 wss_server: use large partition table config 2025-06-18 12:30:24 +08:00
sibeibei
b62e55db0b feat(coex): support backgorund scan for coex, fix some issues of scan when connected 2025-06-18 11:13:36 +08:00
Jiang Jiang Jian
8ac432ec0a Merge branch 'fix/update_dfs_compensate_table_v5.5' into 'release/v5.5'
fix(esp_hw_support): update esp32 dfs table to make the timing drift always negative (v5.5)

See merge request espressif/esp-idf!39897
2025-06-18 00:40:23 +08:00
Jiang Jiang Jian
6fd5f51432 Merge branch 'bugfix/fix_coex_ble_disc_v5.5' into 'release/v5.5'
fix(coex): Fix ble disconnect when coexisting wifi on esp32c2 (v5.5)

See merge request espressif/esp-idf!39625
2025-06-18 00:21:36 +08:00
Jiang Jiang Jian
0eb2407a26 Merge branch 'feat/ble_mesh_micellaneous_fix_v5.5' into 'release/v5.5'
Feat/ble mesh micellaneous fix (v5.5)

See merge request espressif/esp-idf!39638
2025-06-17 22:59:37 +08:00
liuning
85c77bdb82 fix(pm): reserve txqblocks when mac init at offchannels 2025-06-17 22:16:15 +08:00
liuning
391c39414e fix(pm): fix ps none status check 2025-06-17 22:16:08 +08:00
zhangyanjiao
df19d0421f fix(wifi/mesh): fixed the mesh STA sends data error on c5 2025-06-17 22:06:52 +08:00
wangtao@espressif.com
5558a08c07 fix(wifi): add check for esp_wifi_set_config 2025-06-17 22:05:58 +08:00
liuning
8aa235a9a5 fix(wifi): fix cant sleep if connection breaks during sending probe 2025-06-17 22:04:41 +08:00
Kapil Gupta
9c61e31be4 fix(esp_wifi): Make sure old DPP listen is cancelled 2025-06-17 21:33:18 +08:00
Kapil Gupta
f0d7baae5e fix(esp_wifi): Modify check for dpp event handlers 2025-06-17 21:31:56 +08:00
Kapil Gupta
9189406b05 change(esp_wifi): Update dpp enrollee example to use updated events 2025-06-17 21:31:46 +08:00
Kapil Gupta
30c24b2f31 fix(esp_wifi): Update dpp code to send events in freeRTOS context 2025-06-17 21:31:38 +08:00
Kapil Gupta
23bc0a51fb fix(esp_wifi): Fixed DPP concurrency issue 2025-06-17 21:31:27 +08:00
tarun.kumar
16985bfd3c fix(wifi): Made changes in api for sending bcast deauth frames 2025-06-17 21:30:15 +08:00
Sarvesh Bodakhe
e454c9be2d 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-17 21:27:38 +08:00
zhanghaipeng
4fd109860b fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(4713a69)
- Fixed double free exception during BLE init under low memory
2025-06-17 21:03:32 +08:00
zhiweijian
88f234f1ef feat(ble/controller): Reduce bin size and IRAM for BLE rom code 2025-06-17 21:03:32 +08:00
Guillaume Souchere
8b06985fdf 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-06-17 14:24:38 +02:00
Guillaume Souchere
d43f18a278 feat(usb_cdc): Update vfs read() to comply with POSIX standards 2025-06-17 14:24:38 +02:00
Guillaume Souchere
6076037bd5 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-06-17 14:24:38 +02:00
Guillaume Souchere
20d1fdec15 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-06-17 14:24:38 +02:00
Jiang Jiang Jian
e44e7ce2f9 Merge branch 'bugfix/fix_tls1_3_dynamic_buffer_build_v5.5' into 'release/v5.5'
fix(mbedtls): Fix failing build with TLS1.3 only and dynamic buffer enabled (v5.5)

See merge request espressif/esp-idf!39879
2025-06-17 15:39:50 +08:00
morris
06268a4efc fix(rmt): enable internal pull-up resistor for onewire bus 2025-06-17 15:32:43 +08:00
Michael (XIAO Xufeng)
e1faf670b2 feat(hw_support): move call_start_cpu0 into flash to save IRAM 2025-06-17 15:11:36 +08:00
Jiang Jiang Jian
4684d3dffc Merge branch 'bugfix/http_client_test_failure_v5.5' into 'release/v5.5'
fix: update root certificate for postman-echo endpoint (v5.5)

See merge request espressif/esp-idf!39846
2025-06-17 15:02:42 +08:00
Jiang Jiang Jian
d8f3e05201 Merge branch 'ci/reenable_c5_adc_test_v5.5' into 'release/v5.5'
ci(adc): reenable c5 adc test and fix test val (v5.5)

See merge request espressif/esp-idf!39906
2025-06-17 14:57:32 +08:00
Jiang Jiang Jian
0104bcde1a Merge branch 'change/update-esp-event-register-doxygen_v5.5' into 'release/v5.5'
change(esp-event): Update the doxygen comment of esp_event_handler_register (v5.5)

See merge request espressif/esp-idf!39853
2025-06-17 14:53:59 +08:00
Jiang Jiang Jian
aac26c847e Merge branch 'feat/ram_optimization_v5.5' into 'release/v5.5'
fix(nimble): Add support to minimize ram consumption (v5.5)

See merge request espressif/esp-idf!39618
2025-06-17 14:52:05 +08:00
Jiang Jiang Jian
4a21060839 Merge branch 'docs/autocolor_multiline_v5.5' into 'release/v5.5'
docs(tools/idf-monitor): Add note about autocoloring limitation on multiline logs (v5.5)

See merge request espressif/esp-idf!39145
2025-06-17 14:51:25 +08:00
Jiang Jiang Jian
9671a5d3b0 Merge branch 'fix/gen_soc_caps_v5.5' into 'release/v5.5'
change: config options of the same name must have the same type (v5.5)

See merge request espressif/esp-idf!39569
2025-06-17 14:50:47 +08:00
Jiang Jiang Jian
2f3351f1a9 Merge branch 'bugfix/pawr_sync_v5.5' into 'release/v5.5'
fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports (v5.5)

See merge request espressif/esp-idf!39715
2025-06-17 14:49:54 +08:00
Jiang Jiang Jian
39ebd0b143 Merge branch 'feat/nimble_ancs_final_v5.5' into 'release/v5.5'
fix(nimble): Added support for ANCS in nimble (v5.5)

See merge request espressif/esp-idf!39654
2025-06-17 14:44:31 +08:00
Jiang Jiang Jian
cfe6cbaaa0 Merge branch 'fix/enable_remove_requirements_file_v5.5' into 'release/v5.5'
fix(tools): handle missing `requirements.*.txt` files for enabled features (v5.5)

See merge request espressif/esp-idf!39802
2025-06-17 14:44:14 +08:00
Jiang Jiang Jian
c7990e649e Merge branch 'ci/fix-custom-oocd-setting_v5.5' into 'release/v5.5'
ci: select OpenOCD binary based on runner (v5.5)

See merge request espressif/esp-idf!39376
2025-06-17 14:43:49 +08:00
luoxu
adc3a80381 feat(ble_mesh): update lib to f15b27e2d2 2025-06-17 14:39:14 +08:00
Luo Xu
e0f7f4e539 fix(ble_mesh): fixed issue with recv ntf before ccc done
(cherry picked from commit 224b7e158d)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-06-17 14:39:14 +08:00
Luo Xu
42a3c9b024 fix(ble_mesh): fixed proxy server might send segment message with incorrect format
(cherry picked from commit 7738bca124)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-06-17 14:39:14 +08:00
Luo Xu
a468bbcadd feat(ble_mesh): support ble 50 for esp32c6 series chip
(cherry picked from commit d4cd6e5741)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-06-17 14:39:14 +08:00
Jiang Jiang Jian
d0d04bd986 Merge branch 'docs/add_doc_link_for_esp32p4_v5.5' into 'release/v5.5'
docs: Update hw-reference/index.rst for esp32p4 (v5.5)

See merge request espressif/esp-idf!39729
2025-06-17 14:37:45 +08:00
Jiang Jiang Jian
7b1cbb89e0 Merge branch 'bugfix/fix_blecibr25_119_v5.5' into 'release/v5.5'
fix(ble/bluedroid): Fixed extended adv restart failure during reconnection (v5.5)

See merge request espressif/esp-idf!39778
2025-06-17 14:34:03 +08:00
Jiang Jiang Jian
e17993b175 Merge branch 'fix/nimble_pr_issues_v5.5' into 'release/v5.5'
fix(nimble): Add fixes for compilation issues in nimble (v5.5)

See merge request espressif/esp-idf!39841
2025-06-17 14:31:10 +08:00
Jiang Jiang Jian
36749445f4 Merge branch 'feat/add_ble_dtm_on_cert_test_v5.5' into 'release/v5.5'
feat(ble): add dtm test code to cert test example on ESP32-C6 (v5.5)

See merge request espressif/esp-idf!39835
2025-06-17 14:24:57 +08:00
Jiang Jiang Jian
a644e9073e Merge branch 'change/opt_hid_device_connect_description_v5.5' into 'release/v5.5'
docs(bt/bluedroid): Updated HID Device connect API description (v5.5)

See merge request espressif/esp-idf!39603
2025-06-17 14:21:18 +08:00
Jiang Jiang Jian
191a24cb6d Merge branch 'feature/usb_host_ext_hub_collective_backport_v5.5' into 'release/v5.5'
feat(usb_host): External Hub collective backport to v5.5

See merge request espressif/esp-idf!39580
2025-06-17 14:20:53 +08:00
Jiang Jiang Jian
24e323685a Merge branch 'change/ble_update_lib_20250606_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250606 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!39740
2025-06-17 14:19:41 +08:00
Jiang Jiang Jian
7bbaba909f Merge branch 'fix/ble_mesh_micellaneous_update_v5.5' into 'release/v5.5'
feat(ble_mesh): Fix/ble mesh micellaneous update (v5.5)

See merge request espressif/esp-idf!39465
2025-06-17 14:17:51 +08:00
Jiang Jiang Jian
f7046307a5 Merge branch 'feat/and_function_to_exit_ot_mainloop_v5.5' into 'release/v5.5'
feat(openthread): add a function to exit openthread mainloop safely (v5.5)

See merge request espressif/esp-idf!39610
2025-06-17 14:11:48 +08:00
Jiang Jiang Jian
cd7c97e6eb Merge branch 'disable_esp32c61_test_v5.5' into 'release/v5.5'
ci(change): disable esp32c61 tests

See merge request espressif/esp-idf!39656
2025-06-17 14:08:56 +08:00
Jiang Jiang Jian
624175fc01 Merge branch 'bugfix/fix_ble_smp_fail_0x82_v5.5' into 'release/v5.5'
Bugfix/fix ble smp fail 0x82 (v5.5)

See merge request espressif/esp-idf!39663
2025-06-17 14:08:19 +08:00
Jiang Jiang Jian
8cf17632c2 Merge branch 'bugfix/supplicant_analyzer_fixes_v5.5' into 'release/v5.5'
Bugfix/supplicant analyzer fixes (v5.5)

See merge request espressif/esp-idf!39454
2025-06-17 14:05:31 +08:00
Jiang Jiang Jian
9a74093e98 Merge branch 'bugfix/fix_ble_crash_when_check_send_pkts_v5.5' into 'release/v5.5'
fix(ble/bluedroid): Fixed null pointer assert in l2c_link_check_send_pkts (v5.5)

See merge request espressif/esp-idf!39599
2025-06-17 14:05:04 +08:00
Jiang Jiang Jian
fa889bf5b6 Merge branch 'fix/ble_mesh_solic_tx_pdu_fix_v5.5' into 'release/v5.5'
fix(ble_mesh): fixed issues with proxy solic pdu adv (v5.5)

See merge request espressif/esp-idf!39528
2025-06-17 14:04:32 +08:00
Jiang Jiang Jian
c4747aae02 Merge branch 'feat/add_avrcp_init_state_event_v5.5' into 'release/v5.5'
feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP(v5.5)

See merge request espressif/esp-idf!39534
2025-06-17 14:02:56 +08:00
Jiang Jiang Jian
0ea73a9273 Merge branch 'fix/incorrect_setting_of_sco_packet_type_mask_v5.5' into 'release/v5.5'
fix(bt): fixed incorrect mask was used to exclude sco packets (backport v5.5)

See merge request espressif/esp-idf!39499
2025-06-17 14:02:09 +08:00
Jiang Jiang Jian
80d191e797 Merge branch 'fix/ble_mesh_set_proxy_adv_param_failed_v5.5' into 'release/v5.5'
fix(ble_mesh): fixed the issue of incorrect proxy adv flag setting (v5.5)

See merge request espressif/esp-idf!39393
2025-06-17 14:00:41 +08:00
Jiang Jiang Jian
ba0da6f2a6 Merge branch 'test/reenable_sdspi_c5_test_v5.5' into 'release/v5.5'
sdspi: re-enable sdspi test on c5 eco2 (v5.5)

See merge request espressif/esp-idf!39344
2025-06-17 13:59:15 +08:00
Jiang Jiang Jian
c943797004 Merge branch 'fix/bin_log_config_v5.5' into 'release/v5.5'
fix(log): Fix bin log config available only for log version 2 (v5.5)

See merge request espressif/esp-idf!39203
2025-06-17 13:58:17 +08:00
morris
1a40b106b4 Merge branch 'fix/fix_xip_psram_ptr_check_v5.5' into 'release/v5.5'
psram: fixed psram ptr check issue under xip_psram condition for ESP32P4 (v5.5)

See merge request espressif/esp-idf!39732
2025-06-17 10:34:10 +08:00
morris
10a210d08a Merge branch 'fix/slot0_requires_all_pins_in_1bit_mode_issue_v5.5' into 'release/v5.5'
sd: fixed all pins need to be set when using slot0 on esp32p4 issue (v5.5)

See merge request espressif/esp-idf!39305
2025-06-17 10:31:22 +08:00
morris
56a4c70c31 Merge branch 'change/psram_2t_check_only_on_ap_v5.5' into 'release/v5.5'
psram: limited 2t check only for ap (v5.5)

See merge request espressif/esp-idf!39429
2025-06-17 10:30:51 +08:00
morris
5a04cfded1 Merge branch 'fix/jpeg_encode_msync_v5.5' into 'release/v5.5'
fix(jpeg): Fix wrong parameter in jpeg encoder msync ,eliminate random black line on jpeg decoder (backport v5.5)

See merge request espressif/esp-idf!39887
2025-06-17 10:30:09 +08:00
morris
3fe9252c3f Merge branch 'feat/usb-explicit-fifo-config_v5.5' into 'release/v5.5'
feat(usb/hal): Add HAL API to configure custom FIFO layout (backport v5.5)

See merge request espressif/esp-idf!39266
2025-06-17 10:29:39 +08:00
morris
c837712306 Merge branch 'docs/p4_eco1_usb_pins_backport_v5.5' into 'release/v5.5'
docs(usb): Update ESP32-P4 USB pins to MP version (backport to v5.5)

See merge request espressif/esp-idf!39902
2025-06-17 10:28:47 +08:00
morris
80abd1c7e4 Merge branch 'refactor/p4_touch_channel_increase_1_v5.5' into 'release/v5.5'
refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14 (v5.5)

See merge request espressif/esp-idf!39791
2025-06-17 10:20:45 +08:00
Zhang Shuxian
3da3f6f2e2 docs: Update hw-reference/index.rst for esp32p4 2025-06-17 10:06:54 +08:00
gaoxu
210f3a4e38 docs(camera): add lcd_cam dvp driver docs for camera 2025-06-17 09:30:58 +08:00
gaoxu
a17bc0ef44 fix(cam): fix dvp do not generate clock 2025-06-17 09:30:58 +08:00
gaoxu
9ba46035c8 feat(cam): add esp32p4 dvp example 2025-06-17 09:30:57 +08:00
gaoxu
f9e4d9504e fix(cam): fix dvp can not get cam_buffer 2025-06-17 09:30:57 +08:00
gaoxu
472baa7525 fix(cam): decrease i2c sccb frequency for camera 2025-06-17 09:30:57 +08:00
gaoxu
8d7aefa890 ci(adc): reenable c5 adc test and fix test val 2025-06-17 09:28:46 +08:00
Michael (XIAO Xufeng)
ef71aad834 Merge branch 'fix/fix_c3_c2_cache_freeze_soc_caps_issue_v5.5' into 'release/v5.5'
cache: fixed SOC_CACHE_FREEZE_SUPPORTED not defined on C3 / C2 issue (v5.5)

See merge request espressif/esp-idf!39886
2025-06-16 23:54:42 +08:00
Tomas Rezucha
73058bfca0 docs(usb): Update ESP32-P4 USB pins to MP version
Closes https://github.com/espressif/esp-idf/issues/16136
2025-06-16 16:39:22 +02:00
Aditya Patwardhan
d5323cfaaa Merge branch 'feature/enable_support_for_deterministic_mode_and_ecdsa_192_v5.5' into 'release/v5.5'
enable support for deterministic mode and ecdsa 192 in ESP32H2 (v5.5)

See merge request espressif/esp-idf!39540
2025-06-16 18:32:43 +05:30
Aditya Patwardhan
6e82c7a061 Merge branch 'bugfix/fix_tls1_3_server_failing_handshake_v5.5' into 'release/v5.5'
fix(mbedtls): Fix failing handshake when running HTTPS Server with TLS1.3 (v5.5)

See merge request espressif/esp-idf!39414
2025-06-16 17:02:10 +05:30
Mahavir Jain
6cf1a6f297 Merge branch 'fix/suppress_cert_bundle_serial_number_warning_v5.5' into 'release/v5.5'
fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning (v5.5)

See merge request espressif/esp-idf!39401
2025-06-16 15:42:10 +05:30
Mahavir Jain
95b7c023da Merge branch 'feat/httpd_register_uri_handler_strdup_failure_case_check_v5.5' into 'release/v5.5'
Handling httdp_register_uri_handler() strdup function failure case check (v5.5)

See merge request espressif/esp-idf!39511
2025-06-16 15:41:47 +05:30
wuzhenghui
f4669e3377 change(bt): increase BTDM_MODEM_WAKE_UP_DELAY 2025-06-16 17:24:47 +08:00
wuzhenghui
7e28275ac1 change(esp_timer): make esp_timer timming drift always be negative 2025-06-16 17:24:47 +08:00
wuzhenghui
da534bf462 fix(esp_hw_support): config lact in critical 2025-06-16 17:24:46 +08:00
Rahul Tank
59434db045 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-16 12:57:36 +05:30
Aditya Patwardhan
2e7a9174fc Merge branch 'feature/esp_tee_h2_v5.5' into 'release/v5.5'
feat(esp_tee): Support for ESP32-H2 (v5.5)

See merge request espressif/esp-idf!39311
2025-06-16 12:04:22 +05:30
C.S.M
fc77b58ced bugfix(jpeg): eliminate random black line on jpeg decoder 2025-06-16 14:19:51 +08:00
C.S.M
770052e859 fix(jpeg): Fix wrong parameter in jpeg encoder msync 2025-06-16 14:19:39 +08:00
Aditya Patwardhan
71f83ca625 Merge branch 'change/exclude_cve-2023-53154_v5.5' into 'release/v5.5'
change: adds CVE-2023-53154 to cJSON sbom exclude list (v5.5)

See merge request espressif/esp-idf!39415
2025-06-16 11:28:13 +05:30
Ashish Sharma
156ead0cd5 fix(mbedtls): Fixes failing TLS 1.3 server handshake
Closes https://github.com/espressif/esp-idf/issues/15984
2025-06-16 11:27:48 +05:30
armando
5555ef7425 fix(cache): fixed SOC_CACHE_FREEZE_SUPPORTED not defined on c3/c2 issue 2025-06-16 13:13:49 +08:00
Zhang Shuxian
4b93bde59b docs: Update CN translation for ecdsa.rst 2025-06-16 13:13:03 +08:00
nilesh.kale
04f5e591c0 feat: enable support for deterministic mode for esp32h2 2025-06-16 13:13:03 +08:00
nilesh.kale
2d5d7b819f feat: enabled ECDSA-P192 support for ESP32H2 2025-06-16 13:13:03 +08:00
Michael (XIAO Xufeng)
908ff6e5df Merge branch 'refactor/change_mmap_cache_lock_type_v5.5' into 'release/v5.5'
mmu: use cache freeze for mmap APIs (v5.5)

See merge request espressif/esp-idf!39796
2025-06-16 13:12:08 +08:00
Krzysztof Budzynski
0dd5b0b979 Merge branch 'docs/update_getting_started_page_c5_v5.5' into 'release/v5.5'
docs: update get-started documents for ESP32-C5 (v5.5)

See merge request espressif/esp-idf!39398
2025-06-16 12:00:09 +08:00
Island
e536aa670b Merge branch 'bugfix/fix_few_nimble_issues_29052025_v5.5' into 'release/v5.5'
fix(nimble): Fix issues 29052025(v5.5)

See merge request espressif/esp-idf!39509
2025-06-16 11:01:08 +08:00
morris
1df4f13b2e Merge branch 'fix/gptimer_sleep_retention_case_v5.5' into 'release/v5.5'
test(gptimer): power domain is not power down on esp32c5 (v5.5)

See merge request espressif/esp-idf!39616
2025-06-16 10:02:47 +08:00
morris
bb72c42611 Merge branch 'fix/driver_issue_by_coverity_v5.5' into 'release/v5.5'
Fix some false issue report by coverity (v5.5)

See merge request espressif/esp-idf!39303
2025-06-16 10:02:26 +08:00
morris
d8fa0886b0 Merge branch 'feat/c5_eco2_psram_timing_tuning_v5.5' into 'release/v5.5'
mspi: psram 80M timing tuning on C5 ECO2 (v5.5)

See merge request espressif/esp-idf!39345
2025-06-16 10:01:13 +08:00
Ashish Sharma
08d78dcd7e fix(esp_tls): fix failing build with TLS1.3 only and dynamic buffer 2025-06-16 09:22:57 +08:00
laokaiyao
849c74b2b9 fix(touch): fixed touch interval freq unit convert issue 2025-06-13 19:49:16 +08:00
laokaiyao
e32bd2502d fix(touch): fixed channel offset issue in touch v2 2025-06-13 19:49:16 +08:00
laokaiyao
666f3db1a3 fix(touch): fixed incorrect interval clock source 2025-06-13 19:49:16 +08:00
laokaiyao
79da851a4c refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14 2025-06-13 19:49:16 +08:00
morris
3f8da22ae0 Merge branch 'fix/fix_adc_cali_error_c5_v5.5_bp' into 'release/v5.5'
fix(adc): fix adc calibration error on c5 (v5.5)

See merge request espressif/esp-idf!39857
2025-06-13 19:10:16 +08:00
morris
f523943972 Merge branch 'feat/twai_driver_add_programming_guide_v5.5' into 'release/v5.5'
feat(driver_twai): new driver add programming guide (v5.5)

See merge request espressif/esp-idf!39679
2025-06-13 19:09:20 +08:00
Island
fc71a8643e Merge branch 'bugfix/fix_ble_scan_no_adv_report_when_connected_v5.5' into 'release/v5.5'
Fixed missing ADV reports after bonding and connection on ESP32-C3 and ESP32-S3 (v5.5)

See merge request espressif/esp-idf!39276
2025-06-13 19:00:26 +08:00
Island
0e585a2994 Merge branch 'bugfix/fix_send_delete_link_key_cmd_1_v5.5' into 'release/v5.5'
Bugfix/fix send delete link key cmd 1 (v5.5)

See merge request espressif/esp-idf!39446
2025-06-13 19:00:23 +08:00
Zhao Wei Liang
f5be149eb2 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-13 16:09:23 +08:00
Zhao Wei Liang
ccef14fad2 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-13 16:09:23 +08:00
Zhao Wei Liang
bb8338b17a 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-13 16:09:23 +08:00
Zhao Wei Liang
53534bc5ce fix(ble): change the default ble cca thresh on ESP32-C5
(cherry picked from commit c802176535)

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

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-13 16:09:23 +08:00
Zhao Wei Liang
ec2f1c0023 fix(ble): fixed an occasional abnormal scanning stop issue on ESP32-C5
(cherry picked from commit 44d7fc43f6)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-13 16:09:23 +08:00
Zhao Wei Liang
5584880376 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-13 16:09:23 +08:00
Zhao Wei Liang
ebdafe8e0c change(ble): [AUTO_MR] Update lib_esp32c2 to 7f72c031
(cherry picked from commit 4be18a2469)

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

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-13 16:09:23 +08:00
Zhao Wei Liang
6078213bcd change(ble): [AUTO_MR] Update lib_esp32c5 to 35fe65f4
(cherry picked from commit dacaae746e)

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

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-13 16:09:23 +08:00
gaoxu
37f017585d fix(adc): fix adc calibration error on c5 2025-06-13 14:46:34 +08:00
Guillaume Souchere
8f57d672d2 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:12 +02:00
Mahavir Jain
881c5a9795 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:03:24 +05:30
Zhao Wei Liang
2e760d374e feat(ble): add dtm test code to cert test example on ESP32-C6
(cherry picked from commit 71bc00568d)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-13 11:03:38 +08:00
chenjianhua
e22c523b55 feat(ble/bluedroid): Support anonymous address type for white list 2025-06-13 10:31:52 +08:00
chenjianhua
7c2734dc02 feat(ble/bluedroid): Add config for BLE vendor hci command and event 2025-06-13 10:31:52 +08:00
chenjianhua
9e7325a3d6 feat(ble/bluedroid): Support BLE vendor event reporting with params 2025-06-13 10:31:52 +08:00
Chen Jian Hua
29ba5469ef fix(ble/bluedroid): Fixed extended adv restart failure during reconnection
(cherry picked from commit 6392180813)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2025-06-13 10:31:52 +08:00
liqigan
20d66da972 docs(bt/bluedroid): Updated HID Device connect API description
Closes https://github.com/espressif/esp-idf/issues/16020
2025-06-13 07:07:35 +08:00
Marius Vikhammer
4c3d086c13 Merge branch 'update/version_5_5_0' into 'release/v5.5'
Update version to 5.5.0

See merge request espressif/esp-idf!39823
2025-06-13 02:06:50 +08:00
igor.masar
d0e0c188fb 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-06-12 21:03:47 +08:00
Marius Vikhammer
19b0d6c13c change(version): Update version to 5.5.0 2025-06-12 14:25:45 +02:00
Marek Fiala
e9e995bd0a fix(tools): Enabled removing requirements.* files 2025-06-11 11:12:49 +02:00
wanckl
7914e75525 feat(driver_twai): new driver add programming guide 2025-06-11 17:05:37 +08:00
Fu Hanxi
c2f551d87a ci: disable idf-ci plugin
this plugin will be re-enabled with compatible code in !38755
2025-06-11 10:56:38 +02:00
armando
90b3d29223 feat(mmu): use cache freeze for mmap apis 2025-06-11 14:48:40 +08:00
armando
30d77f494e 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-11 06:44:21 +00:00
John Boiles
7557ec0951 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-11 06:44:21 +00:00
John Boiles
e29823cfe0 fix(freertos): Use ESP_EARLY_LOGE in vPortTLSPointersDelCb for RISCV
Using ESP_LOG* in this function causes a crash
2025-06-11 06:44:21 +00:00
Jan Beran
f0a4d73ea1 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-11 14:19:50 +08:00
renpeiying
22aeb00462 docs: Update CN for idf-monitor.rst 2025-06-11 13:54:16 +08:00
Peter Dragun
fd3178eb6b docs(tools/idf-monitor): Add note about autocoloring limitation on multiline logs
Closes https://github.com/espressif/esp-idf/issues/15793
2025-06-11 13:54:16 +08:00
Rahul Tank
7cf59adc0c fix(nimble): Add invocation for mempool_deinit 2025-06-11 10:51:44 +05:30
Rahul Tank
96b43c9797 fix(nimble): Added CI files for various configurations 2025-06-11 10:51:44 +05:30
Rahul Tank
168808248d fix(nimble): Add chip dependancy flag for Flow control feature 2025-06-11 10:51:44 +05:30
Rahul Tank
fc72303490 fix(nimble): Add changes for coverity reported issue 2025-06-11 10:51:44 +05:30
Rahul Tank
6b74032d2e fix(nimble): Add support for minimilistic builds 2025-06-11 10:51:44 +05:30
Island
39c6c703b1 Merge branch 'feat/ble_log_spi_out_dev_phase_3_v5.5' into 'release/v5.5'
Feat/ble log spi out dev phase 3 (v5.5)

See merge request espressif/esp-idf!39356
2025-06-11 13:17:23 +08:00
morris
ce09a8c037 test(gptimer): power domain is not power down on esp32c5 2025-06-09 10:16:07 +08:00
Abhinav Kudnar
370ac37623 fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports 2025-06-06 17:13:24 +05:30
Marius Vikhammer
98cd765953 Merge branch 'bugfix/c5_newlib_tests_v5.5' into 'release/v5.5'
test(newlib): fixed failing C5 ECO2 newlib tests (v5.5)

See merge request espressif/esp-idf!39711
2025-06-06 18:18:11 +08:00
Jiang Jiang Jian
73747da716 Merge branch 'bugfix/idfci-2959_v5.5' into 'release/v5.5'
backport v5.5: fix ci build doc field on power management and sleep rst text

See merge request espressif/esp-idf!39706
2025-06-06 17:41:05 +08:00
Marius Vikhammer
18b6997e32 test(newlib): fixed failing C5 ECO2 newlib tests 2025-06-06 09:56:55 +02:00
Li Shuai
693a5393b2 change(unit-test): filter top domain power down check for some sleep test cases 2025-06-05 22:08:34 +08:00
Li Shuai
23892d857a change(esp_hw_support): force top domain power up during sleep 2025-06-05 22:07:30 +08:00
Li Shuai
087727a693 Revert "fix(esp_pm): esp32c5 eco2 disable top pd to avoid mem being changed during sleep"
This reverts commit d881dda91c.
2025-06-05 22:06:23 +08:00
Xu Si Yu
49b5cc9e50 feat(openthread): add a function to exit openthread main loop safely 2025-06-05 14:53:11 +08:00
Astha Verma
33c71ea033 fix(nimble): Added support for ANCS in nimble 2025-06-05 10:22:47 +05:30
armando
5961670d06 change(psram): limited 2t check only for ap 2025-06-05 02:50:08 +00:00
harshal.patil
07ae83249a fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning
Co-authored-by: Mahavir Jain <mahavir.jain@espressif.com>
2025-06-04 17:37:47 +05:30
linruihao
fa75a4dd67 fix(coex): Fix ble disconnect when coexisting wifi on esp32c2 2025-06-04 19:26:23 +08:00
Aditya Patwardhan
b002e50857 Merge branch 'fix/all_crypto_periphs_reset_cause_sec_reset_v5.5' into 'release/v5.5'
fix(system_internal): Avoid the sec clock reset caused due to resetting all crypto peripherals (v5.5)

See merge request espressif/esp-idf!39397
2025-06-04 15:17:38 +05:30
Zhang Hai Peng
f19263a97c 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:49 +08:00
Zhang Hai Peng
7f8290e911 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:47 +08:00
Erhan Kurubas
0170c56e04 ci(change): disable esp32c61 tests 2025-06-04 11:11:05 +02:00
morris
7b66ed489f Merge branch 'test/c61_disable_test_v5.5' into 'release/v5.5'
test(ci): c61 disable test for eco3 update (v5.5)

See merge request espressif/esp-idf!39632
2025-06-04 17:04:54 +08:00
wanckl
35876be5e6 test(ci): c61 disable test for eco3 update 2025-06-03 20:17:07 +08:00
Shreeyash
e2b524c609 fix(nimble): Add support to minimize ram consumption 2025-06-03 16:06:44 +05:30
Zhang Hai Peng
30859ceaff 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:42 +08:00
Roman Leonov
99e5203d89 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:42:47 +02:00
Roman Leonov
c48b74805f 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:42:05 +02:00
Zhou Xiao
a2cd564044 fix(ble): set timer handle to null after deletion 2025-05-30 22:37:55 +08:00
Jiang Jiang Jian
ad5d36257b Merge branch 'fix/backport_some_wifi_fixes_v5.5' into 'release/v5.5'
Fix/backport some wifi fixes v5.5

See merge request espressif/esp-idf!39529
2025-05-30 18:54:29 +08:00
Jiang Jiang Jian
52e3d9bb5f Merge branch 'bugfix/esp32c5_eco2_cpulockup_top_pu_v5.5' into 'release/v5.5'
backport v5.5: esp32c5 eco2 disable top pd to avoid mem being changed during sleep

See merge request espressif/esp-idf!39549
2025-05-30 18:42:49 +08:00
Li Shuai
d881dda91c fix(esp_pm): esp32c5 eco2 disable top pd to avoid mem being changed during sleep 2025-05-30 16:33:37 +08:00
Jiang Jiang Jian
ecb5fc3075 Merge branch 'bugfix/fix_esp32c5_ble_tx_error_after_deep_sleep_v5.5' into 'release/v5.5'
fix(phy): update phy lib on ESP32-C5 (v5.5)

See merge request espressif/esp-idf!39510
2025-05-30 11:17:30 +08:00
Jiang Jiang Jian
cd1601f408 Merge branch 'fix/fix_esp_timer_accuracy_when_do_dfs_v5.5' into 'release/v5.5'
fix(esp_hw_support): improve esp timer accuracy on DFS for esp32 & esp32s2 (v5.5)

See merge request espressif/esp-idf!39339
2025-05-30 10:25:37 +08:00
xiongweichao
4d83f1b8af feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP 2025-05-30 10:02:38 +08:00
wangtao@espressif.com
0fe8891e3a fix(wifi): fix esp32c2 auth threshold issue 2025-05-29 21:44:10 +08:00
zhangyanjiao
b1a379d574 fix(wifi): Added more check when receiving espnow data 2025-05-29 20:25:24 +08:00
yinqingzhao
84973428b2 fix(bss_max_idle): fix some wifi bugs related to bss max idle 2025-05-29 20:25:08 +08:00
Luo Xu
41a17b71ad fix(ble_mesh): fixed issues with proxy solic pdu adv
(cherry picked from commit ca30088aa8)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-05-29 20:23:37 +08:00
tarun.kumar
253ca4267a fix)wifi): Add GTK rekeying interval field in softap example 2025-05-29 20:23:19 +08:00
tarun.kumar
60ab2598c5 fix(wifi) : Add config param for gtk rekeying on softAP side 2025-05-29 20:23:08 +08:00
hrushikesh.bhosale
b9c586ebd1 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:49:57 +05:30
Jin Chen
3d09da9251 fix(phy): update phy lib to fix phy errors on ESP32-C5
(cherry picked from commit 4a18a67898)

Co-authored-by: cjin <jinchen@espressif.com>
2025-05-29 14:18:18 +08:00
gongyantao
fddf34d7b0 fix(bt): fixed incorrect mask was used to exclude sco packets 2025-05-29 09:55:35 +08:00
luoxu
2e761da92a feat(ble_mesh): update lib to bbb57d10f9 2025-05-27 20:06:58 +08:00
luoxu
b045635cea feat(ble_mesh): Change the type of rpl size from uint8 to uint16 2025-05-27 17:30:55 +08:00
Kapil Gupta
3b596bb602 fix(esp_wifi): Fixed static analyzer issues 2025-05-27 13:37:13 +05:30
Kapil Gupta
45fed1d225 fix(esp_wifi): Disble IP renew skip by default 2025-05-27 13:37:13 +05:30
Zhang Hai Peng
d7216d221b fix(ble/bluedroid): Fixed clear BLE device recored
(cherry picked from commit 21391a45fd)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2025-05-27 15:14:02 +08:00
Zhang Hai Peng
80c5fd1836 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:59 +08:00
Ashish Sharma
b3843ea09a change: adds CVE-2023-53154 to cJSON sbom exclude list 2025-05-26 17:29:14 +08:00
Zhou Xiao
6687749fae change(ble): make falling edge when disabling ts sync 2025-05-26 15:35:29 +08:00
Linda
2b0c548593 docs: update get-statted documents for ESP32-C5 2025-05-26 15:02:46 +08:00
harshal.patil
59496b4927 fix(system_internal): Avoid the sec clock reset caused due to resetting all crypto peripherals 2025-05-26 11:40:51 +05:30
armando
b977a13796 test(psram): re-enable 80M psram tests on C5 ECO2 2025-05-26 11:32:24 +08:00
Zhou Xiao
0a3cc83a86 fix(ble): fixed spi log init failure return value for ESP32 2025-05-26 10:47:03 +08:00
Luo Xu
d5d713cff2 fix(ble_mesh): fixed the issue of incorrect proxy adv flag setting
(cherry picked from commit 6297edade5)

Co-authored-by: luoxu <luoxu@espressif.com>
2025-05-26 09:24:47 +08:00
Zhou Xiao
80c92bae34 fix(ble): fixed ts sync sleep support trigger 2025-05-23 19:13:12 +08:00
Zhou Xiao
0904640409 fix(ble): fixed printf va list cross function pass failure 2025-05-23 12:31:55 +08:00
Samuel Obuch
b0f107b69a ci: select OpenOCD binary based on runner 2025-05-23 00:34:00 +02:00
Zhou Xiao
1c81d11ec3 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:55:39 +08:00
Zhou Xiao
059a675e5c 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:55:36 +08:00
Zhou Xiao
4c7a13b570 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:55:34 +08:00
Zhou Xiao
5be9ac3d93 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:55:31 +08:00
Zhou Xiao
e100fc790c 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:55:29 +08:00
Zhou Xiao
a73197e886 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:55:26 +08:00
Zhou Xiao
9e0c4d226a 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:55:24 +08:00
Zhou Xiao
68dd2c9a3c 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:55:22 +08:00
Zhou Xiao
3d3b7caf95 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:55:19 +08:00
Zhou Xiao
0e59feac9d feat(ble): support hci log buffer separation
(cherry picked from commit 16a3b2c71b)

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

Co-authored-by: Zhou Xiao <zhouxiao@espressif.com>
2025-05-22 16:55:15 +08:00
armando
3092578b4a fix(ci): fixed psram tests not running on c5 issue 2025-05-22 14:42:48 +08:00
armando
fafc25b8b9 feat(mspi): supported psram 80MHz timing tuning 2025-05-22 14:42:42 +08:00
armando
e7c8f555e7 refactor(mspi): change mspi timing tuning dirrectory structure 2025-05-22 14:42:37 +08:00
armando
5f71d958c3 test(sdspi): re-enable sdspi test on c5 eco2 2025-05-22 14:32:03 +08:00
wuzhenghui
e26be2be8f test(esp_timer): add UT case for esp_timer period alarm with DFS 2025-05-22 14:07:37 +08:00
wuzhenghui
e8475d7796 feat(esp_hw_support): compensate the error introduced to LACT during APB frequency switching 2025-05-22 14:07:37 +08:00
wuzhenghui
31149354a9 fix(esp_hw_support): update systimer step immediately when XTAL changes on esp32s2 2025-05-22 14:07:37 +08:00
wuzhenghui
833df30063 fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32 2025-05-22 14:07:36 +08:00
armando
1cc377a373 fix(sd): fixed menuconfig multi pin definitions issue 2025-05-21 12:43:49 +08:00
armando
a74197c552 fix(sd): fixed slot0 requires all pins to be set when using 1bit iomux mode on p4 2025-05-21 12:43:49 +08:00
Laukik Hase
d482206483 ci(esp_tee): Enable the tee_test_fw test app for ESP32-H2 2025-05-21 10:06:17 +05:30
Laukik Hase
27496e47f0 feat(esp_tee): Support for ESP32-H2 - the rest of the components 2025-05-21 10:06:17 +05:30
Laukik Hase
eca7c7296c feat(esp_tee): Support for ESP32-H2 - the esp_tee component 2025-05-21 10:06:16 +05:30
morris
039cc1ac80 fix(drivers): some false reports from coverity 2025-05-21 10:08:08 +08:00
morris
ee3baa4ca7 refactor(bitscrambler): don't use Reset Clock Control lock of RC version 2025-05-21 10:08:08 +08:00
Jiang Jiang Jian
ba70c7f3d1 Merge branch 'fix/enable_ecdsa_verify_sw_fallback_when_p192_disabled_v5.5' into 'release/v5.5'
Enable signature verification s/w fallback when ECDSA-P192 is disabled (v5.5)

See merge request espressif/esp-idf!39260
2025-05-20 22:39:17 +08:00
Jiang Jiang Jian
c5b725fc50 Merge branch 'feat/move_ocode_config_to_pmuinit_c6_c5_c61_v5.5' into 'release/v5.5'
refactor: move_ocode_to_pmu_init_c6_c5_c61 (v5.5)

See merge request espressif/esp-idf!39286
2025-05-20 22:39:06 +08:00
Jiang Jiang Jian
10a690fe10 Merge branch 'feat/support_different_pwr_glitch_dref_to_fit_eco_esp32c61_v5.5' into 'release/v5.5'
Feat/support different pwr glitch dref to fit eco esp32c61 v5.5

See merge request espressif/esp-idf!39289
2025-05-20 22:38:46 +08:00
Jiang Jiang Jian
758da73338 Merge branch 'feat/impl_bt_coex_timer_event_v5.5' into 'release/v5.5'
feat(coex): implement BT coex timer event (Backport v5.5)

See merge request espressif/esp-idf!39277
2025-05-20 22:38:35 +08:00
Jiang Jiang Jian
27b85137c7 Merge branch 'contrib/github_pr_15942_v5.5' into 'release/v5.5'
fix(esp_hw_support): Fix compile error on esp_cpu_int_has_handler on ESP32-P4 (GitHub PR) (v5.5)

See merge request espressif/esp-idf!39117
2025-05-20 22:37:40 +08:00
Rahul Tank
06ee44ef46 Merge branch 'feat/gattc_gatts_coex_v5.5' into 'release/v5.5'
feat(nimble): Add new gattc + gatts coex example for nimble (v5.5)

See merge request espressif/esp-idf!39298
2025-05-20 19:49:32 +05:30
Weltenprinz
f4add076a8 fix(esp_hw_support): Fix compile error on esp_cpu_int_has_handler on ESP32-P4
Merges https://github.com/espressif/esp-idf/pull/15942
Closes https://github.com/espressif/esp-idf/issues/15941
2025-05-20 21:15:12 +08:00
chaijie@espressif.com
5e6ecd81b5 refactor: move_ocode_to_pmu_init_c6_c5_c61 (v5.5) 2025-05-20 21:14:56 +08:00
chaijie@espressif.com
45fb5fb793 fix(pmu): fix deepsleep current too big bug for esp32c61 2025-05-20 21:14:33 +08:00
chaijie@espressif.com
63f72f659d feat(power_glich): support power_glitch of esp32c5_eco1 and above, eco32c61 eco2 and above 2025-05-20 21:14:33 +08:00
linruihao
7910ea8571 feat(coex): implement BT coex timer event 2025-05-20 21:13:57 +08:00
Jiang Jiang Jian
7f46f6152e Merge branch 'fix/fix_esp32p4_stuck_in_pd_ana_v5.5' into 'release/v5.5'
fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep (v5.5)

See merge request espressif/esp-idf!39283
2025-05-20 21:10:26 +08:00
Rahul Tank
5da8865f9b feat(nimble): Add demo example for gattc and gatts coex for nimble 2025-05-20 18:12:02 +05:30
Xiao Xufeng
c771e4508e iperf: increased app partition size in example 2025-05-20 19:52:07 +08:00
Xiao Xufeng
375d675cdc https_server: use larger partition table in the example 2025-05-20 19:52:07 +08:00
wuzhenghui
2252a4166a fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep 2025-05-20 19:52:07 +08:00
Kapil Gupta
1f4fbd060c Merge branch 'fix/rrm_config_set_v5.5' into 'release/v5.5'
Set rrm config condition in case RRM monitoring is enabled

See merge request espressif/esp-idf!39280
2025-05-20 15:34:42 +05:30
Jiang Jiang Jian
f97fd7490f Merge branch 'bugfix/incorrect_sae_pk_flag_v5.5' into 'release/v5.5'
Disable SAE-PK indication in Assoc Request when not configured (Backport v5.5)

See merge request espressif/esp-idf!39074
2025-05-20 17:30:26 +08:00
morris
dbfb663b66 Merge branch 'feature/add_uart_io_deinit_process_v5.5' into 'release/v5.5'
fix(uart): eliminate garbled data on TX/RX line in sleep (v5.5)

See merge request espressif/esp-idf!39262
2025-05-20 16:00:38 +08:00
Jiang Jiang Jian
429183de1e Merge branch 'fix/fix_iram_safe_code_inlined_to_flash_v5.5' into 'release/v5.5'
fix(esp_hw_support): fix sleep iram safe code inlined to flash (v5.5)

See merge request espressif/esp-idf!39271
2025-05-20 15:35:52 +08:00
harshal.patil
1ba8abd8b7 fix(mbedtls): Enable signature verification s/w fallback when ECDSA curve is disabled 2025-05-20 12:18:07 +05:30
morris
5b1588e0db Merge branch 'fix/i2c_ci_esp32c5_v5.5' into 'release/v5.5'
test(i2c): Re-enable i2c test on esp32c5 (Support i2c slave on esp32c5) (backport v5.5)

See merge request espressif/esp-idf!39255
2025-05-20 14:37:59 +08:00
morris
3ded40b276 Merge branch 'docs/uhci_programming_guide_v5.5' into 'release/v5.5'
docs(uhci): implementation for uart-dma (uhci) docs (backport v5.5)

See merge request espressif/esp-idf!39256
2025-05-20 14:28:41 +08:00
Jiang Jiang Jian
a6db9d402f Merge branch 'fix/fix_usj_pad_leakage_v5.5' into 'release/v5.5'
fix(esp_hw_support): always disable USJ pad in sleep to supress leakage (5.5)

See merge request espressif/esp-idf!39105
2025-05-20 14:24:44 +08:00
Jiang Jiang Jian
693dfe6b0e Merge branch 'fix/fix_usb_hs_phy_leakage_on_deepsleep_v5.5' into 'release/v5.5'
fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy (v5.5)

See merge request espressif/esp-idf!39167
2025-05-20 14:01:02 +08:00
Jiang Jiang Jian
d738d889d8 Merge branch 'bugfix/force_calibrate_ocode_no_inline_c5eco2_v5.5' into 'release/v5.5'
fix(esp_hw_support): Force function calibrate_ocode not inlined to flash (v5.5)

See merge request espressif/esp-idf!39110
2025-05-20 14:00:44 +08:00
Jiang Jiang Jian
ce340fcce7 Merge branch 'fix/backport_some_wifi_fixes_v5.5' into 'release/v5.5'
fix(wifi): backport some wifi fixes to v5.5

See merge request espressif/esp-idf!39261
2025-05-20 13:55:40 +08:00
tarun.kumar
b1218adfae fix(wifi) : Set rrm config condition in case RRM monitoring is enabled 2025-05-20 10:19:16 +05:30
akshat
aff86ba14b bugfix(wifi): Fix incorrect SAE-PK advertisement in assoc request 2025-05-20 11:57:13 +08:00
Jiang Jiang Jian
c85c74f54b Merge branch 'fix/lp_periph_use_int_raw_v5.5' into 'release/v5.5'
change(lp-core): Update LP I2C and LP UART drivers to use raw interrupt status (v5.5)

See merge request espressif/esp-idf!39248
2025-05-20 11:54:58 +08:00
Jiang Jiang Jian
0778748506 Merge branch 'feat/cjson_update_to_upstream_v5.5' into 'release/v5.5'
feat(cjson): update to latest upstream (v5.5)

See merge request espressif/esp-idf!39225
2025-05-20 11:54:36 +08:00
Jiang Jiang Jian
8a54378b95 Merge branch 'bugfix/wps_pbc_overlap_uuid_v5.5' into 'release/v5.5'
fix(wpa_supplicant): Ensure pbc_overlap event is posted correctly (Backport v5.5)

See merge request espressif/esp-idf!39054
2025-05-20 11:53:08 +08:00
Zhang Hai Peng
43ff2531ab 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:38 +08:00
Jiang Jiang Jian
a3edce572a Merge branch 'change/ble_update_lib_20250516_v5.5' into 'release/v5.5'
change(ble): [AUTO_MR] 20250516 - Update ESP BLE Controller Lib (v5.5)

See merge request espressif/esp-idf!39238
2025-05-20 11:02:11 +08:00
Jiang Jiang Jian
4aa47aacc3 Merge branch 'feature/parttable_tool_use_only_ascii_for_names_v5.5' into 'release/v5.5'
fix(partition_table): Ignore UTF-8 BOM bytes in csv file (v5.5)

See merge request espressif/esp-idf!39176
2025-05-20 11:00:38 +08:00
Jiang Jiang Jian
379f4de500 Merge branch 'docs/fix_p4_usb_jtag_pins_v5.5' into 'release/v5.5'
docs(jtag): fix esp32p4 usb jtag pins (v5.5)

See merge request espressif/esp-idf!39156
2025-05-20 10:55:23 +08:00
wanglei
048d03e94d fix(esp_hw_support): Force function calibrate_ocode not inlined to flash 2025-05-20 10:51:20 +08:00
Jiang Jiang Jian
29520e982c Merge branch 'bugfix/secure_ota_no_secure_boot_v5.5' into 'release/v5.5'
fix: secure OTA without secure boot issue for MMU page size configurable SoCs (v5.5)

See merge request espressif/esp-idf!39123
2025-05-20 10:47:57 +08:00
wuzhenghui
527e2f38b8 fix(esp_hw_support): always disable USJ pad in sleep to supress leakage 2025-05-20 10:46:11 +08:00
wuzhenghui
9cf4ddf797 fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy 2025-05-20 10:32:52 +08:00
wuzhenghui
3052ad53e7 fix(esp_hw_support): fix sleep iram safe code inlined to flash 2025-05-20 10:26:06 +08:00
Alexey Gerenkov
1adbeceb27 Merge branch 'ci/enable_gcov_test_v5.5' into 'release/v5.5'
ci: enable gcov example for all chips (v5.5)

See merge request espressif/esp-idf!39162
2025-05-20 01:58:20 +08:00
Alexey Gerenkov
d1c131f649 Merge branch 'feat/apptrace-crc16_v5.5' into 'release/v5.5'
Store CRC16 checksum value in the PERFMON1 reg (v5.5)

See merge request espressif/esp-idf!39208
2025-05-20 01:49:26 +08:00
Song Ruo Jing
7b52c11661 test(gpio,gpio_ext,ppa): test with malloc from psram by default 2025-05-19 21:53:10 +08:00
Song Ruo Jing
5bb83afac7 refactor(uart): minor refactor to uart wakeup code 2025-05-19 21:52:55 +08:00
Song Ruo Jing
669e677ba3 fix(uart): eliminate garbled data on UART TX/RX line in sleep 2025-05-19 21:52:15 +08:00
Song Ruo Jing
1909105acf feat(uart): add pin release process to uart driver 2025-05-19 21:51:59 +08:00
sibeibei
afcb8199b0 fix(wifi): rx bcn failed when sta off channel under modem state 2025-05-19 21:16:37 +08:00
akshat
0a17f79cc7 feat(esp_wifi): Add FTM support for ESP32C5 (ECO2)
Closes https://github.com/espressif/esp-idf/issues/15909
2025-05-19 21:14:48 +08:00
tarun.kumar
de17b6ff94 fix(softAP): Adjusted authentication mode for wpa-eap version 1 2025-05-19 21:12:52 +08:00
tarun.kumar
046479c23f fix(wifi): Sending disconnect event in connect fail and add enterprise check in Suite-B 192-bit certification 2025-05-19 21:12:13 +08:00
yinqingzhao
79d2bedbf9 fix(wifi): fix build issue by modifying parttion table of file_server example 2025-05-19 21:11:30 +08:00
yinqingzhao
6514df1ba9 feat(wifi): add tx error 0xa0 count 2025-05-19 21:11:18 +08:00
Shreyas Sheth
692f7df5aa fix(esp_wifi): Fix locking in incorrect state when stop_scan is called after connect 2025-05-19 21:10:05 +08:00
C.S.M
f6cb4422db docs(uhci): implementation for uart-dma (uhci) docs 2025-05-19 17:49:39 +08:00
C.S.M
60adcc5980 test(i2c): Re-enable i2c test on esp32c5 2025-05-19 17:44:27 +08:00
Sudeep Mohanty
a544a33131 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:33:10 +02:00
morris
4f56bba225 Merge branch 'refactor/add_dfs_init_auto_test_v5.5' into 'release/v5.5'
fix(mcpwm): the wrong pm lock type on esp32 and esp32s3 (v5.5)

See merge request espressif/esp-idf!39192
2025-05-19 15:55:29 +08:00
Rahul Tank
5273ba9731 Merge branch 'fix/gattc_proc_comparison_v5.5' into 'release/v5.5'
fix(nimble): Fix proc rx entry comparison (v5.5)

See merge request espressif/esp-idf!39188
2025-05-19 12:32:12 +05:30
Zhao Wei Liang
eb0cf524c0 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:43 +08:00
Zhao Wei Liang
6ba1a3a427 feat(ble): support creating connections during scanning process on ESP32-C5
(cherry picked from commit 9d687daf36)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:04:41 +08:00
Zhao Wei Liang
f9597a06f4 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:04:38 +08:00
Zhao Wei Liang
f056662cd5 fix(ble): fixed occasional assert issue in scan and connection scenarios on ESP32-C6
(cherry picked from commit cd6038b6cf)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:04:36 +08:00
Zhao Wei Liang
e1aee3ff2b 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:04:33 +08:00
Zhao Wei Liang
2e02c26b81 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:04:31 +08:00
Zhao Wei Liang
f5748f3d9b change(ble): [AUTO_MR] Update lib_esp32c5 to 1304a9d0
(cherry picked from commit 27220c1b4c)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-05-19 12:04:28 +08:00
Zhao Wei Liang
8a138cbd22 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:04:26 +08:00
Ashish Sharma
c18e53b672 feat(cjson): update to latest upstream 2025-05-19 09:50:59 +08:00
Ivan Grokhotkov
28ac0243bb Merge branch 'update/v5.5_esp-idf-doc-env-v5.5_ubuntu_24.04' into 'release/v5.5'
Update esp-idf-docs-env-v5.5 image

See merge request espressif/esp-idf!38956
2025-05-17 04:10:33 +08:00
morris
c61f36de13 Merge branch 'refactor/usb_dwc_buff_delay_on_p4_backport_v5.5' into 'release/v5.5'
refactor(hcd_dwc): Apply ls_via_fs_hub delay for all targets (backport to v5.5)

See merge request espressif/esp-idf!39148
2025-05-16 23:04:27 +08:00
Erhan Kurubas
6fdcf9efc1 feat(apptrace): Store CRC16 checksum value of exposed block in the perfmon reg 2025-05-16 11:32:13 +02:00
morris
a652a8473e Merge branch 'fix/usbjtag_after_tinyusb_backport_v5.5' into 'release/v5.5'
fix(usb/phy): Fix ability to switch back to USB/JTAG after uninstalling TinyUSB (backport to v5.5)

See merge request espressif/esp-idf!39127
2025-05-16 17:18:11 +08:00
Konstantin Kondrashov
6f82f332fd fix(log): Fix bin log config available only for log version 2 2025-05-16 09:33:36 +03:00
morris
b095331a51 fix(mcpwm): the wrong pm lock type on esp32 and esp32s3 2025-05-16 10:31:27 +08:00
Sumeet Singh
084dfefd6f fix(nimble): Fix proc rx entry comparison (v5.5) 2025-05-15 19:48:34 +05:30
Samuel Obuch
04d83433c3 ci: fix app_trace_basic rules and test 2025-05-15 14:27:11 +02:00
Samuel Obuch
dd1a331f4f ci: enable gcov example for all chips 2025-05-15 14:27:07 +02:00
Konstantin Kondrashov
0f7b621d47 refactor(partition_table): Refactoring of code style 2025-05-15 13:21:02 +03:00
Konstantin Kondrashov
72ae023a42 fix(partition_table): Ignore UTF-8 BOM bytes in csv file 2025-05-15 13:21:02 +03:00
akshat
84e62daedc fix(wpa_supplicant): Disconnect from previous AP while initiating WPS 2025-05-15 17:55:28 +08:00
akshat
0d5d31b343 fix(wpa_supplicant): Detect PBC overlap even when UUID is null 2025-05-15 17:55:28 +08:00
akshat
05617e458b 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-05-15 17:55:28 +08:00
Alexey Gerenkov
f8284e1733 Merge branch 'freertos_sysview_deadlock_fix_v5.5' into 'release/v5.5'
fix(app_trace): prevent deadlock on sysview start (v5.5)

See merge request espressif/esp-idf!39136
2025-05-15 15:46:11 +08:00
morris
b9e03c3cf4 Merge branch 'bugfix/fix_bitscrambler_rx_mode_init_error_v5.5' into 'release/v5.5'
fix(bitscrambler): fix bitscrambler RX mode initialization error (v5.5)

See merge request espressif/esp-idf!39155
2025-05-15 14:39:39 +08:00
Rahul Tank
4498eea285 Merge branch 'fix/outstanding_packet_race_condition_v5.5' into 'release/v5.5'
fix(nimble): Fixed async race condition with HCI outstanding packets counter (v5.5)

See merge request espressif/esp-idf!39092
2025-05-15 13:43:43 +08:00
Anton Maklakov
af9e528409 docs(jtag): fix esp32p4 usb jtag pins 2025-05-15 12:13:23 +07:00
Dong Heng
d35923141d fix(bitscrambler): fix bitscrambler RX mode initialization error 2025-05-15 12:08:44 +08:00
Sumeet Singh
81f5d899f6 fix(nimble): Fixed async race condition with HCI outstanding packets counter 2025-05-15 09:13:16 +05:30
Rahul Tank
2eac57a1da fix(nimble): Extend support for allow connect during scan for more chips 2025-05-15 09:13:12 +05:30
Rahul Tank
2fd71413f0 fix(nimble): Add support for anonymous address type for whitelist 2025-05-15 09:13:08 +05:30
Rahul Tank
b8badb85d1 fix(nimble): Add configurable option to select ext adv v2 command 2025-05-15 09:13:04 +05:30
Rahul Tank
f8cdf02b55 Merge branch 'feat/gatt_cache_info_v5.5' into 'release/v5.5'
fix(nimble): Added api's to fetch gatt cache info (v5.5)

See merge request espressif/esp-idf!39093
2025-05-14 23:09:29 +08:00
morris
ac12d560a2 Merge branch 'feat/usb_host_move_dma_cap_mem_to_psram_p4_backport_v5.5' into 'release/v5.5'
feat(usb_host): Move DMA capable memory to external ram on P4 (backport v5.5)

See merge request espressif/esp-idf!39065
2025-05-14 22:20:05 +08:00
Roman Leonov
18cd0fa030 refactor(hcd_dwc): Apply ls_via_fs_hub delay for all targets 2025-05-14 13:54:25 +02:00
Peter Macko
269f1d110d change(ci): Update esp-idf-docs-env-v5.5 image
- Add Sphinx warnings caused by [#11323](https://github.com/doxygen/doxygen/issues/11323)
- Update esp-idf-doc-env-v5.5 to use the updated parent image (Ubuntu 24.04 and Node.js 22)
- Exclude sphinx-known-warnings.txt from pre-commit checks
- Fix doxygen warning in components/esp_wifi/include/esp_now.h
2025-05-14 12:31:36 +02:00
Island
f03b0fe0c5 Merge branch 'bugfix/fix_some_ble_bugs_0422_v5.5' into 'release/v5.5'
Bugfix/fix some ble bugs 0422 (v5.5)

See merge request espressif/esp-idf!39073
2025-05-14 17:23:11 +08:00
Samuel Obuch
a0fc3e68a8 fix(sysview): do not use freertos ticks to prevent deadlock 2025-05-14 11:22:13 +02:00
John Boiles
0993f1e67b 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:33 +02:00
Mahavir Jain
45831351fa test: add secure image verification case for C6/H2 2025-05-14 10:53:47 +05:30
Mahavir Jain
37e28522c2 fix: secure OTA without secure boot issue for MMU page size configurable SoCs
For secure app verification during OTA update case, the image was
getting memory mapped twice and hence the failure in verification.

Modified from memory mapped flash read to SPI flash read approach
for the MMU page size from image header.

Regression from 07318a4987

Closes https://github.com/espressif/esp-idf/issues/15936
2025-05-14 10:53:46 +05:30
Astha Verma
8ea6b3170b fix(nimble): Added APIs to fetch GATT cache info and discover included services 2025-05-14 10:26:25 +05:30
Zhang Hai Peng
2de265b3e7 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:14:30 +08:00
Zhang Hai Peng
953fe222ec 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:14:28 +08:00
Zhang Hai Peng
70f19793f8 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:14:25 +08:00
Zhang Hai Peng
0b2f639c62 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:14:23 +08:00
Zhang Hai Peng
a3cb7f4404 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:14:20 +08:00
peter.marcisovsky
b264d7f89b 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 09:46:16 +02:00
morris
14c29c467e Merge branch 'doc/summarize_bs_support_status_v5.5' into 'release/v5.5'
docs(bitscrambler): update documentation with integration details (v5.5)

See merge request espressif/esp-idf!39059
2025-05-13 15:32:16 +08:00
Marius Vikhammer
3b7f4e2341 Merge branch 'fix/esp32c5_eco2_efuse_test_v5.5' into 'release/v5.5'
fix(efuse): Fix ESP32-C5 eFuse test for ECO2 (v5.5)

See merge request espressif/esp-idf!39060
2025-05-13 14:51:21 +08:00
Konstantin Kondrashov
3a6e5dba88 fix(efuse): Fix ESP32-C5 eFuse test for ECO2 2025-05-13 09:16:57 +03:00
morris
27e1a30acc docs(bitscrambler): update documentation with integration details 2025-05-13 13:38:40 +08:00
Jiang Jiang Jian
c0d91e33d0 Merge branch 'maint/release_v5.5_codeowners' into 'release/v5.5'
change(gitlab): simplify approvals for backports (v5.5)

See merge request espressif/esp-idf!39050
2025-05-13 10:33:14 +08:00
Ivan Grokhotkov
a4d0ab04c5 change(gitlab): simplify approvals for backports (v5.5) 2025-05-13 00:05:46 +02:00
1648 changed files with 98532 additions and 65313 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

@@ -2,253 +2,5 @@
#
# https://docs.gitlab.com/ee/user/project/code_owners.html#the-syntax-of-code-owners-files
#
# If more than one rule matches a given file, the latest rule is used.
# The file should be generally kept sorted, except when it is necessary
# to use a different order due to the fact above. In that case, use
# '# sort-order-reset' comment line to reset the sort order.
#
# Recipes for a few common cases:
#
# 1. Specific directory with all its contents:
#
# /components/app_trace/
#
# Note the trailing slash!
#
# 2. File with certain extension in any subdirectory of a certain directory:
#
# /examples/**/*.py
#
# This includes an *.py files in /examples/ directory as well.
#
# 3. Contents of a directory with a certain name, anywhere in the tree:
#
# test_*_host/
#
# Will match everything under components/efuse/test_efuse_host/,
# components/heap/test_multi_heap_host/, components/lwip/test_afl_host/, etc.
#
# 4. Same as above, except limited to a specific place in the tree:
#
# /components/esp32*/
#
# Matches everything under /components/esp32, /components/esp32s2, etc.
# Doesn't match /tools/some-test/components/esp32s5.
#
# 5. Specific file:
#
# /tools/tools.json
#
# 6. File with a certain name anywhere in the tree
#
# .gitignore
#
* @esp-idf-codeowners/other
/.* @esp-idf-codeowners/tools
/.codespellrc @esp-idf-codeowners/ci
/.github/workflows/ @esp-idf-codeowners/ci
/.gitlab-ci.yml @esp-idf-codeowners/ci
/.gitlab/ci/ @esp-idf-codeowners/ci
/.pre-commit-config.yaml @esp-idf-codeowners/ci
/.readthedocs.yml @esp-idf-codeowners/docs
/.vale.ini @esp-idf-codeowners/docs
/CMakeLists.txt @esp-idf-codeowners/build-config
/COMPATIBILITY*.md @esp-idf-codeowners/peripherals
/CONTRIBUTING.md @esp-idf-codeowners/docs
/Kconfig @esp-idf-codeowners/build-config
/README*.md @esp-idf-codeowners/docs
/ROADMAP*.md @esp-idf-codeowners/docs
/SUPPORT_POLICY*.md @esp-idf-codeowners/docs
/add_path.sh @esp-idf-codeowners/tools
/conftest.py @esp-idf-codeowners/ci
/export.* @esp-idf-codeowners/tools
/install.* @esp-idf-codeowners/tools
/pytest.ini @esp-idf-codeowners/ci
/ruff.toml @esp-idf-codeowners/tools
/sdkconfig.rename @esp-idf-codeowners/build-config
/sonar-project.properties @esp-idf-codeowners/ci
# sort-order-reset
/components/app_trace/ @esp-idf-codeowners/debugging
/components/app_update/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/bootloader*/ @esp-idf-codeowners/system @esp-idf-codeowners/security
/components/bootloader_support/bootloader_flash/ @esp-idf-codeowners/peripherals
/components/bt/ @esp-idf-codeowners/bluetooth
/components/cmock/ @esp-idf-codeowners/system
/components/console/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities/console
/components/cxx/ @esp-idf-codeowners/system
/components/driver/ @esp-idf-codeowners/peripherals
/components/efuse/ @esp-idf-codeowners/system
/components/esp_adc/ @esp-idf-codeowners/peripherals
/components/esp_app_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/esp_bootloader_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/esp_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154
/components/esp_common/ @esp-idf-codeowners/system
/components/esp_driver_*/ @esp-idf-codeowners/peripherals
/components/esp_driver_sdmmc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/storage
/components/esp_eth/ @esp-idf-codeowners/network
/components/esp_event/ @esp-idf-codeowners/system
/components/esp_gdbstub/ @esp-idf-codeowners/debugging
/components/esp_hid/ @esp-idf-codeowners/bluetooth
/components/esp_http_client/ @esp-idf-codeowners/app-utilities
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
/components/esp_https_ota/ @esp-idf-codeowners/app-utilities
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
/components/esp_hw_support/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals
/components/esp_hw_support/lowpower/ @esp-idf-codeowners/power-management
/components/esp_lcd/ @esp-idf-codeowners/peripherals
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
/components/esp_mm/ @esp-idf-codeowners/peripherals
/components/esp_netif/ @esp-idf-codeowners/network
/components/esp_netif_stack/ @esp-idf-codeowners/network
/components/esp_partition/ @esp-idf-codeowners/storage
/components/esp_phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/components/esp_pm/ @esp-idf-codeowners/power-management @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/system
/components/esp_psram/ @esp-idf-codeowners/peripherals
/components/esp_psram/system_layer/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/esp_ringbuf/ @esp-idf-codeowners/system
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
/components/esp_security/ @esp-idf-codeowners/security
/components/esp_system/ @esp-idf-codeowners/system
/components/esp_tee/ @esp-idf-codeowners/security
/components/esp_timer/ @esp-idf-codeowners/system
/components/esp-tls/ @esp-idf-codeowners/app-utilities
/components/esp_vfs_*/ @esp-idf-codeowners/storage
/components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
/components/esp_wifi/ @esp-idf-codeowners/wifi
/components/espcoredump/ @esp-idf-codeowners/debugging
/components/esptool_py/ @esp-idf-codeowners/tools
/components/fatfs/ @esp-idf-codeowners/storage
/components/freertos/ @esp-idf-codeowners/system
/components/hal/ @esp-idf-codeowners/peripherals
/components/hal/test_apps/crypto/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/security
/components/heap/ @esp-idf-codeowners/system
/components/http_parser/ @esp-idf-codeowners/app-utilities
/components/idf_test/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/ieee802154/ @esp-idf-codeowners/ieee802154
/components/json/ @esp-idf-codeowners/app-utilities
/components/linux/ @esp-idf-codeowners/system
/components/log/ @esp-idf-codeowners/system
/components/lwip/ @esp-idf-codeowners/lwip
/components/mbedtls/ @esp-idf-codeowners/app-utilities/mbedtls @esp-idf-codeowners/security
/components/mqtt/ @esp-idf-codeowners/network
/components/newlib/ @esp-idf-codeowners/system @esp-idf-codeowners/toolchain
/components/nvs_flash/ @esp-idf-codeowners/storage
/components/nvs_sec_provider/ @esp-idf-codeowners/storage @esp-idf-codeowners/security
/components/openthread/ @esp-idf-codeowners/ieee802154
/components/partition_table/ @esp-idf-codeowners/system
/components/perfmon/ @esp-idf-codeowners/debugging
/components/protobuf-c/ @esp-idf-codeowners/app-utilities
/components/protocomm/ @esp-idf-codeowners/app-utilities/provisioning
/components/pthread/ @esp-idf-codeowners/system
/components/riscv/ @esp-idf-codeowners/system
/components/rt/ @esp-idf-codeowners/system
/components/sdmmc/ @esp-idf-codeowners/storage
/components/soc/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/spi_flash/ @esp-idf-codeowners/peripherals
/components/spiffs/ @esp-idf-codeowners/storage
/components/tcp_transport/ @esp-idf-codeowners/network
/components/touch_element/ @esp-idf-codeowners/peripherals
/components/ulp/ @esp-idf-codeowners/system
/components/unity/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/usb/ @esp-idf-codeowners/peripherals/usb
/components/vfs/ @esp-idf-codeowners/storage
/components/wear_levelling/ @esp-idf-codeowners/storage
/components/wifi_provisioning/ @esp-idf-codeowners/app-utilities/provisioning
/components/wpa_supplicant/ @esp-idf-codeowners/wifi @esp-idf-codeowners/app-utilities/mbedtls
/components/xtensa/ @esp-idf-codeowners/system
/docs/ @esp-idf-codeowners/docs
/docs/docs_not_updated/ @esp-idf-codeowners/all-maintainers
/docs/**/api-guides/tools/ @esp-idf-codeowners/tools
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
/docs/**/api-guides/wifi* @esp-idf-codeowners/wifi
/docs/**/api-guides/esp-wifi-mesh.rst @esp-idf-codeowners/wifi
/docs/en/api-guides/jtag-debugging/ @esp-idf-codeowners/debugging
/docs/**/api-reference/bluetooth/ @esp-idf-codeowners/bluetooth
/docs/**/api-reference/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
/docs/**/api-reference/peripherals/ @esp-idf-codeowners/peripherals
/docs/**/api-reference/peripherals/usb* @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
/docs/**/api-reference/peripherals/usb*/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
/docs/**/api-reference/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/docs/**/api-reference/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
/docs/**/api-reference/storage/ @esp-idf-codeowners/storage
/docs/**/api-reference/system/ @esp-idf-codeowners/system
/docs/**/security/ @esp-idf-codeowners/security
/docs/**/migration-guides/ @esp-idf-codeowners/docs @esp-idf-codeowners/all-maintainers
/docs/**/contribute/install-pre-commit-hook.rst @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/examples/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
/examples/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/examples/bluetooth/ @esp-idf-codeowners/bluetooth
/examples/build_system/ @esp-idf-codeowners/build-config
/examples/common_components/ @esp-idf-codeowners/system @esp-idf-codeowners/wifi @esp-idf-codeowners/lwip @esp-idf-codeowners/network
/examples/custom_bootloader/ @esp-idf-codeowners/system
/examples/cxx/ @esp-idf-codeowners/system
/examples/ethernet/ @esp-idf-codeowners/network
/examples/get-started/ @esp-idf-codeowners/system
/examples/ieee802154/ @esp-idf-codeowners/ieee802154
/examples/lowpower/ @esp-idf-codeowners/power-management @esp-idf-codeowners/system
/examples/mesh/ @esp-idf-codeowners/wifi
/examples/network/ @esp-idf-codeowners/network @esp-idf-codeowners/wifi
/examples/openthread/ @esp-idf-codeowners/ieee802154
/examples/peripherals/ @esp-idf-codeowners/peripherals
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
/examples/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/examples/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
/examples/security/ @esp-idf-codeowners/security
/examples/storage/ @esp-idf-codeowners/storage
/examples/system/ @esp-idf-codeowners/system
/examples/system/ota/ @esp-idf-codeowners/app-utilities
/examples/wifi/ @esp-idf-codeowners/wifi
/examples/zigbee/ @esp-idf-codeowners/ieee802154
/tools/ @esp-idf-codeowners/tools
/tools/ble/ @esp-idf-codeowners/app-utilities
/tools/bt/ @esp-idf-codeowners/bluetooth
/tools/catch/ @esp-idf-codeowners/ci
/tools/ci/ @esp-idf-codeowners/ci
/tools/cmake/ @esp-idf-codeowners/build-config
/tools/cmake/toolchain-*.cmake @esp-idf-codeowners/toolchain
/tools/esp_app_trace/ @esp-idf-codeowners/debugging
/tools/esp_prov/ @esp-idf-codeowners/app-utilities
/tools/gdb_panic_server.py @esp-idf-codeowners/debugging
/tools/kconfig*/ @esp-idf-codeowners/build-config
/tools/ldgen/ @esp-idf-codeowners/build-config
/tools/mass_mfg/ @esp-idf-codeowners/app-utilities
/tools/mocks/ @esp-idf-codeowners/system
/tools/test_apps/ @esp-idf-codeowners/ci
/tools/test_apps/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
## Note: owners here should be the same as the owners for the same example subdir, above
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
/tools/test_apps/configs/ @esp-idf-codeowners/system
/tools/test_apps/linux_compatible/ @esp-idf-codeowners/system
/tools/test_apps/peripherals/ @esp-idf-codeowners/peripherals
/tools/test_apps/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/tools/test_apps/security/ @esp-idf-codeowners/security
/tools/test_apps/storage/ @esp-idf-codeowners/storage
/tools/test_apps/system/ @esp-idf-codeowners/system
/tools/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/tools/test_build_system/ @esp-idf-codeowners/tools @esp-idf-codeowners/build-config
/tools/tools.json @esp-idf-codeowners/tools @esp-idf-codeowners/toolchain @esp-idf-codeowners/debugging
/tools/unit-test-app/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
# sort-order-reset
/components/**/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
# ignore lists
/tools/ci/check_copyright_config.yaml @esp-idf-codeowners/all-maintainers
/tools/ci/check_copyright_ignore.txt @esp-idf-codeowners/all-maintainers
/tools/ci/mypy_ignore_list.txt @esp-idf-codeowners/tools
* @esp-idf-codeowners/all-maintainers

View File

@@ -237,7 +237,7 @@ pytest_build_system_macos:
PYENV_VERSION: "3.9"
# 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

@@ -40,7 +40,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.5-dev
LATEST_GIT_TAG: v5.5.1
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
# by default we will fetch all submodules
@@ -56,7 +56,7 @@ variables:
# Docker images
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v5.5:3"
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.5:2-1"
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v5.5:3-1"
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v5.5:2"
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
@@ -191,13 +191,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

@@ -113,7 +113,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

View File

@@ -165,6 +165,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
- python tools/ci/ci_process_description.py
- cat pipeline.env
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report

View File

@@ -18,6 +18,8 @@
after_script: []
test_cli_installer_win:
rules:
- when: never
extends:
- .host_test_win_template
- .rules:labels:windows_pytest_build_system
@@ -30,9 +32,11 @@ test_cli_installer_win:
variables:
IDF_PATH: "$CI_PROJECT_DIR"
timeout: 3h
allow_failure: true
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

@@ -51,7 +51,8 @@ repos:
.*.pb-c.c|
.*.yuv|
.*.rgb|
.*COPYING.*
.*COPYING.*|
docs/sphinx-known-warnings\.txt
)$
- id: end-of-file-fixer
exclude: *whitespace_excludes
@@ -69,6 +70,7 @@ repos:
rev: v2.3.0
hooks:
- id: codespell
exclude: ^docs/sphinx-known-warnings\.txt$
- repo: local
hooks:
- id: check-executables

View File

@@ -15,18 +15,18 @@ ESP-IDF is the development framework for Espressif SoCs supported on Windows, Li
The following table shows ESP-IDF support of Espressif SoCs where ![alt text][preview] and ![alt text][supported] denote preview status and support, respectively. The preview support is usually limited in time and intended for beta versions of chips. Please use an ESP-IDF release where the desired SoC is already supported.
|Chip | v5.0 | v5.1 | v5.2 | v5.3 | v5.4 | |
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------- |
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|ESP32-P4 | | | | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|ESP32-C61 | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/products/socs/esp32-c61) |
|Chip | v5.1 | v5.2 | v5.3 | v5.4 | v5.5 | |
|:----------- |:--------------------: | :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------- |
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|ESP32-C6 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|ESP32-H2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|ESP32-P4 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|ESP32-C5 | | | | |![alt text][supported] |since v5.5.1, [Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|ESP32-C61 | | | | |![alt text][supported] |since v5.5.1, [Announcement](https://www.espressif.com/en/products/socs/esp32-c61) |
[supported]: https://img.shields.io/badge/-supported-green "supported"
[preview]: https://img.shields.io/badge/-preview-orange "preview"

View File

@@ -15,18 +15,19 @@ ESP-IDF 是乐鑫官方推出的物联网开发框架,支持 Windows、Linux
下表总结了乐鑫芯片在 ESP-IDF 各版本中的支持状态,其中 ![alt text][supported] 代表已支持,![alt text][preview] 代表目前处于预览支持状态。预览支持状态通常有时间限制,而且仅适用于测试版芯片。请确保使用与芯片相匹配的 ESP-IDF 版本。
|芯片 | v5.0 | v5.1 | v5.2 | v5.3 | v5.4 | |
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------: | :------------------------------------------------------------------------ |
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|ESP32-P4 | | | | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|ESP32-C61 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/products/socs/esp32-c61) |
芯片 | v5.1 | v5.2 | v5.3 | v5.4 | v5.5 | |
|:----------- | :--------------------: | :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------------ |
|ESP32 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | |
|ESP32-S2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|ESP32-C2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|ESP32-C6 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|ESP32-H2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|ESP32-P4 | | | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|ESP32-C5 | | | | |![alt text][supported] | 自 v5.5.1 开始,[芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|ESP32-C61 | | | | |![alt text][supported] | 自 v5.5.1 开始,[芯片发布公告](https://www.espressif.com/zh-hans/products/socs/esp32-c61) |
[supported]: https://img.shields.io/badge/-%E6%94%AF%E6%8C%81-green "supported"
[preview]: https://img.shields.io/badge/-%E9%A2%84%E8%A7%88-orange "preview"

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

@@ -50,7 +50,7 @@ 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);
@@ -353,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

@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2017-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2017-2025 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
@@ -65,6 +65,7 @@ Revision: $Rev: 7745 $
#include "esp_app_trace.h"
#include "esp_app_trace_util.h"
#include "esp_intr_alloc.h"
#include "esp_clk_tree.h"
#include "esp_cpu.h"
#include "soc/soc.h"
#include "soc/interrupts.h"
@@ -84,11 +85,7 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
// The target device name
#define SYSVIEW_DEVICE_NAME CONFIG_IDF_TARGET
// The target core name
#if CONFIG_IDF_TARGET_ARCH_XTENSA
#define SYSVIEW_CORE_NAME "xtensa"
#elif CONFIG_IDF_TARGET_ARCH_RISCV
#define SYSVIEW_CORE_NAME "riscv"
#endif
#define SYSVIEW_CORE_NAME "core0" // In dual core, this will be renamed by OpenOCD as core1
// Determine which timer to use as timestamp source
#if CONFIG_APPTRACE_SV_TS_SOURCE_CCOUNT
@@ -105,9 +102,6 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
// Timer group timer divisor
#define SYSVIEW_TIMER_DIV 2
// Frequency of the timestamp, using APB as GPTimer source clock
#define SYSVIEW_TIMESTAMP_FREQ (esp_clk_apb_freq() / SYSVIEW_TIMER_DIV)
// GPTimer handle
gptimer_handle_t s_sv_gptimer;
@@ -177,30 +171,38 @@ static void _cbSendSystemDesc(void) {
*
**********************************************************************
*/
static void SEGGER_SYSVIEW_TS_Init(void)
static int SEGGER_SYSVIEW_TS_Init(void)
{
/* We only need to initialize something if we use Timer Group.
* esp_timer and ccount can be used as is.
*/
#if TS_USE_TIMERGROUP
// get clock source frequency
uint32_t counter_src_hz = 0;
ESP_ERROR_CHECK(esp_clk_tree_src_get_freq_hz(
(soc_module_clk_t)GPTIMER_CLK_SRC_DEFAULT,
ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED, &counter_src_hz));
gptimer_config_t config = {
.clk_src = GPTIMER_CLK_SRC_DEFAULT,
.direction = GPTIMER_COUNT_UP,
.resolution_hz = SYSVIEW_TIMESTAMP_FREQ,
.resolution_hz = counter_src_hz / SYSVIEW_TIMER_DIV,
};
// pick any free GPTimer instance
ESP_ERROR_CHECK(gptimer_new_timer(&config, &s_sv_gptimer));
/* Start counting */
gptimer_enable(s_sv_gptimer);
gptimer_start(s_sv_gptimer);
return config.resolution_hz;
#else
return SYSVIEW_TIMESTAMP_FREQ;
#endif // TS_USE_TIMERGROUP
}
void SEGGER_SYSVIEW_Conf(void) {
U32 disable_evts = 0;
SEGGER_SYSVIEW_TS_Init();
SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ,
int timestamp_freq = SEGGER_SYSVIEW_TS_Init();
SEGGER_SYSVIEW_Init(timestamp_freq, SYSVIEW_CPU_FREQ,
&SYSVIEW_X_OS_TraceAPI, _cbSendSystemDesc);
SEGGER_SYSVIEW_SetRAMBase(SYSVIEW_RAM_BASE);

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

@@ -7,6 +7,7 @@ components/app_update/test_apps:
- if: CONFIG_NAME == "xip_psram" and SOC_SPIRAM_XIP_SUPPORTED == 1
# S2 doesn't have ROM for flash
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and (SOC_SPIRAM_XIP_SUPPORTED == 1 and IDF_TARGET != "esp32s2")
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1
disable:
- if: IDF_TARGET in ["esp32h21", "esp32h4"]
temporary: true
@@ -14,3 +15,7 @@ components/app_update/test_apps:
- if: IDF_TARGET == "esp32c61" and CONFIG_NAME == "xip_psram_with_rom_impl"
temporary: true
reason: not supported yet # TODO: [ESP32C61] IDF-12784
disable_test:
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1 and IDF_TARGET == "esp32c61"
temporary: true
reason: lack of runners # TODO: [ESP32C61] IDF-13165

View File

@@ -1,4 +1,15 @@
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash esp_psram
WHOLE_ARCHIVE)
idf_component_register(
SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES
cmock
test_utils
app_update
bootloader_support
nvs_flash
driver
spi_flash
esp_psram
efuse
WHOLE_ARCHIVE
)

View File

@@ -0,0 +1,87 @@
/*
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Tests bootloader update.
*/
#include "unity.h"
#include "esp_log.h"
#include "esp_efuse.h"
#include "esp_flash_internal.h"
#include "esp_rom_sys.h"
#include "utils_update.h"
#include "sdkconfig.h"
#define BOOT_COUNT_NAMESPACE "boot_count"
static __attribute__((unused)) const char *TAG = "btldr_update";
#if CONFIG_BOOTLOADER_RECOVERY_ENABLE
/* @brief Checks and prepares the partition so that the factory app is launched after that.
*/
static void start_test(void)
{
ESP_LOGI(TAG, "boot count 1 - reset");
set_boot_count_in_nvs(1);
erase_ota_data();
ESP_LOGI(TAG, "ota_data erased");
ESP_LOGI(TAG, "Bootloader offset: 0x%x", esp_rom_get_bootloader_offset());
reboot_as_deep_sleep();
}
static void test_flow1(void)
{
uint8_t boot_count = get_boot_count_from_nvs();
boot_count++;
set_boot_count_in_nvs(boot_count);
ESP_LOGI(TAG, "boot count %d", boot_count);
ESP_LOGI(TAG, "Bootloader offset: 0x%x", esp_rom_get_bootloader_offset());
const esp_partition_t *primary_bootloader;
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_BOOTLOADER_OFFSET, ESP_BOOTLOADER_SIZE, "PrimaryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_PRIMARY, &primary_bootloader));
const esp_partition_t *recovery_bootloader;
TEST_ESP_OK(esp_partition_register_external(NULL, CONFIG_BOOTLOADER_RECOVERY_OFFSET, ESP_BOOTLOADER_SIZE, "RecoveryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_RECOVERY, &recovery_bootloader));
ESP_LOGI(TAG, "Bootloaders are registered");
// Remove write protection for the bootloader
esp_flash_set_dangerous_write_protection(esp_flash_default_chip, false);
switch (boot_count) {
case 2:
TEST_ASSERT_EQUAL_HEX32(ESP_PRIMARY_BOOTLOADER_OFFSET, esp_rom_get_bootloader_offset());
TEST_ESP_OK(esp_partition_erase_range(recovery_bootloader, 0, recovery_bootloader->size));
ESP_LOGI(TAG, "Erase recovery bootloader");
TEST_ESP_OK(esp_efuse_set_recovery_bootloader_offset(CONFIG_BOOTLOADER_RECOVERY_OFFSET));
ESP_LOGI(TAG, "Backup, copy <%s> -> <%s>", primary_bootloader->label, recovery_bootloader->label);
TEST_ESP_OK(esp_partition_copy(recovery_bootloader, 0, primary_bootloader, 0, primary_bootloader->size));
TEST_ESP_OK(esp_partition_erase_range(primary_bootloader, 0, primary_bootloader->size));
ESP_LOGI(TAG, "Erase primary bootloader");
reboot_as_deep_sleep();
break;
case 3:
TEST_ASSERT_EQUAL_HEX32(CONFIG_BOOTLOADER_RECOVERY_OFFSET, esp_rom_get_bootloader_offset());
ESP_LOGI(TAG, "Return to primary bootloader...");
ESP_LOGI(TAG, "Copy <%s> -> <%s>", recovery_bootloader->label, primary_bootloader->label);
TEST_ESP_OK(esp_partition_copy(primary_bootloader, 0, recovery_bootloader, 0, primary_bootloader->size));
TEST_ESP_OK(esp_partition_erase_range(recovery_bootloader, 0, recovery_bootloader->size));
ESP_LOGI(TAG, "Erase recovery bootloader");
break;
default:
TEST_FAIL_MESSAGE("Unexpected stage");
break;
}
}
TEST_CASE_MULTIPLE_STAGES("Recovery bootloader feature", "[recovery_bootloader][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET]", start_test, test_flow1, test_flow1);
#endif // CONFIG_BOOTLOADER_RECOVERY_ENABLE

View File

@@ -7,315 +7,16 @@
* Tests for switching between partitions: factory, OTAx, test.
*/
#include <esp_types.h>
#include <stdio.h>
#include "string.h"
#include <inttypes.h>
#include "sdkconfig.h"
#include "esp_rom_spiflash.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "unity.h"
#include "esp_system.h"
#include "bootloader_common.h"
#include "../bootloader_flash/include/bootloader_flash_priv.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_ota_ops.h"
#include "esp_partition.h"
#include "esp_flash_partitions.h"
#include "esp_image_format.h"
#include "nvs_flash.h"
#include "driver/gpio.h"
#include "esp_sleep.h"
#include "test_utils.h"
#define BOOT_COUNT_NAMESPACE "boot_count"
#include "unity.h"
#include "utils_update.h"
#include "sdkconfig.h"
static const char *TAG = "ota_test";
static void set_boot_count_in_nvs(uint8_t boot_count)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle);
if (err != ESP_OK) {
TEST_ESP_OK(nvs_flash_erase());
TEST_ESP_OK(nvs_flash_init());
TEST_ESP_OK(nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle));
}
TEST_ESP_OK(nvs_set_u8(boot_count_handle, "boot_count", boot_count));
TEST_ESP_OK(nvs_commit(boot_count_handle));
nvs_close(boot_count_handle);
}
static uint8_t get_boot_count_from_nvs(void)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READONLY, &boot_count_handle);
if (err == ESP_ERR_NVS_NOT_FOUND) {
set_boot_count_in_nvs(0);
}
uint8_t boot_count;
TEST_ESP_OK(nvs_get_u8(boot_count_handle, "boot_count", &boot_count));
nvs_close(boot_count_handle);
return boot_count;
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
static void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
esp_partition_mmap_handle_t data_map;
ESP_LOGI(TAG, "start the copy process");
TEST_ESP_OK(esp_partition_mmap(curr_app, 0, curr_app->size, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
esp_partition_munmap(data_map);
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
static void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
esp_partition_mmap_handle_t data_map;
ESP_LOGI(TAG, "start the copy process");
uint32_t offset = 0, bytes_to_write = curr_app->size;
uint32_t write_bytes;
while (bytes_to_write > 0) {
write_bytes = (bytes_to_write > (4 * 1024)) ? (4 * 1024) : bytes_to_write;
TEST_ESP_OK(esp_partition_mmap(curr_app, offset, write_bytes, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write_with_offset(update_handle, (const void *)partition_bin, write_bytes, offset));
esp_partition_munmap(data_map);
bytes_to_write -= write_bytes;
offset += write_bytes;
}
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Get the next partition of OTA for the update.
*
* @return The next partition of OTA(OTA0-15).
*/
static const esp_partition_t * get_next_update_partition(void)
{
const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, update_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address);
return update_partition;
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
static void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
static void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition_with_offset(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Erase otadata partition
*/
static void erase_ota_data(void)
{
const esp_partition_t *data_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, data_partition);
TEST_ESP_OK(esp_partition_erase_range(data_partition, 0, 2 * data_partition->erase_size));
}
/* @brief Reboots ESP using mode deep sleep. This mode guaranty that RTC_DATA_ATTR variables is not reset.
*/
static void reboot_as_deep_sleep(void)
{
ESP_LOGI(TAG, "reboot as deep sleep");
esp_deep_sleep(20000);
TEST_FAIL_MESSAGE("Should never be reachable except when sleep is rejected, abort");
}
/* @brief Copies a current app to next partition (OTA0-15), after that ESP is rebooting and run this (the next) OTAx.
*/
static void copy_current_app_to_next_part_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Copies a current app to next partition (OTA0-15) using esp_ota_write_with_offest(), after that ESP is rebooting and run this (the next) OTAx.
*/
static void copy_current_app_to_next_part_with_offset_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part_with_offset(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Get running app.
*
* @return The next partition of OTA(OTA0-15).
*/
static const esp_partition_t* get_running_firmware(void)
{
const esp_partition_t *configured = esp_ota_get_boot_partition();
const esp_partition_t *running = esp_ota_get_running_partition();
ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")",
running->type, running->subtype, running->address);
ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")",
configured->type, configured->subtype, configured->address);
TEST_ASSERT_NOT_EQUAL(NULL, configured);
TEST_ASSERT_NOT_EQUAL(NULL, running);
if (running->subtype != ESP_PARTITION_SUBTYPE_APP_TEST) {
TEST_ASSERT_EQUAL_PTR(running, configured);
}
return running;
}
// type of a corrupt ota_data
typedef enum {
CORR_CRC_1_SECTOR_OTA_DATA = (1 << 0), /*!< Corrupt CRC only 1 sector of ota_data */
CORR_CRC_2_SECTOR_OTA_DATA = (1 << 1), /*!< Corrupt CRC only 2 sector of ota_data */
} corrupt_ota_data_t;
/* @brief Get two copies ota_data from otadata partition.
*
* @param[in] otadata_partition - otadata partition.
* @param[out] ota_data_0 - First copy from otadata_partition.
* @param[out] ota_data_1 - Second copy from otadata_partition.
*/
static void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1)
{
uint32_t offset = otadata_partition->address;
uint32_t size = otadata_partition->size;
if (offset != 0) {
const esp_ota_select_entry_t *ota_select_map;
ota_select_map = bootloader_mmap(offset, size);
TEST_ASSERT_NOT_EQUAL(NULL, ota_select_map);
memcpy(ota_data_0, ota_select_map, sizeof(esp_ota_select_entry_t));
memcpy(ota_data_1, (uint8_t *)ota_select_map + otadata_partition->erase_size, sizeof(esp_ota_select_entry_t));
bootloader_munmap(ota_select_map);
}
}
/* @brief Writes a ota_data into required sector of otadata_partition.
*
* @param[in] otadata_partition - Partition information otadata.
* @param[in] ota_data - otadata structure.
* @param[in] sec_id - Sector number 0 or 1.
*/
static void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id)
{
esp_partition_write(otadata_partition, otadata_partition->erase_size * sec_id, &ota_data[sec_id], sizeof(esp_ota_select_entry_t));
}
/* @brief Makes a corrupt of ota_data.
* @param[in] err - type error
*/
static void corrupt_ota_data(corrupt_ota_data_t err)
{
esp_ota_select_entry_t ota_data[2];
const esp_partition_t *otadata_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, otadata_partition);
get_ota_data(otadata_partition, &ota_data[0], &ota_data[1]);
if (err & CORR_CRC_1_SECTOR_OTA_DATA) {
ota_data[0].crc = 0;
}
if (err & CORR_CRC_2_SECTOR_OTA_DATA) {
ota_data[1].crc = 0;
}
TEST_ESP_OK(esp_partition_erase_range(otadata_partition, 0, otadata_partition->size));
write_ota_data(otadata_partition, &ota_data[0], 0);
write_ota_data(otadata_partition, &ota_data[1], 1);
}
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
/* @brief Sets the pin number to output and sets output level as low. After reboot (deep sleep) this pin keep the same level.
*
* The output level of the pad will be force locked and can not be changed.
* Power down or call gpio_hold_dis will disable this function.
*
* @param[in] num_pin - Pin number
*/
static void set_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
gpio_config_t io_conf;
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << num_pin);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
TEST_ESP_OK(gpio_config(&io_conf));
TEST_ESP_OK(gpio_set_level(num_pin, 0));
TEST_ESP_OK(gpio_hold_en(num_pin));
}
/* @brief Unset the pin number hold function.
*/
static void reset_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
TEST_ESP_OK(gpio_reset_pin(num_pin));
}
#endif
static void mark_app_valid(void)
{
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
#endif
}
/* @brief Checks and prepares the partition so that the factory app is launched after that.
*/
static void start_test(void)
@@ -546,20 +247,6 @@ static void test_flow5(void)
TEST_CASE_MULTIPLE_STAGES("Switching between factory, test, factory", "[app_update][timeout=90][reset=SW_CPU_RESET, SW_CPU_RESET, DEEPSLEEP_RESET]", start_test, test_flow5, test_flow5, test_flow5);
#endif
static const esp_partition_t* app_update(void)
{
const esp_partition_t *cur_app = get_running_firmware();
const esp_partition_t* update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_NULL(update_partition);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(update_partition));
return update_partition;
}
static void test_rollback1(void)
{
uint8_t boot_count = get_boot_count_from_nvs();

View File

@@ -0,0 +1,307 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_rom_spiflash.h"
#include "driver/gpio.h"
#include "nvs_flash.h"
#include "esp_partition.h"
#include "esp_flash_partitions.h"
#include "esp_image_format.h"
#include "../bootloader_flash/include/bootloader_flash_priv.h"
#include "esp_sleep.h"
#include "esp_ota_ops.h"
#include "esp_err.h"
#include "esp_log.h"
#include "test_utils.h"
#include "utils_update.h"
#include "unity.h"
#include "sdkconfig.h"
#define BOOT_COUNT_NAMESPACE "boot_count"
static const char *TAG = "ota_test";
void set_boot_count_in_nvs(uint8_t boot_count)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle);
if (err != ESP_OK) {
TEST_ESP_OK(nvs_flash_erase());
TEST_ESP_OK(nvs_flash_init());
TEST_ESP_OK(nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle));
}
TEST_ESP_OK(nvs_set_u8(boot_count_handle, "boot_count", boot_count));
TEST_ESP_OK(nvs_commit(boot_count_handle));
nvs_close(boot_count_handle);
}
uint8_t get_boot_count_from_nvs(void)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READONLY, &boot_count_handle);
if (err == ESP_ERR_NVS_NOT_FOUND) {
set_boot_count_in_nvs(0);
}
uint8_t boot_count;
TEST_ESP_OK(nvs_get_u8(boot_count_handle, "boot_count", &boot_count));
nvs_close(boot_count_handle);
return boot_count;
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
esp_partition_mmap_handle_t data_map;
ESP_LOGI(TAG, "start the copy process");
TEST_ESP_OK(esp_partition_mmap(curr_app, 0, curr_app->size, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
esp_partition_munmap(data_map);
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
esp_partition_mmap_handle_t data_map;
ESP_LOGI(TAG, "start the copy process");
uint32_t offset = 0, bytes_to_write = curr_app->size;
uint32_t write_bytes;
while (bytes_to_write > 0) {
write_bytes = (bytes_to_write > (4 * 1024)) ? (4 * 1024) : bytes_to_write;
TEST_ESP_OK(esp_partition_mmap(curr_app, offset, write_bytes, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write_with_offset(update_handle, (const void *)partition_bin, write_bytes, offset));
esp_partition_munmap(data_map);
bytes_to_write -= write_bytes;
offset += write_bytes;
}
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Get the next partition of OTA for the update.
*
* @return The next partition of OTA(OTA0-15).
*/
const esp_partition_t * get_next_update_partition(void)
{
const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, update_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address);
return update_partition;
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition_with_offset(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Erase otadata partition
*/
void erase_ota_data(void)
{
const esp_partition_t *data_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, data_partition);
TEST_ESP_OK(esp_partition_erase_range(data_partition, 0, 2 * data_partition->erase_size));
}
/* @brief Reboots ESP using mode deep sleep. This mode guaranty that RTC_DATA_ATTR variables is not reset.
*/
void reboot_as_deep_sleep(void)
{
ESP_LOGI(TAG, "reboot as deep sleep");
esp_deep_sleep(20000);
TEST_FAIL_MESSAGE("Should never be reachable except when sleep is rejected, abort");
}
/* @brief Copies a current app to next partition (OTA0-15), after that ESP is rebooting and run this (the next) OTAx.
*/
void copy_current_app_to_next_part_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Copies a current app to next partition (OTA0-15) using esp_ota_write_with_offest(), after that ESP is rebooting and run this (the next) OTAx.
*/
void copy_current_app_to_next_part_with_offset_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part_with_offset(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Get running app.
*
* @return The next partition of OTA(OTA0-15).
*/
const esp_partition_t* get_running_firmware(void)
{
const esp_partition_t *configured = esp_ota_get_boot_partition();
const esp_partition_t *running = esp_ota_get_running_partition();
// If a reboot hasn't occurred after app_update(), the configured and running partitions may differ
ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")",
running->type, running->subtype, running->address);
ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")",
configured->type, configured->subtype, configured->address);
TEST_ASSERT_NOT_EQUAL(NULL, configured);
TEST_ASSERT_NOT_EQUAL(NULL, running);
return running;
}
/* @brief Get two copies ota_data from otadata partition.
*
* @param[in] otadata_partition - otadata partition.
* @param[out] ota_data_0 - First copy from otadata_partition.
* @param[out] ota_data_1 - Second copy from otadata_partition.
*/
void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1)
{
uint32_t offset = otadata_partition->address;
uint32_t size = otadata_partition->size;
if (offset != 0) {
const esp_ota_select_entry_t *ota_select_map;
ota_select_map = bootloader_mmap(offset, size);
TEST_ASSERT_NOT_EQUAL(NULL, ota_select_map);
memcpy(ota_data_0, ota_select_map, sizeof(esp_ota_select_entry_t));
memcpy(ota_data_1, (uint8_t *)ota_select_map + otadata_partition->erase_size, sizeof(esp_ota_select_entry_t));
bootloader_munmap(ota_select_map);
}
}
/* @brief Writes a ota_data into required sector of otadata_partition.
*
* @param[in] otadata_partition - Partition information otadata.
* @param[in] ota_data - otadata structure.
* @param[in] sec_id - Sector number 0 or 1.
*/
void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id)
{
esp_partition_write(otadata_partition, otadata_partition->erase_size * sec_id, &ota_data[sec_id], sizeof(esp_ota_select_entry_t));
}
/* @brief Makes a corrupt of ota_data.
* @param[in] err - type error
*/
void corrupt_ota_data(corrupt_ota_data_t err)
{
esp_ota_select_entry_t ota_data[2];
const esp_partition_t *otadata_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, otadata_partition);
get_ota_data(otadata_partition, &ota_data[0], &ota_data[1]);
if (err & CORR_CRC_1_SECTOR_OTA_DATA) {
ota_data[0].crc = 0;
}
if (err & CORR_CRC_2_SECTOR_OTA_DATA) {
ota_data[1].crc = 0;
}
TEST_ESP_OK(esp_partition_erase_range(otadata_partition, 0, otadata_partition->size));
write_ota_data(otadata_partition, &ota_data[0], 0);
write_ota_data(otadata_partition, &ota_data[1], 1);
}
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
/* @brief Sets the pin number to output and sets output level as low. After reboot (deep sleep) this pin keep the same level.
*
* The output level of the pad will be force locked and can not be changed.
* Power down or call gpio_hold_dis will disable this function.
*
* @param[in] num_pin - Pin number
*/
void set_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
gpio_config_t io_conf;
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << num_pin);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
TEST_ESP_OK(gpio_config(&io_conf));
TEST_ESP_OK(gpio_set_level(num_pin, 0));
TEST_ESP_OK(gpio_hold_en(num_pin));
}
/* @brief Unset the pin number hold function.
*/
void reset_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
TEST_ESP_OK(gpio_reset_pin(num_pin));
}
#endif
void mark_app_valid(void)
{
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
#endif
}
const esp_partition_t* app_update(void)
{
const esp_partition_t *cur_app = get_running_firmware();
const esp_partition_t* update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_NULL(update_partition);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(update_partition));
return update_partition;
}

View File

@@ -0,0 +1,148 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "esp_ota_ops.h"
#include "esp_partition.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
* @brief Enumeration for specifying which OTA data sectors' CRCs to corrupt.
*/
typedef enum {
CORR_CRC_1_SECTOR_OTA_DATA = (1 << 0), /*!< Corrupt CRC only 1 sector of ota_data */
CORR_CRC_2_SECTOR_OTA_DATA = (1 << 1), /*!< Corrupt CRC only 2 sector of ota_data */
} corrupt_ota_data_t;
/**
* @brief Set boot count value in NVS.
* @param boot_count Value to set.
*/
void set_boot_count_in_nvs(uint8_t boot_count);
/**
* @brief Get boot count value from NVS.
* @return Boot count value.
*/
uint8_t get_boot_count_from_nvs(void);
/**
* @brief Copy current app to next partition using OTA handle.
* @param update_handle OTA update handle.
* @param curr_app Current app partition.
*/
void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app);
/**
* @brief Copy current app to next partition using OTA handle with offset.
* @param update_handle OTA update handle.
* @param curr_app Current app partition.
*/
void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app);
/**
* @brief Get the next OTA update partition.
* @return Pointer to next OTA partition.
*/
const esp_partition_t * get_next_update_partition(void);
/**
* @brief Copy current app to next partition and set boot partition.
* @param cur_app_partition Current app partition.
* @param next_app_partition Next app partition.
*/
void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition);
/**
* @brief Copy current app to next partition with offset and set boot partition.
* @param cur_app_partition Current app partition.
* @param next_app_partition Next app partition.
*/
void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition);
/**
* @brief Erase OTA data partition.
*/
void erase_ota_data(void);
/**
* @brief Reboot ESP using deep sleep mode.
*/
void reboot_as_deep_sleep(void);
/**
* @brief Copy current app to next partition and reboot.
*/
void copy_current_app_to_next_part_and_reboot(void);
/**
* @brief Copy current app to next partition with offset and reboot.
*/
void copy_current_app_to_next_part_with_offset_and_reboot(void);
/**
* @brief Get running firmware partition.
* @return Pointer to running firmware partition.
*/
const esp_partition_t* get_running_firmware(void);
/**
* @brief Get two OTA data copies from OTA data partition.
* @param otadata_partition OTA data partition.
* @param ota_data_0 First OTA data copy.
* @param ota_data_1 Second OTA data copy.
*/
void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1);
/**
* @brief Write OTA data into required sector of OTA data partition.
* @param otadata_partition OTA data partition.
* @param ota_data OTA data structure.
* @param sec_id Sector number (0 or 1).
*/
void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id);
/**
* @brief Corrupt OTA data for testing.
* @param err Type of corruption.
*/
void corrupt_ota_data(corrupt_ota_data_t err);
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
/**
* @brief Set output pin to low and hold state.
* @param num_pin Pin number.
*/
void set_output_pin(uint32_t num_pin);
/**
* @brief Reset output pin hold function.
* @param num_pin Pin number.
*/
void reset_output_pin(uint32_t num_pin);
#endif
/**
* @brief Mark app as valid and cancel rollback.
*/
void mark_app_valid(void);
/**
* @brief Perform app update and set new boot partition.
* @return Pointer to updated partition.
*/
const esp_partition_t* app_update(void);
#ifdef __cplusplus
}
#endif

View File

@@ -60,3 +60,18 @@ def test_app_update_xip_psram_rom_impl(dut: Dut) -> None:
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32s3', 'esp32p4'], indirect=['target'])
def test_app_update_with_rollback(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
@pytest.mark.recovery_bootloader
@pytest.mark.parametrize(
'config',
['recovery_bootloader'],
indirect=True,
)
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
def test_recovery_bootloader_update(dut: Dut) -> None:
try:
dut.run_all_single_board_cases(group='recovery_bootloader', timeout=90)
finally:
# Erase recovery bootloader after test because it may interfere with other tests using this runner
dut.serial.erase_flash()

View File

@@ -0,0 +1,3 @@
CONFIG_BOOTLOADER_RECOVERY_ENABLE=y
CONFIG_BOOTLOADER_RECOVERY_OFFSET=0x3F0000
CONFIG_PARTITION_TABLE_OFFSET=0x9000

View File

@@ -0,0 +1,2 @@
# ESP32C5 supports the Recovery bootloader feature in ROM starting from v1.0 (ECO2)
CONFIG_IDF_TARGET="esp32c5"

View File

@@ -0,0 +1,2 @@
# ESP32C61 supports the Recovery bootloader feature in ROM starting from v1.0 (ECO3)
CONFIG_IDF_TARGET="esp32c61"

View File

@@ -1,8 +1,37 @@
menu "Bootloader Rollback"
menu "Recovery Bootloader and Rollback"
config BOOTLOADER_RECOVERY_ENABLE
bool "Enable Recovery Bootloader"
depends on SOC_RECOVERY_BOOTLOADER_SUPPORTED
default n
help
The recovery bootloader feature is implemented in the ROM bootloader. It is required for safe OTA
updates of the bootloader. The feature is activated when the eFuse field
(ESP_EFUSE_RECOVERY_BOOTLOADER_FLASH_SECTOR) is set, which defines the flash address of the
recovery bootloader. If activated and the primary bootloader fails to load, the ROM bootloader
will attempt to load the recovery bootloader from the address specified in eFuse.
config BOOTLOADER_RECOVERY_OFFSET
hex "Recovery Bootloader Flash Offset"
depends on BOOTLOADER_RECOVERY_ENABLE
default 0x3F0000
range 0x0 0xFFE000
help
Flash address where the recovery bootloader is stored.
This value must be written to the eFuse field (ESP_EFUSE_RECOVERY_BOOTLOADER_FLASH_SECTOR)
to activate the recovery bootloader in the ROM bootloader. The eFuse can be programmed
using espefuse.py or in the user application with the API esp_efuse_set_recovery_bootloader_offset().
Setting this value in the config allows parttool.py to verify that it does not overlap with existing
partitions in the partition table.
The address must be a multiple of the flash sector size (0x1000 bytes).
The eFuse field stores the offset in sectors.
If the feature is no longer needed or unused, you can burn the 0xFFF value to disable this feature in
the ROM bootloader.
config BOOTLOADER_ANTI_ROLLBACK_ENABLE
bool "Enable bootloader rollback support"
depends on SOC_RECOVERY_BOOTLOADER_SUPPORTED
depends on BOOTLOADER_RECOVERY_ENABLE
default n
help
This option prevents rollback to previous bootloader image with lower security version.

View File

@@ -21,6 +21,7 @@ menu "Settings"
config BOOTLOADER_LOG_MODE_BINARY
bool "Binary Log Mode"
select BOOTLOADER_LOG_MODE_BINARY_EN
depends on BOOTLOADER_LOG_VERSION_2
help
Enables binary logging with host-side format string expansion. In this mode, the
format argument of ESP_LOGx, ESP_EARLY_LOG, and ESP_DRAM_LOG macros is stored in a

View File

@@ -553,12 +553,13 @@ menu "Security features"
depends on SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
default SECURE_BOOT_ECDSA_KEY_LEN_256_BITS
help
Select the ECDSA key size. Two key sizes are supported
Select the ECDSA key size. Three key sizes are supported depending upon on the target:
- 192 bit key using NISTP192 curve
- 256 bit key using NISTP256 curve (Recommended)
- 384 bit key using NISTP384 curve (Recommended)
The advantage of using 256 bit key is the extra randomness which makes it difficult to be
The advantage of using 384 and 256 bit keys is the extra randomness which makes it difficult to be
bruteforced compared to 192 bit key.
At present, both key sizes are practically implausible to bruteforce.
@@ -570,6 +571,10 @@ menu "Security features"
bool "Using ECC curve NISTP256 (Recommended)"
depends on SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
config SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
bool "Using ECC curve NISTP384 (Recommended)"
depends on SECURE_SIGNED_APPS_ECDSA_V2_SCHEME && SOC_ECDSA_SUPPORT_CURVE_P384
endchoice
config SECURE_SIGNED_ON_BOOT_NO_SECURE_BOOT
@@ -1162,7 +1167,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

@@ -70,6 +70,8 @@ if(CONFIG_SECURE_SIGNED_APPS)
set(scheme "ecdsa192")
elseif(CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_256_BITS)
set(scheme "ecdsa256")
elseif(CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS)
set(scheme "ecdsa384")
endif()
fail_at_build_time(gen_secure_boot_signing_key
"Secure Boot Signing Key ${CONFIG_SECURE_BOOT_SIGNING_KEY} does not exist. Generate using:"

View File

@@ -136,7 +136,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
#if ESP_TEE_BUILD
#include "esp_fault.h"
#include "esp_flash_partitions.h"
#include "esp32c6/rom/spi_flash.h"
#include "rom/spi_flash.h"
extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr);
#endif

View File

@@ -55,7 +55,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)

View File

@@ -52,7 +52,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_DEFAULT);
mspi_ll_fast_set_hs_divider(6);
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)

View File

@@ -17,7 +17,6 @@
#if !CONFIG_IDF_TARGET_LINUX
#include "rom/secure_boot.h"
#endif
#ifdef CONFIG_SECURE_BOOT_V1_ENABLED
#if !defined(CONFIG_SECURE_SIGNED_ON_BOOT) || !defined(CONFIG_SECURE_SIGNED_ON_UPDATE) || !defined(CONFIG_SECURE_SIGNED_APPS)
#error "internal sdkconfig error, secure boot should always enable all signature options"
@@ -33,12 +32,20 @@ extern "C" {
Can be compiled as part of app or bootloader code.
*/
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
#define ESP_SECURE_BOOT_DIGEST_LEN 48
#else /* !CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS */
#define ESP_SECURE_BOOT_DIGEST_LEN 32
#endif /* CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS */
/* SHA-256 length of the public key digest */
#define ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN 32
/* Length of the public key digest that is stored in efuses */
#if CONFIG_IDF_TARGET_ESP32C2
#define ESP_SECURE_BOOT_KEY_DIGEST_LEN 16
#define ESP_SECURE_BOOT_KEY_DIGEST_LEN ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN / 2
#else
#define ESP_SECURE_BOOT_KEY_DIGEST_LEN 32
#define ESP_SECURE_BOOT_KEY_DIGEST_LEN ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN
#endif
#ifdef CONFIG_EFUSE_VIRTUAL_KEEP_IN_FLASH
@@ -193,7 +200,8 @@ esp_err_t esp_secure_boot_v2_permanently_enable(const esp_image_metadata_t *imag
/** @brief Verify the secure boot signature appended to some binary data in flash.
*
* For ECDSA Scheme (Secure Boot V1) - deterministic ECDSA w/ SHA256 image
* For RSA Scheme (Secure Boot V2) - RSA-PSS Verification of the SHA-256 image
* For RSA Scheme (Secure Boot V2) - RSA-PSS Verification of the SHA-256 image digest
* For ECDSA Scheme (Secure Boot V2) - ECDSA Verification of the SHA-256 / SHA-384 (in case of ECDSA-P384 secure boot key) image digest
*
* Public key is compiled into the calling program in the ECDSA Scheme.
* See the apt docs/security/secure-boot-v1.rst or docs/security/secure-boot-v2.rst for details.
@@ -236,13 +244,13 @@ esp_err_t esp_secure_boot_verify_ecdsa_signature_block(const esp_secure_boot_sig
/** @brief Verify the secure boot signature block for Secure Boot V2.
*
* Performs RSA-PSS or ECDSA verification of the SHA-256 image based on the public key
* Performs RSA-PSS or ECDSA verification of the SHA-256 / SHA-384 image based on the public key
* in the signature block, compared against the public key digest stored in efuse.
*
* Similar to esp_secure_boot_verify_signature(), but can be used when the digest is precalculated.
* @param[in] sig_block Pointer to signature block data
* @param[in] image_digest Pointer to 32 byte buffer holding SHA-256 hash.
* @param[out] verified_digest Pointer to 32 byte buffer that will receive verified digest if verification completes. (Used during bootloader implementation only, result is invalid otherwise.)
* @param[in] image_digest Pointer to 32/48 byte buffer holding SHA-256/SHA-384 hash.
* @param[out] verified_digest Pointer to 32/48 byte buffer that will receive verified digest if verification completes. (Used during bootloader implementation only, result is invalid otherwise.)
*
*/
esp_err_t esp_secure_boot_verify_sbv2_signature_block(const ets_secure_boot_signature_t *sig_block, const uint8_t *image_digest, uint8_t *verified_digest);
@@ -255,7 +263,7 @@ esp_err_t esp_secure_boot_verify_sbv2_signature_block(const ets_secure_boot_sign
* Each image can have one or more signature blocks (up to SECURE_BOOT_NUM_BLOCKS). Each signature block includes a public key.
*/
typedef struct {
uint8_t key_digests[SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS][ESP_SECURE_BOOT_DIGEST_LEN]; /* SHA of the public key components in the signature block */
uint8_t key_digests[SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS][ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN]; /* SHA of the public key components in the signature block */
unsigned num_digests; /* Number of valid digests, starting at index 0 */
} esp_image_sig_public_key_digests_t;

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -12,15 +12,18 @@
Use mbedTLS APIs or include esp32/sha.h to calculate SHA256 in IDF apps.
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include "esp_err.h"
#include "soc/soc_caps.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void *bootloader_sha256_handle_t;
typedef bootloader_sha256_handle_t bootloader_sha_handle_t;
bootloader_sha256_handle_t bootloader_sha256_start(void);
@@ -28,6 +31,14 @@ void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data,
void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest);
#if SOC_SHA_SUPPORT_SHA512
bootloader_sha_handle_t bootloader_sha512_start(bool is384);
void bootloader_sha512_data(bootloader_sha_handle_t handle, const void *data, size_t data_len);
void bootloader_sha512_finish(bootloader_sha_handle_t handle, uint8_t *digest);
#endif /* SOC_SHA_SUPPORT_SHA512 */
#ifdef __cplusplus
}
#endif

View File

@@ -25,12 +25,11 @@ void bootloader_ana_super_wdt_reset_config(bool enable);
void bootloader_ana_clock_glitch_reset_config(bool enable);
/**
* @brief Configure analog power glitch reset & glitch reset dref
* @brief Configure analog power glitch reset
*
* @param enable Boolean to enable or disable power glitch reset
* @param dref voltage threshold
*/
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref);
void bootloader_power_glitch_reset_config(bool enable);
#ifdef __cplusplus
}

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -138,6 +138,20 @@ void bootloader_debug_buffer(const void *buffer, size_t length, const char *labe
*/
esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest);
/** @brief Generates the digest of the data between offset & offset+length.
*
* This function should be used when the size of the data is larger than 3.2MB.
* The MMU capacity is 3.2MB (50 pages - 64KB each). This function generates the SHA-384
* of the data in chunks of 3.2MB, considering the MMU capacity.
*
* @param[in] flash_offset Offset of the data in flash.
* @param[in] len Length of data in bytes.
* @param[out] digest Pointer to buffer where the digest is written, if ESP_OK is returned.
*
* @return ESP_OK if secure boot digest is generated successfully.
*/
esp_err_t bootloader_sha384_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest);
#ifdef __cplusplus
}
#endif

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";
@@ -264,7 +265,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,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
*/
@@ -19,6 +19,7 @@
#include "hal/wdt_hal.h"
#include "hal/efuse_hal.h"
#include "esp_bootloader_desc.h"
#include "esp_rom_sys.h"
static const char *TAG = "boot";
@@ -34,7 +35,12 @@ void bootloader_clear_bss_section(void)
esp_err_t bootloader_read_bootloader_header(void)
{
/* load bootloader image header */
if (bootloader_flash_read(ESP_BOOTLOADER_OFFSET, &bootloader_image_hdr, sizeof(esp_image_header_t), true) != ESP_OK) {
#if SOC_RECOVERY_BOOTLOADER_SUPPORTED
const uint32_t bootloader_flash_offset = esp_rom_get_bootloader_offset();
#else
const uint32_t bootloader_flash_offset = ESP_PRIMARY_BOOTLOADER_OFFSET;
#endif
if (bootloader_flash_read(bootloader_flash_offset, &bootloader_image_hdr, sizeof(esp_image_header_t), true) != ESP_OK) {
ESP_EARLY_LOGE(TAG, "failed to load bootloader image header!");
return ESP_FAIL;
}

View File

@@ -25,20 +25,19 @@ void bootloader_init_mem(void)
* So, at boot disabling these filters. They will enable as per the
* use case by TEE initialization code.
*/
#ifdef SOC_APM_CTRL_FILTER_SUPPORTED
apm_hal_apm_ctrl_filter_enable_all(false);
/* [APM] On power-up, only the HP CPU starts in TEE mode; others default to REE2.
* APM blocks REE0REE2 access by default. C5 ECO2 adds per-peripheral control
* (default REEx blocking), but config support is pending. As a workaround,
* all masters are set to TEE mode.
#if SOC_APM_CTRL_FILTER_SUPPORTED
apm_hal_enable_ctrl_filter_all(false);
/* [APM] On power-up, only the HP CPU starts in TEE mode; others
* default to REE2. APM blocks REE0REE2 access by default.
* Thus, all masters are set to TEE mode.
*/
#if SOC_APM_SUPPORT_TEE_PERI_ACCESS_CTRL
apm_tee_hal_set_master_secure_mode_all(APM_LL_SECURE_MODE_TEE);
apm_hal_set_master_sec_mode_all(APM_SEC_MODE_TEE);
#endif // SOC_APM_SUPPORT_TEE_PERI_ACCESS_CTRL
#endif // SOC_APM_CTRL_FILTER_SUPPORTED
#endif
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
#if CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();
#endif

View File

@@ -9,6 +9,7 @@
#include "hal/adc_ll.h"
#include "hal/adc_types.h"
#include "esp_private/regi2c_ctrl.h"
#include "soc/lpperi_reg.h"
void bootloader_random_enable(void)
{
@@ -48,6 +49,9 @@ void bootloader_random_enable(void)
adc_ll_digi_set_trigger_interval(200);
adc_ll_digi_trigger_enable();
SET_PERI_REG_MASK(LPPERI_RNG_CFG_REG, LPPERI_RNG_SAMPLE_ENABLE);
REG_SET_FIELD(LPPERI_RNG_CFG_REG, LPPERI_RTC_TIMER_EN, 0x3);
SET_PERI_REG_MASK(LPPERI_RNG_CFG_REG, LPPERI_RNG_TIMER_EN);
}
void bootloader_random_disable(void)

View File

@@ -29,15 +29,6 @@ bootloader_sha256_handle_t bootloader_sha256_start()
void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data, size_t data_len)
{
assert(handle != NULL);
#if !SOC_SECURE_BOOT_V2_ECC
/* For secure boot, the key field consists of 1 byte of curve identifier and 64 bytes of ECDSA public key.
* While verifying the signature block, we need to calculate the SHA of this key field which is of 65 bytes.
* ets_sha_update handles it cleanly so we can safely remove the check:
*/
assert(data_len % 4 == 0);
#endif /* SOC_SECURE_BOOT_V2_ECC */
ets_sha_update(&ctx, data, data_len, false);
}
@@ -51,6 +42,33 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
}
ets_sha_finish(&ctx, digest);
}
#if SOC_SHA_SUPPORT_SHA512
bootloader_sha_handle_t bootloader_sha512_start(bool is384)
{
// Enable SHA hardware
ets_sha_enable();
ets_sha_init(&ctx, is384 ? SHA2_384 : SHA2_512);
return &ctx; // Meaningless non-NULL value
}
void bootloader_sha512_data(bootloader_sha_handle_t handle, const void *data, size_t data_len)
{
assert(handle != NULL);
ets_sha_update(&ctx, data, data_len, false);
}
void bootloader_sha512_finish(bootloader_sha_handle_t handle, uint8_t *digest)
{
assert(handle != NULL);
if (digest == NULL) {
bzero(&ctx, sizeof(ctx));
return;
}
ets_sha_finish(&ctx, digest);
}
#endif /* SOC_SHA_SUPPORT_SHA512 */
#else /* !CONFIG_IDF_TARGET_ESP32 */
#include "soc/dport_reg.h"
@@ -162,6 +180,7 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
#include "bootloader_flash_priv.h"
#include <mbedtls/sha256.h>
#include <mbedtls/sha512.h>
bootloader_sha256_handle_t bootloader_sha256_start(void)
{
@@ -199,4 +218,43 @@ void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest
free(handle);
handle = NULL;
}
#if SOC_SHA_SUPPORT_SHA512
bootloader_sha_handle_t bootloader_sha512_start(bool is384)
{
mbedtls_sha512_context *ctx = (mbedtls_sha512_context *)malloc(sizeof(mbedtls_sha512_context));
if (!ctx) {
return NULL;
}
mbedtls_sha512_init(ctx);
int ret = mbedtls_sha512_starts(ctx, is384);
if (ret != 0) {
return NULL;
}
return ctx;
}
void bootloader_sha512_data(bootloader_sha_handle_t handle, const void *data, size_t data_len)
{
assert(handle != NULL);
mbedtls_sha512_context *ctx = (mbedtls_sha512_context *)handle;
int ret = mbedtls_sha512_update(ctx, data, data_len);
assert(ret == 0);
(void)ret;
}
void bootloader_sha512_finish(bootloader_sha_handle_t handle, uint8_t *digest)
{
assert(handle != NULL);
mbedtls_sha512_context *ctx = (mbedtls_sha512_context *)handle;
if (digest != NULL) {
int ret = mbedtls_sha512_finish(ctx, digest);
assert(ret == 0);
(void)ret;
}
mbedtls_sha512_free(ctx);
free(handle);
handle = NULL;
}
#endif /* SOC_SHA_SUPPORT_SHA512 */
#endif /* !(NON_OS_BUILD || CONFIG_APP_BUILD_TYPE_RAM) */

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -30,6 +30,7 @@
#include "hal/cache_types.h"
#include "hal/cache_ll.h"
#include "hal/cache_hal.h"
#include "hal/sha_types.h"
#include "esp_cpu.h"
#include "esp_image_format.h"
@@ -1213,18 +1214,29 @@ void bootloader_debug_buffer(const void *buffer, size_t length, const char *labe
#endif
}
esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest)
static esp_err_t bootloader_sha_flash_contents(esp_sha_type type, uint32_t flash_offset, uint32_t len, uint8_t *digest)
{
if (digest == NULL) {
return ESP_ERR_INVALID_ARG;
}
/* Handling firmware images larger than MMU capacity */
uint32_t mmu_free_pages_count = bootloader_mmap_get_free_pages();
bootloader_sha256_handle_t sha_handle = NULL;
bootloader_sha_handle_t sha_handle = NULL;
if (type == SHA2_256) {
sha_handle = bootloader_sha256_start();
} else
// Using SOC_ECDSA_SUPPORT_CURVE_P384 here so that there is no flash size impact in the case of existing targets like ESP32.
#if SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384
if (type == SHA2_384) {
sha_handle = bootloader_sha512_start(true);
} else
#endif /* SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384 */
{
return ESP_ERR_INVALID_ARG;
}
sha_handle = bootloader_sha256_start();
if (sha_handle == NULL) {
return ESP_ERR_NO_MEM;
}
@@ -1234,7 +1246,14 @@ esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len,
uint32_t max_pages = (mmu_free_pages_count > mmu_page_offset) ? (mmu_free_pages_count - mmu_page_offset) : 0;
if (max_pages == 0) {
ESP_LOGE(TAG, "No free MMU pages are available");
bootloader_sha256_finish(sha_handle, NULL);
if (type == SHA2_256) {
bootloader_sha256_finish(sha_handle, NULL);
}
#if SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384
else if (type == SHA2_384) {
bootloader_sha512_finish(sha_handle, NULL);
}
#endif /* SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384 */
return ESP_ERR_NO_MEM;
}
uint32_t max_image_len;
@@ -1245,15 +1264,51 @@ esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len,
const void * image = bootloader_mmap(flash_offset, partial_image_len);
if (image == NULL) {
bootloader_sha256_finish(sha_handle, NULL);
if (type == SHA2_256) {
bootloader_sha256_finish(sha_handle, NULL);
}
#if SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384
else if (type == SHA2_384) {
bootloader_sha512_finish(sha_handle, NULL);
}
#endif /* SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384 */
return ESP_FAIL;
}
bootloader_sha256_data(sha_handle, image, partial_image_len);
if (type == SHA2_256) {
bootloader_sha256_data(sha_handle, image, partial_image_len);
}
#if SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384
else if (type == SHA2_384) {
bootloader_sha512_data(sha_handle, image, partial_image_len);
}
#endif /* SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384 */
bootloader_munmap(image);
flash_offset += partial_image_len;
len -= partial_image_len;
}
bootloader_sha256_finish(sha_handle, digest);
if (type == SHA2_256) {
bootloader_sha256_finish(sha_handle, digest);
}
#if SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384
else if (type == SHA2_384) {
bootloader_sha512_finish(sha_handle, digest);
}
#endif /* SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384 */
return ESP_OK;
}
esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest)
{
return bootloader_sha_flash_contents(SHA2_256, flash_offset, len, digest);
}
#if SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384
esp_err_t bootloader_sha384_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest)
{
return bootloader_sha_flash_contents(SHA2_384, flash_offset, len, digest);
}
#endif /* SOC_SHA_SUPPORT_SHA384 && SOC_ECDSA_SUPPORT_CURVE_P384 */

View File

@@ -94,11 +94,7 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
if (efuse_hal_chip_revision() == 0) {
// decrease power glitch reset voltage to avoid start the glitch reset
uint8_t power_glitch_dref = 0;
bootloader_power_glitch_reset_config(true, power_glitch_dref);
}
bootloader_power_glitch_reset_config(true);
}
esp_err_t bootloader_init(void)

View File

@@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
(void)enable;
}
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
void bootloader_power_glitch_reset_config(bool enable)
{
assert(dref < 8);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
//only detect VDDPST POWER GLITCH
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_XTAL, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO1
if (enable) {
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_XTAL, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO1
} else {
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0);
}

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -71,12 +71,9 @@ esp_err_t esp_flash_encryption_enable_secure_features(void)
esp_err_t esp_flash_encryption_enable_key_mgr(void)
{
// Enable and reset key manager
// To suppress build errors about spinlock's __DECLARE_RCC_ATOMIC_ENV
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
key_mgr_ll_enable_bus_clock(true);
key_mgr_ll_enable_peripheral_clock(true);
key_mgr_ll_reset_register();
_key_mgr_ll_enable_bus_clock(true);
_key_mgr_ll_enable_peripheral_clock(true);
_key_mgr_ll_reset_register();
while (key_mgr_ll_get_state() != ESP_KEY_MGR_STATE_IDLE) {
};

View File

@@ -49,6 +49,12 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
#endif
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_SHA384_EN);
#endif
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_SECURE_BOOT_SHA384_EN);
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS

View File

@@ -95,8 +95,7 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
uint8_t power_glitch_dref = 0;
bootloader_power_glitch_reset_config(true, power_glitch_dref);
bootloader_power_glitch_reset_config(true);
}
esp_err_t bootloader_init(void)

View File

@@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
(void)enable;
}
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
void bootloader_power_glitch_reset_config(bool enable)
{
assert(dref < 8);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
//only detect VDDPST POWER GLITCH
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLLBB, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO2
if (enable) {
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLLBB, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO2
} else {
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0);
}

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: 2022-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -53,12 +53,9 @@ esp_err_t esp_flash_encryption_enable_secure_features(void)
esp_err_t esp_flash_encryption_enable_key_mgr(void)
{
// Enable and reset key manager
// To suppress build errors about spinlock's __DECLARE_RCC_ATOMIC_ENV
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
key_mgr_ll_enable_bus_clock(true);
key_mgr_ll_enable_peripheral_clock(true);
key_mgr_ll_reset_register();
_key_mgr_ll_enable_bus_clock(true);
_key_mgr_ll_enable_peripheral_clock(true);
_key_mgr_ll_reset_register();
while (key_mgr_ll_get_state() != ESP_KEY_MGR_STATE_IDLE) {
};

View File

@@ -23,6 +23,7 @@
#include "soc/soc_caps.h"
#include "hal/cache_ll.h"
#include "spi_flash_mmap.h"
#include "hal/efuse_hal.h"
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
@@ -104,7 +105,6 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
static esp_err_t process_image_header(esp_image_metadata_t *data, uint32_t part_offset, bootloader_sha256_handle_t *sha_handle, bool do_verify, bool silent);
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent);
static esp_err_t process_checksum(bootloader_sha256_handle_t sha_handle, uint32_t checksum_word, esp_image_metadata_t *data, bool silent, bool skip_check_checksum);
static esp_err_t __attribute__((unused)) verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data, uint8_t *image_digest, uint8_t *verified_digest);
static esp_err_t __attribute__((unused)) verify_simple_hash(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data);
@@ -119,11 +119,26 @@ void esp_image_bootloader_offset_set(const uint32_t offset)
{
s_bootloader_partition_offset = offset;
ESP_LOGI(TAG, "Bootloader offsets for PRIMARY: 0x%x, Secondary: 0x%" PRIx32, ESP_PRIMARY_BOOTLOADER_OFFSET, s_bootloader_partition_offset);
#if SOC_RECOVERY_BOOTLOADER_SUPPORTED
uint32_t recovery_offset = efuse_hal_get_recovery_bootloader_address();
if (efuse_hal_recovery_bootloader_enabled()) {
ESP_LOGI(TAG, "Bootloader offset for RECOVERY: 0x%" PRIx32, recovery_offset);
} else if (recovery_offset == 0) {
ESP_LOGI(TAG, "Bootloader offset for RECOVERY: has not been set yet");
} else {
ESP_LOGI(TAG, "Bootloader offset for RECOVERY: is disabled");
}
#endif
}
static bool is_bootloader(uint32_t offset)
{
return ((offset == ESP_PRIMARY_BOOTLOADER_OFFSET) || (offset == s_bootloader_partition_offset));
return ((offset == ESP_PRIMARY_BOOTLOADER_OFFSET)
|| (offset == s_bootloader_partition_offset)
#if SOC_RECOVERY_BOOTLOADER_SUPPORTED
|| (efuse_hal_recovery_bootloader_enabled() ? offset == efuse_hal_get_recovery_bootloader_address() : false)
#endif
);
}
static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_t *part, esp_image_metadata_t *data)
@@ -144,8 +159,8 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
bool verify_sha;
#if (SECURE_BOOT_CHECK_SIGNATURE == 1)
/* used for anti-FI checks */
uint8_t image_digest[HASH_LEN] = { [ 0 ... 31] = 0xEE };
uint8_t verified_digest[HASH_LEN] = { [ 0 ... 31 ] = 0x01 };
uint8_t image_digest[ESP_SECURE_BOOT_DIGEST_LEN] = { [ 0 ... ESP_SECURE_BOOT_DIGEST_LEN - 1 ] = 0xEE };
uint8_t verified_digest[ESP_SECURE_BOOT_DIGEST_LEN] = { [ 0 ... ESP_SECURE_BOOT_DIGEST_LEN - 1 ] = 0x01 };
#endif
if (data == NULL || part == NULL) {
@@ -221,7 +236,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
"only verify signature in bootloader" into the macro so it's tested multiple times.
*/
#if CONFIG_SECURE_BOOT_V2_ENABLED
ESP_FAULT_ASSERT(!esp_secure_boot_enabled() || memcmp(image_digest, verified_digest, HASH_LEN) == 0);
ESP_FAULT_ASSERT(!esp_secure_boot_enabled() || memcmp(image_digest, verified_digest, ESP_SECURE_BOOT_DIGEST_LEN) == 0);
#else // Secure Boot V1 on ESP32, only verify signatures for apps not bootloaders
ESP_FAULT_ASSERT(is_bootloader(data->start_addr) || memcmp(image_digest, verified_digest, HASH_LEN) == 0);
#endif
@@ -796,20 +811,27 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
bool map_segment = should_map(load_addr);
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
esp_err_t err = ESP_FAIL;
/* ESP APP descriptor is present in the DROM segment #0 */
if (index == 0 && !is_bootloader(metadata->start_addr)) {
const esp_app_desc_t *app_desc = (const esp_app_desc_t *)bootloader_mmap(segment_data_offs, sizeof(esp_app_desc_t));
if (!app_desc || app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
uint32_t mmu_page_size = 0, magic_word = 0;
const uint32_t mmu_page_size_offset = segment_data_offs + offsetof(esp_app_desc_t, mmu_page_size);
CHECK_ERR(bootloader_flash_read(segment_data_offs, &magic_word, sizeof(uint32_t), true));
CHECK_ERR(bootloader_flash_read(mmu_page_size_offset, &mmu_page_size, sizeof(uint32_t), true));
// Extract only the lowest byte from mmu_page_size (as per image format)
mmu_page_size &= 0xFF;
if (magic_word != ESP_APP_DESC_MAGIC_WORD) {
ESP_LOGE(TAG, "Failed to fetch app description header!");
return ESP_FAIL;
}
// Convert from log base 2 number to actual size while handling legacy image case (value 0)
metadata->mmu_page_size = (app_desc->mmu_page_size > 0) ? (1UL << app_desc->mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
metadata->mmu_page_size = (mmu_page_size > 0) ? (1UL << mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
if (metadata->mmu_page_size != SPI_FLASH_MMU_PAGE_SIZE) {
ESP_LOGI(TAG, "MMU page size mismatch, configured: 0x%x, found: 0x%"PRIx32, SPI_FLASH_MMU_PAGE_SIZE, metadata->mmu_page_size);
}
bootloader_munmap(app_desc);
} else if (index == 0 && is_bootloader(metadata->start_addr)) {
// Bootloader always uses the default MMU page size
metadata->mmu_page_size = SPI_FLASH_MMU_PAGE_SIZE;
@@ -836,6 +858,10 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
}
return ESP_OK;
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
err:
return err;
#endif
}
static bool should_map(uint32_t load_addr)
@@ -996,43 +1022,14 @@ err:
return err;
}
static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data, uint8_t *image_digest, uint8_t *verified_digest)
{
#if (SECURE_BOOT_CHECK_SIGNATURE == 1)
uint32_t end = data->start_addr + data->image_len;
ESP_LOGI(TAG, "Verifying image signature...");
// For secure boot, we calculate the signature hash over the whole file, which includes any "simple" hash
// appended to the image for corruption detection
if (data->image.hash_appended) {
const void *simple_hash = bootloader_mmap(end - HASH_LEN, HASH_LEN);
bootloader_sha256_data(sha_handle, simple_hash, HASH_LEN);
bootloader_munmap(simple_hash);
}
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
// End of the image needs to be padded all the way to a 4KB boundary, after the simple hash
// (for apps they are usually already padded due to --secure-pad-v2, only a problem if this option was not used.)
uint32_t padded_end = ALIGN_UP(end, FLASH_SECTOR_SIZE);
if (padded_end > end) {
const void *padding = bootloader_mmap(end, padded_end - end);
bootloader_sha256_data(sha_handle, padding, padded_end - end);
bootloader_munmap(padding);
end = padded_end;
}
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
bootloader_sha256_finish(sha_handle, image_digest);
// Log the hash for debugging
bootloader_debug_buffer(image_digest, HASH_LEN, "Calculated secure boot hash");
static esp_err_t verify_signature_and_adjust_image_len(esp_image_metadata_t *data, uint32_t end, uint8_t *image_digest, uint8_t *verified_digest)
{
// Use hash to verify signature block
esp_err_t err = ESP_ERR_IMAGE_INVALID;
#if CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
const void *sig_block;
ESP_FAULT_ASSERT(memcmp(image_digest, verified_digest, HASH_LEN) != 0); /* sanity check that these values start differently */
ESP_FAULT_ASSERT(memcmp(image_digest, verified_digest, ESP_SECURE_BOOT_DIGEST_LEN) != 0); /* sanity check that these values start differently */
#if defined(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
sig_block = bootloader_mmap(data->start_addr + data->image_len, sizeof(esp_secure_boot_sig_block_t));
err = esp_secure_boot_verify_ecdsa_signature_block(sig_block, image_digest, verified_digest);
@@ -1049,7 +1046,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
ESP_LOGI(TAG, "Calculating simple hash to check for corruption...");
const void *whole_image = bootloader_mmap(data->start_addr, data->image_len - HASH_LEN);
if (whole_image != NULL) {
sha_handle = bootloader_sha256_start();
bootloader_sha256_handle_t sha_handle = bootloader_sha256_start();
bootloader_sha256_data(sha_handle, whole_image, data->image_len - HASH_LEN);
bootloader_munmap(whole_image);
if (verify_simple_hash(sha_handle, data) != ESP_OK) {
@@ -1070,6 +1067,64 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
}
#endif
return ESP_OK;
}
#endif /* SECURE_BOOT_CHECK_SIGNATURE */
static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data, uint8_t *image_digest, uint8_t *verified_digest)
{
#if (SECURE_BOOT_CHECK_SIGNATURE == 1)
uint32_t end = data->start_addr + data->image_len;
ESP_LOGI(TAG, "Verifying image signature...");
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
(void) sha_handle;
/* Re-calculating image digest using SHA384 */
const void *image_data = bootloader_mmap(data->start_addr, data->image_len - HASH_LEN);
bootloader_sha_handle_t sha384_handle = bootloader_sha512_start(true);
bootloader_sha512_data(sha384_handle, image_data, data->image_len - HASH_LEN);
bootloader_munmap(image_data);
#endif
// For secure boot, we calculate the signature hash over the whole file, which includes any "simple" hash
// appended to the image for corruption detection
if (data->image.hash_appended) {
const void *simple_hash = bootloader_mmap(end - HASH_LEN, HASH_LEN);
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
bootloader_sha512_data(sha384_handle, simple_hash, HASH_LEN);
#else
bootloader_sha256_data(sha_handle, simple_hash, HASH_LEN);
#endif
bootloader_munmap(simple_hash);
}
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
// End of the image needs to be padded all the way to a 4KB boundary, after the simple hash
// (for apps they are usually already padded due to --secure-pad-v2, only a problem if this option was not used.)
uint32_t padded_end = ALIGN_UP(end, FLASH_SECTOR_SIZE);
if (padded_end > end) {
const void *padding = bootloader_mmap(end, padded_end - end);
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
bootloader_sha512_data(sha384_handle, padding, padded_end - end);
#else
bootloader_sha256_data(sha_handle, padding, padded_end - end);
#endif
bootloader_munmap(padding);
end = padded_end;
}
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
bootloader_sha512_finish(sha384_handle, image_digest);
#else
bootloader_sha256_finish(sha_handle, image_digest);
#endif
// Log the hash for debugging
bootloader_debug_buffer(image_digest, ESP_SECURE_BOOT_DIGEST_LEN, "Calculated secure boot hash");
return verify_signature_and_adjust_image_len(data, end, image_digest, verified_digest);
#endif // SECURE_BOOT_CHECK_SIGNATURE
return ESP_OK;
}

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";
@@ -341,15 +345,17 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
}
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
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)");
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)");
}
}
}
}
@@ -421,7 +427,19 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
#endif
}
}
#if SOC_ECDSA_SUPPORT_CURVE_P384
/* When using Secure Boot with SHA-384, the efuse bit representing Secure Boot with SHA-384 would already be programmed.
* But in the case of the existing Secure Boot V2 schemes using SHA-256, the efuse bit representing
* Secure Boot with SHA-384 needs to be write-protected, so that an attacker cannot perform a denial-of-service
* attack by changing the existing secure boot mode using SHA-256 to SHA-384.
*/
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_SECURE_BOOT_SHA384_EN);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected secure boot using SHA-384 mode (set WR_DIS_SECURE_BOOT_SHA384_EN->1)");
}
#endif
secure = (num_keys != 0);
result &= secure;

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
*/
@@ -69,16 +69,21 @@ static esp_err_t validate_signature_block(const ets_secure_boot_sig_block_t *blo
*/
static esp_err_t s_calculate_image_public_key_digests(uint32_t flash_offset, uint32_t flash_size, esp_image_sig_public_key_digests_t *public_key_digests)
{
esp_err_t ret;
esp_err_t ret = ESP_FAIL;
uint8_t image_digest[ESP_SECURE_BOOT_DIGEST_LEN] = {0};
uint8_t __attribute__((aligned(4))) key_digest[ESP_SECURE_BOOT_DIGEST_LEN] = {0};
uint8_t __attribute__((aligned(4))) key_digest[ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN] = {0};
size_t sig_block_addr = flash_offset + ALIGN_UP(flash_size, FLASH_SECTOR_SIZE);
ESP_LOGD(TAG, "calculating public key digests for sig blocks of image offset 0x%" PRIx32 " (sig block offset 0x%x)", flash_offset, sig_block_addr);
bzero(public_key_digests, sizeof(esp_image_sig_public_key_digests_t));
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
ret = bootloader_sha384_flash_contents(flash_offset, sig_block_addr - flash_offset, image_digest);
#else
ret = bootloader_sha256_flash_contents(flash_offset, sig_block_addr - flash_offset, image_digest);
#endif
if (ret != ESP_OK) {
ESP_LOGE(TAG, "error generating image digest, %d", ret);
return ret;
@@ -129,7 +134,7 @@ static esp_err_t s_calculate_image_public_key_digests(uint32_t flash_offset, uin
}
ESP_LOGD(TAG, "Signature block (%d) is verified", i);
/* Copy the key digest to the buffer provided by the caller */
memcpy((void *)public_key_digests->key_digests[i], key_digest, ESP_SECURE_BOOT_DIGEST_LEN);
memcpy((void *)public_key_digests->key_digests[i], key_digest, ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN);
public_key_digests->num_digests++;
}
@@ -317,7 +322,7 @@ static esp_err_t check_and_generate_secure_boot_keys(const esp_image_metadata_t
}
for (unsigned j = 0; j < tee_key_digests.num_digests; j++) {
if (!memcmp(boot_key_digests.key_digests[i], tee_key_digests.key_digests[j], ESP_SECURE_BOOT_DIGEST_LEN)) {
if (!memcmp(boot_key_digests.key_digests[i], tee_key_digests.key_digests[j], ESP_SECURE_BOOT_KEY_DIGEST_LEN)) {
ESP_LOGI(TAG, "TEE key(%d) matches with bootloader key(%d).", j, i);
tee_match = true;
}

View File

@@ -73,7 +73,7 @@ static esp_err_t calculate_image_public_key_digests(bool verify_image_digest, bo
}
uint8_t image_digest[ESP_SECURE_BOOT_DIGEST_LEN] = {0};
uint8_t __attribute__((aligned(4))) key_digest[ESP_SECURE_BOOT_DIGEST_LEN] = {0};
uint8_t __attribute__((aligned(4))) key_digest[ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN] = {0};
size_t sig_block_addr = img_metadata.start_addr + ALIGN_UP(img_metadata.image_len, FLASH_SECTOR_SIZE);
ESP_LOGD(TAG, "calculating public key digests for sig blocks of image offset 0x%"PRIu32" (sig block offset 0x%u)", img_metadata.start_addr, sig_block_addr);
@@ -81,7 +81,11 @@ static esp_err_t calculate_image_public_key_digests(bool verify_image_digest, bo
bzero(public_key_digests, sizeof(esp_image_sig_public_key_digests_t));
if (verify_image_digest) {
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
ret = bootloader_sha384_flash_contents(img_metadata.start_addr, sig_block_addr - img_metadata.start_addr, image_digest);
#else
ret = bootloader_sha256_flash_contents(img_metadata.start_addr, sig_block_addr - img_metadata.start_addr, image_digest);
#endif
if (ret != ESP_OK) {
ESP_LOGE(TAG, "error generating image digest, %d", ret);
return ret;
@@ -118,7 +122,7 @@ static esp_err_t calculate_image_public_key_digests(bool verify_image_digest, bo
ESP_LOGD(TAG, "Signature block (%d) is verified", i);
}
/* Copy the key digest to the buffer provided by the caller */
memcpy((void *)public_key_digests->key_digests[public_key_digests->num_digests], key_digest, ESP_SECURE_BOOT_DIGEST_LEN);
memcpy((void *)public_key_digests->key_digests[public_key_digests->num_digests], key_digest, ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN);
}
public_key_digests->num_digests++;
}
@@ -184,14 +188,19 @@ static esp_err_t get_secure_boot_key_digests(esp_image_sig_public_key_digests_t
esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
{
uint8_t digest[ESP_SECURE_BOOT_KEY_DIGEST_LEN] = {0};
uint8_t verified_digest[ESP_SECURE_BOOT_KEY_DIGEST_LEN] = {0};
esp_err_t err = ESP_FAIL;
uint8_t digest[ESP_SECURE_BOOT_DIGEST_LEN] = {0};
/* Rounding off length to the upper 4k boundary */
uint32_t padded_length = ALIGN_UP(length, FLASH_SECTOR_SIZE);
ESP_LOGD(TAG, "verifying signature src_addr 0x%"PRIx32" length 0x%"PRIx32, src_addr, length);
esp_err_t err = bootloader_sha256_flash_contents(src_addr, padded_length, digest);
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
err = bootloader_sha384_flash_contents(src_addr, padded_length, digest);
#else
err = bootloader_sha256_flash_contents(src_addr, padded_length, digest);
#endif
if (err != ESP_OK) {
ESP_LOGE(TAG, "Digest calculation failed 0x%"PRIx32", 0x%"PRIx32, src_addr, padded_length);
return err;
@@ -203,7 +212,7 @@ esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
return ESP_FAIL;
}
err = esp_secure_boot_verify_sbv2_signature_block(sig_block, digest, verified_digest);
err = esp_secure_boot_verify_sbv2_signature_block(sig_block, digest, NULL);
if (err != ESP_OK) {
ESP_LOGE(TAG, "Secure Boot V2 verification failed.");
}
@@ -218,9 +227,11 @@ esp_err_t esp_secure_boot_verify_sbv2_signature_block(const ets_secure_boot_sign
{
bool any_trusted_key = false;
/* Note: in IDF verification we don't add any fault injection resistance, as we don't expect this to be called
during boot-time verification. */
memset(verified_digest, 0, ESP_SECURE_BOOT_KEY_DIGEST_LEN);
if (verified_digest != NULL) {
/* Note: in IDF verification we don't add any fault injection resistance, as we don't expect this to be called
during boot-time verification. */
memset(verified_digest, 0, ESP_SECURE_BOOT_DIGEST_LEN);
}
esp_image_sig_public_key_digests_t trusted = {0};
@@ -237,7 +248,7 @@ esp_err_t esp_secure_boot_verify_sbv2_signature_block(const ets_secure_boot_sign
#endif
for (unsigned app_blk_idx = 0; app_blk_idx < secure_boot_num_blocks; app_blk_idx++) {
uint8_t app_blk_digest[ESP_SECURE_BOOT_DIGEST_LEN] = { 0 };
uint8_t app_blk_digest[ESP_SECURE_BOOT_KEY_DIGEST_SHA_256_LEN] = { 0 };
const ets_secure_boot_sig_block_t *app_blk = &sig_block->block[app_blk_idx];
const ets_secure_boot_sig_block_t *trusted_block = NULL;

View File

@@ -26,6 +26,7 @@ static const char* TAG = "secure_boot_v2";
esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
{
esp_err_t err = ESP_FAIL;
uint8_t digest[ESP_SECURE_BOOT_DIGEST_LEN] = {0};
uint8_t verified_digest[ESP_SECURE_BOOT_DIGEST_LEN] = { 0 }; /* Note: this function doesn't do any anti-FI checks on this buffer */
@@ -34,7 +35,12 @@ esp_err_t esp_secure_boot_verify_signature(uint32_t src_addr, uint32_t length)
ESP_LOGD(TAG, "verifying signature src_addr 0x%" PRIx32 " length 0x%" PRIx32, src_addr, length);
/* Calculate digest of main image */
esp_err_t err = bootloader_sha256_flash_contents(src_addr, padded_length, digest);
#if CONFIG_SECURE_BOOT_ECDSA_KEY_LEN_384_BITS
err = bootloader_sha384_flash_contents(src_addr, padded_length, digest);
#else
err = bootloader_sha256_flash_contents(src_addr, padded_length, digest);
#endif
if (err != ESP_OK) {
ESP_LOGE(TAG, "Digest calculation failed 0x%" PRIx32 ", 0x%" PRIx32, src_addr, padded_length);
return err;

View File

@@ -134,6 +134,7 @@ if(CONFIG_BT_ENABLED)
"common/osi/semaphore.c"
"porting/mem/bt_osi_mem.c"
"common/ble_log/ble_log_spi_out.c"
"common/ble_log/ble_log_uhci_out.c"
)
# Host Bluedroid
@@ -155,9 +156,6 @@ if(CONFIG_BT_ENABLED)
host/bluedroid/bta/sys/include
host/bluedroid/device/include
host/bluedroid/hci/include
host/bluedroid/external/sbc/decoder/include
host/bluedroid/external/sbc/encoder/include
host/bluedroid/external/sbc/plc/include
host/bluedroid/btc/profile/esp/include
host/bluedroid/btc/profile/std/a2dp/include
host/bluedroid/btc/profile/std/include
@@ -315,29 +313,6 @@ if(CONFIG_BT_ENABLED)
"host/bluedroid/device/bdaddr.c"
"host/bluedroid/device/controller.c"
"host/bluedroid/device/interop.c"
"host/bluedroid/external/sbc/decoder/srce/alloc.c"
"host/bluedroid/external/sbc/decoder/srce/bitalloc-sbc.c"
"host/bluedroid/external/sbc/decoder/srce/bitalloc.c"
"host/bluedroid/external/sbc/decoder/srce/bitstream-decode.c"
"host/bluedroid/external/sbc/decoder/srce/decoder-oina.c"
"host/bluedroid/external/sbc/decoder/srce/decoder-private.c"
"host/bluedroid/external/sbc/decoder/srce/decoder-sbc.c"
"host/bluedroid/external/sbc/decoder/srce/dequant.c"
"host/bluedroid/external/sbc/decoder/srce/framing-sbc.c"
"host/bluedroid/external/sbc/decoder/srce/framing.c"
"host/bluedroid/external/sbc/decoder/srce/oi_codec_version.c"
"host/bluedroid/external/sbc/decoder/srce/synthesis-8-generated.c"
"host/bluedroid/external/sbc/decoder/srce/synthesis-dct8.c"
"host/bluedroid/external/sbc/decoder/srce/synthesis-sbc.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_analysis.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_dct.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_dct_coeffs.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_ste.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_enc_coeffs.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_encoder.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_packing.c"
"host/bluedroid/external/sbc/plc/sbc_plc.c"
"host/bluedroid/hci/hci_audio.c"
"host/bluedroid/hci/hci_hal_h4.c"
"host/bluedroid/hci/hci_layer.c"
@@ -474,6 +449,38 @@ if(CONFIG_BT_ENABLED)
"host/bluedroid/api/esp_ble_cte_api.c")
endif()
if((CONFIG_BT_A2DP_ENABLE AND NOT CONFIG_BT_A2DP_USE_EXTERNAL_CODEC) OR
(CONFIG_BT_HFP_ENABLE AND CONFIG_BT_HFP_AUDIO_DATA_PATH_HCI AND NOT CONFIG_BT_HFP_USE_EXTERNAL_CODEC))
list(APPEND priv_include_dirs
host/bluedroid/external/sbc/decoder/include
host/bluedroid/external/sbc/encoder/include
host/bluedroid/external/sbc/plc/include)
list(APPEND srcs "host/bluedroid/external/sbc/decoder/srce/alloc.c"
"host/bluedroid/external/sbc/decoder/srce/bitalloc-sbc.c"
"host/bluedroid/external/sbc/decoder/srce/bitalloc.c"
"host/bluedroid/external/sbc/decoder/srce/bitstream-decode.c"
"host/bluedroid/external/sbc/decoder/srce/decoder-oina.c"
"host/bluedroid/external/sbc/decoder/srce/decoder-private.c"
"host/bluedroid/external/sbc/decoder/srce/decoder-sbc.c"
"host/bluedroid/external/sbc/decoder/srce/dequant.c"
"host/bluedroid/external/sbc/decoder/srce/framing-sbc.c"
"host/bluedroid/external/sbc/decoder/srce/framing.c"
"host/bluedroid/external/sbc/decoder/srce/oi_codec_version.c"
"host/bluedroid/external/sbc/decoder/srce/synthesis-8-generated.c"
"host/bluedroid/external/sbc/decoder/srce/synthesis-dct8.c"
"host/bluedroid/external/sbc/decoder/srce/synthesis-sbc.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_analysis.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_dct.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_dct_coeffs.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_enc_bit_alloc_ste.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_enc_coeffs.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_encoder.c"
"host/bluedroid/external/sbc/encoder/srce/sbc_packing.c"
"host/bluedroid/external/sbc/plc/sbc_plc.c")
endif()
endif()
if(CONFIG_BLE_MESH)
@@ -938,6 +945,11 @@ if(CONFIG_BT_ENABLED)
if(CONFIG_BT_LE_CONTROLLER_LOG_WRAP_PANIC_HANDLER_ENABLE)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=esp_panic_handler")
endif()
if(CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED)
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=uart_tx_chars")
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=uart_write_bytes")
target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=uart_write_bytes_with_break")
endif()
if(CONFIG_IDF_TARGET_ESP32C6)
add_prebuilt_library(libble_app
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c6/libble_app.a"

View File

@@ -27,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
@@ -35,6 +50,21 @@ 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_HOST_BUF_SIZE
int "SPI transaction buffer size for host logs"
depends on BT_BLE_LOG_SPI_OUT_HOST_ENABLED
default 1024
help
SPI transaction buffer size for host logs.
There will be 2 SPI DMA buffers with the same size.
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
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
@@ -48,7 +78,7 @@ config BT_BLE_LOG_SPI_OUT_LL_TASK_BUF_SIZE
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 1024
help
SPI transaction buffer size for upper layer task logs.
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
@@ -56,9 +86,17 @@ config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 512
help
SPI transaction buffer size for upper layer ISR logs.
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
@@ -108,3 +146,108 @@ config BT_BLE_LOG_SPI_OUT_FLUSH_TIMEOUT
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
config BT_BLE_LOG_UHCI_OUT_ENABLED
bool "Output ble logs via UHCI (UART DMA) driver (Experimental)"
default n
help
Output ble logs via UHCI (UART DMA) driver
On enable, BT_BLE_LOG_UHCI_OUT_UART_PORT would be reinited with
BT_BLE_LOG_UHCI_OUT_UART_BAUD_RATE as new baud rate and
BT_BLE_LOG_UHCI_OUT_UART_IO_NUM_TX as new UART Tx IO
config BT_BLE_LOG_UHCI_OUT_UART_PORT
int "UART port connected to UHCI controller"
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
default 0
help
UART port connected to UHCI controller
If UART port 0 is selected, UART VFS Driver, UART ROM Driver
and UART Driver output would be redirected to BLE Log UHCI Out
to solve UART Tx FIFO multi-task access issue
config BT_BLE_LOG_UHCI_OUT_LL_TASK_BUF_SIZE
int "UHCI transaction buffer size for lower layer task logs"
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
default 1024
help
UHCI transaction buffer size for lower layer task logs
config BT_BLE_LOG_UHCI_OUT_LL_ISR_BUF_SIZE
int "UHCI transaction buffer size for lower layer ISR logs"
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
default 1024
help
UHCI transaction buffer size for lower layer ISR logs
config BT_BLE_LOG_UHCI_OUT_LL_HCI_BUF_SIZE
int "UHCI transaction buffer size for lower layer HCI logs"
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
default 1024
help
UHCI transaction buffer size for lower layer HCI logs
config BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
bool "Enable to init UART port"
depends on BT_BLE_LOG_UHCI_OUT_ENABLED
default y
help
Enable to init UART port
config BT_BLE_LOG_UHCI_OUT_UART_BAUD_RATE
int "Baud rate for BT_BLE_LOG_UHCI_OUT_UART_PORT"
depends on BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
default 3000000
help
Baud rate for BT_BLE_LOG_UHCI_OUT_UART_PORT
config BT_BLE_LOG_UHCI_OUT_UART_IO_NUM_TX
int "IO number for UART TX port"
depends on BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
default 0
help
IO number for UART TX port

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,780 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "ble_log/ble_log_uhci_out.h"
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
// Private includes
#include "esp_bt.h"
// sdkconfig defines
#define UHCI_OUT_LL_TASK_BUF_SIZE CONFIG_BT_BLE_LOG_UHCI_OUT_LL_TASK_BUF_SIZE
#define UHCI_OUT_LL_ISR_BUF_SIZE CONFIG_BT_BLE_LOG_UHCI_OUT_LL_ISR_BUF_SIZE
#define UHCI_OUT_LL_HCI_BUF_SIZE CONFIG_BT_BLE_LOG_UHCI_OUT_LL_HCI_BUF_SIZE
#define UHCI_OUT_UART_PORT CONFIG_BT_BLE_LOG_UHCI_OUT_UART_PORT
#define UHCI_OUT_UART_NEED_INIT CONFIG_BT_BLE_LOG_UHCI_OUT_UART_NEED_INIT
#if UHCI_OUT_UART_NEED_INIT
#define UHCI_OUT_UART_BAUD_RATE CONFIG_BT_BLE_LOG_UHCI_OUT_UART_BAUD_RATE
#define UHCI_OUT_UART_IO_NUM_TX CONFIG_BT_BLE_LOG_UHCI_OUT_UART_IO_NUM_TX
#endif // UHCI_OUT_UART_NEED_INIT
// Private defines
#define UHCI_OUT_MAX_TRANSFER_SIZE (10240)
#define UHCI_OUT_MALLOC(size) heap_caps_malloc(size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT)
#define UHCI_OUT_FLUSH_TIMEOUT_MS (100)
#define UHCI_OUT_FLUSH_TIMEOUT_US (UHCI_OUT_FLUSH_TIMEOUT_MS * 1000)
#define UHCI_OUT_USER_BUF_SIZE (512)
#define UHCI_OUT_UART_PORT0 (0)
#define UHCI_OUT_UART_PORT1 (1)
#define UHCI_OUT_UART_DRIVER_RX_BUF_SIZE (32)
// Queue size defines
#define UHCI_OUT_PING_PONG_BUF_CNT (2)
#define UHCI_OUT_USER_QUEUE_SIZE (UHCI_OUT_PING_PONG_BUF_CNT)
#define UHCI_OUT_LL_QUEUE_SIZE (3 * UHCI_OUT_PING_PONG_BUF_CNT)
#define UHCI_OUT_QUEUE_SIZE (UHCI_OUT_USER_QUEUE_SIZE + UHCI_OUT_LL_QUEUE_SIZE)
// Private typedefs
typedef struct {
// This flag is for multithreading, must be a word, do not modify
volatile uint32_t flag;
uint16_t buf_size;
uint16_t length;
uint8_t buffer[0];
} uhci_out_trans_cb_t;
typedef struct {
uhci_out_trans_cb_t *trans_cb[2];
uint8_t trans_cb_idx;
uint8_t type;
uint16_t lost_frame_cnt;
uint32_t lost_bytes_cnt;
uint32_t frame_sn;
} uhci_out_log_cb_t;
typedef struct {
uint16_t length;
uint8_t source;
uint8_t type;
uint16_t frame_sn;
} __attribute__((packed)) frame_head_t;
typedef struct {
uint8_t type;
uint16_t lost_frame_cnt;
uint32_t lost_bytes_cnt;
} __attribute__((packed)) loss_payload_t;
// Private enums
enum {
TRANS_CB_FLAG_AVAILABLE = 0,
TRANS_CB_FLAG_NEED_QUEUE,
TRANS_CB_FLAG_IN_QUEUE,
};
enum {
LOG_CB_TYPE_USER = 0,
LOG_CB_TYPE_LL,
};
enum {
LOG_CB_LL_SUBTYPE_TASK = 0,
LOG_CB_LL_SUBTYPE_ISR,
LOG_CB_LL_SUBTYPE_HCI
};
enum {
LL_LOG_FLAG_CONTINUE = 0,
LL_LOG_FLAG_END,
LL_LOG_FLAG_TASK,
LL_LOG_FLAG_ISR,
LL_LOG_FLAG_HCI,
LL_LOG_FLAG_RAW,
LL_LOG_FLAG_SYNC
};
enum {
LL_EV_FLAG_ISR_APPEND = 0,
LL_EV_FLAG_FLUSH_LOG,
};
// Private variables
static bool uhci_out_inited = false;
static uhci_controller_handle_t uhci_handle = NULL;
static bool user_log_inited = false;
static SemaphoreHandle_t user_log_mutex = NULL;
static uhci_out_log_cb_t *user_log_cb = NULL;
static uint32_t user_last_write_ts = 0;
static bool ll_log_inited = false;
static uhci_out_log_cb_t *ll_task_log_cb = NULL;
static uhci_out_log_cb_t *ll_isr_log_cb = NULL;
static uhci_out_log_cb_t *ll_hci_log_cb = NULL;
static uint32_t ll_ev_flags = 0;
static uint32_t ll_last_write_ts = 0;
static esp_timer_handle_t flush_timer = NULL;
// Private function declarations
extern void esp_panic_handler_feed_wdts(void);
static int uhci_out_init_trans(uhci_out_trans_cb_t **trans_cb, uint16_t buf_size);
static void uhci_out_deinit_trans(uhci_out_trans_cb_t **trans_cb);
static bool uhci_out_tx_done_cb(uhci_controller_handle_t uhci_ctrl,
const uhci_tx_done_event_data_t *edata, void *user_ctx);
static inline void uhci_out_append_trans(uhci_out_trans_cb_t *trans_cb);
static int uhci_out_log_cb_init(uhci_out_log_cb_t **log_cb, uint16_t buf_size, uint8_t type, uint8_t idx);
static void uhci_out_log_cb_deinit(uhci_out_log_cb_t **log_cb);
static inline bool uhci_out_log_cb_check_trans(uhci_out_log_cb_t *log_cb, uint16_t len, bool *need_append);
static inline void uhci_out_log_cb_append_trans(uhci_out_log_cb_t *log_cb);
static inline void uhci_out_log_cb_flush_trans(uhci_out_log_cb_t *log_cb);
static bool uhci_out_log_cb_write(uhci_out_log_cb_t *log_cb, const uint8_t *addr, uint16_t len,
const uint8_t *addr_append, uint16_t len_append, uint8_t source);
static void uhci_out_log_cb_write_loss(uhci_out_log_cb_t *log_cb);
static void uhci_out_log_cb_dump(uhci_out_log_cb_t *log_cb);
static void esp_timer_cb_log_flush(void);
static void uhci_out_user_write_str(const uint8_t *src, uint16_t len);
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
static void uhci_out_user_write_char(char c);
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
static int uhci_out_user_log_init(void);
static void uhci_out_user_log_deinit(void);
static int uhci_out_ll_log_init(void);
static void uhci_out_ll_log_deinit(void);
static void uhci_out_ll_log_flush(void);
#if defined(CONFIG_IDF_TARGET_ESP32H2) || defined(CONFIG_IDF_TARGET_ESP32C6) || defined(CONFIG_IDF_TARGET_ESP32C5) ||\
defined(CONFIG_IDF_TARGET_ESP32C61) || defined(CONFIG_IDF_TARGET_ESP32H21)
extern void r_ble_log_simple_put_ev(void);
#define UHCI_OUT_LL_PUT_EV r_ble_log_simple_put_ev()
#elif defined(CONFIG_IDF_TARGET_ESP32C2)
extern void ble_log_simple_put_ev(void);
#define UHCI_OUT_LL_PUT_EV ble_log_simple_put_ev()
#else
#define UHCI_OUT_LL_PUT_EV
#endif
// Private macros
#define UHCI_OUT_FRAME_HEAD_LEN (sizeof(frame_head_t))
#define UHCI_OUT_FRAME_TAIL_LEN (sizeof(uint32_t))
#define UHCI_OUT_FRAME_OVERHEAD (UHCI_OUT_FRAME_HEAD_LEN + UHCI_OUT_FRAME_TAIL_LEN)
#define UHCI_OUT_GET_FRAME_SN(VAR) __atomic_fetch_add(VAR, 1, __ATOMIC_RELAXED)
// Private functions
static int uhci_out_init_trans(uhci_out_trans_cb_t **trans_cb, uint16_t buf_size)
{
// Memory allocations
size_t cb_size = sizeof(uhci_out_trans_cb_t) + buf_size;
*trans_cb = (uhci_out_trans_cb_t *)UHCI_OUT_MALLOC(cb_size);
if (!(*trans_cb)) {
return -1;
}
memset(*trans_cb, 0, sizeof(uhci_out_trans_cb_t));
// Initialization
(*trans_cb)->buf_size = buf_size;
return 0;
}
static void uhci_out_deinit_trans(uhci_out_trans_cb_t **trans_cb)
{
if (!(*trans_cb)) {
return;
}
free(*trans_cb);
*trans_cb = NULL;
return;
}
IRAM_ATTR static bool uhci_out_tx_done_cb(uhci_controller_handle_t uhci_ctrl,
const uhci_tx_done_event_data_t *edata, void *user_ctx)
{
uhci_out_trans_cb_t *trans_cb = (uhci_out_trans_cb_t *)((uint8_t *)edata->buffer - sizeof(uhci_out_trans_cb_t));
trans_cb->length = 0;
trans_cb->flag = TRANS_CB_FLAG_AVAILABLE;
return true;
}
IRAM_ATTR static inline void uhci_out_append_trans(uhci_out_trans_cb_t *trans_cb)
{
if ((trans_cb->flag != TRANS_CB_FLAG_NEED_QUEUE) || !trans_cb->length) {
return;
}
// Note: If task yield after transmission but before flag set
// flag might be reset in tx done ISR before flag set, leading to buffer access failure
trans_cb->flag = TRANS_CB_FLAG_IN_QUEUE;
if (uhci_transmit(uhci_handle, trans_cb->buffer, trans_cb->length) != ESP_OK) {
goto recycle;
}
return;
recycle:
trans_cb->length = 0;
trans_cb->flag = TRANS_CB_FLAG_AVAILABLE;
return;
}
static int uhci_out_log_cb_init(uhci_out_log_cb_t **log_cb, uint16_t buf_size, uint8_t type, uint8_t idx)
{
// Initialize log control block
*log_cb = (uhci_out_log_cb_t *)UHCI_OUT_MALLOC(sizeof(uhci_out_log_cb_t));
if (!(*log_cb)) {
return -1;
}
memset(*log_cb, 0, sizeof(uhci_out_log_cb_t));
// Initialize transactions
int ret = 0;
for (uint8_t i = 0; i < 2; i++) {
ret |= uhci_out_init_trans(&((*log_cb)->trans_cb[i]), buf_size);
}
if (ret != 0) {
uhci_out_log_cb_deinit(log_cb);
return -1;
}
(*log_cb)->type = (type << 4) | (idx);
return 0;
}
static void uhci_out_log_cb_deinit(uhci_out_log_cb_t **log_cb)
{
if (!(*log_cb)) {
return;
}
for (uint8_t i = 0; i < 2; i++) {
if ((*log_cb)->trans_cb[i]) {
uhci_out_deinit_trans(&((*log_cb)->trans_cb[i]));
}
}
free(*log_cb);
*log_cb = NULL;
return;
}
IRAM_ATTR static inline bool uhci_out_log_cb_check_trans(uhci_out_log_cb_t *log_cb, uint16_t len, bool *need_append)
{
uhci_out_trans_cb_t *trans_cb;
*need_append = false;
for (uint8_t i = 0; i < 2; i++) {
trans_cb = log_cb->trans_cb[log_cb->trans_cb_idx];
if (len > trans_cb->buf_size) {
goto failed;
}
if (trans_cb->flag == TRANS_CB_FLAG_AVAILABLE) {
if ((trans_cb->buf_size - trans_cb->length) >= len) {
return true;
} else {
trans_cb->flag = TRANS_CB_FLAG_NEED_QUEUE;
*need_append = true;
}
}
log_cb->trans_cb_idx = !(log_cb->trans_cb_idx);
}
failed:
log_cb->lost_bytes_cnt += len;
log_cb->lost_frame_cnt++;
return false;
}
// CRITICAL: Shall not be called from ISR!
IRAM_ATTR static inline void uhci_out_log_cb_append_trans(uhci_out_log_cb_t *log_cb)
{
uhci_out_trans_cb_t *trans_cb;
uint8_t idx = !log_cb->trans_cb_idx;
for (uint8_t i = 0; i < 2; i++) {
trans_cb = log_cb->trans_cb[idx];
if (trans_cb->flag == TRANS_CB_FLAG_NEED_QUEUE) {
uhci_out_append_trans(trans_cb);
}
idx = !idx;
}
}
IRAM_ATTR static inline void uhci_out_log_cb_flush_trans(uhci_out_log_cb_t *log_cb)
{
uhci_out_trans_cb_t *trans_cb;
for (uint8_t i = 0; i < 2; i++) {
trans_cb = log_cb->trans_cb[i];
if (trans_cb->length && (trans_cb->flag == TRANS_CB_FLAG_AVAILABLE)) {
trans_cb->flag = TRANS_CB_FLAG_NEED_QUEUE;
}
}
}
// Return value: Need append
IRAM_ATTR static bool uhci_out_log_cb_write(uhci_out_log_cb_t *log_cb, const uint8_t *addr, uint16_t len,
const uint8_t *addr_append, uint16_t len_append, uint8_t source)
{
uhci_out_trans_cb_t *trans_cb = log_cb->trans_cb[log_cb->trans_cb_idx];
uint8_t *buf = trans_cb->buffer + trans_cb->length;
uint16_t total_length = len + len_append;
frame_head_t head = {
.length = total_length,
.source = source,
.type = log_cb->type,
.frame_sn = UHCI_OUT_GET_FRAME_SN(&(log_cb->frame_sn)) & 0xFFFF,
};
memcpy(buf, (const uint8_t *)&head, UHCI_OUT_FRAME_HEAD_LEN);
memcpy(buf + UHCI_OUT_FRAME_HEAD_LEN, addr, len);
if (len_append && addr_append) {
memcpy(buf + UHCI_OUT_FRAME_HEAD_LEN + len, addr_append, len_append);
}
uint32_t checksum = 0;
for (int i = 0; i < UHCI_OUT_FRAME_HEAD_LEN + total_length; i++) {
checksum += buf[i];
}
memcpy(buf + UHCI_OUT_FRAME_HEAD_LEN + total_length, &checksum, UHCI_OUT_FRAME_TAIL_LEN);
trans_cb->length += total_length + UHCI_OUT_FRAME_OVERHEAD;
if ((trans_cb->buf_size - trans_cb->length) <= UHCI_OUT_FRAME_OVERHEAD) {
trans_cb->flag = TRANS_CB_FLAG_NEED_QUEUE;
return true;
}
return false;
}
IRAM_ATTR static void uhci_out_log_cb_write_loss(uhci_out_log_cb_t *log_cb)
{
if (!log_cb->lost_bytes_cnt || !log_cb->lost_frame_cnt) {
return;
}
bool need_append;
uint16_t frame_len = sizeof(loss_payload_t) + UHCI_OUT_FRAME_OVERHEAD;
if (uhci_out_log_cb_check_trans(log_cb, frame_len, &need_append)) {
loss_payload_t payload = {
.type = log_cb->type,
.lost_frame_cnt = log_cb->lost_frame_cnt,
.lost_bytes_cnt = log_cb->lost_bytes_cnt,
};
uhci_out_log_cb_write(log_cb, (const uint8_t *)&payload, sizeof(loss_payload_t),
NULL, 0, BLE_LOG_UHCI_OUT_SOURCE_LOSS);
log_cb->lost_frame_cnt = 0;
log_cb->lost_bytes_cnt = 0;
}
}
static void uhci_out_log_cb_dump(uhci_out_log_cb_t *log_cb)
{
uhci_out_trans_cb_t *trans_cb;
uint8_t *buf;
for (uint8_t i = 0; i < 2; i++) {
// Dump the last transaction before dumping the current transaction
log_cb->trans_cb_idx = !(log_cb->trans_cb_idx);
trans_cb = log_cb->trans_cb[log_cb->trans_cb_idx];
buf = (uint8_t *)trans_cb->buffer;
for (uint16_t j = 0; j < trans_cb->buf_size; j++) {
esp_rom_printf("%02x ", buf[j]);
// Feed watchdogs periodically to avoid wdts timeout
if ((j % 100) == 0) {
esp_panic_handler_feed_wdts();
}
}
}
}
static void esp_timer_cb_log_flush(void)
{
uint32_t os_ts = pdTICKS_TO_MS(xTaskGetTickCount());
if ((os_ts - user_last_write_ts) > UHCI_OUT_FLUSH_TIMEOUT_MS) {
xSemaphoreTake(user_log_mutex, portMAX_DELAY);
uhci_out_log_cb_flush_trans(user_log_cb);
uhci_out_log_cb_append_trans(user_log_cb);
xSemaphoreGive(user_log_mutex);
}
if ((esp_bt_controller_get_status() >= ESP_BT_CONTROLLER_STATUS_INITED) &&
((os_ts - ll_last_write_ts) > UHCI_OUT_FLUSH_TIMEOUT_MS)) {
ll_ev_flags |= BIT(LL_EV_FLAG_FLUSH_LOG);
UHCI_OUT_LL_PUT_EV;
}
esp_timer_start_once(flush_timer, UHCI_OUT_FLUSH_TIMEOUT_US);
}
static void uhci_out_user_write_str(const uint8_t *src, uint16_t len)
{
if (!user_log_inited || !src || !len) {
return;
}
xSemaphoreTake(user_log_mutex, portMAX_DELAY);
bool need_append;
if (uhci_out_log_cb_check_trans(user_log_cb, len, &need_append)) {
uhci_out_trans_cb_t *trans_cb = user_log_cb->trans_cb[user_log_cb->trans_cb_idx];
uint8_t *buf = trans_cb->buffer + trans_cb->length;
memcpy(buf, (const uint8_t *)src, len);
trans_cb->length += len;
}
if (need_append) {
uhci_out_log_cb_append_trans(user_log_cb);
}
user_last_write_ts = pdTICKS_TO_MS(xTaskGetTickCount());
xSemaphoreGive(user_log_mutex);
}
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
static void uhci_out_user_write_char(char c)
{
uhci_out_user_write_str((const uint8_t *)&c, 1);
}
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
static int uhci_out_user_log_init(void)
{
if (user_log_inited) {
return 0;
}
// Initialize mutex
user_log_mutex = xSemaphoreCreateMutex();
if (!user_log_mutex) {
goto failed;
}
// Initialize log control block
if (uhci_out_log_cb_init(&user_log_cb, UHCI_OUT_USER_BUF_SIZE, LOG_CB_TYPE_USER, 0) != 0) {
goto failed;
}
// Initialization done
user_log_inited = true;
return 0;
failed:
uhci_out_user_log_deinit();
return -1;
}
static void uhci_out_user_log_deinit(void)
{
user_log_inited = false;
if (!user_log_mutex) {
return;
}
xSemaphoreTake(user_log_mutex, portMAX_DELAY);
uhci_out_log_cb_deinit(&user_log_cb);
xSemaphoreGive(user_log_mutex);
vSemaphoreDelete(user_log_mutex);
user_log_mutex = NULL;
}
static int uhci_out_ll_log_init(void)
{
if (ll_log_inited) {
return 0;
}
if (uhci_out_log_cb_init(&ll_task_log_cb, UHCI_OUT_LL_TASK_BUF_SIZE,
LOG_CB_TYPE_LL, LOG_CB_LL_SUBTYPE_TASK) != 0) {
goto failed;
}
if (uhci_out_log_cb_init(&ll_isr_log_cb, UHCI_OUT_LL_ISR_BUF_SIZE,
LOG_CB_TYPE_LL, LOG_CB_LL_SUBTYPE_ISR) != 0) {
goto failed;
}
if (uhci_out_log_cb_init(&ll_hci_log_cb, UHCI_OUT_LL_HCI_BUF_SIZE,
LOG_CB_TYPE_LL, LOG_CB_LL_SUBTYPE_HCI) != 0) {
goto failed;
}
ll_log_inited = true;
return 0;
failed:
uhci_out_ll_log_deinit();
return -1;
}
static void uhci_out_ll_log_deinit(void)
{
ll_log_inited = false;
uhci_out_log_cb_deinit(&ll_hci_log_cb);
uhci_out_log_cb_deinit(&ll_isr_log_cb);
uhci_out_log_cb_deinit(&ll_task_log_cb);
}
static void uhci_out_ll_log_flush(void)
{
if (!ll_log_inited) {
return;
}
uhci_out_log_cb_write_loss(ll_task_log_cb);
uhci_out_log_cb_write_loss(ll_hci_log_cb);
uhci_out_log_cb_flush_trans(ll_task_log_cb);
uhci_out_log_cb_flush_trans(ll_hci_log_cb);
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
uhci_out_log_cb_write_loss(ll_isr_log_cb);
uhci_out_log_cb_flush_trans(ll_isr_log_cb);
portEXIT_CRITICAL_SAFE(&spinlock);
uhci_out_log_cb_append_trans(ll_task_log_cb);
uhci_out_log_cb_append_trans(ll_hci_log_cb);
uhci_out_log_cb_append_trans(ll_isr_log_cb);
}
// Public functions
int ble_log_uhci_out_init(void)
{
// Avoid double init
if (uhci_out_inited) {
return 0;
}
#if UHCI_OUT_UART_NEED_INIT
uart_config_t uart_config = {
.baud_rate = UHCI_OUT_UART_BAUD_RATE,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_CTS_RTS,
.rx_flow_ctrl_thresh = 122,
};
// Configure UART parameters
uart_param_config(UHCI_OUT_UART_PORT, &uart_config);
uart_set_pin(UHCI_OUT_UART_PORT, UHCI_OUT_UART_IO_NUM_TX, -1, -1, -1);
#endif // UHCI_OUT_UART_NEED_INIT
uhci_controller_config_t uhci_config = {
.uart_port = UHCI_OUT_UART_PORT,
.tx_trans_queue_depth = UHCI_OUT_QUEUE_SIZE,
.max_receive_internal_mem = 1024,
.max_transmit_size = UHCI_OUT_MAX_TRANSFER_SIZE,
.dma_burst_size = 32,
.rx_eof_flags.idle_eof = 1,
};
if (uhci_new_controller(&uhci_config, &uhci_handle) != ESP_OK) {
goto failed;
}
uhci_event_callbacks_t uhci_cbs = {
.on_tx_trans_done = uhci_out_tx_done_cb,
};
uhci_register_event_callbacks(uhci_handle, &uhci_cbs, NULL);
if (uhci_out_user_log_init() != 0) {
goto failed;
}
if (uhci_out_ll_log_init() != 0) {
goto failed;
}
esp_timer_create_args_t timer_args = {
.callback = (esp_timer_cb_t)esp_timer_cb_log_flush,
.dispatch_method = ESP_TIMER_TASK
};
if (esp_timer_create(&timer_args, &flush_timer) != ESP_OK) {
goto failed;
}
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
// Install UART Driver if not installed
if (!uart_is_driver_installed(UHCI_OUT_UART_PORT0)) {
uart_driver_install(UHCI_OUT_UART_PORT0, UHCI_OUT_UART_DRIVER_RX_BUF_SIZE, 0, 0, NULL, 0);
}
// Redirect UART VFS Driver to UART Driver
uart_vfs_dev_use_driver(UHCI_OUT_UART_PORT0);
// Redirect esp_rom_printf to BLE Log UHCI Out
esp_rom_install_channel_putc(1, uhci_out_user_write_char);
esp_rom_install_channel_putc(2, NULL);
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
uhci_out_inited = true;
esp_timer_start_once(flush_timer, UHCI_OUT_FLUSH_TIMEOUT_US);
return 0;
failed:
ble_log_uhci_out_deinit();
return -1;
}
void ble_log_uhci_out_deinit(void)
{
uhci_out_inited = false;
if (flush_timer) {
esp_timer_stop(flush_timer);
esp_timer_delete(flush_timer);
flush_timer = NULL;
}
if (uhci_handle) {
uhci_wait_all_tx_transaction_done(uhci_handle, portMAX_DELAY);
uhci_del_controller(uhci_handle);
uhci_handle = NULL;
}
uhci_out_ll_log_deinit();
uhci_out_user_log_deinit();
}
IRAM_ATTR void ble_log_uhci_out_ll_write(uint32_t len, const uint8_t *addr, uint32_t len_append,
const uint8_t *addr_append, uint32_t flag)
{
// Raw logs will come in case of assert, shall be printed to console directly
if (flag & BIT(LL_LOG_FLAG_RAW)) {
if (len && addr) {
for (uint32_t i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (uint32_t i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (flag & BIT(LL_LOG_FLAG_END)) { esp_rom_printf("\n"); }
}
if (!ll_log_inited) {
return;
}
bool in_isr = false;
uint8_t source;
uhci_out_log_cb_t *log_cb;
if (flag & BIT(LL_LOG_FLAG_ISR)) {
log_cb = ll_isr_log_cb;
source = BLE_LOG_UHCI_OUT_SOURCE_ESP_ISR;
in_isr = true;
} else if (flag & BIT(LL_LOG_FLAG_HCI)) {
log_cb = ll_hci_log_cb;
source = BLE_LOG_UHCI_OUT_SOURCE_LL_HCI;
} else {
log_cb = ll_task_log_cb;
source = BLE_LOG_UHCI_OUT_SOURCE_ESP;
}
bool need_append;
uint16_t frame_len = len + len_append + UHCI_OUT_FRAME_OVERHEAD;
if (uhci_out_log_cb_check_trans(log_cb, frame_len, &need_append)) {
need_append |= uhci_out_log_cb_write(log_cb, addr, len, addr_append,
len_append, source);
}
ll_last_write_ts = in_isr?\
pdTICKS_TO_MS(xTaskGetTickCountFromISR()):\
pdTICKS_TO_MS(xTaskGetTickCount());
if (need_append) {
if (in_isr) {
ll_ev_flags |= BIT(LL_EV_FLAG_ISR_APPEND);
UHCI_OUT_LL_PUT_EV;
} else {
uhci_out_log_cb_append_trans(log_cb);
}
}
}
IRAM_ATTR void ble_log_uhci_out_ll_log_ev_proc(void)
{
if (!ll_log_inited) {
return;
}
if (ll_ev_flags & BIT(LL_EV_FLAG_ISR_APPEND)) {
uhci_out_log_cb_append_trans(ll_isr_log_cb);
ll_ev_flags &= ~BIT(LL_EV_FLAG_ISR_APPEND);
}
if (ll_ev_flags & BIT(LL_EV_FLAG_FLUSH_LOG)) {
uhci_out_ll_log_flush();
ll_ev_flags &= ~BIT(LL_EV_FLAG_FLUSH_LOG);
}
ll_ev_flags = 0;
}
// Redirect UART Driver to BLE Log UHCI Out
int __real_uart_tx_chars(uart_port_t uart_num, const char *buffer, uint32_t len);
int __wrap_uart_tx_chars(uart_port_t uart_num, const char *buffer, uint32_t len)
{
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
uhci_out_user_write_str((const uint8_t *)buffer, len);
return 0;
#else
return __real_uart_tx_chars(uart_num, buffer, len);
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
}
int __real_uart_write_bytes(uart_port_t uart_num, const void *src, size_t size);
int __wrap_uart_write_bytes(uart_port_t uart_num, const void *src, size_t size)
{
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
uhci_out_user_write_str((const uint8_t *)src, size);
return 0;
#else
return __real_uart_write_bytes(uart_num, src, size);
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
}
int __real_uart_write_bytes_with_break(uart_port_t uart_num, const void *src, size_t size, int brk_len);
int __wrap_uart_write_bytes_with_break(uart_port_t uart_num, const void *src, size_t size, int brk_len)
{
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
return __wrap_uart_write_bytes(uart_num, src, size);
#else
return __real_uart_write_bytes_with_break(uart_num, src, size, brk_len);
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
}
void ble_log_uhci_out_dump_all(void)
{
if (!uhci_out_inited) {
return;
}
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
esp_rom_output_tx_wait_idle(UHCI_OUT_UART_PORT0);
esp_rom_install_uart_printf();
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
if (ll_log_inited) {
esp_rom_printf("[DUMP_START:\n");
uhci_out_log_cb_dump(ll_isr_log_cb);
uhci_out_log_cb_dump(ll_task_log_cb);
uhci_out_log_cb_dump(ll_hci_log_cb);
esp_rom_printf("\n:DUMP_END]\n\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
#if UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
esp_rom_install_channel_putc(1, uhci_out_user_write_char);
#endif // UHCI_OUT_UART_PORT == UHCI_OUT_UART_PORT0
}
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED

View File

@@ -11,30 +11,38 @@
#include "driver/spi_master.h"
#include "driver/gpio.h"
#include "esp_timer.h"
#include "esp_log.h"
#include "freertos/semphr.h"
#include "esp_heap_caps.h"
#include "esp_task.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_ESP_ISR 6
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR 7
#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
int ble_log_spi_out_init(void);
@@ -46,9 +54,12 @@ void ble_log_spi_out_ll_write(uint32_t len, const uint8_t *addr, uint32_t len_ap
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, ...);
int 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

@@ -0,0 +1,35 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __BT_SPI_OUT_H__
#define __BT_SPI_OUT_H__
#include <stdarg.h>
#include <string.h>
#include "driver/uhci.h"
#include "driver/uart.h"
#include "driver/uart_vfs.h"
#include "esp_rom_uart.h"
#include "esp_timer.h"
#include "freertos/semphr.h"
// Public enums
enum {
BLE_LOG_UHCI_OUT_SOURCE_ESP = 0,
BLE_LOG_UHCI_OUT_SOURCE_ESP_ISR = 6,
BLE_LOG_UHCI_OUT_SOURCE_LL_HCI = 8,
BLE_LOG_UHCI_OUT_SOURCE_USER = 0x10,
BLE_LOG_UHCI_OUT_SOURCE_LOSS = 0xFF,
};
// Public functions
int ble_log_uhci_out_init(void);
void ble_log_uhci_out_deinit(void);
void ble_log_uhci_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_uhci_out_ll_log_ev_proc(void);
void ble_log_uhci_out_dump_all(void);
#endif // __BT_SPI_OUT_H__

View File

@@ -490,10 +490,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

View File

@@ -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;

View File

@@ -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)
@@ -208,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;
@@ -219,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);
@@ -250,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';
@@ -266,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

@@ -459,6 +459,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.

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);
@@ -261,6 +262,7 @@ extern void bt_stack_enableCoexVsCmd(bool en);
extern void scan_stack_enableAdvFlowCtrlVsCmd(bool en);
extern void adv_stack_enableClearLegacyAdvVsCmd(bool en);
extern void advFilter_stack_enableDupExcListVsCmd(bool en);
extern void arr_stack_enableMultiConnVsCmd(bool en);
#endif // (CONFIG_BT_NIMBLE_ENABLED) || (CONFIG_BT_BLUEDROID_ENABLED)
/* Local Function Declare
@@ -965,7 +967,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 +1542,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);
@@ -1701,6 +1705,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
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
@@ -1723,6 +1728,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
scan_stack_enableAdvFlowCtrlVsCmd(true);
adv_stack_enableClearLegacyAdvVsCmd(true);
advFilter_stack_enableDupExcListVsCmd(true);
arr_stack_enableMultiConnVsCmd(true);
#endif // (CONFIG_BT_NIMBLE_ENABLED) || (CONFIG_BT_BLUEDROID_ENABLED)
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
@@ -1762,6 +1768,7 @@ esp_err_t esp_bt_controller_deinit(void)
scan_stack_enableAdvFlowCtrlVsCmd(false);
adv_stack_enableClearLegacyAdvVsCmd(false);
advFilter_stack_enableDupExcListVsCmd(false);
arr_stack_enableMultiConnVsCmd(false);
#endif // (CONFIG_BT_NIMBLE_ENABLED) || (CONFIG_BT_BLUEDROID_ENABLED)
return ESP_OK;
@@ -1848,6 +1855,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

@@ -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
@@ -584,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.

View File

@@ -13,6 +13,7 @@
*/
#if (CONFIG_BT_NIMBLE_ENABLED || CONFIG_BT_BLUEDROID_ENABLED)
void scan_stack_enableAdvFlowCtrlVsCmd(bool en);
void scan_stack_enableSpecifyScanChanVsCmd(bool en);
void adv_stack_enableClearLegacyAdvVsCmd(bool en);
void chanSel_stack_enableSetCsaVsCmd(bool en);
void hci_stack_enableSetVsEvtMaskVsCmd(bool en);
@@ -34,6 +35,7 @@ void ble_stack_enableVsCmds(bool en)
#if DEFAULT_BT_LE_ROLE_OBSERVER
scan_stack_enableAdvFlowCtrlVsCmd(en);
scan_stack_enableSpecifyScanChanVsCmd(en);
#endif // DEFAULT_BT_LE_ROLE_OBSERVER
chanSel_stack_enableSetCsaVsCmd(en);

View File

@@ -119,6 +119,11 @@ struct ext_funcs_t {
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
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
@@ -136,7 +141,7 @@ 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);
@@ -411,20 +416,22 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
#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 ? true : false;
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();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
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
}
@@ -1070,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);
@@ -1084,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;
}
@@ -1567,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

@@ -231,7 +231,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,
@@ -416,10 +416,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
@@ -530,30 +530,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
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
@@ -598,6 +599,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

@@ -312,6 +312,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;
@@ -540,7 +551,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)
{
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
@@ -1265,6 +1276,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)
@@ -1599,15 +1650,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
@@ -1619,6 +1666,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;
@@ -1629,6 +1677,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);
@@ -1637,6 +1686,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);
@@ -1758,6 +1809,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
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

View File

@@ -320,6 +320,16 @@ menu "Controller debug features"
help
Output ble controller logs to SPI bus
config BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
bool "Output ble controller logs via UART DMA (Experimental)"
depends on BT_LE_CONTROLLER_LOG_ENABLED
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on !BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
select BT_BLE_LOG_UHCI_OUT_ENABLED
default y
help
Output ble controller logs via UART DMA
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
@@ -406,6 +416,12 @@ menu "Controller debug features"
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
@@ -681,7 +697,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 +821,45 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
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

@@ -17,6 +17,28 @@ void base_stack_deinitEnv(void);
int base_stack_enable(void);
void base_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
int conn_stack_initEnv(void);
void conn_stack_deinitEnv(void);
int conn_stack_enable(void);
@@ -85,6 +107,27 @@ 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) {
@@ -97,7 +140,6 @@ int ble_stack_initEnv(void)
}
#endif // CONFIG_BT_LE_ERROR_SIM_ENABLED
#endif // DEFAULT_BT_LE_MAX_CONNECTIONS
return 0;
}
@@ -109,7 +151,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();
}
@@ -122,6 +169,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) {
@@ -143,7 +212,20 @@ int ble_stack_enable(void)
#if CONFIG_BT_LE_RXBUF_OPT_ENABLED
mmgmt_enableRxbufOptFeature();
#endif // CONFIG_BT_LE_RXBUF_OPT_ENABLED
rc = adv_stack_enable();
if (rc) {
return rc;
}
rc = extAdv_stack_enable();
if (rc) {
return rc;
}
rc = sync_stack_enable();
if (rc) {
return rc;
}
return 0;
}
@@ -160,6 +242,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

@@ -60,6 +60,10 @@
#include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
#include "ble_log/ble_log_uhci_out.h"
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
/* Macro definition
************************************************************************
*/
@@ -67,7 +71,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,14 +102,17 @@ 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, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
@@ -140,8 +147,7 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
extern void r_ble_ll_scan_start_time_init_compensation(uint32_t init_compensation);
extern void r_priv_sdk_config_insert_proc_time_set(uint16_t insert_proc_time);
extern void esp_ble_controller_flash_only_param_config(void);
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
@@ -182,14 +188,13 @@ 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
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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
@@ -216,25 +221,35 @@ esp_err_t esp_bt_controller_log_init(void)
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
if (ble_log_uhci_out_init() != 0) {
goto uhci_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
if (r_ble_log_init_simple(ble_log_uhci_out_ll_write, ble_log_uhci_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else
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
#endif
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
#endif
if (r_ble_log_init_async(esp_bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size) != 0) {
goto log_init_failed;
@@ -250,14 +265,20 @@ esp_err_t esp_bt_controller_log_init(void)
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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
r_ble_log_deinit_simple();
#else
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif
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
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_deinit();
uhci_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
return ESP_FAIL;
}
@@ -267,11 +288,17 @@ void esp_bt_controller_log_deinit(void)
ble_log_spi_out_deinit();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_deinit();
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
r_ble_log_deinit_simple();
#else
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif
log_is_inited = false;
}
@@ -459,15 +486,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)
{
@@ -1115,8 +1136,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
r_ble_ll_scan_start_time_init_compensation(500);
r_priv_sdk_config_insert_proc_time_set(500);
esp_ble_controller_flash_only_param_config();
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
if (ble_stack_enable() != 0) {
@@ -1416,27 +1436,29 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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 ? true : false;
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();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
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
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
@@ -1444,9 +1466,13 @@ void esp_ble_controller_log_dump_all(bool output)
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
@@ -1675,7 +1701,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;
@@ -1702,3 +1728,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
@@ -274,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

@@ -361,6 +361,16 @@ menu "Controller debug features"
help
Output ble controller logs to SPI bus
config BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
bool "Output ble controller logs via UART DMA (Experimental)"
depends on BT_LE_CONTROLLER_LOG_ENABLED
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on !BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
select BT_BLE_LOG_UHCI_OUT_ENABLED
default y
help
Output ble controller logs via UART DMA
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
@@ -447,6 +457,12 @@ menu "Controller debug features"
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
@@ -721,7 +737,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.
@@ -839,3 +855,45 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
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);
@@ -104,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;
}
@@ -115,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();
}
@@ -128,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) {
@@ -166,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

@@ -58,11 +58,16 @@
#include "hal/efuse_hal.h"
#include "soc/rtc.h"
#include "modem/modem_syscon_struct.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
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
#include "ble_log/ble_log_uhci_out.h"
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
/* Macro definition
************************************************************************
*/
@@ -70,7 +75,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
@@ -101,17 +106,29 @@ 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, 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);
@@ -143,8 +160,7 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
extern void r_ble_ll_scan_start_time_init_compensation(uint32_t init_compensation);
extern void r_priv_sdk_config_insert_proc_time_set(uint16_t insert_proc_time);
extern void esp_ble_controller_flash_only_param_config(void);
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
@@ -185,14 +201,16 @@ 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
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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
@@ -219,11 +237,21 @@ esp_err_t esp_bt_controller_log_init(void)
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
if (ble_log_uhci_out_init() != 0) {
goto uhci_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
if (r_ble_log_init_simple(ble_log_uhci_out_ll_write, ble_log_uhci_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
@@ -237,12 +265,12 @@ esp_err_t esp_bt_controller_log_init(void)
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
#endif
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
#endif
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;
@@ -253,14 +281,20 @@ esp_err_t esp_bt_controller_log_init(void)
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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
r_ble_log_deinit_simple();
#else
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif
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
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_deinit();
uhci_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
return ESP_FAIL;
}
@@ -270,11 +304,17 @@ void esp_bt_controller_log_deinit(void)
ble_log_spi_out_deinit();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_deinit();
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
r_ble_log_deinit_simple();
#else
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif
log_is_inited = false;
}
@@ -463,15 +503,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)
{
@@ -1148,8 +1207,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
r_ble_ll_scan_start_time_init_compensation(500);
r_priv_sdk_config_insert_proc_time_set(500);
esp_ble_controller_flash_only_param_config();
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
if (ble_stack_enable() != 0) {
@@ -1449,27 +1507,29 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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 ? true : false;
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();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
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
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
@@ -1477,9 +1537,13 @@ void esp_ble_controller_log_dump_all(bool output)
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
@@ -1708,7 +1772,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;
@@ -1735,3 +1799,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

@@ -195,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
@@ -277,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

@@ -355,6 +355,16 @@ menu "Controller debug features"
help
Output ble controller logs to SPI bus
config BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
bool "Output ble controller logs via UART DMA (Experimental)"
depends on BT_LE_CONTROLLER_LOG_ENABLED
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on !BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
select BT_BLE_LOG_UHCI_OUT_ENABLED
default y
help
Output ble controller logs via UART DMA
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
@@ -441,6 +451,12 @@ menu "Controller debug features"
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
@@ -716,7 +732,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.
@@ -843,3 +859,45 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
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);
@@ -85,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) {
@@ -109,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();
}
@@ -122,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) {
@@ -160,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

@@ -59,6 +59,10 @@
#include "ble_log/ble_log_spi_out.h"
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
#include "ble_log/ble_log_uhci_out.h"
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
/* Macro definition
************************************************************************
*/
@@ -66,7 +70,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
@@ -97,12 +101,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, 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
************************************************************************
@@ -138,8 +146,7 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
extern void r_ble_ll_scan_start_time_init_compensation(uint32_t init_compensation);
extern void r_priv_sdk_config_insert_proc_time_set(uint16_t insert_proc_time);
extern void esp_ble_controller_flash_only_param_config(void);
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
@@ -183,14 +190,13 @@ 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
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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
@@ -217,11 +223,21 @@ esp_err_t esp_bt_controller_log_init(void)
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
if (ble_log_uhci_out_init() != 0) {
goto uhci_out_init_failed;
}
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
if (r_ble_log_init_simple(ble_log_uhci_out_ll_write, ble_log_uhci_out_ll_log_ev_proc) != 0) {
goto log_init_failed;
}
#else
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
@@ -235,12 +251,12 @@ esp_err_t esp_bt_controller_log_init(void)
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
#endif
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
#endif
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;
@@ -251,14 +267,20 @@ esp_err_t esp_bt_controller_log_init(void)
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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
r_ble_log_deinit_simple();
#else
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif
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
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_deinit();
uhci_out_init_failed:
#endif // CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
return ESP_FAIL;
}
@@ -268,11 +290,17 @@ void esp_bt_controller_log_deinit(void)
ble_log_spi_out_deinit();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_deinit();
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
r_ble_log_deinit_simple();
#else
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#endif
log_is_inited = false;
}
@@ -460,15 +488,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)
{
@@ -1109,8 +1131,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
r_ble_ll_scan_start_time_init_compensation(500);
r_priv_sdk_config_insert_proc_time_set(500);
esp_ble_controller_flash_only_param_config();
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
if (ble_stack_enable() != 0) {
@@ -1409,27 +1430,29 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_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 ? true : false;
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();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
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
#endif // !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
void esp_ble_controller_log_dump_all(bool output)
{
@@ -1437,9 +1460,13 @@ void esp_ble_controller_log_dump_all(bool output)
ble_log_spi_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#if CONFIG_BT_BLE_LOG_UHCI_OUT_ENABLED
ble_log_uhci_out_dump_all();
#endif // CONFIG_BT_BLE_LOG_UHCI_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
#elif !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED && !CONFIG_BT_LE_CONTROLLER_LOG_UHCI_OUT_ENABLED
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
@@ -1667,7 +1694,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;
@@ -1694,3 +1721,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
@@ -274,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

@@ -25,7 +25,6 @@ if BLE_MESH
menuconfig BLE_MESH_USE_BLE_50
bool "Support using BLE 5.0 APIs for BLE Mesh"
depends on BLE_MESH_EXPERIMENTAL
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
select BT_NIMBLE_50_FEATURE_SUPPORT if BT_NIMBLE_ENABLED
select BT_NIMBLE_EXT_ADV if BT_NIMBLE_ENABLED
select BT_BLE_50_FEATURES_SUPPORTED if BT_BLUEDROID_ENABLED
@@ -477,7 +476,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

@@ -94,17 +94,16 @@ 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),
};
#if CONFIG_BLE_MESH_USE_BLE_50
param.primary_phy = BLE_MESH_ADV_PHY_1M;
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, &ad, 3, NULL, 0);
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
#else /* CONFIG_BLE_MESH_USE_BLE_50 */
err = bt_le_adv_start(&param, &ad, 3, NULL, 0);
err = bt_le_adv_start(&param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
} else
#endif

View File

@@ -625,6 +625,9 @@ void bt_mesh_adv_common_init(void)
bt_mesh_adv_type_init(BLE_MESH_ADV_DATA, &adv_queue, &adv_buf_pool, adv_alloc);
bt_mesh_adv_type_init(BLE_MESH_ADV_BEACON, &adv_queue, &adv_buf_pool, adv_alloc);
bt_mesh_adv_type_init(BLE_MESH_ADV_URI, &adv_queue, &adv_buf_pool, adv_alloc);
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
bt_mesh_adv_type_init(BLE_MESH_ADV_PROXY_SOLIC, &adv_queue, &adv_buf_pool, adv_alloc);
#endif
#if CONFIG_BLE_MESH_USE_BLE_50
bt_mesh_adv_inst_init(BLE_MESH_ADV_INS, CONFIG_BLE_MESH_ADV_INST_ID);

View File

@@ -140,6 +140,9 @@ enum bt_mesh_adv_type {
#endif
BLE_MESH_ADV_BEACON,
BLE_MESH_ADV_URI,
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
BLE_MESH_ADV_PROXY_SOLIC,
#endif
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
BLE_MESH_ADV_BLE,
#endif

View File

@@ -667,7 +667,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
interval >>= 1;
interval += (bt_mesh_get_rand() % (interval + 1));
BT_INFO("%u->%u", param->interval_min, interval);
BT_DBG("%u->%u", param->interval_min, interval);
}
#endif
@@ -2153,8 +2153,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

@@ -70,6 +70,9 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
#endif
#if CONFIG_BLE_MESH_RELAY_ADV_BUF
case BLE_MESH_ADV_RELAY_DATA:
#endif
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
case BLE_MESH_ADV_PROXY_SOLIC:
#endif
case BLE_MESH_ADV_BEACON:
case BLE_MESH_ADV_URI: {
@@ -96,9 +99,20 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
param.primary_phy = BLE_MESH_ADV_PHY_1M;
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
err = bt_le_ext_adv_start(inst->id, &param, &ad, 1, NULL, 0);
#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[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_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
} else
#endif
{
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
err = bt_le_ext_adv_start(inst->id, &param, &ad, 1, NULL, 0);
}
}
break;
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
@@ -303,6 +317,7 @@ static uint32_t received_adv_evts_handle(uint32_t recv_evts)
CONFIG_BLE_MESH_GATT_PROXY_SERVER
if (unlikely(i == BLE_MESH_ADV_PROXY_INS)) {
BT_DBG("Mesh Proxy Advertising auto stop");
bt_mesh_proxy_server_adv_flag_set(false);
} else
#endif
{
@@ -366,7 +381,7 @@ void bt_mesh_adv_update(void)
{
#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_SERVER
BT_WARN("Mesh Proxy Advertising stopped manually");
BT_DBG("Mesh Proxy Advertising stopped manually");
bt_mesh_proxy_server_adv_stop();
if (adv_insts[BLE_MESH_ADV_PROXY_INS].busy) {
ble_mesh_adv_task_wakeup(ADV_TASK_PROXY_ADV_UPD_EVT);

View File

@@ -1223,7 +1223,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
interval >>= 1;
interval += (bt_mesh_get_rand() % (interval + 1));
BT_INFO("%u->%u", param->interval_min, interval);
BT_DBG("%u->%u", param->interval_min, interval);
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -31,7 +31,7 @@
static struct bt_mesh_proxy_server {
struct bt_mesh_conn *conn;
bt_mesh_addr_t addr;
enum __attribute__((packed)) {
CLI_NONE,
CLI_PROV,
@@ -465,6 +465,7 @@ static void proxy_connected(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn, int
server->conn = bt_mesh_conn_ref(conn);
server->conn_type = CLI_NONE;
memcpy(&server->addr, addr, sizeof(bt_mesh_addr_t));
net_buf_simple_reset(&server->buf);
#if CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT
@@ -629,6 +630,12 @@ static ssize_t proxy_write_ccc(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn)
return 0;
}
#if CONFIG_BLE_MESH_BQB_TEST
/* notify maybe received first */
if (server->conn_type == CLI_PROXY) {
return 0;
}
#endif
return -EINVAL;
}
@@ -641,6 +648,16 @@ static ssize_t proxy_recv_ntf(struct bt_mesh_conn *conn, uint8_t *data, uint16_t
return -ENOTCONN;
}
#if CONFIG_BLE_MESH_BQB_TEST
/* update conn type if notify received before write ccc */
if (server->conn_type == CLI_NONE) {
server->conn_type = CLI_PROXY;
if (proxy_client_connect_cb) {
proxy_client_connect_cb(&server->addr, server - servers, server->net_idx);
}
}
#endif
if (server->conn_type == CLI_PROXY) {
return proxy_recv(conn, NULL, data, len, 0, 0);
}

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