Compare commits

...

341 Commits

Author SHA1 Message Date
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
1d9e0ac834 fix(ble): fixed assertion issue in connection state on ESP32C2-ECO4
(cherry picked from commit 83fd955f11a3813eb31aacc259d6b95a05b7aeea)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2025-06-20 15:31:41 +08:00
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
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
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
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
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
5210e576d5 feat(mbedtls/sha): New API for setting SHA mode 2025-06-18 16:46:39 +05:30
e7a76ff71e feat(soc): Update ESP32-C5 ECO2 to support SHA512 2025-06-18 16:46:39 +05:30
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
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
4d06a6ec9d feat(phy): update phylib for esp32c5 2025-06-18 14:56:18 +08:00
6cb9214520 wss_server: use large partition table config 2025-06-18 12:30:24 +08:00
b62e55db0b feat(coex): support backgorund scan for coex, fix some issues of scan when connected 2025-06-18 11:13:36 +08:00
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
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
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
85c77bdb82 fix(pm): reserve txqblocks when mac init at offchannels 2025-06-17 22:16:15 +08:00
391c39414e fix(pm): fix ps none status check 2025-06-17 22:16:08 +08:00
df19d0421f fix(wifi/mesh): fixed the mesh STA sends data error on c5 2025-06-17 22:06:52 +08:00
5558a08c07 fix(wifi): add check for esp_wifi_set_config 2025-06-17 22:05:58 +08:00
8aa235a9a5 fix(wifi): fix cant sleep if connection breaks during sending probe 2025-06-17 22:04:41 +08:00
9c61e31be4 fix(esp_wifi): Make sure old DPP listen is cancelled 2025-06-17 21:33:18 +08:00
f0d7baae5e fix(esp_wifi): Modify check for dpp event handlers 2025-06-17 21:31:56 +08:00
9189406b05 change(esp_wifi): Update dpp enrollee example to use updated events 2025-06-17 21:31:46 +08:00
30c24b2f31 fix(esp_wifi): Update dpp code to send events in freeRTOS context 2025-06-17 21:31:38 +08:00
23bc0a51fb fix(esp_wifi): Fixed DPP concurrency issue 2025-06-17 21:31:27 +08:00
16985bfd3c fix(wifi): Made changes in api for sending bcast deauth frames 2025-06-17 21:30:15 +08:00
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
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
88f234f1ef feat(ble/controller): Reduce bin size and IRAM for BLE rom code 2025-06-17 21:03:32 +08:00
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
06268a4efc fix(rmt): enable internal pull-up resistor for onewire bus 2025-06-17 15:32:43 +08:00
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
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
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
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
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
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
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
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
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
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
adc3a80381 feat(ble_mesh): update lib to f15b27e2d2 2025-06-17 14:39:14 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
3da3f6f2e2 docs: Update hw-reference/index.rst for esp32p4 2025-06-17 10:06:54 +08:00
8d7aefa890 ci(adc): reenable c5 adc test and fix test val 2025-06-17 09:28:46 +08:00
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
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
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
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
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
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
f4669e3377 change(bt): increase BTDM_MODEM_WAKE_UP_DELAY 2025-06-16 17:24:47 +08:00
7e28275ac1 change(esp_timer): make esp_timer timming drift always be negative 2025-06-16 17:24:47 +08:00
da534bf462 fix(esp_hw_support): config lact in critical 2025-06-16 17:24:46 +08:00
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
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
fc77b58ced bugfix(jpeg): eliminate random black line on jpeg decoder 2025-06-16 14:19:51 +08:00
770052e859 fix(jpeg): Fix wrong parameter in jpeg encoder msync 2025-06-16 14:19:39 +08:00
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
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
5555ef7425 fix(cache): fixed SOC_CACHE_FREEZE_SUPPORTED not defined on c3/c2 issue 2025-06-16 13:13:49 +08:00
4b93bde59b docs: Update CN translation for ecdsa.rst 2025-06-16 13:13:03 +08:00
04f5e591c0 feat: enable support for deterministic mode for esp32h2 2025-06-16 13:13:03 +08:00
2d5d7b819f feat: enabled ECDSA-P192 support for ESP32H2 2025-06-16 13:13:03 +08:00
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
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
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
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
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
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
08d78dcd7e fix(esp_tls): fix failing build with TLS1.3 only and dynamic buffer 2025-06-16 09:22:57 +08:00
849c74b2b9 fix(touch): fixed touch interval freq unit convert issue 2025-06-13 19:49:16 +08:00
e32bd2502d fix(touch): fixed channel offset issue in touch v2 2025-06-13 19:49:16 +08:00
666f3db1a3 fix(touch): fixed incorrect interval clock source 2025-06-13 19:49:16 +08:00
79da851a4c refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14 2025-06-13 19:49:16 +08:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
37f017585d fix(adc): fix adc calibration error on c5 2025-06-13 14:46:34 +08:00
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
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
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
e22c523b55 feat(ble/bluedroid): Support anonymous address type for white list 2025-06-13 10:31:52 +08:00
7c2734dc02 feat(ble/bluedroid): Add config for BLE vendor hci command and event 2025-06-13 10:31:52 +08:00
9e7325a3d6 feat(ble/bluedroid): Support BLE vendor event reporting with params 2025-06-13 10:31:52 +08:00
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
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
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
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
19b0d6c13c change(version): Update version to 5.5.0 2025-06-12 14:25:45 +02:00
e9e995bd0a fix(tools): Enabled removing requirements.* files 2025-06-11 11:12:49 +02:00
7914e75525 feat(driver_twai): new driver add programming guide 2025-06-11 17:05:37 +08:00
90b3d29223 feat(mmu): use cache freeze for mmap apis 2025-06-11 14:48:40 +08:00
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
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
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
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
22aeb00462 docs: Update CN for idf-monitor.rst 2025-06-11 13:54:16 +08:00
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
7cf59adc0c fix(nimble): Add invocation for mempool_deinit 2025-06-11 10:51:44 +05:30
96b43c9797 fix(nimble): Added CI files for various configurations 2025-06-11 10:51:44 +05:30
168808248d fix(nimble): Add chip dependancy flag for Flow control feature 2025-06-11 10:51:44 +05:30
fc72303490 fix(nimble): Add changes for coverity reported issue 2025-06-11 10:51:44 +05:30
6b74032d2e fix(nimble): Add support for minimilistic builds 2025-06-11 10:51:44 +05:30
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
ce09a8c037 test(gptimer): power domain is not power down on esp32c5 2025-06-09 10:16:07 +08:00
370ac37623 fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports 2025-06-06 17:13:24 +05:30
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
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
18b6997e32 test(newlib): fixed failing C5 ECO2 newlib tests 2025-06-06 09:56:55 +02:00
693a5393b2 change(unit-test): filter top domain power down check for some sleep test cases 2025-06-05 22:08:34 +08:00
23892d857a change(esp_hw_support): force top domain power up during sleep 2025-06-05 22:07:30 +08:00
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
49b5cc9e50 feat(openthread): add a function to exit openthread main loop safely 2025-06-05 14:53:11 +08:00
33c71ea033 fix(nimble): Added support for ANCS in nimble 2025-06-05 10:22:47 +05:30
5961670d06 change(psram): limited 2t check only for ap 2025-06-05 02:50:08 +00:00
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
fa75a4dd67 fix(coex): Fix ble disconnect when coexisting wifi on esp32c2 2025-06-04 19:26:23 +08:00
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
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
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
0170c56e04 ci(change): disable esp32c61 tests 2025-06-04 11:11:05 +02:00
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
35876be5e6 test(ci): c61 disable test for eco3 update 2025-06-03 20:17:07 +08:00
e2b524c609 fix(nimble): Add support to minimize ram consumption 2025-06-03 16:06:44 +05:30
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
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
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
a2cd564044 fix(ble): set timer handle to null after deletion 2025-05-30 22:37:55 +08:00
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
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
d881dda91c fix(esp_pm): esp32c5 eco2 disable top pd to avoid mem being changed during sleep 2025-05-30 16:33:37 +08:00
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
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
4d83f1b8af feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP 2025-05-30 10:02:38 +08:00
0fe8891e3a fix(wifi): fix esp32c2 auth threshold issue 2025-05-29 21:44:10 +08:00
b1a379d574 fix(wifi): Added more check when receiving espnow data 2025-05-29 20:25:24 +08:00
84973428b2 fix(bss_max_idle): fix some wifi bugs related to bss max idle 2025-05-29 20:25:08 +08:00
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
253ca4267a fix)wifi): Add GTK rekeying interval field in softap example 2025-05-29 20:23:19 +08:00
60ab2598c5 fix(wifi) : Add config param for gtk rekeying on softAP side 2025-05-29 20:23:08 +08:00
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
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
fddf34d7b0 fix(bt): fixed incorrect mask was used to exclude sco packets 2025-05-29 09:55:35 +08:00
2e761da92a feat(ble_mesh): update lib to bbb57d10f9 2025-05-27 20:06:58 +08:00
b045635cea feat(ble_mesh): Change the type of rpl size from uint8 to uint16 2025-05-27 17:30:55 +08:00
3b596bb602 fix(esp_wifi): Fixed static analyzer issues 2025-05-27 13:37:13 +05:30
45fed1d225 fix(esp_wifi): Disble IP renew skip by default 2025-05-27 13:37:13 +05:30
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
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
b3843ea09a change: adds CVE-2023-53154 to cJSON sbom exclude list 2025-05-26 17:29:14 +08:00
6687749fae change(ble): make falling edge when disabling ts sync 2025-05-26 15:35:29 +08:00
2b0c548593 docs: update get-statted documents for ESP32-C5 2025-05-26 15:02:46 +08:00
59496b4927 fix(system_internal): Avoid the sec clock reset caused due to resetting all crypto peripherals 2025-05-26 11:40:51 +05:30
b977a13796 test(psram): re-enable 80M psram tests on C5 ECO2 2025-05-26 11:32:24 +08:00
0a3cc83a86 fix(ble): fixed spi log init failure return value for ESP32 2025-05-26 10:47:03 +08:00
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
80c92bae34 fix(ble): fixed ts sync sleep support trigger 2025-05-23 19:13:12 +08:00
0904640409 fix(ble): fixed printf va list cross function pass failure 2025-05-23 12:31:55 +08:00
b0f107b69a ci: select OpenOCD binary based on runner 2025-05-23 00:34:00 +02:00
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
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
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
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
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
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
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
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
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
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
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
3092578b4a fix(ci): fixed psram tests not running on c5 issue 2025-05-22 14:42:48 +08:00
fafc25b8b9 feat(mspi): supported psram 80MHz timing tuning 2025-05-22 14:42:42 +08:00
e7c8f555e7 refactor(mspi): change mspi timing tuning dirrectory structure 2025-05-22 14:42:37 +08:00
5f71d958c3 test(sdspi): re-enable sdspi test on c5 eco2 2025-05-22 14:32:03 +08:00
e26be2be8f test(esp_timer): add UT case for esp_timer period alarm with DFS 2025-05-22 14:07:37 +08:00
e8475d7796 feat(esp_hw_support): compensate the error introduced to LACT during APB frequency switching 2025-05-22 14:07:37 +08:00
31149354a9 fix(esp_hw_support): update systimer step immediately when XTAL changes on esp32s2 2025-05-22 14:07:37 +08:00
833df30063 fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32 2025-05-22 14:07:36 +08:00
1cc377a373 fix(sd): fixed menuconfig multi pin definitions issue 2025-05-21 12:43:49 +08:00
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
d482206483 ci(esp_tee): Enable the tee_test_fw test app for ESP32-H2 2025-05-21 10:06:17 +05:30
27496e47f0 feat(esp_tee): Support for ESP32-H2 - the rest of the components 2025-05-21 10:06:17 +05:30
eca7c7296c feat(esp_tee): Support for ESP32-H2 - the esp_tee component 2025-05-21 10:06:16 +05:30
039cc1ac80 fix(drivers): some false reports from coverity 2025-05-21 10:08:08 +08:00
ee3baa4ca7 refactor(bitscrambler): don't use Reset Clock Control lock of RC version 2025-05-21 10:08:08 +08:00
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
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
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
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
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
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
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
5e6ecd81b5 refactor: move_ocode_to_pmu_init_c6_c5_c61 (v5.5) 2025-05-20 21:14:56 +08:00
45fb5fb793 fix(pmu): fix deepsleep current too big bug for esp32c61 2025-05-20 21:14:33 +08:00
63f72f659d feat(power_glich): support power_glitch of esp32c5_eco1 and above, eco32c61 eco2 and above 2025-05-20 21:14:33 +08:00
7910ea8571 feat(coex): implement BT coex timer event 2025-05-20 21:13:57 +08:00
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
5da8865f9b feat(nimble): Add demo example for gattc and gatts coex for nimble 2025-05-20 18:12:02 +05:30
c771e4508e iperf: increased app partition size in example 2025-05-20 19:52:07 +08:00
375d675cdc https_server: use larger partition table in the example 2025-05-20 19:52:07 +08:00
2252a4166a fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep 2025-05-20 19:52:07 +08:00
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
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
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
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
1ba8abd8b7 fix(mbedtls): Enable signature verification s/w fallback when ECDSA curve is disabled 2025-05-20 12:18:07 +05:30
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
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
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
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
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
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
b1218adfae fix(wifi) : Set rrm config condition in case RRM monitoring is enabled 2025-05-20 10:19:16 +05:30
aff86ba14b bugfix(wifi): Fix incorrect SAE-PK advertisement in assoc request 2025-05-20 11:57:13 +08:00
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
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
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
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
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
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
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
048d03e94d fix(esp_hw_support): Force function calibrate_ocode not inlined to flash 2025-05-20 10:51:20 +08:00
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
527e2f38b8 fix(esp_hw_support): always disable USJ pad in sleep to supress leakage 2025-05-20 10:46:11 +08:00
9cf4ddf797 fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy 2025-05-20 10:32:52 +08:00
3052ad53e7 fix(esp_hw_support): fix sleep iram safe code inlined to flash 2025-05-20 10:26:06 +08:00
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
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
7b52c11661 test(gpio,gpio_ext,ppa): test with malloc from psram by default 2025-05-19 21:53:10 +08:00
5bb83afac7 refactor(uart): minor refactor to uart wakeup code 2025-05-19 21:52:55 +08:00
669e677ba3 fix(uart): eliminate garbled data on UART TX/RX line in sleep 2025-05-19 21:52:15 +08:00
1909105acf feat(uart): add pin release process to uart driver 2025-05-19 21:51:59 +08:00
afcb8199b0 fix(wifi): rx bcn failed when sta off channel under modem state 2025-05-19 21:16:37 +08:00
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
de17b6ff94 fix(softAP): Adjusted authentication mode for wpa-eap version 1 2025-05-19 21:12:52 +08:00
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
79d2bedbf9 fix(wifi): fix build issue by modifying parttion table of file_server example 2025-05-19 21:11:30 +08:00
6514df1ba9 feat(wifi): add tx error 0xa0 count 2025-05-19 21:11:18 +08:00
692f7df5aa fix(esp_wifi): Fix locking in incorrect state when stop_scan is called after connect 2025-05-19 21:10:05 +08:00
f6cb4422db docs(uhci): implementation for uart-dma (uhci) docs 2025-05-19 17:49:39 +08:00
60adcc5980 test(i2c): Re-enable i2c test on esp32c5 2025-05-19 17:44:27 +08:00
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
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
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
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
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
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
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
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
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
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
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
c18e53b672 feat(cjson): update to latest upstream 2025-05-19 09:50:59 +08:00
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
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
6fdcf9efc1 feat(apptrace): Store CRC16 checksum value of exposed block in the perfmon reg 2025-05-16 11:32:13 +02:00
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
6f82f332fd fix(log): Fix bin log config available only for log version 2 2025-05-16 09:33:36 +03:00
b095331a51 fix(mcpwm): the wrong pm lock type on esp32 and esp32s3 2025-05-16 10:31:27 +08:00
084dfefd6f fix(nimble): Fix proc rx entry comparison (v5.5) 2025-05-15 19:48:34 +05:30
04d83433c3 ci: fix app_trace_basic rules and test 2025-05-15 14:27:11 +02:00
dd1a331f4f ci: enable gcov example for all chips 2025-05-15 14:27:07 +02:00
0f7b621d47 refactor(partition_table): Refactoring of code style 2025-05-15 13:21:02 +03:00
72ae023a42 fix(partition_table): Ignore UTF-8 BOM bytes in csv file 2025-05-15 13:21:02 +03:00
84e62daedc fix(wpa_supplicant): Disconnect from previous AP while initiating WPS 2025-05-15 17:55:28 +08:00
0d5d31b343 fix(wpa_supplicant): Detect PBC overlap even when UUID is null 2025-05-15 17:55:28 +08:00
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
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
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
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
af9e528409 docs(jtag): fix esp32p4 usb jtag pins 2025-05-15 12:13:23 +07:00
d35923141d fix(bitscrambler): fix bitscrambler RX mode initialization error 2025-05-15 12:08:44 +08:00
81f5d899f6 fix(nimble): Fixed async race condition with HCI outstanding packets counter 2025-05-15 09:13:16 +05:30
2eac57a1da fix(nimble): Extend support for allow connect during scan for more chips 2025-05-15 09:13:12 +05:30
2fd71413f0 fix(nimble): Add support for anonymous address type for whitelist 2025-05-15 09:13:08 +05:30
b8badb85d1 fix(nimble): Add configurable option to select ext adv v2 command 2025-05-15 09:13:04 +05:30
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
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
18cd0fa030 refactor(hcd_dwc): Apply ls_via_fs_hub delay for all targets 2025-05-14 13:54:25 +02:00
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
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
a0fc3e68a8 fix(sysview): do not use freertos ticks to prevent deadlock 2025-05-14 11:22:13 +02:00
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
45831351fa test: add secure image verification case for C6/H2 2025-05-14 10:53:47 +05:30
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
8ea6b3170b fix(nimble): Added APIs to fetch GATT cache info and discover included services 2025-05-14 10:26:25 +05:30
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
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
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
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
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
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
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
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
3a6e5dba88 fix(efuse): Fix ESP32-C5 eFuse test for ECO2 2025-05-13 09:16:57 +03:00
27e1a30acc docs(bitscrambler): update documentation with integration details 2025-05-13 13:38:40 +08:00
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
a4d0ab04c5 change(gitlab): simplify approvals for backports (v5.5) 2025-05-13 00:05:46 +02:00
681 changed files with 17853 additions and 5456 deletions

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

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

@ -14,6 +14,7 @@ extra_default_build_targets:
bypass_check_test_targets:
- esp32h21
- esp32c61
- esp32h4
- esp32c5

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

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

@ -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
*/
@ -148,6 +148,18 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
if (res != ESP_OK) {
break;
}
#if CONFIG_IDF_TARGET_ESP32S3
/*
* ESP32S3 has a serious data corruption issue with the transferred data to host.
* This delay helps reduce the failure rate by temporarily reducing heavy memory writes
* from RTOS-level tracing and giving OpenOCD more time to read trace memory before
* the current thread continues execution. While this doesn't completely prevent
* memory access from other threads/cores/ISRs, it has shown to significantly improve
* reliability when combined with CRC checks in OpenOCD. In practice, this reduces the
* number of retries needed to read an entire block without corruption.
*/
esp_rom_delay_us(100);
#endif
}
return res;
}
@ -339,7 +351,7 @@ uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *p
esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_membufs_pkt_end(ptr);
// TODO: mark block as busy in order not to re-use it for other tracing calls until it is completely written
// TODO: mark block as busy in order not to reuse it for other tracing calls until it is completely written
// TODO: avoid potential situation when all memory is consumed by low prio tasks which can not complete writing due to
// higher prio tasks and the latter can not allocate buffers at all
// this is abnormal situation can be detected on host which will receive only uncompleted buffers

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 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)
@ -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,6 +525,14 @@ 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;
/* calculate CRC16 of the already switched 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);
}
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();

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

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

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

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

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

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

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

@ -796,20 +796,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 +843,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)

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)");
}
}
}
}

View File

@ -48,7 +48,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 +56,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
@ -94,6 +102,13 @@ config BT_BLE_LOG_SPI_OUT_SYNC_IO_NUM
help
GPIO number of SYNC IO
config BT_BLE_LOG_SPI_OUT_TS_SYNC_SLEEP_SUPPORT
bool "Enable ble log & logic analyzer log time sync sleep support"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default n
help
Enable ble log & logic analyzer log time sync sleep support
config BT_BLE_LOG_SPI_OUT_FLUSH_TIMER_ENABLED
bool "Enable periodic buffer flush out"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
@ -108,3 +123,18 @@ 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.

File diff suppressed because it is too large Load Diff

View File

@ -14,27 +14,33 @@
#include "esp_log.h"
#include "freertos/semphr.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_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 */
enum {
BLE_LOG_SPI_OUT_LEVEL_NONE = 0,
BLE_LOG_SPI_OUT_LEVEL_ERROR,
BLE_LOG_SPI_OUT_LEVEL_WARN,
BLE_LOG_SPI_OUT_LEVEL_INFO,
BLE_LOG_SPI_OUT_LEVEL_DEBUG,
BLE_LOG_SPI_OUT_LEVEL_VERBOSE,
BLE_LOG_SPI_OUT_LEVEL_MAX,
};
// Public functions
int ble_log_spi_out_init(void);
@ -50,5 +56,8 @@ 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);
#endif // __BT_SPI_OUT_H__

View File

@ -965,7 +965,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;
}
@ -1701,6 +1701,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

View File

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

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

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

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

View File

@ -681,7 +681,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 +805,10 @@ 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.

View File

@ -67,7 +67,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 +98,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
************************************************************************
*/
@ -182,7 +185,6 @@ 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);
@ -459,15 +461,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)
{
@ -1419,20 +1415,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#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
}
@ -1675,7 +1673,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;

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

View File

@ -721,7 +721,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 +839,10 @@ 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.

View File

@ -58,6 +58,7 @@
#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"
@ -70,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
@ -101,17 +102,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);
@ -185,7 +198,9 @@ 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);
@ -463,15 +478,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)
{
@ -1452,20 +1486,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#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
}
@ -1708,7 +1744,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;

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

View File

@ -716,7 +716,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 +843,10 @@ 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.

View File

@ -66,7 +66,7 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
@ -97,12 +97,16 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, 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
************************************************************************
@ -183,7 +187,6 @@ 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);
@ -460,15 +463,9 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE,
};
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
@ -1412,20 +1409,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#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
}
@ -1667,7 +1666,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
int IRAM_ATTR
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
{
int i;

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

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);
}

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -170,6 +170,11 @@ static void proxy_sar_timeout(struct k_work *work)
bt_mesh_gatts_disconnect(client->conn, 0x13);
}
void bt_mesh_proxy_server_adv_flag_set(bool enable)
{
proxy_adv_enabled = enable;
}
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER
/**
* The following callbacks are used to notify proper information
@ -853,7 +858,9 @@ static void proxy_connected(struct bt_mesh_conn *conn, uint8_t err)
conn_count++;
/* Since we use ADV_OPT_ONE_TIME */
proxy_adv_enabled = false;
#if !CONFIG_BLE_MESH_USE_BLE_50
bt_mesh_proxy_server_adv_flag_set(false);
#endif
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_RX
/* Before re-enabling advertising, stop advertising
@ -1356,7 +1363,7 @@ int bt_mesh_proxy_server_segment_send(struct bt_mesh_conn *conn, uint8_t type,
net_buf_simple_pull(msg, mtu);
while (msg->len) {
if (msg->len + 1 < mtu) {
if (msg->len + 1 <= mtu) {
net_buf_simple_push_u8(msg, BLE_MESH_PROXY_PDU_HDR(BLE_MESH_PROXY_SAR_LAST, type));
proxy_send(conn, msg->data, msg->len);
break;
@ -1498,7 +1505,7 @@ static int node_id_adv(struct bt_mesh_subnet *sub)
return err;
}
proxy_adv_enabled = true;
bt_mesh_proxy_server_adv_flag_set(true);
return 0;
}
@ -1529,7 +1536,7 @@ static int net_id_adv(struct bt_mesh_subnet *sub)
return err;
}
proxy_adv_enabled = true;
bt_mesh_proxy_server_adv_flag_set(true);
return 0;
}
@ -1592,7 +1599,7 @@ static int private_node_id_adv(struct bt_mesh_subnet *sub)
return err;
}
proxy_adv_enabled = true;
bt_mesh_proxy_server_adv_flag_set(true);
return 0;
}
@ -1636,7 +1643,7 @@ static int private_net_id_adv(struct bt_mesh_subnet *sub)
return err;
}
proxy_adv_enabled = true;
bt_mesh_proxy_server_adv_flag_set(true);
return 0;
}
@ -1902,7 +1909,7 @@ int32_t bt_mesh_proxy_server_adv_start(void)
prov_sd, prov_sd_len) == 0) {
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
proxy_adv_enabled = true;
bt_mesh_proxy_server_adv_flag_set(true);
/* Advertise 60 seconds using fast interval */
if (prov_fast_adv) {
@ -1959,7 +1966,7 @@ int bt_mesh_proxy_server_adv_stop(void)
return -EINVAL;
}
proxy_adv_enabled = false;
bt_mesh_proxy_server_adv_flag_set(false);
return 0;
}
@ -2022,7 +2029,7 @@ int bt_mesh_proxy_server_deinit(void)
proxy_adv_inst = BLE_MESH_ADV_INS_UNUSED;
#endif
proxy_adv_enabled = false;
bt_mesh_proxy_server_adv_flag_set(false);
gatt_svc = MESH_GATT_NONE;
#if CONFIG_BLE_MESH_GATT_PROXY_SERVER

View File

@ -118,6 +118,7 @@ void bt_mesh_proxy_server_identity_stop(struct bt_mesh_subnet *sub);
bool bt_mesh_proxy_server_relay(struct net_buf_simple *buf, uint16_t dst);
void bt_mesh_proxy_server_addr_add(struct net_buf_simple *buf, uint16_t addr);
void bt_mesh_proxy_server_adv_flag_set(bool enable);
int bt_mesh_proxy_server_init(void);
int bt_mesh_proxy_server_deinit(void);

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2020-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2020-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -102,13 +102,14 @@ int bt_mesh_unprov_dev_info_query(uint8_t uuid[16], uint8_t addr[6],
{
uint8_t idx = 0;
uint8_t cnt = 0;
uint8_t pair_num = unprov_dev_info_fifo.pair_num;
if (uuid == NULL || addr == NULL) {
if (uuid == NULL && addr == NULL) {
BT_WARN("No available information to query");
return -1;
}
while (cnt < unprov_dev_info_fifo.pair_num) {
while (cnt < pair_num) {
idx = (cnt + unprov_dev_info_fifo.start_idx) % BLE_MESH_STORE_UNPROV_INFO_MAX_NUM;
if (query_type & BLE_MESH_STORE_UNPROV_INFO_QUERY_TYPE_UUID) {
if (!memcmp(unprov_dev_info_fifo.info[idx].addr, addr, 6)) {
@ -134,7 +135,7 @@ int bt_mesh_unprov_dev_info_query(uint8_t uuid[16], uint8_t addr[6],
cnt++;
}
if (cnt == unprov_dev_info_fifo.pair_num) {
if (cnt == pair_num) {
return -1;
}

View File

@ -92,6 +92,9 @@ uint8_t __meshlib_var_BLE_MESH_ADV_RELAY_DATA = BLE_MESH_ADV_RELAY_DATA;
#endif
uint8_t __meshlib_var_BLE_MESH_ADV_BEACON = BLE_MESH_ADV_BEACON;
uint8_t __meshlib_var_BLE_MESH_ADV_URI = BLE_MESH_ADV_URI;
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
uint8_t __meshlib_var_BLE_MESH_ADV_PROXY_SOLIC = BLE_MESH_ADV_PROXY_SOLIC;
#endif
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
uint8_t __meshlib_var_BLE_MESH_ADV_BLE = BLE_MESH_ADV_BLE;
#endif
@ -1175,17 +1178,17 @@ uint8_t *bt_mesh_ext_net_get_dev_key_ca(void)
return bt_mesh.dev_key_ca;
}
uint8_t bt_mesh_ext_net_get_rpl_count(void)
uint16_t bt_mesh_ext_net_get_rpl_count(void)
{
return ARRAY_SIZE(bt_mesh.rpl);
}
uint16_t bt_mesh_ext_net_get_rpl_src(uint8_t index)
uint16_t bt_mesh_ext_net_get_rpl_src(uint16_t index)
{
return bt_mesh.rpl[index].src;
}
void bt_mesh_ext_net_reset_rpl(uint8_t index)
void bt_mesh_ext_net_reset_rpl(uint16_t index)
{
memset(&bt_mesh.rpl[index], 0, sizeof(bt_mesh.rpl[index]));
}
@ -3813,7 +3816,7 @@ void *bt_mesh_ext_brc_srv_get_bridge_table_entry(void *srv, uint8_t index)
#endif /* CONFIG_BLE_MESH_BRC_SRV */
}
void *bt_mesh_ext_brc_srv_get_bridge_rpl(uint8_t index)
void *bt_mesh_ext_brc_srv_get_bridge_rpl(uint16_t index)
{
#if CONFIG_BLE_MESH_BRC_SRV
return &bridge_rpl[index];
@ -4584,7 +4587,7 @@ typedef struct {
uint16_t (*_bt_mesh_ext_sub_get_sbr_net_idx)(void *sub);
void (*_bt_mesh_ext_sub_set_sbr_net_idx)(void *sub, uint16_t sbr_net_idx);
void *(*_bt_mesh_ext_brc_srv_get_bridge_table_entry)(void *srv, uint8_t index);
void *(*_bt_mesh_ext_brc_srv_get_bridge_rpl)(uint8_t index);
void *(*_bt_mesh_ext_brc_srv_get_bridge_rpl)(uint16_t index);
/* CONFIG_BLE_MESH_BRC_SRV */
/* CONFIG_BLE_MESH_AGG_CLI */

View File

@ -1493,6 +1493,13 @@ config BT_BLE_FEAT_CONN_SUBRATING
help
Enable BLE connection subrating feature
config BT_BLE_VENDOR_HCI_EN
bool "Enable BLE Vendor HCI command and event"
depends on BT_BLE_ENABLED
default y
help
This enables BLE vendor HCI command and event
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
bool "Enable BLE high duty advertising interval feature"
depends on BT_BLE_ENABLED

View File

@ -131,19 +131,6 @@ esp_err_t esp_ble_gap_stop_advertising(void)
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_clear_advertising(void)
{
btc_msg_t msg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CLEAR_ADV;
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif // #if (BLE_42_ADV_EN == TRUE)
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
@ -300,83 +287,17 @@ esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable)
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon)
{
esp_err_t ret;
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
switch (icon) {
case ESP_BLE_APPEARANCE_GENERIC_PHONE:
case ESP_BLE_APPEARANCE_GENERIC_COMPUTER:
case ESP_BLE_APPEARANCE_GENERIC_REMOTE:
case ESP_BLE_APPEARANCE_GENERIC_THERMOMETER:
case ESP_BLE_APPEARANCE_THERMOMETER_EAR:
case ESP_BLE_APPEARANCE_GENERIC_HEART_RATE:
case ESP_BLE_APPEARANCE_HEART_RATE_BELT:
case ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE:
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM:
case ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST:
case ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER:
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP:
case ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST:
case ESP_BLE_APPEARANCE_GENERIC_GLUCOSE:
case ESP_BLE_APPEARANCE_GENERIC_WEIGHT:
case ESP_BLE_APPEARANCE_GENERIC_WALKING:
case ESP_BLE_APPEARANCE_WALKING_IN_SHOE:
case ESP_BLE_APPEARANCE_WALKING_ON_SHOE:
case ESP_BLE_APPEARANCE_WALKING_ON_HIP:
case ESP_BLE_APPEARANCE_GENERIC_WATCH:
case ESP_BLE_APPEARANCE_SPORTS_WATCH:
case ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES:
case ESP_BLE_APPEARANCE_GENERIC_DISPLAY:
case ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER:
case ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER:
case ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER:
case ESP_BLE_APPEARANCE_GENERIC_HID:
case ESP_BLE_APPEARANCE_HID_KEYBOARD:
case ESP_BLE_APPEARANCE_HID_MOUSE:
case ESP_BLE_APPEARANCE_HID_JOYSTICK:
case ESP_BLE_APPEARANCE_HID_GAMEPAD:
case ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET:
case ESP_BLE_APPEARANCE_HID_CARD_READER:
case ESP_BLE_APPEARANCE_HID_DIGITAL_PEN:
case ESP_BLE_APPEARANCE_UNKNOWN:
case ESP_BLE_APPEARANCE_GENERIC_CLOCK:
case ESP_BLE_APPEARANCE_GENERIC_TAG:
case ESP_BLE_APPEARANCE_GENERIC_KEYRING:
case ESP_BLE_APPEARANCE_GENERIC_CYCLING:
case ESP_BLE_APPEARANCE_CYCLING_COMPUTER:
case ESP_BLE_APPEARANCE_CYCLING_SPEED:
case ESP_BLE_APPEARANCE_CYCLING_CADENCE:
case ESP_BLE_APPEARANCE_CYCLING_POWER:
case ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE:
case ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE:
case ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR:
case ESP_BLE_APPEARANCE_MOBILITY_SCOOTER:
case ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR:
case ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP:
case ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP:
case ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP:
case ESP_BLE_APPEARANCE_INSULIN_PEN:
case ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY:
case ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD:
case ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV:
case ESP_BLE_APPEARANCE_STANDALONE_SPEAKER:
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
arg.cfg_local_icon.icon = icon;
ret = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
break;
default:
ret = ESP_ERR_INVALID_ARG;
break;
}
return ret;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CONFIG_LOCAL_ICON;
arg.cfg_local_icon.icon = icon;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_update_whitelist(bool add_remove, esp_bd_addr_t remote_bda, esp_ble_wl_addr_type_t wl_addr_type)
@ -1079,23 +1000,6 @@ esp_err_t esp_ble_gap_set_privacy_mode(esp_ble_addr_type_t addr_type, esp_bd_add
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select)
{
btc_msg_t msg;
btc_ble_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_SET_CSA_SUPPORT;
arg.set_csa_support.csa_select = csa_select;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if (BLE_50_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_gap_read_phy(esp_bd_addr_t bd_addr)
@ -1779,6 +1683,7 @@ esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr, con
}
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
#if (BLE_VENDOR_HCI_EN == TRUE)
esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cmd_param)
{
btc_msg_t msg = {0};
@ -1807,7 +1712,7 @@ esp_err_t esp_ble_gap_vendor_command_send(esp_ble_vendor_cmd_params_t *vendor_cm
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask)
esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask)
{
btc_msg_t msg = {0};
btc_ble_gap_args_t arg;
@ -1825,6 +1730,37 @@ esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_clear_advertising(void)
{
btc_msg_t msg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_ACT_CLEAR_ADV;
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select)
{
btc_msg_t msg;
btc_ble_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_SET_CSA_SUPPORT;
arg.set_csa_support.csa_select = csa_select;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif // (BLE_VENDOR_HCI_EN == TRUE)
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
esp_err_t esp_ble_gap_enhanced_read_transmit_power_level(uint16_t conn_handle, esp_ble_tx_power_phy_t phy)
{

View File

@ -260,6 +260,11 @@ esp_err_t esp_ble_gatts_stop_service(uint16_t service_handle)
esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id, uint16_t attr_handle,
uint16_t value_len, uint8_t *value, bool need_confirm)
{
if (value_len > ESP_GATT_MAX_ATTR_LEN) {
LOG_ERROR("%s, value_len > ESP_GATT_MAX_ATTR_LEN.", __func__);
return ESP_ERR_INVALID_SIZE;
}
btc_msg_t msg = {0};
btc_ble_gatts_args_t arg;
@ -272,7 +277,7 @@ esp_err_t esp_ble_gatts_send_indicate(esp_gatt_if_t gatts_if, uint16_t conn_id,
}
if (L2CA_CheckIsCongest(L2CAP_ATT_CID, p_tcb->peer_bda)) {
LOG_DEBUG("%s, the l2cap chanel is congest.", __func__);
LOG_DEBUG("%s, the l2cap channel is congest.", __func__);
return ESP_FAIL;
}

View File

@ -145,6 +145,7 @@ typedef enum {
ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT = 7, /*!< set absolute volume response event */
ESP_AVRC_CT_COVER_ART_STATE_EVT = 8, /*!< cover art client connection state changed event */
ESP_AVRC_CT_COVER_ART_DATA_EVT = 9, /*!< cover art client data event */
ESP_AVRC_CT_PROF_STATE_EVT = 10, /*!< Indicate AVRCP controller init or deinit complete */
} esp_avrc_ct_cb_event_t;
/// AVRC Target callback events
@ -155,6 +156,7 @@ typedef enum {
ESP_AVRC_TG_SET_ABSOLUTE_VOLUME_CMD_EVT = 3, /*!< set absolute volume command from remote device */
ESP_AVRC_TG_REGISTER_NOTIFICATION_EVT = 4, /*!< register notification event */
ESP_AVRC_TG_SET_PLAYER_APP_VALUE_EVT = 5, /*!< set application attribute value, attribute refer to esp_avrc_ps_attr_ids_t */
ESP_AVRC_TG_PROF_STATE_EVT = 6, /*!< Indicate AVRCP target init or deinit complete */
} esp_avrc_tg_cb_event_t;
/// AVRC metadata attribute mask
@ -303,6 +305,18 @@ typedef struct {
uint8_t ct_cover_art_conn_num; /*!< Number of cover art client connections */
} esp_avrc_profile_status_t;
/**
* @brief Bluetooth AVRCP Initiation states
*/
typedef enum {
ESP_AVRC_INIT_SUCCESS = 0, /*!< Indicate init successful */
ESP_AVRC_INIT_ALREADY, /*!< Indicate init repeated */
ESP_AVRC_INIT_FAIL, /*!< Indicate init fail */
ESP_AVRC_DEINIT_SUCCESS, /*!< Indicate deinit successful */
ESP_AVRC_DEINIT_ALREADY, /*!< Indicate deinit repeated */
ESP_AVRC_DEINIT_FAIL, /*!< Indicate deinit fail */
} esp_avrc_init_state_t;
/// AVRC controller callback parameters
typedef union {
/**
@ -390,6 +404,14 @@ typedef union {
uint16_t data_len; /*!< the data length of this data event, in bytes */
uint8_t *p_data; /*!< pointer to data, should copy to other buff before event callback return */
} cover_art_data; /*!< AVRC Cover Art data event */
/**
* @brief ESP_AVRC_CT_PROF_STATE_EVT
*/
struct avrc_ct_init_stat_param {
esp_avrc_init_state_t state; /*!< avrc ct initialization param */
} avrc_ct_init_stat; /*!< status to indicate avrcp ct init or deinit */
} esp_avrc_ct_cb_param_t;
/// AVRC target callback parameters
@ -442,6 +464,13 @@ typedef union {
esp_avrc_set_app_value_param_t *p_vals; /*!< point to the id and value of player application attribute */
} set_app_value; /*!< set player application value */
/**
* @brief ESP_AVRC_TG_PROF_STATE_EVT
*/
struct avrc_tg_init_stat_param {
esp_avrc_init_state_t state; /*!< avrc tg initialization param */
} avrc_tg_init_stat; /*!< status to indicate avrcp tg init or deinit */
} esp_avrc_tg_cb_param_t;
/**
@ -482,6 +511,7 @@ esp_err_t esp_avrc_ct_register_callback(esp_avrc_ct_cb_t callback);
* @brief Initialize the bluetooth AVRCP controller module, This function should be called
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
* AVRC should be used along with A2DP and AVRC should be initialized before A2DP.
* ESP_AVRC_CT_PROF_STATE_EVT with ESP_AVRC_INIT_SUCCESS will reported to the APP layer.
*
* @return
* - ESP_OK: success
@ -496,6 +526,7 @@ esp_err_t esp_avrc_ct_init(void);
* @brief De-initialize AVRCP controller module. This function should be called after
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
* AVRC should be used along with A2DP and AVRC should be deinitialized before A2DP.
* ESP_AVRC_CT_PROF_STATE_EVT with ESP_AVRC_DEINIT_SUCCESS will reported to the APP layer.
*
* @return
* - ESP_OK: success
@ -636,6 +667,7 @@ esp_err_t esp_avrc_tg_register_callback(esp_avrc_tg_cb_t callback);
* @brief Initialize the bluetooth AVRCP target module, This function should be called
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
* AVRC should be used along with A2DP and AVRC should be initialized before A2DP.
* ESP_AVRC_TG_PROF_STATE_EVT with ESP_AVRC_INIT_SUCCESS will reported to the APP layer.
*
* @return
* - ESP_OK: success
@ -650,6 +682,7 @@ esp_err_t esp_avrc_tg_init(void);
* @brief De-initialize AVRCP target module. This function should be called after
* after esp_bluedroid_enable() completes successfully. Note: AVRC cannot work independently,
* AVRC should be used along with A2DP and AVRC should be deinitialized before A2DP.
* ESP_AVRC_TG_PROF_STATE_EVT with ESP_AVRC_DEINIT_SUCCESS will reported to the APP layer.
*
* @return
* - ESP_OK: success

View File

@ -282,8 +282,11 @@ typedef enum {
/// white list address type
typedef enum {
BLE_WL_ADDR_TYPE_PUBLIC = 0x00,
BLE_WL_ADDR_TYPE_RANDOM = 0x01,
BLE_WL_ADDR_TYPE_PUBLIC = 0x00, /*!< Public Device Address */
BLE_WL_ADDR_TYPE_RANDOM = 0x01, /*!< Random Device Address */
#if (CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
BLE_WL_ADDR_TYPE_ANONYMOUS = 0xFF, /*!< Devices sending anonymous advertisements, use to enable anonymous advertising report for scanning */
#endif // (CONFIG_BT_BLE_50_FEATURES_SUPPORTED)
} esp_ble_wl_addr_type_t;
/// Used to exchange the encryption key in the init key & response key

View File

@ -1102,11 +1102,58 @@ typedef struct {
} esp_ble_gap_past_params_t;
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
typedef enum{
typedef enum {
ESP_BLE_NETWORK_PRIVACY_MODE = 0X00, /*!< Network Privacy Mode for peer device (default) */
ESP_BLE_DEVICE_PRIVACY_MODE = 0X01, /*!< Device Privacy Mode for peer device */
} esp_ble_privacy_mode_t;
#define ESP_BLE_VENDOR_SCAN_REQ_RECV_EVT_MASK BIT(0) /*!< Vendor BLE legacy SCAN_REQ received event mask */
#define ESP_BLE_VENDOR_CHMAP_UPDATE_EVT_MASK BIT(1) /*!< Vendor BLE channel map update event mask */
#define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT_MASK BIT(3) /*!< Vendor BLE sleep wakeup event mask */
#define ESP_BLE_VENDOR_CONN_REQ_RECV_EVT_MASK BIT(4) /*!< Vendor BLE CONNECT_IND and AUX_CONNECT_REQ received event mask */
#define ESP_BLE_VENDOR_CONN_RSP_RECV_EVT_MASK BIT(5) /*!< Vendor BLE AUX_CONNECT_RSP received event mask */
typedef uint32_t esp_ble_vendor_evt_mask_t;
#define ESP_BLE_VENDOR_PDU_RECV_EVT (0) /*!< Vendor BLE specify PDU received event */
#define ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT (1) /*!< Vendor BLE channel map update complete event */
#define ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT (2) /*!< Vendor BLE sleep wakeup event */
typedef uint8_t esp_ble_vendor_evt_t;
typedef enum {
ESP_BLE_VENDOR_PDU_SCAN_REQ = 0, /*!< SCAN_REQ PDU type */
ESP_BLE_VENDOR_PDU_CONN_REQ, /*!< CONNECT_IND and AUX_CONNECT_REQ PDU type */
ESP_BLE_VENDOR_PDU_CONN_RSP, /*!< AUX_CONNECT_RSP PDU type */
} esp_ble_vendor_pdu_t;
/**
* @brief BLE vendor event parameters union
*/
typedef union {
/**
* @brief ESP_BLE_VENDOR_PDU_RECV_EVT
*/
struct ble_pdu_recv_evt_param {
esp_ble_vendor_pdu_t type; /*!< The type of LE PDU */
uint8_t handle; /*!< The handle of advertising set */
esp_ble_addr_type_t addr_type; /*!< The address type of peer device */
esp_bd_addr_t peer_addr; /*!< The address of peer device */
} pdu_recv; /*!< Event parameter of ESP_BLE_VENDOR_PDU_RECV_EVT */
/**
* @brief ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT
*/
struct ble_chan_map_update_evt_param {
uint8_t status; /*!< Indicate the channel map update status (HCI error code) */
uint16_t conn_handle; /*!< The connection handle */
esp_gap_ble_channels ch_map; /*!< The channel map after updated */
} chan_map_update; /*!< Event parameter of ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT */
/**
* @brief ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT
*/
struct ble_sleep_wakeup_evt_param {
// No parameters
} sleep_wakeup; /*!< Event parameter of ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT */
} esp_ble_vendor_evt_param_t;
/**
* @brief path loss report parameters
*/
@ -1258,12 +1305,6 @@ typedef union {
struct ble_adv_stop_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate adv stop operation success status */
} adv_stop_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
*/
struct ble_adv_clear_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate adv clear operation success status */
} adv_clear_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief ESP_GAP_BLE_SET_STATIC_RAND_ADDR_EVT
@ -1665,6 +1706,19 @@ typedef union {
esp_ble_dtm_update_evt_t update_evt; /*!< DTM state change event, 0x00: DTM TX start, 0x01: DTM RX start, 0x02:DTM end */
uint16_t num_of_pkt; /*!< number of packets received, only valid if update_evt is DTM_TEST_STOP_EVT and shall be reported as 0 for a transmitter */
} dtm_state_update; /*!< Event parameter of ESP_GAP_BLE_DTM_TEST_UPDATE_EVT */
/**
* @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
*/
struct ble_set_privacy_mode_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate privacy mode set operation success status */
} set_privacy_mode_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
#if (BLE_VENDOR_HCI_EN == TRUE)
/**
* @brief ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT
*/
struct ble_adv_clear_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate adv clear operation success status */
} adv_clear_cmpl; /*!< Event parameter of ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT
*/
@ -1673,12 +1727,6 @@ typedef union {
uint16_t param_len; /*!< The length of parameter buffer */
uint8_t *p_param_buf; /*!< The point of parameter buffer */
} vendor_cmd_cmpl; /*!< Event parameter of ESP_GAP_BLE_VENDOR_CMD_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT
*/
struct ble_set_privacy_mode_cmpl_evt_param {
esp_bt_status_t status; /*!< Indicate privacy mode set operation success status */
} set_privacy_mode_cmpl; /*!< Event parameter of ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SET_CSA_SUPPORT_COMPLETE_EVT
*/
@ -1695,10 +1743,12 @@ typedef union {
* @brief ESP_GAP_BLE_VENDOR_HCI_EVT
*/
struct ble_vendor_hci_event_evt_param {
uint8_t subevt_code; /*!< Subevent code for vendor HCI event, the range is 0xC0 to 0xFF */
uint8_t param_len; /*!< The length of the event parameter buffer */
uint8_t *param_buf; /*!< The pointer of the event parameter buffer */
} vendor_hci_evt; /*!< Event parameter buffer of ESP_GAP_BLE_VENDOR_HCI_EVT */
esp_ble_vendor_evt_t subevt_code; /*!< Subevent code for BLE vendor HCI event */
esp_ble_vendor_evt_param_t param; /*!< Event parameter of BLE vendor HCI subevent */
uint8_t param_len; /*!< The length of the event parameter buffer (for internal use only) */
uint8_t *param_buf; /*!< The pointer of the event parameter buffer (for internal use only) */
} vendor_hci_evt; /*!< Event parameter of ESP_GAP_BLE_VENDOR_HCI_EVT */
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
/**
* @brief ESP_GAP_BLE_ENH_READ_TRANS_PWR_LEVEL_EVT
@ -2040,15 +2090,19 @@ esp_err_t esp_ble_gap_clear_rand_addr(void);
esp_err_t esp_ble_gap_config_local_privacy (bool privacy_enable);
/**
* @brief set local gap appearance icon
* @brief Set the local GAP appearance icon.
*
* @note This API does not restrict the input icon value.
* If an undefined or incorrect icon value is used, the device icon may not display properly.
*
* @param[in] icon - External appearance value, these values are defined by the Bluetooth SIG, please refer to
* For a complete list of valid appearance values, please refer to "2.6.2 Appearance Category ranges" at:
* https://www.bluetooth.com/specifications/assigned-numbers/
*
* @param[in] icon - External appearance value (16-bit), as defined by the Bluetooth SIG.
*
* @return
* - ESP_OK : success
* - other : failed
* - ESP_OK : Success
* - ESP_FAIL : Internal failure
*
*/
esp_err_t esp_ble_gap_config_local_icon (uint16_t icon);
@ -2726,15 +2780,17 @@ esp_err_t esp_ble_gap_periodic_adv_stop(uint8_t instance);
esp_err_t esp_ble_gap_set_ext_scan_params(const esp_ble_ext_scan_params_t *params);
/**
* @brief This function is used to enable scanning.
* @brief Enables extended scanning.
*
* @param[in] duration Scan duration time, where Time = N * 10 ms. Range: 0x0001 to 0xFFFF.
* @param[in] period Time interval from when the Controller started its last Scan Duration until it begins the subsequent Scan Duration.
* Time = N * 1.28 sec. Range: 0x0001 to 0xFFFF.
* @param[in] duration Scan duration in units of 10 ms.
* - Range: 0x0001 to 0xFFFF (Time = N * 10 ms).
* - 0x0000: Scan continuously until explicitly disabled.
*
* @param[in] period Time interval between the start of consecutive scan durations, in units of 1.28 seconds.
* - Range: 0x0001 to 0xFFFF (Time = N * 1.28 sec).
* - 0x0000: Scan continuously.
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_start_ext_scan(uint32_t duration, uint16_t period);
@ -3026,14 +3082,13 @@ esp_err_t esp_ble_gap_set_csa_support(uint8_t csa_select);
/**
* @brief This function is used to control which vendor events are generated by the HCI for the Host.
*
* @param[in] event_mask: Bit0: Legacy scan request received event
* Bit1: Vendor channel map update complete event
* @param[in] event_mask: The BLE vendor HCI event mask
*
* @return
* - ESP_OK : success
* - other : failed
*/
esp_err_t esp_ble_gap_set_vendor_event_mask(uint32_t event_mask);
esp_err_t esp_ble_gap_set_vendor_event_mask(esp_ble_vendor_evt_mask_t event_mask);
/**
* @brief This function is used to read the current and maximum transmit power levels of the local Controller.

View File

@ -478,7 +478,7 @@ typedef uint8_t esp_gatt_char_prop_t;
*
* This definition specifies the maximum number of bytes that a GATT attribute can hold.
*/
#define ESP_GATT_MAX_ATTR_LEN 512 /*!< As same as GATT_MAX_ATTR_LEN. */
#define ESP_GATT_MAX_ATTR_LEN 517 /*!< As same as GATT_MAX_ATTR_LEN. */
/**
* @brief Enumerates the possible sources of a GATT service discovery.

View File

@ -345,6 +345,11 @@ esp_err_t esp_bt_hid_device_unregister_app(void);
* called after esp_bt_hid_device_init(). When the operation is complete, the callback function will
* be called with ESP_HIDD_OPEN_EVT.
*
* @note The connection between the HID Host and the HID Device is established as a virtual cable by default.
* A new HID Host connection request will only be accepted after the previous HID Host has been
* explicitly unplugged. For details on disconnection and virtual cable unplugging, please refer to API
* `esp_bt_hid_device_disconnect` and `esp_bt_hid_device_virtual_cable_unplug`.
*
* @param[in] bd_addr: Remote host bluetooth device address.
*
* @return

View File

@ -733,6 +733,7 @@ void bta_dm_cfg_coex_status (tBTA_DM_MSG *p_data)
}
#endif
#if (BLE_VENDOR_HCI_EN == TRUE)
void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
{
BTM_VendorSpecificCommand(p_data->vendor_hci_cmd.opcode,
@ -741,6 +742,28 @@ void bta_dm_send_vendor_hci(tBTA_DM_MSG *p_data)
p_data->vendor_hci_cmd.vendor_hci_cb);
}
void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
{
if (BTM_BleClearAdv(p_data->ble_clear_adv.p_clear_adv_cback) == FALSE) {
if (p_data->ble_clear_adv.p_clear_adv_cback) {
(*p_data->ble_clear_adv.p_clear_adv_cback)(BTA_FAILURE);
}
}
}
void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, csa_select = %d", __func__, p_data->ble_set_csa_support.csa_select);
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
}
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
/*******************************************************************************
**
** Function bta_dm_set_afh_channels
@ -5822,15 +5845,6 @@ void bta_dm_ble_gap_dtm_stop(tBTA_DM_MSG *p_data)
}
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
void bta_dm_ble_gap_clear_adv(tBTA_DM_MSG *p_data)
{
if (BTM_BleClearAdv(p_data->ble_clear_adv.p_clear_adv_cback) == FALSE) {
if (p_data->ble_clear_adv.p_clear_adv_cback) {
(*p_data->ble_clear_adv.p_clear_adv_cback)(BTA_FAILURE);
}
}
}
void bta_dm_ble_gap_set_rpa_timeout(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, rpa_timeout = %d", __func__, p_data->set_rpa_timeout.rpa_timeout);
@ -5853,18 +5867,6 @@ void bta_dm_ble_gap_set_privacy_mode(tBTA_DM_MSG *p_data)
p_data->ble_set_privacy_mode.privacy_mode, p_data->ble_set_privacy_mode.p_cback);
}
void bta_dm_ble_gap_set_csa_support(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, csa_select = %d", __func__, p_data->ble_set_csa_support.csa_select);
BTM_BleSetCsaSupport(p_data->ble_set_csa_support.csa_select, p_data->ble_set_csa_support.p_cback);
}
void bta_dm_ble_gap_set_vendor_evt_mask(tBTA_DM_MSG *p_data)
{
APPL_TRACE_API("%s, evt_mask = %d", __func__, p_data->ble_set_vendor_evt_mask.evt_mask);
BTM_BleSetVendorEventMask(p_data->ble_set_vendor_evt_mask.evt_mask, p_data->ble_set_vendor_evt_mask.p_cback);
}
void bta_dm_read_ble_channel_map(tBTA_DM_MSG *p_data)
{
if (p_data && p_data->ch_map.read_ch_map_cb) {

View File

@ -231,6 +231,7 @@ void BTA_DmCfgCoexStatus(UINT8 op, UINT8 type, UINT8 status)
}
#endif
#if (BLE_VENDOR_HCI_EN == TRUE)
void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf, tBTA_SEND_VENDOR_HCI_CMPL_CBACK p_vendor_cmd_complete_cback)
{
tBTA_DM_API_SEND_VENDOR_HCI_CMD *p_msg;
@ -246,6 +247,57 @@ void BTA_DmsendVendorHciCmd(UINT16 opcode, UINT8 param_len, UINT8 *p_param_buf,
}
}
/*******************************************************************************
**
** Function BTA_DmBleClearAdv
**
** Description This function is called to clear Advertising
**
** Parameters p_adv_data_cback : clear adv complete callback.
**
** Returns None
**
*******************************************************************************/
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
{
tBTA_DM_API_CLEAR_ADV *p_msg;
if ((p_msg = (tBTA_DM_API_CLEAR_ADV *)
osi_malloc(sizeof(tBTA_DM_API_CLEAR_ADV))) != NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_CLEAR_ADV_EVT;
p_msg->p_clear_adv_cback = p_clear_adv_cback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
{
tBTA_DM_API_BLE_SET_CSA_SUPPORT *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_SET_CSA_SUPPORT *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_CSA_SUPPORT)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT;
p_msg->csa_select = csa_select;
p_msg->p_cback = p_callback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
{
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
p_msg->evt_mask = evt_mask;
p_msg->p_cback = p_callback;
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
#if (CLASSIC_BT_INCLUDED == TRUE)
void BTA_DmConfigEir(tBTA_DM_EIR_CONF *eir_config)
@ -1896,30 +1948,6 @@ extern void BTA_DmBleBroadcast (BOOLEAN start, tBTA_START_STOP_ADV_CMPL_CBACK *p
bta_sys_sendmsg(p_msg);
}
}
/*******************************************************************************
**
** Function BTA_DmBleClearAdv
**
** Description This function is called to clear Advertising
**
** Parameters p_adv_data_cback : clear adv complete callback.
**
** Returns None
**
*******************************************************************************/
void BTA_DmBleClearAdv (tBTA_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
{
tBTA_DM_API_CLEAR_ADV *p_msg;
if ((p_msg = (tBTA_DM_API_CLEAR_ADV *)
osi_malloc(sizeof(tBTA_DM_API_CLEAR_ADV))) != NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_CLEAR_ADV_EVT;
p_msg->p_clear_adv_cback = p_clear_adv_cback;
bta_sys_sendmsg(p_msg);
}
}
#endif // #if (BLE_42_ADV_EN == TRUE)
#endif
@ -3014,32 +3042,6 @@ void BTA_DmClearRandAddress(void)
}
}
void BTA_DmBleGapSetCsaSupport(uint8_t csa_select, tBTA_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
{
tBTA_DM_API_BLE_SET_CSA_SUPPORT *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_SET_CSA_SUPPORT *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_CSA_SUPPORT)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT;
p_msg->csa_select = csa_select;
p_msg->p_cback = p_callback;
bta_sys_sendmsg(p_msg);
}
}
void BTA_DmBleGapSetVendorEventMask(uint32_t evt_mask, tBTA_SET_VENDOR_EVT_MASK_CBACK *p_callback)
{
tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *p_msg;
if ((p_msg = (tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_VENDOR_EVT_MASK)))
!= NULL) {
p_msg->hdr.event = BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT;
p_msg->evt_mask = evt_mask;
p_msg->p_cback = p_callback;
bta_sys_sendmsg(p_msg);
}
}
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
void BTA_DmBleGapEnhReadTransPwrLevel(uint16_t conn_handle, uint8_t phy)
{

View File

@ -67,7 +67,12 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
#if (ESP_COEX_VSC_INCLUDED == TRUE)
bta_dm_cfg_coex_status, /* BTA_DM_API_CFG_COEX_ST_EVT */
#endif
#if (BLE_VENDOR_HCI_EN == TRUE)
bta_dm_send_vendor_hci, /* BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT */
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
#if (CLASSIC_BT_INCLUDED == TRUE)
bta_dm_config_eir, /* BTA_DM_API_CONFIG_EIR_EVT */
bta_dm_set_page_timeout, /* BTA_DM_API_PAGE_TO_SET_EVT */
@ -278,14 +283,9 @@ const tBTA_DM_ACTION bta_dm_action[BTA_DM_MAX_EVT] = {
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
bta_dm_ble_gap_dtm_stop, /* BTA_DM_API_DTM_STOP_EVT */
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
#if (BLE_42_ADV_EN == TRUE)
bta_dm_ble_gap_clear_adv, /* BTA_DM_API_BLE_CLEAR_ADV_EVT */
#endif // #if (BLE_42_ADV_EN == TRUE)
bta_dm_ble_gap_set_rpa_timeout, /* BTA_DM_API_SET_RPA_TIMEOUT_EVT */
bta_dm_ble_gap_add_dev_to_resolving_list, /* BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT */
bta_dm_ble_gap_set_privacy_mode, /* BTA_DM_API_SET_PRIVACY_MODE_EVT */
bta_dm_ble_gap_set_csa_support, /* BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT */
bta_dm_ble_gap_set_vendor_evt_mask, /* BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT */
bta_dm_read_ble_channel_map, /* BTA_DM_API_BLE_READ_CH_MAP_EVT */
#endif
#if (BLE_FEAT_ISO_EN == TRUE)

View File

@ -57,7 +57,12 @@ enum {
#if (ESP_COEX_VSC_INCLUDED == TRUE)
BTA_DM_API_CFG_COEX_ST_EVT,
#endif
#if (BLE_VENDOR_HCI_EN == TRUE)
BTA_DM_API_SEND_VENDOR_HCI_CMD_EVT,
BTA_DM_API_BLE_CLEAR_ADV_EVT,
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
#if (CLASSIC_BT_INCLUDED == TRUE)
BTA_DM_API_CONFIG_EIR_EVT,
BTA_DM_API_PAGE_TO_SET_EVT,
@ -269,14 +274,9 @@ enum {
#if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
BTA_DM_API_DTM_STOP_EVT,
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
#if (BLE_42_ADV_EN == TRUE)
BTA_DM_API_BLE_CLEAR_ADV_EVT,
#endif // #if (BLE_42_ADV_EN == TRUE)
BTA_DM_API_SET_RPA_TIMEOUT_EVT,
BTA_DM_API_ADD_DEV_TO_RESOLVING_LIST_EVT,
BTA_DM_API_SET_PRIVACY_MODE_EVT,
BTA_DM_API_BLE_SET_CSA_SUPPORT_EVT,
BTA_DM_API_BLE_SET_VENDOR_EVT_MASK_EVT,
BTA_DM_API_BLE_READ_CH_MAP_EVT,
#endif
#if (BLE_FEAT_ISO_EN == TRUE)

View File

@ -166,9 +166,9 @@ uint32_t btc_get_ble_status(void)
#if (SMP_INCLUDED == TRUE)
// Number of recorded devices
extern uint8_t btm_ble_sec_dev_active_count(void);
if (btm_ble_sec_dev_active_count()) {
status |= BIT(BTC_BLE_STATUS_KEYS);
extern uint8_t btm_ble_sec_dev_record_count(void);
if (btm_ble_sec_dev_record_count()) {
status |= BIT(BTC_BLE_STATUS_DEVICE_REC);
}
// Number of saved bonded devices
@ -216,5 +216,12 @@ uint32_t btc_get_ble_status(void)
}
#endif
#if SMP_INCLUDED == TRUE
extern uint8_t smp_get_state(void);
if (smp_get_state()) {
status |= BIT(BTC_BLE_STATUS_SMP_STATE);
}
#endif
return status;
}

View File

@ -34,13 +34,14 @@ typedef enum {
BTC_BLE_STATUS_EXT_ADV, // Extended advertising exist
BTC_BLE_STATUS_SCAN, // Scanning exist
BTC_BLE_STATUS_CONN, // Connection exist
BTC_BLE_STATUS_KEYS, // Device keys record exist
BTC_BLE_STATUS_DEVICE_REC, // Device record exist
BTC_BLE_STATUS_BOND, // Bond info exist
BTC_BLE_STATUS_GATTC_CACHE, // GATTC cache exist
BTC_BLE_STATUS_GATTC_APP, // GATTC application exist
BTC_BLE_STATUS_GATTS_SRVC, // GATTS service exist
BTC_BLE_STATUS_PRIVACY, // Privacy enabled
BTC_BLE_STATUS_ADDR_RESOLVE_DISABLE,// Address resolution disable status
BTC_BLE_STATUS_SMP_STATE, // SMP state machine
} tBTC_BLE_STATUS;
future_t **btc_main_get_future_p(btc_main_future_type_t type);

View File

@ -303,10 +303,6 @@ static bool btc_avrc_tg_set_rn_supported_evt(uint16_t evt_set)
static inline void btc_avrc_ct_cb_to_app(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param)
{
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
return;
}
esp_avrc_ct_cb_t btc_avrc_ct_cb = (esp_avrc_ct_cb_t)btc_profile_cb_get(BTC_PID_AVRC_CT);
if (btc_avrc_ct_cb) {
btc_avrc_ct_cb(event, param);
@ -315,10 +311,6 @@ static inline void btc_avrc_ct_cb_to_app(esp_avrc_ct_cb_event_t event, esp_avrc_
static inline void btc_avrc_tg_cb_to_app(esp_avrc_tg_cb_event_t event, esp_avrc_tg_cb_param_t *param)
{
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
return;
}
esp_avrc_tg_cb_t btc_avrc_tg_cb = (esp_avrc_tg_cb_t)btc_profile_cb_get(BTC_PID_AVRC_TG);
if (btc_avrc_tg_cb) {
btc_avrc_tg_cb(event, param);
@ -1108,27 +1100,39 @@ BOOLEAN btc_rc_get_connected_peer(BD_ADDR peer_addr)
*******************************************************************************/
static void btc_avrc_ct_init(void)
{
esp_avrc_init_state_t state = ESP_AVRC_INIT_SUCCESS;
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__);
if (s_rc_ct_init == BTC_RC_CT_INIT_MAGIC) {
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
return;
}
/// initialize CT-specific resources
s_rc_ct_init = BTC_RC_CT_INIT_MAGIC;
do {
/// initialize CT-TG shared resources
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
if (!g_av_with_rc) {
g_av_with_rc = true;
if (s_rc_ct_init == BTC_RC_CT_INIT_MAGIC) {
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
state = ESP_AVRC_INIT_ALREADY;
break;
}
if (g_a2dp_on_init) {
BTC_TRACE_WARNING("AVRC Controller is expected to be initialized in advance of A2DP !!!");
/// initialize CT-TG shared resources
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
if (g_a2dp_on_init) {
BTC_TRACE_WARNING("AVRC Controller is expected to be initialized in advance of A2DP !!!");
state = ESP_AVRC_INIT_FAIL;
break;
}
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
if (!g_av_with_rc) {
g_av_with_rc = true;
}
}
}
/// initialize CT-specific resources
s_rc_ct_init = BTC_RC_CT_INIT_MAGIC;
} while (0);
esp_avrc_ct_cb_param_t param = {0};
param.avrc_ct_init_stat.state = state;
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_PROF_STATE_EVT, &param);
}
@ -1143,29 +1147,37 @@ static void btc_avrc_ct_init(void)
***************************************************************************/
static void btc_avrc_ct_deinit(void)
{
esp_avrc_init_state_t state = ESP_AVRC_DEINIT_SUCCESS;
BTC_TRACE_API("## %s ##", __FUNCTION__);
if (g_a2dp_on_deinit) {
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
}
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
return;
}
/// deinit CT-specific resources
s_rc_ct_init = 0;
/// deinit CT-TG shared resources
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
if (g_av_with_rc) {
g_av_with_rc = false;
do {
if (g_a2dp_on_deinit) {
BTC_TRACE_WARNING("A2DP already deinit, AVRC CT should deinit in advance of A2DP !!!");
}
}
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
state = ESP_AVRC_DEINIT_ALREADY;
break;
}
/// deinit CT-specific resources
s_rc_ct_init = 0;
/// deinit CT-TG shared resources
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb_t));
if (g_av_with_rc) {
g_av_with_rc = false;
}
}
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
} while (0);
esp_avrc_ct_cb_param_t param = {0};
param.avrc_ct_init_stat.state = state;
btc_avrc_ct_cb_to_app(ESP_AVRC_CT_PROF_STATE_EVT, &param);
}
static bt_status_t btc_avrc_ct_send_set_player_value_cmd(uint8_t tl, uint8_t attr_id, uint8_t value_id)
@ -1474,30 +1486,42 @@ static void btc_avrc_ct_cover_art_get_linked_thumbnail(UINT8 *image_handle)
*******************************************************************************/
static void btc_avrc_tg_init(void)
{
esp_avrc_init_state_t state = ESP_AVRC_INIT_SUCCESS;
BTC_TRACE_DEBUG("## %s ##", __FUNCTION__);
if (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) {
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
return;
}
/// initialize TG-specific resources
memcpy(s_psth_supported_cmd, cs_psth_dft_supported_cmd, sizeof(s_psth_supported_cmd));
s_rn_supported_evt = cs_rn_dft_supported_evt;
/// initialize CT-TG shared resources
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
if (!g_av_with_rc) {
g_av_with_rc = true;
do {
if (s_rc_tg_init == BTC_RC_TG_INIT_MAGIC) {
BTC_TRACE_WARNING("%s already initialized", __FUNCTION__);
state = ESP_AVRC_INIT_ALREADY;
break;
}
if (g_a2dp_on_init) {
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
}
}
/// initialize CT-TG shared resources
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
if (g_a2dp_on_init) {
BTC_TRACE_WARNING("AVRC Target is expected to be initialized in advance of A2DP !!!");
state = ESP_AVRC_INIT_FAIL;
break;
}
s_rc_tg_init = BTC_RC_TG_INIT_MAGIC;
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
if (!g_av_with_rc) {
g_av_with_rc = true;
}
}
/// initialize TG-specific resources
memcpy(s_psth_supported_cmd, cs_psth_dft_supported_cmd, sizeof(s_psth_supported_cmd));
s_rn_supported_evt = cs_rn_dft_supported_evt;
s_rc_tg_init = BTC_RC_TG_INIT_MAGIC;
} while (0);
esp_avrc_tg_cb_param_t param = {0};
param.avrc_tg_init_stat.state = state;
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_PROF_STATE_EVT, &param);
}
@ -1512,31 +1536,40 @@ static void btc_avrc_tg_init(void)
***************************************************************************/
static void btc_avrc_tg_deinit(void)
{
esp_avrc_init_state_t state = ESP_AVRC_DEINIT_SUCCESS;
BTC_TRACE_API("## %s ##", __FUNCTION__);
if (g_a2dp_on_deinit) {
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
}
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
return;
}
/// deinit TG-specific resources
memset(s_psth_supported_cmd, 0, sizeof(s_psth_supported_cmd));
s_rn_supported_evt = 0;
s_rc_tg_init = 0;
/// deinit CT-TG shared resources
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
if (g_av_with_rc) {
g_av_with_rc = false;
do {
if (g_a2dp_on_deinit) {
BTC_TRACE_WARNING("A2DP already deinit, AVRC TG should deinit in advance of A2DP !!!");
}
}
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
if (s_rc_tg_init != BTC_RC_TG_INIT_MAGIC) {
BTC_TRACE_WARNING("%s not initialized", __FUNCTION__);
state = ESP_AVRC_DEINIT_ALREADY;
break;
}
/// deinit TG-specific resources
memset(s_psth_supported_cmd, 0, sizeof(s_psth_supported_cmd));
s_rn_supported_evt = 0;
s_rc_tg_init = 0;
/// deinit CT-TG shared resources
if (s_rc_ct_init != BTC_RC_CT_INIT_MAGIC) {
memset (&btc_rc_cb, 0, sizeof(btc_rc_cb));
if (g_av_with_rc) {
g_av_with_rc = false;
}
}
BTC_TRACE_API("## %s ## completed", __FUNCTION__);
} while (0);
esp_avrc_tg_cb_param_t param = {0};
param.avrc_tg_init_stat.state = state;
btc_avrc_tg_cb_to_app(ESP_AVRC_TG_PROF_STATE_EVT, &param);
}
static void btc_avrc_tg_send_rn_rsp(esp_avrc_rn_event_ids_t event_id, esp_avrc_rn_rsp_t rsp, const esp_avrc_rn_param_t *param)

View File

@ -467,25 +467,6 @@ static void btc_stop_adv_callback(uint8_t status)
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
}
}
static void btc_clear_adv_callback(uint8_t status)
{
esp_ble_gap_cb_param_t param;
bt_status_t ret;
btc_msg_t msg = {0};
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_GAP_BLE;
msg.act = ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT;
param.adv_clear_cmpl.status = btc_hci_to_esp_status(status);
ret = btc_transfer_context(&msg, &param,
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
if (ret != BT_STATUS_SUCCESS) {
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
}
}
#endif // #if (BLE_42_ADV_EN == TRUE)
void btc_update_duplicate_exceptional_list_callback(tBTA_STATUS status, uint8_t subcode, uint32_t length, uint8_t *device_info)
@ -1406,6 +1387,45 @@ void btc_dtm_stop_callback(void *p1)
}
#endif // #if ((BLE_42_DTM_TEST_EN == TRUE) || (BLE_50_DTM_TEST_EN == TRUE))
static void btc_ble_set_privacy_mode_callback(UINT8 status)
{
esp_ble_gap_cb_param_t param;
bt_status_t ret;
btc_msg_t msg = {0};
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_GAP_BLE;
msg.act = ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT;
param.set_privacy_mode_cmpl.status = btc_btm_status_to_esp_status(status);
ret = btc_transfer_context(&msg, &param, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
if (ret != BT_STATUS_SUCCESS) {
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
}
}
#if (BLE_VENDOR_HCI_EN == TRUE)
static void btc_clear_adv_callback(uint8_t status)
{
esp_ble_gap_cb_param_t param;
bt_status_t ret;
btc_msg_t msg = {0};
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_GAP_BLE;
msg.act = ESP_GAP_BLE_ADV_CLEAR_COMPLETE_EVT;
param.adv_clear_cmpl.status = btc_hci_to_esp_status(status);
ret = btc_transfer_context(&msg, &param,
sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
if (ret != BT_STATUS_SUCCESS) {
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
}
}
static void btc_ble_vendor_hci_cmd_complete_callback(tBTA_VSC_CMPL *p_param)
{
bool param_invalid = false;
@ -1442,25 +1462,6 @@ static void btc_ble_vendor_hci_cmd_complete_callback(tBTA_VSC_CMPL *p_param)
}
}
static void btc_ble_set_privacy_mode_callback(UINT8 status)
{
esp_ble_gap_cb_param_t param;
bt_status_t ret;
btc_msg_t msg = {0};
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_GAP_BLE;
msg.act = ESP_GAP_BLE_SET_PRIVACY_MODE_COMPLETE_EVT;
param.set_privacy_mode_cmpl.status = btc_btm_status_to_esp_status(status);
ret = btc_transfer_context(&msg, &param, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
if (ret != BT_STATUS_SUCCESS) {
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
}
}
static void btc_ble_set_csa_support_callback(UINT8 status)
{
esp_ble_gap_cb_param_t param;
@ -1490,7 +1491,7 @@ static void btc_ble_set_vendor_evt_mask_callback(UINT8 status)
msg.pid = BTC_PID_GAP_BLE;
msg.act = ESP_GAP_BLE_SET_VENDOR_EVT_MASK_COMPLETE_EVT;
param.set_csa_support_cmpl.status = btc_btm_status_to_esp_status(status);
param.set_vendor_evt_mask_cmpl.status = btc_btm_status_to_esp_status(status);
ret = btc_transfer_context(&msg, &param, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
@ -1504,20 +1505,52 @@ static void btc_ble_vendor_hci_event_callback(UINT8 subevt_code, UINT8 param_len
esp_ble_gap_cb_param_t param = {0};
bt_status_t ret;
btc_msg_t msg = {0};
esp_ble_vendor_evt_param_t *evt_param = &param.vendor_hci_evt.param;
bool copy_param = false;
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_GAP_BLE;
msg.act = ESP_GAP_BLE_VENDOR_HCI_EVT;
param.vendor_hci_evt.subevt_code = subevt_code;
param.vendor_hci_evt.param_len = param_len;
param.vendor_hci_evt.param_buf = params;
ret = btc_transfer_context(&msg, &param, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
param.vendor_hci_evt.param_len = 0;
param.vendor_hci_evt.param_buf = NULL;
switch (subevt_code) {
case BLE_VENDOR_PDU_RECV_EVT:
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_PDU_RECV_EVT;
STREAM_TO_UINT8(evt_param->pdu_recv.type, params);
STREAM_TO_UINT8(evt_param->pdu_recv.handle, params);
STREAM_TO_UINT8(evt_param->pdu_recv.addr_type, params);
STREAM_TO_BDADDR(evt_param->pdu_recv.peer_addr, params);
break;
case BLE_VENDOR_CHMAP_UPDATE_EVT:
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_CHAN_MAP_UPDATE_EVT;
STREAM_TO_UINT8(evt_param->chan_map_update.status, params);
STREAM_TO_UINT16(evt_param->chan_map_update.conn_handle, params);
REVERSE_STREAM_TO_ARRAY(evt_param->chan_map_update.ch_map, params, ESP_GAP_BLE_CHANNELS_LEN);
break;
case BLE_VENDOR_SLEEP_WAKEUP_EVT:
param.vendor_hci_evt.subevt_code = ESP_BLE_VENDOR_SLEEP_WAKEUP_EVT;
// No parameters
break;
default:
copy_param = true;
break;
}
if (copy_param) {
param.vendor_hci_evt.param_len = param_len;
param.vendor_hci_evt.param_buf = (param_len) ? params : NULL;
ret = btc_transfer_context(&msg, &param, sizeof(esp_ble_gap_cb_param_t), btc_gap_ble_cb_deep_copy, btc_gap_ble_cb_deep_free);
} else {
ret = btc_transfer_context(&msg, &param, sizeof(esp_ble_gap_cb_param_t), NULL, NULL);
}
if (ret != BT_STATUS_SUCCESS) {
BTC_TRACE_ERROR("%s btc_transfer_context failed\n", __func__);
}
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
void btc_get_whitelist_size(uint16_t *length)
{
@ -1552,11 +1585,6 @@ static void btc_ble_stop_advertising(tBTA_START_STOP_ADV_CMPL_CBACK *stop_adv_cb
BTA_DmBleBroadcast(stop_adv, stop_adv_cb);
}
static void btc_ble_clear_advertising(tBTA_CLEAR_ADV_CMPL_CBACK *clear_adv_cb)
{
BTA_DmBleClearAdv(clear_adv_cb);
}
#endif // #if (BLE_42_ADV_EN == TRUE)
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
@ -1899,6 +1927,7 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
}
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_VENDOR_HCI_EN == TRUE)
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT: {
btc_ble_gap_args_t *src = (btc_ble_gap_args_t *)p_src;
btc_ble_gap_args_t *dst = (btc_ble_gap_args_t *)p_dest;
@ -1912,6 +1941,7 @@ void btc_gap_ble_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
}
break;
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
case BTC_GAP_BLE_ACT_SET_DEV_NAME:{
btc_ble_gap_args_t *src = (btc_ble_gap_args_t *)p_src;
btc_ble_gap_args_t *dst = (btc_ble_gap_args_t *)p_dest;
@ -2065,6 +2095,7 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
}
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_VENDOR_HCI_EN == TRUE)
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT: {
uint8_t *p_param_buf = ((btc_ble_gap_args_t *)msg->arg)->vendor_cmd_send.p_param_buf;
if (p_param_buf) {
@ -2072,6 +2103,7 @@ void btc_gap_ble_arg_deep_free(btc_msg_t *msg)
}
break;
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
case BTC_GAP_BLE_ACT_SET_DEV_NAME:{
char *p_name = ((btc_ble_gap_args_t *)msg->arg)->set_dev_name.device_name;
if (p_name) {
@ -2156,9 +2188,6 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
case BTC_GAP_BLE_ACT_STOP_ADV:
btc_ble_stop_advertising(btc_stop_adv_callback);
break;
case BTC_GAP_BLE_ACT_CLEAR_ADV:
btc_ble_clear_advertising(btc_clear_adv_callback);
break;
#endif // #if (BLE_42_ADV_EN == TRUE)
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
case BTC_GAP_BLE_ACT_UPDATE_CONN_PARAM:
@ -2618,22 +2647,27 @@ void btc_gap_ble_call_handler(btc_msg_t *msg)
btc_ble_dtm_enhance_rx_start(arg_5->dtm_enh_rx_start.rx_channel, arg_5->dtm_enh_rx_start.phy, arg_5->dtm_enh_rx_start.modulation_index, btc_dtm_rx_start_callback);
break;
#endif // #if (BLE_50_DTM_TEST_EN == TRUE)
case BTC_GAP_BLE_SET_PRIVACY_MODE:
btc_ble_set_privacy_mode(arg->set_privacy_mode.addr_type, arg->set_privacy_mode.addr,
arg->set_privacy_mode.privacy_mode, btc_ble_set_privacy_mode_callback);
break;
#if (BLE_VENDOR_HCI_EN == TRUE)
case BTC_GAP_BLE_ACT_CLEAR_ADV:
BTA_DmBleClearAdv(btc_clear_adv_callback);
break;
case BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT:
BTA_DmsendVendorHciCmd(arg->vendor_cmd_send.opcode,
arg->vendor_cmd_send.param_len,
arg->vendor_cmd_send.p_param_buf,
btc_ble_vendor_hci_cmd_complete_callback);
break;
case BTC_GAP_BLE_SET_PRIVACY_MODE:
btc_ble_set_privacy_mode(arg->set_privacy_mode.addr_type, arg->set_privacy_mode.addr,
arg->set_privacy_mode.privacy_mode, btc_ble_set_privacy_mode_callback);
break;
case BTC_GAP_BLE_SET_CSA_SUPPORT:
BTA_DmBleGapSetCsaSupport(arg->set_csa_support.csa_select, btc_ble_set_csa_support_callback);
break;
case BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK:
BTA_DmBleGapSetVendorEventMask(arg->set_vendor_evt_mask.evt_mask, btc_ble_set_vendor_evt_mask_callback);
break;
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
case BTC_GAP_BLE_ENH_READ_TRANS_POWER_LEVEL:
BTA_DmBleGapEnhReadTransPwrLevel(arg_5->enh_read_trans_pwr_level.conn_handle, arg_5->enh_read_trans_pwr_level.phy);
@ -2682,7 +2716,9 @@ void btc_gap_callback_init(void)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
BTM_BleGapRegisterCallback(btc_ble_5_gap_callback);
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_VENDOR_HCI_EN == TRUE)
BTM_BleRegisterVendorHciEventCallback(btc_ble_vendor_hci_event_callback);
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
}
bool btc_gap_ble_init(void)

View File

@ -24,6 +24,10 @@ extern tBTA_BLE_ADV_DATA *gl_bta_scan_rsp_data_ptr;
#define BLE_ISVALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)))
#define BLE_VENDOR_PDU_RECV_EVT (0xC0)
#define BLE_VENDOR_CHMAP_UPDATE_EVT (0xC1)
#define BLE_VENDOR_SLEEP_WAKEUP_EVT (0xC3)
typedef enum {
#if (BLE_42_FEATURE_SUPPORT == TRUE)
BTC_GAP_BLE_ACT_CFG_ADV_DATA = 0,
@ -113,15 +117,15 @@ typedef enum {
BTC_GAP_BLE_DTM_RX_START,
#endif // #if (BLE_42_DTM_TEST_EN == TRUE)
BTC_GAP_BLE_DTM_STOP,
#if (BLE_42_FEATURE_SUPPORT == TRUE)
#if (BLE_VENDOR_HCI_EN == TRUE)
BTC_GAP_BLE_ACT_CLEAR_ADV,
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
BTC_GAP_BLE_ACT_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT,
BTC_GAP_BLE_ACT_ADD_DEVICE_TO_RESOLVING_LIST,
BTC_GAP_BLE_ACT_VENDOR_HCI_CMD_EVT,
BTC_GAP_BLE_SET_PRIVACY_MODE,
BTC_GAP_BLE_SET_CSA_SUPPORT,
BTC_GAP_BLE_ACT_SET_VENDOR_EVT_MASK,
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
BTC_GAP_BLE_ACT_SET_RESOLVABLE_PRIVATE_ADDRESS_TIMEOUT,
BTC_GAP_BLE_ACT_ADD_DEVICE_TO_RESOLVING_LIST,
BTC_GAP_BLE_SET_PRIVACY_MODE,
#if (BLE_FEAT_POWER_CONTROL_EN == TRUE)
BTC_GAP_BLE_ENH_READ_TRANS_POWER_LEVEL,
BTC_GAP_BLE_READ_REM_TRANS_POWER_LEVEL,

View File

@ -364,6 +364,12 @@
#define UC_BT_BLE_FEAT_CONN_SUBRATING FALSE
#endif
#ifdef CONFIG_BT_BLE_VENDOR_HCI_EN
#define UC_BT_BLE_VENDOR_HCI_EN CONFIG_BT_BLE_VENDOR_HCI_EN
#else
#define UC_BT_BLE_VENDOR_HCI_EN FALSE
#endif
#ifdef CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
#define UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL
#else

View File

@ -415,6 +415,12 @@
#define BLE_FEAT_CONN_SUBRATING FALSE
#endif
#if (UC_BT_BLE_VENDOR_HCI_EN == TRUE)
#define BLE_VENDOR_HCI_EN TRUE
#else
#define BLE_VENDOR_HCI_EN FALSE
#endif
#if (UC_BT_BLE_HIGH_DUTY_ADV_INTERVAL == TRUE)
#define BLE_HIGH_DUTY_ADV_INTERVAL TRUE
#else

View File

@ -223,12 +223,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
#define BTM_TRACE_ERROR(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_BTM", fmt, ## args); \
if (btm_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(BTM, ERROR)) BT_PRINT_E("BT_BTM", fmt, ## args); \
}
#define BTM_TRACE_WARNING(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_BTM", fmt, ## args); \
if (btm_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(BTM, WARNING)) BT_PRINT_W("BT_BTM", fmt, ## args); \
}
@ -243,7 +241,6 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
}
#define BTM_TRACE_DEBUG(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_BTM", fmt, ## args); \
if (btm_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(BTM, DEBUG)) BT_PRINT_D("BT_BTM", fmt, ## args); \
}
@ -262,12 +259,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
#define L2CAP_TRACE_ERROR(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_L2CAP", fmt, ## args); \
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(L2CAP, ERROR)) BT_PRINT_E("BT_L2CAP", fmt, ## args); \
}
#define L2CAP_TRACE_WARNING(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_L2CAP", fmt, ## args); \
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(L2CAP, WARNING)) BT_PRINT_W("BT_L2CAP", fmt, ## args); \
}
@ -277,12 +272,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
}
#define L2CAP_TRACE_EVENT(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_L2CAP", fmt, ## args); \
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(L2CAP, EVENT)) BT_PRINT_D("BT_L2CAP", fmt, ## args); \
}
#define L2CAP_TRACE_DEBUG(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_L2CAP", fmt, ## args); \
if (l2cb.l2cap_trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(L2CAP, DEBUG)) BT_PRINT_D("BT_L2CAP", fmt, ## args); \
}
@ -317,12 +310,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
#define GAP_TRACE_ERROR(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_GAP", fmt, ## args); \
if (gap_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(GAP, ERROR)) BT_PRINT_E("BT_GAP", fmt, ## args); \
}
#define GAP_TRACE_WARNING(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_GAP", fmt, ## args); \
if (gap_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(GAP, WARNING)) BT_PRINT_W("BT_GAP", fmt, ## args); \
}
@ -332,7 +323,6 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
}
#define GAP_TRACE_EVENT(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GAP", fmt, ## args); \
if (gap_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(GAP, EVENT)) BT_PRINT_D("BT_GAP", fmt, ## args); \
}
@ -450,12 +440,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
#define GATT_TRACE_ERROR(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_GATT", fmt, ## args); \
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(GATT, ERROR)) BT_PRINT_E("BT_GATT", fmt, ## args); \
}
#define GATT_TRACE_WARNING(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_GATT", fmt, ## args); \
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(GATT, WARNING)) BT_PRINT_W("BT_GATT", fmt, ## args); \
}
@ -465,12 +453,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
}
#define GATT_TRACE_EVENT(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GATT", fmt, ## args); \
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(GATT, EVENT)) BT_PRINT_D("BT_GATT", fmt, ## args); \
}
#define GATT_TRACE_DEBUG(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_GATT", fmt, ## args); \
if (gatt_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(GATT, DEBUG)) BT_PRINT_D("BT_GATT", fmt, ## args); \
}
@ -489,12 +475,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
#if (BT_BLE_LOG_SPI_OUT_HOST_ENABLED && !CLASSIC_BT_INCLUDED)
#define SMP_TRACE_ERROR(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_ERROR, "BT_SMP", fmt, ## args); \
if (smp_cb.trace_level >= BT_TRACE_LEVEL_ERROR && BT_LOG_LEVEL_CHECK(SMP, ERROR)) BT_PRINT_E("BT_SMP", fmt, ## args); \
}
#define SMP_TRACE_WARNING(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_WARN, "BT_SMP", fmt, ## args); \
if (smp_cb.trace_level >= BT_TRACE_LEVEL_WARNING && BT_LOG_LEVEL_CHECK(SMP, WARNING)) BT_PRINT_W("BT_SMP", fmt, ## args); \
}
@ -504,12 +488,10 @@ static inline void trc_dump_buffer(const char *prefix, uint8_t *data, uint16_t l
}
#define SMP_TRACE_EVENT(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_SMP", fmt, ## args); \
if (smp_cb.trace_level >= BT_TRACE_LEVEL_EVENT && BT_LOG_LEVEL_CHECK(SMP, EVENT)) BT_PRINT_D("BT_SMP", fmt, ## args); \
}
#define SMP_TRACE_DEBUG(fmt, args...) { \
ble_log_spi_out_printf_enh(BLE_LOG_SPI_OUT_SOURCE_BLUEDROID, BLE_LOG_SPI_OUT_LEVEL_DEBUG, "BT_SMP", fmt, ## args); \
if (smp_cb.trace_level >= BT_TRACE_LEVEL_DEBUG && BT_LOG_LEVEL_CHECK(SMP, DEBUG)) BT_PRINT_D("BT_SMP", fmt, ## args); \
}

View File

@ -2946,7 +2946,7 @@ uint8_t btm_ble_scan_active_count(void)
}
#if (SMP_INCLUDED == TRUE)
uint8_t btm_ble_sec_dev_active_count(void)
uint8_t btm_ble_sec_dev_record_count(void)
{
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
list_node_t *p_node = NULL;
@ -2962,6 +2962,12 @@ uint8_t btm_ble_sec_dev_active_count(void)
return count;
}
void btm_ble_clear_sec_dev_record(void)
{
/* only used when connection is closed */
if(btm_cb.p_sec_dev_rec_list) list_clear(btm_cb.p_sec_dev_rec_list);
}
#endif
#if (BLE_PRIVACY_SPT == TRUE)

View File

@ -613,6 +613,7 @@ tBTM_STATUS BTM_BleStartExtAdvRestart(uint8_t con_handle)
}
if((index >= MAX_BLE_ADV_INSTANCE) || (!adv_record[index].invalid)) {
BTM_TRACE_WARNING("%s failed to find extend adv, adv_handle %u con_handle %u", __func__, index, con_handle);
return BTM_WRONG_MODE;
}
@ -1254,7 +1255,7 @@ void btm_ble_adv_set_terminated_evt(tBTM_BLE_ADV_TERMINAT *params)
}
// adv terminated due to connection, save the adv handle and connection handle
if(params->completed_event == 0x00) {
if(params->status == 0x00) {
adv_record[params->adv_handle].ter_con_handle = params->conn_handle;
} else {
adv_record[params->adv_handle].ter_con_handle = INVALID_VALUE;

View File

@ -201,7 +201,12 @@ BOOLEAN btm_add_dev_to_controller (BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TY
/* Controller do not support resolvable address now, only support public address and static random address */
BOOLEAN started = FALSE;
if(wl_addr_type > BLE_ADDR_RANDOM) {
#if (BLE_50_FEATURE_SUPPORT == TRUE)
if (wl_addr_type > BLE_ADDR_RANDOM && wl_addr_type != BLE_ADDR_ANONYMOUS)
#else
if (wl_addr_type > BLE_ADDR_RANDOM)
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
{
BTM_TRACE_ERROR("wl_addr_type is error\n");
return started;
}
@ -278,7 +283,12 @@ void btm_enq_wl_dev_operation(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE ad
*******************************************************************************/
BOOLEAN btm_update_dev_to_white_list(BOOLEAN to_add, BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBTM_UPDATE_WHITELIST_CBACK *update_wl_cb)
{
if(addr_type > BLE_ADDR_RANDOM) {
#if (BLE_50_FEATURE_SUPPORT == TRUE)
if (addr_type > BLE_ADDR_RANDOM && addr_type != BLE_ADDR_ANONYMOUS)
#else
if (addr_type > BLE_ADDR_RANDOM)
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
{
BTM_TRACE_ERROR("%s address type is error, unable to add device", __func__);
if (update_wl_cb){
update_wl_cb(HCI_ERR_ILLEGAL_PARAMETER_FMT,to_add);

View File

@ -72,7 +72,9 @@ static tBTM_BLE_CTRL_FEATURES_CBACK *p_ctrl_le_feature_rd_cmpl_cback = NULL;
tBTM_CallbackFunc conn_callback_func;
// BLE vendor HCI event callback
#if (BLE_VENDOR_HCI_EN == TRUE)
static tBTM_BLE_VENDOR_HCI_EVT_CBACK *ble_vs_evt_callback = NULL;
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
/*******************************************************************************
** Local functions
*******************************************************************************/
@ -353,10 +355,12 @@ void BTM_BleRegiseterPktLengthChangeCallback(tBTM_SET_PKT_DATA_LENGTH_CBACK *ptk
conn_callback_func.set_pkt_data_length_cb = ptk_len_chane_cb;
}
#if (BLE_VENDOR_HCI_EN == TRUE)
void BTM_BleRegisterVendorHciEventCallback(tBTM_BLE_VENDOR_HCI_EVT_CBACK *vendor_hci_evt_cb)
{
ble_vs_evt_callback = vendor_hci_evt_cb;
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
/*******************************************************************************
**
@ -4548,6 +4552,7 @@ BOOLEAN btm_ble_update_mode_operation(UINT8 link_role, BD_ADDR bd_addr, UINT8 st
return bg_con;
}
#if (BLE_VENDOR_HCI_EN == TRUE)
static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
{
UINT8 sub_event;
@ -4559,7 +4564,7 @@ static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
STREAM_TO_UINT8(sub_event, p);
len--;
if (sub_event < HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT) {
if (sub_event < HCI_VSE_LE_SUBEVT_BASE) {
return;
}
@ -4567,6 +4572,7 @@ static void btm_ble_vs_evt_callback(UINT8 len, UINT8 *p)
ble_vs_evt_callback(sub_event, len, p);
}
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
/*******************************************************************************
**
@ -4626,8 +4632,9 @@ void btm_ble_init (void)
btm_ble_adv_filter_init();
#endif // #if BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE
#endif
#if (BLE_VENDOR_HCI_EN == TRUE)
BTM_RegisterForVSEvents(btm_ble_vs_evt_callback, TRUE);
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
}
/*******************************************************************************
@ -4754,6 +4761,7 @@ BOOLEAN BTM_Ble_Authorization(BD_ADDR bd_addr, BOOLEAN authorize)
return FALSE;
}
#if (BLE_VENDOR_HCI_EN == TRUE)
/*******************************************************************************
**
** Function BTM_BleClearAdv
@ -4775,6 +4783,30 @@ BOOLEAN BTM_BleClearAdv(tBTM_CLEAR_ADV_CMPL_CBACK *p_clear_adv_cback)
p_cb->inq_var.p_clear_adv_cb = p_clear_adv_cback;
return TRUE;
}
BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
{
if (btsnd_hcic_ble_set_csa_support(csa_select) != TRUE) {
BTM_TRACE_ERROR("LE SetCsaSupport csa_select=%d: error", csa_select);
return FALSE;
}
btm_cb.ble_ctr_cb.set_csa_support_cmpl_cb = p_callback;
return TRUE;
}
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
{
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
return FALSE;
}
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
return TRUE;
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
BOOLEAN BTM_BleSetRpaTimeout(uint16_t rpa_timeout,tBTM_SET_RPA_TIMEOUT_CMPL_CBACK *p_set_rpa_timeout_cback)
{
if ((btsnd_hcic_ble_set_rand_priv_addr_timeout(rpa_timeout)) != TRUE) {
@ -4810,28 +4842,6 @@ BOOLEAN BTM_BleSetPrivacyMode(UINT8 addr_type, BD_ADDR bd_addr, UINT8 privacy_mo
return TRUE;
}
BOOLEAN BTM_BleSetCsaSupport(UINT8 csa_select, tBTM_SET_CSA_SUPPORT_CMPL_CBACK *p_callback)
{
if (btsnd_hcic_ble_set_csa_support(csa_select) != TRUE) {
BTM_TRACE_ERROR("LE SetCsaSupport csa_select=%d: error", csa_select);
return FALSE;
}
btm_cb.ble_ctr_cb.set_csa_support_cmpl_cb = p_callback;
return TRUE;
}
BOOLEAN BTM_BleSetVendorEventMask(UINT32 evt_mask, tBTM_SET_VENDOR_EVT_MASK_CBACK *p_callback)
{
if (btsnd_hcic_ble_set_vendor_evt_mask(evt_mask) != TRUE) {
BTM_TRACE_ERROR("LE SetVendorEventMask evt_mask=%x: error", evt_mask);
return FALSE;
}
btm_cb.ble_ctr_cb.set_vendor_evt_mask_cmpl_cb = p_callback;
return TRUE;
}
#if (BLE_42_SCAN_EN == TRUE)
bool btm_ble_adv_pkt_ready(void)
{

View File

@ -187,8 +187,10 @@ BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
}
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
#if (CLASSIC_BT_INCLUDED == TRUE)
/* Tell controller to get rid of the link key, if it has one stored */
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
#endif // (CLASSIC_BT_INCLUDED == TRUE)
btm_sec_free_dev(p_dev_rec, transport);
}

View File

@ -1149,6 +1149,7 @@ tBTM_STATUS BTM_EnableTestMode(void)
}
#endif // #if (BLE_HOST_ENABLE_TEST_MODE_EN == TRUE)
#if (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function BTM_DeleteStoredLinkKey
@ -1223,6 +1224,7 @@ void btm_delete_stored_link_key_complete (UINT8 *p)
}
}
#endif // (CLASSIC_BT_INCLUDED == TRUE)
/*******************************************************************************
**
** Function btm_report_device_status

View File

@ -612,12 +612,12 @@ static tBTM_STATUS btm_send_connect_request(UINT16 acl_handle,
** If so, we cannot use SCO-only packet types (HFP 1.7)
*/
if (BTM_BothEndsSupportSecureConnections(p_acl->remote_addr)) {
temp_pkt_types &= ~(BTM_SCO_PKT_TYPE_MASK);
temp_pkt_types &= ~(BTM_SCO_LINK_ONLY_MASK);
BTM_TRACE_DEBUG("%s: SCO Conn: pkt_types after removing SCO (0x%04x)", __FUNCTION__,
temp_pkt_types);
/* Return error if no packet types left */
if (temp_pkt_types == 0) {
if (temp_pkt_types == BTM_SCO_EXCEPTION_PKTS_MASK) {
BTM_TRACE_ERROR("%s: SCO Conn (BR/EDR SC): No packet types available",__FUNCTION__);
return (BTM_WRONG_MODE);
}

View File

@ -1001,12 +1001,12 @@ tBTM_STATUS btm_sec_bond_by_transport (BD_ADDR bd_addr, tBT_TRANSPORT transport,
return (BTM_SUCCESS);
}
#if (CLASSIC_BT_INCLUDED == TRUE)
/* Tell controller to get rid of the link key if it has one stored */
if ((BTM_DeleteStoredLinkKey (bd_addr, NULL)) != BTM_SUCCESS) {
return (BTM_NO_RESOURCES);
}
#if (CLASSIC_BT_INCLUDED == TRUE)
/* Save the PIN code if we got a valid one */
if (p_pin && (pin_len <= PIN_CODE_LEN) && (pin_len != 0)) {
btm_cb.pin_code_len = pin_len;

View File

@ -1088,27 +1088,6 @@ BOOLEAN btsnd_hcic_ble_set_channels (BLE_CHANNELS channels)
return (TRUE);
}
BOOLEAN btsnd_hcic_ble_clear_adv (void)
{
BT_HDR *p;
UINT8 *pp;
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_ADV)) == NULL) {
return (FALSE);
}
pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_ADV;
p->offset = 0;
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_CLEAR_ADV);
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_CLEAR_ADV);
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
return TRUE;
}
#define HCIC_BLE_CMD_CREATED(p, pp, size) do{\
if ((p = HCI_GET_CMD_BUF(size)) == NULL) { \
return FALSE; \
@ -1948,6 +1927,28 @@ BOOLEAN btsnd_hcic_ble_set_privacy_mode(UINT8 addr_type, BD_ADDR addr, UINT8 pri
return (TRUE);
}
#if (BLE_VENDOR_HCI_EN == TRUE)
BOOLEAN btsnd_hcic_ble_clear_adv (void)
{
BT_HDR *p;
UINT8 *pp;
if ((p = HCI_GET_CMD_BUF (HCIC_PARAM_SIZE_BLE_CLEAR_ADV)) == NULL) {
return (FALSE);
}
pp = (UINT8 *)(p + 1);
p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_CLEAR_ADV;
p->offset = 0;
UINT16_TO_STREAM (pp, HCI_VENDOR_BLE_CLEAR_ADV);
UINT8_TO_STREAM (pp, HCIC_PARAM_SIZE_BLE_CLEAR_ADV);
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
return TRUE;
}
BOOLEAN btsnd_hcic_ble_set_csa_support (UINT8 csa_select)
{
BT_HDR *p;
@ -1991,6 +1992,7 @@ BOOLEAN btsnd_hcic_ble_set_vendor_evt_mask (UINT32 evt_mask)
btu_hcif_send_cmd (LOCAL_BR_EDR_CONTROLLER_ID, p);
return TRUE;
}
#endif // #if (BLE_VENDOR_HCI_EN == TRUE)
#endif
#if (BLE_FEAT_ISO_EN == TRUE)

View File

@ -486,6 +486,7 @@ typedef struct {
#define BLE_ADDR_RANDOM_ID 0x03
#define BLE_ADDR_TYPE_MAX BLE_ADDR_RANDOM_ID
#define BLE_ADDR_UNKNOWN_TYPE 0XFF
#define BLE_ADDR_ANONYMOUS 0xFF
typedef UINT8 tBLE_ADDR_TYPE;
#define BLE_ADDR_TYPE_MASK (BLE_ADDR_RANDOM | BLE_ADDR_PUBLIC)

View File

@ -139,7 +139,7 @@ typedef UINT16 tGATT_DISCONN_REASON;
/* max length of an attribute value
*/
#ifndef GATT_MAX_ATTR_LEN
#define GATT_MAX_ATTR_LEN 512
#define GATT_MAX_ATTR_LEN GATT_MAX_MTU_SIZE
#endif
/* default GATT MTU size over LE link

View File

@ -927,9 +927,9 @@
#define HCI_VENDOR_CH_CLASSIFICATION_EVT_SUBCODE 0x06
#define HCI_VENDOR_CH_CLASSIFICATION_REPORTING_MODE_EVT_SUBCODE 0x07
#define HCI_VSE_LE_LEGACY_SCAN_REQ_RECEIVED_EVT 0xC0
#define HCI_VSE_LE_CHAN_MAP_UPDATE_CMPL_EVT 0xC1
#define HCI_VSE_LE_EVT_MAX 0xFF
#define HCI_VENDOR_SPECIFIC_EVT 0xFF /* Vendor specific events */
#define HCI_VSE_LE_SUBEVT_BASE 0xC0 /* BLE vendor event code base */
#define HCI_VSE_LE_EVT_MAX 0xFF /* BLE vendor event code max */
#define HCI_NAP_TRACE_EVT 0xFF /* was define 0xFE, 0xFD, change to 0xFF
because conflict w/ TCI_EVT and per
specification compliant */

View File

@ -480,6 +480,8 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
if (l2cu_create_conn(p_lcb, BT_TRANSPORT_LE)) {
btm_acl_removed (p_lcb->remote_bd_addr, BT_TRANSPORT_LE);
lcb_is_free = FALSE; /* still using this lcb */
} else {
L2CAP_TRACE_ERROR("master retry connect failed");
}
}
#endif // (GATTC_CONNECT_RETRY_EN == TRUE)
@ -489,7 +491,10 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
if(btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
p_lcb->retry_create_con ++;
L2CAP_TRACE_DEBUG("slave restart extend adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
BTM_BleStartExtAdvRestart(handle);
tBTM_STATUS start_adv_status = BTM_BleStartExtAdvRestart(handle);
if (start_adv_status != BTM_SUCCESS) {
L2CAP_TRACE_ERROR("slave restart extend adv failed (err 0x%x)", start_adv_status);
}
}
#endif // #if (BLE_50_EXTEND_ADV_EN == TRUE)
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
@ -499,7 +504,10 @@ BOOLEAN l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
if(!btm_ble_inter_get() && p_lcb->link_role == HCI_ROLE_SLAVE) {
p_lcb->retry_create_con ++;
L2CAP_TRACE_DEBUG("slave resatrt adv, retry count %d reason 0x%x\n", p_lcb->retry_create_con, reason);
btm_ble_start_adv();
tBTM_STATUS start_adv_status = btm_ble_start_adv();
if (start_adv_status != BTM_SUCCESS) {
L2CAP_TRACE_ERROR("slave resatrt adv failed (err 0x%x)", start_adv_status);
}
}
#endif // #if (BLE_42_ADV_EN == TRUE)
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
@ -1084,7 +1092,9 @@ void l2c_link_check_send_pkts (tL2C_LCB *p_lcb, tL2C_CCB *p_ccb, BT_HDR *p_buf)
p_lcb_cur = list_node(p_node);
if (p_lcb_cur == p_lcb) {
p_node = list_next(p_node);
p_lcb = list_node(p_node);
if (p_node) {
p_lcb = list_node(p_node);
}
break;
}
}

View File

@ -1553,7 +1553,7 @@ void smp_fast_conn_param(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
}
/* Disable L2CAP connection parameter updates while bonding since
some peripherals are not able to revert to fast connection parameters
during the start of service discovery. Connection paramter updates
during the start of service discovery. Connection parameter updates
get enabled again once service discovery completes. */
#if (BT_MULTI_CONNECTION_ENBALE == FALSE)
L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE);
@ -1648,6 +1648,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
/* slave calculates and sends local commitment */
smp_calculate_local_commitment(p_cb);
smp_send_commitment(p_cb, NULL);
/* Ensure the connection is still active */
if (smp_get_state() == SMP_STATE_IDLE) return;
/* slave has to wait for peer nonce */
smp_set_state(SMP_STATE_WAIT_NONCE);
} else { /* i.e. master */
@ -1658,6 +1660,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
p_cb->selected_association_model);
p_cb->flags &= ~SMP_PAIR_FLAG_HAVE_PEER_COMM;
smp_send_rand(p_cb, NULL);
/* Ensure the connection is still active */
if (smp_get_state() == SMP_STATE_IDLE) return;
smp_set_state(SMP_STATE_WAIT_NONCE);
}
}
@ -1672,6 +1676,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
if (p_cb->flags & SMP_PAIR_FLAG_HAVE_PEER_COMM) {
/* master commitment is already received */
smp_send_commitment(p_cb, NULL);
/* Ensure the connection is still active */
if (smp_get_state() == SMP_STATE_IDLE) return;
smp_set_state(SMP_STATE_WAIT_NONCE);
}
}
@ -1679,6 +1685,8 @@ void smp_process_local_nonce(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
case SMP_MODEL_SEC_CONN_OOB:
if (p_cb->role == HCI_ROLE_MASTER) {
smp_send_rand(p_cb, NULL);
/* Ensure the connection is still active */
if (smp_get_state() == SMP_STATE_IDLE) return;
}
smp_set_state(SMP_STATE_WAIT_NONCE);
@ -2002,7 +2010,7 @@ void smp_link_encrypted(BD_ADDR bda, UINT8 encr_enable)
SMP_TRACE_DEBUG("%s encr_enable=%d\n", __func__, encr_enable);
if (memcmp(&smp_cb.pairing_bda[0], bda, BD_ADDR_LEN) == 0) {
/* encryption completed with STK, remmeber the key size now, could be overwite
/* encryption completed with STK, remember the key size now, could be overwrite
* when key exchange happens */
if (p_cb->loc_enc_size != 0 && encr_enable) {
/* update the link encryption key size if a SMP pairing just performed */

View File

@ -156,7 +156,7 @@ config BT_NIMBLE_ROLE_BROADCASTER
depends on BT_NIMBLE_ENABLED
default y
help
Enables broadcaster role
Enables broadcaster role
config BT_NIMBLE_ROLE_OBSERVER
bool "Enable BLE Observer role"
@ -165,6 +165,20 @@ config BT_NIMBLE_ROLE_OBSERVER
help
Enables observer role
config BT_NIMBLE_GATT_CLIENT
bool "Enable BLE GATT Client support"
depends on BT_NIMBLE_ROLE_CENTRAL
default y
help
Enables support for GATT Client
config BT_NIMBLE_GATT_SERVER
bool "Enable BLE GATT Server support"
depends on BT_NIMBLE_ROLE_PERIPHERAL
default y
help
Enables support for GATT Server
config BT_NIMBLE_NVS_PERSIST
bool "Persist the BLE Bonding keys in NVS"
depends on BT_NIMBLE_ENABLED
@ -237,6 +251,13 @@ config BT_NIMBLE_SM_SC_ONLY
help
Enable Secure Connections Only Mode
config BT_NIMBLE_PRINT_ERR_NAME
bool "Enable feature to print Error description"
depends on BT_NIMBLE_ENABLED
default y
help
Enable feature to give useful explanation for HCI errors
config BT_NIMBLE_DEBUG
bool "Enable extra runtime asserts and host debugging"
default n
@ -274,6 +295,13 @@ config BT_NIMBLE_ATT_PREFERRED_MTU
This is the default value of ATT MTU indicated by the device during an ATT MTU exchange.
This value can be changed using API ble_att_set_preferred_mtu()
config BT_NIMBLE_ATT_MAX_PREP_ENTRIES
int "Max Prepare write entries"
depends on BT_NIMBLE_ENABLED
default 64
help
This is the default value of ATT Maximum prepare entries
config BT_NIMBLE_SVC_GAP_APPEARANCE
hex "External appearance of the device"
depends on BT_NIMBLE_ENABLED
@ -384,7 +412,7 @@ config BT_NIMBLE_GATT_MAX_PROCS
config BT_NIMBLE_HS_FLOW_CTRL
bool "Enable Host Flow control"
depends on BT_NIMBLE_ENABLED
depends on BT_NIMBLE_ENABLED && !SOC_ESP_NIMBLE_CONTROLLER
default y if IDF_TARGET_ESP32
default n
help
@ -600,6 +628,13 @@ if BT_NIMBLE_50_FEATURE_SUPPORT
will be supported from BLE 5.0 onwards.
if BT_NIMBLE_EXT_ADV
config BT_NIMBLE_EXT_ADV_V2
bool "Enable support for extended adv v2"
default n
depends on BT_NIMBLE_EXT_ADV
help
Enable this option to use Extended Adv V2 command instead of V1.
config BT_NIMBLE_MAX_EXT_ADV_INSTANCES
int "Maximum number of extended advertising instances."
range 0 4
@ -708,6 +743,19 @@ menuconfig BT_NIMBLE_GATT_CACHING
select BT_NIMBLE_DYNAMIC_SERVICE
help
Enable GATT caching
config BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
bool "Include services in GATT caching"
depends on BT_NIMBLE_GATT_CACHING
default n
help
Enable this option to include *included services* (e.g., services referenced by other services)
in the GATT database cache. Disabling this will skip caching of included service entries.
config BT_NIMBLE_INCL_SVC_DISCOVERY
bool "Enable Included service discovery"
default y if BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
default n
help
Enable this option to start discovery for included service.
config BT_NIMBLE_GATT_CACHING_MAX_CONNS
int "Maximum connections to be cached"
depends on BT_NIMBLE_GATT_CACHING
@ -720,6 +768,12 @@ config BT_NIMBLE_GATT_CACHING_MAX_SVCS
default 64
help
Set this option to set the upper limit on number of services per connection to be cached.
config BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
int "Maximum number of included services per connection"
depends on BT_NIMBLE_GATT_CACHING
default 64
help
Set this option to set the upper limit on number of included services per connection to be cached.
config BT_NIMBLE_GATT_CACHING_MAX_CHRS
int "Maximum number of characteristics per connection"
depends on BT_NIMBLE_GATT_CACHING
@ -781,8 +835,172 @@ config BT_NIMBLE_BLE_GATT_BLOB_TRANSFER
This option is used when data to be sent is more than 512 bytes. For peripheral role,
BT_NIMBLE_MSYS_1_BLOCK_COUNT needs to be increased according to the need.
menu "GAP Service"
menu "BLE Services"
depends on BT_NIMBLE_GATT_SERVER
config BT_NIMBLE_PROX_SERVICE
bool "Proximity service"
default y
help
Enable Proximity Service support
config BT_NIMBLE_ANS_SERVICE
bool "Alert Notification service"
default y
help
Enable Alert Notification Service support
config BT_NIMBLE_CTS_SERVICE
bool "Current Time Service"
default y
help
Enable Current Time Service support
config BT_NIMBLE_HTP_SERVICE
bool "Health Thermometer service"
default y
help
Enable Health Thermometer Service support
config BT_NIMBLE_IPSS_SERVICE
bool "Internet Protocol Support service"
default y
help
Enable Internet Protocol Service support
config BT_NIMBLE_TPS_SERVICE
bool "Tx Power service"
default y
help
Enable Tx Power Service support
config BT_NIMBLE_IAS_SERVICE
bool "Immediate Alert service"
default y
help
Enable Immediate Alert Service support
config BT_NIMBLE_LLS_SERVICE
bool "Link Loss service"
default y
help
Enable Link Loss Service support
config BT_NIMBLE_SPS_SERVICE
bool "Serial Port service"
default y
help
Enable Serial Port Service support
config BT_NIMBLE_HR_SERVICE
bool "Heart Rate service"
default y
help
Enable HeartRate Service support
menuconfig BT_NIMBLE_HID_SERVICE
bool "HID service"
default n
help
Enable HID service support
config BT_NIMBLE_SVC_HID_MAX_INSTANCES
depends on BT_NIMBLE_HID_SERVICE
int "Maximum HID service instances"
default 2
help
Defines maximum number of HID service instances
config BT_NIMBLE_SVC_HID_MAX_RPTS
depends on BT_NIMBLE_HID_SERVICE
int "Maximum HID Report characteristics per service instance"
default 3
help
Defines maximum number of report characteristics per service instance
menuconfig BT_NIMBLE_BAS_SERVICE
bool "Battery service"
default y
help
Enable Battery service support
config BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY
depends on BT_NIMBLE_BAS_SERVICE
bool "BAS Battery Level NOTIFY permission"
help
Enable/Disable notifications on BAS Battery Level Characteristic
menuconfig BT_NIMBLE_DIS_SERVICE
bool "DIS service"
default y
help
Enable DIS service support
config BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME
depends on BT_NIMBLE_DIS_SERVICE
bool "Manufacturer Name"
default n
help
Enable the DIS characteristic Manufacturer Name String characteristic
config BT_NIMBLE_SVC_DIS_SERIAL_NUMBER
depends on BT_NIMBLE_DIS_SERVICE
bool "Serial Number"
default n
help
Enable the DIS Serial Number characteristic
config BT_NIMBLE_SVC_DIS_HARDWARE_REVISION
depends on BT_NIMBLE_DIS_SERVICE
bool "Hardware Revision"
default n
help
Enable the DIS Hardware Revision characteristic
config BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION
depends on BT_NIMBLE_DIS_SERVICE
bool "Firmware Revision"
default n
help
Enable the DIS Firmware Revision characteristic
config BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION
depends on BT_NIMBLE_DIS_SERVICE
bool "Software Revision"
default n
help
Enable the DIS Software Revision characteristic
config BT_NIMBLE_SVC_DIS_SYSTEM_ID
depends on BT_NIMBLE_DIS_SERVICE
bool "System ID"
default n
help
Enable the DIS System ID characteristic
config BT_NIMBLE_SVC_DIS_PNP_ID
depends on BT_NIMBLE_DIS_SERVICE
bool "PnP ID"
default n
help
Enable the DIS PnP ID characteristic
config BT_NIMBLE_SVC_DIS_INCLUDED
depends on BT_NIMBLE_DIS_SERVICE
bool "DIS as an Included Service"
default n
help
Use DIS as an included service
menuconfig BT_NIMBLE_GAP_SERVICE
bool "GAP Service"
default y
help
Enable GAP Service support
menu "GAP Appearance write permissions"
depends on BT_NIMBLE_GAP_SERVICE
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write"
default n
@ -792,14 +1010,12 @@ menu "GAP Service"
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write with encryption"
default n
help
Enable write with encryption permission (BLE_GATT_CHR_F_WRITE_ENC)
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
depends on BT_NIMBLE_SVC_GAP_APPEAR_WRITE
bool "Write with authentication"
default n
help
Enable write with authentication permission (BLE_GATT_CHR_F_WRITE_AUTHEN)
@ -809,48 +1025,49 @@ menu "GAP Service"
default n
help
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
endmenu
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE
default 8 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ENC
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
default 4096 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_ENC
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHN
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
default 8192 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHEN
config BT_NIMBLE_SVC_GAP_APPEAR_WRITE_PERM_ATHR
int
default 0 if !BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
default 16384 if BT_NIMBLE_SVC_GAP_APPEAR_WRITE_AUTHOR
choice BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
prompt "GAP Characteristic - Central Address Resolution"
depends on BT_NIMBLE_GAP_SERVICE
default BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
help
Weather or not Central Address Resolution characteristic is supported on
the device, and if supported, weather or not Central Address Resolution
is supported.
Weather or not Central Address Resolution characteristic is supported on
the device, and if supported, weather or not Central Address Resolution
is supported.
- Central Address Resolution characteristic not supported
- Central Address Resolution not supported
- Central Address Resolution supported
- Central Address Resolution characteristic not supported
- Central Address Resolution not supported
- Central Address Resolution supported
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
bool "Characteristic not supported"
config BT_NIMBLE_SVC_GAP_CAR_CHAR_NOT_SUPP
bool "Characteristic not supported"
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
bool "Central Address Resolution not supported"
config BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
bool "Central Address Resolution not supported"
config BT_NIMBLE_SVC_GAP_CAR_SUPP
bool "Central Address Resolution supported"
config BT_NIMBLE_SVC_GAP_CAR_SUPP
bool "Central Address Resolution supported"
endchoice
config BT_NIMBLE_SVC_GAP_CENT_ADDR_RESOLUTION
@ -859,7 +1076,9 @@ menu "GAP Service"
default 0 if BT_NIMBLE_SVC_GAP_CAR_NOT_SUPP
default 1 if BT_NIMBLE_SVC_GAP_CAR_SUPP
menu "GAP device name write permissions"
depends on BT_NIMBLE_GAP_SERVICE
config BT_NIMBLE_SVC_GAP_NAME_WRITE
bool "Write"
default n
@ -888,6 +1107,40 @@ menu "GAP Service"
Enable write with authorisation permission (BLE_GATT_CHR_F_WRITE_AUTHOR)
endmenu
menu "PPCP settings"
depends on BT_NIMBLE_GAP_SERVICE
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
depends on BT_NIMBLE_ROLE_PERIPHERAL && BT_NIMBLE_GAP_SERVICE
default 0
help
Peripheral Preferred Connection Parameter: Connection Interval maximum value
Interval Max = value * 1.25 ms
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
depends on BT_NIMBLE_ROLE_PERIPHERAL && BT_NIMBLE_GAP_SERVICE
default 0
help
Peripheral Preferred Connection Parameter: Connection Interval minimum value
Interval Min = value * 1.25 ms
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
int "PPCP Slave Latency"
depends on BT_NIMBLE_GAP_SERVICE
default 0
help
Peripheral Preferred Connection Parameter: Slave Latency
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
int "PPCP Supervision Timeout (Uint: 10 ms)"
depends on BT_NIMBLE_GAP_SERVICE
default 0
help
Peripheral Preferred Connection Parameter: Supervision Timeout
Timeout = Value * 10 ms
endmenu
config BT_NIMBLE_SVC_GAP_NAME_WRITE_PERM
int
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE
@ -908,35 +1161,6 @@ menu "GAP Service"
default 0 if !BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
default 16384 if BT_NIMBLE_SVC_GAP_NAME_WRITE_AUTHOR
config BT_NIMBLE_SVC_GAP_PPCP_MAX_CONN_INTERVAL
int "PPCP Connection Interval Max (Unit: 1.25 ms)"
depends on BT_NIMBLE_ROLE_PERIPHERAL
default 0
help
Peripheral Preferred Connection Parameter: Connection Interval maximum value
Interval Max = value * 1.25 ms
config BT_NIMBLE_SVC_GAP_PPCP_MIN_CONN_INTERVAL
int "PPCP Connection Interval Min (Unit: 1.25 ms)"
depends on BT_NIMBLE_ROLE_PERIPHERAL
default 0
help
Peripheral Preferred Connection Parameter: Connection Interval minimum value
Interval Min = value * 1.25 ms
config BT_NIMBLE_SVC_GAP_PPCP_SLAVE_LATENCY
int "PPCP Slave Latency"
default 0
help
Peripheral Preferred Connection Parameter: Slave Latency
config BT_NIMBLE_SVC_GAP_PPCP_SUPERVISION_TMO
int "PPCP Supervision Timeout (Uint: 10 ms)"
default 0
help
Peripheral Preferred Connection Parameter: Supervision Timeout
Timeout = Value * 10 ms
config BT_NIMBLE_SVC_GAP_GATT_SECURITY_LEVEL
bool "LE GATT Security Level Characteristic"
default n
@ -951,94 +1175,6 @@ menu "GAP Service"
endmenu
menu "BLE Services"
menuconfig BT_NIMBLE_HID_SERVICE
bool "HID service"
depends on BT_NIMBLE_ENABLED
default n
help
Enable HID service support
config BT_NIMBLE_SVC_HID_MAX_INSTANCES
depends on BT_NIMBLE_HID_SERVICE
int "Maximum HID service instances"
default 2
help
Defines maximum number of HID service instances
config BT_NIMBLE_SVC_HID_MAX_RPTS
depends on BT_NIMBLE_HID_SERVICE
int "Maximum HID Report characteristics per service instance"
default 3
help
Defines maximum number of report characteristics per service instance
config BT_NIMBLE_SVC_BAS_BATTERY_LEVEL_NOTIFY
depends on BT_NIMBLE_ENABLED
bool "BAS Battery Level NOTIFY permission"
default n
help
Enable/Disable notifications on BAS Battery Level Characteristic
menu "Device Information Service"
config BT_NIMBLE_SVC_DIS_MANUFACTURER_NAME
depends on BT_NIMBLE_ENABLED
bool "Manufacturer Name"
default n
help
Enable the DIS characteristic Manufacturer Name String characteristic
config BT_NIMBLE_SVC_DIS_SERIAL_NUMBER
depends on BT_NIMBLE_ENABLED
bool "Serial Number"
default n
help
Enable the DIS Serial Number characteristic
config BT_NIMBLE_SVC_DIS_HARDWARE_REVISION
depends on BT_NIMBLE_ENABLED
bool "Hardware Revision"
default n
help
Enable the DIS Hardware Revision characteristic
config BT_NIMBLE_SVC_DIS_FIRMWARE_REVISION
depends on BT_NIMBLE_ENABLED
bool "Firmware Revision"
default n
help
Enable the DIS Firmware Revision characteristic
config BT_NIMBLE_SVC_DIS_SOFTWARE_REVISION
depends on BT_NIMBLE_ENABLED
bool "Software Revision"
default n
help
Enable the DIS Software Revision characteristic
config BT_NIMBLE_SVC_DIS_SYSTEM_ID
depends on BT_NIMBLE_ENABLED
bool "System ID"
default n
help
Enable the DIS System ID characteristic
config BT_NIMBLE_SVC_DIS_PNP_ID
depends on BT_NIMBLE_ENABLED
bool "PnP ID"
default n
help
Enable the DIS PnP ID characteristic
config BT_NIMBLE_SVC_DIS_INCLUDED
depends on BT_NIMBLE_ENABLED
bool "DIS as an Included Service"
default n
help
Use DIS as an included service
endmenu
endmenu
config BT_NIMBLE_VS_SUPPORT
bool "Enable support for VSC and VSE"
help
@ -1075,8 +1211,7 @@ config BT_NIMBLE_HIGH_DUTY_ADV_ITVL
config BT_NIMBLE_HOST_ALLOW_CONNECT_WITH_SCAN
bool "Allow Connections with scanning in progress"
depends on BT_NIMBLE_ENABLED
depends on (!SOC_ESP_NIMBLE_CONTROLLER || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32H2)
depends on BT_NIMBLE_ENABLED && !(IDF_TARGET_ESP32C2)
help
This enables support for user to initiate a new connection with scan in progress

View File

@ -98,6 +98,14 @@
#define MYNEWT_VAL_BLE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV)
#endif
#ifndef MYNEWT_VAL_BLE_EXT_ADV_V2
#ifdef CONFIG_BT_NIMBLE_EXT_ADV_V2
#define MYNEWT_VAL_BLE_EXT_ADV_V2 (CONFIG_BT_NIMBLE_EXT_ADV_V2)
#else
#define MYNEWT_VAL_BLE_EXT_ADV_V2 (0)
#endif
#endif
#ifndef CONFIG_BT_NIMBLE_EXT_ADV_MAX_SIZE
#define MYNEWT_VAL_BLE_EXT_ADV_MAX_SIZE (31)
#else
@ -129,11 +137,27 @@
#define MYNEWT_VAL_BLE_MAX_PERIODIC_ADVERTISER_LIST (CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST)
#endif
#ifndef MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY
#ifdef CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (CONFIG_BT_NIMBLE_INCL_SVC_DISCOVERY)
#else
#define MYNEWT_VAL_BLE_INCL_SVC_DISCOVERY (0)
#endif
#endif
#ifndef CONFIG_BT_NIMBLE_GATT_CACHING
#define MYNEWT_VAL_BLE_GATT_CACHING (0)
#else
#define MYNEWT_VAL_BLE_GATT_CACHING (CONFIG_BT_NIMBLE_GATT_CACHING)
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (CONFIG_BT_NIMBLE_GATT_CACHING_INCLUDE_SERVICES)
#else
#define MYNEWT_VAL_BLE_GATT_CACHING_INCLUDE_SERVICES (0)
#endif
#endif
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS)
#else
@ -146,6 +170,14 @@
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (0)
#endif
#ifndef MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_INCL_SVCS)
#else
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_INCL_SVCS (0)
#endif
#endif
#ifdef CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS)
#else
@ -212,6 +244,18 @@
#define MYNEWT_VAL_BLE_ROLE_PERIPHERAL (CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
#endif
#ifndef CONFIG_BT_NIMBLE_GATT_CLIENT
#define MYNEWT_VAL_BLE_GATTC (0)
#else
#define MYNEWT_VAL_BLE_GATTC (CONFIG_BT_NIMBLE_GATT_CLIENT)
#endif
#ifndef CONFIG_BT_NIMBLE_GATT_SERVER
#define MYNEWT_VAL_BLE_GATTS (0)
#else
#define MYNEWT_VAL_BLE_GATTS (CONFIG_BT_NIMBLE_GATT_SERVER)
#endif
#ifndef MYNEWT_VAL_BLE_WHITELIST
#define MYNEWT_VAL_BLE_WHITELIST (1)
#endif
@ -552,7 +596,7 @@
#endif
#ifndef MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES
#define MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES (64)
#define MYNEWT_VAL_BLE_ATT_SVR_MAX_PREP_ENTRIES CONFIG_BT_NIMBLE_ATT_MAX_PREP_ENTRIES
#endif
#ifndef MYNEWT_VAL_BLE_ATT_SVR_NOTIFY
@ -2032,4 +2076,16 @@
#endif
#endif
#ifndef MYNEWT_VAL_BLE_ERR_CHECK
#ifdef CONFIG_BT_NIMBLE_PRINT_ERR_NAME
#define MYNEWT_VAL_BLE_ERR_CHECK CONFIG_BT_NIMBLE_PRINT_ERR_NAME
#else
#define MYNEWT_VAL_BLE_ERR_CHECK (0)
#endif
#endif
#ifndef MYNEWT_VAL_BLE_USED_IN_IDF
#define MYNEWT_VAL_BLE_USED_IN_IDF (1)
#endif
#endif

View File

@ -30,7 +30,7 @@ extern "C" {
*
* @note Please do not modify this value
*/
#define ESP_BT_CTRL_CONFIG_VERSION 0x02502230
#define ESP_BT_CTRL_CONFIG_VERSION 0x02505080
/**
* @brief Internal use only
@ -268,7 +268,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
#define BT_CTRL_RUN_IN_FLASH_ONLY (0)
#endif
#if (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
#if defined(CONFIG_BT_CTRL_DTM_ENABLE)
#define BT_CTRL_DTM_ENABLE CONFIG_BT_CTRL_DTM_ENABLE
@ -288,20 +288,11 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
#define BT_CTRL_BLE_TEST (0)
#endif
#if defined (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || defined (CONFIG_BT_BLE_SMP_ENABLE)
#ifdef CONFIG_BT_NIMBLE_SECURITY_ENABLE
#define BLE_SECURITY_ENABLE (CONFIG_BT_NIMBLE_SECURITY_ENABLE)
#endif //CONFIG_BT_NIMBLE_SECURITY_ENABLE
#ifdef CONFIG_BT_BLE_SMP_ENABLE
#define BLE_SECURITY_ENABLE (CONFIG_BT_BLE_SMP_ENABLE)
#endif //CONFIG_BT_BLE_SMP_ENABLE
#else
#if defined (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
#define BLE_SECURITY_ENABLE (CONFIG_BT_CTRL_BLE_SECURITY_ENABLE)
#else
#define BLE_SECURITY_ENABLE (0)
#endif
#endif // (CONFIG_BT_NIMBLE_SECURITY_ENABLE) || (CONFIG_BT_BLE_SMP_ENABLE)
#if defined (CONFIG_BT_CTRL_BLE_SCAN)
#define BT_CTRL_BLE_SCAN CONFIG_BT_CTRL_BLE_SCAN
@ -309,13 +300,11 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
#define BT_CTRL_BLE_SCAN (0)
#endif
#if defined (CONFIG_BT_CTRL_BLE_ADV)
#define BT_CTRL_BLE_ADV CONFIG_BT_CTRL_BLE_ADV
#else
#define BT_CTRL_BLE_MASTER (1)
#define BT_CTRL_DTM_ENABLE (1)
#define BT_CTRL_BLE_TEST (1)
#define BLE_SECURITY_ENABLE (1)
#define BT_CTRL_BLE_SCAN (1)
#endif // (BT_CTRL_RUN_IN_FLASH_ONLY == 1)
#define BT_CTRL_BLE_ADV (0)
#endif
#ifdef CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
#define BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED CONFIG_BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
@ -384,11 +373,12 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
.dtm_en = BT_CTRL_DTM_ENABLE, \
.enc_en = BLE_SECURITY_ENABLE, \
.qa_test = BT_CTRL_BLE_TEST, \
.master_en = BT_CTRL_BLE_MASTER, \
.connect_en = BT_CTRL_BLE_MASTER, \
.scan_en = BT_CTRL_BLE_SCAN, \
.ble_aa_check = BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED, \
.ble_log_mode_en = BLE_LOG_MODE_EN, \
.ble_log_level = BLE_LOG_LEVEL, \
.adv_en = BT_CTRL_BLE_ADV, \
}
#else
@ -508,14 +498,15 @@ typedef struct {
uint8_t ble_llcp_disc_flag; /*!< Flag indicating whether the Controller disconnects after Instant Passed (0x28) error occurs. Configurable in menuconfig.
- The Controller does not disconnect after Instant Passed (0x28) by default. */
bool run_in_flash; /*!< True if the Controller code is in flash (flash model); false otherwise (default). Configurable in menuconfig. */
bool dtm_en; /*!< In the flash mode, True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
bool enc_en; /*!< In the flash mode, True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
bool qa_test; /*!< In the flash mode, True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
bool master_en; /*!< In the flash mode, True if the master feature is enabled (default); false otherwise. Configurable in menuconfig.*/
bool scan_en; /*!< In the flash mode, True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
bool dtm_en; /*!< True if the DTM feature is enabled; false otherwise (default). Configurable in menuconfig. */
bool enc_en; /*!< True if the encryption feature is enabled (default); false otherwise. Configurable in menuconfig. */
bool qa_test; /*!< True if the QA test feature is enabled; false otherwise (default). Configurable in menuconfig.*/
bool connect_en; /*!< True if the connection feature is enabled (default); false otherwise. Configurable in menuconfig.*/
bool scan_en; /*!< True if the scan feature is enabled (default); false otherwise. Configurable in menuconfig.*/
bool ble_aa_check; /*!< True if adds a verification step for the Access Address within the CONNECT_IND PDU; false otherwise. Configurable in menuconfig */
uint32_t ble_log_mode_en; /*!< BLE log mode enable */
uint8_t ble_log_level; /*!< BLE log level */
bool adv_en; /*!< True if the ADV feature is enabled (default); false otherwise. Configurable in menuconfig.*/
} esp_bt_controller_config_t;
/**

View File

@ -159,7 +159,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
*/
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20250310
#define CONFIG_VERSION 0x20250526
#define CONFIG_MAGIC 0x5A5AA5A5
/**
@ -226,6 +226,12 @@ typedef struct {
- 1 - Enable */
uint8_t vhci_enabled; /*!< VHCI mode is enabled */
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
- 0 - Disable
- 1 - Enable (default) */
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
uint32_t config_magic; /*!< Magic number for configuration validation */
} esp_bt_controller_config_t;
@ -281,6 +287,10 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
.config_magic = CONFIG_MAGIC, \
}

View File

@ -156,7 +156,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
*/
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20250310
#define CONFIG_VERSION 0x20250526
#define CONFIG_MAGIC 0x5A5AA5A5
/**
@ -226,6 +226,12 @@ typedef struct {
- 1 - Enable */
uint8_t vhci_enabled; /*!< VHCI mode is enabled */
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
- 0 - Disable
- 1 - Enable (default) */
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
uint32_t config_magic; /*!< Magic number for configuration validation */
} esp_bt_controller_config_t;
@ -284,6 +290,10 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
.config_magic = CONFIG_MAGIC, \
}
#elif CONFIG_IDF_TARGET_ESP32C61
@ -339,6 +349,10 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
.config_magic = CONFIG_MAGIC, \
}
#endif

View File

@ -161,7 +161,7 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
*/
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20250310
#define CONFIG_VERSION 0x20250526
#define CONFIG_MAGIC 0x5A5AA5A5
/**
@ -226,8 +226,14 @@ typedef struct {
uint8_t ble_data_lenth_zero_aux; /*!< Enable / disable auxiliary packets when the extended ADV data length is zero. Configurable in menuconfig.
- 0 - Disable (default)
- 1 - Enable */
uint8_t vhci_enabled; /*!< VHCI is enabled */
uint8_t vhci_enabled; /*!< VHCI is enabled */
uint8_t ptr_check_enabled; /*!< Enable boundary check for internal memory. */
uint8_t ble_adv_tx_options; /*!< The options for Extended advertising sending. */
uint8_t skip_unnecessary_checks_en; /*!< The option to skip non-fatal state checks and perform extra handling for fatal checks. */
uint8_t fast_conn_data_tx_en; /*!< The option for fast transmission of connection data
- 0 - Disable
- 1 - Enable (default) */
int8_t ch39_txpwr; /*!< BLE transmit power (in dBm) used for BLE advertising on channel 39. */
uint32_t config_magic; /*!< Configuration magic value */
} esp_bt_controller_config_t;
@ -284,6 +290,10 @@ typedef struct {
.ble_data_lenth_zero_aux = DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX, \
.vhci_enabled = DEFAULT_BT_LE_VHCI_ENABLED, \
.ptr_check_enabled = DEFAULT_BT_LE_PTR_CHECK_ENABLED, \
.ble_adv_tx_options = 0, \
.skip_unnecessary_checks_en = 0, \
.fast_conn_data_tx_en = DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN, \
.ch39_txpwr = BLE_LL_TX_PWR_DBM_N, \
.config_magic = CONFIG_MAGIC, \
}

View File

@ -79,7 +79,7 @@
#define ADC_TEST_LOW_VAL 0
#define ADC_TEST_LOW_THRESH 17
#define ADC_TEST_HIGH_VAL 3430
#define ADC_TEST_HIGH_VAL 3375
#define ADC_TEST_HIGH_THRESH 200
#elif CONFIG_IDF_TARGET_ESP32C61

View File

@ -245,10 +245,13 @@ static void twai_intr_handler_main(void *arg)
//Handle events that only require alerting (i.e. no handler)
if (events & TWAI_HAL_EVENT_BUS_OFF) {
twai_ll_set_mode(p_twai_obj->hal->dev, true, false, false); //Freeze TEC/REC by entering LOM
p_twai_obj->state = TWAI_STATE_BUS_OFF;
twai_alert_handler(p_twai_obj, TWAI_ALERT_BUS_OFF, &alert_req);
}
if (events & TWAI_HAL_EVENT_BUS_RECOV_CPLT) {
//Back to STOPPED state after recovered, for cautious engineering strategy
twai_ll_enter_reset_mode(p_twai_obj->hal->dev);
p_twai_obj->state = TWAI_STATE_STOPPED;
twai_alert_handler(p_twai_obj, TWAI_ALERT_BUS_RECOVERED, &alert_req);
}

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