Compare commits

...

1759 Commits

Author SHA1 Message Date
9d7f2d69f5 change(version): Update version to 5.3.2 2024-12-05 15:30:21 +08:00
a24dc94030 Merge branch 'fix/fix_modem_module_clock_missing_after_ota_v5.3' into 'release/v5.3'
fix(esp_system): deselect all modem modules lp clock source selection before clk initialization (v5.3)

See merge request espressif/esp-idf!34924
2024-12-05 10:48:25 +08:00
00cd226fd4 ci: increase test_wifi_power_save got ip timeout 2024-12-02 14:57:39 +08:00
7563ae5e70 fix(esp_system): deselect all modem modules clk source selection before clk init 2024-11-27 17:02:53 +08:00
4143156926 Merge branch 'fix/fix_deadlock_in_pm_mode_switching_v5.3' into 'release/v5.3'
fix(esp_pm): fix deadlock in pm_mode switching (v5.3)

See merge request espressif/esp-idf!34939
2024-11-15 20:48:26 +08:00
34b31d4c2e Merge branch 'bugfix/fix_tbtt_interval_update_fail_v5.3' into 'release/v5.3'
fix(wifi): Optimization for wifi components (v5.3)

See merge request espressif/esp-idf!34896
2024-11-15 20:09:00 +08:00
1fde2c3cec Merge branch 'fix/thread_resolve_invalid_host_v5_3' into 'release/v5.3'
fix(openthread): Fix invalid host resolving for Thread end devices(v5.3)

See merge request espressif/esp-idf!34941
2024-11-15 20:08:02 +08:00
8ed5ef2de3 ci(docs): set PDF build as allowed to fail 2024-11-15 16:36:51 +08:00
64067f4cf0 fix(wifi): fix some wifi issues 241031
1. fix cant sleep if reconnect to connected ap
    2. clear pmk in internal reconnection
    3. update connect status for init-->auth
2024-11-15 16:35:50 +08:00
6ba7a20e9f docs: add esp_wifi_types_generic.h to esp_wifi.rst 2024-11-15 16:35:50 +08:00
37674bf1b1 docs(wifi/mesh): make it clear that the root node does not automatically forward IP packets to the external address 2024-11-15 16:35:50 +08:00
90ed8096a9 docs(wifi): update the wifi api doc 2024-11-15 16:35:50 +08:00
5d04427d26 fix(wifi): update comments in esp_wifi_types_generic.h 2024-11-15 16:35:50 +08:00
4fb8608e9a fix(wifi): add esp_wifi_types_native.h and esp_wifi_types_generic.h to Doxyfile 2024-11-15 16:35:50 +08:00
43afca49b4 docs(wifi/espnow): update the documentation for EPS-NOW ERSU and phy rate
Closes https://github.com/espressif/esp-idf/issues/12216
2024-11-15 16:35:50 +08:00
8004824d30 docs(wifi/espnow): Update the description for ESP-NOW frame 2024-11-15 16:35:50 +08:00
bce45894e7 Merge branch 'feat/mipi_dsi_yuv_converter_v5.3' into 'release/v5.3'
feat(lcd): support YUV422 input color format (v5.3)

See merge request espressif/esp-idf!34761
2024-11-15 13:45:02 +08:00
9b3dd3e443 Merge branch 'fix/esp_hiram_heap_v5.3' into 'release/v5.3'
fix(esp_psram): fix a bug in PSRAM heap registration (backport v5.3)

See merge request espressif/esp-idf!34693
2024-11-15 13:44:40 +08:00
4473476107 Merge branch 'bugfix/chip823_pll_low_temp_bug_v5.3' into 'release/v5.3'
[H2]Fix cpu switch fail for bbpll cali fail bug in low temp (v5.3)

See merge request espressif/esp-idf!34599
2024-11-15 12:59:02 +08:00
5f7e1aa14f fix(openthread): Fix invalid host resolving for Thread end devices 2024-11-15 11:28:21 +08:00
b57d6ecc81 fix(esp_pm): fix deadlock in pm_mode switching 2024-11-15 11:26:26 +08:00
2607022204 fix(esp_pm): fix missed ccompare update when another core is already in do_switch 2024-11-15 11:26:25 +08:00
d44e47e910 Merge branch 'bugfix/gpio_set_level_atomic_v5.3' into 'release/v5.3'
fix(gpio): improve set level performance (v5.3)

See merge request espressif/esp-idf!34765
2024-11-15 11:22:39 +08:00
8cce21dbf6 Merge branch 'fix/p4_spi_no_dma_polling_cache_fail_v5.3' into 'release/v5.3'
fix(driver_spi): fixed p4 no dma polling trans cache sync fail (v5.3)

See merge request espressif/esp-idf!34814
2024-11-15 11:20:40 +08:00
0c90cf37bb Merge branch 'fix/littlefs_image_creation_windows_v5.3' into 'release/v5.3'
fix(littlefs): Allow LittleFS image generation on Windows + version bump (v5.3)

See merge request espressif/esp-idf!34916
2024-11-15 11:20:00 +08:00
f35389e956 Merge branch 'bugfix/fix_classic_bt_build_fail_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fixed classic bt build fail when enable dynamic memory and disable BLE (v5.3)

See merge request espressif/esp-idf!34930
2024-11-15 11:16:59 +08:00
f3e99aa4e7 Merge branch 'fix/fix_top_domain_pd_v5.3' into 'release/v5.3'
fix(esp_pm): move clock module out of TOP_DOMAIN_PERIPHERALS_BM (v5.3)

See merge request espressif/esp-idf!34881
2024-11-15 11:13:54 +08:00
6467dea037 Merge branch 'fix/tusb_midi_task_stack_overflow_v5.3' into 'release/v5.3'
fix(examples): tusb_midi task stack overflow fix (v5.3)

See merge request espressif/esp-idf!34934
2024-11-15 11:13:30 +08:00
c54355ee96 Merge branch 'bugfix/fix_avrc_absolute_volume_compatibility_v5.3' into 'release/v5.3'
bugfix/fix_avrc_absolute_volume_compatibility[backport v5.3]

See merge request espressif/esp-idf!34770
2024-11-15 10:57:45 +08:00
3e700eff31 Merge branch 'bugfix/esp32c3_eco7_usj_console_v5.3' into 'release/v5.3'
fix(esp_rom): fix esp32c3 eco7 console rom function address (v5.3)

See merge request espressif/esp-idf!34739
2024-11-15 10:43:29 +08:00
f18a122917 Merge branch 'backport/fix_154_ext_coex_5_3' into 'release/v5.3'
fix(coex): fix 802.15.4 external coexistence (backport to 5.3)

See merge request espressif/esp-idf!34901
2024-11-15 09:39:22 +08:00
be42634dc9 fix(examples): tusb_midi task stack overflow fix 2024-11-14 16:43:27 +01:00
f88298796b fix(bt/bluedroid): Fixed classic bt build fail when enable dynamic memory and disable BLE
(cherry picked from commit 59d20e80d3)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-11-14 22:13:45 +08:00
a973b02fbe fix(littlefs): Allow LittleFS image generation on Windows + version bump
Closes https://github.com/espressif/esp-idf/issues/12900
2024-11-14 13:17:52 +01:00
cfdce1f95c Merge branch 'bugfix/fix_some_wifi_bugs_1030_v5.3' into 'release/v5.3'
Bugfix/fix some wifi bugs 1030 v5.3(Backport v5.3)

See merge request espressif/esp-idf!34705
2024-11-14 20:05:21 +08:00
15c18e4757 fix(esp_rom): fix esp32c3 eco7 console rom function address 2024-11-14 19:14:50 +08:00
d902ed146c fix(esp_psram): fix a bug in PSRAM heap registration
This commit fixes a bug in the PSRAM heap initialization that didn't take into
account the reserved himem area when registering the PSRAM virtual space as a heap.
2024-11-14 19:11:20 +08:00
d8a2be0564 Merge branch 'contrib/github_pr_14196_v5.3' into 'release/v5.3'
fix(esp_http_server): prevent concurrent access to socket used in async http requests (GitHub PR) (v5.3)

See merge request espressif/esp-idf!34684
2024-11-14 19:10:23 +08:00
96a795dac9 Merge branch 'feature/usb_host_hub_support_collective_backport_p3_v5.3' into 'release/v5.3'
feat(usb_host): Hub Support Collective backport part 3/3 (v5.3)

See merge request espressif/esp-idf!33987
2024-11-14 19:09:02 +08:00
6639e723e7 Merge branch 'fix/disable_sar_power_when_enter_deepsleep_v5.3' into 'release/v5.3'
fix(esp_hw_support): disable sar power when esp32p4 going to deepsleep (v5.3)

See merge request espressif/esp-idf!34868
2024-11-14 19:06:45 +08:00
d9cbadebdd Merge branch 'bugfix/wrong_return_type_v5.3' into 'release/v5.3'
fix(i2c_lcd): wrong return type for esp_lcd_new_panel_io_i2c (v5.3)

See merge request espressif/esp-idf!34654
2024-11-14 19:01:30 +08:00
8b6ef89ade Merge branch 'bugfix/update_condition_to_verify_http_version_v5.3' into 'release/v5.3'
fix(esp_http_server): updated condition to verify http version (v5.3)

See merge request espressif/esp-idf!34635
2024-11-14 19:01:05 +08:00
c5a3c7e78f Merge branch 'ci/backport_i2s_ci_fix_to_v5.3' into 'release/v5.3'
ci(i2s&parlio): backport i2s and parlio ci fix (v5.3)

See merge request espressif/esp-idf!34587
2024-11-14 19:00:39 +08:00
62933660a8 Merge branch 'feat/fatfs_support_sector_less_than_128_v5.3' into 'release/v5.3'
feat(fatfs): enable partition handling for sectors less than 128 (v5.3)

See merge request espressif/esp-idf!34559
2024-11-14 19:00:24 +08:00
61c5b1151a Merge branch 'ci/diff_manifest_with_sha' into 'release/v5.3'
CI: Diff manifest (v5.3)

See merge request espressif/esp-idf!34746
2024-11-14 18:59:49 +08:00
14f6943f30 Merge branch 'bugfix/osi_replace_free_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Replace free/malloc with osi_free/malloc(v5.3)

See merge request espressif/esp-idf!34606
2024-11-14 18:58:57 +08:00
24bdc5312d fix: fix pll low temp bug 2024-11-14 18:58:28 +08:00
61f337f3a2 Merge branch 'docs/update_cn_libs_frameworks' into 'release/v5.3'
docs: Update CN translation for libs-frameworks.rst(v5.3)

See merge request espressif/esp-idf!34506
2024-11-14 18:56:35 +08:00
d819f0c512 Merge branch 'bugfix/p4_ld_newlib_api_v5.3' into 'release/v5.3'
fix(lp_core): updated lp rom newlib API addresses (v5.3)

See merge request espressif/esp-idf!34480
2024-11-14 18:56:14 +08:00
004e1b5c24 Merge branch 'ci/fix_macos_ccache_v5.3' into 'release/v5.3'
CI: Fix failing ccache and show ccache statistics for macOS tests (v5.3)

See merge request espressif/esp-idf!33937
2024-11-14 18:55:25 +08:00
6b2ac26da3 Merge branch 'feature/support_apll_on_p4_v5.3' into 'release/v5.3'
feat(clock): support apll clock on p4 (v5.3)

See merge request espressif/esp-idf!33214
2024-11-14 18:54:59 +08:00
b820d70949 Merge branch 'fix/fix_cache_stuck_in_esp_restart_v5.3' into 'release/v5.3'
fix(esp_system): writeback L1 Dcache before disable L2 if PSRAM used (v5.3)

See merge request espressif/esp-idf!34800
2024-11-14 18:54:08 +08:00
683b7b4f07 fix(coex): fix 802.15.4 external coexistence 2024-11-14 15:07:41 +08:00
bde65f22fc fix(gpio): improve set level performance
by avoid "read-modify-write" operation. The registers designed to be
write only.

Related to https://github.com/espressif/esp-idf/issues/14674
2024-11-14 14:35:49 +08:00
a30099a879 feat(lcd): support color conversion for mipi dsi driver 2024-11-14 14:35:25 +08:00
62a926857e fix(wifi): fix some wifi bugs 2024-11-14 14:09:55 +08:00
87bdd572c7 fix(wifi): modify the comment of bandwidth in wifi_ap_record_t 2024-11-14 14:03:39 +08:00
ee9a74ec52 feat(phy): esp32c6 update phy init data 2024-11-14 14:03:24 +08:00
439cb125c5 feat(twt): twt add parameter to enable keep alive 2024-11-14 14:03:13 +08:00
87af41852e Merge branch 'fix/find_and_close_service_in_ot_ci_case_v5.3' into 'release/v5.3'
fix(ci): optimize an openthread ci case (Backport v5.3)

See merge request espressif/esp-idf!34726
2024-11-14 12:01:21 +08:00
7cd3d4a97f Merge branch 'feature/support_moving_code_to_flash_v5.3' into 'release/v5.3'
feat(ble): Support for putting code in flash on ESP32-C2 (v5.3)

See merge request espressif/esp-idf!34785
2024-11-14 11:46:39 +08:00
d451cb1f34 Merge branch 'bugfix/support_random_iv_in_esptouch_v2_v5.3' into 'release/v5.3'
fix(wifi): Support AES IV with random value in esptouch v2 (v5.3)

See merge request espressif/esp-idf!34603
2024-11-14 10:46:03 +08:00
54bb25ce8d Merge branch 'ci/remove_gitlab_api_while_generating_test_pipeline_v5.3' into 'release/v5.3'
CI: remove gitlab api call while generating test pipeline (v5.3)

See merge request espressif/esp-idf!34639
2024-11-14 10:18:55 +08:00
d271b6b7db Merge branch 'backport/openthread_related_feature_v53_20241112' into 'release/v5.3'
Backport openthread related features to 5.3

See merge request espressif/esp-idf!34838
2024-11-14 09:42:38 +08:00
6df4318039 Merge branch 'backport/fix_energy_scan_api_para_mismatch_v53' into 'release/v5.3'
fix(openthread): set channel for energy scan(Backport v5.3)

See merge request espressif/esp-idf!34596
2024-11-14 09:42:29 +08:00
773ce3de55 ci: remove gitlab api call while generating pytest target-test child pipeline 2024-11-13 20:46:01 +01:00
91feda824b ci: generate new report if old one failed to be updated 2024-11-13 20:46:01 +01:00
fd224e83bb fix(wifi): Support AES IV with random value in esptouch v2 2024-11-13 17:29:23 +08:00
zwx
98bd2ef93c feat(openthread): support alloc nat64 session from psram 2024-11-13 16:46:29 +08:00
bb24084db4 enable openthread coap client for mtd 2024-11-13 16:46:29 +08:00
aff23f32e4 feat(openthread): update openthread submodule and border router lib 2024-11-13 16:46:29 +08:00
06fa736f84 fix(esp_pm): move clock module out of TOP_DOMAIN_PERIPHERALS_BM 2024-11-13 16:12:02 +08:00
d22ed3fc0d Merge branch 'bugfix/fix_some_ble_bugs_240926_esp32_v5.3' into 'release/v5.3'
Fixed some BLE bugs 240926 on ESP32 (v5.3)

See merge request espressif/esp-idf!34553
2024-11-13 14:21:46 +08:00
6948697e66 Merge branch 'feat/support_blecrt_90_v5.3' into 'release/v5.3'
feat(bt/bluedroid): Added API to set supported channel selection algorithm (v5.3)

See merge request espressif/esp-idf!34505
2024-11-13 14:21:40 +08:00
951aaa2a9a Merge branch 'bugfix/fix_ble_adv_start_fail_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed crash issue in BLE SMP when a disconnection process is ongoing(v5.3)

See merge request espressif/esp-idf!34528
2024-11-13 14:21:21 +08:00
845a925def Merge branch 'bugfix/fix_ble_build_fail_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed BLE build fail when enable dynamic memory and BLE5.0 (v5.3)

See merge request espressif/esp-idf!34664
2024-11-13 14:21:15 +08:00
dc1265c6eb Merge branch 'bugfix/fixed_h2_assert_master_1031_v5.3' into 'release/v5.3'
Bugfix/fixed h2 assert master 1031 (v5.3)

See merge request espressif/esp-idf!34540
2024-11-13 14:20:54 +08:00
14f37bd8e8 fix(esp_hw_support): disable sar power when esp32p4 going to deepsleep 2024-11-13 11:35:26 +08:00
49c356ab18 fix(bt/bluedroid): Fixed AVRCP compatibility issue on absolute volume synchronization 2024-11-12 19:19:50 +08:00
9196ca3054 Merge branch 'feat/support_controller_run_in_flash_only_v5.3' into 'release/v5.3'
feat/support controller run in flash only(backport v5.3)

See merge request espressif/esp-idf!34749
2024-11-12 11:12:11 +08:00
6e4b35ac4a feat(ble): Support for putting code in flash on ESP32-C2 2024-11-11 17:52:15 +08:00
2f5020176d fix(driver_spi): fixed p4 no dma polling trans cache sync fail 2024-11-11 17:35:13 +08:00
9c195f52a3 fix(esp_system): writeback L1 Dcache before disable L2 if PSRAM used 2024-11-11 14:03:08 +08:00
ac81c14b48 feat(bt/controller): Support controller code run in flash only 2024-11-08 17:28:52 +08:00
6fdc9ae60f fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(52ee788)
- Fixed BLE vendor HCI set and get tx power
- Support BLE vendor HCI set adv aux offset command
- Support BLE vendor HCI set CSA support command
- Added config for BLE instant passed workaround
- Fixed btdm_sleep_clock_sync timeout workaround


(cherry picked from commit 1e3220b0b0)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-11-08 17:28:52 +08:00
dc2b26c25f Merge branch 'fix/esp_prov_ipv6_resolve_v5_3' into 'release/v5.3'
fix(tools/esp_prov): Fix hostname resolving for IPv6-only host(v5.3)

See merge request espressif/esp-idf!34678
2024-11-08 16:36:56 +08:00
6ba4aa75fc Merge branch 'feat/openthread_dataset_changed_event_v5_3' into 'release/v5.3'
feat(openthread): Add dataset changed event and post it in state change callback(v5.3)

See merge request espressif/esp-idf!34546
2024-11-08 16:36:48 +08:00
7e712b6b20 Merge branch 'backport/upgrade-zigbee-examples-v5.3' into 'release/v5.3'
feat(zigbee): Upgrade the Zigbee lib to v1.6 for Zigbee examples(Backport v5.3)

See merge request espressif/esp-idf!34715
2024-11-08 16:36:38 +08:00
780f99b489 Merge branch 'backport/linker_script_check_missing_function_v53' into 'release/v5.3'
fix(ieee802154): fix linker error due to static function being inlined(Backport v5.3)

See merge request espressif/esp-idf!34721
2024-11-08 16:36:29 +08:00
0eb655b407 Merge branch 'fix/bypass_some_restore_process_if_sleep_rejected_v5.3' into 'release/v5.3'
fix(esp_hw_support): skip some wakeup steps if sleep is rejected (v5.3)

See merge request espressif/esp-idf!34621
2024-11-08 16:35:15 +08:00
0a14e9a4db Merge branch 'fix/c6_ble_no_adv_bug_v5.3' into 'release/v5.3'
fix: C6 ble does not send adv when coexistence with wifi

See merge request espressif/esp-idf!34573
2024-11-08 16:34:52 +08:00
4676ec7d4a Merge branch 'bugfix/fix_memory_leak_in_sco_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fix memory leak in sco when bluedroid disable (v5.3)

See merge request espressif/esp-idf!34565
2024-11-08 16:34:41 +08:00
b840737ebf Merge branch 'fix/fix_ota_slowclock_switching_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix rtc slow clock missing after the OTA app changes the slow clock source (v5.3)

See merge request espressif/esp-idf!34474
2024-11-08 16:34:22 +08:00
0448a53c66 fix(bt): fix some issues in bt controller
1: Store local device name into NVDS when handling hci_wr_local_name_cmd.
2: Set default device name during link manager initialization.
3: Set the QoS value to the minimum value if the calculated QoS is less
   than the minumum.
2024-11-08 14:33:11 +08:00
90a723f7b5 fix(bt/ble): Update esp32 libbtdm_app.a (17db8bd)
- Added a verification step for the Access Address within the CONNECT_IND PDU
2024-11-08 14:33:02 +08:00
f36d81a62c fix(bt): Update bt lib for ESP32(a2a7457)
- Fixed assert in ke_mem.c at line 409 when controller reset
- Added config for BLE instant passed workaround
- Fixed connection can't be established when initiating and advertising coexist


(cherry picked from commit 2b28133ace)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-11-08 14:32:44 +08:00
f7154edfd8 Merge branch 'feat/support_bod_p4_eco2_v5.3' into 'release/v5.3'
feat(bod): Update bod threshold on esp32p4-eco2 (backport v5.3)

See merge request espressif/esp-idf!34591
2024-11-07 21:36:01 +08:00
dccce426d5 Merge branch 'fix/fix_writeback_psram_after_vo2_powerdown_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix writeback cache to psram after vo2 powerdown (v5.3)

See merge request espressif/esp-idf!34580
2024-11-07 21:24:24 +08:00
dbe61e3290 ci: use different base commit for merge result pipelines 2024-11-07 10:40:39 +01:00
c9971bea59 ci: support diff manifest sha with the base commit 2024-11-07 10:40:23 +01:00
07959c4bbe fix(ci): optimize an openthread ci case 2024-11-07 10:45:48 +08:00
ca41ac94b9 feat(zigbee): Upgrade the Zigbee lib to v1.6 for Zigbee examples
- Optimize the Zigbee light, switch and gateway examples
- Remove the esp_zigbee_rcp example
2024-11-07 10:42:50 +08:00
zwx
c4bddd3319 fix(802.15.4): add no inline to some static function 2024-11-06 19:50:47 +08:00
6ed49332f3 fix(ieee802154): fix linker error due to static function being inlined
When the compiler decides to inline a static function, linker script
generator will complain about the missing function.
2024-11-06 19:50:41 +08:00
8b559ce614 fix(esp_http_server): prevent concurrent access to socket used in async http requests 2024-11-06 08:10:55 +01:00
20ee7e18f4 fix(tools/esp_prov): Fix hostname resolving for IPv6-only host 2024-11-05 17:44:46 +08:00
7a4d10b718 fix(ble/bluedroid): Fixed BLE build fail when enable dynamic memory and BLE5.0
(cherry picked from commit 94d1a4f1c0)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-11-05 16:13:46 +08:00
c0bc1046c8 fix(i2c_lcd): wrong return type for esp_lcd_new_panel_io_i2c
when build for C++ project
2024-11-05 13:46:24 +08:00
b06249f483 fix(esp_http_server): updated condition to verify http version
Closes https://github.com/espressif/esp-idf/issues/14723
2024-11-04 15:50:00 +05:30
d93d99f134 fix(esp_hw_support): skip some wakeup steps if sleep is rejected
1. Skip esp_timer time compensation to avoid introducing errors into rtc_timer
    2. Ignore sleep_time_overhead_out measurements when sleep is rejected
2024-11-04 14:23:53 +08:00
68b16aa2ba fix(bt/bluedroid): Replace free/malloc with osi_free/malloc 2024-11-01 17:49:39 +08:00
zwx
cbc69025d1 fix(openthread): set channel for energy scan 2024-11-01 16:38:30 +08:00
e488d7669a fix(esp_hw_support): only support power down flash after revison v1.0 on esp32p4 2024-11-01 16:26:29 +08:00
0a437b0ea0 fix(bod): Remove config for bod on p4 v0.x 2024-11-01 15:31:13 +08:00
4049f2b5fb feat(bod): Update bod threshold on esp32p4-eco2 2024-11-01 15:31:02 +08:00
12d6cdb29a feat(esp32p4): Introduce p4 eco2 configuration 2024-11-01 15:30:39 +08:00
655a99bec8 fix(esp_hw_support): fix writeback cache to psram after vo2 powerdown 2024-11-01 14:14:35 +08:00
035f2f8280 ci(parlio_rx): enable logic analyzer example test 2024-11-01 11:18:59 +08:00
9b4e9e7c7a ci(parlio_rx): increase the i2s test case stability 2024-11-01 11:06:12 +08:00
ea3f4ad6f0 ci(parlio_rx): bypass the spi test case 2024-11-01 11:06:12 +08:00
9b4d83fe40 ci(i2s): fix i2s_multi_dev failed case 2024-11-01 11:06:04 +08:00
a987953341 fix(bt/bluedroid): Fix memory leak in sco when bluedroid disable 2024-11-01 10:42:48 +08:00
bf1e6008ee feat(openthread): Add dataset changed event and post it in state change callback 2024-10-31 19:05:00 +08:00
72bdce626d fix(phy): Updated phylib to phy_version: 320, 348a293 2024-10-31 18:43:07 +08:00
c255d61f5a docs: Update CN translation for fatfs.rst 2024-10-31 11:04:55 +01:00
d3992d4963 feat(fatfs): enable partition handling for sectors less than 128 2024-10-31 09:22:35 +01:00
zwl
f808a705b8 fix(ble): fixed occasional crash issue in low memory scenarios on ESP32-C6 2024-10-31 11:34:09 +08:00
c9b55d1542 fix(ble): fixed occasional crash issue in low memory scenarios on ESP32-H2
(cherry picked from commit dbad6a0ca5)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2024-10-31 11:23:50 +08:00
5b03fff32e feat(clock): support apll clock on p4 2024-10-31 11:01:04 +08:00
4f707f0c12 fix(ble/bluedroid): Fixed crash issue in BLE SMP when a disconnection process is ongoing
(cherry picked from commit 76e1650161)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-10-30 15:24:52 +08:00
bc1b6e2bf1 fix(ble/bluedroid): Support enable BLE topology check by API
(cherry picked from commit dbc94c7056)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-10-30 15:24:37 +08:00
116820c42c fix(bt/bluedroid): Fixed error when memory debug enabled 2024-10-29 21:49:53 +08:00
5e383d34fa fix(bt/bluedroid): Fixed GATTC app status check when BT and BLE coexist 2024-10-29 21:49:44 +08:00
116e5c34f6 fix(bt/bluedroid): Update address type for BLE link when the connection is completed 2024-10-29 21:49:28 +08:00
149474e5d2 feat(bt/bluedroid): Added API to set supported channel selection algorithm
(cherry picked from commit 4ae7b4aecf)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-10-29 17:35:26 +08:00
30c62f19a3 docs: Update CN translation for libs-frameworks.rst 2024-10-29 17:34:30 +08:00
b15e83f6e0 refactor(usb_host): Removed error in enum when stalled, added hcd_dwc no more free channels 2024-10-28 18:14:14 +01:00
63f9104669 fix(ext_port): Added port recovery delay 2024-10-28 18:14:14 +01:00
79d7c23315 fix(usb_host_lib): Returned task suspend 2024-10-28 18:14:14 +01:00
670f11644f refactor(usb_host/examples): Enabled external Hub support feature 2024-10-28 18:14:14 +01:00
52aa6a1d4c feat(ext_port): Added External Port driver
Closes https://github.com/espressif/esp-idf/issues/12554
2024-10-28 18:14:08 +01:00
9f4b1bd471 Merge branch 'bugfix/hfp_sniff_mng_v5.3' into 'release/v5.3'
bugfix/hf_and_ag_cannot_enter/exit sniff mode. (v5.3)

See merge request espressif/esp-idf!34464
2024-10-28 21:46:21 +08:00
dddc2938f2 Merge branch 'backport/openthread_related_feature_v53' into 'release/v5.3'
Backport/openthread related feature v53(Backport v5.3)

See merge request espressif/esp-idf!33407
2024-10-28 21:44:11 +08:00
938c363930 Merge branch 'fix/fix_some_wifi_bugs_10_25_v5.3' into 'release/v5.3'
fix(wifi): fix some bss color bugs (v5.3)

See merge request espressif/esp-idf!34462
2024-10-28 21:40:23 +08:00
7828079733 Merge branch 'bugfix/mipi_gen_short_read_v5.3' into 'release/v5.3'
fix(mipi_dsi): error logic in reading short packet (v5.3)

See merge request espressif/esp-idf!34461
2024-10-28 21:37:26 +08:00
eb4186dc97 Merge branch 'bugfix/update_btlib_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed some controller bugs on ESP32 (v5.3)

See merge request espressif/esp-idf!34463
2024-10-28 21:09:50 +08:00
f2fb17cb87 fix(esp_hw_support): disable unused clock sources after rtc clock switching complete 2024-10-28 19:54:06 +08:00
f3557bcf5e fix(lp_core): updated lp rom newlib API addresses 2024-10-28 17:21:26 +08:00
9266b5a6a1 fix(wifi): fix some bss color bugs (v5.3) 2024-10-28 14:21:56 +08:00
73ad41524a Merge branch 'fix/lcd_lvgl_regression_v5.3' into 'release/v5.3'
fix(lcd): fix the newest lvgl regression (v5.3)

See merge request espressif/esp-idf!34473
2024-10-28 14:20:47 +08:00
12a68856e7 Merge branch 'bugfix/roaming_app_support_wifi_disconnect_v5.3' into 'release/v5.3'
Stops roaming app upon application initiated disconnect(backport v5.3)

See merge request espressif/esp-idf!33705
2024-10-28 13:38:09 +08:00
b8a5a171a2 Merge branch 'feat/i2c_port_handle_func_v5.3' into 'release/v5.3'
feat(i2c_master): Add an api for retrieveing handle via port (backport v5.3)

See merge request espressif/esp-idf!34438
2024-10-28 12:44:33 +08:00
ba2d48dacd feat(openthread): update extension commands component for examples 2024-10-28 12:21:34 +08:00
436550ae7f feat(openthread): support time sync feature on border router 2024-10-28 12:21:34 +08:00
2ea60a4931 fix(openthread): fix RCP build to pass time sync and CSL options
Closes https://github.com/espressif/esp-idf/pull/14060
2024-10-28 12:21:34 +08:00
zwx
34e9768e82 fix(802.15.4): fix oob issue for pending table 2024-10-28 12:21:34 +08:00
zwx
ad236ae122 feat(802.15.4): support large scale pending table size 2024-10-28 12:21:34 +08:00
zwx
c3ad441895 feat(lwip): add a config to set the size of ND6 table cache 2024-10-28 12:21:33 +08:00
zwx
4cd756ccc1 feat(esp_netif): add an API to get all preferred ip6 addresses 2024-10-28 12:21:33 +08:00
7229ec4be9 Merge branch 'feature/check_efuse_blk_after_ota_v5.3' into 'release/v5.3'
feat(bootloader): support to check efuse block revision (v5.3)

See merge request espressif/esp-idf!33136
2024-10-28 12:20:05 +08:00
a848c82b12 fix(lcd): fix the newest lvgl regression 2024-10-28 12:19:16 +08:00
2fb4424db0 Merge branch 'example/ping_invalid_ip6_fix_v5.3' into 'release/v5.3'
fix(example): Fixed updating recv addr for invalid packets (v5.3)

See merge request espressif/esp-idf!32989
2024-10-28 12:15:56 +08:00
2153a6b81e fix(esp_hw_support): enable all supported slow clock at pmu_init 2024-10-28 12:14:54 +08:00
e6fcf6632c Merge branch 'fix/gdbstub_runtime_test_requiers_elf_file_v5.3' into 'release/v5.3'
fix(gdbstub_runtime): fix test gdbstub_runtime which requiers elf file (v5.3)

See merge request espressif/esp-idf!33815
2024-10-28 12:12:32 +08:00
2144fb9ae9 Merge branch 'bugfix/fix_h2_wrong_lslp_drvb_config_bug_v5.3' into 'release/v5.3'
fix(h2): fix lslp drvb config bug (v5.3)

See merge request espressif/esp-idf!34292
2024-10-28 12:09:08 +08:00
1fbb8b12b3 Merge branch 'fix/bootloader_size_increase_perf_benchmark_fails_to_build_v5.3' into 'release/v5.3'
fix: Bootloader size increase broke perf_benchmark example compilation (v5.3)

See merge request espressif/esp-idf!34306
2024-10-28 12:07:37 +08:00
5cb70e4452 Merge branch 'fix/freertos_race_cond_in_stream_buffers_send_v5.3' into 'release/v5.3'
fix(freertos): Fixed SMP race condition in xStreamBufferSend() (v5.3)

See merge request espressif/esp-idf!34335
2024-10-28 12:06:41 +08:00
425db8e135 Merge branch 'bugfix/fix_assert_if_ble_sleep_init_failed_v5.3' into 'release/v5.3'
fix(ble): do not assert if ble sleep init failed (v5.3)

See merge request espressif/esp-idf!34427
2024-10-28 11:55:31 +08:00
8d41e65110 Merge branch 'fix/kconfig-option-orphan_sections_warning_v5.3' into 'release/v5.3'
fix(build): fix orphan sections warning kconfig variable (v5.3)

See merge request espressif/esp-idf!33941
2024-10-28 11:53:16 +08:00
921a8a7e71 Merge branch 'feat/mbedtls_size_optimization_v5.3' into 'release/v5.3'
Fix the increase in build size of mbedtls while upgrading to v3.x (v5.3)

See merge request espressif/esp-idf!34252
2024-10-28 11:16:23 +08:00
d926a9259b Merge branch 'refactor/ble_example_print_on_bluedroid_v5.3' into 'release/v5.3'
refactor(bt/bluedroid): Refactor the print for BLE examples (v5.3)

See merge request espressif/esp-idf!34310
2024-10-28 10:52:54 +08:00
c42c11ec4d fix(bt/controller): Fixed some controller bugs on ESP32
- Fixed access NULL in SCO frame end
      Closes https://jira.espressif.com:8443/browse/IDFGH-10796
    - Added LAP checking for Periodic Inquiry
    - Removed an inproper assertion in SCO module
    - Fixed wrong logic in key exchange when
      LMP transaction collision occurred
    - Fixed the using of wrong error code in
      the transaction collision of role switch
2024-10-28 10:26:45 +08:00
2a603083d0 fix(bt/bluedroid): fixed AG and HF client cannot enter/exit sniff mode 2024-10-28 10:20:34 +08:00
ca3618c433 Revert "Disable sniff mode during (e)SCO connection."
This reverts commit 39a5eb84f3.
2024-10-28 10:20:34 +08:00
47dc6f37f5 Merge branch 'backport/openthread_154_related_feature_v53' into 'release/v5.3'
Backport/openthread 154 related feature v53

See merge request espressif/esp-idf!34274
2024-10-28 10:19:39 +08:00
ceef7a5f91 fix(mipi_dsi): error logic in reading short packet 2024-10-28 10:14:59 +08:00
d25f9b6071 Merge branch 'feat/mipi_dsi_hdmi_v5.3' into 'release/v5.3'
feat(lcd): Allow to disable low-power mode in DPI panel (v5.3)

See merge request espressif/esp-idf!34432
2024-10-28 10:05:39 +08:00
37cc7aac0a Merge branch 'ci/temp_disable_sonarqube_v5.3' into 'release/v5.3'
ci: temp disable sonarqube check. keep it for migrating to codechecker (v5.3)

See merge request espressif/esp-idf!34450
2024-10-28 09:43:11 +08:00
5bb5407dc6 Merge branch 'feat/support_32k_osc_ble_sleep_clk_v5.3' into 'release/v5.3'
feat(ble): Support using 32k oscillator as Bluetooth sleep clock(v5.3)

See merge request espressif/esp-idf!33996
2024-10-28 09:41:03 +08:00
baed5ea1e9 fix(esp_wifi): Stop roaming app when station stops 2024-10-25 23:39:05 +05:30
9f27f51dbe fix(esp_wifi): Remove duplicate declaration of function 2024-10-25 23:32:14 +05:30
161751bec2 fix(examples) : Common component's wifi disconnect handler should ignore roaming disconnect
- Common component's wifi disconnect handler should ignore roaming disconnect (WIFI_REASON_ROAMING)
  as connect gets issued internally in these cases.
2024-10-25 23:32:14 +05:30
74bb92cc5f fix(esp_wifi): Stops roaming app upon application initiated disconnect
Stops roaming app when the application initiates a disconnect.
Roaming app if enabled will be restarted when the station reconnects again.
2024-10-25 23:32:14 +05:30
33214e4d68 fix(esp_supplicant): Fix compilation issues with btm and rrm status funcs
- Ensure that the btm and rrm status funcs can be used even if 80211.kv
  are not enabled in menuconfig. They will return false in such cases.
2024-10-25 23:32:14 +05:30
e071521943 Merge branch 'fix/wifi_netif_null_deref_v5.3' into 'release/v5.3'
esp_wifi: Add null pointer checks to WiFi-netif APIs (v5.3)

See merge request espressif/esp-idf!34158
2024-10-26 01:58:45 +08:00
1a9959b55b Merge branch 'bugfix/retry_count_when_sta_disconnect_v5.3' into 'release/v5.3'
fix(wifi): Do not attempt re-connection as per 'failure_retry_cnt' when sta itself issues disconnect in between of connection establishment (Backport v5.3)

See merge request espressif/esp-idf!34168
2024-10-25 22:25:34 +08:00
0deebec285 Merge branch 'feat/lwip_more_sockets_v5.3' into 'release/v5.3'
change(lwip): bump max sockets in lwip Kconfig (GItHubPR) (v5.3)

See merge request espressif/esp-idf!34151
2024-10-25 21:02:55 +08:00
7e6a1e39db Merge branch 'fix/lwip_drop_ipv6_if_no_ll_v5.3' into 'release/v5.3'
fix(lwip): Add default IPv6 input filter to drop traffic if ipv6 not assigned (v5.3)

See merge request espressif/esp-idf!34148
2024-10-25 21:02:47 +08:00
3e77489941 Merge branch 'docs/remove_user_guide_for_esp32-devkitm-1_migration_v5.3' into 'release/v5.3'
docs: Remove user guide for esp32-devkitm-1 migration (v5.3)

See merge request espressif/esp-idf!34320
2024-10-25 19:39:53 +08:00
8e7ce462be Merge branch 'bugfix/workaround_of_i2s_half_sample_rate_issue_v5.3' into 'release/v5.3'
fix(i2s): fix i2s half sample rate issue (v5.3)

See merge request espressif/esp-idf!34353
2024-10-25 19:38:42 +08:00
9c2e021bed Merge branch 'feature/add_dpp_crypto_layer_v53' into 'release/v5.3'
feat(esp_wifi): Restructure dpp crypto Layer APIs

See merge request espressif/esp-idf!34319
2024-10-25 19:38:08 +08:00
bc42469f3c Merge branch 'fix/ws_transport_linux_signed_promotions_v5.3' into 'release/v5.3'
fix(ws_transport): Fix incorrect packet-len on linux due to int promotions of char (GitHub PR) (v5.3)

See merge request espressif/esp-idf!34146
2024-10-25 19:36:59 +08:00
400760634d Merge branch 'fix/ws_transport_mem_corrupt_v5.3' into 'release/v5.3'
fix(transport): Fix websocket mem-corruption while reading headers (v5.3)

See merge request espressif/esp-idf!34153
2024-10-25 19:35:11 +08:00
9e33b5ffc0 ci: disable sonarqube check 2024-10-25 13:01:45 +02:00
9675ca6028 Merge branch 'feat/wifi_remote_with_hosted_v5.3' into 'release/v5.3'
fix(examples): esp_hosted as default for Wi-Fi connect on P4 (v5.3)

See merge request espressif/esp-idf!34156
2024-10-25 18:51:27 +08:00
a9bdb4a2c9 fix(wifi): Do not try re-connection when sta disconnects with esp_wifi_disconnect()
Do not follow wifi_config::wifi_sta_config::failure_retry_cnt logic when
station itself issues a disconnect from AP/Router using
esp_wifi_disconnect()
2024-10-25 16:00:09 +05:30
9cbbb437db fix(transport): Fix websocket mem-corruption while reading headers
Closes https://github.com/espressif/esp-idf/issues/14473
2024-10-25 17:51:34 +08:00
c52114bb0b change: bump max sockets in lwip Kconfig
Tested under ESP32S3, running 50 tasks, each with a client, and a server
listening to one client, totalizing 150 sockets/files open, forwarding
data from PPP to Ethernet and vice versa.
Reasoning for 255 total sockets/files is VFS local_fd_t being a uint8_t.
Since FD_SETSIZE is defined at tool level, a CMakeLists user definition
is needed in cases above 64 (the default value).

Merges https://github.com/espressif/esp-idf/pull/13866
2024-10-25 17:50:10 +08:00
4831eee72c fix(lwip): Add default IPv6 input filter to drop traffic if ipv6 not assigned
* Makes LWIP_HOOK_IP6_INPUT default to LWIP_HOOK_IP6_INPUT_DEFAULT
* Updated the stub hook implementation to actually filter out all IPv6
packets if the input netif has no link local address.
2024-10-25 17:49:22 +08:00
c28534fd37 fix(ws_transport): Fix crash when reading
When parsing WS framing protocol integer promotion would cause
invalid values to be read. Acting upon these values would eventually
cause a crash

Fixes esp-protocols#645
2024-10-25 17:49:02 +08:00
93ce86a309 Merge branch 'feat/support_enable_ble_hci_log_by_api_v5.3' into 'release/v5.3'
feat(ble/bluedroid): Support enable BLE hci log by API (v5.3)

See merge request espressif/esp-idf!34424
2024-10-25 17:47:30 +08:00
89bf068df2 Merge branch 'bugfix/fix_ble_robust_feature_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed error when writing Client Supported Features characteristic (v5.3)

See merge request espressif/esp-idf!34247
2024-10-25 17:46:26 +08:00
5438287fd5 fix(esp_wifi): Add null pointer checks to WiFi-netif APIs
Added null pointer checks to WiFi-netif API functions to prevent potential
crashes from invalid arguments, updated unit tests.

Closes https://github.com/espressif/esp-idf/issues/8702
2024-10-25 17:40:36 +08:00
847ec07bc4 fix(examples): esp_hosted as default for Wi-Fi connect on P4 2024-10-25 17:32:09 +08:00
2b30323a2b feat(ble): Support using 32k oscillator as Bluetooth sleep clock 2024-10-25 17:25:18 +08:00
b1fcd348be Merge branch 'change/polish_wifi_sleep_current_desc_v53' into 'release/v5.3'
change(doc): add notes for sleep current data tested in shieled box

See merge request espressif/esp-idf!34435
2024-10-25 16:47:12 +08:00
edb7c4b68b Merge branch 'fix/fix_some_wifi_bugs_v53' into 'release/v5.3'
Fix/fix some wifi bugs v53

See merge request espressif/esp-idf!34431
2024-10-25 16:34:49 +08:00
22edfd2021 test(i2c): Support test for esp32p4 lp i2c 2024-10-25 16:09:21 +08:00
3419abf601 fix(i2c_master): Fix the memory leak in the async transaction 2024-10-25 16:08:50 +08:00
399b8b6ef1 feat(i2c_master): Add an api for retrieveing handle via port 2024-10-25 16:06:15 +08:00
c9f094fbc6 change(doc): add notes for sleep current data tested in shieled box 2024-10-25 15:29:39 +08:00
3eefb7d800 Merge branch 'ci/enable_esp32p4_gpio_uart_target_test_v5.3' into 'release/v5.3'
fix(gpio): esp32p4 IOs cannot keep being held in the entire deep sleep process (v5.3)

See merge request espressif/esp-idf!33523
2024-10-25 15:08:40 +08:00
369a6a5dc7 feat(lcd): Allow to disable low-power mode in DPI panel 2024-10-25 14:52:10 +08:00
2397ca90cc fix(wifi): backport some wifi bug fixs v53 2024-10-25 14:39:46 +08:00
ac0bfa6769 fix(wifi): fix esp32s2 get ack rssi issue 2024-10-25 14:21:12 +08:00
91e57cfb15 Merge branch 'feat/support_esp32p4_flash_psram_sleep_pd_v5.3' into 'release/v5.3'
feat(esp_hw_support): support power down PSRAM or Flash during sleep for esp32p4 v1.0 (v5.3)

See merge request espressif/esp-idf!34390
2024-10-25 11:00:08 +08:00
e3cbe53fa3 fix(ble): do not assert if ble sleep init failed 2024-10-25 10:54:35 +08:00
a0f798cfc4 Merge branch 'bugfix/fix_some_wifi_bugs_241024_v5.3' into 'release/v5.3'
fix(wifi): fix some wifi bugs 241024 v5.3

See merge request espressif/esp-idf!34420
2024-10-24 23:37:37 +08:00
5f5feed0f4 Merge branch 'bugfix/fix_datalen_issue_v5.3' into 'release/v5.3'
fix(nimble): Adjust time parameter in set Data len API in case BLE 5.0 support is not present(v5.3)

See merge request espressif/esp-idf!34219
2024-10-24 20:23:50 +08:00
8fbf8820f1 feat(ble/bluedroid): Support enable BLE hci log by API
(cherry picked from commit 15c895fc6a)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-10-24 20:13:28 +08:00
2b894fca0f fix(wifi): fix ampdu to normal cause free buffer twice issue 2024-10-24 19:49:20 +08:00
24d122e19c fix(esp_wifi): fix the issue of station fail to connect to softap caused by abnormal rf flag signal 2024-10-24 19:36:14 +08:00
6731f12200 Merge branch 'feat/new_xmc_id_v5.3' into 'release/v5.3'
feat(spi_flash): Add new xmc chip id(backport v5.3)

See merge request espressif/esp-idf!34283
2024-10-24 18:22:40 +08:00
a7c3e8b814 Merge branch 'bugfix/fix_some_wifi_coexist_bugs_20241023_v5.3' into 'release/v5.3'
Bugfix/fix some wifi coexist bugs 20241023 v5.3

See merge request espressif/esp-idf!34414
2024-10-24 18:03:03 +08:00
d7d4dc7817 fix(coex): fix esp32c2/esp32c5/esp32c61 coexist memory leakage issue 2024-10-24 15:14:01 +08:00
6eb3d20674 fix(coex): sync up coex head file 2024-10-24 15:10:21 +08:00
a4354e8cb2 fix(coex): fix esp32c5 coexist hw timer issue 2024-10-24 15:10:21 +08:00
b09488d35a fix(coex): fix some coexist debug issues 2024-10-24 15:10:20 +08:00
001b20f914 fix(wifi): fix modem_clock_module_enable mismatch issue 2024-10-24 15:10:20 +08:00
b2d96dfa83 fix(wifi): fix esp32c5 enable external coex fail issue 2024-10-24 15:10:20 +08:00
4665dbc6b9 fix(wifi): esp32c5 esp32c61 support external coex 2024-10-24 15:10:20 +08:00
36ff167161 feat(coex): optimize connectionless coexist pwr, optimize wifi pwr with bt idle 2024-10-24 15:10:20 +08:00
ce0fe97399 feat(coex): support GPIO debug 2024-10-24 15:10:20 +08:00
2e57177b94 fix(i2s): fix multi-dev test failure 2024-10-24 14:32:06 +08:00
e1e9ffdd4f fix(i2s): fix i2s half sample rate issue 2024-10-24 14:32:06 +08:00
6ae7f18158 Merge branch 'bugfix/ppa_buffer_writeback_invalidate_fix2_v5.3' into 'release/v5.3'
fix(ppa): fix a few minor issues for ppa driver (v5.3)

See merge request espressif/esp-idf!34407
2024-10-24 14:27:50 +08:00
deed35c72e Merge branch 'fix/fix_coverity_defects_in_sleep_code_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix coverity defects in sleep code (v5.3)

See merge request espressif/esp-idf!34108
2024-10-24 14:02:19 +08:00
3eef7a1d92 Merge branch 'bugfix/wpa2_ent_fixes_v53' into 'release/v5.3'
Few fixes in wpa_supplicant(v5.3)

See merge request espressif/esp-idf!34275
2024-10-24 13:03:03 +08:00
994568e387 fix(bt/bluedroid): correct the readme links for BLE periodic examples 2024-10-24 12:03:56 +08:00
0b8bec3fa5 refactor(bt/bluedroid): Refactor the print for BLE examples 2024-10-24 12:03:56 +08:00
f6bedd65b6 refactor(bt/bluedroid): Refactor the print for gatt_server and gatt_client example 2024-10-24 12:03:56 +08:00
8e9226f7f8 Merge branch 'feature/ftm_calibration_esp32c6_v5.3' into 'release/v5.3'
feat(ftm): Add ftm calibration values for esp32c6 (Backport v5.3)

See merge request espressif/esp-idf!34406
2024-10-24 11:59:39 +08:00
4956035e3f Merge branch 'jtag_doc_update_v5.3' into 'release/v5.3'
docs(jtag): update OpenOCD related sections (v5.3)

See merge request espressif/esp-idf!34398
2024-10-24 11:22:10 +08:00
817495b1ff Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20241016_v5.3' into 'release/v5.3'
feat(tools): update openocd version to v0.12.0-esp32-20241016 (v5.3)

See merge request espressif/esp-idf!34393
2024-10-24 11:21:28 +08:00
2eec7053f2 Merge branch 'change/improve_some_wifi_releated_introduction_v53' into 'release/v5.3'
change(wifi):improve some wifi releated introduction v53

See merge request espressif/esp-idf!34277
2024-10-24 11:19:41 +08:00
915c011ca5 Merge branch 'feat/add_sbom_wpa_supplicant_v5.3' into 'release/v5.3'
feat(wpa_supplicant): Add sbom manifest file for wpa_supplicant (Backport v5.3)

See merge request espressif/esp-idf!34272
2024-10-24 11:18:29 +08:00
c6420897ea Merge branch 'fix/add_wifi_public_header_checksums_v5.3' into 'release/v5.3'
feat(wifi/coex): Add integrity check for public headers files for esp32c5 and esp32_host (Backport v5.3)

See merge request espressif/esp-idf!34057
2024-10-24 11:16:50 +08:00
5bd2d825a2 Merge branch 'fix/fix_esp32c2_eco4_rom_issue_v53' into 'release/v5.3'
fix(wifi): fix esp32c2 eco4 set conutry policy auto issue

See merge request espressif/esp-idf!34391
2024-10-23 20:10:43 +08:00
ee72cad28f Merge branch 'fix/gdbgui_py3.13_v5.3' into 'release/v5.3'
fix(tools): Print message about GDBGUI being not supported with Python 3.13 (v5.3)

See merge request espressif/esp-idf!34377
2024-10-23 20:00:11 +08:00
e5079b6bd1 feat(ftm): Add ftm calibration values for esp32c6 2024-10-23 17:00:49 +05:30
70a7de77e1 Merge branch 'docs/add_ble_get_started_eng_2024102310_v5.3' into 'release/v5.3'
Docs: Added BLE English version of BLE Get Started (v5.3)

See merge request espressif/esp-idf!34386
2024-10-23 18:55:20 +08:00
5a0eb906da fix(ppa): fix a few minor issues for ppa srm and blend driver
1. The smallest scale size can be 1/16, not 1/15
2. Fix potential heap corruption if scale to a smaller size (OOB)
3. Fix mismatching writeback and invalidate data size if in_bg/fg_buffer and out_buffer
are the same one and L2 cacheline size is larger than L1 cacheline size
2024-10-23 18:39:03 +08:00
d8b02f5d76 fix(ppa): fix insufficient writeback/invalidate data length 2024-10-23 18:38:15 +08:00
16476a7a59 fix(gpio): esp32p4 IOs cannot keep being held in the entire deep sleep process 2024-10-23 18:01:50 +08:00
d3c6c9ccb8 fix(ci): enable gpio, uart, ledc target tests on esp32p4 2024-10-23 18:01:50 +08:00
5239bd2879 docs(spi_flash): Add migration guide for removing XMC-C suspend support 2024-10-23 17:34:16 +08:00
922777118b patch(spi_flash): cleanup XMC flash chip usage according to new information 2024-10-23 17:34:16 +08:00
8890286468 feat(spi_flash): Add new xmc chip id 2024-10-23 17:34:16 +08:00
95abe26a87 docs(jtag): update OpenOCD related sections 2024-10-23 10:17:16 +02:00
854dfb45d4 feat(tools): update openocd version to v0.12.0-esp32-20241016 2024-10-23 10:04:56 +02:00
855bba0582 feat(esp_hw_support): support power down PSRAM or Flash during sleep for esp32p4 v1.0 2024-10-23 16:03:39 +08:00
87bb09d746 change(wifi):improve some wifi releated introduction 2024-10-23 13:57:46 +08:00
8d472cf779 Merge branch 'fix/fix_esp32c2_tx_shake_issue_v53' into 'release/v5.3'
fix(wifi): fix esp32c2 tx shake issue v53

See merge request espressif/esp-idf!34388
2024-10-23 13:55:19 +08:00
aa7802ee6a fix(nimble): Adjust Data len time in case BLE 5.0 support is not present 2024-10-23 11:15:55 +05:30
300bc6bbe1 Merge branch 'feature/update_mbedtls_version_to_3.6.2_v5.3' into 'release/v5.3'
feat(mbedtls): update mbedtls version to 3.6.2 (v5.3)

See merge request espressif/esp-idf!34357
2024-10-23 13:12:27 +08:00
de273130d1 fix(wifi): fix esp32c2 eco4 set conutry policy auto issue 2024-10-23 11:49:18 +08:00
868351beaa ci: Add md5 checksum validation for COEX public header files for esp32c5
Add MD5 checksum validation for public header files of the following esp32c5.
2024-10-23 11:16:47 +08:00
9c54b3183f ci: Add md5 checksum validation for WiFi public header files for new chips
Add MD5 checksum validation for public header files of the following new chips:
esp32c5 and esp32_host.
2024-10-23 11:16:47 +08:00
1298cac4e7 feat(wifi): Add checks for public headers for esp32c5 and esp32_host
Add md5sum integrity check for public header files for esp32c5 and esp32_host libraries.
2024-10-23 11:16:47 +08:00
0c0dce7c4f fix(wifi): fix esp32c2 tx shake issue 2024-10-23 11:12:41 +08:00
9c61080493 Merge branch 'feat/support_esp32c2_eco4_wifi_v53' into 'release/v5.3'
Feat/support esp32c2 eco4 wifi v53

See merge request espressif/esp-idf!34109
2024-10-23 11:06:27 +08:00
a8f6e53005 Merge branch 'docs/add_ble_get_started_eng' into 'master'
Docs: Added BLE English version of BLE Get Started

See merge request espressif/esp-idf!34013

(cherry picked from commit 35fd041288)

42601a7a docs(ble): Added ENG version of ble-introduction.rst
615282c4 docs(ble): Added ENG version of ble-device-discovery.rst
645e68f5 docs(ble): Added initial ENG version of ble-device-discovery.rst
d2d95a52 docs(ble): Added ENG version of ble-data-exchange.rst
00ca4dc7 docs(ble):Updated Details table in ble-device-discovery.rst
8e03c200 fix(ble): Removed trailing white space, and fixed some format issues
5b304485 docs(ble):Fixed a indentation in ble-data-exchange.rst
b4c51e7b docs(ble): Deleted some chinese character in ble-data-exchange.rst ENG version
d01d7efe docs(ble):Revised some expression in ENG version of BLE Get Started
a24762c5 docs(ble): Removed a trailing whitespace in ble-introduction.rst
afbe5a1f Apply 44 suggestion(s) to 4 file(s)
4ddab725 docs(ble): Fixed a description in ble-introduction.rst
203dfa03 Apply 5 suggestion(s) to 3 file(s)

Co-authored-by: Island <island@espressif.com>
2024-10-23 10:17:02 +08:00
431cf92fed fix(tools): Print message about GDBGUI being not supported with Python 3.13 2024-10-22 16:00:42 +02:00
5510aa6f08 Merge branch 'bugfix/nvs_entry_sanity_check_v5.3' into 'release/v5.3'
Bugfix/added nvs entry header sanity checks (v5.3)

See merge request espressif/esp-idf!34289
2024-10-22 19:51:53 +08:00
21f893b038 feat(wifi): update support esp32c2eco4 wifi lib 2024-10-22 17:05:13 +08:00
2b63725383 feat(wifi): support esp32c2 eco4 wifi bringup sync head 2024-10-22 17:05:13 +08:00
33b0dbf599 fix(wifi): fix esp32c2 eco4 ld 2024-10-22 17:05:13 +08:00
71bb752d98 feat(wifi): support esp32c2 eco4 wifi bringup 2024-10-22 17:05:13 +08:00
9498786a97 Merge branch 'fix/fix_softap_sta_example_deafult_dns_addr_v5.3' into 'release/v5.3'
fix(wifi): fix softap_sta example default dns addr invaild issue v53

See merge request espressif/esp-idf!34276
2024-10-22 16:09:49 +08:00
2f72b29add fix(freertos): Fixed SMP race condition in xStreamBufferSend()
This commit fixes a race condition in dual-core SMP mode where in the
xStreamBufferSend() makes the xTaskWaitingToSend NULL but it may
have already been evaluated to not be NULL by xStreamBufferReceive()
running on another core and eventually leading to a crash in tasks.c.
2024-10-22 10:04:14 +02:00
18d997805a Merge branch 'fix/freertos_race_cond_in_stream_buffers_v5.3' into 'release/v5.3'
fix(freertos): Fixed SMP race condition in stream_buffers.c (v5.3)

See merge request espressif/esp-idf!34223
2024-10-22 15:59:18 +08:00
75f416f435 feat(mbedtls): update mbedtls version to 3.6.2 2024-10-22 13:23:28 +05:30
2f2acfaf8f Merge branch 'feat/rgb_lcd_gdma_link_v5.3' into 'release/v5.3'
refactor rgb_lcd driver to use gdma_link driver (v5.3)

See merge request espressif/esp-idf!34265
2024-10-22 11:07:46 +08:00
f7c4b636a2 Merge branch 'docs/delete_user_guide_esp32_s2_and_s3_v5.3' into 'release/v5.3'
docs: Delete user guide esp32-s2-saola-1, esp32-s3-devkitc-1 and esp32-s3-devkitm-1 (v5.3)

See merge request espressif/esp-idf!34324
2024-10-22 10:42:30 +08:00
9461323fda fix(ble/bluedroid): Fixed error when writing Client Supported Features characteristic
(cherry picked from commit 5126742003)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-10-21 18:03:27 +08:00
28c9f1abde docs: Delete user guide esp32-s2-saola-1, esp32-s3-devkitc-1 and esp32-s3-devkitm-1 2024-10-21 16:56:46 +08:00
a7a09c4300 docs: Remove user guide for esp32-devkitm-1 migration 2024-10-21 15:24:01 +08:00
e84a7e651d feat(openthread): allow enabling trel before getting interface 2024-10-21 10:42:33 +08:00
2d61ea12be Merge branch 'fix/mbedtls_fs_io_dependency_on_vfs_v5.3' into 'release/v5.3'
fix(mbedtls): Fix the MBEDTLS_FS_IO dependency on vfs (v5.3)

See merge request espressif/esp-idf!34269
2024-10-20 22:50:18 +08:00
45c49778a0 fix: Bootloader size increase broke perf_benchmark example compilation 2024-10-19 18:57:25 +02:00
4235a074a9 Merge branch 'bugfix/fix_miss_internal_wapi_deinit_issue_v5.3' into 'release/v5.3'
fix(wifi): fix miss internal wapi deinit issue(Backport v5.3)

See merge request espressif/esp-idf!34279
2024-10-18 18:37:47 +08:00
9b6d574c95 Merge branch 'feature/add_compiler_no_merge_constants_v5.3' into 'release/v5.3'
feat: add compiler config for not merging const sections (v5.3)

See merge request espressif/esp-idf!34086
2024-10-18 18:37:03 +08:00
5c2c1d8a24 fix(h2): modify wrong lslp drvb config 2024-10-18 17:01:00 +08:00
7668a321db fix(storage/nvs): Fixed hadling of inconsistent values in NVS entry header
feat(storage/nvs): Added test cases for damaged entries with correct CRC
2024-10-18 10:48:24 +02:00
9c55f57fa4 fix(wifi): fix miss internal wapi deinit issue 2024-10-18 14:24:52 +08:00
e80ab15073 fix(wifi): fix softap_sta example default dns addr invaild issue 2024-10-18 14:07:46 +08:00
c807ce97d9 feat(esp_wifi): Add esp-idf specific changes
Added esp-idf implementation specific changes on top of the upstream updates.
2024-10-18 11:36:16 +05:30
7490867a4d feat(esp_wifi): Replace crypto_key with crypto_ec_key
Replaced all occurances of crypto_key with crypto_ec_key struct
    to make the code more consistent with upstream.
2024-10-18 11:36:01 +05:30
d45588ff51 feat(esp_wifi): Restructure dpp crypto Layer APIs
1) Update dpp implementation as per upstram hostapd tag hostap_2_10.
2) Move dpp crypto routines into a separate source code file.
2024-10-18 11:34:37 +05:30
f6591b773e feat(openthread): support trel feature 2024-10-18 13:57:38 +08:00
8057de95d7 fix(wpa_supplicant): Add few fixes in dpp task 2024-10-18 11:26:16 +05:30
e148c20c07 fix(wpa_supplicant): Add few fixes in btm_rrm task 2024-10-18 11:26:08 +05:30
afd8449418 fix(wpa_supplicant): Add few fixes in eloop task 2024-10-18 11:26:01 +05:30
78f5d3b11d fix(wpa_supplicant): Add few fixes in WPS task 2024-10-18 11:25:52 +05:30
79bbcd5952 fix(wpa_supplicant): Add few fixes in NAN task 2024-10-18 11:25:39 +05:30
e142c11dd0 fix(wpa_supplicant): Add few fixes in eap client code 2024-10-18 11:25:21 +05:30
zwx
064ac29b41 fix(802154): pass hardware abort reason into processing function 2024-10-18 13:18:20 +08:00
6e1bc89945 fix(ieee802154): fix a bug in the usage of a macro 2024-10-18 13:18:20 +08:00
zwx
77ce639292 feat(ieee802154): add frame type checking for hw autoack feature 2024-10-18 13:18:20 +08:00
64dc7ebbc3 fix(openthread): add macro for rcp init 2024-10-18 13:18:19 +08:00
38f024681c feat(openthread): support vendor hook for rcp spi 2024-10-18 13:18:19 +08:00
0e883d99ff Merge branch 'bugfix/fix_retry_assoc_auth_timeout_issue_v5.3' into 'release/v5.3'
fix(wifi): fixed association refused temporarily lead auth timeout issue(Backport v5.3)

See merge request espressif/esp-idf!34242
2024-10-18 12:37:42 +08:00
fabf233666 feat(wpa_supplicant): Add sbom manifest file for wpa_supplicant 2024-10-18 09:57:22 +05:30
5197683852 Merge branch 'fix/esp_tls_excessive_parameter_check_v5.3' into 'release/v5.3'
fix(esp-tls): Reduce parameter check for esp_tls_conn_read (v5.3)

See merge request espressif/esp-idf!34266
2024-10-18 11:52:28 +08:00
20ab1e807d fix(mbedtls): Fix the MBEDTLS_FS_IO dependency on vfs
By default MBEDTLS_FS_IO option in mbedtls uses the filesystem supported
added by vfs component.
If the vfs support is disabled by user then mbedtls raises a warning
that the filesystem realted operation shall always fail
This commit fixes the behaviour by enabling respective depedency check for the
MBEDTLS_FS_IO option

Closes https://github.com/espressif/esp-idf/issues/14409
2024-10-18 09:15:23 +05:30
2fa45a9028 feat(rgb_lcd): use gdma_link driver 2024-10-18 11:00:21 +08:00
3e6ae73dd4 Merge branch 'fix/p4_twai_enable_test_v5.3' into 'release/v5.3'
test(twai): p4 twai enable ci test (v5.3)

See merge request espressif/esp-idf!34178
2024-10-18 10:47:24 +08:00
888b6f5c69 Merge branch 'fix/spi_slave_no_dma_rx_overwrite_v5.3' into 'release/v5.3'
fix(driver_spi): fixed slave no dma rx overwrite when trans_len below or over (v5.3)

See merge request espressif/esp-idf!34169
2024-10-18 10:47:10 +08:00
76d5665136 fix(esp-tls): Reduce parameter check for esp_tls_conn_read
Previously the *data parameters of esp_tls_conn_read
    was required to be non-NULL after espressif/esp-idf!28358.
    This prevents users from using a functionality in esp_tls_conn_read
    where calling `esp_tls_conn_read(ctx, NULL, 0);` triggers the
    transfer of contents from tcp layer to mbedtls (ssl) layer.
    After this the user can read the contents from
    esp_tls_get_bytes_avail().
    This commit removes the additional NULL check on the data field
    to keep this functionality enabled.
2024-10-18 08:15:42 +05:30
fd5736f9bf feat(gdma): added function to concat two link lists 2024-10-18 10:37:49 +08:00
d9cf088d4c Merge branch 'feat/move_crt_bundle_dummy_cert_to_rodata_v5.3' into 'release/v5.3'
Move cert bundle's dummy cert to .rodata to reduce RAM usage (v5.3)

See merge request espressif/esp-idf!34201
2024-10-18 10:37:48 +08:00
03a0b7ace9 Merge branch 'bugfix/fix_funcs_overriding_on_esp32c3_eco7_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed BLE functions overriding on ESP32-C3 ECO7 (v5.3)

See merge request espressif/esp-idf!34200
2024-10-17 19:45:49 +08:00
18998ddbe0 fix(mbedtls): Fix the increase in build size of mbedtls when upgrading to v3.x 2024-10-17 14:53:30 +05:30
e58c05a294 Merge branch 'bugfix/pcnt_pm_lock_v5.3' into 'release/v5.3'
fix(pcnt): install the pm lock upon driver installation (v5.3)

See merge request espressif/esp-idf!34213
2024-10-17 15:39:54 +08:00
48bbf278c9 fix(wifi): fixed association refused temporarily lead auth timeout issue 2024-10-17 14:24:21 +08:00
98295c8c67 Merge branch 'bug/ci_test_https_server_file_serving_v5.3' into 'release/v5.3'
fix(protocols): Erased the storage partition for http_server ci test (v5.3)

See merge request espressif/esp-idf!34163
2024-10-17 12:37:57 +08:00
bd81faaf15 Merge branch 'feat/docs_wifi_on_wifiless_chips_v5.3' into 'release/v5.3'
feat(wifi): Document WiFi expansion on wifi-less chips (v5.3)

See merge request espressif/esp-idf!34157
2024-10-17 10:43:04 +08:00
3ecc5e451f Merge branch 'bugfix/wifi_bt_coex_crash_v5.3' into 'release/v5.3'
fix(nimble): Fix the sequence of ll and host transport init (v5.3)

See merge request espressif/esp-idf!33961
2024-10-17 10:40:50 +08:00
b2bc2dfcc3 Merge branch 'bugfix/riscv_task_wdt_cleanup_v5.3' into 'release/v5.3'
fix(wdt): changed register dump on task WDT to be more descriptive (v5.3)

See merge request espressif/esp-idf!33105
2024-10-17 10:39:56 +08:00
6185744331 Merge branch 'bugfix/intr_alloc_rom_handler_v5.3' into 'release/v5.3'
fix(esp_hw_support): allow allocating interrupts with handlers in ROM with IRAM attribute (backport v5.3)

See merge request espressif/esp-idf!33813
2024-10-17 08:20:41 +08:00
8d9d5ee218 feat(mbedtls/esp_crt_bundle): Move dummy cert to .rodata to save 408B from dram
Co-authored-by: Hanno <h.binder@web.de>
2024-10-16 16:36:33 +05:30
5955059940 Merge branch 'feat/update_tools_in_tools_json_v5.3' into 'release/v5.3'
feat(tools): Update tools: cmake, ninja, ccache (v5.3)

See merge request espressif/esp-idf!33530
2024-10-16 16:04:07 +08:00
39f4581178 fix(freertos): Fixed SMP race condition in stream_buffers.c
This commit fixes a race condition in dual-core SMP mode where in the
xStreamBufferReceive() makes the xTaskWaitingToReceive NULL but it may
have already been evaluated to not be NULL by xStreamBufferSend()
running on another core and eventually leading to a crash in tasks.c.
2024-10-16 09:26:58 +02:00
2bfcfda7d4 feat(tools): Exclude modified folders by rebuild 2024-10-16 15:05:52 +08:00
02d90f2784 feat(tools): Update tools: cmake, ninja, ccache
cmake  v3.24.0 -> v3.30.2
ninja  v1.11.1 -> v1.12.1
ccache v4.8    -> v4.10.2

Closes https://github.com/espressif/esp-idf/pull/14376
2024-10-16 15:05:52 +08:00
dbbdb0db0e Merge branch 'bugfix/xtensa_startup_stack_v5.3' into 'release/v5.3'
fix(system): fixed potential double exception when booting on xtensa (v5.3)

See merge request espressif/esp-idf!33902
2024-10-16 11:46:58 +08:00
33f82075e9 fix(pcnt): install the pm lock upon driver installation 2024-10-16 11:33:14 +08:00
9d0c888bec fix(esp_hw_support): allow allocating interrupts with handlers in ROM with IRAM attribute
The interrupt allocator now allows allocating an interrupt with a handler in ROM
and flags set to ESP_INTR_FLAG_IRAM
2024-10-16 09:36:09 +08:00
5d3399f079 Merge branch 'bugfix/wifi_set_mode_error_propagation_v5.3' into 'release/v5.3'
Handle missing error propagation in esp_wifi_set_mode() API (Backport v5.3)

See merge request espressif/esp-idf!33883
2024-10-15 20:55:08 +08:00
d4a4cc8fcf Merge branch 'refactor/usb_host_add_func_ret_values_backport_5.3' into 'release/v5.3'
refactor(usb_host): USB Host add function return values description backport v5.3

See merge request espressif/esp-idf!34015
2024-10-15 15:02:05 +08:00
5a2db45f40 fix(driver_spi): fixed slave no dma rx overwrite when trans_len below or over
Closes https://github.com/espressif/esp-idf/issues/14462
2024-10-15 14:44:56 +08:00
e183263484 Merge branch 'bugfix/correct_typo_scan_v5.3' into 'release/v5.3'
fix(esp_wifi): Correct typos in example/scan.c (v5.3)

See merge request espressif/esp-idf!34191
2024-10-15 13:44:53 +08:00
bfd037e87e feat: add compiler config for not merging const sections
Probably GCC-13.x and on-wards uses "-fmerge-constants" to merge
the const section (string/floating-point) across compilation units.
This makes it difficult to properly analyze the size output of rodata
section across libraries, the merged section (big in size) is showed
across a single library.

The config option added here can help to disable this compiler behavior
and help to provide better size analysis. It can be used during
development phase only as it increases rodata section size.
2024-10-15 13:35:35 +08:00
65ff48a604 fix(bt/controller): Fixed BLE functions overriding on ESP32-C3 ECO7
(cherry picked from commit 020f7a6297)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-10-15 13:33:38 +08:00
9a94e3c59b Merge branch 'bugfix/build_failure_cryptoauthlib_v5.3' into 'release/v5.3'
fix(mbedtls): link esp-cryptoauthlib to mbedcrypto library (v5.3)

See merge request espressif/esp-idf!34088
2024-10-15 13:06:51 +08:00
6ccdda249b fix(mbedtls): link esp-cryptoauthlib to mbedcrypto library
If the certificate bundle feature is disabled then the mbedtls
component library becomes interface only component and hence
adding esp-cryptoauthlib as its PRIVATE dependency does not work.

Instead the esp-cryptoauthlib should be added as PRIVATE dependency
for mbedcrypto library (for alternate ECDSA implementation).
2024-10-15 12:15:04 +08:00
b9221c37d9 Merge branch 'mqtt_custom_outbox_ci_v5.3' into 'release/v5.3'
Set partition to large for c6 on custom outbox example (v5.3)

See merge request espressif/esp-idf!34170
2024-10-14 23:02:05 +08:00
2028984bbb fix(esp_wifi): Correct typos in example/scan.c
Closes https://github.com/espressif/esp-idf/issues/14102
Closes https://github.com/espressif/esp-idf/pull/14103
2024-10-14 17:13:54 +05:30
ee198ebd4b test(twai): p4 twai enable ci test 2024-10-14 15:56:00 +08:00
3f62cc4af8 Merge branch 'fix/ldgen_sort_v5.3' into 'release/v5.3'
fix(ldgen): enable default name SORT in linker fragment (v5.3)

See merge request espressif/esp-idf!34074
2024-10-14 15:20:19 +08:00
b16f944b86 ci(mqtt): Set partition to large for c6 on custom outbox example
Example failed to build on CI for c6 target due to partition size.
2024-10-14 09:11:25 +02:00
b4eb654cc3 fix(protocols): Erased the storage partition for http_server ci test
Added api to erase storage partition for http_server ci test
2024-10-14 12:00:15 +05:30
80543cf39c feat(wifi): Document WiFi expansion on wifi-less chips 2024-10-14 07:40:31 +02:00
83a947d540 Merge branch 'docs/cpu_lockup_v5.3' into 'release/v5.3'
Docs/cpu lockup (v5.3)

See merge request espressif/esp-idf!33506
2024-10-14 11:15:26 +08:00
3d97a8ba2e Merge branch 'bugfix/mbedtls_doc_update_v5.3' into 'release/v5.3'
docs: update mbedtls guide for TLS 1.3 supported change (v5.3)

See merge request espressif/esp-idf!33993
2024-10-14 10:26:53 +08:00
a72ce3590d Merge branch 'fix/priority_inv_when_remove_from_unordered_event_list_v5.3' into 'release/v5.3'
fix(freertos): Fixed priority inversion when setting event group bits (v5.3)

See merge request espressif/esp-idf!34123
2024-10-14 10:24:32 +08:00
5eb746252f Merge branch 'docs/update_startup_for_single_core_chip_v5.3' into 'release/v5.3'
docs: update startup.rst description for single-core chip support (v5.3)

See merge request espressif/esp-idf!33445
2024-10-14 10:22:59 +08:00
d11c994692 Merge branch 'bugfix/fix_wrong_sleep_memory_param_p4_c5_c61_to_v5.3' into 'release/v5.3'
fix(sleep): fix_wrong_sleep_param_for_lp_memory_retention (v5.3)

See merge request espressif/esp-idf!33422
2024-10-14 10:22:28 +08:00
70ee5fa536 Merge branch 'bugfix/fix_s3c3_wrong_ext32k_config_bug_v5.3' into 'release/v5.3'
fix(ext_32k): fix the external 32K issue on C3&S3 (v5.3)

See merge request espressif/esp-idf!33162
2024-10-14 10:20:40 +08:00
590309a8f1 fix(system): fixed potential double exception when booting on xtensa
Due to old windows from the startup flow being present after
switching to running freertos tasks  windowoverflow exceptions
could potentially try to save windows to the startup stack.

During this overflow they also values previously saved on the
startup stack to find earlier frames' stacks.
Since the start up stack was already recycled these values were
invalid and would cause a crash.

Closes https://github.com/espressif/esp-idf/issues/14406Y
2024-10-14 10:12:27 +08:00
27d7db1205 Merge branch 'refactor/lcd_i80_gpio_config_v5.3' into 'release/v5.3'
Optimize RGB LCD IRAM usage (v5.3)

See merge request espressif/esp-idf!34113
2024-10-14 10:12:22 +08:00
e5a7ee16f7 fix(esp_wifi): Handle missing error propagation in set_mode 2024-10-12 17:33:49 +08:00
ab0affd796 Merge branch 'fix/fix_macro_in_memory_ld_v5.3' into 'release/v5.3'
fix(psram): fix macro in memory.ld (v5.3)

See merge request espressif/esp-idf!34065
2024-10-12 17:25:01 +08:00
a7782d0d5c Merge branch 'docs/add_ble_get_started_docs_v5.3' into 'release/v5.3'
docs(ble): Added BLE Get Started (v5.3)

See merge request espressif/esp-idf!34017
2024-10-12 14:25:38 +08:00
4fd7958d36 docs(ble): Added BLE Get Started (v5.3) 2024-10-12 14:25:37 +08:00
a41e1502a6 Merge branch 'bugfix/load_access_fault_upon_auth_v5.3' into 'release/v5.3'
fix(wifi): Add a check on hostapd instance while handling an Auth frame (Backport v5.3)

See merge request espressif/esp-idf!34122
2024-10-12 14:24:52 +08:00
6ec74ab769 Merge branch 'fix/ot_dns_ext_hook_ip_check_v5_3' into 'release/v5.3'
fix(openthread): Add check for ip address in DNS external resolve hook(v5.3)

See merge request espressif/esp-idf!34069
2024-10-12 14:23:03 +08:00
fe53000b24 Merge branch 'bugfix/fix_ble_handle_check_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed BLE handle check for GATT API (v5.3)

See merge request espressif/esp-idf!34096
2024-10-12 14:21:31 +08:00
465d1cf229 Merge branch 'feature/set_hp_sleep_power_mode_with_clock_src_selection' into 'release/v5.3'
change(esp_hw_support): switch lp_cpu power mode with clock src selection to save lp_cpu working power (v5.3)

See merge request espressif/esp-idf!34110
2024-10-12 14:14:37 +08:00
e8822fac4e Merge branch 'fix/mcpwm_pm_lock_memory_leak_v5.3' into 'release/v5.3'
fix(mcpwm): fix pm_lock memory issues (v5.3)

See merge request espressif/esp-idf!34058
2024-10-12 11:48:42 +08:00
1eb81bbf17 Merge branch 'bugfix/fix_deep_sleep_wakeup_by_touch_on_p4_v5.3' into 'release/v5.3'
fix(touch): fixed the deep sleep wakeup issue on P4 (v5.3)

See merge request espressif/esp-idf!34134
2024-10-12 11:30:10 +08:00
7372f1a81f fix(touch): fixed the deep sleep wakeup issue on P4 2024-10-12 09:39:10 +08:00
738bf30efa Merge branch 'docs/update_ble_feature_support_status_v5.3' into 'release/v5.3'
docs(ble): Updated a feature name in feature status table v5.3

See merge request espressif/esp-idf!34061
2024-10-11 20:26:07 +08:00
17921b7e9c test(freertos): Added unit test for event groups to test priority inversion
This commit adds a FreeRTOS unit test to verify that event groups do not
cause priority inversion when unblocking a higher priority task.
2024-10-11 11:53:32 +02:00
f33abbddba fix(freertos): Fixed priority inversion when setting event group bits
This commit fixes a priority inversion when a lower priority task set
event group bits to unblock a higher priority task but the lower
priority task continued to run.
2024-10-11 11:53:32 +02:00
3ff63b3bfc fix(wifi): Add a check on hostapd instance while handling an Auth frame 2024-10-11 15:16:16 +05:30
353b48aa44 refactor(lcd): optimize rgb lcd iram usage
lcd_com_mount_dma_data() doesn't need to be placed in IRAM
2024-10-11 16:24:19 +08:00
a70fe8bdee change(esp_hw_support): switch hp_sys default power mode with clock src selection 2024-10-11 16:06:10 +08:00
55ff2325c5 change(esp_hw_support): improve gpio deepsleep wakeup configuration code 2024-10-11 14:39:20 +08:00
aee378edd0 fix(esp_hw_support): fix coverity defects in sleep code 2024-10-11 14:33:53 +08:00
b031e0b672 fix(ble/bluedroid): Fixed BLE handle check for GATT API
(cherry picked from commit 514155de3b)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-10-10 21:13:28 +08:00
9b5809d7a3 Merge branch 'bugfix/support_cert_test_v5.3' into 'release/v5.3'
fix(phy): Add cert_test support for ESP32, ESP32-C2, ESP32-C6, ESP32-H2 and ESP32-S2(Backport v5.3)

See merge request espressif/esp-idf!34033
2024-10-10 20:54:27 +08:00
4a74ca2d2d Merge branch 'docs/freertos_stack_size_v5.3' into 'release/v5.3'
docs(freertos): update freertos comments to reflect that stack size is in bytes (v5.3)

See merge request espressif/esp-idf!33504
2024-10-10 16:35:07 +08:00
0ccbe0d2e5 Merge branch 'fix/assert_fail_in_xtaskdeletewithcaps_v5.3' into 'release/v5.3'
Fixed occational assert failure in vTaskDeleteWithCaps() (v5.3)

See merge request espressif/esp-idf!33685
2024-10-10 16:26:54 +08:00
e32914f972 fix(ldgen): enable default name SORT in linker fragment
Currently, the `SORT` flag mandates the inclusion of at least the
`sort_by_first` argument in the grammar, despite the documentation[1]
indicating that `SORT` can be utilized without any arguments, defaulting
to sorting input sections by name. Fix this by modifying the grammar
to allow a default `SORT` and update a test accordingly.

[1] https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/
    linker-script-generation.html

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-10-10 09:12:27 +02:00
7e1df3e0b0 docs(ble): Update the status of AOA in host feature status table 2024-10-10 14:18:35 +08:00
995bd20dcd fix(openthread): Add check for ip address in DNS external resolve hook 2024-10-10 12:20:55 +08:00
67b99935d9 fix(ci): fixed examples protocols mqtt custom_outbox build fail issue 2024-10-10 10:56:25 +08:00
d63eb1239c Merge branch 'feat/adapt_spi_lcd_to_lvgl_v5.3' into 'release/v5.3'
docs: update programming guide to also support quad spi lcd (v5.3)

See merge request espressif/esp-idf!34036
2024-10-10 10:31:46 +08:00
ded2989a73 Merge branch 'feat/ble_mesh_v1.1_feat_disable_support_v5.3' into 'release/v5.3'
feat(ble_mesh): esp ble mesh v1.1 features enable/disable supported (v5.3)

See merge request espressif/esp-idf!33779
2024-10-10 10:19:09 +08:00
2f8f397d6b fix(test): reduce gdb_loadable_elf binary size 2024-10-10 10:12:31 +08:00
04c7bbde5e fix(psram): fix macro in memory.ld 2024-10-10 10:12:29 +08:00
04d15ae574 docs(ble): Updated a feature name in feature status table 2024-10-10 09:59:17 +08:00
41838bb8a6 fix(mcpwm): fix pm_lock memory issues 2024-10-10 09:49:41 +08:00
88030d4832 Merge branch 'bugfix/fix_bleqabr24_1282_v5.3' into 'release/v5.3'
Fixed BLE scanning and initiating coexist on ESP32 (v5.3)

See merge request espressif/esp-idf!33834
2024-10-09 17:19:30 +08:00
7531d7e853 Merge branch 'bugfix/fix_bci_443_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed the timeout of wake up timer when using RC OSC (v5.3)

See merge request espressif/esp-idf!33893
2024-10-09 17:19:04 +08:00
7046cb360c Merge branch 'modified_ble_multi_conn_example_readme_v5.3' into 'release/v5.3'
update(ble): Modified the ble multi_conn example's readme (v5.3)

See merge request espressif/esp-idf!33995
2024-10-09 15:16:02 +08:00
530f891259 Merge branch 'bugfix/fix_ext_conn_adv_data_check_v5.3' into 'release/v5.3'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(01cc408) (v5.3)

See merge request espressif/esp-idf!34003
2024-10-09 11:58:21 +08:00
a7c2b5c9b6 docs(spi_lcd): update supported spi mode description
Closes https://github.com/espressif/esp-idf/issues/14605
2024-10-09 11:00:13 +08:00
6c8315511b docs(freertos): update freertos comments to reflect that stack size is in bytes
Closes https://github.com/espressif/esp-idf/issues/11600
2024-10-09 10:10:52 +08:00
dd6fdb92ea docs(system): add cpu lock up description 2024-10-09 10:10:38 +08:00
b171f1d57b fix(phy): update cert_test docs 2024-10-09 10:00:52 +08:00
32700ae426 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Jiang Jiang Jian <jack@espressif.com>
2024-10-09 09:50:38 +08:00
7cb3bba0ba fix(phy): esp32s2 and esph2 support rf cert_test 2024-10-09 09:49:05 +08:00
cf577ee4cb fix(phy): fix esp32 build fail issue
Closes https://github.com/espressif/esp-idf/issues/11972
2024-10-09 09:48:13 +08:00
2225b4c3ca fix(phy): All chip support cert_test 2024-10-09 09:48:03 +08:00
4866363b87 Merge branch 'bugfix/ftm_apsta_bw_issue_v5.3' into 'release/v5.3'
fix(esp_wifi): Fix FTM issues in AP-STA mode (Backport v5.3)

See merge request espressif/esp-idf!33702
2024-10-08 20:03:20 +08:00
21858b4144 Merge branch 'bugfix/sae_h2e_vulnerability_fix_v5.3' into 'release/v5.3'
fix(wifi): Sae check for invalid rejected group (v5.3)

See merge request espressif/esp-idf!33979
2024-10-08 19:37:33 +08:00
46e610fe13 fix(usb_host): Update log level and error poropagation 2024-10-08 11:25:28 +02:00
07dc67c640 refactor(usb_host): Fixed function return values in usb_host stack:
- updated doxygen for the whole usb_host stack
    - doxygen for test_apps is not updated
    - fixed error codes propagation problems in the usb_host stack
2024-10-08 11:25:28 +02:00
7a7ad4a62e fix(esp_wifi): Fix FTM issues in AP-STA mode
Add AP-STA mode support in FTM example
Update wifi libs with below changes -
- Use ex-AP's bandwidth in FTM request when connected
- Allow Bandwidth downgrade in FTM negotiation
- Use separate calibration when Initiator performs 20MHz FTM
  while in-AP is in 40MHz
2024-10-08 16:06:30 +08:00
657d250d96 Merge branch 'bugfix/backport_supplicant_fixes_v5.3' into 'release/v5.3'
fix(wifi): Backport some fixes(v5.3)

See merge request espressif/esp-idf!33714
2024-10-08 16:03:50 +08:00
b6cbf1a026 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(01cc408)
- Fixed extended connectable advertising data length check


(cherry picked from commit 8a80675b7c)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-10-08 15:13:40 +08:00
41be5e929e feat(ble_mesh): esp ble mesh v1.1 features enable/disable supported 2024-10-08 15:05:24 +08:00
9617e728e7 update(ble): Modified the ble multi_conn example's readme
(cherry picked from commit 28ffd5fc04)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2024-10-08 12:53:49 +08:00
1191500dae docs: update mbedtls guide for TLS 1.3 supported change 2024-10-08 09:57:41 +05:30
c4d4c22e5b Merge branch 'bugfix/spi_eth_latest_p4_fnc_board_v5.3' into 'release/v5.3'
fix(esp_eth): fixed SPI ETH GPIO to align with latest ESP32-P4-Function-EV-Board (v5.3)

See merge request espressif/esp-idf!33960
2024-10-07 22:03:44 +08:00
b18849638e SAE: Check for invalid Rejected Groups element length explicitly on STA
Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.

Fixes: 444d76f74f65 ("SAE: Check that peer's rejected groups are not enabled")
Signed-off-by: Jouni Malinen <j@w1.fi>
2024-10-07 12:25:45 +05:30
c6fee11bfc SAE: Check that peer's rejected groups are not enabled
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2024-10-07 12:25:45 +05:30
90317ded69 SAE: Reject invalid Rejected Groups element in the parser
There is no need to depend on all uses (i.e., both hostapd and
wpa_supplicant) to verify that the length of the Rejected Groups field
in the Rejected Groups element is valid (i.e., a multiple of two octets)
since the common parser can reject the message when detecting this.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-10-07 12:25:45 +05:30
5f7a3b6d48 SAE: Check for invalid Rejected Groups element length explicitly
Instead of practically ignoring an odd octet at the end of the element,
check for such invalid case explicitly. This is needed to avoid a
potential group downgrade attack.

Signed-off-by: Jouni Malinen <j@w1.fi>
2024-10-07 12:25:45 +05:30
6b3bf4d0e7 SAE: Check that peer's rejected groups are not enabled in AP
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
2024-10-07 12:25:45 +05:30
bff34554df fix(wifi): Add channel bit definition 2024-10-07 09:54:17 +05:30
0fa6298774 fix: Fix spelling mistakes in esp_http_server.h 2024-10-06 17:06:48 +05:30
640f9750a4 fix(esp_wifi): Prevent memory overflow in WPS 2024-10-06 16:52:25 +05:30
f430a553de fix(esp_wifi): Mask some error conditions in WPS
Mask some error conditions in WPS to increase the probability of
WPS success.
2024-10-06 16:52:25 +05:30
9f17d6fff8 fix(esp_wifi): Disable WPS timers once WPS succeed 2024-10-06 16:52:25 +05:30
11c1627de9 fix(esp_wifi): Add support for 5ghz channel list for easy connect 2024-10-06 16:52:25 +05:30
32d3b0b02c fix(esp_wifi): Allow connection with WPA mode in WPS 2024-10-06 16:52:25 +05:30
a7065d7020 fix(esp_wifi): Deinit WPS registrar during hostapd deinit 2024-10-06 16:52:25 +05:30
efc79c72ed fix(esp_wifi): Added prints in btm roam for error condition 2024-10-06 16:52:25 +05:30
dbd96d6499 fix(wpa_supplicant): Fix for WPS-PBC overlap detection in dual band
When WPS is running on dual band(e.g. a separate 2.4 GHz and 5 GHz band
    radios in an AP device), detect pbc overlap only if UUID differs.
2024-10-06 16:52:25 +05:30
6de1045f01 fix(esp_eth): fixed SPI ETH GPIO to align with latest ESP32-P4-Function-EV-Board 2024-10-03 09:34:24 +02:00
4337e634c6 fix(nimble): Fix the sequence of ll and host transport init 2024-10-03 15:33:04 +08:00
8c9361afaf Merge branch 'feature/update_mbedtls_version_to_3.6.1_v5.3' into 'release/v5.3'
feat(mbedtls): updated mbedtls version to 3.6.1 (v5.3)

See merge request espressif/esp-idf!33913
2024-10-03 15:00:09 +08:00
90ca8e7cb7 Merge branch 'fix/idfpy_uf2_fail_v5.3' into 'release/v5.3'
fix(uf2): Ignore ESPBAUD, ESPPORT when calling idf.py uf2[-app] (v5.3)

See merge request espressif/esp-idf!33948
2024-10-02 20:32:11 +08:00
7020c8479a Merge branch 'fix/coredump_sha_build_error_v5.3' into 'release/v5.3'
fix(esp-coredump): fix build error when mbedtls hardware sha disabled (v5.3)

See merge request espressif/esp-idf!33943
2024-10-01 22:12:55 +08:00
519322de5f fix(uf2): Ignore ESPBAUD, ESPPORT when calling idf.py uf2[-app] 2024-10-01 13:37:17 +02:00
67e49f542a test(esp-coredump): add test for the soft sha config 2024-10-01 10:07:04 +02:00
3994a0cb1b fix(esp-coredump): fix build error when mbedtls hardware sha disabled 2024-10-01 10:07:04 +02:00
40d7068a95 fix(build): fix orphan sections warning kconfig variable 2024-10-01 12:18:56 +07:00
4f29e3ffe7 Merge branch 'fix/add_countermeasure_for_ecdsa_peripheral_issue_v5.3' into 'release/v5.3'
feat(hal): Add countermeasure for ECDSA generate signature (v5.3)

See merge request espressif/esp-idf!33745
2024-10-01 11:10:47 +08:00
044b34475a fix(macos): ccache: re-enable, show stats, set CCACHE_DIR, limit CCACHE_MAXSIZE 2024-09-30 17:57:33 +02:00
98440e1315 Merge branch 'bugfix/fix_esp32c2_rom_eco1_mbedtls_issues_v5.3' into 'release/v5.3'
fix(esp_rom): Fixed esp32c2 rom eco1 mbedtls issues (v5.3)

See merge request espressif/esp-idf!33917
2024-09-30 14:11:16 +08:00
44ce512011 feat(hal): Add countermeasure for ECDSA generate signature
The ECDSA peripheral before ECO5 of esp32h2 does not perform the ECDSA
    sign operation in constant time. This allows an attacker to read the
    power signature of the ECDSA sign operation and then calculate the
    ECDSA key stored inside the eFuse. The commit adds a countermeasure
    for this attack. In this case the real ECDSA sign operation is
    masked under dummy ECDSA sign operations to hide its real power
    signature
2024-09-30 12:24:38 +08:00
fad9341c08 fix(esp_rom): Fixed esp32c2 rom eco1 mbedtls issues 2024-09-30 09:21:21 +08:00
82c178618d feat(mbedtls): updated mbedtls version to 3.6.1 2024-09-29 20:20:07 +05:30
6df7db673e Merge branch 'feat/add_mode_chg_parem_v5.3' into 'release/v5.3'
feat(bt/bluedroid): Report sniff interval to application layer(v5.3)

See merge request espressif/esp-idf!33865
2024-09-29 14:03:31 +08:00
b398c12576 Merge branch 'fix/fix_esp32p4_freq_switching_timing_v5.3' into 'release/v5.3'
fix(esp_hw_support): fix esp32p4 CPU frequency switching timing (v5.3)

See merge request espressif/esp-idf!33881
2024-09-29 12:11:07 +08:00
3497691fc5 fix(sleep): fix_wrong_sleep_param_for_lp_memory_retention (v5.3) 2024-09-29 10:30:00 +08:00
f765a4ccd8 Merge branch 'feat/get_ble_resolve_address_status_v5.3' into 'release/v5.3'
feat(ble/bluedroid): Support resolve BLE address for interval usage (v5.3)

See merge request espressif/esp-idf!33808
2024-09-29 10:29:59 +08:00
a5ed03eb85 Merge branch 'feat/usb_disconnect_api_backport_v5.3' into 'release/v5.3'
refactor(usb): Update HCD tests to use port power off for disconnections backport v5.3

See merge request espressif/esp-idf!33527
2024-09-28 10:50:46 +08:00
8fa51aa1b5 fix(bt/controller): Fixed ble get tx power error
(cherry picked from commit 4108a5cc4c)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-09-27 18:33:45 +08:00
0bf641a17c fix(bt/controller): Fixed the timeout of wake up timer when using RC OSC
(cherry picked from commit 873708579c)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-09-27 18:33:43 +08:00
e009a4f451 feat(usb/host): Enable USB Host tests on P4 2024-09-27 11:31:42 +02:00
9bdea61071 fix(usb/host): Correctly handle unpowered port in HUB 2024-09-27 11:31:42 +02:00
802ab4c2cc refactor(usb): Remove use of usb_phy_action() from unit tests
Currently, USB Host unit tests that require a software triggered disconnection/
reconnection rely on the 'usb_phy_action()' function.

This commit replaces those calls with 'hcd_port_command()' or
'usb_host_lib_set_root_port_power()'.

Note: Also removed 'test_usb_common.h/c' as it is no longer necessary are the
function call replacements.
2024-09-27 11:31:42 +02:00
318c69a671 feat(usb): Add usb_host_lib_set_root_port_power()
This commit adds the usb_host_lib_set_root_port_power() function. This provides
a public API for users to power the root port OFF or ON at runtime, thus trigger
a disconnection or allow connections respectively.

In addition, the usb_host_config_t.root_port_unpowered install configuration is
provided to allow users to install the USB Host Library without automatically
powering ON the root port.
2024-09-27 11:31:42 +02:00
a82938bb7e fix(esp_hw_support): fix esp32p4 CPU frequency switching timing 2024-09-27 17:29:54 +08:00
5b1796b284 revert(esp_hw_support): revert stall another core during cpu/mem/apb freq switching
This reverts commit 4c2b86f5.
2024-09-27 17:28:05 +08:00
a7d1558e32 fix(ble/bluedroid): Fixed BLE spelling error in word 2024-09-27 15:49:20 +08:00
36b44e7430 feat(ble/bluedroid): Add BLE memory allocation failure message 2024-09-27 15:49:10 +08:00
2129c70ecf feat(ble/controller): Display BLE controller init status for ESP32 and ESP32C3/S3 2024-09-27 15:49:01 +08:00
049f644181 feat(ble/bluedroid): Optimize address resolution status for interval use 2024-09-27 14:47:15 +08:00
93f862d6fd feat(bt/bluedroid): Report sniff interval to application layer 2024-09-27 14:11:26 +08:00
620966389c Merge branch 'fix/fix_readme_check' into 'release/v5.3'
fix(ci): rerun pre-commit to fix readme

See merge request espressif/esp-idf!33856
2024-09-27 13:42:16 +08:00
144b039abc Merge branch 'feat/bringup_esp32c2_rom_mbedtls_to_formal_feature_v5.3' into 'release/v5.3'
feat(mbedtls): bringup rom mbedtls feature to formal (v5.3)

See merge request espressif/esp-idf!33800
2024-09-27 12:18:34 +08:00
ef53542940 Merge branch 'fix/fix_clock_retention_link_context_v5.3' into 'release/v5.3'
fix(esp_hw_support): add clock retention contents for esp32c6 & esp32h2  (v5.3)

See merge request espressif/esp-idf!33608
2024-09-27 12:18:11 +08:00
84f024478c fix(ci): rerun pre-commit to fix readme files 2024-09-27 11:12:55 +08:00
466da04867 Merge branch 'fix/fix_nimble_gatt_server_example_readme_v5.3' into 'release/v5.3'
docs(ble): Added BLE Get Started documentation link to README.md (v5.3)

See merge request espressif/esp-idf!33830
2024-09-26 15:47:17 +08:00
da96dfa4be Merge branch 'fix/ecdsa_verify_check_hash_len_v5.3' into 'release/v5.3'
Wrap some mbedtls' ECDSA verification related APIs (v5.3)

See merge request espressif/esp-idf!33783
2024-09-26 15:13:12 +08:00
536d6225a1 Merge branch 'ci/enable_memprot_tests_for_esp32c61_v5.3' into 'release/v5.3'
Clear PMA entries before usage (v5.3)

See merge request espressif/esp-idf!33786
2024-09-26 15:11:58 +08:00
0d81f5b619 Merge branch 'bugfix/fix_c2eco4_ble_init_error_v5.3' into 'release/v5.3'
fix(ble): Fixed BLE initialization issue on ESP32-C2 eco4

See merge request espressif/esp-idf!33812
2024-09-26 14:52:38 +08:00
b724f2a78f fix(bt): Update bt lib for ESP32(3bf7ef0)
- Fixed BLE scanning and initiating coexist


(cherry picked from commit 241b90f3f0)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-09-26 10:33:37 +08:00
072d872fc6 docs(ble): Added BLE Get Started documentation link to README.md
(cherry picked from commit 5f008828d3)

Co-authored-by: Yuhan Wei <weiyuhan@espressif.com>
2024-09-26 09:38:23 +08:00
9d3cdebddb fix(gdbstub_runtime): fix test gdbstub_runtime which requiers elf file 2024-09-25 15:34:50 +07:00
6729419ee9 feat(mbedtls): bringup rom mbedtls feature to formal 2024-09-25 14:56:36 +08:00
2fbe37a0e5 feat(ble/bluedroid): Support resolve BLE address for interval usage
(cherry picked from commit b88b511362)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-09-25 12:13:31 +08:00
2040eb646c fix(ble): Fixed BLE initialization issue on ESP32-C2 eco4 2024-09-25 11:47:41 +08:00
7d8c955e21 fix(wdt): changed register dump on non panic task WDT to be more descriptive
Closes https://github.com/espressif/esp-idf/issues/14400
2024-09-25 10:51:47 +08:00
707d097b01 Merge branch 'bugfix/fixed_c5_ble_cache_error_240919_v5.3' into 'release/v5.3'
Bugfix/fixed c5 ble cache error 240919 (v5.3)

See merge request espressif/esp-idf!33761
2024-09-25 10:31:36 +08:00
22858c37c1 Merge branch 'bugfix/fix_clang_compilation_issue_v5.3' into 'release/v5.3'
fix(nimble): Fix clang compilation issue (v5.3)

See merge request espressif/esp-idf!33763
2024-09-25 00:14:21 +08:00
c302ea2e71 Merge branch 'bugfix/fix_blufi_deinit_fail_v5.3' into 'release/v5.3'
fix(nimble): Fixed deinit sequence in blufi (v5.3)

See merge request espressif/esp-idf!33768
2024-09-25 00:10:25 +08:00
f9548c4b7d Merge branch 'docs/fix_typo_gpio_description_v5.3' into 'release/v5.3'
docs: fix a typo in gpio.rst (v5.3)

See merge request espressif/esp-idf!33772
2024-09-24 21:33:56 +08:00
e1d72e960c feat(mbedtls): Wrap mbedtls_ecdsa_read_signature to use ECDSA hardware when possible 2024-09-24 17:05:27 +05:30
e4de9ffe7d fix(cpu_region_protect): Reset PMA entries before using them
- ROM uses some PMA entries so we clear such PMA entries before using them in ESP-IDF
2024-09-24 16:56:17 +05:30
87ddff0ce5 fix(mbedtls/port): Check signature hash length before using ECDSA hardware 2024-09-24 16:48:01 +05:30
e3fdf3efe9 Merge branch 'ci/increase_tiemout_wl_multiple_tasks_can_use_same_volume_v5.3' into 'release/v5.3'
ci: Increase CONFIG_FATFS_VFS_FSTAT_BLKSIZE size for auto_fsync case to fix CI (v5.3)

See merge request espressif/esp-idf!33749
2024-09-24 19:12:37 +08:00
351e9208ee Merge branch 'bugfix/fix_ble_scan_assert_1728_v5.3' into 'release/v5.3'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(e9ae856) (v5.3)

See merge request espressif/esp-idf!33722
2024-09-24 16:10:19 +08:00
419b646d17 docs: fix a typo in gpio.rst 2024-09-24 15:56:21 +08:00
887c116f44 fix(nimble): Fixed deinit sequence in blufi 2024-09-24 12:20:07 +05:30
f8e4681ea0 fix(nimble): Fix clang compilation issue 2024-09-24 11:58:38 +05:30
17c29f773b fix(ble): unified ble memory allocation method
(cherry picked from commit 8e4cc79a27)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2024-09-24 12:03:34 +08:00
d5e66b8196 ci: Increase CONFIG_FATFS_VFS_FSTAT_BLKSIZE size for auto_fsync case 2024-09-23 17:42:39 +02:00
1f68652c46 Merge branch 'feature/add_api_to_get_last_status_code_logged_during_ota_v5.3' into 'release/v5.3'
feat(esp_https_ota): added API to get last status code logged from http resonse (v5.3)

See merge request espressif/esp-idf!33609
2024-09-23 20:49:13 +08:00
fbf7f2c031 Merge branch 'bugfix/fix_efuse_example_c2_v5.3' into 'release/v5.3'
fix(efuse): Fix efuse test examples (v5.3)

See merge request espressif/esp-idf!33729
2024-09-23 16:42:41 +08:00
5ff61c0913 fix(examples): Fix codespell check for efuse example 2024-09-23 11:10:40 +03:00
2d65f53903 feat(examples): Get offsets for efuses from espefuse.py 2024-09-23 11:10:40 +03:00
599419ab62 fix(examples): Fix SB and FE tests, type of sign 2024-09-23 10:27:14 +03:00
f4086e5f92 feat(examples): Increases partition table offset for P4 and C5 2024-09-23 10:26:31 +03:00
81c0ccfade fix(efuse): fix efuse examples not compiling on c2 2024-09-23 10:25:02 +03:00
a29f9c9b57 Merge branch 'fix/usb_device_msc_example_fix_console_backport_v5.3' into 'release/v5.3'
fix(usb_device): Fix console periheral, enable USJ Console on P4 backport v5.3

See merge request espressif/esp-idf!33653
2024-09-23 14:42:18 +08:00
7c137656aa Merge branch 'feature/usb_host_hub_support_collective_backport_p2_v5.3' into 'release/v5.3'
feat(usb_host): Hub Support Collective backport part 2/3 (v5.3)

See merge request espressif/esp-idf!31365
2024-09-23 13:40:01 +08:00
b74c02bcd7 Merge branch 'bugfix/gcmp_reason_code_v53' into 'release/v5.3'
fix(esp_wifi): Fix reason code for sta not supporting GCMP

See merge request espressif/esp-idf!33639
2024-09-23 13:38:47 +08:00
e07d014b1d fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(63eb54d)
- Fixed issue where RPA is not updated after BLE RPA timeout
2024-09-23 13:33:22 +08:00
e6013c84da test(bt/bluedroid): Support to disable BLE address resolution 2024-09-23 13:33:22 +08:00
81d0122ede Merge branch 'ci/remove_c5_build' into 'release/v5.3'
ci(esp32c5,esp32c61): stop building c5 and c61 on 5.3

See merge request espressif/esp-idf!33525
2024-09-23 13:16:36 +08:00
d4a69b5a3d Merge branch 'feat/support_blecrt_242_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fixed access fault when reading BLE controller information fails (v5.3)

See merge request espressif/esp-idf!33634
2024-09-23 12:08:31 +08:00
1bde82470a Merge branch 'bugfix/fix_ble_max_tx_power_on_esp32c3_v5.3' into 'release/v5.3'
fix(bt/controller): Change the max TX power to +20dBm on ESP32-C3 and ESP32-S3 (v5.3)

See merge request espressif/esp-idf!33617
2024-09-23 12:08:26 +08:00
10664a2e03 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(e9ae856)
- Fixed BLE scan assert in lld_scan.c 1728


(cherry picked from commit 32c7694f56)

Co-authored-by: zhanghaipeng <zhanghaipeng@espressif.com>
2024-09-23 11:13:32 +08:00
48088eceaf Merge branch 'fix/ble_mesh_gh_pr_13135_v5.3' into 'release/v5.3'
fix(ble_mesh): Fix OP_TIME_SET and OP_TIME_STATUS (v5.3)

See merge request espressif/esp-idf!32769
2024-09-23 10:29:41 +08:00
310e71e277 Merge branch 'fix/ble_mesh_github_pr_14140_v5.3' into 'release/v5.3'
fix(ble-mesh): don't use dangling pointer in nimble gatt service_(v5.3)

See merge request espressif/esp-idf!32612
2024-09-23 10:29:29 +08:00
94ea3fd1de Merge branch 'feat/send_data_len_afer_conn_v5.3' into 'release/v5.3'
feat(nimble): Set data length after connection (v5.3)

See merge request espressif/esp-idf!33694
2024-09-21 21:25:45 +08:00
f41a395b78 Merge branch 'bugfix/warn_rc32k_use_v5.3' into 'release/v5.3'
fix(clk): warn the users to avoid using RC32K clock (v5.3)

See merge request espressif/esp-idf!33501
2024-09-21 14:53:49 +08:00
fe0e852e0a Merge branch 'bugfix/esp_ringbuf_32_bit_alignment_v5.3' into 'release/v5.3'
fix(ringbuf): allow xRingbufferCreateWithCaps to pass in non-32-bit aligned size (v5.3)

See merge request espressif/esp-idf!33520
2024-09-21 14:53:34 +08:00
5ccf21e236 Merge branch 'ble_dev/esp32c2eco4_chip_20240903_v5.3' into 'release/v5.3'
change(ble): update c2 eco4 ld file (v5.3)

See merge request espressif/esp-idf!33669
2024-09-21 14:53:01 +08:00
e0608d7c2c fix(freertos): Fixed assert failure in vTaskDeleteWithCaps
This commit fixes an assert failure in vTaskDeleteWithCaps() when
multiple un-pinned tasks are created with stack in the external memory
and such tasks delete themselves.

Closes https://github.com/espressif/esp-idf/issues/14222
2024-09-20 15:13:49 +02:00
469d9c8bae test(freertos): Added a test for vTaskDeleteWithCaps when stack is in ext RAM
This commit adds a stress tests for creating multiple tasks with
xTaskCreateWithCaps such that the stack is allocated in external SPIRAM.
Then the tasks self-delete. This is done iteratively as stress test.
2024-09-20 15:07:23 +02:00
ae4b955a0c Merge branch 'feat/lwip_dns_external_resolve_hook_v5_3' into 'release/v5.3'
feat(lwip): Add DNS external hook in TCPIP context and replace netconn external resolve hook with dns external hook for OpenThread (v5.3)

See merge request espressif/esp-idf!33512
2024-09-20 14:18:01 +08:00
5bedb0ed69 Merge branch 'fix/ringbuf_receives_item_not_yet_sent_v5.3' into 'release/v5.3'
fix(esp_ringbuf): Fixed a bug where in a no-split buffer received items prematurely (v5.3)

See merge request espressif/esp-idf!33649
2024-09-20 13:38:56 +08:00
cd1ff31bba change(ble): update c2 eco4 ld file
(cherry picked from commit 25189b190f)

Co-authored-by: Shen Weilong <shenweilong@espressif.com>
2024-09-20 12:53:37 +08:00
d15668f058 Merge branch 'bugfix/fix_sdp_bugs_v5.3' into 'release/v5.3'
Bugfix/fix sdp bugs[backport 5.3]

See merge request espressif/esp-idf!33602
2024-09-20 11:41:39 +08:00
22912e4f21 Merge branch 'bugfix/fix_some_bugs_in_avrcp_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fixed some bugs in AVRCP (Backport v5.3)

See merge request espressif/esp-idf!33576
2024-09-20 11:40:54 +08:00
0507cbaf14 fix(ble_mesh): Fix OP_TIME_SET and OP_TIME_STATUS
When a user app is handling these messages, the tai_utc_delta and
time_zone_offset fields are not correctly populated.  Resolve by
properly setting the fields.
2024-09-20 10:59:23 +08:00
98df0172ac fix(ble-mesh): don't use dangling pointer in nimble gatt service 2024-09-20 10:58:56 +08:00
cdef1308a4 Merge branch 'feat/ble_mesh_lib_flash_size_optimized_v5.3' into 'release/v5.3'
feat(ble_mesh): ble mesh lib flash size optimized (v5.3)

See merge request espressif/esp-idf!33477
2024-09-20 10:36:16 +08:00
d8ec774d96 Merge branch 'bugfix/check_bootloader_size_with_sign_v5.3' into 'release/v5.3'
fix(esptool_py): Check the size of the bootloader + signature block (v5.3)

See merge request espressif/esp-idf!33590
2024-09-20 09:14:07 +08:00
ef1c1169e4 feat(nimble): Set data length after connection 2024-09-19 20:22:43 +05:30
fd36173ac3 fix(examples): Fix pre-commit check for efuse ESP32-C5 2024-09-19 17:30:42 +03:00
7d442f76f1 fix(esp_ringbuf): Fixed a bug where in a no-split buffer received items prematurely
This commit fixes a bug in the no-split buffer which could receive an
item prematurely if the space on the buffer is acquired until the buffer
is full. The commit also adds a unit test for this scenario.

Closes https://github.com/espressif/esp-idf/issues/14568
2024-09-19 16:01:54 +02:00
e6a551b88d fix(usb_device): Fix console periheral, enable USJ Console on P4 2024-09-19 13:52:23 +02:00
3c3d05e97b Merge branch 'feat/supported_camera_sc2336_lcd_ek79007_v5.3' into 'release/v5.3'
camera: supported camera related example using sc2336 and ek79007 (v5.3)

See merge request espressif/esp-idf!33636
2024-09-19 16:14:41 +08:00
a286bc32dd Merge branch 'bugfix/fixed_c6_crash_c2_crash_issue_v5.3' into 'release/v5.3'
Bugfix/fixed c6 crash c2 crash issue (v5.3)

See merge request espressif/esp-idf!33599
2024-09-19 14:34:10 +08:00
c48a47c341 feat(camera): supported camera related example using sc2336 and ek79007
Closes https://github.com/espressif/esp-idf/issues/14517
2024-09-19 14:18:42 +08:00
bae4cf504a Merge branch 'fix/added_a_change_to_print_address_of_advertising_instance_v5.3' into 'release/v5.3'
fix(nimble): Added a change to print address of an advertising instance (v5.3)

See merge request espressif/esp-idf!33561
2024-09-19 14:09:01 +08:00
f1468c2ca3 fix(esp_wifi): Fix reason code for sta not supporting GCMP
Add fix for returning correct reason code when sta doesn't
     support GCMP to ensure consistent behaviour for all chips.
2024-09-19 11:29:20 +05:30
01613ca01d Merge branch 'backport/add_thread_curl_https_ci_case_v5.3' into 'release/v5.3'
feat(openthread): add thread curl https ci case (Backport v5.3)

See merge request espressif/esp-idf!33586
2024-09-19 10:38:19 +08:00
7fbc78d4dc Merge branch 'feat/support_esp32c2_eco4_rom_systimer_hal_v5.3' into 'release/v5.3'
feat(esp_rom): support esp32c2 rev2.0(ECO4) rom systimer hal (backport v5.3)

See merge request espressif/esp-idf!33618
2024-09-19 10:16:41 +08:00
3b76633516 fix(bt/bluedroid): Fixed access fault when reading BLE controller information fails
(cherry picked from commit e4e23087ee)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-09-19 09:12:43 +08:00
805ee5af90 feat(bt/bluedroid): Add BLE connection id param for ESP_GATTS_RESPONSE_EVT
(cherry picked from commit e4a372ab76)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-09-19 09:12:41 +08:00
05b9f85acc feat(esp_rom): support esp32c2 rev2.0(ECO4) rom systimer hal 2024-09-18 19:21:45 +08:00
da31e4beb4 feat(esp_rom): Add esp32c2.rom.eco4.ld 2024-09-18 19:21:35 +08:00
6a34742cb7 fix(bt/controller): Change the max TX power to +20dBm on ESP32-C3 and ESP32-S3
(cherry picked from commit fe43c8f1b5)

Co-authored-by: chenjianhua <chenjianhua@espressif.com>
2024-09-18 17:34:34 +08:00
186d53427e feat(esp_https_ota): added API to get last status code logged from http resonse
Closes https://github.com/espressif/esp-idf/issues/14302
2024-09-18 14:58:16 +05:30
234103d7aa fix(esp_hw_support): add clock retention contents 2024-09-18 17:22:21 +08:00
zwl
8650436d6b fix(ble): fixed occasional crash issue in multi-connect scenarios on ESP32-C6 2024-09-18 17:05:08 +08:00
50ba5891b5 fix(bt/bluedroid): Fixed not deep copy service_name and user1_ptr in RAW SDP search event 2024-09-18 16:22:24 +08:00
0fe9ddd190 change(bt/bluedroid): Limited SDP service discovery operation 2024-09-18 16:22:19 +08:00
f1d14e7db5 change(bt/bluedroid): Release record data after SDP record created 2024-09-18 16:08:14 +08:00
1ae74c4dd4 fix(ble): fixed memory leak issue when using uart hci
(cherry picked from commit 4d2c44f511)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2024-09-18 15:58:07 +08:00
dbfc55c111 fix(ble): fixed occasional assertion issue when enabling logging on ESP32-C2
(cherry picked from commit 0ef9ecb715)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2024-09-18 15:58:05 +08:00
a760bbc784 fix(ble): fixed occasional acl data packet loss issue when using UHCI on ESP32-H2
(cherry picked from commit c929a01931)

Co-authored-by: zwl <zhaoweiliang@espressif.com>
2024-09-18 15:58:02 +08:00
da77828786 fix(examples): Increases partition table offset for SBV2+FE test 2024-09-18 09:58:10 +03:00
3a8e4d8fa0 fix(esptool_py): Check the size of the bootloader + signature block 2024-09-18 09:58:10 +03:00
307df28d6e feat(openthread): add thread curl https ci case 2024-09-18 14:17:39 +08:00
1de0308a65 fix(bt/bluedroid): Fixed some bugs in AVRCP 2024-09-18 11:05:13 +08:00
0955c1aabe Merge branch 'contrib/github_pr_14469_v5.3' into 'release/v5.3'
fix(spinlock): comparison of integer expressions of different signedness (GitHub PR) (v5.3)

See merge request espressif/esp-idf!33543
2024-09-18 09:12:20 +08:00
75e8a58a41 Merge branch 'fix/sysview_example_tests_v5.3' into 'release/v5.3'
test(sysview): fix gdb no response error in sysview_heap_log tests (v5.3)

See merge request espressif/esp-idf!33457
2024-09-17 22:58:58 +08:00
17aa8c7f4c Merge branch 'contrib/github_pr_14314_v5.3' into 'release/v5.3'
perf(gcm): shrink Shoup table and tune GCM loop (GitHub PR) (v5.3)

See merge request espressif/esp-idf!32996
2024-09-17 20:51:05 +08:00
0d3856e369 change(mbedtls/port): optimize gcm_mult()
1) pre-shift GCM last4 to use 32-bit shift

On 32-bit architectures like Aarch32, RV32, Xtensa,
shifting a 64-bit variable by 32-bits is free,
since it changes the register representing half of the 64-bit var.
Pre-shift the last4 array to take advantage of this.

2) unroll first GCM iteration

The first loop of gcm_mult() is different from
the others. By unrolling it separately from the
others, the other iterations may take advantage
of the zero-overhead loop construct, in addition
to saving a conditional branch in the loop.
2024-09-17 20:06:24 +08:00
43515e0ccd feat(ble_mesh): ble mesh lib flash size optimized 2024-09-17 17:23:47 +08:00
fd98cf0594 fix(nimble): Added a change to print address of an advertising instance 2024-09-17 12:18:42 +05:30
9a6fcb836c Merge branch 'feat/support_esp32c2_eco4_rom_mbedtls_v3.6.0_lts_v5.3' into 'release/v5.3'
feat(mbedtls): support esp32c2 eco4 rom mbedtls v3.6.0 lts v5.3 (backport v5.3)

See merge request espressif/esp-idf!33419
2024-09-17 12:51:38 +08:00
a7fdf8d982 Merge branch 'bugfix/nimble_coverity_fixes_v5.3' into 'release/v5.3'
fix(nimble): Fix for coverity issues (v5.3)

See merge request espressif/esp-idf!33461
2024-09-16 22:40:14 +08:00
619db6b4c4 Merge branch 'fix/spinlock-var-not-used-warning_v5.3' into 'release/v5.3'
fix(system): fixed warnings related to ununsed var in spinlock.h (backport v5.3)

See merge request espressif/esp-idf!33484
2024-09-16 18:00:01 +08:00
a7d487acc5 fix(nimble): Fix for coverity issues 2024-09-16 14:26:06 +05:30
d97d579e6b Merge branch 'bugfix/add_dummy_cb_during_deinit_v5.3' into 'release/v5.3'
fix(nimble): De-register host cb in stack deinit (v5.3)

See merge request espressif/esp-idf!33373
2024-09-16 16:41:45 +08:00
b24d36a1cd fix(spinlock): comparison of integer expressions of different signedness 2024-09-16 09:49:25 +03:00
62d9ebf9ec fix(nimble): De-register host cb in stack deinit 2024-09-16 10:36:58 +05:30
42fc27767c Merge branch 'bugfix/fixed_ble_multi_conn_host_issue_5.3' into 'release/v5.3'
fix(ble): fixed the nimble connection reattempt issue when the OPTIMIZE_MULTI_CONN is enabled

See merge request espressif/esp-idf!33500
2024-09-16 13:04:15 +08:00
e6ee09b6a1 Merge branch 'fix/fix_csi_bridge_clock_enable_issue_v5.3' into 'release/v5.3'
rcc: change rcc var i to rcc_cnt (v5.3)

See merge request espressif/esp-idf!33536
2024-09-14 16:10:56 +08:00
ee735d7dbf Merge branch 'bugfix/fix_missing_per_adv_sync_est_evt_v5.3' into 'release/v5.3'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(c66a703) (Backport v5.3)

See merge request espressif/esp-idf!33450
2024-09-14 15:49:11 +08:00
9011c4a3fd change(rcc): change rcc var i to rcc_cnt 2024-09-14 10:05:00 +08:00
c9430ed953 ci(esp32c5,esp32c61): stop building c5 and c61 on 5.3 2024-09-13 19:39:29 +08:00
d02281a90c Merge branch 'bugfix/uart_example_stask_overflow_s3_v5.3' into 'release/v5.3'
fix(uart): increased stack size for the task in uart example (v5.3)

See merge request espressif/esp-idf!33519
2024-09-13 19:21:09 +08:00
2c621edab6 Merge branch 'bugfix/fixed_multi_conn_example_crash_issue_5.3' into 'release/v5.3'
fix(ble): fiexed the crash issue of examples/bluetooth/nimble/ble_multi_conn

See merge request espressif/esp-idf!33492
2024-09-13 19:18:02 +08:00
0c8074b318 feat(openthread): Replace netconn external resolve hook with dns external hook 2024-09-13 17:59:15 +08:00
4eac78f675 feat(lwip): Add DNS external hook in TCPIP context(v5.3) 2024-09-13 17:59:15 +08:00
5eb49bab26 fix(ringbuf): allow xRingbufferCreateWithCaps to pass in non-32-bit aligned size 2024-09-13 17:24:39 +08:00
1c9ff00e50 fix(uart/example): Fixed minimal stack size in uart_echo example 2024-09-13 17:16:20 +08:00
3ded6819f3 fix(uart/example): Fixed the stack size allocation in uart_echo_rs485 example 2024-09-13 17:15:54 +08:00
7bb93a2b1e Update rs485_example.c
Signed-off-by: aleks <aleks@espressif.com>
Merges https://github.com/espressif/esp-idf/pull/14382
2024-09-13 17:15:42 +08:00
d712ae83ee fix(uart): increased stack size for the task in uart_events example
The example cannot run successfully on ESP32S3 due to task stack overflow
Introduced in a4e6f57a40
2024-09-13 17:15:15 +08:00
df00c22439 Merge branch 'bugfix/fix_batch_of_i2c_issue_v5.3' into 'release/v5.3'
fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout...etc.4MR (backport v5.3)

See merge request espressif/esp-idf!33475
2024-09-13 15:49:39 +08:00
29c39f5164 test(sysview): fix gdb no response error in sysview_heap_log tests 2024-09-13 09:34:23 +03:00
a9fcf0d57a fix(clk): warn the users to avoid using RC32K clock 2024-09-13 11:44:51 +08:00
03f54fe5b0 fix(ble): fixed the nimble connection reattempt issue when the OPTIMIZE_MULTI_CONN is enabled 2024-09-13 11:23:21 +08:00
dfead07789 fix(ble): fiexed the crash issue of examples/bluetooth/nimble/ble_multi_conn 2024-09-12 20:53:20 +08:00
ce4e689be0 fix(system): fixed warnings related to ununsed var in spinlock.h 2024-09-12 08:34:44 +02:00
c72fec55dd Merge branch 'feature/efuse_update_v5.3' into 'release/v5.3'
feat(efuse): Updates efuse tables for p4 and c5 (v5.3)

See merge request espressif/esp-idf!33280
2024-09-12 13:39:21 +08:00
5589d8cbf4 Merge branch 'feat/flash_32bit_support_p4_v5.3' into 'release/v5.3'
feature(spi_flash): Add 32bit address support for esp32p4 eco1 (backport v5.3)

See merge request espressif/esp-idf!31262
2024-09-12 11:45:14 +08:00
403bd86a21 fix(i2c): Fix the wrong return value of esp32,esp32s2,esp32s3 2024-09-12 11:21:10 +08:00
7be3141195 fix(i2c): Fix the i2c sda/scl force out register value on some esp chips 2024-09-12 11:21:10 +08:00
189db78bec fix(i2c): Fix possible error state in clear the bus,
Closes https://github.com/espressif/esp-idf/issues/13647
2024-09-12 11:21:08 +08:00
deb91c7abe fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout set seems doesn't work
Closes https://github.com/espressif/esp-idf/issues/14129
Closes https://github.com/espressif/esp-idf/issues/14401
2024-09-12 11:20:46 +08:00
561f46d989 Merge branch 'docs/sync_psram_noinit_and_bss_description_v5.3' into 'release/v5.3'
docs(psram): sync psram noinit description (v5.3)

See merge request espressif/esp-idf!33462
2024-09-12 10:01:14 +08:00
230d0c7c5e Merge branch 'feat/parlio_tx_support_psram_buffer_v5.3' into 'release/v5.3'
feat(parlio_tx): support transmit buffer in external PSRAM (v5.3)

See merge request espressif/esp-idf!33357
2024-09-12 09:43:06 +08:00
3743d387a4 Merge branch 'feat/add_ext_adv_param_v5.3' into 'release/v5.3'
feat(nimble): Add support for ext adv param v2 HCI command (v5.3)

See merge request espressif/esp-idf!33409
2024-09-12 00:24:34 +08:00
b7cbf82c14 feat(efuse): Updates efuse table for esp32c5 2024-09-11 23:12:46 +08:00
ce822125e7 feat(efuse): Updates efuse table for esp32p4 2024-09-11 23:12:46 +08:00
bf34e2547d docs(psram): sync psram noinit description 2024-09-11 20:04:20 +08:00
8fb1a41da5 feat(nimble): Add support for ext adv param v2 HCI command 2024-09-11 15:58:38 +05:30
b63ac1ce9b Merge branch 'ci/stop_test_c5_v5.3' into 'release/v5.3'
ci(esp32c5): stop testing c5

See merge request espressif/esp-idf!32568
2024-09-11 17:40:02 +08:00
2bf5856f06 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(c66a703)
- Fixed missing sync established event after canceling sync
2024-09-11 17:12:12 +08:00
b3a29daa8c Merge branch 'bugfix/fix_wifi_bugs_240904_v5.3' into 'release/v5.3'
fix(wifi): fix wifi bugs 240904 v5.3(Backport v5.3)

See merge request espressif/esp-idf!33383
2024-09-11 16:36:07 +08:00
04741d258a Merge branch 'bugfix/eth_plus_wifi_doc_v5.3' into 'release/v5.3'
docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi (v5.3)

See merge request espressif/esp-idf!33245
2024-09-11 16:31:05 +08:00
bb85aaf10c Merge branch 'bugfix/exit_sniff_immed_enter_sniff_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fix the protocol stack to exit sniff mode(v5.3)

See merge request espressif/esp-idf!33397
2024-09-11 15:31:05 +08:00
7c0c3fa104 Merge branch 'bugfix/bidirectioanl_data_transfer_ble_spp_v5.3' into 'release/v5.3'
fix(nimble): Added support for bidirectional data trasfer (v5.3)

See merge request espressif/esp-idf!33412
2024-09-11 14:02:59 +08:00
4e4f23dde0 This is a combination of 2 commits.
docs: update startup.rst description for single-core chip support
2024-09-11 10:44:04 +08:00
bf487cc290 feat(parlio_tx): support psram buffer 2024-09-11 09:52:49 +08:00
8bf4b5bbc0 fix(parlio_tx): fix error in first transfer and 1 byte transfer
On p4, the clock was configured in the wrong order causing a dropped
count on the first transmission. And gdma eof event fails to trigger
parlio_tx eof event when transmitting single byte.
2024-09-11 09:52:49 +08:00
d98a0a0979 docs: Update zh_CN translation for MR32736 2024-09-10 13:45:59 +08:00
243b01eccc docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi 2024-09-10 13:45:59 +08:00
4d0db7045d Merge branch 'bugfix/fix_some_ble_bugs_240826_v5.3' into 'release/v5.3'
Fixed some BLE bugs 240826 on ESP32C3 (8ce789b) (v5.3)

See merge request espressif/esp-idf!33389
2024-09-10 11:37:42 +08:00
1245cb2a9a Merge branch 'feat/support_ble_scan_and_init_coex_on_esp32_v5.3' into 'release/v5.3'
Support BLE scanning and initiating coexist on ESP32 (v5.3)

See merge request espressif/esp-idf!33385
2024-09-10 11:37:21 +08:00
5a3c22dc2b feat(mbedtls): support rom mbedtls threading layer 2024-09-10 10:00:44 +08:00
9e618fffcb feat(mbedtls): select MBEDTLS_CMAC_C when MBEDTLS_USE_CRYPTO_ROM_IMPL enabled 2024-09-10 10:00:44 +08:00
2dea1035d9 Merge branch 'feature/p4_efuse_get_pkg_ver_v5.3' into 'release/v5.3'
feat(efuse): Updates esp_efuse_get_pkg_ver (v5.3)

See merge request espressif/esp-idf!32931
2024-09-10 10:00:10 +08:00
fb9a435952 feat(mbedtls): support ROM mbedtls v3.6.0 on C2 rev2.0(ECO4) 2024-09-10 09:47:39 +08:00
caca3c2bc3 feat(esp_rom): include rom.mbedtls.eco4.ld with C2 rev2.0(ECO4) select 2024-09-10 09:47:31 +08:00
0e80012fce feat(esp_rom): update esp32c2.rom.mbedtls.eco4.ld 2024-09-10 09:47:22 +08:00
4e41b73b04 feat(esp_hw_support): Support esp32c2 rev2.0 chip 2024-09-10 09:41:33 +08:00
c697efd32a Merge branch 'feat/newlib-add-sbom-exclude_cve-2024-30949' into 'release/v5.3'
fix(newlib): sbom: add CVE-2024-30949 to cve-exclude-list

See merge request espressif/esp-idf!33369
2024-09-10 07:34:33 +08:00
c6f9d1b4cd fix(nimble): Added support for bidirectional data trasfer 2024-09-09 18:41:06 +05:30
ab11ab7769 Merge branch 'bugfix/fix_some_esp32_host_issues_v5.3' into 'release/v5.3'
Bugfix/fix some esp32 host issues(Backport v5.3)

See merge request espressif/esp-idf!32681
2024-09-09 17:28:52 +08:00
37bdbf3693 Merge branch 'contrib/github_pr_14317_v5.3' into 'release/v5.3'
fix(mbedtls/port): fix codespell issues (GitHub PR) (v5.3)

See merge request espressif/esp-idf!33010
2024-09-09 15:47:37 +08:00
a9f47ffd5e fix(bt/bluedroid): Fix the protocol stack to exit sniff mode
- Already in result mode but request change indication has not been cleared
2024-09-09 15:30:39 +08:00
b4c956c801 fix(mbedtls/port): fix codespell issues
Fix a few comments codespell identified.
2024-09-09 14:09:19 +08:00
0c7e957636 Merge branch 'bugfix/psram_fallback_in_wifi_osi_v5.3' into 'release/v5.3'
fix(wifi): Add PSRAM failure fallback in WiFi Queue API's (backport v5.3)

See merge request espressif/esp-idf!33345
2024-09-09 14:08:48 +08:00
1feb703e73 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(8ce789b)
- Fixed BLE vendor HCI set scan perfer address command
- Support BLE vendor HCI get controller compile version command
- Fixed BLE util buffer free after controller reset
- Fixed assert when connection already exist and be connected again
2024-09-09 11:35:18 +08:00
4a3ca7f97f Merge branch 'feat/i80_lcd_esp32p4_v5.3' into 'release/v5.3'
Add i80 LCD support on ESP32P4 (v5.3)

See merge request espressif/esp-idf!33293
2024-09-09 11:33:30 +08:00
887cb5dffa Merge branch 'fix/clang_linker_fix_for_linux_target_v5.3' into 'release/v5.3'
fix(cmake): Fixed linker not supporting -warn_commons for linux target on MacOS (v5.3)

See merge request espressif/esp-idf!33052
2024-09-09 11:32:03 +08:00
5aa5090126 Merge branch 'mqtt_update_v5.3' into 'release/v5.3'
change(mqtt): Updte esp_mqtt submodule (v5.3)

See merge request espressif/esp-idf!32938
2024-09-09 11:30:41 +08:00
f8d64f1026 feat(bt): Update esp32 bt-lib(bc393dd)
- Fixed BLE vendor HCI set scan perfer address command
- Support BLE vendor HCI get controller compile version command
- Support BLE scanning and initiating coexist
2024-09-09 11:30:34 +08:00
591805b943 Merge branch 'test/fix_flaky_sched_time_test_v5.3' into 'release/v5.3'
test(freertos): Fixed flaky scheduling time test (v5.3)

See merge request espressif/esp-idf!32848
2024-09-09 11:29:57 +08:00
d6e9558a1c Merge branch 'contrib/github_pr_14329_v5.3' into 'release/v5.3'
fix(ulp): Add the missing extern "C" guard to ulp_lp_core_print.h (GitHub PR) (v5.3)

See merge request espressif/esp-idf!32833
2024-09-09 11:27:51 +08:00
b994115eee Merge branch 'change/support_pm_slp_iram_opt_in_normal_light_sleep_v5.3' into 'release/v5.3'
change(esp_pm): bypass cache access assertion when using ext0 or ext1(backport v5.3)

See merge request espressif/esp-idf!33142
2024-09-09 11:26:28 +08:00
5ee415a5f5 fix(wifi): fix wifi bugs 240904 v5.3 2024-09-09 11:14:09 +08:00
d4c9710569 ci(esp32c5): stop testing c5 2024-09-09 10:45:51 +08:00
0593e04dee Merge branch 'docs/optimized_ble_adv_data_type_v5.3' into 'release/v5.3'
docs(ble/bluedroid): Optimize BLE example for setting advertising data (v5.3)

See merge request espressif/esp-idf!32755
2024-09-09 10:35:05 +08:00
140873dfaa Merge branch 'bugfix/fix_ble_resolve_adv_data_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed memory out-of-bounds issue when parsing adv data (v5.3)

See merge request espressif/esp-idf!33023
2024-09-09 10:33:30 +08:00
cc505fe27d refactor(hub): Cleaned up dev_tree_node debug output, moved node freeing 2024-09-07 11:46:53 +02:00
b9edac01ae feat(ble/controller): Support get BLE controller free heap size 2024-09-07 12:26:37 +08:00
ca5db5aef0 docs(blufi): Optimize documentation for Blufi example 2024-09-07 12:25:30 +08:00
e4003fd98e fix(ble/bluedroid): Optimize BLE function 'esp_ble_resolve_adv_data_by_type' 2024-09-07 12:25:22 +08:00
af9ebecc1d fix(ble/bluedroid): Fixed memory out-of-bounds issue when parsing adv data 2024-09-07 12:25:10 +08:00
cef46b3cef Merge branch 'docs/remove_user_guide_for_esp32_pico_kit_related_migration_v5.3' into 'release/v5.3'
docs: remove user guide for esp32-pico-kit related docs after migration (v5.3)

See merge request espressif/esp-idf!32781
2024-09-06 22:05:58 +08:00
13ec7d2b24 fix(newlib): sbom: add CVE-2024-30949 to cve-exclude-list 2024-09-06 18:27:09 +07:00
d097cf38b3 docs: Remove User Guide for ESP32-Pico-Kit related docs after migration 2024-09-06 19:21:32 +08:00
50abf54d0f Merge branch 'bugfix/make_cccd_flags_configurable_v5.3' into 'release/v5.3'
fix(nimble): Make CCCD flags configurable (v5.3)

See merge request espressif/esp-idf!33233
2024-09-06 18:57:51 +08:00
c2691b94c8 refactor(ext_hub): Prerequisites for the Ext Port Driver 2024-09-06 10:53:13 +02:00
aa3adb747e fix(usb_host): The Enumeration Driver, cancellation on error 2024-09-06 10:53:01 +02:00
4ac395b1b7 Merge branch 'bugfix/fix_hid_cod_setting_v5.3' into 'release/v5.3'
Bugfix/fix hid cod setting[backport 5.3]

See merge request espressif/esp-idf!33337
2024-09-06 16:52:22 +08:00
23852bd449 docs(ext_hub): Added description for External Hub Driver 2024-09-06 10:29:50 +02:00
8c3a4fc1fe feat(ext_hub): Added External Hub driver 2024-09-06 10:29:02 +02:00
56c7b79253 fix(usb_host): Increased address map for clients and changed the uid member type 2024-09-06 10:27:42 +02:00
a9f8f2576a fix(enum): Returned usb_round_up_to_mps for control request of string descriptors 2024-09-06 10:27:42 +02:00
71708508d6 feat(hub): Added device tree nodes list and uid calculation logic 2024-09-06 10:27:42 +02:00
9eb4ea32fe fix(enum): Fixed STALL on descriptor request, removed unused value 2024-09-06 10:27:42 +02:00
a3b60ecf51 docs(enum): Added description for Enumeration process (Enum Driver) 2024-09-06 10:27:40 +02:00
e729453089 refactor(enum): Curved out Enumeration process from Hub Driver 2024-09-06 10:17:22 +02:00
231247b0f5 refactor(hub): Updated HUB api for ENUM driver 2024-09-06 10:17:22 +02:00
7fdc327cc1 refactor(usbh): Updated USBH api for ENUM driver 2024-09-06 10:17:22 +02:00
77475b4a9a Merge branch 'bugfix/add_notify_flag_for_wifi_prov_v5.3' into 'release/v5.3'
fix(wifi_prov): Add notify characteristic flag support (v5.3)

See merge request espressif/esp-idf!33183
2024-09-06 14:43:35 +08:00
f7b540934b Merge branch 'bugfix/dma2d_transacrion_config_lifecycle_v5.3' into 'release/v5.3'
fix(lcd): prolonged the lifecycle of dma2d transaction config structure (v5.3)

See merge request espressif/esp-idf!32837
2024-09-06 13:36:31 +08:00
1ebc4f4c8b fix(nimble): Make CCCD flags configurable 2024-09-06 10:53:01 +05:30
021233eed7 Merge branch 'refactor/use_gdma_link_list_in_parlio_tx_v5.3' into 'release/v5.3'
refactor(parlio_tx): use gdma link list driver to mount buffer (v5.3)

See merge request espressif/esp-idf!33334
2024-09-06 10:44:02 +08:00
bba6bd35f1 Merge branch 'docs/optimized_ble_gattc_multi_connect_example_v5.3' into 'release/v5.3'
docs(ble/bluedroid): Optimize BLE example documentation for getting characteristic (v5.3)

See merge request espressif/esp-idf!33194
2024-09-06 10:31:55 +08:00
dfbbbabfbc Merge branch 'bugfix/fix_ble_channel_map_update_v5.3' into 'release/v5.3'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(f583012) (v5.3)

See merge request espressif/esp-idf!32581
2024-09-06 10:31:52 +08:00
ddda4cc013 Merge branch 'contrib/github_pr_14276_v5.3' into 'release/v5.3'
fix(esp_eth): fix C++ invalid type conversion error (GitHub PR) (v5.3)

See merge request espressif/esp-idf!32787
2024-09-06 10:31:10 +08:00
9c8303a7fa Merge branch 'ci/disable_dangerjs_releasenote_check_v5.3' into 'release/v5.3'
change(ci): disable dangerjs checker for release notes (v5.3)

See merge request espressif/esp-idf!32773
2024-09-06 10:30:13 +08:00
93cce50b3c Merge branch 'feat/print_the_ble_mac_when_init_5.3' into 'release/v5.3'
feat(ble): Print out the BT mac when the controller is initialized

See merge request espressif/esp-idf!32730
2024-09-06 10:29:39 +08:00
f3dc731015 Merge branch 'fix/incorrect_critical_nesting_count_in_linux_port_v5.3' into 'release/v5.3'
fix(freertos): Fixed critical section macro in vTaskPlaceOnEventListRestricted() (v5.3)

See merge request espressif/esp-idf!32742
2024-09-06 10:29:14 +08:00
71eb08b702 fix(wifi): enable ci build by sdkconfig.ci.esp32p4_with_extconn 2024-09-06 10:03:35 +08:00
2d0f0cbbcc Merge branch 'bugfix/correct_per_adv_sync_enable_v5.3' into 'release/v5.3'
fix(nimble): Corrected parameters assignment in per_adv_transfer_enable (v5.3)

See merge request espressif/esp-idf!33269
2024-09-06 08:57:29 +08:00
2c2e1a030d fix(nimble): Corrected parameters assignment in per_adv_transfer_enable 2024-09-05 18:56:59 +05:30
64d8797756 Merge branch 'fix/change_bt_hci_log_to_nimble_nomenclature_v5.3' into 'release/v5.3'
fix(nimble): Added BT_HCI_LOG_INCLUDED macro into esp nimble configuration according to nimble nomenclature (v5.3)

See merge request espressif/esp-idf!32952
2024-09-05 21:14:05 +08:00
5a14b3caf9 Merge branch 'debug/fix_deep_sleep_wake_up_by_ble_v5.3' into 'release/v5.3'
fix(ble): fix BLE immediately  wakeup deep sleep (v5.3)

See merge request espressif/esp-idf!33095
2024-09-05 21:04:00 +08:00
2bfe84235d fix(nimble): Add notify characteristic flag support 2024-09-05 16:18:24 +05:30
b1f17b69b6 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20240821_v5.3' into 'release/v5.3'
feat(tools): update openocd version to v0.12.0-esp32-20240821 (v5.3)

See merge request espressif/esp-idf!33170
2024-09-05 18:18:16 +08:00
e74ca2811a Merge branch 'coredump_fixes_v5.3' into 'release/v5.3'
Coredump fixes v5.3

See merge request espressif/esp-idf!31104
2024-09-05 17:49:00 +08:00
cfbb9c0115 fix(wifi): Add PSRAM failure fallback in WiFi Queue API's 2024-09-05 14:38:00 +05:30
a55ca99677 fix(nimble): Added BT_HCI_LOG_INCLUDED macro according to nimble nomenclature 2024-09-05 12:12:28 +05:30
e7f99a1542 Merge branch 'docs/update_cn_ulp_lp_core_v5.3' into 'release/v5.3'
docs: Update the CN translation for ulp-lp-core.rst (v5.3)

See merge request espressif/esp-idf!32675
2024-09-05 14:41:37 +08:00
dd64098cab Merge branch 'docs/delete_user_guide_esp32s2_kaluga_1_kit_v5.3' into 'release/v5.3'
docs: Delete ESP32-S2-Kaluga-Kit related user guide files (v5.3)

See merge request espressif/esp-idf!32591
2024-09-05 14:41:22 +08:00
51515f2296 Merge branch 'bugfix/blesmp_getlist_bond_fail_v5.3' into 'release/v5.3'
fix(nimble): Fixed blesmp getbondlist issue (v5.3)

See merge request espressif/esp-idf!32822
2024-09-05 14:32:47 +08:00
d3b1b54f72 Merge branch 'bugfix/fix_esp32p4_sleep_psram_access_failure_v5.3' into 'release/v5.3'
fix(esp_hw_support): support esp32p4 psram sleep retention (v5.3)

See merge request espressif/esp-idf!32598
2024-09-05 13:46:07 +08:00
24c2c80d2d Merge branch 'fix/hfp_pcm_codec_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fix default codec type on PCM datapath for hfp_hf (backport v5.3)

See merge request espressif/esp-idf!33158
2024-09-05 13:45:24 +08:00
a82edc880f fix(esp_hid): Fixed protocol mode mapping bug
Closes https://github.com/espressif/esp-idf/issues/14232
2024-09-05 11:47:59 +08:00
e38b425011 feat(bt/bluedroid): Added definition of minor class of COD for peripheral major class
Closes https://github.com/espressif/esp-idf/issues/13622
2024-09-05 11:47:36 +08:00
4913f936af Merge branch 'docs/add_ble_feature_status_table_v5.3' into 'release/v5.3'
docs(ble): Added BLE feature support status (v5.3)

See merge request espressif/esp-idf!32922
2024-09-05 11:45:37 +08:00
b1f6f331dc Merge branch 'docs/add_nimble_get_started_v5.3' into 'release/v5.3'
feat(ble/example): Added NimBLE Get started examples (v5.3)

See merge request espressif/esp-idf!33028
2024-09-05 11:45:34 +08:00
1720dc7795 Merge branch 'bugfix/fix_some_ble_bugs_cjh_v5.3' into 'release/v5.3'
Fixed some BLE bugs 240812 (backport v5.3)

See merge request espressif/esp-idf!32792
2024-09-05 11:34:24 +08:00
cd1da85d06 Merge branch 'feat/esp_netif_dns_switch_v5.3' into 'release/v5.3'
[LWIP]: Update submodule to bced058f (multi DNS + PPP/mbedTLS) (v5.3)

See merge request espressif/esp-idf!32798
2024-09-05 10:48:09 +08:00
b0f330a59a Merge branch 'bugfix/heap_corrupt_in_bt_mem_release_on_esp32_v5.3' into 'release/v5.3'
fix(bt): Fix heap corruption in the call of esp_bt_mem_release on ESP32 (v5.3)

See merge request espressif/esp-idf!32801
2024-09-05 10:45:09 +08:00
cbc95947e8 Merge branch 'docs/fix_typo_adc_oneshot_v5.3' into 'release/v5.3'
docs: fix a typo in adc_oneshot (v5.3)

See merge request espressif/esp-idf!33006
2024-09-05 10:42:28 +08:00
d77148bb33 Merge branch 'bugfix/i2s_dma_buf_saturation_on_p4_v5.3' into 'release/v5.3'
fix(i2s): fixed alignment of max DMA buffer length on P4 (v5.3)

See merge request espressif/esp-idf!33221
2024-09-05 10:41:50 +08:00
412f1f5991 Merge branch 'feat/usb_ls_p4_backport_v5.3' into 'release/v5.3'
Fix USB Low-Speed devices on ESP32-P4 backport v5.3

See merge request espressif/esp-idf!33268
2024-09-05 10:41:16 +08:00
26b2e3db8a Merge branch 'docs/usb_docs_p4_backport_v5.3' into 'release/v5.3'
usb_host: P4 Docs and DMA fix backport to v5.3

See merge request espressif/esp-idf!33075
2024-09-05 10:40:53 +08:00
8ef2bd2582 fix(nimble): Fixed blesmp getbondlist issue 2024-09-05 08:09:48 +05:30
897e889f7b refactor(parlio_tx): use gdma link list driver to mount buffer 2024-09-05 10:37:53 +08:00
3af62b6e48 fix(bt/bluedroid): Fix default codec type on PCM datapath for hfp_hf 2024-09-05 10:37:46 +08:00
10bba8feda Merge branch 'feat/add_ble_link_estab_event_v5.3' into 'release/v5.3'
feat(nimble): BLE_GAP_EVENT_LINK_ESTAB event to ensure link established

See merge request espressif/esp-idf!33332
2024-09-05 10:37:08 +08:00
daec3b39e4 Merge branch 'docs/delete_not_available_p4_documents_v5.3' into 'release/v5.3'
docs: delete unavailable document links for ESP32-P4 (v5.3)

See merge request espressif/esp-idf!33151
2024-09-05 10:36:13 +08:00
038a86fc5f Merge branch 'task/add_ldgen_exception_for_freertos_v5.3' into 'release/v5.3'
fix(freertos): Added freertos and ringbuf fragments to the exception list of ldgen mapping checks (v5.3)

See merge request espressif/esp-idf!33215
2024-09-05 10:35:36 +08:00
8afaec46c4 Merge branch 'bugfix/fixed_assert_on_esp32c2_v5.3' into 'release/v5.3'
fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2 (v5.3)

See merge request espressif/esp-idf!33205
2024-09-05 10:21:21 +08:00
992bf3f078 feat(ble): add internal api to change ble slow clock source 2024-09-05 10:17:20 +08:00
420f3ac086 fix(ble): remove ble wakeup before entering light sleep 2024-09-05 10:17:20 +08:00
ade6f459cd fix(ble): Increased the length of addr_str in ble_get_started nimble examples 2024-09-05 10:09:45 +08:00
20e360e68e fix(ble): Removed unsupported sdkconfig 2024-09-05 10:09:45 +08:00
3bb1e9be45 docs(ble): Replace advertising interval hex value with BLE_GAP_ADV_ITVL_MS 2024-09-05 10:09:45 +08:00
ad345aaf60 docs(ble): Improved as Weilong and Shenhang requested 2024-09-05 10:09:45 +08:00
9c0976d89e docs(ble): Added BLE Get Started 2024-09-05 10:09:45 +08:00
990a84add7 Merge branch 'bugfix/fixed_c6_c2_issues_master_v5.3' into 'release/v5.3'
Bugfix/fixed c6 c2 issues master (v5.3)

See merge request espressif/esp-idf!33064
2024-09-05 10:09:00 +08:00
4e7a7b60c1 fix(ci): update iperf build ci condition
Co-authored-by: Chen Yu Dong <chenyudong@espressif.com>
2024-09-05 09:57:08 +08:00
1c2b9e8903 fix(wifi): enable p4 and esp8689 build iperf in ci 2024-09-05 09:57:08 +08:00
7d7e5059bb fix(wifi): support esp32_host ext_connect in iper 2024-09-05 09:56:56 +08:00
821c94ddd5 fix(wifi_host): support esp32p4 host get mac addr from target 2024-09-05 09:56:56 +08:00
1189ac4bcd fix(iperf): add esp_extconn idf component ymy 2024-09-05 09:56:45 +08:00
19c8c15d2d Merge branch 'bugfix/fix_wrong_typecast_spp_v5.3' into 'release/v5.3'
fix(wifi): Fix wrong typecasting of sta_info while getting SPP Caps (Backport v5.3)

See merge request espressif/esp-idf!33121
2024-09-04 23:11:20 +08:00
bbc5658f6b feat(nimble): BLE_GAP_EVENT_LINK_ESTAB event to ensure link established 2024-09-04 20:07:50 +05:30
7506432083 Merge branch 'feat/allow_connect_during_scan_v5.3' into 'release/v5.3'
feat(nimble): Add support to allow connection during scanning (v5.3)

See merge request espressif/esp-idf!32821
2024-09-04 22:29:07 +08:00
f0e7941994 Merge branch 'support_psram_noinit_segment_on_s3_v5.3' into 'release/v5.3'
feat(psram): add psram noinit  segment support on s2/s3/p4/c5 and bss segment on c5 (v5.3)

See merge request espressif/esp-idf!33256
2024-09-04 18:24:02 +08:00
f4eef0a5fb fix(bt): Fix heap corruption in the call of esp_bt_mem_release on ESP32
Closes https://github.com/espressif/esp-idf/issues/14263
2024-09-04 18:00:28 +08:00
3de27ba7b2 change(bt): Perform comprehensive heap check in test_app for memory release 2024-09-04 18:00:28 +08:00
2934986c0d Merge branch 'docs/delete_user_guides_three_esp32_dev_boards_v5.3' into 'release/v5.3'
docs: delete user guides of ESP32-DevKitC, ESP-WROVER-KIT and ESP32-PICO-DevKitM-2 (v5.3)

See merge request espressif/esp-idf!32748
2024-09-04 17:59:09 +08:00
0d1227c06f Merge branch 'doc/update_esp32p4_pm_programming_guide_docs_v5.3' into 'release/v5.3'
docs(pm): update power management related docs for esp32p4 (v5.3)

See merge request espressif/esp-idf!32629
2024-09-04 17:58:13 +08:00
2d850169c0 Merge branch 'feature/ble_example_pytest_v5.3' into 'release/v5.3'
add pytest for classic bt example(backport v5.3)

See merge request espressif/esp-idf!32541
2024-09-04 17:57:37 +08:00
384b569ca4 Merge branch 'docs/remove_user_guide_for_esp32_ethernet_migration_v5.3' into 'release/v5.3'
docs: remove user guide for esp32-ethernet-kit migration (v5.3)

See merge request espressif/esp-idf!32580
2024-09-04 17:57:11 +08:00
92e4100df1 feat(nimble): Add support to allow connection during scanning 2024-09-04 14:27:04 +05:30
21d430cf28 fix(esp_hw_support): always writeback L1D$ before sleep to keep cpu/regdma data consistency 2024-09-04 16:42:54 +08:00
e38462456c change(esp_hw_support): add case to test PSRAM survives after lightsleep 2024-09-04 16:42:54 +08:00
6e307d5408 change(esp_hw_support): reorder light/deep sleep test cases and wrapper with corresponding support macros 2024-09-04 16:42:50 +08:00
2c68d03182 feat(esp_hw_support): support esp32p4 psram retention 2024-09-04 16:41:35 +08:00
4fff077599 fix(esp_hw_support): flash/psram SPI io is not controlled by hp iomux on esp32p4 2024-09-04 16:41:34 +08:00
7cc55a0e0b fix(esp_hw_support): fix bad power parameter if PSRAM is enabled during sleep 2024-09-04 16:41:34 +08:00
4af7646927 Merge branch 'bugfix/mdio_default_p4_v5.3' into 'release/v5.3'
fix(esp_eth): fixed default GPIO to match new ver. of P4 devboard (v5.3)

See merge request espressif/esp-idf!32777
2024-09-04 16:30:13 +08:00
1da3d68f7e Merge branch 'fix/docs_nvs_encryption_update_v5.3' into 'release/v5.3'
docs(nvs_encryption): Updated the docs of nvs_encryption (v5.3)

See merge request espressif/esp-idf!32909
2024-09-04 16:25:18 +08:00
30d5bd0bdc Merge branch 'backport/nimble_support_cte_release_5_3' into 'release/v5.3'
Backport Bluetooth LE 5.1 direction finding host support (Backport v5.3)

See merge request espressif/esp-idf!33222
2024-09-04 15:45:07 +08:00
zlq
1f68af2720 fix(ext_32k): fix the external 32K issue on C3&S3 (v5.3) 2024-09-04 15:06:40 +08:00
1726cb266d Merge branch 'change/update-kconfcheck-pre-commit_v5.3' into 'release/v5.3'
ci(pre-commit): bump kconfig checker pre-commit version to 2.3.0 (v5.3)

See merge request espressif/esp-idf!32776
2024-09-04 15:05:30 +08:00
aaeb1fcbcb Merge branch 'docs/remove_output_format' into 'release/v5.3'
docs(size): remove -DOUTPUT_FORMAT output format option for idf.py size

See merge request espressif/esp-idf!33019
2024-09-04 15:04:44 +08:00
e100e4c699 docs(ble): Updated the support status for some NimBLE features 2024-09-04 14:47:55 +08:00
2991384f30 docs(ble): Updated support status of LE Isochronous Channels 2024-09-04 14:47:55 +08:00
afa2161067 docs(ble): Replaced Classic Bluetooth with Bluetooth Classic in classic_bt.rst 2024-09-04 14:47:55 +08:00
f7606657a7 docs(ble): Added BLE feature support status to API Guides 2024-09-04 14:47:55 +08:00
607a689b39 fix(wifi): Fix wrong typecasting of sta_info while getting SPP Caps 2024-09-04 14:44:06 +08:00
5e403bb7c6 docs(pm): update power management related docs for esp32p4 2024-09-04 14:13:19 +08:00
90f1111868 Merge branch 'contrib/github_pr_14286_v5.3' into 'release/v5.3'
fix(bt): Add a parameter in the two least significant bits of Class of Device (backport v5.3)

See merge request espressif/esp-idf!33164
2024-09-04 14:01:00 +08:00
59380fef68 Merge branch 'bugfix/fix_wifi_example_itwt_build_fail_issue_v5.3' into 'release/v5.3'
fix(wifi): fix wifi example itwt build fail issue(Backport v5.3)

See merge request espressif/esp-idf!33108
2024-09-04 13:59:29 +08:00
6bca576f99 Merge branch 'bugfix/ldgen_file_single_entry_v5.3' into 'release/v5.3'
fix(ldgen): fix linker script generation from a single-entry fragment file (backport v5.3)

See merge request espressif/esp-idf!33099
2024-09-04 13:58:25 +08:00
246e973232 Merge branch 'bugfix/fix_hidh_integrity_check_bug_v5.3' into 'release/v5.3'
fix(esp_hid): Loose the check of input report length to be more compatible[backport 5.3]

See merge request espressif/esp-idf!32720
2024-09-04 13:54:41 +08:00
1054460446 Merge branch 'bugfix/fix_mesh_ie_issue_from_leaf_to_root_v5.3' into 'release/v5.3'
fix(wifi/mesh): clear the rootless state in mesh ie when changing from leaf to root (v5.3)

See merge request espressif/esp-idf!32560
2024-09-04 13:47:06 +08:00
ed06d008f4 Merge branch 'fix/fix_p4_apb_clk_calc' into 'release/v5.3'
fix(esp_pm): Fix APB clock calculation for chips w/o modem (v5.3)

See merge request espressif/esp-idf!32753
2024-09-04 13:45:26 +08:00
3afe962817 Merge branch 'fix/disable_timer_wakeup_source_with_auto_sleep_off_v5.3' into 'release/v5.3'
fix(esp_pm): disable timer wakeup source with auto light-sleep off (v5.3)

See merge request espressif/esp-idf!32618
2024-09-04 13:45:06 +08:00
212973cca3 Merge branch 'refactor/gptimer_sleep_retention_v5.3' into 'release/v5.3'
Fix gptimer auto reload configuration being overwritten by regdma (v5.3)

See merge request espressif/esp-idf!32729
2024-09-04 12:08:05 +08:00
42a5118974 feat: Add support for BLE 5.1 Direction Finding feature 2024-09-04 09:38:00 +05:30
be33558164 feat: Add direction finding relate defines and kconfig and CMakeLists 2024-09-04 09:38:00 +05:30
3ea09ae6c2 Merge branch 'feat/set_data_length_enhancement_v5.3' into 'release/v5.3'
feat(nimble): Add extra handling for set data len packet event (v5.3)

See merge request espressif/esp-idf!32622
2024-09-04 12:05:31 +08:00
a034b21a9e Merge branch 'bugfix/add_bluedroid_support_for_esp_ip_v5.3' into 'release/v5.3'
fix(wifi_prov): Add support for ESP IP controller chips in bluedroid (v5.3)

See merge request espressif/esp-idf!33177
2024-09-04 12:02:33 +08:00
a6df4152ac Merge branch 'bugfix/handle_linked_om_blufi_v5.3' into 'release/v5.3'
fix(nimble) Added change to handle linked om data at blufi layer (v5.3)

See merge request espressif/esp-idf!31974
2024-09-04 12:00:09 +08:00
e072a83a43 Merge branch 'bugfix/fix_proxy_example_assert_v5.3' into 'release/v5.3'
fix(nimble): Fixed assert issue in proximity_sensor example (v5.3)

See merge request espressif/esp-idf!32626
2024-09-04 11:57:08 +08:00
b278fb8f63 Merge branch 'bugfix/linux_target_mac_v5.3' into 'release/v5.3'
fix(linux): fixed build errors on MacOS (v5.3)

See merge request espressif/esp-idf!32919
2024-09-04 11:44:25 +08:00
07f531e984 Merge branch 'bugfix/usleep_overflow_v5.3' into 'release/v5.3'
fix(newlib): fixed potential overflow in usleep (v5.3)

See merge request espressif/esp-idf!33001
2024-09-04 11:44:21 +08:00
c593bef24e change(lcd): simplify the i80 lcd example
removed the lcd touch panel initialization code.

For those touch panel driver usage, please check the esp_bsp repo.
2024-09-04 11:39:55 +08:00
03df9a2df2 feat(lcd): support i80 lcd driver on esp32p4 2024-09-04 11:39:55 +08:00
14f723244c Merge branch 'contrib/github_pr_14310_v5.3' into 'release/v5.3'
fix(gptimer): remove incorrect param from example (GitHub PR) (v5.3)

See merge request espressif/esp-idf!32684
2024-09-04 11:32:05 +08:00
a9aa97391d Merge branch 'fix/mmu_multicore_app_bl_v5.3' into 'release/v5.3'
fix(MMU): fixed mmap deadlock when using multicore app with unicore bootloader (v5.3)

See merge request espressif/esp-idf!32889
2024-09-04 11:31:41 +08:00
a3f1ec060c Merge branch 'fix/adc_channel_num_caps_v5.3' into 'release/v5.3'
fix(adc): Corrected the ADC channel number caps for esp32p4 (v5.3)

See merge request espressif/esp-idf!33239
2024-09-04 11:30:22 +08:00
29b43f3f1a Merge branch 'feat/ldo_channel_reserve_v5.3' into 'release/v5.3'
feat(ldo): reserve the LDO1 and LDO2 (v5.3)

See merge request espressif/esp-idf!32836
2024-09-04 11:28:28 +08:00
fe169a2f48 Merge branch 'feat/add_ek79007_mipi_dsi_v5.3' into 'release/v5.3'
feat(lcd): adapt the mipi_dsi example for the EK79007 LCD IC (v5.3)

See merge request espressif/esp-idf!33242
2024-09-04 11:27:55 +08:00
cea789defd Merge branch 'fix/fix_p4_sdspi_v5.3' into 'release/v5.3'
sdspi: fix p4 sdspi (v5.3)

See merge request espressif/esp-idf!33189
2024-09-04 11:27:52 +08:00
4c3f6efbd7 fix(pm): cancel cache_safe_assertion when using ext0 & ext1 2024-09-04 11:27:26 +08:00
20975fb1e6 Merge branch 'fix/fix_c5_p4_c6_cache_disable_with_brc_predict_issue_v5.3' into 'release/v5.3'
cache: fixed double exception after cache disabled caused by branch predictor (v5.3)

See merge request espressif/esp-idf!32886
2024-09-04 11:23:33 +08:00
6ce2eabc4e Merge branch 'fix/pr_14288_v5.3' into 'release/v5.3'
sdspi: add dma_aligned_buffer and pwr_ctrl_handle fields (pr_14288) (v5.3)

See merge request espressif/esp-idf!32608
2024-09-04 11:23:16 +08:00
278ccec584 Merge branch 'feat/gdma_descriptor_driver_v5.3' into 'release/v5.3'
feat(gdma): add GDMA link list driver (v5.3)

See merge request espressif/esp-idf!33012
2024-09-04 11:21:15 +08:00
8016f0dcb8 Merge branch 'docs/fix_a_typo_v5.3' into 'release/v5.3'
docs: Fix a small typo in adc_calibration.rst (v5.3)

See merge request espressif/esp-idf!32715
2024-09-04 11:19:25 +08:00
cc3203dc4f Merge branch 'update/version_5_3_1' into 'release/v5.3'
Update version to 5.3.1

See merge request espressif/esp-idf!33262
2024-09-03 20:36:46 +08:00
9e3fca8d71 feat(psram): add psram noinit segment support on S2/S3/P4/C5
Closes https://github.com/espressif/esp-idf/issues/14253
2024-09-03 15:39:54 +08:00
8e27a0fb25 refactor(usb/host): Move P4 HS PHY function to correct LL file
Moved usb_wrap_ll_enable_precise_detection() in usb_wrap_ll.h
to usb_utmi_ll_enable_precise_detection() in usb_utmi_ll.h

Fixes commit 97d30e7c48
2024-09-03 08:11:15 +02:00
3f1d59d6bb fix(usb/host): Fix USB Low Speed devices connection on P4
P4 USB UTMI PHY was updated to specification v2.0
2024-09-03 08:11:07 +02:00
c8fc5f643b change(version): Update version to 5.3.1 2024-09-03 09:37:24 +08:00
87c9fb8d40 Merge branch 'fix/flash_encryption_for_esp32p4_v5.3' into 'release/v5.3'
fix(security): Fixed flash encryption for esp32p4 (v5.3)

See merge request espressif/esp-idf!33140
2024-09-02 19:46:31 +08:00
aa754d40b8 fix(security): Fixed flash encryption for esp32p4
The flash encryption on esp32p4 was broken due to code related
    to key manager not being executed when key manager support was
    disabled on esp32p4 target.
    This commit fixes that behaviour
    Additionally, the atomic env enablement for
    key_mgr_ll_enable_peripheral_clock was fixed.
2024-09-02 13:28:30 +05:30
64bfd8c24d feat(lcd): support EK79007 LCD in the mipi dsi example 2024-09-02 15:48:44 +08:00
e7b582d472 fix(adc): Corrected the ADC channel number caps for esp32p4
This commit fixes the incorrect soc_caps for the ADC channel numbers on
the esp32p4.
2024-09-02 08:41:22 +02:00
c518c281dd change(i2s): add warning for inaccurate sample rate 2024-08-30 15:56:28 +08:00
5bca458dbc fix(i2s): fixed alignment of max DMA buffer length on P4
Closes https://github.com/espressif/esp-idf/issues/14448
2024-08-30 15:56:25 +08:00
c3a79c301d test(freertos): Added build test for function in flash with -Os optimation
This commit adds a build test for when FreeRTOS and esp_ringbuf functions
are placed in flash and the compiler optimizes for code size.
2024-08-30 09:15:15 +02:00
99b18665a4 fix(freertos): Added freertos fragments to the exception list of ldgen mapping checks
This commit adds freertos and esp_ringbuf linker fragment sections
to the exception list of the ldgen mappings checker script.
2024-08-30 09:15:15 +02:00
zwl
a5f0f83c05 fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2 2024-08-30 12:02:53 +08:00
fa13b31dca ci(sdspi): clean up newlib memory, reset between tests
Two changes to make the tests less susceptible to random failures:
- Free up newlib memory to not have false-positive memory leaks due to
  lazy allocations in reent structure
- Reset between tests, so that one failing test doesn't cause
  subsequent tests to fail

Both changes are already applied to esp_driver_sdmmc test app.
2024-08-30 11:54:29 +08:00
db389c7a55 ci(sdspi): re-enable probe/rw tests for slot 1
These tests were disabled since SDMMC_FREQ_HIGHSPEED with sdspi didn't
work on ESP32 and ESP32-S3. However we don't have other tests for
slot 1, meaning that we weren't running probe and perf tests at all.

This commit re-enables the tests, keeping them with SDMMC_FREQ_DEFAULT
2024-08-30 11:53:40 +08:00
a89f1fcfaf fix(sdspi): fix memory leak in do_one_sdspi_probe test 2024-08-30 11:53:14 +08:00
4922c67780 fix(sdspi): fixed sdspi on p4, s3 2024-08-30 11:50:45 +08:00
8c632f4560 fix(wifi_prov): Add support for ESP IP controller chips in bluedroid 2024-08-29 15:05:00 +05:30
01f46017d9 docs(ble/bluedroid): Optimize documentation for BLE connection parameter updates 2024-08-29 16:38:17 +08:00
d02df53fd8 feat(ble/bluedroid): Support getting BLE address type in bond list 2024-08-29 16:37:15 +08:00
dc428a3854 docs(ble/bluedroid): Optimize BLE example documentation for getting characteristic 2024-08-29 16:17:39 +08:00
c100af18e6 fix(bt/bluedroid): Resolve warning: unused variable 'pp' 2024-08-29 16:17:39 +08:00
fdbdeaaae2 fix(driver_spi): fix p4 cache auto writeback during spi(dma) rx 2024-08-29 14:18:12 +08:00
2c46030bbf Merge branch 'fix/fix_wrong_ap3204_id_check_v5.3' into 'release/v5.3'
fix(psram): fixed ap3204 id check (v5.3)

See merge request espressif/esp-idf!33109
2024-08-29 11:02:09 +08:00
6adb58833f feat(tools): update openocd version to v0.12.0-esp32-20240821 2024-08-28 13:18:15 +03:00
020276b94a fix(bt): Add a parameter in the two least significant bits of Class of Device 2024-08-28 16:46:31 +08:00
4d8825dfa6 fix(bt): Enable use of RESERVED bits in COD (GitHub PR) 2024-08-28 16:46:21 +08:00
2bb7b51449 docs: delete unavailable document links for ESP32-P4 2024-08-28 15:57:42 +08:00
45990692d1 change(pm): change dependence of pm_slp_iram_opt 2024-08-28 14:22:18 +08:00
6724cd9ec6 refactor(bootloader): lower down the log level to reduce the bootloader size 2024-08-28 12:12:06 +08:00
1ece052ce3 feat(bootloader): support to check efuse block revision
change(bootloader): remove ignore efuse check flag (temp)

change(bootloader): use int for the minimum efuse blk rev (temp)
2024-08-28 12:12:00 +08:00
9e5570e77c docs(chip_revision): update eFuse block revision info 2024-08-28 12:00:22 +08:00
e9df36a2df fix(esp_eth): fix C++ invalid type conversion error
Closes https://github.com/espressif/esp-idf/issues/14265
2024-08-27 20:02:07 +08:00
475825c436 fix(psram): fixed ap3204 id check 2024-08-27 15:50:08 +08:00
c7c0fefd13 fix(wifi): fix wifi example itwt build fail issue 2024-08-27 15:48:20 +08:00
99b30023f8 fix(ldgen): fix linker script generation from a single-entry fragment file 2024-08-27 11:41:07 +08:00
c986991d90 fix(esp_hid): Loose the check of input report length to be more compatible
Closes https://github.com/espressif/esp-idf/issues/14259
2024-08-27 10:14:31 +08:00
d72b765404 fix(coredump): fix buffer overflow inside esp_core_dump_get_summary
Closes https://github.com/espressif/esp-idf/issues/13754
2024-08-26 12:17:25 +03:00
8dd40eeeda ci(panic): add flash encrypted coredump tests 2024-08-26 12:17:18 +03:00
3767ec04ae fix(cmake): Fixed linker not supporting -warn_commons for linux target on MacOS
This commit updates the ld linker flags to conditionally include the
-warn_commons flag when the linux target is built on MacOS. This is
because, not all versions of ld support the -warn_commons option.

Closes https://github.com/espressif/esp-idf/issues/13185
2024-08-26 09:53:24 +02:00
d36469fa59 docs(usb/host): Update USB host docs for ESP32-P4 2024-08-26 08:40:48 +02:00
e94176c44e docs(usb/device): Update USB device docs for ESP32-P4 2024-08-26 08:40:19 +02:00
8f38d943b6 docs(usb/host): Update maintainer docs for ESP32-P4 2024-08-26 08:36:06 +02:00
8f7dcc1eab fix(usb/host): Use new cache aligned DMA alloc functions 2024-08-26 08:32:16 +02:00
023aadac0f fix(bt/bluedroid): Fixed work queue delete when create thread failed 2024-08-26 12:13:33 +08:00
cbefea95e4 feat(bt/bluedroid): Report HCI error code to app when command fails 2024-08-26 12:12:43 +08:00
f199eeee90 fix(bt/bluedroid): Fixed BLE create conn cancel when conn already exist 2024-08-26 12:12:43 +08:00
7096ac8c29 feat(bt/bluedroid): Add print and assert when failed to alloc memory 2024-08-26 12:12:43 +08:00
zwl
bd8e4e8cd1 fix(ble): fixed ble controller issues on ESP32-H2 2024-08-24 14:34:08 +08:00
zwl
8a4b12a7a7 fix(ble): fixed ble controller issues on ESP32-C6 2024-08-24 14:34:04 +08:00
zwl
4768c57ad2 fix(ble): fixed ble controller issues on ESP32-C2 2024-08-24 13:57:27 +08:00
d645030210 fix(esp_netif): Correct spelling erros 2024-08-23 12:57:52 +02:00
a84d136002 fix(lwip): Fixed incorrect handling of 0.0.0.0 in dns (v5.3)
LWIP submodule update: git log --oneline e8d05138..bced058f
  - dns: Fixed incorrect handling of 0.0.0.0
    (espressif/esp-lwip@bced058f)
2024-08-23 11:38:03 +02:00
fec0c43edd fix(esp_netif): Remove unused leftover pppapi_set_auth() call 2024-08-23 11:37:33 +02:00
1237b8c669 feat(lwip): Add support for PPP Auth using mbedTLS (v5.3)
LWIP submodule update (v5.3): git log --oneline 3a3d1fb3..e8d05138
  - PPP/Auth: Add mbedtls includes if lwip uses it
    (espressif/esp-lwip@e8d05138)

Closes https://github.com/espressif/esp-idf/issues/13597
2024-08-23 11:37:09 +02:00
d716e64138 fix(esp_netif): Add unit test of getter/setter API for DNS servers 2024-08-23 11:36:03 +02:00
cf65f557cc fix(esp_netif): Restore DNS servers per netif when setting it default(5.3)
Introducing config option `CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF`
to overcome LWIP limitation of using global DNS server info.
This config option enables LWIP callbacks to collect per netif DNS
server info and then restores global DNS servers of whichever network
interface is selected as default.

LWIP submodule update v5.3: git log --oneline f1746813..3a3d1fb3
  - dns: Allow storing dnsserver per netif (espressif/esp-lwip@3a3d1fb3)
  - api_msg: Fix unused local variable if LWIP_NETCONN_SEM_PER_THREAD=1
    (espressif/esp-lwip@aa4f6e78)
  - lwip: fix gcc -fanalyzer warnings (espressif/esp-lwip@4297782b)
2024-08-23 11:35:36 +02:00
0f08a5b123 feat(lwip): Added multiple dns ip support (v5.3)
LWIP submodule update on v5.3: git log --oneline f7922143..f1746813
  - feat(lwip): Added multiple dns ip support
    (espressif/esp-lwip@f1746813)
  - api_msg: Fix crash to fail-safe error if cannot get semaphore
    (espressif/esp-lwip@a1bd9e44)
2024-08-23 11:33:44 +02:00
6f97a18e44 docs(size): remove -DOUTPUT_FORMAT output format option for idf.py size
Setting OUTPUT_FORMAT through the CMake variable probably never
functioned and seems to be a remnant (possibly a typo in the
documentation) from the time when the -DOUTPUT_JSON=1 CMake variable was
used to specify the JSON output format, prior to the introduction of the
--format option. This removes the note regarding the option to choose
the output format using -DOUTPUT_FORMAT.

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

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-08-22 13:04:47 +02:00
80bc9a3845 refactor(i80): use the gdma link list driver 2024-08-22 15:47:46 +08:00
473e7268fd feat(gdma): add GDMA link list driver 2024-08-22 15:47:46 +08:00
234a1371b1 docs: fix a typo in adc_oneshot 2024-08-22 10:18:59 +08:00
d777b8e72a fix(newlib): fixed potential overflow in usleep
If trying to usleep for 0xFFFF FFFF us the calculation of delay ticks would overflow
resulting in the system not sleeping at all.

Closes https://github.com/espressif/esp-idf/issues/14390
2024-08-22 09:55:58 +08:00
0bbd728196 Merge branch 'bugfix/fix_clkn_lost_after_modem_sleep_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed bluetooth disconnect issue after modem sleep on ESP32 (Backport v5.3)

See merge request espressif/esp-idf!32963
2024-08-21 23:20:44 +08:00
cd3c60e8c3 fix(example): Fixed updating recv addr for invalid packets for ping
Closes https://github.com/espressif/esp-idf/issues/14197
2024-08-21 20:37:56 +10:00
13326df918 fix(bt/controller): Fixed bluetooth disconnect issue after modem sleep on ESP32 2024-08-21 17:55:52 +08:00
5703d60420 fix(bt): Update bt lib for ESP32(241c96c)
- Fixed BLE vendor HCI get controller status command
2024-08-21 17:54:20 +08:00
808950a25a Merge branch 'fix/hfp_pcm_api_set_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Add PCM configuration about pcm frame sync signal shape (backport v5.3)

See merge request espressif/esp-idf!32483
2024-08-21 17:27:14 +08:00
aad4a5591f Merge branch 'bugfix/fixed_c2_blufi_issue_when_use_only_4.2_adv_v5.3' into 'release/v5.3'
fix(ble): fixed blufi issue on ESP32-C2 (v5.3)

See merge request espressif/esp-idf!32942
2024-08-21 10:46:59 +08:00
bf228ffbda fix(ci): disable ci test when target is not support classic bluetooth 2024-08-20 19:22:30 +08:00
2e95ecfbc5 fix(bt): remove redundant space in hid example path 2024-08-20 19:22:20 +08:00
124c7192b8 docs: delete user guides of ESP32-DevKitC, ESP-WROVER-KIT and ESP32-PICO-DevKitM-2 2024-08-20 14:48:43 +08:00
zwl
6c507056f3 fix(ble): fixed blufi issue on ESP32-C2 2024-08-19 21:48:12 +08:00
1fc04a0321 change(mqtt): Update esp_mqtt submodule
git log --oneline aa6f889fb4f6f743b3a550aa587713aabbdca1fc..cac1552e62b0474c162547b7cce345d7cd1aecfe

Detailed description of the changes:
* fix: clang analyzer unknown pragma warning
  - See merge request espressif/esp-mqtt!215
  - See commit https://github.com/espressif/esp-mqtt/commit/6bb5a5b
* fix: gcc analyzer unknown pragma warning
  - See merge request espressif/esp-mqtt!214
  - See commit https://github.com/espressif/esp-mqtt/commit/b527203
* feat: Moves deletion of expired messages to run at all states
  - Closes IDFGH-12831
  - Closes https://github.com/espressif/esp-mqtt/issues/278
  - See commit https://github.com/espressif/esp-mqtt/commit/32dada4
* fix: Handling of state in the outbox for enqueued QoS 0 messages
  - Closes IDFGH-12829
  - Closes https://github.com/espressif/esp-mqtt/issues/276
  - See commit https://github.com/espressif/esp-mqtt/commit/739cb2d
* fix: Instalation of gcovr in host tests was broken
  - See merge request espressif/esp-mqtt!211
  - See commit https://github.com/espressif/esp-mqtt/commit/6643c49
* Allow to publish using only topic alias on MQTT5
  - Closes IDFGH-12735
  - Fix: Allow to publish using only topic alias on MQTT5 (espressif/esp-mqtt@0071aca)
* refactor: replaced heap mock with Linux-compatible heap component
  - See merge request espressif/esp-mqtt!208
  - See commit https://github.com/espressif/esp-mqtt/commit/8b0b43e
* fix: gcc -fanalyzer warnings
  - See merge request espressif/esp-mqtt!209
  - See commit https://github.com/espressif/esp-mqtt/commit/8bc3bff
* fix: Use catch from component manager
  - See merge request espressif/esp-mqtt!210
  - See commit https://github.com/espressif/esp-mqtt/commit/53e0cc7
* fix: Fix host test for github ci.
  - Closes IDF-8883
  - See commit https://github.com/espressif/esp-mqtt/commit/b43d93c
2024-08-19 15:20:23 +02:00
0b72099bb9 feat(efuse): Updates esp_efuse_get_pkg_ver 2024-08-19 11:32:32 +03:00
0526c35ec3 Merge branch 'fix/esp32c5_rng_random_disable_v5.3' into 'release/v5.3'
fix(bootloader): update random disable api for ESP32-C5/C6 (v5.3)

See merge request espressif/esp-idf!32761
2024-08-19 11:33:01 +08:00
1f37d126c6 Merge branch 'change/exclude_cves_v5.3' into 'release/v5.3'
change: exclude CVEs that do not impact ESP-IDF components (v5.3)

See merge request espressif/esp-idf!32659
2024-08-19 11:32:29 +08:00
24c6528d29 Merge branch 'fix/incorrect_config_name_v5.3' into 'release/v5.3'
Fix encrypt image instead of the partition optimisation not being enabled (v5.3)

See merge request espressif/esp-idf!32639
2024-08-19 11:31:53 +08:00
9d010bd0b2 fix(linux): fixed build errors on MacOS
Closes https://github.com/espressif/esp-idf/issues/14379
2024-08-19 11:17:14 +08:00
19ab530729 docs(nvs_encryption): Updated the docs of nvs_encryption
Updated the documentation by changing subtype from key to
nvs_keys in nvs_encryption.rst
2024-08-18 20:02:48 +05:30
b1c9475b71 fix(bt/controller): Fixed disconnection issue
- Fixed the issue of disconnection caused by updating the channel map in sniff mode
2024-08-16 12:20:47 +08:00
aa2290a0ae fix(bt/bluedroid): Add PCM configuration about pcm frame sync signal shape 2024-08-16 12:20:47 +08:00
a26af847b7 ci(mmu): add unicore test 2024-08-16 11:51:58 +08:00
87cc3cb7a7 fix(MMU): fixed mmap deadlock when using multicore app with unicore bootloader
Closes https://github.com/espressif/esp-idf/issues/11617
2024-08-16 11:51:58 +08:00
466a392a76 Merge branch 'fix/avoid_extra_c2m_msync_in_aes_driver_v5.3' into 'release/v5.3'
fix(mbedtls/aes): Avoid extra C2M sync of memory (v5.3)

See merge request espressif/esp-idf!32699
2024-08-16 11:21:45 +08:00
13c30981b9 fix(cache): disable branch predictor before disable cache
branch predictor will start cache request
2024-08-16 10:25:43 +08:00
95594df093 feat(riscv): added api to disable branch predictor 2024-08-16 10:25:40 +08:00
4c53b937b6 Merge branch 'bugfix/fix_none_iram_code_before_xip_psram_v5.3' into 'release/v5.3'
rtc: fixed non-iram rtc code in early stage on p4 leading xip_psram stuck (v5.3)

See merge request espressif/esp-idf!32679
2024-08-15 14:46:07 +08:00
be5feaff6d Merge branch 'backport/make_ot_task_queue_non_permanent_blocking' into 'release/v5.3'
fix(openthread): make ot task queue sending non-permanent blocking(backport5.3)

See merge request espressif/esp-idf!32630
2024-08-15 14:43:46 +08:00
8679f14d1d Merge branch 'fix/move_xip_doc_out_from_non_updated_list_v5.3' into 'release/v5.3'
doc(psram): move xip psram doc out from non updated list (v5.3)

See merge request espressif/esp-idf!32841
2024-08-15 10:05:32 +08:00
bbe0750ca0 Merge branch 'bugfix/fixed_ble_issues_on_c6_h2_c2_0731_v5.3' into 'release/v5.3'
Bugfix/fixed ble issues on c6 h2 c2 0731 (v5.3)

See merge request espressif/esp-idf!32460
2024-08-14 16:51:57 +08:00
3b1bde1238 test(freertos): Fixed flaky scheduling time test
This commit updates the scheduling time test to test for median
scheduling time values instead of average values.
2024-08-14 09:28:30 +02:00
eca7b3b1f1 fix(xip): move rest xip_psram doc out from non updated list 2024-08-14 14:57:44 +08:00
fe48cfd6e5 fix(xip): added SOC_SPIRAM_XIP_SUPPORTED for programming guide usage 2024-08-14 14:57:29 +08:00
867acff64a docs: Update the CN translation for ulp-lp-core.rst 2024-08-14 14:14:47 +08:00
d54f5cdb43 fix(drivers): rename the nested extra_flags structure 2024-08-14 10:45:47 +08:00
3358b3073b fix(lcd): prelonged the lifecycle of dma2d transaction config structure
The context must exit at least until on_job_pixked callback is called
2024-08-14 10:44:40 +08:00
479c835d1a feat(ldo): add config to let hardware control the ldo output
If LDO1 is used by spi flash, then we recommend to give the ownership to
the hardware. Software just read the parameters from the efuse and set
to PMU.
2024-08-14 10:25:04 +08:00
88c476e630 fix(ulp): Add the missing extern "C" guard to ulp_lp_core_print.h
This commit adds the missing extern `C` guards the ulp_lp_core_print.h
header file.

Closes https://github.com/espressif/esp-idf/pull/14329
2024-08-13 23:08:30 +02:00
584be40657 fix(nimble) Added change to handle linked om data at blufi layer 2024-08-13 16:53:36 +05:30
7b5454bbaa fix(bt): change example sdkconfig name to sdkconfig.ci.test 2024-08-13 09:55:31 +08:00
9c9ba2e54f fix(esp_eth): fixed default GPIO to match new ver. of P4 devboard 2024-08-12 10:47:16 +02:00
5fedad0308 ci(pre-commit): bump kconfig checker pre-commit version to 2.3.0 2024-08-12 10:36:10 +02:00
a600af4950 change(ci): disable dangerjs checker for release notes 2024-08-12 09:27:41 +02:00
3eec62f823 fix(rng): avoid clearing PMU_PERIF_I2C_RSTB in random disable API for C6
This configuration bit is required for ADC operation as well and hence
should not be cleared in the RNG API sequence.

Ideally, the ADC driver should take care of initializing this bit but
still the RNG layer change is required because of interleaved API usage
scenario described in following linked issue.

Closes https://github.com/espressif/esp-idf/issues/14124
Closes https://github.com/espressif/esp-idf/issues/14280
2024-08-12 10:07:28 +05:30
87ec32e738 docs(ble/bluedroid): Optimize BLE example for setting advertising data 2024-08-12 11:32:34 +08:00
1aec9e7df3 fix(esp_pm): Fix APB clock calculation for chips w/o modem 2024-08-12 10:45:04 +08:00
fd446a674a fix(freertos): Fixed critical section macro in vTaskPlaceOnEventListRestricted()
The vTaskPlaceOnEventListRestricted() did not use the correct macro when
exiting a kernel cirtical section. This does not affect the HW targets
but on the Linux port, this caused an issue as the critical nesting
count became negative, leading to deadlocks. This commit fixes the bug
and updates the linux port to prevent the nesting count from going
negative.
2024-08-10 09:24:05 +02:00
7c9d9a8ad8 feat(ble): Print out the BT mac when the controller is initialized 2024-08-09 20:47:59 +08:00
7741d58b7f feat(ble/bluedroid): Support getting BLE address type in bond list 2024-08-09 20:21:04 +08:00
2e0c01b1c5 docs(ble/bluedroid): Optimize documentation for BLE connection parameter updates 2024-08-09 20:21:04 +08:00
1046724f9e fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(f583012)
- Fix BLE channel map update when latency is not zero
2024-08-09 20:20:31 +08:00
cfebc2052a feat(bt): Update bt lib for ESP32-C3 and ESP32-S3(4e58df9)
- Support enhanced BLE TX power setting and getting
2024-08-09 20:20:31 +08:00
998cd5e1f7 refactor(gptimer): sleep retention code clean up 2024-08-09 18:15:32 +08:00
e1ba14df02 fix(gptimer): fix the regdma overwrite the reload configuration 2024-08-09 18:12:25 +08:00
7e7f388392 change(wdt): create wdt_periph.c in soc component 2024-08-09 18:12:25 +08:00
51130a7a56 docs: Fix a small typo in adc_calibration.rst 2024-08-09 14:44:45 +08:00
e94d1f275c fix(mbedtls/aes): Avoid extra C2M sync of memory 2024-08-08 14:50:38 +05:30
3084df33d3 docs(gptimer): remove incorrect param from example
Fixes call to `gptimer_start` in one of the examples
which includes extra second parameter `&alarm_config`,
when the function takes only one.

Mreges https://github.com/espressif/esp-idf/pull/14310
2024-08-08 10:05:35 +08:00
4a7985ab4a fix(rtc): fixed non-iram rtc code in early stage on p4 leading xip_psram stuck 2024-08-07 18:06:56 +08:00
1f06765630 change: exclude CVEs that do not impact ESP-IDF components
cJSON:    CVE-2024-31755 - Resolved in cJSON v1.7.18
FreeRTOS: CVE-2024-28115 - Affects only ARMv7-M MPU ports, and ARMv8-M ports

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-08-06 17:23:43 +02:00
12a2e89ac6 fix(bootloader_support): Fix encrypt image instead of the partition feature not being enabled 2024-08-06 13:44:36 +05:30
4977a8245b fix(wifi/mesh): update the mesh ip_internal_network example 2024-08-06 14:52:47 +08:00
fc92df3ac3 fix(wifi/mesh): fixed the dhcp offer send error issue when root restart multiple times
Closes https://github.com/espressif/esp-idf/issues/13212
2024-08-06 14:52:39 +08:00
ed831645ad fix(wifi/mesh): clear the rootless state in mesh ie when changing from leaf to root
Closes https://github.com/espressif/esp-idf/issues/14063
2024-08-06 14:51:55 +08:00
zwx
73cdd20168 fix(openthread): make ot task queue sending non-permanent blocking 2024-08-06 14:09:20 +08:00
da2979f5ad change(ci): remove device name check in bt example 2024-08-06 11:41:00 +08:00
89218d6cfb fix(bt): get remote device name from eir data 2024-08-06 11:40:49 +08:00
202858eb3e feat(bt/example): add ci sdkconfig for bt examples 2024-08-06 11:40:37 +08:00
f7040d3633 fix(esp_pm): configure timer wakeup source with auto light-sleep congiguration 2024-08-06 11:02:30 +08:00
2ebd58bbc0 fix(sdspi): add dma_aligned_buffer and pwr_ctrl_handle fields
Closes https://github.com/espressif/esp-idf/pull/14288
2024-08-06 09:48:29 +08:00
6568f8c553 Merge branch 'feature/update-qemu-to-esp_develop_9.0.0_20240606_v5.3' into 'release/v5.3'
feat(tools): update qemu version to esp_develop_9.0.0_20240606 (v5.3)

See merge request espressif/esp-idf!31526
2024-08-05 22:50:57 +08:00
55069a785e Merge branch 'fix/fatfs_f_mount_immediately_after_formatting_v5.3_backport' into 'release/v5.3'
fix(vfs): FATFS mount immediately after format if mount failed (v5.3)

See merge request espressif/esp-idf!32379
2024-08-05 20:32:08 +08:00
6226780516 fix(nimble): Fixed assert issue in proximity_sensor example 2024-08-05 16:56:29 +05:30
b7513a2d1e feat(nimble): Add extra handling for set data len packet event 2024-08-05 16:42:55 +05:30
da12d1d932 docs: remove user guide for esp32-ethernet-kit migration 2024-08-05 17:25:22 +08:00
0c03c2008e Merge branch 'fix/mmu_func_force_inline_v5.3' into 'release/v5.3'
fix(mmu_map): make a static function force inline in order not be put in flash(backport v5.3)

See merge request espressif/esp-idf!32574
2024-08-05 17:14:39 +08:00
21147cd7f5 Merge branch 'feat/gpspi_flash_support_v5.3' into 'release/v5.3'
fix(spi_flash): Add external flash support on esp32c6,esp32h2,esp32p4(backport v5.3)

See merge request espressif/esp-idf!32522
2024-08-05 17:13:53 +08:00
da816521d3 Merge branch 'fix/p4_ulp_shared_mem_v5.3' into 'release/v5.3'
fix(lp-core): fixed ULP shared mem address being wrong on P4 (v5.3)

See merge request espressif/esp-idf!32537
2024-08-05 16:17:07 +08:00
823ac69f43 docs: Delete ESP32-S2-Kaluga-Kit related user guide files 2024-08-05 16:15:34 +08:00
18a8fcd510 Merge branch 'refactor/rtc_init_before_mspi_tuning_v5.3' into 'release/v5.3'
fix(startup): move rtc initialization before MSPI timing tuning to improve stability (v5.3)

See merge request espressif/esp-idf!32548
2024-08-05 13:34:59 +08:00
c4d4bfd646 Merge branch 'bugfix/adjust_tx_power_lvl_boundary_v5.3' into 'release/v5.3'
fix(nimble): Modify Advertising Tx power levels (v5.3)

See merge request espressif/esp-idf!32565
2024-08-05 13:29:53 +08:00
5b8da6f327 fix(spi_flash): Add external flash support on esp32c6,esp32h2,esp32p4 2024-08-05 11:47:55 +08:00
9ed45e4055 Merge branch 'change/pin_ili9881c_version_v5.3' into 'release/v5.3'
change(examples): set the ili9881c version to 0.2.x (v5.3)

See merge request espressif/esp-idf!32573
2024-08-05 11:46:39 +08:00
70bc919e80 change(examples): set the ili9881c version to 0.2.x 2024-08-05 11:01:40 +08:00
0cca45334e fix(mmu_map): make a static function force inline in order not be put in flash 2024-08-05 11:00:50 +08:00
7ccfd7d673 Merge branch 'bugfix/avoid_offchan_ftm_retries_v5.3' into 'release/v5.3'
fix(wifi): Avoid internal retries for offchannel FTM Requests (Backport v5.3)

See merge request espressif/esp-idf!32536
2024-08-05 10:46:14 +08:00
f81cece9d4 fix(startup): move rtc initialization before MSPI timing tuning to improve stability 2024-08-05 00:35:10 +08:00
01f0fd4158 fix(nimble): Modify Advertising Tx power levels 2024-08-03 14:42:10 +05:30
9a44ced672 Merge branch 'bugfix/null_assign_variable_v5.3' into 'release/v5.3'
fix(wifi_prov): Use calloc instead of malloc to zero initialize variable (v5.3)

See merge request espressif/esp-idf!32526
2024-08-02 22:02:52 +08:00
883ee8b0a0 Merge branch 'bugfix/fix_ble_security_param_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed issue with resetting BLE security parameters during initialization (v5.3)

See merge request espressif/esp-idf!32505
2024-08-02 17:38:40 +08:00
530f10f261 Merge branch 'bugfix/fix_ble_gattc_app_unregister_v5.3' into 'release/v5.3'
Bugfix/fix ble gattc app unregister (v5.3)

See merge request espressif/esp-idf!32438
2024-08-02 17:30:29 +08:00
a1ddeeca3e Merge branch 'change/disable_eot_in_lp_mode_v5.3' into 'release/v5.3'
change(dsi): don't send eot packet in lp mode (v5.3)

See merge request espressif/esp-idf!32535
2024-08-02 16:59:15 +08:00
5177bcc0a4 Merge branch 'fix/setuptools_constraint_v5.3' into 'release/v5.3'
fix: ensure the constraint file is followed also for setuptools (v5.3)

See merge request espressif/esp-idf!32545
2024-08-02 16:53:55 +08:00
adb5d60ec9 Merge branch 'fix/fix-gcc13-dirent-breaking_v5.3' into 'release/v5.3'
fix(newlib): fix include sys/dirent.h breaking change (v5.3)

See merge request espressif/esp-idf!32528
2024-08-02 16:26:05 +08:00
4c90790cd2 fix: ensure the constraint file is followed also for setuptools
Currently, when the venv is installed or updated, we attempt to
automatically update pip and setuptools within the venv. Unfortunately,
the setuptools package is installed or updated without adhering to the
constraints file, which restricts the setuptools version due to
https://github.com/pypa/setuptools/issues/4480. Resolve this issue by
applying the constraints file to the installation and update of both pip
and setuptools.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-08-02 09:30:11 +02:00
d51dd9b836 feat(bt):add pytest for classic bt example 2024-08-02 15:10:04 +08:00
cab1a2ab4a fix(lp-core): fixed ULP shared mem address being wrong on P4 2024-08-02 14:23:52 +08:00
fc847a0e9f Merge branch 'feature/ulp_hp_core_printf_debug_v5.3' into 'release/v5.3'
feat(ulp): add option for routing LP-printf to HP console (v5.3)

See merge request espressif/esp-idf!32493
2024-08-02 14:05:55 +08:00
14bdeaede5 Merge branch 'bugfix/usb_otg_console_v5.3' into 'release/v5.3'
fix(usb_otg): Fix bug that usb_otg console cannot work on esp32s3 (v5.3)

See merge request espressif/esp-idf!32179
2024-08-02 13:44:34 +08:00
f5e6f7276e Merge branch 'fix/netif_ppp_ip6_autoconfig_v5.3' into 'release/v5.3'
fix(esp_netif): Fix missing IPv6 autoconfig for PPP netifs (v5.3)

See merge request espressif/esp-idf!32177
2024-08-02 13:43:51 +08:00
de1050b810 fix(wifi): Avoid internal retries for offchannel FTM Requests 2024-08-02 10:41:49 +05:30
948c178a96 fix(wifi_prov): Use calloc instead of malloc to zero initialize variable 2024-08-02 10:35:51 +05:30
fc177553b2 Merge branch 'feature/usb_host_multi_configuration_backport_v5.3' into 'release/v5.3'
feat(usb/host): multiconfiguration support backport (v5.3)

See merge request espressif/esp-idf!32054
2024-08-02 11:45:29 +08:00
f7ac13a566 change(dsi): don't send eot packet in lp mode
because some LCD doesn't respond to that
2024-08-02 11:31:44 +08:00
90bb23f2f0 Merge branch 'bugfix/fix_newlib_nano_float_printf_issues_v5.3' into 'release/v5.3'
fix newlib nano float printf issues (backport v5.3)

See merge request espressif/esp-idf!32504
2024-08-02 11:00:58 +08:00
7a538b96a6 Merge branch 'backport/esp_netif_get_ip6addr_should_be_valid_v53' into 'release/v5.3'
fix(esp_netif): netif should return only valid addr(Backportv5.3)

See merge request espressif/esp-idf!32161
2024-08-02 10:58:27 +08:00
ba3a106fed Merge branch 'fix_coredump_build_error_v5.3' into 'release/v5.3'
fix(coredump): fix array out of the bounds error (v5.3)

See merge request espressif/esp-idf!32014
2024-08-02 10:57:52 +08:00
39148025fc Merge branch 'fix/correct_esp_xt_wdt_configuration_v5.3' into 'release/v5.3'
fix(esp_system): properly exclude XTAL32K WDT from other chips (v5.3)

See merge request espressif/esp-idf!31745
2024-08-02 10:57:24 +08:00
b82594e589 Merge branch 'lwip/if_indextoname_compolation_fix_v5.3' into 'release/v5.3'
rfix(lwip): Fixed compilation error referencing undefined POSIX interface API (v5.3)

See merge request espressif/esp-idf!31405
2024-08-02 10:56:07 +08:00
f7a3808374 feat(ulp): add option for routing LP-printf to HP console 2024-08-02 09:54:23 +08:00
86484c14e6 fix(newlib): fix include sys/dirent.h breaking change 2024-08-01 20:08:23 +07:00
611beb2c7b Merge branch 'bugfix/add_return_value_to_rpa_to_api_v5.3' into 'release/v5.3'
fix(nimble): Add return value to RPA Timeout API (v5.3)

See merge request espressif/esp-idf!32475
2024-08-01 20:23:56 +08:00
e3182df661 Merge branch 'update/esp32c6-h2_apm_api_v5.3.1' into 'release/v5.3'
fix(apm): minor fixes for apm api

See merge request espressif/esp-idf!32502
2024-08-01 18:32:42 +08:00
3110c94117 feat(spi_flash): Support auto suspend on esp32p4 2024-08-01 18:12:51 +08:00
a4fbcae397 feat(spi_flash): Adjust flash clock to real 80M clock, and support 32bit address on eco1 2024-08-01 18:12:51 +08:00
660de3d5af Merge branch 'docs/fix_intr_num_hlinterrupts_doc_v5.3' into 'release/v5.3'
docs(interrupts): fix wrong high-level interrupt level num in doc (v5.3)

See merge request espressif/esp-idf!32501
2024-08-01 16:25:15 +08:00
1df847e2a0 fix(ble/bluedroid): Fixed issue with resetting BLE security parameters during initialization 2024-08-01 16:17:53 +08:00
e4962dccf3 fix(coredump): fix array out of the bounds error
Closes https://github.com/espressif/esp-idf/issues/14117
2024-08-01 16:16:52 +08:00
c658ae6679 fix(esp_system): properly exclude XTAL32K WDT from other chips
Closes https://github.com/espressif/esp-idf/issues/13955
2024-08-01 10:08:19 +02:00
ae8c5f5e1c feat(newlib): add test case for printf float 2024-08-01 15:55:19 +08:00
d61531a8e5 fix(esp_rom): add new rom caps ESP_ROM_HAS_NEWLIB_NANO_PRINTF_FLOAT_BUG 2024-08-01 15:54:32 +08:00
04220bda1b Merge branch 'bugfix/fix_usb_dp_pullup_disable_v5.3' into 'release/v5.3'
GPIO: correct pio_ll_pullup_dis when USB DP (backport v5.3)

See merge request espressif/esp-idf!32494
2024-08-01 15:25:53 +08:00
9e0a13e4d7 fix(apm): minor fixes for apm api 2024-08-01 12:40:24 +05:30
46892c32ec docs(interrupts): fix wrong high-level interrupt level num in doc 2024-08-01 15:09:36 +08:00
68bdc86b65 Merge branch 'feature/print_panic_while_cache_fail_v5.3' into 'release/v5.3'
feat(esp_system): Print backtrace for both CPUs when cache error does not determine CPU (v5.3)

See merge request espressif/esp-idf!31129
2024-08-01 14:47:04 +08:00
9775832c8c Merge branch 'bugfix/deinit_roaming_app_crash_v5.3' into 'release/v5.3'
fix(esp_wifi): Fix crash in wifi deinit due to roaming neighbor list (v5.3)

See merge request espressif/esp-idf!32472
2024-08-01 13:52:30 +08:00
7be0bf12af fix(nimble): Add return value to RPA Timeout API 2024-08-01 09:23:24 +05:30
0df2bb24e7 Merge branch 'fix/fix_some_wifi_bugs_07_29_v5.3' into 'release/v5.3'
fix(wifi): fix some wifi bugs (v5.3)

See merge request espressif/esp-idf!32451
2024-08-01 11:22:53 +08:00
4b665425a2 fix(gpio): correct usb dp gpio pullup disable function v5.3 2024-08-01 10:50:58 +08:00
124778fbcb Merge branch 'fix/spi_hd_seg_fix_iwdt_timeout_v5.3' into 'release/v5.3'
fix(spi_slave_hd): fix seg mode potential iwdt timeout when multi task call (v5.3)

See merge request espressif/esp-idf!31842
2024-08-01 10:48:56 +08:00
b5ddc10ed1 Merge branch 'bugfix/sdmmc_test_app_usj_console_v5.3' into 'release/v5.3'
ci(sdmmc): enable tests and switch to usb_serial_jtag in the test app for P4 (v5.3)

See merge request espressif/esp-idf!32490
2024-08-01 02:38:22 +08:00
1dff957597 ci(sdmmc): enable tests for ESP32-P4 2024-07-31 18:39:40 +02:00
b124b1d682 ci(sdmmc): switch to usb_serial_jtag in the test app for P4
New CI runners use usb_serial_jtag, update configuration to match this.
2024-07-31 17:21:25 +02:00
e566ffffcb Merge branch 'feature/support_uart_sleep_retention_v5.3' into 'release/v5.3'
feat(uart): support uart module sleep retention (v5.3)

See merge request espressif/esp-idf!32464
2024-07-31 22:07:59 +08:00
4cc7eecf4f fix(wifi): fix some wifi bugs (v5.3) 2024-07-31 20:35:47 +08:00
fe810983c4 Merge branch 'feature/support_isp_ccm_v5.3' into 'release/v5.3'
feat(isp_ccm): support isp color correction matrix (v5.3)

See merge request espressif/esp-idf!31608
2024-07-31 18:59:44 +08:00
5dac537f6b fix(esp_wifi): Fix crash in wifi deinit due to roaming neighbor list 2024-07-31 14:47:52 +05:30
df5bf8c365 Merge branch 'bugfix/fix_parlio_cache_sync_issue_on_p4_v5.3' into 'release/v5.3'
fix(parlio): fix cache sync issue on P4 (v5.3)

See merge request espressif/esp-idf!32427
2024-07-31 16:46:57 +08:00
e1f066e3b3 Merge branch 'backport/add_ot_ts_lock_check_v53' into 'release/v5.3'
feat(openthread): add task switching lock holder check(Backport v5.3)

See merge request espressif/esp-idf!32454
2024-07-31 16:46:36 +08:00
21e23c16c4 Merge branch 'feat/lp_core_pre_calc_timer_v5.3' into 'release/v5.3'
change(lp_core): changed wakeup time calc to use a precomputed tick value (v5.3)

See merge request espressif/esp-idf!32458
2024-07-31 16:39:27 +08:00
59666823e4 Merge branch 'feature/lp_core_etm_v5.3' into 'release/v5.3'
feat(lp-core): added support for using ETM events as wake-up source (v5.3)

See merge request espressif/esp-idf!32455
2024-07-31 16:11:47 +08:00
753fe53fab fix(uart): fix uart_config_t structure size difference in C and C++ 2024-07-31 15:15:59 +08:00
8b8bb72ad4 feat(uart): support uart module sleep retention on c6/h2/p4 2024-07-31 15:15:11 +08:00
zwl
5509cda7ca fix: fixed directed adv can't be conneted when adv filter is 0x2 on ESP32C2 2024-07-31 14:38:40 +08:00
zwl
8d22f1c609 fix: fixed occasional wdt issue in multi-connection scenarios on ESP32H2 2024-07-31 14:38:40 +08:00
cada05a0df Merge branch 'fix/vtaskdeletewithcaps_leaks_memory_v5.3' into 'release/v5.3'
fix(freertos): Fixed memory leak issue in vTaskDeleteWithCaps() (v5.3)

See merge request espressif/esp-idf!32399
2024-07-31 13:33:53 +08:00
dccd6b0259 change(lp_core): changed wakeup time calc to use a precomputed tick value
Previously we would calculate the wakeup ticks upon every wakeup using the lp-timer clock frequency,
but this caused the binary to pull in software division functions, increasing the binary size.

This value is now precalculated by the hp-core when we configure the ULP. This saves about 1k bytes.
2024-07-31 13:28:14 +08:00
cf36c11b81 feat(lp-core): added support for using ETM events as wake-up source 2024-07-31 11:55:24 +08:00
zwx
7e93518073 feat(openthread): add task switching lock holder check 2024-07-31 11:33:40 +08:00
144b731f3a Merge branch 'feat/save_ble_log_to_flash_0605_v5.3' into 'release/v5.3'
ble: save ble log to flash on ESP32C6 (v5.3)

See merge request espressif/esp-idf!32394
2024-07-31 11:29:39 +08:00
cd6b3ab9fb feat(isp_ccm): support isp color correction matrix (v5.3) 2024-07-31 11:16:17 +08:00
05305871b2 Merge branch 'bugfix/fix_the_readme_check_failure' into 'release/v5.3'
fix(ci): fix the readme check of c5 mp (v5.3)

See merge request espressif/esp-idf!32428
2024-07-31 11:15:40 +08:00
9a481d8f23 Merge branch 'bugfix/dpp_auth_failure_v5.3' into 'release/v5.3'
fix(wpa_supplicant):Deinit old dpp authentication data after receiving config.(v5.3)

See merge request espressif/esp-idf!32432
2024-07-31 10:35:55 +08:00
474a92697c Merge branch 'contrib/github_pr_14084_v5.3' into 'release/v5.3'
remove TLS pointer/deletion callback from correct thread (GitHub PR) (v5.3)

See merge request espressif/esp-idf!31851
2024-07-31 10:27:19 +08:00
bbda124fce Merge branch 'bugfix/fix_beacon_timeout_issue_in_mesh_v5.3' into 'release/v5.3'
fix(wifi/mesh): fix the beacon timeout issue in mesh (v5.3)

See merge request espressif/esp-idf!32435
2024-07-31 10:19:42 +08:00
dc7fb34fca Merge branch 'backport/openthread_related_bacport_to_5_3' into 'release/v5.3'
Backport some openthread related features (Backport v5.3)

See merge request espressif/esp-idf!32251
2024-07-30 21:18:47 +08:00
3fc2c00dab fix(parlio): fix cache sync issue on P4 2024-07-30 19:46:35 +08:00
3e4fcf66ef fix(freertos): Fixed memory leak issue in vTaskDeleteWithCaps()
vTaskDeleteWithCaps() leaked memory when a task uses the API to delete
itself. This commit adds a fix to avoid the memory leak.

Closes https://github.com/espressif/esp-idf/issues/14222
2024-07-30 19:45:52 +08:00
ec130b0a64 fix(usb_otg): Fix bug that usb_otg console cannot work on esp32s3 2024-07-30 19:42:25 +08:00
6b83cc254d fix(esp_netif): Fix missing IPv6 autoconfig for PPP netifs
Closes https://github.com/espressif/esp-idf/issues/13713
2024-07-30 19:41:54 +08:00
zwx
e034358983 fix(esp_netif): netif should return only valid addr 2024-07-30 19:41:10 +08:00
aa95bb1e9a Merge branch 'feature/ulp_include_sdkconfig_cmake_v5.3' into 'release/v5.3'
feat(ulp): import all sdkconfigs macros into cmake build (v5.3)

See merge request espressif/esp-idf!32139
2024-07-30 19:40:15 +08:00
c4d3716f76 Merge branch 'fix/usb_hs_scheduler_backport_v5.3' into 'release/v5.3'
fix(usb/host): Fix occasional ISOC scheduler skipping transfers backport v5.3

See merge request espressif/esp-idf!32083
2024-07-30 19:40:03 +08:00
5b4b867a9c fix(pthread): Remove TLS pointer/deletion callback from correct thread
Originally, pthread_internal_local_storage_destructor_callback was only called from pthread_exit
on the thread whose TLS is being destroyed.

In b3755b751e, pthread_internal_local_storage_destructor_callback
started being called from pthread_join and pthread_detach on a different thread (whichever one
called one of those functions).

But pthread_internal_local_storage_destructor_callback is still calling
vTaskSetThreadLocalStoragePointer and vTaskSetThreadLocalStoragePointerAndDelCallback with a NULL
xTaskToSet argument, which causes those functions to set the TLS pointer and deletion callback
for the current thread, not the thread whose TLS is being destroyed.

This commit makes pthread_internal_local_storage_destructor_callback call
vTaskSetThreadLocalStoragePointer and vTaskSetThreadLocalStoragePointerAndDelCallback
with the handle of the thread whose TLS is being destroyed.
2024-07-30 19:39:17 +08:00
9e38f78ea2 fix(spi_slave_hd): fix seg mode potential iwdt timeout when multi task call 2024-07-30 19:38:45 +08:00
acb201e5b2 feat(tools): enable idf.py qemu integration for ESP32-S3 2024-07-30 19:37:32 +08:00
4168fa28f4 feat(esp_eth): enable openeth in QEMU for ESP32-S3 2024-07-30 19:37:32 +08:00
ae0a230843 feat(tools): update qemu version to esp_develop_9.0.0_20240606 2024-07-30 19:37:32 +08:00
ca967c9f96 fix(lwip): Fixed compilation error referencing undefined POSIX interface API
Closes https://github.com/espressif/esp-idf/issues/13577
2024-07-30 19:36:18 +08:00
3f82f6e93b feat(esp_system): Print backtrace for both CPUs when cache error does not determine CPU 2024-07-30 19:35:35 +08:00
18a4191adf fix(ble/bluedroid): Fix incorrect state issue when unregistering BLE GATTC application 2024-07-30 18:03:37 +08:00
fa7fb662c1 fix(wifi/mesh): fix the beacon timeout issue in mesh 2024-07-30 16:44:37 +08:00
da2fb9de49 fix(wpa_supplicant):Deinit old dpp authentication data after receiving config. 2024-07-30 13:57:42 +05:30
951bdd70a2 fix(ci): fix the readme check of c5 mp 2024-07-30 15:40:19 +08:00
6cbb5af66e Merge branch 'ci/disable_c5_system_test' into 'release/v5.3'
ci(system): disable c5 system tests (v5.3)

See merge request espressif/esp-idf!32423
2024-07-30 14:21:53 +08:00
1adbfa6822 ci(system): disable c5 system tests 2024-07-30 13:19:04 +08:00
6fffc3b017 Merge branch 'fix/esp_lcd_i2c_ng_v5.3' into 'release/v5.3'
fix(esp_lcd): Fix I2C receive without param (v5.3)

See merge request espressif/esp-idf!32412
2024-07-30 10:53:11 +08:00
23e2b6a130 Merge branch 'backport/fix_154_next_operation_for_multi_event_v53' into 'release/v5.3'
fix(ieee802154): refactor the next opteration logic for multiple events(Backport v5.3)

See merge request espressif/esp-idf!32388
2024-07-30 10:34:03 +08:00
0ac440afcc Merge branch 'bugfix/split_hci_log_in_nimble_v5.3' into 'release/v5.3'
fix(bt/nimble): split hci log in nimble (backport v5.3)

See merge request espressif/esp-idf!32383
2024-07-30 10:33:16 +08:00
1a6f1e67c6 feat(ulp): include sdkconfig macros in cmake build 2024-07-30 10:27:28 +08:00
0d7d3b5dbb fix(usb/host): Fix occasional ISOC scheduler skipping transfers 2024-07-30 10:25:54 +08:00
179622046d Merge branch 'backport/shortened_uart_read_bytes_blocking_53' into 'release/v5.3'
fix(uart): remove unnecessary wait when sending message to ring buffer(Backport5.3)

See merge request espressif/esp-idf!31380
2024-07-30 10:20:51 +08:00
0e2b19b11b Merge branch 'bugfix/usb_serial_jtag_simplify_v5.3' into 'release/v5.3'
usb-serial-jtag driver simplification (backport v5.3)

See merge request espressif/esp-idf!31947
2024-07-29 18:37:50 +08:00
613ad211c6 refactor(usb_host): Update USB Host multiconfig public API
- previous usb_host_get_config_desc_free()
    - updated usb_host_free_config_desc()
2024-07-29 12:20:16 +02:00
5fc18ffc04 feat(usb/host): multiconfiguration support
- usb host reads device's configuration on request
    - a control transfer is sent
    - memory is allocated for a new descriptor
    - user must manually free the memory
2024-07-29 12:20:16 +02:00
873ae74e0b fix(vfs): FATFS mount immediately after format if mount failed 2024-07-29 17:58:49 +08:00
ac4c6dfd86 Merge branch 'fix/vfs_console_fstat_infinite_recursion_v5.3' into 'release/v5.3'
fix(storage/vfs_console): remove possible infinite recursion (v5.3)

See merge request espressif/esp-idf!31423
2024-07-29 17:25:00 +08:00
c782e57a0f Merge branch 'feature/usb_host_hub_support_collective_backport_v5.3' into 'release/v5.3'
refactor(usb/host): Prerequisite Refactoring For Hub Collective backport (v5.3)

See merge request espressif/esp-idf!30480
2024-07-29 17:11:08 +08:00
0019a9fb8d Merge branch 'change/mipi_dsi_minor_change_v5.3' into 'release/v5.3'
feat(mipi_dsi): update low level functions to include underrun interrupt (v5.3)

See merge request espressif/esp-idf!32389
2024-07-29 16:46:09 +08:00
b9b3479a20 fix(esp_lcd): Fix I2C receive without param 2024-07-29 16:42:10 +08:00
a156e2871e Merge branch 'feat/support_psram_aps3204l_v5.3' into 'release/v5.3'
psram: support APS3204L (v5.3)

See merge request espressif/esp-idf!32390
2024-07-29 16:00:25 +08:00
bdd2233180 Merge branch 'change/improve_xip_docs_on_p4_v5.3' into 'release/v5.3'
psram: improved xip psram docs on p4 (v5.3)

See merge request espressif/esp-idf!32384
2024-07-29 13:54:53 +08:00
85955903e9 Merge branch 'bugifx/zero_initilize_variable_v5.3' into 'release/v5.3'
fix(nimble): Zero initialize variable to avoid garbage value (v5.3)

See merge request espressif/esp-idf!32366
2024-07-29 13:01:34 +08:00
ee423b186a Merge branch 'ci/enable_misc_c5_build_tests_v5.3' into 'release/v5.3'
test(misc): enable misc tests that have been missed during bringup (v5.3)

See merge request espressif/esp-idf!31789
2024-07-29 12:39:36 +08:00
zwl
6e11307d16 fix(ble): fixed tx memory leak issue when controller disable 2024-07-29 11:56:10 +08:00
zwl
ba97f7d755 fix(ble): fixed wdt issue when print key controller info on ESP32-C6 and ESP32-H2 2024-07-29 11:56:10 +08:00
zwl
29d8e723b8 feat(bluetooth/controller): support switching log output mode on ESP32-C2 2024-07-29 11:56:09 +08:00
zwl
30ff46717f feat(bluetooth/controller): support switching log output mode on ESP32-C6 and ESP32-H2 2024-07-29 11:56:09 +08:00
zwl
565053406b feat(bluetooth/controller): storage ble controller log to flash on ESP32C2 2024-07-29 11:56:09 +08:00
zwl
777e58f80e feat(bluetooth/controller): storage ble controller log to flash on ESP32C6 and ESP32H2 2024-07-29 11:56:08 +08:00
03447f5827 fix(usb_serial_jtag): Fix issue that use u32_reg read/write cannot be used to modify fifo regs 2024-07-29 11:46:52 +08:00
a0dbe28c9f refactor(usb-serial-jtag): usb-serial-jtag driver simplification to fix rom print coexistence 2024-07-29 11:44:15 +08:00
10d68e943a feat(psram): support APS3204L 2024-07-29 11:41:00 +08:00
0417d48a9d feat(mipi_dsi): update low level functions to include underrun interrupt 2024-07-29 11:23:52 +08:00
zwx
e8660cd99d fix(ieee802154): refactor the next opteration logic for multiple events 2024-07-29 11:16:37 +08:00
21b861e9df change(psram): improved xip psram docs on p4 2024-07-29 10:36:44 +08:00
39a3d54619 Merge branch 'fix/freertos_port_assert_in_isr_bug_v5.3' into 'release/v5.3'
fix(freertos): Incorrect assert in FreeRTOS port layer when not in ISR context (v5.3)

See merge request espressif/esp-idf!32372
2024-07-29 09:52:55 +08:00
917bcc2cd8 fix(bt/nimble): split hci log in nimble 2024-07-29 09:46:13 +08:00
3469d50a8b fix(nimble): Zero initialize variable to avoid garbage value 2024-07-26 21:29:00 +05:30
d43458790d Merge branch 'bugfix/host_cb_to_provide_key_v5.3' into 'release/v5.3'
fix(nimble): Add host callback to provide security key (v5.3)

See merge request espressif/esp-idf!32247
2024-07-26 23:00:00 +08:00
d2e4722f5b fix(freertos): Incorrect assert in FreeRTOS port layer when not in ISR context
This commit fixes an issue where in the FreeRTOS port layer would cause
the portASSERT_IF_IN_ISR() assert check to fail even when the system is
not in an interrupt context.
2024-07-26 15:15:34 +02:00
2e512fb8ee Merge branch 'bugfix/ld_acl_c_3576_v5.3' into 'release/v5.3'
fix(bt/controller): Removed an improper assertion in ACL link driver (v5.3)

See merge request espressif/esp-idf!32117
2024-07-26 19:09:47 +08:00
7f1b752631 Merge branch 'backport/support_eth_mac_using_esp_read_mac_v53' into 'release/v5.3'
feat(eth) configure eth mac using esp_read_mac(Backport v5.3)

See merge request espressif/esp-idf!31093
2024-07-26 16:38:09 +08:00
ab8e19710f Merge branch 'bugfix/handle_no_pmkid_case_owe_v5.3' into 'release/v5.3'
Recompute keys in OWE incase of PMKID absence or mismatch (Backport v5.3)

See merge request espressif/esp-idf!32331
2024-07-26 16:09:31 +08:00
f15a63efd7 Merge branch 'bugfix/c5_mintstatus_value_v5.3' into 'release/v5.3'
fix(riscv): fix a bug that affected mintstatus CSR value in the CLIC (backport v5.3)

See merge request espressif/esp-idf!32230
2024-07-26 15:56:18 +08:00
01086e0307 fix(nimble): Add host callback to provide security key 2024-07-26 11:34:40 +05:30
9f7f1f3bf2 Merge branch 'bugfix/reset_irk_when_all_unpair_v5.3' into 'release/v5.3'
fix(nimble): Fixed BLE security vulnerability when using fixed IRK (v5.3)

See merge request espressif/esp-idf!32156
2024-07-26 14:03:09 +08:00
dce5170cdb fix(riscv): fix a that affected mintstatus CSR value in the CLIC 2024-07-26 13:57:14 +08:00
8795e7a12d Merge branch 'bugfix/provide_random_addr_api_v5.3' into 'release/v5.3'
fix(wifi_prov): Added API to set random address (v5.3)

See merge request espressif/esp-idf!32325
2024-07-26 13:53:41 +08:00
509bd0ec9e Merge branch 'docs/delete_userguide_esp32_s2_devkitc_1_v5.3' into 'release/v5.3'
docs: Delete user guide esp32-s2-devkitc-1 (v5.3)

See merge request espressif/esp-idf!31613
2024-07-26 13:12:40 +08:00
81cdaa3ace fix(bt/controller): Removed an improper assertion in ACL link driver
It can be triggered on peripheral SNIFF mode
when RX window is adjusted on ESP32.
2024-07-26 12:40:04 +08:00
e9ca15c173 Merge branch 'docs/migrate_esp32c3_devkitc_02_devkitm_1_user_guide_v5.3' into 'release/v5.3'
docs: Migrate user guides of ESP32-C3-DevKitM and ESP32-C3-DevKitC to esp-dev-kits (v5.3)

See merge request espressif/esp-idf!31818
2024-07-26 12:01:33 +08:00
24de52e110 fix(esp_wifi): Handle PMKID mismatch or absence in OWE
Compute keys incase PMKID does not match or PMKID is absent in association response
2024-07-26 11:57:59 +08:00
b58fa75121 Merge branch 'bugfix/wifi_scan_example_v5.3' into 'release/v5.3'
fix(wifi): Free scan configuration after use when channel bitmap is used in scan example (Backport v5.3)

See merge request espressif/esp-idf!32201
2024-07-26 11:56:12 +08:00
d390c6f48a Merge branch 'fix/stack_overflow_in_example_spp_initiator_v5.3' into 'release/v5.3'
Fix/stack overflow in example spp initiator (backport v5.3)

See merge request espressif/esp-idf!32232
2024-07-26 11:55:37 +08:00
b81f35157b Merge branch 'bugfix/fix_ble_cannot_create_conn_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed BLE cannot create connection(v5.3)

See merge request espressif/esp-idf!32306
2024-07-26 11:54:58 +08:00
2ea1eff316 Merge branch 'bugfix/fix_some_ble_bugs_cjh_v5.3' into 'release/v5.3'
Fixed some BLE bugs 240723 (backport v5.3)

See merge request espressif/esp-idf!32345
2024-07-26 11:53:59 +08:00
1fa25ff842 Merge branch 'feat/add_ble50_instant_v5.3' into 'release/v5.3'
Add support for BLE 5.0 instances in related events (v5.3)

See merge request espressif/esp-idf!31990
2024-07-26 11:53:08 +08:00
4a4d20f085 Merge branch 'bugfix/fix_esco_conflict_with_sniff_v5.3' into 'release/v5.3'
fix(bt/controller): Fixed some controller bugs (v5.3)

See merge request espressif/esp-idf!31952
2024-07-26 11:51:49 +08:00
25ff0fb054 Merge branch 'docs/optimized_ble_controller_api_references_esp32_v5.3' into 'release/v5.3'
docs(ble): Revised the esp32 controller API explanations (v5.3)

See merge request espressif/esp-idf!31925
2024-07-26 11:51:19 +08:00
3c3c501967 Merge branch 'docs/update_twt_docs_v5.3' into 'release/v5.3'
docs(wifi):update TWT docs(Backport v5.3)

See merge request espressif/esp-idf!31898
2024-07-26 11:50:34 +08:00
67b0e9bd09 Merge branch 'bugfix/fix_ble_connect_fail_report_time_v5.3' into 'release/v5.3'
fix(ble/bluedroid): Fixed BLE report event when connection fails (v5.3)

See merge request espressif/esp-idf!31781
2024-07-26 11:49:19 +08:00
c2d5712563 Merge branch 'bugfix/openthread_uart_vfs_register_v5_3' into 'release/v5.3'
fix(openthread): register uart vfs devices when they are not registered(v5.3)

See merge request espressif/esp-idf!31795
2024-07-26 11:47:45 +08:00
e3e5b3452d Merge branch 'docs/add_the_description_of_gpio_wakeup_in_lightsleep_when_pd_top_v5.3' into 'release/v5.3'
docs(pm): add description for gpio_wakeup  (backport v5.3)

See merge request espressif/esp-idf!31737
2024-07-26 11:47:17 +08:00
d431971fed Merge branch 'feat/ci_check_ll_rw_register_half_word_v5.3' into 'release/v5.3'
fix(hal): LL function read write the register by half-world (v5.3)

See merge request espressif/esp-idf!31722
2024-07-26 11:46:40 +08:00
2c84e2e40b Merge branch 'fix/fix_aes_dma_desc_align_v5.3' into 'release/v5.3'
fix(aes): fixed aes wrong dma desc alignment (v5.3)

See merge request espressif/esp-idf!32206
2024-07-26 11:46:23 +08:00
86bcea64b9 Merge branch 'feature/touch_driver_ng_on_p4_v5.3' into 'release/v5.3'
feat(touch_sensor): touch driver ng on p4 (v5.3)

See merge request espressif/esp-idf!31624
2024-07-26 11:42:27 +08:00
371ae9577c fix(uart): remove unnecessary wait when sending message to ring buffer 2024-07-26 11:41:36 +08:00
zwx
34a7bc558e feat(eth) configure eth mac using esp_read_mac
* Closes https://github.com/espressif/esp-idf/issues/13808
2024-07-26 11:40:10 +08:00
35e9a119da Merge branch 'bugfix/l2cap_use_wrong_handle_v5.3' into 'release/v5.3'
fix(bt/bluedroid):  Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event(v5.3)

See merge request espressif/esp-idf!31278
2024-07-26 11:39:25 +08:00
1316c4bdfb Merge branch 'fix/blemesh24_61_v5.3' into 'release/v5.3'
fix/blemesh24_61 (v5.3)

See merge request espressif/esp-idf!31564
2024-07-26 11:38:30 +08:00
c9e769a5f4 docs: Delete user guide esp32-s2-devkitc-1 2024-07-26 11:33:11 +08:00
8e210e56ac Merge branch 'bugfix/fix_coex_loadprohibit_issue_v5.3' into 'release/v5.3'
fix(coex): Fixed coexist scheme phase index overflow issue (backport v5.3)

See merge request espressif/esp-idf!32296
2024-07-26 11:15:46 +08:00
5e24acf877 Merge branch 'fix/esp_eth_p4_docs_v5.3' into 'release/v5.3'
docs(esp_eth): enabled Configure MAC and PHY section for P4 (v5.3)

See merge request espressif/esp-idf!31496
2024-07-26 11:14:37 +08:00
9722f4d044 Merge branch 'docs/delete_user_guide_esp32_s2_devkitm_1_v5.3' into 'release/v5.3'
docs: Delete user guide esp32-s2-devkitm-1 (v5.3)

See merge request espressif/esp-idf!31606
2024-07-26 11:12:14 +08:00
5325cac7e6 Merge branch 'coredump_save_all_regions_v5.3' into 'release/v5.3'
Save .bss, .data and .heap sections in to the coredump (v5.3)

See merge request espressif/esp-idf!30438
2024-07-26 11:11:22 +08:00
3e826dd883 Merge branch 'fix/bump_esp_littlefs_to_v5.3' into 'release/v5.3'
fix(storage/littlefs): Bump version to v1.14.4 (core v2.9.1) (v5.3)

See merge request espressif/esp-idf!30356
2024-07-26 11:09:43 +08:00
50288969c2 Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
fix(wifi): backport some wifi fixes to v5.3

See merge request espressif/esp-idf!32291
2024-07-26 11:08:23 +08:00
97888426ab Merge branch 'fix/add_integrity_check_when_select_temporary_key_v5.3' into 'release/v5.3'
fix(bt): add integrity check when temporary link key selected(backport v5.3)

See merge request espressif/esp-idf!31698
2024-07-25 22:03:55 +08:00
758567a7b7 Merge branch 'bugfix/wps_reg_state_handling_v5.3' into 'release/v5.3'
fix(wpa_supplicant): Handle case when WPS registrar misses WSC_DONE sent by station (Backport v5.3)

See merge request espressif/esp-idf!32082
2024-07-25 22:02:21 +08:00
4bfb21de98 Merge branch 'feature/upgrade_example_autofocus_component_v5.3' into 'release/v5.3'
isp: upgrade esp_cam_sensor component for isp/auto_focus (v5.3)

See merge request espressif/esp-idf!32330
2024-07-25 19:13:12 +08:00
8957785f4d Merge branch 'feat/cache_panic_p4_v5.3' into 'release/v5.3'
cache:cache panic p4 (v5.3)

See merge request espressif/esp-idf!32110
2024-07-25 18:56:39 +08:00
a2056b0aa7 Merge branch 'fix/idf_tools_warning_error_v5.3' into 'release/v5.3'
fix(tools): Improve the warning message from idf_tools.py about the Python environment (v5.3)

See merge request espressif/esp-idf!31511
2024-07-25 18:13:41 +08:00
2233244c86 feat(bt/controller): support mesh duplicate with extend scan 2024-07-25 17:50:04 +08:00
313f7be30b fix(coex): Update bt lib for ESP32-C3 and ESP32-S3(e4ba7f6)
- Fixed coexist LoadProhibited issue
2024-07-25 17:50:04 +08:00
ed0cc11750 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(abd7733)
- Fix the issue where RSSI is incorrect when latency is not zero
2024-07-25 17:50:04 +08:00
bec7b260c6 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(66b5cc0)
- Fixed vendor hci get controller status command
- Prevent BLE interrupt from being preempted
2024-07-25 17:50:04 +08:00
e5c1a03e52 fix(nimble): Fixed BLE security vulnerability when using fixed IRK 2024-07-25 15:11:59 +05:30
e78cd20095 Merge branch 'bugfix/increase_timer_task_depth_v5.3' into 'release/v5.3'
fix(nimble): Increase Timer stack size for nimble application (v5.3)

See merge request espressif/esp-idf!32269
2024-07-25 17:38:21 +08:00
14135f9def Merge branch 'bugfix/fix_example_menuconfig_error_v5.3' into 'release/v5.3'
fix(nimble): Update menuconfig option to consider 5.0 support (v5.3)

See merge request espressif/esp-idf!32035
2024-07-25 17:30:25 +08:00
ab6203d819 Merge branch 'bugfix/existing_mmap_region_offset_v5.3' into 'release/v5.3'
fix(esp_mm): for existing mmap region, consider new offset for virtual addr (v5.3)

See merge request espressif/esp-idf!32112
2024-07-25 17:09:33 +08:00
53fd6cb516 Merge branch 'feature/support_isp_awb_v5.3' into 'release/v5.3'
feat(isp): Support ISP Auto White Balance (AWB) (v5.3)

See merge request espressif/esp-idf!31605
2024-07-25 17:02:22 +08:00
d4ac5470ce Merge branch 'fix/ble_mesh_24_76_v5.3' into 'release/v5.3'
fix(ble_mesh): fixed BLEMESH24-76_v5.3

See merge request espressif/esp-idf!32226
2024-07-25 16:55:09 +08:00
638577b0bf Merge branch 'bugfix/fix_some_ble_bugs_cjh_v5.3' into 'release/v5.3'
Fixed some BLE bugs 240620 (backport v5.3)

See merge request espressif/esp-idf!31646
2024-07-25 16:54:55 +08:00
d0eccc2de2 Merge branch 'fix/update_latest_git_tag_variable' into 'release/v5.3'
fix(ci): Update LATEST_GIT_TAG variable

See merge request espressif/esp-idf!32340
2024-07-25 16:54:12 +08:00
9c507c76f1 docs(ble): Removed trailing whitespaces 2024-07-25 16:54:09 +08:00
cd05dfede7 docs(ble): Added newline for mode in esp_bt_controller_config_t 2024-07-25 16:54:09 +08:00
300750b8c6 docs(ble): Revised the explanation for esp_bt_mem_release and esp_bt_controller_mem_release 2024-07-25 16:54:09 +08:00
6df549d6b0 docs(ble):Added the parameter name data in esp_vhci_host_send_packet 2024-07-25 16:54:09 +08:00
efbc3bbbf5 docs(ble): Removed period for incomplete sentences 2024-07-25 16:54:09 +08:00
4aaad560b3 Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Wang Ning <wangning@espressif.com>
2024-07-25 16:54:09 +08:00
d0a5c72c75 docs(ble): Add the explanations to controller parameters configurable in menuconfig 2024-07-25 16:54:09 +08:00
f0cb44a69c Apply 35 suggestion(s) to 1 file(s)
Co-authored-by: Wang Ning <wangning@espressif.com>
2024-07-25 16:54:09 +08:00
2f9af2ce02 docs(ble): Removed note in esp_bt_controller_config_t 2024-07-25 16:54:09 +08:00
dcece3822e docs(ble): Replaced BT with Bluetooth 2024-07-25 16:54:09 +08:00
294c17e08b docs(ble): Removed unnecessary explanations 2024-07-25 16:54:09 +08:00
2a3b3ab6f9 docs(ble): Added corresponding values to the controller mode 2024-07-25 16:54:09 +08:00
d600d97c04 docs(ble): Fixed the explanation of TX power type 2024-07-25 16:54:09 +08:00
56f8419f5f docs(ble): Added typeof for BLE sleep clock accuracy enum 2024-07-25 16:54:09 +08:00
73509ce16b docs(ble): Added a name for BLE sleep clock accuracy enum 2024-07-25 16:54:09 +08:00
c20cc2d9b2 docs(ble): Revised the esp32 controller API explanations 2024-07-25 16:54:09 +08:00
0efdd4ac01 Merge branch 'feat/optimize_bt_porting_hci_0628_5.3' into 'release/v5.3'
Feat/optimize bt porting hci 0628 5.3

See merge request espressif/esp-idf!32135
2024-07-25 16:53:54 +08:00
9fb47d0ee4 Merge branch 'fix/i2c_semaphore_release_v5.3' into 'release/v5.3'
fix(i2c): Fix i2c not release semaphore in command send loop(backport v5.3)

See merge request espressif/esp-idf!31958
2024-07-25 16:53:19 +08:00
4acc83d7b0 Merge branch 'bugfix/rmt_memory_power_up_v5.3' into 'release/v5.3'
fix(rmt): power up memory block (v5.3)

See merge request espressif/esp-idf!32171
2024-07-25 16:52:12 +08:00
86b9fb7db0 Merge branch 'contrib/github_pr_13945_v5.3' into 'release/v5.3'
fix(esp_http_client): Do not allocate client->if_name twice in esp_http_client_init. (GitHub PR) (v5.3)

See merge request espressif/esp-idf!31942
2024-07-25 16:51:01 +08:00
ad0cfa57e7 Merge branch 'feature/esp32p4_apm_api_v5.3' into 'release/v5.3'
feat: add esp32p4 APM HAL/LL API (v5.3)

See merge request espressif/esp-idf!31417
2024-07-25 16:50:18 +08:00
f0ba6eb94c Merge branch 'fix/incorrect_console_input_decoding_wifi_prov_mgr_v5.3' into 'release/v5.3'
fix(tools/esp_prov): Fix incorrect input decoding when using console transport (v5.3)

See merge request espressif/esp-idf!31689
2024-07-25 16:49:49 +08:00
99467a17e9 Merge branch 'bugfix/c5_mpi_ecc_power_mode_v5.3' into 'release/v5.3'
fix(hal): correct mpi/ecc peripheral power up sequence for ESP32-C5 (v5.3)

See merge request espressif/esp-idf!31728
2024-07-25 16:49:05 +08:00
98578d456f Merge branch 'bugfix/update_ecdsa_reset_api_to_execute_correctly_v5.3' into 'release/v5.3'
fix(hal): updated ecdsa reset api to execute correctly (v5.3)

See merge request espressif/esp-idf!32338
2024-07-25 16:48:25 +08:00
e841a69498 Merge branch 'feature/dvp_cam_driver_optimize_v5.3' into 'release/v5.3'
feat(dvp): DVP cam supports more color format and don't initialize xclock pin (v5.3)

See merge request espressif/esp-idf!32023
2024-07-25 16:46:56 +08:00
5f96f87715 Merge branch 'fix/usb_isoc_error_status_backport_v5.3' into 'release/v5.3'
fix(usb/host): Decode error flags in ISOC transfers backport to v5.3

See merge request espressif/esp-idf!31884
2024-07-25 16:45:42 +08:00
a6edff26c6 Merge branch 'fix/usb_host_hcd_dconn_hs_backport_v5.3' into 'release/v5.3'
fix(usb_dwc_hal): Enabled precise detection of VBUS backport to v5.3

See merge request espressif/esp-idf!32059
2024-07-25 16:45:21 +08:00
b131527d13 Merge branch 'fix/fix_csi_c2m_cache_ops_v5.3' into 'release/v5.3'
camera: fixed csi and isp_dvp c2m cache ops (v5.3)

See merge request espressif/esp-idf!32293
2024-07-25 16:43:10 +08:00
e296941d36 Merge branch 'fix/fix_p4_psram_20m_wrong_clk_div_v5.3' into 'release/v5.3'
fix(psram): fixed p4 psram 20M wrong clk div (v5.3)

See merge request espressif/esp-idf!32255
2024-07-25 16:42:29 +08:00
35961c945a Merge branch 'fix/fix_esp_dma_is_buffer_alignment_satisfied_issue_v5.3' into 'release/v5.3'
dma: fix esp_dma_is_buffer_alignment_satisfied align issue when l2 cache line 128B (v5.3)

See merge request espressif/esp-idf!32205
2024-07-25 16:42:08 +08:00
94bc5d953f Merge branch 'feat/bss_in_psram_p4_v5.3' into 'release/v5.3'
psram: bss in psram p4 (v5.3)

See merge request espressif/esp-idf!32124
2024-07-25 16:41:59 +08:00
9c874ee95d Merge branch 'ci/re-enable_spi_lcd_test_on_p4_v5.3' into 'release/v5.3'
Ci(spi_lcd): re-enable spi lcd test on p4 (v5.3)

See merge request espressif/esp-idf!32073
2024-07-25 16:41:13 +08:00
cf3047a87f Merge branch 'refator/re-enable_test_on_p4_v5.3' into 'release/v5.3'
fix(gptimer): re-enable legacy_test on p4 (v5.3)

See merge request espressif/esp-idf!31539
2024-07-25 16:40:45 +08:00
ab5b9a0c29 fix(hal): functions that may generate invalid load/store byte/half-word instructions
because the APB regsiters can't behave correctly on these instructions
2024-07-25 16:38:47 +08:00
0903bcca1b Merge branch 'fix/lcd_build_error_in_cpp_v5.3' into 'release/v5.3'
fix(lcd): build errors with deprecated lcd types in cpp (v5.3)

See merge request espressif/esp-idf!31676
2024-07-25 16:38:17 +08:00
ea05ae73a5 Merge branch 'bugfix/huk_ll_enable_interrupt_v5.3' into 'release/v5.3'
fix(huk): switch case fall through unexpected (v5.3)

See merge request espressif/esp-idf!31721
2024-07-25 16:34:57 +08:00
8f0584c5be Merge branch 'refactor/adc_dma_memory_allocation_v5.3' into 'release/v5.3'
ADC & AES: use heap component API to allocate cached aligned DMA buffer (v5.3)

See merge request espressif/esp-idf!31723
2024-07-25 16:34:34 +08:00
02fb7add3c Merge branch 'fix/workaround_rmt_static_analyzer_issue_v5.3' into 'release/v5.3'
fix(rmt): fix gcc static analyzer warnings (v5.3)

See merge request espressif/esp-idf!32184
2024-07-25 16:31:59 +08:00
dd77b0b822 Merge branch 'change/dw_gdma_memory_allocation_v5.3' into 'release/v5.3'
change(dw_gdma): clean up memory allocation for link list items (v5.3)

See merge request espressif/esp-idf!32224
2024-07-25 16:31:34 +08:00
6c52686649 Merge branch 'fix/usb-serial-jtag-hangs-on-init_v5.3' into 'release/v5.3'
fix(console): USB Serial JTAG freezes when input received before the driver is installed (v5.3)

See merge request espressif/esp-idf!31820
2024-07-25 16:26:03 +08:00
a2d2f30816 Merge branch 'contrib/github_pr_14010_v5.3' into 'release/v5.3'
fix(ulp): Write pin's output mode to the correct register (GitHub PR) (v5.3)

See merge request espressif/esp-idf!31595
2024-07-25 16:24:35 +08:00
ddc482f11f Merge branch 'fix/ulp_riscv_i2c_multi_byte_v5.3' into 'release/v5.3'
fix(ulp-risc-v): Fixed RTC I2C multi-byte read/write issue for ULP RISC-V (v5.3)

See merge request espressif/esp-idf!31713
2024-07-25 16:24:18 +08:00
fd6e699728 Merge branch 'feat/lp_core_lp_spi_support_v5.3' into 'release/v5.3'
feat(lp-spi): Added support for LP SPI to the LP core (v5.3)

See merge request espressif/esp-idf!31762
2024-07-25 16:24:04 +08:00
e438c6973a Merge branch 'fix/duplicate_linux_target_kconfig_v5.3' into 'release/v5.3'
fix(kconfig): Removed duplicate entry for IDF_TARGET_LINUX in Kconfig (v5.3)

See merge request espressif/esp-idf!32027
2024-07-25 16:23:26 +08:00
93578b5b15 Merge branch 'fix/lp_i2c_generates_spurious_start_cond_v5.3' into 'release/v5.3'
fix(lp-i2c): Fixed the generation of spurious I2C start with lp-i2c (v5.3)

See merge request espressif/esp-idf!32107
2024-07-25 16:23:17 +08:00
5a1f4f389c fix(ci): Update LATEST_GIT_TAG variable 2024-07-25 13:53:10 +05:30
0ae2bf5b4a Merge branch 'ci/esp_intr_dump_qemu_timeout_v5.3' into 'release/v5.3'
ci(qemu): increase timeout for esp_intr_dump test (v5.3)

See merge request espressif/esp-idf!31787
2024-07-25 16:22:27 +08:00
bed5aa5429 feat(openthread): support restoring vendor properties of rcp 2024-07-25 16:00:46 +08:00
ee788924eb feat(openthread): support changing openthread version information 2024-07-25 16:00:40 +08:00
215e1391ce fix(hal): updated ecdsa reset api to execute correctly
This commit updated API to ensure ECDSA peripheral resets
and waits until the state returns to idle.
2024-07-25 10:34:12 +05:30
6a9e8278a1 feat(examples): upgrade esp_cam_sensor component for isp/auto_focus 2024-07-25 09:34:22 +08:00
a2666d6f2c fix(wifi_prov): Added API to set random address 2024-07-24 20:52:37 +05:30
7db459d85f docs(usb): Add USBH maintainer notes 2024-07-24 15:21:02 +08:00
a602befe1b refactor(usb/usbh): Update USBH device creation and enumeration handling
This commit updates how the USBH handles device creation and enumeration so that
upper layers (such as the Hub driver) can use the USBH API for enumeration instead
of calling the HCD.

USBH Updates:

USBH now creates unenumerated devices set to address 0 with no device/config
descriptor. A newly created device can be opened and communicated with immediately
(using control transfers). This allows the Hub driver to call the USBH instead of
the HCD. Summary of USBH changes:

- Added new APIs to add/remove a device. Devices are now created as unenumerated
and can be immediately opened and communicated with.
- Added new APIs to enumerate a device (see 'usbh_dev_set_...()' functions). Device
must be locked (see 'usbh_dev_enum_lock()') before enumeration functions can be called.
- Added UID for each device. This allows the particular USBH without needing to
use the device's handle (which implies opening the device).

Hub Driver Updates:

Hub driver now calls the USBH for enumeration. Summary of USBH changes:

- Replace all 'hcd_pipe_...()' calls with 'usbh_dev_...()' calls
- Refactored port event handling to fit with new USBH API
- Updated to use UID to uniquely identify devices without opening them

USB Host Updates:

- Reroute USBH control transfers to clients and hub driver
2024-07-24 15:21:02 +08:00
df6c6f93fa refactor(usb/hub): Update Hub driver port request logic 2024-07-24 15:21:02 +08:00
3358f3ec46 refactor(usb/hcd): Allow port resets with allocated pipes
This commit updates the HCD API to allow port resets to occur even if pipes
are allocated. The pipes cannot be active and the port reset will simply
restore the pipes (by reinitializing their channel registers) following the
reset.

Changes:

- Allow port resets while channels are allocated
- Remove pipe persistance API 'hcd_pipe_set_persist_reset()'
2024-07-24 15:21:02 +08:00
8aa9a42f2b refactor(usb/usbh): Rename device pool functions and ref_count
This commit renames the following APIs and variables in the USBH:

- Rename the prefix of device pool functions from 'usbh_dev_...' to
  'usbh_devs_...'.
- Rename 'ref_count' to 'open_count'. This variable tracks the number of times
  a device has been opened.
2024-07-24 15:21:02 +08:00
c14eae95cd refactor(usb/host): Refactor USBH function grouping
This commit rearranges the USBH functions into new groupings to provide a
clearer abstraction. This is in preparation for refactoring/removing the Hub
related functions in the USBH API. This commit DOES NOT MAKE ANY BEHAVIORAL
CHANGES to the code.

Functions are now grouped into...

- USBH Processing: Functions dealing with overall USBH processing
- Device Pool: Functions that add/remove/open/close devices from the internal
               device pool
- Device: Functions that pertain to setting/getting a particular device
- Endpoints: Functions that pertain to a particular endpoint
- Transfer: Functions that pertain to sending transfers
2024-07-24 15:21:02 +08:00
d8798c4bd5 fix(ble/bluedroid): Fixed BLE cannot create connection 2024-07-24 10:51:08 +08:00
40b3f88dfb fix(coex): Fixed coexist scheme phase index overflow issue 2024-07-23 17:56:01 +08:00
715516eea5 fix(camera): fixed c2m cache ops 2024-07-23 17:49:04 +08:00
2c4812092d fix(coex): fix esp32 crash issue, fix esp32c6 rx issue 2024-07-23 17:09:09 +08:00
9db556c20e fix(pm): ssn update failed when dut wakeup from lightsleep 2024-07-23 17:08:53 +08:00
b072ccac62 fix(wifi): fix sta may join bad signal ap when set by signal
Closes https://github.com/espressif/esp-idf/issues/13958
2024-07-23 17:08:38 +08:00
240d300d64 fix(wifi): fix reset connection dns fail issue
Closes https://github.com/espressif/esp-idf/issues/12315
2024-07-23 17:08:24 +08:00
ecde808af9 fix(wifi): fixed association refused temporarily issue
1. fixed association refused temporarily issue.
2. give some information when password length mismatch authmode threshold
2024-07-23 17:08:00 +08:00
6bb959e7ee fix(wifi):fix get softap dtim and csa config err 2024-07-23 17:07:32 +08:00
1191a9e1c5 fix(wifi): Ignore 11R, ENT AP when disabled in sdkconfig 2024-07-23 17:07:06 +08:00
9e0064ba20 fix(wifi/mesh): fix the issue that xon request timeout constantly when root reboot
Closes https://github.com/espressif/esp-idf/issues/13212
2024-07-23 17:06:34 +08:00
20932eceaf fix(wifi): annotate a rom function 2024-07-23 16:42:31 +08:00
2130416e2e fix(wifi):Fix for setting wps status fail when connection fails 2024-07-23 16:39:43 +08:00
436b31be6e fix(nimble): Increase Timer stack size for nimble application 2024-07-22 15:51:24 +05:30
d1b3845aaa fix(common_components): unregister event handler if wifi disconnect and stop reconnecting 2024-07-22 16:46:35 +08:00
6fa12ecdf8 fix(psram): fixed p4 psram 20M wrong clk div 2024-07-22 09:27:11 +08:00
436bf0b1ee feat(openthread): update openthread submodule 2024-07-19 19:22:47 +08:00
99b1e56500 fix(hal): correct the power up sequence for MPI/ECC peripherals in ESP32-C5 2024-07-19 13:39:03 +08:00
7f0be0c06c feat(bt): add bt address printing for all bt examples 2024-07-19 11:43:09 +08:00
2c9aaf738d fix(bt): fix uTask stack overflow in bt example spp_initiator 2024-07-19 11:43:08 +08:00
249e7e9282 change(dw_gdma): clean up memory allocation for link list items 2024-07-19 09:58:37 +08:00
8d15c0417f fix(spi_master): change MOSI pin default idle level to low 2024-07-18 21:56:31 +08:00
c3fc7cffda fix(aes): fixed aes wrong dma desc alignment 2024-07-18 16:26:09 +08:00
a23ae5b4bf fix(dma): fix esp_dma_is_buffer_alignment_satisfied align issue when l2 cache line 128B 2024-07-18 16:23:14 +08:00
25f78b3715 fix(rmt): power up memory block 2024-07-18 14:52:15 +08:00
3a1cc2be50 fix(wifi): Free scan configuration after use when channel bitmap is used 2024-07-18 11:54:15 +05:30
5c39705bac fix(ble_mesh): fixed BLEMESH24-76 2024-07-18 10:54:53 +08:00
zwl
e497c29efe feat(bluetooth/controller): support default tx power configurable on ESP32C2 2024-07-18 10:53:55 +08:00
zwl
a2df884e64 feat(bluetooth/controller): support default tx power configurable on ESP32C6 and ESP32H2 2024-07-18 10:53:45 +08:00
zwl
d5df6dd78b fix(bluetooth/controller): fixed alloc memory fail when use uhci on ESP32-C6 and ESP32-H2 2024-07-17 19:32:22 +08:00
zwl
5a545d6885 fix(ble): fixed nimble host only build error 2024-07-17 19:32:22 +08:00
zwl
52c9d724bc feat(bluetooth/controller): update nimble host to adapt hci layer 2024-07-17 19:32:22 +08:00
zwl
09f4644629 feat(bluetooth/controller): add default cts and rts macro definition 2024-07-17 19:32:22 +08:00
zwl
9117932c6d feat(bluetooth/controller): adopting new HCI layer code on ESP32-C5 2024-07-17 19:32:22 +08:00
zwl
e761c1de8f feat(bluetooth/controller): adopting new HCI layer code and support UHCI function on ESP32-C6 and ESP32-H2 2024-07-17 19:32:22 +08:00
zwl
1390711c27 feat(bluetooth/controller): adopting new HCI layer code on ESP32-C2 2024-07-17 19:32:22 +08:00
zwl
6089f84653 feat(bluetooth/controller): optimize bt hci layer code 2024-07-17 19:32:22 +08:00
zwl
580b6fbd3c fix(ble): fixed some ble issues on ESP32C5 2024-07-17 19:32:22 +08:00
zwl
04e543949e fix(ble): fixed some ble controller issues on ESP32C6 and ESP32H2 2024-07-17 19:32:22 +08:00
zwl
5a6b9fc1b2 fix(ble): fixed some ble controller issues on ESP32-C2 2024-07-17 19:32:22 +08:00
de7b7bc880 fix(rmt): fix gcc static analyzer warnings 2024-07-17 18:42:32 +08:00
e0991facf5 Merge branch 'bugfix/fix_esp32p4_deepsleep_gpio_wakeup_support_v5.3' into 'release/v5.3'
feat(esp_hw_support): support esp32p4 gpio/ext1 wakeup deepsleep (v5.3)

See merge request espressif/esp-idf!32164
2024-07-17 11:03:25 +08:00
c2cf3d7a0b Merge branch 'fix/stall_other_core_in_cpu_freq_switching_v5.3' into 'release/v5.3'
fix(esp_hw_support): stall another core during cpu/mem/apb freq switching (v5.3)

See merge request espressif/esp-idf!32163
2024-07-17 10:42:44 +08:00
51a102a467 feat(example): update gpio/ext1 wakeup avaliable IO num in example Kconfig 2024-07-16 22:00:40 +08:00
603ad059a3 fix(esp_hw_support): hold LP_IO mode if LP_PERI domain powerdown in sleep 2024-07-16 22:00:40 +08:00
074035aac5 feat(esp_hw_support): support esp32p4 gpio wakeup deepsleep 2024-07-16 21:58:45 +08:00
4c2b86f5fe fix(esp_hw_support): stall another core during cpu/mem/apb freq switching 2024-07-16 21:47:04 +08:00
02e19c4f9a Merge branch 'bugfix/wrong_ic_parameters_in_connect_v5.3' into 'release/v5.3'
fix(wifi): Fix issue of supplicant using wrong parameters to configure bss (Backport v5.3)

See merge request espressif/esp-idf!32068
2024-07-15 19:37:58 +08:00
28c124d210 Merge branch 'fix/fix_stuck_in_bootloader_random_enable_v5.3' into 'release/v5.3'
fix(esp_system): fix stuck in bootloader_random_enable after lightsleep (v5.3)

See merge request espressif/esp-idf!32021
2024-07-15 19:37:40 +08:00
5c180bf3b6 Merge branch 'feat/esp32p4eco_sleep_feature_update_v5.3' into 'release/v5.3'
feat(esp_hw_support): esp32p4eco1 sleep feature update (v5.3)

See merge request espressif/esp-idf!31682
2024-07-15 19:35:56 +08:00
2a24cc206e fix(console): USB Serial JTAG freezes when input received before init
When data was sent through USB Serial JTAG before the
driver was installed, the bus was malfunctioning. This
was because the interrupt bit for data reception was cleared
regardless of whether data was received or not. Consequently,
usb_serial_jtag_isr_handler_default was not triggered and the
data was never read causing the bus to malfunction.

This commit is modifying usb_serial_jtag_driver_install to
prevent clearing USB_SERIAL_JTAG_INTR_SERIAL_OUT_RECV_PKT and
USB_SERIAL_JTAG_INTR_SERIAL_IN_EMPTY thus allowing the callback
usb_serial_jtag_isr_handler_default to trigger for possible data
exchanged prior to the call to usb_serial_jtag_driver_install.

This commit also modified the while logic in linenoiseProbe to
discard any data that doesn't match the expected chaaracter sequences
to prevent random input from interfering with evaluating whether the
terminal supports escape sequences or not.

See https://github.com/espressif/esp-idf/issues/13940
2024-07-15 10:17:00 +02:00
c85dc30b45 test(psram): enable bss psram test 2024-07-15 15:58:00 +08:00
0b5db82e5e feat(psram): support bss on psram on p4 2024-07-15 15:56:23 +08:00
aacfe19a4e fix(esp_mm): for existing mmap region, consider new offset for virtual addr
While returning virtual address for existing memory mapped region, newly
supplied offset from the physical address was not getting considered.

This was a regression present from ESP-IDF 5.1 release.

Added test case in spi_flash component that fails without this fix.

Closes https://github.com/espressif/esp-idf/issues/13929
2024-07-15 12:42:06 +08:00
22f1d28533 feat(cache): supported cache panic on p4 2024-07-15 10:16:54 +08:00
9e34963397 feat(panic): supported more cache error cactch 2024-07-15 10:16:47 +08:00
2c7958735d refactor(lp_ana_periph): sync the reg names to TRM (part2) 2024-07-13 15:47:20 +08:00
2ee7f0e133 refactor(touch): refactor the filter configuration 2024-07-13 15:47:20 +08:00
a775317091 refactor(lp_ana_periph): sync the reg names to TRM 2024-07-13 15:47:20 +08:00
96e370f9bb fix(touch): fix driver coverity issue 2024-07-13 15:47:20 +08:00
e6103c521a docs(touch): add doc for cap touch sens driver 2024-07-13 15:47:20 +08:00
82cba6e3ff feat(touch_sens): add example for the touch sensor v3 2024-07-13 15:47:20 +08:00
8a6f25738c ci(touch): add test cases for cap touch sens driver 2024-07-13 15:47:20 +08:00
8a18ae60e0 feat(touch_sens): touch sensor driver-ng on P4 2024-07-13 15:47:20 +08:00
5f6ddad456 fix(lp-i2c): Fixed the generation of spurious I2C start with lp-i2c
This commit fixes an issue with LP I2C and RTC I2C where in the
peripherals generated a spurious I2C start condition when initialized.
This caused some sensors to not respond properly to the following read
or write request.

Closes https://github.com/espressif/esp-idf/issues/14043
Closes https://github.com/espressif/esp-idf/issues/11608
2024-07-12 17:39:53 +02:00
f8bbf3f32d fix(usb_dwc_hal): Enabled precise detection of VBUS 2024-07-12 11:16:24 +02:00
172784733c Merge branch 'feat/wifi_remote_examples_v5.3' into 'release/v5.3'
fix(esp_wifi_remote): Using remote wifi on standard (protocol) examples (v5.3)

See merge request espressif/esp-idf!31903
2024-07-12 16:06:59 +08:00
2475e6cd5d fix(wpa_supplicant): Avoid delaying removal of wps enrollee by 10ms
This is no longer needed as eloop timers are now executed in wifi task context.
2024-07-12 12:07:50 +05:30
821f4a181f fix(wpa_supplicant): Handle case when WPS registrar misses WSC_DONE sent by station
When registrar somehow misses the WSC_DONE sent by station and station
goes for next connection after sending deauth, make sure that softAP
disables the registrar.
2024-07-12 12:07:44 +05:30
8a0a093cd1 fix(wifi): fix esp32 host lack of lmac api issue 2024-07-12 13:59:32 +08:00
8cac15e95b ci(spi_lcd): re-enable spi_lcd test on p4 2024-07-12 13:22:47 +08:00
5deaedfab1 fix(wifi): Fix issue of supplicant using wrong parameters to configure bss
- Ensure that wpa_supplicant's state machine registers the requirement for rsnxe
  before deciding to add rsnxe to a assoc request.

Co-authored-by: jgujarathi <jash.gujarathi@espressif.com>
2024-07-12 10:16:15 +05:30
64ace5b6d8 fix(esp_hw_support): fix cpu_retention cache invalidate mask 2024-07-11 22:01:49 +08:00
edf14a1de1 fix(esp_hw_support): disable mpll clock after L1 dcache writeback 2024-07-11 13:59:42 +08:00
f6974ab183 fix(nimble): Update menuconfig option to consider 5.0 support 2024-07-10 17:21:45 +05:30
ed7dd46687 Merge branch 'feat/sdmmc_spi_no_crc_v5.3' into 'release/v5.3'
feat(sdmmc_io): support sending CMD53 with fixed address, bypass sdspi crc check (v5.3)

See merge request espressif/esp-idf!31075
2024-07-10 17:15:24 +08:00
432aa793c4 fix(kconfig): Removed duplicate entry for IDF_TARGET_LINUX in Kconfig
This commit removes a duplicate entry for the IDF_TARGET_LINUX Kconfig
option in the project Kconfig file.

Closes https://github.com/espressif/esp-idf/issues/14145
2024-07-10 09:17:54 +02:00
f66ff91e4f feat(dvp): DVP cam supports more color format and don't initialize xclock pin 2024-07-10 14:56:11 +08:00
108123d50c fix(esp_system): fix stuck in bootloader_random_enable after lightsleep 2024-07-10 14:22:39 +08:00
c3af6db044 fix(ble/bluedroid): Fixed BLE set adv param check 2024-07-10 12:25:39 +08:00
095a0dd85f feat(ble/bluedroid): Support BLE50 instance in related event 2024-07-09 15:23:46 +08:00
d6162c4a78 fix(i2c): Fix i2c not release semaphore in command send loop,
Closes https://github.com/espressif/esp-idf/issues/13962
2024-07-08 15:12:49 +08:00
418ddda7ef fix(bt/controller): Fixed some controller bugs
- Fixed fail to establish eSCO when connected to two devices
- Changed some error log level to Debug if the error have a workaround

Closes https://github.com/espressif/esp-idf/issues/12340
2024-07-08 14:26:26 +08:00
1c5bcc4a5d fix(bt/controller): Fixed not report HCI_Disconnection_Complete event 2024-07-08 14:26:01 +08:00
1506144d3a fix: fixed allocating if_name in client context multiple times
Do not allocate client->if_name twice in esp_http_client_init().

Signed-off-by: Harshit Malpani <harshit.malpani@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/13945
2024-07-07 21:19:42 +08:00
44f58ecb51 Merge branch 'fix/c6_bootloader_rng_enable_v5.3' into 'release/v5.3'
fix(bootloader_support): Fixed pattern in RNG enable function to avoid output on IO0 (v5.3)

See merge request espressif/esp-idf!31905
2024-07-05 16:22:06 +08:00
4e0d5c923d fix(sdmmc_io): fixed fixed_addr mode will still increase addr when splitting 2024-07-05 14:47:50 +08:00
42cf452da3 Merge branch 'fix/disable_ecdsa_key_manager_for_p4_v5.3' into 'release/v5.3'
fix(soc): Disable key manager and ECDSA peripheral support for esp32p4 (v5.3)

See merge request espressif/esp-idf!31768
2024-07-05 13:59:20 +08:00
33c3d327c5 Merge branch 'feat/esp32p4_default_rev_0.1_v5.3' into 'release/v5.3'
feat(esp32p4): make revision v0.1 the default version (v5.3)

See merge request espressif/esp-idf!31601
2024-07-05 10:52:02 +08:00
083db8a169 fix(bootloader_support): Fixed pattern in RNG enable function on C6 to avoid output on IO0 2024-07-04 11:36:31 +02:00
d9e4ec6c0a fix(examples): Add wifi_remote option to common connect example
* Add MQTT test configuration with WiFi on ESP32-P4
* Document esp_wifi_remote workflow in the example's README
2024-07-04 11:14:46 +02:00
a83b39f96c docs(wifi):update TWT docs 2024-07-04 14:48:46 +08:00
9b6b8ac41b fix(ble_mesh): ensure the operation of adv busy is thread-safe 2024-07-04 12:13:34 +08:00
cd627d6453 feat(ble_mesh): add cas operation for bt_mesh_atomic_val_t 2024-07-04 12:13:34 +08:00
ffe0de9607 Merge branch 'bugfix/fix_idfgh_12600_v5.3' into 'release/v5.3'
fix(coex): fix ESP32 Wi-Fi cant tx after sw_reset with BLE scan

See merge request espressif/esp-idf!31788
2024-07-04 10:56:30 +08:00
32334c7a25 Merge branch 'bugfix/fixed_hci_uart_error_on_esp32c6_esp32h2_v5.3' into 'release/v5.3'
feat(bluetooth/controller): Fixed the issue of unresponsiveness when using hci... (v5.3)

See merge request espressif/esp-idf!31750
2024-07-03 17:21:18 +08:00
a56a4b8980 fix(soc): Disable key manager and ECDSA peripheral support for esp32p4
The support is disabled only for ECO1 and below
2024-07-03 15:28:41 +08:00
90149f6ffd fix(usb/host): Decode error flags in ISOC transfers 2024-07-03 09:15:48 +02:00
c60e627bba docs: Migrate user guides of ESP32-C3-DevKitM and ESP32-C3-DevKitC to esp-dev-kits 2024-07-01 15:26:49 +08:00
9d60b907d5 fix(openthread): register uart vfs devices when they are not registered 2024-06-28 16:02:27 +08:00
901158540e test(misc): enable misc tests that have been missed during bringup 2024-06-28 15:02:03 +08:00
1c95a38ed1 test: Added LP core unit tests for LP SPI
This commit adds tests for LP SPI master and LP SPI slave devices.
2024-06-28 08:57:28 +02:00
f910f13de9 feat(lp-spi): Added support for LP SPI driver to the LP Core on esp32p4
This commit adds LP SPI master and LP SPI slave support for the LP Core
on the esp32p4.
2024-06-28 08:57:28 +02:00
9417e857a8 fix(coex): fix ESP32 Wi-Fi cant tx after sw_reset with BLE scan
Closes https://github.com/espressif/esp-idf/issues/13598
2024-06-28 14:33:40 +08:00
f3a5160e2c ci(qemu): increase timeout for esp_intr_dump test 2024-06-28 14:24:44 +08:00
0291269573 fix(esp_hw_support): wait eFuse controller idle after sleep wakeup 2024-06-28 13:58:44 +08:00
6e1d598703 fix(esp_hw_support): reset smp core state if the sleep request is rejected by hardware 2024-06-28 13:58:44 +08:00
eb45491d00 feat(esp_hw_support): bypass rst_reason override for esp32p4eco1 2024-06-28 13:58:44 +08:00
fdb0dd23ca feat(esp_hw_support): support LP_Peripheral & CNNT power domain auto powerdown on esp32p4eco1 2024-06-28 13:58:44 +08:00
6b1a173030 Merge branch 'docs/fix_ulp_doxygen_comment_v5.3' into 'release/v5.3'
docs(ulp): fix doxygen comment formatting (v5.3)

See merge request espressif/esp-idf!31767
2024-06-28 12:27:57 +08:00
429eb0952c fix(ble/bluedroid): Fixed BLE report event when connection fails 2024-06-28 12:00:33 +08:00
350d4c03da docs(ulp): fix doxygen comment formatting 2024-06-27 17:08:25 +08:00
zwl
2543313f80 feat(bluetooth/controller): Fixed the issue of unresponsiveness when using hci uart mode on ESP32-C5 2024-06-26 17:33:24 +08:00
zwl
d617f8d5b0 feat(bluetooth/controller): Fixed the issue of unresponsiveness when using hci uart mode on ESP32-C6 and ESP32-H2 2024-06-26 17:33:24 +08:00
2845990aff feat(bt/bluedroid): Add definition for the reason of BLE authentication failure 2024-06-26 17:25:39 +08:00
14b64bfede fix(bt/bluedroid): Fixed BLE security vulnerability when using fixed IRK 2024-06-26 17:25:24 +08:00
73ef188a8c fix(bt): Overwrite a function in esp32c3 eco7 rom 2024-06-26 17:23:29 +08:00
1b36724897 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(0738a61)
- Fixed BT BB interrupt allocation
- Refactor the prefix of assert print
- Fixed HCI LE set privacy mode command handle
2024-06-26 17:23:29 +08:00
ad31f4f029 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(eca46a0)
- Fixed adv data buffer free after restart adv
- Fixed BLE interrupt allocation using esp API
2024-06-26 17:23:29 +08:00
dc9f9bf957 docs(pm): add description for gpio_wakeup 2024-06-26 14:04:49 +08:00
91aab8e6fd Merge branch 'docs/update_c5_esp_timer_docs_v5.3' into 'release/v5.3'
docs(sys-time): add esp32c5 info into programming guide docs (v5.3)

See merge request espressif/esp-idf!31561
2024-06-25 16:59:37 +08:00
8cabe4380b docs(sys-time): add esp32c5 info into programming guide docs 2024-06-25 15:35:11 +08:00
4cfea9e864 Merge branch 'feat/put_bt_interface_code_to_rom_v5.3' into 'release/v5.3'
Feat/put bt interface code to rom (v5.3)

See merge request espressif/esp-idf!31549
2024-06-25 13:57:29 +08:00
3e3e1c77ba change(aes): refactor DMA buffer allocation 2024-06-25 13:49:24 +08:00
b52b99a756 change(adc): refactor DMA memory allocation 2024-06-25 13:49:24 +08:00
d054c4bcb6 fix(huk): switch case fall through unexpected 2024-06-25 13:42:22 +08:00
e7b6fb75d4 Merge branch 'bugfix/fix_phy_cal_data_v5.3' into 'release/v5.3'
fix(phy): add phy calibration data check when mode is not none calibration(v5.3)

See merge request espressif/esp-idf!31480
2024-06-25 11:36:50 +08:00
d83e4bcfbe Merge branch 'fix/trigger_system_reset_in_brownout_isr_v5.3' into 'release/v5.3'
change(esp_system): trigger digital system reset in brownout isr  (v5.3)

See merge request espressif/esp-idf!31683
2024-06-25 09:40:51 +08:00
92c239d9b0 Merge branch 'docs/add_signature_verification_numbers_esp32p4_v5.3' into 'release/v5.3'
docs(secure_boot): Add secure boot signature verification time for esp32p4 (v5.3)

See merge request espressif/esp-idf!31688
2024-06-25 09:40:03 +08:00
e722672fcc Merge branch 'doc/p4_rng_v5.3' into 'release/v5.3'
docs(esp_hw_support): Adjusted RNG docs to reflect P4 changes (v5.3)

See merge request espressif/esp-idf!31658
2024-06-25 09:26:43 +08:00
2d397782d8 Merge branch 'docs/freertos_docs_for_c5_c61_v5.3' into 'release/v5.3'
docs(freertos): Enabled FreeRTOS docs for esp32c5 (v5.3)

See merge request espressif/esp-idf!31538
2024-06-25 01:01:00 +08:00
4a919356ba fix(bt/bluedroid): Fixed deadlock caused by not unlocking 2024-06-25 00:59:25 +08:00
6c01ce3ae2 fix(bt/bluedroid): Fixed L2CAP using wrong handle
- Fixed the issue of using the wrong handle to handle the BTA_JV_L2CAP_READ_EVT event.
- Closes https://github.com/espressif/esp-idf/issues/13847
2024-06-25 00:59:25 +08:00
397b1e51a5 Merge branch 'fix/docs_wifi_get_sta_list_v5.3' into 'release/v5.3'
fix(docs): tcpip_adapter: Document replacement of tcpip_adapter_get_sta_list (v5.3)

See merge request espressif/esp-idf!31170
2024-06-25 00:58:33 +08:00
6c7c212f98 Merge branch 'feat/update-memory-layout-c5-mp_v5.3' into 'release/v5.3'
feat(heap): support heap and update memory layout on esp32c5-mp target (backport v5.3)

See merge request espressif/esp-idf!31040
2024-06-25 00:55:00 +08:00
c56b21bbd5 Merge branch 'bugfix/wifi-6570_v5.3' into 'release/v5.3'
backport v5.3: fix the issue of wifipwr losing its clock during sleep on the esp32c6 eco1

See merge request espressif/esp-idf!31602
2024-06-25 00:29:10 +08:00
52a5fbf3f9 fix(ulp-risc-v): Fixed RTC I2C multi-byte read/write issue for ULP RISC-V
This commit fixes an issue where multi-byte reads and writes over the
RTC I2C peripheral got stuck on the esp32s2 and esp32s3.

Closes https://github.com/espressif/esp-idf/issues/12235
2024-06-24 17:10:36 +02:00
8f9467dc2b Merge branch 'feature/support_esp32p4_dcdc_always_on_v5.3' into 'release/v5.3'
feat(esp_hw_support): support esp32p4 dcdc always on during lightsleep (v5.3)

See merge request espressif/esp-idf!31681
2024-06-24 20:12:51 +08:00
3105644642 feat(esp32p4): make revision v0.1 the default version 2024-06-24 20:11:02 +08:00
872319ac5e fix(phy): add phy calibration data check when mode is not none calibration 2024-06-24 20:05:09 +08:00
34e5669b7b Merge branch 'bugfix/wpa3_init_crash_v5.3' into 'release/v5.3'
fix(wpa_supplicant): Fix wpa3 AP crash because of dangling pointer (v5.3)

See merge request espressif/esp-idf!31540
2024-06-24 19:58:27 +08:00
11d946582c Merge branch 'bugfix/revert_c5_threshold_changes_v5.3' into 'release/v5.3'
Revert "fix(rom): fixed esprv_int_set_threshold on C5" (v5.3)

See merge request espressif/esp-idf!31507
2024-06-24 19:58:03 +08:00
0a1dc07248 Merge branch 'bugfix/fix_dhcp_pool_issue_on_dhcp_server_v5.3' into 'release/v5.3'
fix(lwip): fixed the dhcp pool error on dhcp server (v5.3)

See merge request espressif/esp-idf!31264
2024-06-24 19:43:41 +08:00
ae4013c1a6 fix(bt): add integrity check when temporary link key selected 2024-06-24 17:48:27 +08:00
1ae89b72cb fix(wifi): fix the issue of wifipwr losing its clock during sleep on the esp32c6 eco1 2024-06-24 16:46:17 +08:00
7e1bdbd683 fix(tools/esp_prov): Fix incorrect input decoding when using console transport
- Closes https://github.com/espressif/esp-idf/issues/14013
2024-06-24 12:28:31 +05:30
18470061ab docs(secure_boot): Add secure boot signature verification time for esp32p4 2024-06-24 12:25:42 +05:30
31439dfd77 Merge branch 'ci/do_not_build_rmt_examples_when_not_supported' into 'release/v5.3'
fix(ci): build rmt examples as long as it's driver support is finished

See merge request espressif/esp-idf!31672
2024-06-24 14:39:37 +08:00
561146f52b fix(lwip): fixed the dhcp pool error on dhcp server 2024-06-24 14:21:28 +08:00
32c12e57da Merge branch 'contrib/github_pr_13951_v5.3' into 'release/v5.3'
Fix stack overflow bug for `examples/bluetooth/esp_hid_device` when using esp32s3 with nimble (GitHub PR) (v5.3)

See merge request espressif/esp-idf!31515
2024-06-24 14:05:08 +08:00
d6eedc04bf Revert "fix(intr): fixed intr threshhold min level on C5"
This reverts commit a6c2c4149d.
2024-06-24 13:57:57 +08:00
69ab9d7a17 Revert "fix(rom): fixed esprv_int_set_threshold on C5"
This reverts commit 171e0a21a1.
2024-06-24 13:57:57 +08:00
33e6eaaabf fix(wpa_supplicant): Fix wpa3 AP crash because of dangling pointer 2024-06-24 13:54:30 +08:00
04429c9042 change(esp_hw_support): update xtal_freq after assume to avoid mass print in DFS 2024-06-24 11:56:39 +08:00
6eae7bc996 change(esp_system): trigger digital system reset in brownout isr 2024-06-24 11:56:38 +08:00
dd5a5f1cf2 feat(esp_hw_support): support DCDC always on 2024-06-24 11:48:23 +08:00
79c48b4707 feat(esp_pm): add DCDC always on config 2024-06-24 11:48:18 +08:00
ce7393f67b Merge branch 'docs/esp32p4_storage_v5.3' into 'release/v5.3'
docs(storage): update esp32p4 storage programming guide (v5.3)

See merge request espressif/esp-idf!31600
2024-06-24 11:35:33 +08:00
fd6720c2e4 Merge branch 'fix/sdsdpi_example_esp32p4_add_ldo_config_v5.3' into 'release/v5.3'
fix(storage): Fix and update storage examples using SD cards for SoCs with SOC_SDMMC_IO_POWER_EXTERNAL 1 (ESP32-P4) (v5.3)

See merge request espressif/esp-idf!31029
2024-06-24 11:35:03 +08:00
fe2b23b93a fix(i2c_lcd): using function overloading to keep esp_lcd_new_panel_io_i2c
becuase _Generic is not available in C++

Closes https://github.com/espressif/esp-idf/issues/14037
2024-06-24 10:52:28 +08:00
8d8d8cbf18 fix(lcd): build errors with deprecated lcd types in cpp
Closes https://github.com/espressif/esp-idf/issues/14029
2024-06-24 10:52:28 +08:00
8562e3be12 fix(ci): build rmt examples as long as it's driver support is finished 2024-06-24 10:50:11 +08:00
4189c54abb feat(isp_awb): support to change config after initialized 2024-06-24 10:49:20 +08:00
b0fcdccd5b fix(isp_awb): fixed continuous mode only triggered once 2024-06-24 10:49:20 +08:00
4b3e014076 docs(isp_awb): add isp awb programming guide 2024-06-24 10:49:20 +08:00
8c225c0200 feat(isp_awb): support isp auto white balance 2024-06-24 10:49:20 +08:00
4b08ddb0f3 feat(hal_utils): added float to fixed point function 2024-06-24 10:49:20 +08:00
f7baa7feb2 fix(ble): added c6 config check for ble light sleep 2024-06-24 10:40:46 +08:00
zwl
a21f65cb5b feat(bluetooth/controller): adjust bt/porting code structure and delete redundant code 2024-06-24 10:40:33 +08:00
zwl
430d65225e feat(bluetooth/controller): update controller api name on ESP32-C5 2024-06-24 10:39:28 +08:00
zwl
064fa71277 feat(bluetooth/controller): update controller api name on ESP32-C2 2024-06-24 10:39:28 +08:00
zwl
9fbec0a819 feat(bluetooth/controller): update controller api name on ESP32-C6 and ESP32-H2 2024-06-24 10:39:28 +08:00
cabf41c1c6 Merge branch 'ci/disable_c5_build_v5.3' into 'release/v5.3'
ci: disable failing esp32c5 builds (v5.3)

See merge request espressif/esp-idf!31571
2024-06-21 16:45:17 +08:00
357e0f9bf1 docs(esp_hw_support): Adjusted RNG docs to reflect P4 changes 2024-06-21 09:58:08 +02:00
1b8bae3e15 Merge branch 'bugfix/wpa3_sta_mem_leak_v5.3' into 'release/v5.3'
Fix memory leak in wpa3 station mode (Backport v5.3)

See merge request espressif/esp-idf!31636
2024-06-21 13:38:55 +08:00
5d480b9e89 Merge branch 'ci/fix_misc_c5_ci_errors' into 'release/v5.3'
misc c5 ci errors (v5.3)

See merge request espressif/esp-idf!31625
2024-06-21 10:46:01 +08:00
9e95b9b29c fix(esp_wifi): Backport some fixes to v5.3
1. Fix issue of station PMF not getting reset when disconnecing from PMF connection
2. Fix a memory leak that occurs when the SAE connection is interrupted
3. Drop any received auth responses that use a different algorithm than the one currently in use
2024-06-20 15:29:05 +05:30
14d93dea75 feat(soc): Update efuse related soc_caps for c61 and c5 (MP/beta3) 2024-06-20 12:23:05 +08:00
7e5ab45fbb ci(rom): disable rom wdt test on C5 2024-06-20 12:22:56 +08:00
1056a02ba9 Merge branch 'feat/esp32c5_mp_uart_support_v5.3' into 'release/v5.3'
feat(uart): support HP/LP uart on ESP32C5 MP (backport v5.3)

See merge request espressif/esp-idf!31445
2024-06-20 10:31:05 +08:00
8bcedab874 Merge branch 'bugfix/free_memory_before_reattempt_v5.3' into 'release/v5.3'
fix(nimble): Clear resource before re-starting advertising (v5.3)

See merge request espressif/esp-idf!31570
2024-06-19 18:42:40 +08:00
786b68743b docs: Delete user guide esp32-s2-devkitm-1 2024-06-19 18:09:09 +08:00
dbe5a59412 docs(storage): update esp32p4 storage programming guide 2024-06-19 10:44:58 +02:00
fbd6c9737e fix(ulp-risc-v): Set RTC GPIO output mode in the correct register for ULP RISC-V
According to the ESP32-S2/S3 TRM, the output pin's mode is set in the RTC_GPIO_PINn_REG
by programming the RTC_GPIO_PINn_PAD_DRIVER bit. The current ULP RISC-V RTCIO driver
however, incorrectly programs the RTC_IO_TOUCH_PADn_REG register field RTC_IO_TOUCH_PADn_DRV.
This commit fixes the bug.
2024-06-19 08:59:57 +02:00
8a668d6c03 ci: disable failing esp32c5 builds 2024-06-18 08:27:00 +02:00
81b43829a2 fix(nimble): Clear resource before re-starting advertising 2024-06-18 11:11:29 +05:30
f3ebebb1dd fix(gptimer): re-enable test on P4
Remove timer_get_counter_time_sec in the ISR. Keep ISR as fast as
possible and not allow FPU usage.
2024-06-17 15:03:56 +08:00
ceb6ec92b3 docs(freertos): Enabled FreeRTOS docs for esp32c5
This commit enables the FreeRTOS doc build for esp32c5.
2024-06-17 08:53:48 +02:00
8887599119 Fix stack overflow bug for examples/bluetooth/esp_hid_device when using esp32s3 with nimble
Related to 60354c39a9
2024-06-14 14:28:59 +05:30
04cf7d1230 fix(tools/idf_tools.py): Improve the warning message about the environment 2024-06-14 10:01:05 +02:00
32c6ee8532 change(heap): Remove todo of closed ticket in memory_layout.c files
Leftover closed ticket removed from memory_layout.c on
the following targets:
- esp32c5
- esp32c6
- esp32h2
2024-06-14 08:20:02 +02:00
2ac0fc1f6a change(heap): Update soc_memory_regions on esp32c5
The array of memory regions is simplyfied by using the
macro defined in soc.h (for beta3 and mp respectively).
2024-06-14 08:20:02 +02:00
79b7e2cd97 fix(soc): Fix ROM stack start for esp32c5-mp
Update the value SOC_ROM_STACK_START to the expected
value from bootloader.ld memory map.
2024-06-14 08:20:02 +02:00
f7faae7c2d fix(soc): fix the pms reg headers base addr 2024-06-14 12:55:03 +08:00
5869850af2 feat: add esp32p4 APM HAL/LL API 2024-06-14 12:55:03 +08:00
7d47aecaa8 Merge branch 'bugfix/wifi-5610_v5.3' into 'release/v5.3'
backport v5.3: fix the issue of tbtt interrupt miss caused by beacon monitor

See merge request espressif/esp-idf!31498
2024-06-14 06:51:17 +08:00
e2c042da21 Merge branch 'bugfix/esp32c6_update_ld_v5.3' into 'release/v5.3'
fix(wifi):esp32c6 update ld(Backport v5.3)

See merge request espressif/esp-idf!31499
2024-06-14 06:14:19 +08:00
ce145a2c92 fix(wifi):esp32c6 update ld 2024-06-13 20:18:59 +08:00
a3a9624ca2 fix(esp_wifi): fix the issue of tbtt interrupt miss caused by beacon monitor 2024-06-13 20:17:11 +08:00
e6230e49cb Merge branch 'feat/support_tg_retention_v5.3' into 'release/v5.3'
change(esp_hw_support): do TG WDT/Timer retention by needs (v5.3)

See merge request espressif/esp-idf!31486
2024-06-13 19:55:02 +08:00
9ddf01407f Merge branch 'bugfix/fix_ble_evt_time_v5.3' into 'release/v5.3'
fix(ble/controller): Update esp32 bt-lib (1e63e23) (v5.3)

See merge request espressif/esp-idf!31481
2024-06-13 19:54:30 +08:00
f1989b0dc1 docs(esp_eth): enabled Configure MAC and PHY section for P4 2024-06-13 13:53:37 +02:00
edc2bd8aab Merge branch 'bugfix/esp_rom_clic_thresh_bug_v5.3' into 'release/v5.3'
fix(rom): fixed esprv_int_set_threshold on C5/C61 (v5.3)

See merge request espressif/esp-idf!31490
2024-06-13 18:57:18 +08:00
a70355be55 Merge branch 'fix/fix_not_necessary_public_require_from_esp_system_to_btld_support_v5.3' into 'release/v5.3'
esp_system: fixed not necessary public require to bootloader_support (v5.3)

See merge request espressif/esp-idf!31453
2024-06-13 17:41:59 +08:00
02b60f59db Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
fix(wifi): backport some wifi fixes to v5.3

See merge request espressif/esp-idf!31476
2024-06-13 17:40:36 +08:00
aaf371027d fix(bt/controller): Fixed assert issue caused by DPORT access 2024-06-13 17:37:39 +08:00
171e0a21a1 fix(rom): fixed esprv_int_set_threshold on C5 2024-06-13 16:47:48 +08:00
f6348050e4 fix(ble/controller): Update esp32 bt-lib (1e63e23)
- Optimized GATT write and notify throughput on ESP32
- Fixed BLE connect timeout after using DTM on ESP32
- Added ke memory debug tools on ESP32
- Fixed memory leak issue when BLE SCAN and other event coexist on ESP32
2024-06-13 16:42:17 +08:00
2ab144dc3a fix(esp_hw_support): set pau entry backup configuration with link update 2024-06-13 14:08:37 +08:00
1854036f92 change(esp_hw_support): use union retention link priority definiation 2024-06-13 14:08:37 +08:00
26cb10acbf feat(esp_hw_support): optimize retention link info dump 2024-06-13 14:08:36 +08:00
a27aa02fa3 fix(esp_hw_support): use iterator for regdma_link_stats to save stack consume
Closes https://github.com/espressif/esp-idf/issues/13288
2024-06-13 14:08:36 +08:00
a641428941 fix(ci): use esp_rom_crc32_le in sleep retention frame check 2024-06-13 14:08:35 +08:00
d917f0fa1b ci(esp_driver_gptimer): add gptimer pd_top sleep retention test case 2024-06-13 14:08:35 +08:00
8093516420 ci(esp_system): add task watchdog pd_top sleep retention test case 2024-06-13 14:08:35 +08:00
3785506ec1 change(esp_driver_gptimer): do gptimer timer target retention by needs 2024-06-13 14:08:34 +08:00
ea142bb6d1 change(esp_hw_support): do timergroup watchdogs retention by needs 2024-06-13 14:08:26 +08:00
e282468502 Merge branch 'refactor/avoid_using_git_v5.3' into 'release/v5.3'
fix(tools): Avoiding crashing when Git is not present in system when acquiring IDF version (v5.3)

See merge request espressif/esp-idf!31432
2024-06-13 14:04:49 +08:00
3db95e4f0e Merge branch 'fix/cleanup_unaccessible_sha3_regs_v5.3' into 'release/v5.3'
fix(soc): Cleanup inaccessible SHA_3 registers from the header files (v5.3)

See merge request espressif/esp-idf!31440
2024-06-13 14:04:06 +08:00
ca36dff148 Merge branch 'docs/c5_core_docs_v5.3' into 'release/v5.3'
docs(core): update misc docs for C5 (v5.3)

See merge request espressif/esp-idf!31452
2024-06-13 14:03:45 +08:00
fea0f0cf26 Merge branch 'docs/fix_broken_links_v5.3' into 'release/v5.3'
docs(links): fix broken links found in CI (v5.3)

See merge request espressif/esp-idf!31271
2024-06-13 14:00:26 +08:00
c8264eb519 Merge branch 'docs/fix_doxygen_1_9_8_failure_v5.3' into 'release/v5.3'
docs(doxygen): fix misc issues with new version of doxygen (v5.3)

See merge request espressif/esp-idf!31186
2024-06-13 13:58:40 +08:00
7ac551b870 Merge branch 'docs/esp32p4_apptrace_v5.3' into 'release/v5.3'
docs(app_trace): Update docs for ESP32-P4 (v5.3)

See merge request espressif/esp-idf!31169
2024-06-13 13:58:00 +08:00
c48f84e0ac Merge branch 'fix/gdbgui_version_check_v5.3' into 'release/v5.3'
fix(tools): Use GDGBUI arguments based on its version (v5.3)

See merge request espressif/esp-idf!31037
2024-06-13 13:57:14 +08:00
4641392375 Merge branch 'feature/console_add_sbom_file_v5.3' into 'release/v5.3'
feat(system/console): Added argtable3 SBOM manifest file for SPDX file generation for console component (v5.3)

See merge request espressif/esp-idf!30943
2024-06-13 13:55:39 +08:00
7f0248f39a Merge branch 'docs/add_missing_usb_functions_to_esp32-c3_devkit_user_guides_v5.3' into 'release/v5.3'
Docs: Added missing USB functions to ESP32-C3 DevKit User Guides (v5.3)

See merge request espressif/esp-idf!30860
2024-06-13 13:54:43 +08:00
3ccffd46f1 fix(esp_wifi): Fix for issue in changing opmode when wps is enabled 2024-06-13 11:51:25 +08:00
c4bda59c31 fix(wifi): fix sta scan when connected cause bcn timeout loop issue 2024-06-13 11:50:45 +08:00
c3a47bf365 fix(wifi): fix configure gcmp failure issue 2024-06-13 11:50:01 +08:00
687a40df4e fix(wifi): do not send null data when scan start/done for mesh
Closes https://github.com/espressif/esp-idf/issues/13786
2024-06-13 11:49:21 +08:00
3b0e048f0e fix(wifi): fixed disable gcmp choose pairwise cipher wrong issue 2024-06-13 11:48:27 +08:00
bbf0d76ac3 fix(wifi):fix data len not correct in he actions 2024-06-13 11:47:52 +08:00
cb8670e2bc ci(flash): temp disable SOC_SPI_MEM_SUPPORT_WRAP 2024-06-13 11:26:35 +08:00
d83e7ea505 fix(esp_system): fixed not necessary public require to bootloader_support 2024-06-13 11:26:35 +08:00
f750f4c6f7 Merge branch 'feature/p4_lcdcam_dvp_cam_driver_v5.3' into 'release/v5.3'
feat(cam): add esp32-p4 lcd_cam dvp driver (v5.3)

See merge request espressif/esp-idf!31454
2024-06-13 11:04:54 +08:00
10f8cc42fb Merge branch 'esp32p4/add_adc_support_v5.3' into 'release/v5.3'
feat(adc): support ADC oneshot/continuous mode on ESP32P4(v5.3)

See merge request espressif/esp-idf!31367
2024-06-13 11:00:59 +08:00
321f51d416 Merge branch 'feat/add_hci_log_record_for_nimble_v5.3' into 'release/v5.3'
feat(bt/nimble): support hci log for nimble (backport v5.3)

See merge request espressif/esp-idf!31424
2024-06-13 10:44:16 +08:00
e819b8c0b9 Merge branch 'fix/incorrect_pma_config_esp32p4_v5.3' into 'release/v5.3'
fix(esp_hw_support): Fix incorrect PMA configuration for ESP32-P4 (v5.3)

See merge request espressif/esp-idf!31431
2024-06-13 00:06:26 +08:00
679df9ec6f feat(bt/nimble): support hci log for nimble 2024-06-12 19:24:36 +08:00
a326f15120 feat(adc): support ADC continuous mode on ESP32P4 2024-06-12 18:34:04 +08:00
cfc5da167d feat(soc): rename lp_adc and ahb_dma reg base on p4 2024-06-12 18:16:48 +08:00
e63d6582cc feat(adc): move adc periph enable/reset functions to ll layer 2024-06-12 18:16:45 +08:00
3f5037866b fix(dma): feat(adc): support ADC oneshot mod on ESP32P4 2024-06-12 18:16:41 +08:00
cf123b3626 feat(uart): support HP/LP uart on ESP32C5 MP v5.3 2024-06-12 18:15:22 +08:00
7f0673f634 Merge branch 'refactor/emac_alloc_dma_buffer_v5.3' into 'release/v5.3'
refactor(emac): use heap component API to allocate cached aligned DMA buffer (v5.3)

See merge request espressif/esp-idf!31457
2024-06-12 17:27:30 +08:00
54f30cc94b Merge branch 'feature/esp32c5mp_gdma_support_v5.3' into 'release/v5.3'
feat(gdma): add GDMA support for ESP32C5 MP (v5.3)

See merge request espressif/esp-idf!30897
2024-06-12 17:26:16 +08:00
fd7c809282 Merge branch 'fix/stray_sections_v5.3' into 'release/v5.3'
fix(system): print warning if stray section is found while linking (v5.3)

See merge request espressif/esp-idf!30948
2024-06-12 16:42:12 +08:00
ddbf9936d6 Merge branch 'feature/update-toolchain-to-esp-13.2.0_20240530_v5.3' into 'release/v5.3'
feat(tools): update toolchain version to esp-13.2.0_20240530 (v5.3)

See merge request espressif/esp-idf!31217
2024-06-12 16:35:50 +08:00
bbc44b486e feat(gdma): add GDMA support for ESP32C5 MP 2024-06-12 15:28:40 +08:00
b4dc51b873 Merge branch 'bugfix/fix_no_mem_coex_issue_v5.3' into 'release/v5.3'
fix(nimble): Added change to handle extra memory for ext adv reattempt (v5.3)

See merge request espressif/esp-idf!31444
2024-06-12 14:10:14 +08:00
46677555ed Merge branch 'bugfix/fix_ble_pktlen_change_v5.3' into 'release/v5.3'
Bugfix/fix ble pktlen change (v5.3)

See merge request espressif/esp-idf!31250
2024-06-12 14:06:39 +08:00
6e2950dde2 Merge branch 'backport/openthread_feature_53' into 'release/v5.3'
Backport some openthread related features (Backport v5.3)

See merge request espressif/esp-idf!30973
2024-06-12 14:03:18 +08:00
c349247236 refactor(emac): use heap component API to allocate cached aligned DMA buffer 2024-06-12 13:51:17 +08:00
367b0c16f1 Merge branch 'refactor/i2s_dma_buffer_allocation_v5.3' into 'release/v5.3'
refactor(i2s): clean up DMA buffer allocation (v5.3)

See merge request espressif/esp-idf!31451
2024-06-12 13:49:38 +08:00
de0990e58c feat(cam): add esp32-p4 lcd_cam dvp driver 2024-06-12 11:35:51 +08:00
f1df3eb99b docs(core): update misc docs for C5 2024-06-12 10:24:33 +08:00
7c62ad5434 Merge branch 'feature/ppa_add_test_cases_v5.3' into 'release/v5.3'
feat(ppa): add test cases to test PPA data correctness (v5.3)

See merge request espressif/esp-idf!31448
2024-06-12 10:22:17 +08:00
8ae12473b5 refactor(i2s): clean up DMA buffer allocation 2024-06-12 10:16:24 +08:00
f215c2fd41 Merge branch 'refactor/async_memcpy_allocate_dma_memory_v5.3' into 'release/v5.3'
refactor(async_memcpy): clean up memory allocation code (v5.3)

See merge request espressif/esp-idf!31429
2024-06-12 10:10:11 +08:00
07d53ad11a Merge branch 'bugfix/sdmmc_psram_esp32s3_v5.3' into 'release/v5.3'
fix(sdmmc): fix invalid data when reading/writing PSRAM buffers (v5.3)

See merge request espressif/esp-idf!31362
2024-06-12 03:02:38 +08:00
8377fe746a Merge branch 'fix/spi_sct_fix_descripter_oob_when_lager_then_4092_v5.3' into 'release/v5.3'
fix(spi_master): fix sct mode descripter oob when data lager then 4092 bytes (v5.3)

See merge request espressif/esp-idf!31089
2024-06-12 03:00:58 +08:00
e38e1a0389 Merge branch 'bugfix/check_i2s_intr_alloc_failure_v5.3' into 'release/v5.3'
fix(i2s): check gdma callback register state and add missed port2 on p4 (v5.3)

See merge request espressif/esp-idf!31426
2024-06-12 02:21:20 +08:00
0ef2599e3c Merge branch 'csi/add_no_backup_buffer_usage_verify_v5.3' into 'release/v5.3'
feat(csi): add verify to no backup buffer usage (v5.3)

See merge request espressif/esp-idf!30863
2024-06-12 02:07:32 +08:00
98e99e712f Merge branch 'feature/esp32c5_mp_gpio_support_v5.3' into 'release/v5.3'
Feature/esp32c5 mp gpio support (v5.3)

See merge request espressif/esp-idf!30884
2024-06-12 00:51:06 +08:00
943dd72da0 Merge branch 'feature/esp_emac_improvements_v5.3' into 'release/v5.3'
Feature/esp emac improvements (v5.3)

See merge request espressif/esp-idf!31368
2024-06-11 23:44:01 +08:00
39d0f4b650 feat(ppa): add test cases to test PPA data correctness 2024-06-11 21:59:05 +08:00
5c618745fe Merge branch 'feat/brownout_support_p4_v5.3' into 'release/v5.3'
feat(brownout): Add brownout detector support on esp32p4 (backport v5.3)

See merge request espressif/esp-idf!31094
2024-06-11 21:21:10 +08:00
dbf8726b47 Merge branch 'feat/esp32p4_xip_psram_v5.3' into 'release/v5.3'
psram: support xip_psram on esp32p4 (v5.3)

See merge request espressif/esp-idf!31044
2024-06-11 21:07:41 +08:00
32a2ddceaa fix(nimble): Added change to handle extra memory for ext adv reattempt 2024-06-11 17:43:32 +05:30
8445486303 fix(soc): Cleanup inaccessible SHA registers from the header files 2024-06-11 14:24:09 +05:30
e207b08e28 Merge branch 'change/rm_esp_dma_x_usage_in_doc_v5_3' into 'release/v5.3'
change(dma): remove esp_dma_x usage in programming guide

See merge request espressif/esp-idf!31430
2024-06-11 16:41:07 +08:00
4f11dd7e21 fix(tools): Avoid crashing when Git is used to acquire IDF version
Closes https://github.com/espressif/esp-idf/issues/13345
2024-06-11 09:39:09 +02:00
1c6a8b4521 Merge branch 'refactor/esp_lcd_io_header_files_v5.3' into 'release/v5.3'
i80_lcd: add help function to allocate draw buffer with proper alignment (v5.3)

See merge request espressif/esp-idf!31428
2024-06-11 15:27:08 +08:00
ffbb1aba5e Merge branch 'feat/isp_dvp_driver_v5.3' into 'release/v5.3'
isp: dvp driver (v5.3)

See merge request espressif/esp-idf!31261
2024-06-11 15:05:26 +08:00
3ffea37812 Merge branch 'bugfix/esp32c2_fixed_some_ble_issues_master_v5.3' into 'release/v5.3'
Bugfix/esp32c2 fixed some ble issues master (v5.3)

See merge request espressif/esp-idf!31232
2024-06-11 14:55:43 +08:00
0868604664 fix(esp_hw_support): Fix incorrect PMA configuration for ESP32-P4
- As the PMA entry that made some memory regions cacheable was
assigned the highest priority, some intermediate inaccessible
memory regions bypassed protection.

- Added tests for the same

- Verified that even after changing the priority of the PMA entry,
a write operation at SOC_IRAM_LOW + 0x40 (a random RAM cached address)
still needs the same number (29) of CPU cycles.
2024-06-11 12:23:06 +05:30
0b8952dc2e change(dma): remove esp_dma_x usage in programming guide 2024-06-11 14:35:57 +08:00
zwx
1de232fb98 feat(openthread): update BR lib 2024-06-11 14:25:45 +08:00
15512f4170 fix(openthread): remove the empty task for openthread tasklets 2024-06-11 14:25:45 +08:00
zwx
fd0ea43496 fix(802.15.4): fixed ieee802154 will sleep when only pm enabled 2024-06-11 14:25:02 +08:00
zwx
5887426bad feat(802154): log buffer full message in debug mode only 2024-06-11 14:25:02 +08:00
3860cc8dac feat(openthread): update openthread br lib 2024-06-11 14:25:01 +08:00
3efe49f26a feat(openthread): support openthread ephemeral key 2024-06-11 14:25:01 +08:00
zwx
01e02aec6c fix(802.15.4): fix a risk for receive_at and ignore bit8 for the frame length 2024-06-11 14:25:01 +08:00
zwx
d6a3ed0637 feat(openthread): remove the range for some configurations 2024-06-11 14:25:01 +08:00
zwx
784abd1ae0 feat(openthread): move iperf dependency into cli extension 2024-06-11 14:25:01 +08:00
b8122ec6b3 refactor(async_memcpy): clean up memory allocation code 2024-06-11 13:54:31 +08:00
b6bc597903 feat(i80_lcd): add help function to allocate draw buffer with proper alignment 2024-06-11 13:50:38 +08:00
33ac88cd31 change(esp_lcd): split header files by different IO interface 2024-06-11 13:50:37 +08:00
dafc3b3cd5 Merge branch 'feat/gdma_set_burst_size_v5.3' into 'release/v5.3'
feat(gdma): return alignment constraints required by the GDMA channel (v5.3)

See merge request espressif/esp-idf!31113
2024-06-11 11:59:03 +08:00
bee6044a24 Merge branch 'doc/update_readme_enc_adv_v5.3' into 'release/v5.3'
docs(nimble): Added chip information in enc_adv example README file (v5.3)

See merge request espressif/esp-idf!30773
2024-06-11 11:01:02 +08:00
84660a822a Merge branch 'bugfix/ble_gap_unpair_error_code_v5.3' into 'release/v5.3'
fix(nimble): Added return code in ble_gap_unpair error logs (v5.3)

See merge request espressif/esp-idf!31307
2024-06-11 11:00:49 +08:00
bde502ed27 Merge branch 'bugfix/bleqabr24-549_v5.3' into 'release/v5.3'
fix(ble_mesh): fix issues in mesh deinit_v5.3

See merge request espressif/esp-idf!30540
2024-06-11 11:00:10 +08:00
5634a3260e Merge branch 'feat/add_api_to_set_privacy_mode_v5.3' into 'release/v5.3'
feat(bt/bluedroid): support BLE set privacy mode (v5.3)

See merge request espressif/esp-idf!30906
2024-06-11 10:59:54 +08:00
cd4c71e20f fix(i2s): add the missed port2 for p4 2024-06-11 10:59:05 +08:00
ab81888705 fix(i2s): add check to gdma callback register 2024-06-11 10:55:22 +08:00
67f0bfa8bc Merge branch 'fix/ble_mesh_sar_bugfix_v5.3' into 'release/v5.3'
BLE Mesh SAR bugfix (v5.3)

See merge request espressif/esp-idf!30881
2024-06-11 10:49:52 +08:00
421c94ded5 Merge branch 'fix/ble_mesh_gatts_bugfix_v5.3' into 'release/v5.3'
BLE Mesh Gatts bugfix (v5.3)

See merge request espressif/esp-idf!30872
2024-06-11 10:49:09 +08:00
a31806d076 Merge branch 'feature/esp32c6_pu8m_in_sleep_support_v5.3' into 'release/v5.3'
feat(sleep): support 8m force pu in sleep for esp32c6 & esp32h2 (v5.3)

See merge request espressif/esp-idf!30999
2024-06-11 10:48:05 +08:00
da43ec0425 Merge branch 'fix/assert_in_bt_controller_v5.3' into 'release/v5.3'
fix(bt): fix some issues in bluetooth controller(backport v5.3)

See merge request espressif/esp-idf!31321
2024-06-11 10:45:17 +08:00
832337bdee Merge branch 'fix/support_union_lp_io_clk_control_v5.3' into 'release/v5.3'
fix(esp_driver_gpio): manage lp_io module clock by driver (v5.3)

See merge request espressif/esp-idf!31359
2024-06-11 10:45:00 +08:00
9230a25140 Merge branch 'bugfix/fix_lp_half_world_access_v5.3' into 'release/v5.3'
fix(hal): fix LP timer / PMU LL half word access (v5.3)

See merge request espressif/esp-idf!31386
2024-06-11 10:44:34 +08:00
f20f0ae8d1 Merge branch 'doc/update_esp32c6_power_statics_5.3' into 'release/v5.3'
docs(lowpower): updating low-power statistics in Wi-Fi scenarios (v5.3)

See merge request espressif/esp-idf!31209
2024-06-11 10:43:49 +08:00
726ed08ee2 Merge branch 'bugfix/mldv6_report_memory_leak_v5.3' into 'release/v5.3'
fix(esp_netif): Fix mldv6 report memory leak in esp_netif(v5.3)

See merge request espressif/esp-idf!31064
2024-06-11 10:43:14 +08:00
5feffad9a1 Merge branch 'bugfix/pm-108_v5.3' into 'release/v5.3'
backport v5.3: fix the issue of tg0 watchdog reset caused by wifi module retention

See merge request espressif/esp-idf!31011
2024-06-11 10:42:38 +08:00
eac00e82d1 Merge branch 'bugfix/loadprohibited_after_bt_deinit_v5.3' into 'release/v5.3'
Fixed some coexist issues

See merge request espressif/esp-idf!31003
2024-06-11 10:42:16 +08:00
dbccfbb2e7 change(isp): don't init unnecessary isp pipeline items when doing isp_new_processor 2024-06-11 10:18:16 +08:00
be9c4ebf44 fix(isp): reverted only raw8 input limits 2024-06-11 10:18:16 +08:00
de1d006ba3 change(isp): change isp_af_window_t to isp_window_t 2024-06-11 10:18:16 +08:00
f58b63d31e test(isp_dvp): added isp_dvp test 2024-06-11 10:18:16 +08:00
9713bd63a4 fix(csi): fixed csi wrong state machine settings 2024-06-11 10:18:16 +08:00
05f44bddf0 feat(isp): added isp dvp driver 2024-06-11 10:18:16 +08:00
65d9300b5c Merge branch 'bugfix/esp32h2_iomux_retention_v5.3' into 'release/v5.3'
fix(gpio): fix IO 21-27 IOMUX registers not being backed up on ESP32H2 (v5.3)

See merge request espressif/esp-idf!31190
2024-06-11 10:01:07 +08:00
0a3d59a4fa Merge branch 'docs/update_getting_started_for_esp32p4_support_v5.3' into 'release/v5.3'
Docs/update getting started for esp32p4 support (v5.3)

See merge request espressif/esp-idf!31114
2024-06-11 09:44:13 +08:00
45c7eb4d4b Merge branch 'feature/make_heap_alloc_caps_align_memory2_v5.3' into 'release/v5.3'
Align memory requested from heap component to hw requirements (v5.3)

See merge request espressif/esp-idf!31195
2024-06-11 09:42:04 +08:00
a71f265d25 Merge branch 'feature/lp_core_intr_panic_v5_3' into 'release/v5.3'
feat(ulp): support interrupts and panic for C6/P4 LP core (v5.3)

See merge request espressif/esp-idf!31189
2024-06-11 09:41:51 +08:00
b2dcc24335 Merge branch 'bugfix/clic_intr_thresh_v5.3' into 'release/v5.3'
fix(intr): fixed intr threshhold min level on C5 (v5.3)

See merge request espressif/esp-idf!31272
2024-06-11 09:41:31 +08:00
88c0ea49e3 Merge branch 'feat/ai_coproc_support_esp32p4_v5.3' into 'release/v5.3'
feat(riscv): add support for PIE coprocessor and HWLP feature (backport v5.3)

See merge request espressif/esp-idf!31020
2024-06-11 09:41:06 +08:00
cc869c6ab5 Merge branch 'refactor/usb_mock_classes_v5.3' into 'release/v5.3'
refactor(usb): Split test device descriptors from mock classes (v5.3)

See merge request espressif/esp-idf!31413
2024-06-11 00:41:53 +08:00
c23dbefd45 fix(storage/vfs_console): remove possible infinite recursion 2024-06-10 16:07:49 +02:00
87fd8b41d8 Merge branch 'bugfix/jpeg_error_handle_v5.3' into 'release/v5.3'
fix(jpeg): Modify jpeg deocde/encode error handling logic (backport v5.3)

See merge request espressif/esp-idf!31159
2024-06-10 03:28:52 +08:00
fccc309499 fix(jpeg): Modify jpeg deocde/encode error handling logic (backport v5.3) 2024-06-10 03:28:52 +08:00
9aea2d3395 Merge branch 'fix/peripheral_driver_kconfig_inconsistence_v5.3' into 'release/v5.3'
fix(kconfig): fixed peripheral driver kconfig inconsistencies (v5.3)

See merge request espressif/esp-idf!31294
2024-06-10 03:27:38 +08:00
6192507987 fix(usb): Make string descriptor checks in unit tests optional
Checking for an exact match for product or serial and string descriptors can
lead to test failures if the USB devices connected to the runner is changed. This
commit adds some kconfig options to make the string descriptor checks optional,
with the product and serial string checks being disabled by default.
2024-06-09 12:34:37 +08:00
7f61f74aa0 refactor(usb): Split test device descriptors from mock class files
Previously, descriptors of the test devices were stored direclty in the mock
device files (e.g., "mock_[hid|msc].[h|c]"). This commit splits out the device
descriptors to separate files (e.g., "dev_[hid|msc].c") along with getter
functions.

Users that want to run the tests locally on a different device simply need to
update the "dev_[hid|msc].c" file for their device.
2024-06-09 10:43:25 +08:00
7474a450c2 refactor(usb): Rename mock class files
- Rename "test_usb_mock_..." class files to "mock_..."
- Fixed some codespell issues
- Fixed comment spacing
2024-06-09 10:43:20 +08:00
41515a9086 Merge branch 'feature/parlio_rx_driver_p4_v5.3' into 'release/v5.3'
feat(parlio_rx): supported parlio rx on p4 (v5.3)

See merge request espressif/esp-idf!31096
2024-06-07 22:54:08 +08:00
4787e928a2 Merge branch 'feat/isp_bf_feature_v5.3' into 'release/v5.3'
feat(isp): added isp bf driver (v5.3)

See merge request espressif/esp-idf!31067
2024-06-07 22:52:17 +08:00
c9f8fc0405 Merge branch 'fix/example_blink_esp32h2_v5.3' into 'release/v5.3'
fix(blink): fix sdkconfig defaults name for esp32h2 (v5.3)

See merge request espressif/esp-idf!31340
2024-06-07 22:50:31 +08:00
12d480423b Merge branch 'feature/esp32p4_ppa_driver_support_v5.3' into 'release/v5.3'
feat(ppa): add PPA driver support for ESP32P4 (v5.3)

See merge request espressif/esp-idf!31074
2024-06-07 22:48:49 +08:00
e148263565 Merge branch 'bugfix/mipi_dsi_rgb666_color_pixel_v5.3' into 'release/v5.3'
fix(dsi): fixed wrong RGB666 pixel size (v5.3)

See merge request espressif/esp-idf!31152
2024-06-07 22:47:47 +08:00
5d844e57ed change(rgb_lcd): set DMA transfer burst size 2024-06-07 22:44:18 +08:00
b2ff20d94c change(i80_lcd): set DMA transfer burst size 2024-06-07 22:44:18 +08:00
e8852d5c38 change(async_memcpy): set DMA transfer burst size 2024-06-07 22:44:18 +08:00
2f0c9b3584 feat(gdma): set burst size and return alignment constraint
burst size can affect the buffer alignment
2024-06-07 22:44:18 +08:00
09cbbaaf7c fix(esp_eth): Fixed another memory leak ESP MAC 2024-06-07 15:26:18 +02:00
dab7fdd6f0 fix(esp_eth): fixing memory leak and invalid bit shift 2024-06-07 15:26:18 +02:00
d6b3b8feeb feat(esp_eth): added example to deinit Ethernet 2024-06-07 15:26:18 +02:00
f6420436eb feat(esp_eth): a new folder structure of the driver and other improvements
Fixed memory leak in emac_esp_new_dma function.

Polished ESP EMAC cache management.

Added emac_periph definitions based on SoC features and improved(generalized) ESP EMAC GPIO
initialization.

Added ESP EMAC GPIO reservation.

Added check for frame error condition indicated by EMAC DMA and created a target test.
2024-06-07 15:26:18 +02:00
23cfe0826b Merge branch 'fix/aes_operation_using_psram_memory_with_psram_enc_v5.3' into 'release/v5.3'
Enable AXI-DMA AES-ECC mean access when external memory encryption is enabled (v5.3)

See merge request espressif/esp-idf!30822
2024-06-07 19:17:38 +08:00
30ea848335 Merge branch 'feature/update_cjson_version_to_1.7.18_v5.3' into 'release/v5.3'
feat(cjson): update submodule to v1.7.18 (v5.3)

See merge request espressif/esp-idf!31014
2024-06-07 19:17:23 +08:00
6a86351373 fix(hal): fix PMU LL half word and byte access 2024-06-07 14:13:40 +08:00
e5429b256a fix(hal): fix LP timer LL half word access 2024-06-07 14:13:39 +08:00
4daaa9c587 fix(bod): Disable fib in bootloader so that interrupt can be triggered properly 2024-06-07 10:38:14 +08:00
091da3d631 fix(esp_driver_gpio): manage lp_io module clock by driver
Closes https://github.com/espressif/esp-idf/issues/13683
2024-06-06 19:27:57 +08:00
c8474d48f8 fix(sdmmc): fix invalid data when reading/writing PSRAM buffers
Previous commit has enabled buffers in PSRAM for ESP32-P4. But this
also caused a regression for ESP32-S3, where PSRAM is not DMA capable.
This commit re-introduces the check for esp_ptr_external_ram in case
SOC_SDMMC_PSRAM_DMA_CAPABLE is not set.
2024-06-06 10:44:53 +02:00
6e7a9de65e fix(blink): fix sdkconfig defaults name 2024-06-05 16:30:23 +07:00
6cd960928a fix(bt): fix some issues in bluetooth controller
1: fix return incorrect link key with hci command rd_stored_link_key
2: fix the assert triggered during APB TX
3: fix role switch LMP collision bug
2024-06-05 09:05:29 +08:00
b07a1470c5 feat(tools): update toolchain version to esp-13.2.0_20240530 2024-06-04 18:35:17 +04:00
737b5edd5b fix(nimble): Added return code in ble_gap_unpair error logs 2024-06-04 14:46:13 +05:30
d9f9f79270 fix(kconfig): fixed peripheral driver kconfig inconsistencies 2024-06-04 10:19:31 +08:00
a6c2c4149d fix(intr): fixed intr threshhold min level on C5 2024-06-03 12:44:32 +08:00
fe32b34b20 docs(links): fix broken links found in CI 2024-06-03 12:42:25 +08:00
ae876915ec Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
fix(wifi): Add back WIFI_AUTH_WPA3_EXT_PSK and WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE

See merge request espressif/esp-idf!31218
2024-06-03 10:36:46 +08:00
1542b768fd fix(ble/bluedroid): Optimize BLE stack connect callback name 2024-06-02 17:36:35 +08:00
e10c977834 fix(ble/bluedroid): Fixed BLE no data length change event 2024-06-02 17:36:35 +08:00
zwl
9ab7f325cc ble: fixed ble some issues on esp32c6 and esp32h2 2024-05-31 17:13:31 +08:00
zwl
bbe96641b1 ble: fixed ble some issues on esp32c2 2024-05-31 17:13:31 +08:00
e22c101034 fix(wifi): Add back WIFI_AUTH_WPA3_EXT_PSK and WIFI_AUTH_WPA3_EXT_PSK_MIXED_MODE
Add back above authmodes instead of removing and merging them with WIFI_AUTH_WPA3_PSK
in minor releases during v5.x.

These authmodes will be removed from v6.0
2024-05-31 13:50:54 +08:00
63f019565b fix(wifi): fix send mgmt err when eapol process 2024-05-31 13:50:12 +08:00
3a5ba85419 docs(lowpower): updating low-power statistics in Wi-Fi scenarios 2024-05-30 21:54:32 +08:00
a168f4cc9b fix(ble_mesh): fix issues in mesh deinit 2024-05-30 20:37:31 +08:00
df4195062d change(system): heap_caps_alloc returns aligned memory if caps indicate a need for it
The implicit promise of heap_alloc_caps() and friends is that the memory it
returns is fit for the purpose as requested in the caps field. Before
this commit, that did not happen; e.g. DMA-capable memory wass returned
from a correct region, but not aligned/sized to something the DMA subsystem
can handle.

This commit adds an API to the esp_mm component that is then used by the
heap component to adjust allocation alignment, caps and size dependent on
the hardware requirement of the requested allocation caps.
2024-05-30 16:02:03 +08:00
8800e9d0e5 fix(gpio): fix IO 21-27 IOMUX registers not being backed up on ESP32H2 2024-05-30 15:13:58 +08:00
2f1b81cd14 feat(ulp): add pulse counter example for lp core 2024-05-30 14:41:47 +08:00
87d4172ee5 feat(ulp): add lp core panic handler 2024-05-30 14:41:31 +08:00
7f9b5deae1 feat(ulp): support interrupts for C6/P4 LP core
Closes https://github.com/espressif/esp-idf/issues/13059
2024-05-30 14:40:23 +08:00
3d959421b1 docs(doxygen): fix misc issues with new version of doxygen 2024-05-30 13:42:06 +08:00
52a922f953 fix(wifi): fixed the issue of tg0 watchdog reset caused by wifi module retention 2024-05-29 20:50:53 +08:00
baf6028974 fix(docs): tcpip_adapter: Document replacement of tcpip_adapter_get_sta_list 2024-05-29 13:44:26 +02:00
60c2068fef docs(app_trace): Update docs for ESP32-P4 2024-05-29 14:31:34 +03:00
10f89fe52e fix(ppa): fix mismatching writeback and invalidate data size on the same buffer 2024-05-29 14:35:26 +08:00
b1b182f258 change(dsi): use DW_GDMA as the flow controller
previously the DSI_Bridge was set as the flow controller
2024-05-29 12:32:03 +08:00
1129f0834e fix(dsi): fixed wrong RGB666 pixel size 2024-05-29 12:32:03 +08:00
58ebdb7ae3 change(image): move image_process driver from bootloader_support to esp_system 2024-05-29 10:02:44 +08:00
48e06fafea feat(xip_psram): support xip psram feature on esp32p4 2024-05-29 10:02:44 +08:00
6bb35c551c docs: Updated Getting Started for ESP32-P4 support 2024-05-28 11:52:06 +08:00
0be44b6ccc feat(gpio): fix gpio matrix const input addr on C5 MP 2024-05-27 18:13:58 +08:00
bf604e91a6 feat(gpio): remove io_mux_reg array in gpio_periph.c from c5 2024-05-27 18:13:42 +08:00
dcc7cf9379 feat(parlio_rx): support parlio rx on p4 2024-05-27 17:20:15 +08:00
5a7a9c0638 test(esp_intr_dump): Fix the esp intr dump expected output because the changes happened in brownout 2024-05-27 16:41:18 +08:00
91cedfe89d feat(brownout): Add brownout detector support on esp32p4 2024-05-27 16:40:45 +08:00
0d94b1cd89 fix(spi_master): fix sct mode descripter oob when data lager then 4092 bytes 2024-05-27 15:01:38 +08:00
1b1005a1d8 feat(ppa): add PPA driver support for ESP32P4 2024-05-27 11:34:47 +08:00
096db7521b feat(sdmmc_io): support sending CMD53 with fixed address 2024-05-24 20:27:57 +08:00
cc48efc6ec feat(isp): added isp bf driver 2024-05-24 16:46:00 +08:00
88b300d064 fix(esp_netif): Fix mldv6 report memory leak in esp_netif 2024-05-24 15:33:55 +08:00
f9b58b0c73 change(mmu): fix spell issue 2024-05-23 15:42:04 +08:00
3a7aafe7d6 fix(ble_mesh): change tx/rx lock to recursive mutex to avoid dead lock 2024-05-23 15:41:58 +08:00
e23d24a65d fix(ble_mesh): reference net_buf on correct positions 2024-05-23 15:41:58 +08:00
687064b2f8 change(cpu_start): added note about internal ram only stage 2024-05-23 15:41:35 +08:00
168ff6e268 bugfix(cpu_start): check c3 efuse error log on ram app condition
Prior to this commit, esp_efuse_check_errors() is only called when it's
2nd stage btld app.

This commit moves this error check so under all conditions (including
ram app, pure ram app) will check this efuse error
2024-05-23 15:41:30 +08:00
8e66d38959 refactor(cpu_start): move uni/multi core log later 2024-05-23 15:41:25 +08:00
5890c7450d fix(tools): Use GDGBUI arguments based on its version
Closes https://github.com/espressif/esp-idf/issues/13665
2024-05-23 07:35:55 +02:00
2c96e097c9 fix(ble_mesh): Create service after service register success 2024-05-23 12:16:46 +08:00
f3b7e0502a ci(examples/storage): Enable perf_benchmark spiflash example and build others 2024-05-22 17:00:53 +02:00
2f10ca582b fix(storage): Fix SD card examples for SoCs with SOC_SDMMC_IO_POWER_EXTERNAL 1 2024-05-22 17:00:53 +02:00
0928ff027b fix(riscv): make HWLP feature use direct saving of lazy saving 2024-05-22 16:58:31 +08:00
6eba7a536a feat(riscv): add support for PIE coprocessor and HWLP feature
FreeRTOS tasks may now freely use the PIE coprocessor and HWLP feature.
Just like the FPU, usiing these coprocessors result in the task being pinned
to the core it is currently running on.
2024-05-22 16:58:31 +08:00
75faae29a8 feat(cjson): update submodule to v1.7.18
Changelog: https://github.com/DaveGamble/cJSON/releases/tag/v1.7.18
2024-05-22 13:34:31 +05:30
0f96e51146 ci(coredump): fix capture dram tests 2024-05-22 06:25:04 +02:00
52b36a60f4 Update CN translation for coredump 2024-05-22 06:25:04 +02:00
617f5a7052 feat(coredump): save .bss, .data and .heap sections to the elf file 2024-05-22 06:25:01 +02:00
0c3a0d6c9a fix(coex): Fixed some coexist issues
- Fixed crash issue in coexist callback
- Fixed coexist scheme status update issue
2024-05-22 11:51:44 +08:00
9f04d1ac36 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(a771b7c)
- Fixed assert when starting advertising due to preemption
- Fixed RPA generation after each reboot
- Fixed RPA renew timer start and stop
2024-05-22 11:51:44 +08:00
b8d9da5c03 feat(sleep): support 8m force pu in sleep for esp32c6/esp32h2 2024-05-22 11:35:00 +08:00
52b9c5d666 feat(bt/bluedroid): support BLE set privacy mode 2024-05-22 10:43:37 +08:00
3f632df143 Merge branch 'ci/update-known-failed-cases-file-name(v5.3)' into 'release/v5.3'
ci: add 5.3 known failed cases file

See merge request espressif/esp-idf!30978
2024-05-22 07:42:26 +08:00
5ec2be4ba3 Merge branch 'fix/websocket_first_packet_v5.3' into 'release/v5.3'
fix(ws_transport): fixed `server-key` corruption (backport v5.3)

See merge request espressif/esp-idf!30963
2024-05-22 07:41:55 +08:00
1d3d63c438 Merge branch 'bugfix/fix_resetting_redirect_counter_v5.3' into 'release/v5.3'
fix: reset redirect counter for using same handler (v5.3)

See merge request espressif/esp-idf!30935
2024-05-22 07:41:24 +08:00
e7ba614a04 Merge branch 'set_gdb_remotetimeout_v5.3' into 'release/v5.3'
tools(gdbinit): set remote timeout for the gdb connection (v5.3)

See merge request espressif/esp-idf!30804
2024-05-22 07:40:07 +08:00
dbf757118a Merge branch 'bugfix/free_controlle_memory_in_init_fail_v5.3' into 'release/v5.3'
fix(nimble): Free controller memory if init fails (v5.3)

See merge request espressif/esp-idf!30749
2024-05-22 07:39:47 +08:00
0c2c962b19 Merge branch 'coredump_sanity_check_v5.3' into 'release/v5.3'
fix(coredump): increase sanity check before get summary (v5.3)

See merge request espressif/esp-idf!30527
2024-05-22 07:39:23 +08:00
1f0d27a2c6 Merge branch 'fix/pytest_session_dir_v5.3' into 'release/v5.3'
ci: apply new fix in pytest-embedded 1.10 (v5.3)

See merge request espressif/esp-idf!30676
2024-05-22 07:38:23 +08:00
1aaae85ad2 Merge branch 'bugfix/esp32c6eco1_coex_ble_deinit_wifi_bcn_timeout_v5.3' into 'release/v5.3'
backport v5.3: fix the issue where deinit ble in a coexist scenario causes the wifi mac tsf counter to stop

See merge request espressif/esp-idf!30981
2024-05-22 07:37:41 +08:00
85048f35e3 Merge branch 'bugfix/stop_tg_wdt_in_xpd_xtal_lightsleep_v5.3' into 'release/v5.3'
fix(esp_hw_support): stop tg wdt in xpd xtal lightsleep (v5.3)

See merge request espressif/esp-idf!30992
2024-05-22 07:37:32 +08:00
1a7c782905 Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
Fix(wifi):backport wifi fixes v5.3

See merge request espressif/esp-idf!30994
2024-05-22 07:37:14 +08:00
cf4cf23741 Merge branch 'contrib/github_pr_13560_v5.3' into 'release/v5.3'
esp_eth: DP83848: correct link detection to use BMSR (GitHub PR) (v5.3)

See merge request espressif/esp-idf!30450
2024-05-21 23:42:21 +08:00
236556d1ea Merge branch 'contrib/github_pr_13669_v5.3' into 'release/v5.3'
docs: clarify ESP_RETURN_ON_ERROR result (GitHub PR) (v5.3)

See merge request espressif/esp-idf!30405
2024-05-21 23:41:51 +08:00
07669b8012 Merge branch 'fix/core1_access_cache_when_core0_close_cache_during_sleep_v5.3' into 'release/v5.3'
fix(esp_system): fix core1 access cache when core0 close cache during sleep(backport v5.3)

See merge request espressif/esp-idf!30942
2024-05-21 23:41:17 +08:00
e13bb3d734 fix(esp32c6): fix the issue of except wifi state caused by the missing mac retention config 2024-05-21 21:34:30 +08:00
bb4ba96545 Merge branch 'feat/axi_icm_qos_v5.3' into 'release/v5.3'
feat(axi_icm): AXI interconnect QoS (v5.3)

See merge request espressif/esp-idf!30980
2024-05-21 21:24:36 +08:00
1bf9c822f9 feat(wifi): support coex pwr 2024-05-21 20:57:46 +08:00
bb466097e5 feat(wifi): add softap csa&dtim&wait_bcast_data setting and ignore err nodata 2024-05-21 20:57:06 +08:00
8b369072f9 fix(esp_hw_support/sleep): stop TG0/TG1 watchdog if XTAL not power down in lightsleep 2024-05-21 20:30:28 +08:00
d91dfe3510 change(esp_hw_support/sleep): improve esp32c3 systimer stall bug workaround 2024-05-21 20:30:24 +08:00
2396dc5ff7 fix(wifi): fix the issue where deinit ble in a coexist scenario causes the wifi mac tsf counter to stop 2024-05-21 16:39:20 +08:00
ce7ceb8d9d feat(csi): add verify to no backup buffer usage 2024-05-21 15:36:34 +08:00
5ec85c0bfd feat(axi_icm): AXI interconnect QoS configuration functions 2024-05-21 14:38:34 +08:00
7c49b1da55 ci: add 5.3 known failed cases filename 2024-05-21 14:01:08 +08:00
8805685f72 Merge branch 'bugfix/fixed_issues_on_esp32c6_and_esp32h2_v5.3' into 'release/v5.3'
fixed some ble issues on esp32c6 and esp32h2 (v5.3)

See merge request espressif/esp-idf!30891
2024-05-21 11:52:32 +08:00
a3d77114b6 fix(ws_transport): utility functions minor improvments 2024-05-20 17:54:43 +04:00
021dc8747c fix(ws_transport): fixed server-key corruption
When first fragment is sent over HTTP during websocket
connection, defer buffering of fragment until after the
websocket server-key is validated.

This order is required because the first fragment buffering
overwrites the memory holding the server-key headers.

Fixes 2267d4b
Fixes https://github.com/espressif/esp-protocols/issues/396
PR https://github.com/espressif/esp-idf/pull/13724
2024-05-20 17:54:31 +04:00
c7f146b671 Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
fix(esp_wifi): backport some wifi fixes to v5.3

See merge request espressif/esp-idf!30933
2024-05-20 20:52:18 +08:00
86a49de1eb Merge branch 'fix/fix_esp32p4_kconfig_pd_cpu_dependcy_error_v5.3' into 'release/v5.3'
fix(esp_pm): fix esp32p4 kconfig pd cpu dependency error (v5.3)

See merge request espressif/esp-idf!30794
2024-05-20 20:12:05 +08:00
89218b35e4 fix(system): place idf's stray sections while linking 2024-05-20 13:31:04 +04:00
51b6d16b43 Merge branch 'doc/update-performance-guides-p4-c5_v5.3' into 'release/v5.3'
docs(performance): Add P4 and C5 information in the performance guides (backport v5.3)

See merge request espressif/esp-idf!30492
2024-05-20 16:16:48 +08:00
9e74564ba5 docs: Update the CN Translation for ram-usage and speed 2024-05-20 09:34:12 +02:00
9ebc8f02a9 feat(system/console): Added argtable3 SBOM manifest file in console component for SPDX file generation 2024-05-20 15:04:27 +08:00
7b10c2421f fix(esp_system): fix core1 access cache when core0 close cache during sleep 2024-05-20 15:01:08 +08:00
0c5bce6918 fix(bootloader_support): Make esp_flash_encrypt.h independent of spi_flash_mmap.h header 2024-05-20 14:40:49 +08:00
bef1fba3bc fix(mbedtls/crypto_shared_gdma): Enable AXI-DMA enable external memory AES-ECC access
- When external memory encryption is enabled, set the aes_ecc bit of AXI-DMA to enable memory access
2024-05-20 14:40:49 +08:00
64c062047f fix(esp_hw_support): invalidate L1DCache before enter hardware sleep 2024-05-20 14:02:04 +08:00
157c5b52e3 change(esp_hw_support): put more code into TCM to speed up the sleep and wake-up process 2024-05-20 14:01:01 +08:00
c97ab134ef ci(esp_pm): add pd_top auto lightsleep test case for esp_pm 2024-05-20 14:01:00 +08:00
5899701b68 feat(esp_pm): fix esp32p4 cpu powerdown kconfig dependency error 2024-05-20 14:01:00 +08:00
4ec0065d74 Merge branch 'docs/p4_hw_design_v5.3' into 'release/v5.3'
docs(sys-time): update link to hw design guidelines (v5.3)

See merge request espressif/esp-idf!30934
2024-05-20 13:57:29 +08:00
fe92d9ee60 Merge branch 'doc/update_bt_sleep_process_v5.3' into 'release/v5.3'
docs: Update the process of Bluetooth entering sleep in the sleep_modes.rst(v5.3)

See merge request espressif/esp-idf!30729
2024-05-20 13:50:59 +08:00
4c6cf06838 Merge branch 'fix/fix_esp_pm_case_high_fail_ratio_v5.3' into 'release/v5.3'
fix(esp_pm): fix esp_pm test cases high fail ratio (v5.3)

See merge request espressif/esp-idf!30672
2024-05-20 13:44:53 +08:00
464f4c9cc6 Merge branch 'fix/assert_1024_in_rwbt_isr_v5.3' into 'release/v5.3'
fix(bt/ble): fix some issues in bluetooth controller(backport v5.3)

See merge request espressif/esp-idf!30813
2024-05-20 13:43:43 +08:00
eb8dad2fa6 fix: Add warning to enable LWIP_NETIF_LOOPBACK to use control socket API
Closes https://github.com/espressif/esp-idf/issues/13659
2024-05-20 10:43:41 +05:30
856a299ba8 fix: reset redirect counter for using same handler
Closes https://github.com/espressif/esp-idf/issues/13633
2024-05-20 10:43:41 +05:30
be9c7145f9 Merge branch 'feat/enable_app_update_test_p4_v5.3' into 'release/v5.3'
feat: Enable app_update test app for ESP32P4 (v5.3)

See merge request espressif/esp-idf!30821
2024-05-20 12:32:42 +08:00
d638267741 Merge branch 'fix/fix_flash_encryption_esp32p4_v5.3' into 'release/v5.3'
fix(bootloader_support): Fix flash encryption for esp32p4 (v5.3)

See merge request espressif/esp-idf!30921
2024-05-20 12:29:18 +08:00
f3a73cbce3 docs(sys-time): update link to hw design guidelines 2024-05-20 12:16:19 +08:00
41ff5a2f43 Merge branch 'fix/brownout_crash_v5.3' into 'release/v5.3'
fix(brownout): fixed brownout isr crashing if cache disabled (v5.3)

See merge request espressif/esp-idf!30831
2024-05-20 12:13:17 +08:00
95cfd3987b Merge branch 'bugfix/lp_core_tests_race_condition_v5.3' into 'release/v5.3'
fix(lp_core_test): fixed race-condition in lp core tests (v5.3)

See merge request espressif/esp-idf!30931
2024-05-20 12:12:49 +08:00
520beb865c Merge branch 'bugfix/c5_isr_masking_v5.3' into 'release/v5.3'
fix(interrupt): fixed interrupt thresholds not working on C5 (v5.3)

See merge request espressif/esp-idf!30843
2024-05-20 12:12:36 +08:00
e53ca8e018 fix(lp_core_test): fixed race-condition in lp core tests 2024-05-20 11:59:10 +08:00
68be49d2cf fix(wifi): fixed scan get ap number issue 2024-05-20 11:58:16 +08:00
686878497e docs: update wifi iperf README 2024-05-20 11:56:44 +08:00
c046d87561 docs(wifi): update the docmentation for mesh API 2024-05-20 11:55:27 +08:00
fdb4197d02 fix(esp_wifi): Add some bugfixes and cleanup in softAP
1. Fix wrong reason code in 'WIFI_EVENT_AP_STADISCONNECTED' event
2. cleanup in softAP for disconnecting connected station
3. Update examples to display reason while processing WIFI_EVENT_AP_STADISCONNECTED event
2024-05-20 11:50:09 +08:00
e11f030427 feat(wifi): add itwt teardown status 2024-05-20 11:49:54 +08:00
beebbada64 fix(wifi):esp32c6 wifi rx statistics is always zero 2024-05-20 11:47:43 +08:00
6da7a46bfa fix(bss_color):fix bss color issues 2024-05-20 11:46:50 +08:00
d2551d6e4b fix(wifi): fix esp32 unrecoverable m f issue 2024-05-20 11:46:08 +08:00
4cf29dfcef fix(wifi): fixed sniffer and espnow issue
1. fix(wifi): fixed sniffer dump fcs error packets fail

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

2. fix(wifi): fixed the espnow priv parameter get error

Closes https://github.com/espressif/esp-idf/issues/13693
2024-05-20 11:44:48 +08:00
3dbba47d8c fix(esp_wifi): Fix issues in NAN datapath establishment
1. Resolve indefinite waiting while stopping NAN
2. Increase NDP response timeout to 8 DW's
3. Set NAN discovery beacon interval to 100 TU's as per Section 9.2
   of Wi-Fi Aware Specification v4.0
2024-05-20 11:43:58 +08:00
02c2356cb1 fix(esp_wifi): Fix issue in selecting FTM compensation with external AP 2024-05-20 11:43:18 +08:00
8639f69ed7 fix(wifi): fix the tx issue when mesh packet lifetime remain equal to zero 2024-05-20 11:42:34 +08:00
19ab395364 Merge branch 'feat/csi_dsi_example_v5.3' into 'release/v5.3'
example: csi dsi example and isp af dsi example(v5.3)

See merge request espressif/esp-idf!30913
2024-05-20 11:12:30 +08:00
a7266400be Merge branch 'fix/freertos_scheduler_suspend_crit_v5.3' into 'release/v5.3'
fix(freertos/idf): Add missing critical sections to vTaskSuspendAll() (v5.3)

See merge request espressif/esp-idf!30922
2024-05-20 10:53:35 +08:00
1847e53909 Merge branch 'bugfix/fix_isp_input_data_type_limit_v5.3' into 'release/v5.3'
fix(isp): updated to only support input data type as raw8 (v5.3)

See merge request espressif/esp-idf!30857
2024-05-20 10:15:21 +08:00
285ba1fcf2 Merge branch 'fix/reduce-binary-size_v5.3' into 'release/v5.3'
Reduce binary size (v5.3)

See merge request espressif/esp-idf!30654
2024-05-20 01:09:17 +08:00
5c9392d177 Merge branch 'bugfix/free_memory_if_failed_to_strart_http_server_v5.3' into 'release/v5.3'
fix(esp_https_server): fix memory leak during configuring http server (v5.3)

See merge request espressif/esp-idf!30662
2024-05-20 01:08:21 +08:00
6a92c1485a Merge branch 'fix/pytest_server_start_command_failed_v5.3' into 'release/v5.3'
fix: Refactored script for initiating Python-based HTTPS server (v5.3)

See merge request espressif/esp-idf!30667
2024-05-20 01:07:55 +08:00
c91bdda9f3 Merge branch 'refactor/isp_af_interrupt_and_callback_v5.3' into 'release/v5.3'
refactor(isp): refactor the interrupt and callback solution (v5.3)

See merge request espressif/esp-idf!30565
2024-05-20 00:51:38 +08:00
f63e544dc3 Merge branch 'feature/support_chip912_cpll_spll_eco1_v5.3' into 'release/v5.3'
feat: support(esp32p4_eco1): modify cpll and spll config (v5.3)

See merge request espressif/esp-idf!30783
2024-05-20 00:48:27 +08:00
0680af1269 Merge branch 'feature/usj_support_p4_v5.3' into 'release/v5.3'
feature(usb_serial_jtag): add usb serial jtag support for esp32p4 (backport v5.3)

See merge request espressif/esp-idf!30793
2024-05-20 00:48:22 +08:00
2decfbc007 Merge branch 'fix/hello_world_linux_target_on_macos_v5.3' into 'release/v5.3'
fix(esp-tls): Fix compilation for linux target on macos (v5.3)

See merge request espressif/esp-idf!30808
2024-05-20 00:48:11 +08:00
3640c1ecba fix(bootloader_support): Fix flash encryption for esp32p4 2024-05-17 21:19:14 +05:30
cbb43bb4c4 refactor(freertos/idf): Add critical section requirements to function description
This commit adds a note regarding the critical section calling requires of some
internal functions.
2024-05-17 22:43:35 +08:00
0dc29caf4a fix(freertos/idf): Add missing critical sections to vTaskSuspendAll()
vTaskSuspendAll() requires critical sections when building for SMP. Otherwise,
it is possible for a task to switch cores in between getting the core ID and
before incremented uxSchedulerSuspended.
2024-05-17 22:43:34 +08:00
5f07f64802 example(isp): added isp af example 2024-05-17 15:29:17 +08:00
e4f1c01197 fix(csi): fixed wrong assert when there's new transaction 2024-05-17 15:26:58 +08:00
2ed780b686 fix(isp): fixed af environment detector lack of configuration issue 2024-05-17 15:26:46 +08:00
a9383cb433 example(camera): added new camera dsi example 2024-05-17 15:26:39 +08:00
5e817df25f fix(coredump): don't allow mapping of non-encrypted coredump partition 2024-05-16 21:31:40 +02:00
bd8d7ea76a fix(coredump): increase sanity check before get summary
Closes https://github.com/espressif/esp-idf/issues/13594
2024-05-16 21:17:24 +02:00
zwl
352ee6fc26 ble: fixed some issues on ESP32C6 and ESP32H2 2024-05-16 17:46:07 +08:00
7403b8d68d feat(rom): update c5 mp verison rom ld file 2024-05-16 15:03:21 +08:00
f27e117b5b feat(gpio): update gpio docs on ESP32C5 MP version 2024-05-16 15:02:55 +08:00
a621402e1f feat(pm): add SOC_PM_SUPPORTED in soc caps 2024-05-16 15:00:22 +08:00
a08558a853 feat(coredump): replace fun sel function 2024-05-16 14:58:52 +08:00
2cad39aee5 feat(gpio): add gpio support on ESP32C5 MP version 2024-05-16 14:54:27 +08:00
173bb82f45 docs(esp32c3): Added missing USB functions to esp32-c3 devkit user guides 2024-05-16 10:56:53 +08:00
8472467721 fix(isp): updated to only support input data type as raw8 2024-05-16 10:40:26 +08:00
2f6fb59b6b docs(nimble): Added chip information in ble_enc_adv README file 2024-05-15 15:35:33 +05:30
f324e75c64 fix(interrupt): fixed interrupt thresholds not working on C5 2024-05-15 16:02:48 +08:00
1a1a708699 fix(brownout): fixed brownout isr crashing if cache disabled
If a brownout ISR was triggered while cache was disabled the system would panic.

This was due to a print accessing a string stored in flash
2024-05-15 09:13:53 +08:00
24e5e3aef1 feat: Enable app_update test app for ESP32P4 2024-05-14 10:27:32 +05:30
d8bc05c5d0 fix(bt/controller): Parse out the correct packet types from Host parameters
- For HCI command HCI_Enhanced_Setup_Synchronous_Connection
2024-05-14 11:52:58 +08:00
bfa95cdd75 fix(bt/ble): fix some issues in bluetooth controller
1: fix assert 1024 issue when bt tx and wifi coexist on esp32
2: fix ble scan backoff
3: parse out the correct packet types from host parameters for
   hci command hci_enhanced_setup_synchronous_connection
2024-05-14 10:09:37 +08:00
199dc389cc fix(esp-tls): Fix compilation for linux target on macos
This commit fixes compilation errors for the esp-tls component for the
linux target on a MacOS system.
2024-05-13 13:44:25 +02:00
b400a8cd72 change(gdbinit): set remote timeout for the gdb connection 2024-05-13 13:34:13 +02:00
4dc565b7d0 feature(usb_serial_jtag): add usb serial jtag support for esp32p4 2024-05-13 12:19:14 +08:00
cbcd346171 feat(esp32p4): add eco1 revision config option 2024-05-11 11:46:08 +08:00
f1d1dfd1ef feat(esp32p4_eco1): modify cpll and spll config 2024-05-11 11:43:24 +08:00
dd20d1f2b5 refactor(isp): refactor the interrupt and callback solution
- Added async API
- Replaced the polling API
- Supported one more callback and event data
2024-05-11 11:11:49 +08:00
4e850f158e ci: move log dir from pytest_embedded_log to pytest-embedded 2024-05-10 10:29:21 +02:00
ea010f84ef Merge branch 'fix/freertos_vtasklist_param_order_v5.3' into 'release/v5.3'
fix(freertos): Fix vTaskList() parameter print order (v5.3)

See merge request espressif/esp-idf!30476
2024-05-09 16:48:24 +08:00
68a9c09c49 Merge branch 'bugfix/gcmp_mr_regression_v5.3' into 'release/v5.3'
fix(wifi): Fix issue of wrong Rx control information of espnow packets (Backport v5.3)

See merge request espressif/esp-idf!30739
2024-05-09 16:37:30 +08:00
53c4c08283 Merge branch 'bugfix/libphy_chips_20240430_v5.3' into 'release/v5.3'
update c3 s3 c6 libphy fix coex reset and bug

See merge request espressif/esp-idf!30725
2024-05-09 15:55:08 +08:00
89a612aea0 fix(nimble): Free controller memory if init fails 2024-05-09 12:20:11 +05:30
a9dcc3964d fix(wifi): Fix issue of wrong Rx control information of espnow packets
Only for esp32 and esp32s2
2024-05-09 13:57:12 +08:00
8503709d85 Merge branch 'feature/update_mbedtls_to_3.6.0_v5.3' into 'release/v5.3'
feat(mbedtls): updated mbedtls version from 3.5.2 to 3.6.0 (v5.3)

See merge request espressif/esp-idf!30668
2024-05-09 12:16:22 +08:00
4eacfd6ee1 update c3 s3 c6 libphy fix coex reset and bug 2024-05-09 11:57:56 +08:00
9eb61ef5a7 docs: Update the process of Bluetooth entering sleep in the sleep_modes.rst 2024-05-09 11:01:31 +08:00
7165a3bdbb Merge branch 'feat/mipi_dsi_draw_pixel_round_boundary_v5.3' into 'release/v5.3'
feat(mipi_dsi): round to boundary when draw pixel (v5.3)

See merge request espressif/esp-idf!30694
2024-05-09 09:44:21 +08:00
1b331d24b3 Merge branch 'fix/idf_size_python_compat_v5.3' into 'release/v5.3'
fix: make idf_size.py compatible with python3.8 (v5.3)

See merge request espressif/esp-idf!30727
2024-05-09 02:01:36 +08:00
fe4b401ab2 ci: add simple test for idf_size.py python compatibility
This adds a simple test that tries to run idf_size.py help and check
if the process does not exit with error. This is just to make sure
that idf_size.py can be used with minimum required python version.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-08 19:48:52 +02:00
ebc9d02146 fix: make idf_size.py compatible with python3.8
Previous 6caa4a17ac ("fix: display correct help in the idf_size.py wrapper")
introduced a regression, because it uses exit_on_error parameter for
argparse.ArgumentParser, which was added in python3.9, making
idf_size.py incompatible with idf.py minimal required python3.8.

The objective is to inspect the arguments of idf_size.py using a wrapper
argparse to determine whether the legacy or refactored version should be
initiated, while always displaying help for the underlying version. The
exit_on_error function was previously utilized to prevent argparse from
exiting and displaying help/usage. This replaces exit_on_error with a
workaround that makes the --format argument optional. Since this is the
sole instance where the wrapper argparse might fail, it achieves the
same outcome as using exit_on_error.

Fixes: 6caa4a17ac ("fix: display correct help in the idf_size.py wrapper")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-08 19:48:51 +02:00
ec50cd7d7e Merge branch 'fix/backport_wifi_fixes_v5.3' into 'release/v5.3'
fix(wifi): backport wifi fixes to v5.3

See merge request espressif/esp-idf!30689
2024-05-08 19:16:26 +08:00
0cf4889f22 Merge branch 'change/rename_csi_api_v5.3' into 'release/v5.3'
change(camera): change esp_cam_del_ctlr to esp_cam_ctlr_del (v5.3)

See merge request espressif/esp-idf!30692
2024-05-08 17:23:04 +08:00
b9f15ba3ab feat(mipi_dsi): round to boundary when draw pixel 2024-05-08 16:31:51 +08:00
d22f9a97aa change(camera): change esp_cam_del_ctlr to esp_cam_ctlr_del 2024-05-08 15:29:20 +08:00
90188040fb fix(esp_wifi): clear soc wakeup request signal at tbtt process 2024-05-08 13:44:54 +08:00
ea1a10da17 fix(wifi): Fix issue in scan when AP advertises WPA and WPA2 with SAE AKM 2024-05-08 13:44:51 +08:00
7c54373146 feat(esp_wifi): Update FTM PHY Compensation with calibration 2024-05-08 13:42:23 +08:00
209fbfc18b fix(wifi): fix trc_ampdu_stop_rateidx value errors when DUT under softap + sta mode 2024-05-08 13:42:10 +08:00
8545eeb4ef fix(wifi): clear wifi buffer to fix ampdu compatibility issue 2024-05-08 13:41:58 +08:00
a22d0df155 fix(wifi): fix esp32c6 wdt issues when recv/send tcp packages 2024-05-08 13:41:36 +08:00
c706096f45 Merge branch 'test/gdma_fetch_data_in_flash_v5.3' into 'release/v5.3'
test(gdma): can read data from flash rodata (v5.3)

See merge request espressif/esp-idf!30655
2024-05-08 10:50:53 +08:00
b8ed93eec0 ci: apply new fix in pytest-embedded 1.10 2024-05-07 12:17:10 +02:00
840ec6579f ci: update mypy check for python 3.12, check under python 3.8 rules 2024-05-07 12:17:10 +02:00
7aed3eb3bc fix(esp_pm): fix esp_pm test cases high fail ratio 2024-05-07 17:08:28 +08:00
fe628d5951 feat(mbedtls): updated mbedtls version from 3.5.2 to 3.6.0
This MR updated MbedTLS version to latest version 3.6.0.
2024-05-07 14:16:21 +05:30
855d1eb170 fix: Refactored script for initiating Python-based HTTPS server
This commit refactors the script responsible for starting a Python-based HTTPS server
to align with the latest Python version's requirements and best practices.

Closes https://github.com/espressif/esp-idf/issues/13575
2024-05-07 14:15:05 +05:30
8ed42582fe Merge branch 'fix/jpeg_dri_issue_v5.3' into 'release/v5.3'
fix(jpeg): Fix several issues reported recently, (backport v5.3)

See merge request espressif/esp-idf!30657
2024-05-07 16:22:09 +08:00
5428555092 fix(esp_https_server): fix memory leak during configuring http server
This MR This restructured code to prevent memory leak during the starting HTTP server.

Closes https://github.com/espressif/esp-idf/issues/13526
2024-05-07 13:51:38 +05:30
8f091de9c2 Merge branch 'fix/idf_size_help_v5.3' into 'release/v5.3'
fix: display correct help in the idf_size.py wrapper (v5.3)

See merge request espressif/esp-idf!30661
2024-05-07 16:01:12 +08:00
ae0eabec53 fix: display correct help in the idf_size.py wrapper
Currently the wrapper tries to figure out which version of
the esp-idf-size should be started. The legacy version is
used if explicitly requested by the -l/--legacy option or
if json format is specified. This works fine, but if help
is requested, it is printed for the wrapper as shown bellow

$ idf_size.py -h
usage: idf_size.py [-h] [--format FORMAT] [-l]

options:
  -h, --help       show this help message and exit
  --format FORMAT
  -l, --legacy

This is not convenient and the full help from the underlying
version should be displayed.

Fix this by only peeking into the args to figure out if legacy or
refactored version should be started and always spawn the underlying
esp_idf_size python module. This is done by using exit_on_error=False and
add_help=False for the ArgumentParser. When help for refactored version
is requested a note as following is printed to notify users that the
legacy version can still be used.

$ idf_size.py -h
Note: legacy esp_idf_size version can be invoked by specifying the -l/--legacy
option or by setting the ESP_IDF_SIZE_LEGACY environment variable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-05-07 09:42:19 +02:00
6b0a815b78 fix(jpeg): Fix several issues reported recently,
1. Fix decode images with dri marker failed,
2. Fix encode sometimes get length error
2024-05-07 13:58:18 +08:00
a04f786380 test(gdma): can read data from flash rodata 2024-05-07 13:01:11 +08:00
a6d8251366 feat(gdma): set default valid memory range for gdma 2024-05-07 13:00:39 +08:00
9fd92e8bf4 fix(cxx): use __cxa_throw() stub in case exceptions disabled
Reduces binary size since the linker will drop some code due to --gc-sections.
2024-05-07 08:52:36 +04:00
d42e894a74 fix(system): discard eh_frame sections if disabled in sdkconfig 2024-05-07 08:52:36 +04:00
bf415f580f Merge branch 'bugfix/disable_mbedtls_options_v5.3' into 'release/v5.3'
fix(nimble): Deselect MBEDTLS_ECP_RESTARTABLE when mbedTLS is used (v5.3)

See merge request espressif/esp-idf!30618
2024-05-07 12:38:05 +08:00
55a8a18fb7 Merge branch 'bugfix/fix_hid_connection_failed_bug_v5.3' into 'release/v5.3'
fix(bt/bluedroid): Fix HID Device connection failed bug[backport 5.3]

See merge request espressif/esp-idf!30586
2024-05-06 17:57:27 +08:00
a61a367bc4 fix(nimble): Deselect MBEDTLS_ECP_RESTARTABLE when mbedTLS is used 2024-05-06 15:17:57 +05:30
c19e762c89 Merge branch 'doc/ringbuffer_v5.3' into 'release/v5.3'
docs(esp_ringbuf): Corrected example code block (v5.3)

See merge request espressif/esp-idf!30631
2024-05-06 17:11:41 +08:00
6fea6aae8c docs(esp_ringbuf): Corrected example code block
* Closes https://github.com/espressif/esp-idf/issues/13730
2024-05-06 10:15:03 +02:00
027193ca07 fix(freertos): Fix vTaskList() parameter print order
xCoreID was previously printed as the last parameter priority to IDF v5.1, but
was changed to the third paramtere from v5.2 onwards. This commit restores the
correct ordering.

Closes https://github.com/espressif/esp-idf/issues/13675
2024-05-06 16:05:31 +08:00
8bd2287233 Merge branch 'fix/increase_26mhz_esp32c2_slow_clock_calibration_wdt_threshold_v5.3' into 'release/v5.3'
fix(esp_system): increase 26Mhz esp32c2 slow clock calibration timeout watchdog threshold (v5.3)

See merge request espressif/esp-idf!30575
2024-05-06 14:04:39 +08:00
aa1c3af4c4 Merge branch 'bugfix/nvs_enc_test_v5.3' into 'release/v5.3'
fix(tests): correct the flash write length for NVS encrypted test (v5.3)

See merge request espressif/esp-idf!30602
2024-05-06 13:31:26 +08:00
577a50b02a Merge branch 'bugfix/get_random_inside_assert_v5.3' into 'release/v5.3'
fix(linux): calling getrandom() outside assert() (v5.3)

See merge request espressif/esp-idf!30613
2024-05-06 10:29:02 +08:00
b11014a7c6 Merge branch 'bugfix/mipi_dsi_1_data_lane_v5.3' into 'release/v5.3'
fix(mipi_dsi): only wait ready for enabled data lane (v5.3)

See merge request espressif/esp-idf!30580
2024-05-06 10:22:52 +08:00
901f937698 Merge branch 'fix/esp_tls_use_64_bit_variable_for_time_v5.3' into 'release/v5.3'
fix(esp-tls): Use 64 bit variable for time instead of 32 bit (v5.3)

See merge request espressif/esp-idf!30615
2024-05-03 21:33:17 +08:00
39771b6c81 fix(esp-tls): Use 64 bit variable for time instead of 32 bit
Use appropriate API available on respective platform for obtaining
    time
    Closes https://github.com/espressif/esp-idf/issues/13593
2024-05-03 09:03:05 +05:30
b026a7c915 fix(linux): calling getrandom() outside assert()
* Expressions inside assert are completely removed in release builds
2024-05-02 16:56:39 +02:00
f82fea4c1b fix(tests): correct the flash write length for NVS encrypted test
Write only till the embedded file size in the NVS partition. Earlier
the length was kept as the whole partition size and it could result
in accessing embedded rodata beyond the MMU mapped range.
2024-05-02 16:48:57 +05:30
60ab9631d7 fix(tests): remove unused partition NVS bin file 2024-05-02 16:48:54 +05:30
91c4a94f61 fix(bt/bluedroid): Fix HID Device connection failed bug
Closes https://github.com/espressif/esp-idf/issues/13671
2024-04-30 17:56:00 +08:00
df211933ff fix(mipi_dsi): only wait ready for enabled data lane 2024-04-30 16:46:03 +08:00
e486f3b944 Merge branch 'fix/error_reg_base_name_on_p4_v5.3' into 'release/v5.3'
fix(soc): fixed redefined soc reg names on P4 (v5.3)

See merge request espressif/esp-idf!30564
2024-04-30 12:09:21 +08:00
ccca8b74eb fix(esp_system): increase 26Mhz esp32c2 slow clock calibration timeout watchdog threshold 2024-04-30 11:48:42 +08:00
7d7d9d7090 Merge branch 'docs/p4_cleanup_v5.3' into 'release/v5.3'
docs(programming-guide): clean up misc leftover doc updates for P4 (v5.3)

See merge request espressif/esp-idf!30568
2024-04-30 10:31:20 +08:00
0ee7d4d17a docs(programming-guide): clean up misc leftover doc updates for P4 2024-04-30 09:46:25 +08:00
a246aa2973 fix(soc): fixed redefined soc reg names on P4 2024-04-29 19:33:04 +08:00
2508d3f23b Merge branch 'fix/ci_cli_installer_cmake_v5.3' into 'release/v5.3'
ci(tools): Fix IDF_MIRROR_PREFIX_MAP for including all tools from local (v5.3)

See merge request espressif/esp-idf!30552
2024-04-29 17:45:50 +08:00
b494330381 Merge branch 'fix/docs_p4_tools_v5.3' into 'release/v5.3'
change(docs): Update checked tools doc pages for ESP32-P4 programming guide (v5.3)

See merge request espressif/esp-idf!30558
2024-04-29 17:45:24 +08:00
ddc357fcca change(docs): Update checked tools doc pages for ESP32-P4 programming guide 2024-04-29 09:54:00 +02:00
6a5ab20489 ci(tools): Fix IDF_MIRROR_PREFIX_MAP for including all tools from local 2024-04-29 09:00:55 +02:00
30fce03e35 Merge branch 'bugfix/fix_ble_coex_assert_v5.3' into 'release/v5.3'
Update esp32 bt-lib (4012cfb)(backport v5.3)

See merge request espressif/esp-idf!30521
2024-04-28 10:48:02 +08:00
212f316f24 feat(ble/bluedroid): Support BLE command status debug log 2024-04-26 17:13:39 +08:00
0fcc940bc1 fix(ble/controller): Update esp32 bt-lib (4012cfb)
- Fixed BLE coex assert
- Fixed BLE DTM status and tx count
2024-04-26 16:53:39 +08:00
b43fc4d63a Merge branch 'feat/dsi_lcd_iram_safe_v5.3' into 'release/v5.3'
MIPI DSI IRAM Safe (v5.3)

See merge request espressif/esp-idf!30510
2024-04-26 15:57:01 +08:00
7fb317655d Merge branch 'ci/fix-url-quote-v5.3' into 'release/v5.3'
ci: quote spec character in url

See merge request espressif/esp-idf!30500
2024-04-26 13:53:55 +08:00
49aaac0013 feat(mipi_dsi): support isr iram safe 2024-04-26 10:41:04 +08:00
d910ca7fa8 feat(mipi_dsi): add pm lock for clock source 2024-04-26 10:41:04 +08:00
935da554c9 Merge branch 'refactor/dma_test_p4_v5.3' into 'release/v5.3'
change(gdma): improve the test cases to be target agnostic (v5.3)

See merge request espressif/esp-idf!30486
2024-04-26 10:33:14 +08:00
5b3996885c ci: quote spec character in url 2024-04-25 18:35:56 +08:00
7c57624b66 Merge branch 'ci/fix_app_size_json_path_v5.3' into 'release/v5.3'
CI: fix app size json path (v5.3)

See merge request espressif/esp-idf!30494
2024-04-25 16:37:00 +08:00
e56f92aab4 Merge branch 'bugfix/fix_gpio_etm_multi_task_v5.3' into 'release/v5.3'
fix(gpio_etm): allow one GPIO binds to multiple ETM tasks (v5.3)

See merge request espressif/esp-idf!30455
2024-04-25 15:43:16 +08:00
3386c594b4 ci: fix size.json path for app 2024-04-25 08:49:16 +02:00
0440d582dc docs(performance): Add esp32p4/c5 relevant information to the performance guides
in speed.rst:
- add startup time increase info when spiram test is enabled
- add startup time increase info when spiram is enabled and
  poisoning comprehensive is enabled
- add L2 cache variable size info to optimize IRAM space / cache misses
- update sections refencing bluetooth/wifi built-in tasks to not show
  related info for p4 targets.
- Add IDF_TARGET_RF_TYPE for esp32c5

in ram-usage.rst:
- add L2 cache variable size info to maximize RAM space

Remove the files from esp32c5.txt and esp32p4.txt
that are no longer in need of update.
2024-04-25 08:05:46 +02:00
4fb58d56b4 change(gdma): improve the test cases to be target agnostic 2024-04-25 11:07:16 +08:00
665883229e fix(gpio_etm): allow one GPIO binds to multiple ETM tasks 2024-04-24 15:58:49 +08:00
a85d1e1eca fix(esp_eth): dp83848: correct link detection to use BMSR
Reading the link state via PHYSTS was incorrect, as it only reflects the
link state bit from BMSR.  BMSR latches link down events, and are not
cleared without being read.  (See 802.3-2008 section 2, section 22.2.4.2.13)
This leads to the original DP828xx code only supporting link up, then a
single link down event.

Switch to reading the link state via BMSR, but continuing to read the
negotiation results via PHYSTS and ANLPAR.  This is inline with
LAN8720x, RTL8201, KSZ80xx phy drivers, and other opensource drivers for
the DP838xx family of devices.

Tested on a private board with a DP83825i PHY.  No publically available
boards using the original DP83848 are known of for testing.

Signed-off-by: Karl Palsson <karl.palsson@marel.com>
2024-04-24 09:34:58 +02:00
14315bb751 Merge branch 'bugfix/rpa_timeout_api_v5.3' into 'release/v5.3'
fix(nimble): Expose API to set RPA Timeout (v5.3)

See merge request espressif/esp-idf!30407
2024-04-23 20:06:14 +08:00
fa866b49ca docs(esp_common): Fix formatting issues in error-handling.rst
This commit fixes the following formatting issues in error-handling.rst:

- Incorrect indentation (3 spaces to 4 spaces)
- Fixed some italics that were supposed to be inline literals
- Used code-block directive for language highlighting
2024-04-23 14:49:48 +08:00
ebe1141b25 docs: clarify ESP_RETURN_ON_ERROR result 2024-04-23 14:49:47 +08:00
cb5bc35f2e fix(nimble): Expose API to set RPA Timeout 2024-04-23 11:22:21 +05:30
55658d4c36 Merge branch 'maint/release_v5.3_codeowners' into 'release/v5.3'
change(gitlab): simplify approvals for backports (v5.3)

See merge request espressif/esp-idf!30398
2024-04-23 10:35:14 +08:00
f1b9b357e4 change(gitlab): simplify approvals for backports (v5.3) 2024-04-23 01:33:44 +02:00
3af63dcf4a fix(storage/littlefs): Bump version to v1.14.4 (core v2.9.1)
Fixes a bug which causes DivideByZero exception when the filesystem is full
2024-04-19 12:54:26 +02:00
2749 changed files with 104524 additions and 57474 deletions

View File

@ -1,4 +1,4 @@
[codespell]
skip = build,*.yuv,components/fatfs/src/*,alice.txt,*.rgb,components/wpa_supplicant/*,components/esp_wifi/*
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart
ignore-words-list = ser,dout,rsource,fram,inout,shs,ans,aci,unstall,unstalling,hart,wheight,ot,wel,parms
write-changes = true

3
.gitignore vendored
View File

@ -96,10 +96,13 @@ dependencies.lock
managed_components
# pytest log
pytest-embedded/
# legacy one
pytest_embedded_log/
list_job*.txt
size_info*.txt
XUNIT_RESULT*.xml
.manifest_sha
# clang config (for LSP)
.clangd

View File

@ -2,239 +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
/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
/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 @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_system/ @esp-idf-codeowners/system
/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/heap/ @esp-idf-codeowners/system
/components/http_parser/ @esp-idf-codeowners/app-utilities
/components/idf_test/ @esp-idf-codeowners/ci
/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/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/ci
/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/**/api-guides/tools/ @esp-idf-codeowners/tools
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
/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/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
/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/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/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

@ -1,7 +1,7 @@
.build_template:
stage: build
extends:
- .after_script:build:ccache:upload-when-fail
- .after_script:build:ccache-show-stats:upload-failed-job-logs
image: $ESP_ENV_IMAGE
tags:
- build
@ -16,7 +16,7 @@
extends:
- .build_template
- .before_script:build
- .after_script:build:ccache
- .after_script:build:ccache-show-stats
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
@ -42,9 +42,9 @@
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--extra-preserve-dirs
examples/bluetooth/esp_ble_mesh/ble_mesh_console
examples/bluetooth/hci/controller_hci_uart_esp32
examples/wifi/iperf
examples/bluetooth/esp_ble_mesh/ble_mesh_console
examples/bluetooth/hci/controller_hci_uart_esp32
examples/wifi/iperf
--modified-components ${MR_MODIFIED_COMPONENTS}
--modified-files ${MR_MODIFIED_FILES}
# for detailed documents, please refer to .gitlab/ci/README.md#uploaddownload-artifacts-to-internal-minio-server
@ -210,15 +210,16 @@ pytest_build_system_macos:
extends:
- .test_build_system_template
- .before_script:build:macos
- .after_script:build:macos:upload-when-fail
- .after_script:build:macos:upload-failed-job-logs:ccache-show-stats
- .rules:build:macos
tags:
- macos_shell
parallel: 3
variables:
PYENV_VERSION: "3.8"
CI_CCACHE_DISABLE: "1" # ccache: error: Read-only file system
# CCACHE_DIR: "/cache/idf_ccache". On macOS, you cannot write to this folder due to insufficient permissions.
CCACHE_DIR: "" # ccache will use "$HOME/Library/Caches/ccache".
CCACHE_MAXSIZE: "5G" # To preserve the limited Macbook storage. CCACHE automatically prunes old caches to fit the set limit.
build_docker:
extends:
- .before_script:minimal
@ -264,6 +265,8 @@ generate_build_child_pipeline:
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- pipeline_variables
- job: baseline_manifest_sha
optional: true
artifacts:
paths:
- build_child_pipeline.yml

View File

@ -14,12 +14,12 @@ stages:
- post_deploy
variables:
# System environment
# System environment
# Common parameters for the 'make' during CI tests
MAKEFLAGS: "-j5 --no-keep-going"
# GitLab-CI environment
# GitLab-CI environment
# Thanks to pack-objects cache, clone strategy should behave faster than fetch
# so we pick "clone" as default git strategy
# Shiny runners by default remove the CI_PROJECT_DIR every time at the beginning of one job
@ -39,7 +39,7 @@ variables:
GIT_FETCH_EXTRA_FLAGS: "--no-recurse-submodules --prune --prune-tags"
# we're using .cache folder for caches
GIT_CLEAN_FLAGS: -ffdx -e .cache/
LATEST_GIT_TAG: v5.3-dev
LATEST_GIT_TAG: v5.3.2
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
# by default we will fetch all submodules
@ -84,7 +84,7 @@ variables:
CI_PYTHON_TOOL_BRANCH: ""
# Set this variable to specify the file name for the known failure cases.
KNOWN_FAILURE_CASES_FILE_NAME: "master.txt"
KNOWN_FAILURE_CASES_FILE_NAME: "5.3.txt"
IDF_CI_BUILD: 1
@ -219,13 +219,14 @@ variables:
- *setup_tools_and_idf_python_venv
- fetch_submodules
.after_script:build:macos:upload-when-fail:
.after_script:build:macos:upload-failed-job-logs:ccache-show-stats:
after_script:
# macos is running shell executor, which means it would use
# the system installed /usr/local/bin/python3 by default.
# Ensure pyenv and PYENV_VERSION installed
- eval "$(pyenv init -)"
- *upload_failed_job_log_artifacts
- *show_ccache_statistics
.before_script:build:
before_script:
@ -236,11 +237,11 @@ variables:
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
.after_script:build:ccache:
.after_script:build:ccache-show-stats:
after_script:
- *show_ccache_statistics
.after_script:build:ccache:upload-when-fail:
.after_script:build:ccache-show-stats:upload-failed-job-logs:
after_script:
- *show_ccache_statistics
- *upload_failed_job_log_artifacts
@ -363,12 +364,12 @@ default:
- *setup_tools_and_idf_python_venv
- add_gitlab_ssh_keys
- fetch_submodules
# gitlab bug, setting them here doesn't work
# - expire_in: https://gitlab.com/gitlab-org/gitlab/-/issues/404563
# - when: https://gitlab.com/gitlab-org/gitlab/-/issues/440672
# artifacts:
# expire_in: 1 week
# when: always
# gitlab bug, setting them here doesn't work
# - expire_in: https://gitlab.com/gitlab-org/gitlab/-/issues/404563
# - when: https://gitlab.com/gitlab-org/gitlab/-/issues/440672
# artifacts:
# expire_in: 1 week
# when: always
retry:
max: 2
when:

View File

@ -1,4 +1,4 @@
# Extenal DangerJS
# External DangerJS
include:
- project: espressif/shared-ci-dangerjs
ref: master
@ -10,7 +10,6 @@ run-danger-mr-linter:
GIT_STRATEGY: none # no repo checkout
ENABLE_CHECK_AREA_LABELS: 'true'
ENABLE_CHECK_DOCS_TRANSLATION: 'true'
ENABLE_CHECK_RELEASE_NOTES_DESCRIPTION: 'true'
ENABLE_CHECK_UPDATED_CHANGELOG: 'false'
before_script: []
cache: []

View File

@ -8,7 +8,6 @@
# This file should ONLY be used during bringup. Should be reset to empty after the bringup process
extra_default_build_targets:
- esp32p4
- esp32c5
bypass_check_test_targets:
- esp32c5

View File

@ -171,6 +171,7 @@ build_docs_pdf:
- job: fast_template_app
artifacts: false
optional: true
allow_failure: true # TODO IDFCI-2216
artifacts:
paths:
- docs/_build/*/*/latex/*
@ -182,6 +183,7 @@ build_docs_pdf_prod:
- .build_docs_template
- .doc-rules:build:docs-full-prod
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
allow_failure: true # TODO IDFCI-2216
artifacts:
paths:
- docs/_build/*/*/latex/*

View File

@ -133,7 +133,7 @@ test_cli_installer:
script:
# Tools must be downloaded for testing
# We could use "idf_tools.py download all", but we don't want to install clang because of its huge size
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
- cd ${IDF_PATH}/tools/test_idf_tools
- python3 -m pip install jsonschema
- python3 ./test_idf_tools.py -v
@ -228,6 +228,8 @@ test_tools:
- pytest --noconftest test_idf_qemu.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY_QEMU.xml || stat=1
- cd ${IDF_PATH}/tools/test_mkdfu
- pytest --noconftest test_mkdfu.py --junitxml=${IDF_PATH}/XUNIT_MKDFU.xml || stat=1
- cd ${IDF_PATH}/tools/test_idf_size
- pytest --noconftest test_idf_size.py --junitxml=${IDF_PATH}/XUNIT_IDF_SIZE.xml || stat=1
- cd ${IDF_PATH}
- shellcheck -s sh tools/detect_python.sh || stat=1
- shellcheck -s bash tools/detect_python.sh || stat=1
@ -296,7 +298,7 @@ test_pytest_qemu:
artifacts:
paths:
- XUNIT_RESULT.xml
- pytest_embedded_log/
- pytest-embedded/
reports:
junit: XUNIT_RESULT.xml
allow_failure: true # IDFCI-1752
@ -330,7 +332,7 @@ test_pytest_linux:
artifacts:
paths:
- XUNIT_RESULT.xml
- pytest_embedded_log/
- pytest-embedded/
- "**/build*/build_log.txt"
reports:
junit: XUNIT_RESULT.xml

View File

@ -44,6 +44,8 @@ check_blobs:
- IDF_TARGET=esp32c2 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c3 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c6 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32c5 $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
- IDF_TARGET=esp32_host $IDF_PATH/components/esp_wifi/test_md5/test_md5.sh
# Check if Coexistence library header files match between IDF and the version used when compiling the libraries
- IDF_TARGET=esp32 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32s2 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
@ -52,6 +54,7 @@ check_blobs:
- IDF_TARGET=esp32c3 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32c6 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32h2 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
- IDF_TARGET=esp32c5 $IDF_PATH/components/esp_coex/test_md5/test_md5.sh
# Check if Wi-Fi, PHY, BT blobs contain references to specific symbols
- bash $IDF_PATH/tools/ci/check_blobs.sh
@ -166,3 +169,35 @@ pipeline_variables:
- pipeline.env
expire_in: 1 week
when: always
baseline_manifest_sha:
extends:
- .pre_check_template
- .rules:dev-push
tags: [fast_run, shiny]
script:
- |
# merged results pipelines, by default
# diff between target-branch-head and merged-result-head
if [ -n "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then
git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_SHA --depth=1
git checkout FETCH_HEAD
idf-build-apps dump-manifest-sha \
--manifest-files $(find . -name ".build-test-rules.yml" | xargs) \
--output .manifest_sha
# merge request pipelines, when the mr got conflicts
# diff between diff-base-sha and merge-request-head
elif [ -n "$CI_MERGE_REQUEST_DIFF_BASE_SHA" ]; then
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1
git checkout FETCH_HEAD
idf-build-apps dump-manifest-sha \
--manifest-files $(find . -name ".build-test-rules.yml" | xargs) \
--output .manifest_sha
# other pipelines, like the protected branches pipelines
# not triggered in this job
fi
artifacts:
paths:
- .manifest_sha
expire_in: 1 week
when: always

View File

@ -86,6 +86,7 @@
- "tools/test_idf_py/**/*"
- "tools/idf_size.py"
- "tools/test_idf_size/**/*"
- "tools/tools.json"
- "tools/tools_schema.json"
@ -216,6 +217,10 @@
rules:
- <<: *if-tag-release
.rules:dev-push:
rules:
- <<: *if-dev-push
# Do not upload caches on dev branches by default
.rules:upload-python-cache:
rules:
@ -248,15 +253,6 @@
- <<: *if-dev-push
changes: *patterns-python-files
.rules:patterns:static-code-analysis-preview:
rules:
- <<: *if-dev-push
changes: *patterns-c-files
- <<: *if-dev-push
changes: *patterns-python-files
- <<: *if-dev-push
changes: *patterns-sonarqube-files
.rules:patterns:idf-pytest-plugin:
rules:
- <<: *if-protected

View File

@ -38,84 +38,3 @@ check_pylint:
fi
- if [ -z "$files" ]; then echo "No python files found"; exit 0; fi
- run_cmd pylint --exit-zero --load-plugins=pylint_gitlab --output-format=gitlab-codeclimate:pylint.json $files
# build stage
# Sonarqube related jobs put here for this reason:
# Here we have two jobs. code_quality_check and code_quality_report.
#
# code_quality_check will analyze the code changes between your MR and
# code repo stored in sonarqube server. The analysis result is only shown in
# the comments under this MR and won't be transferred to the server.
#
# code_quality_report will analyze and transfer both of the newly added code
# and the analysis result to the server.
#
# Put in the front to ensure that the newly merged code can be stored in
# sonarqube server ASAP, in order to avoid reporting unrelated code issues
.sonar_scan_template:
stage: build
extends: .pre_check_template
# full clone since this image does not support fetch --shallow-since-cutoff
# shiny runners are used for full clone
tags: [build, shiny]
image: $SONARQUBE_SCANNER_IMAGE
before_script:
- source tools/ci/utils.sh
- export PYTHONPATH="$CI_PROJECT_DIR/tools:$CI_PROJECT_DIR/tools/ci/python_packages:$PYTHONPATH"
- fetch_submodules
# Exclude the submodules, all paths ends with /**
- submodules=$(get_all_submodules)
# get all exclude paths specified in tools/ci/sonar_exclude_list.txt | ignore lines start with # | xargs | replace all <space> to <comma>
- custom_excludes=$(cat $CI_PROJECT_DIR/tools/ci/sonar_exclude_list.txt | grep -v '^#' | xargs | sed -e 's/ /,/g')
# Exclude the report dir as well
- export EXCLUSIONS="$custom_excludes,$submodules"
- export SONAR_SCANNER_OPTS="-Xmx2048m"
variables:
GIT_DEPTH: 0
REPORT_PATTERN: clang_tidy_reports/**/*.txt
artifacts:
paths:
- $REPORT_PATTERN
expire_in: 1 week
when: always
dependencies: # Here is not a hard dependency relationship, could be skipped when only python files changed. so we do not use "needs" here.
- clang_tidy_check
code_quality_check:
extends:
- .sonar_scan_template
- .rules:patterns:static-code-analysis-preview
allow_failure: true # it's using exit code to indicate the code analysis result,
# we don't want to block ci when critical issues founded
script:
- export CI_MERGE_REQUEST_COMMITS=$(python ${CI_PROJECT_DIR}/tools/ci/ci_get_mr_info.py commits --src-branch ${CI_COMMIT_REF_NAME} | tr '\n' ',')
# test if this branch have merge request, if not, exit 0
- test -n "$CI_MERGE_REQUEST_IID" || exit 0
- test -n "$CI_MERGE_REQUEST_COMMITS" || exit 0
- sonar-scanner
-Dsonar.analysis.mode=preview
-Dsonar.branch.name=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
-Dsonar.cxx.clangtidy.reportPath=$REPORT_PATTERN
-Dsonar.exclusions=$EXCLUSIONS
-Dsonar.gitlab.ci_merge_request_iid=$CI_MERGE_REQUEST_IID
-Dsonar.gitlab.commit_sha=$CI_MERGE_REQUEST_COMMITS
-Dsonar.gitlab.merge_request_discussion=true
-Dsonar.gitlab.ref_name=$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
-Dsonar.host.url=$SONAR_HOST_URL
-Dsonar.login=$SONAR_LOGIN
code_quality_report:
extends:
- .sonar_scan_template
- .rules:protected
allow_failure: true # it's using exit code to indicate the code analysis result,
# we don't want to block ci when critical issues founded
script:
- sonar-scanner
-Dsonar.branch.name=$CI_COMMIT_REF_NAME
-Dsonar.cxx.clangtidy.reportPath=$REPORT_PATTERN
-Dsonar.exclusions=$EXCLUSIONS
-Dsonar.gitlab.commit_sha=$PIPELINE_COMMIT_SHA
-Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME
-Dsonar.host.url=$SONAR_HOST_URL
-Dsonar.login=$SONAR_LOGIN

View File

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

5
.gitmodules vendored
View File

@ -49,12 +49,13 @@
[submodule "components/json/cJSON"]
path = components/json/cJSON
url = ../../DaveGamble/cJSON.git
sbom-version = 1.7.17
sbom-version = 1.7.18
sbom-cpe = cpe:2.3:a:cjson_project:cjson:{}:*:*:*:*:*:*:*
sbom-supplier = Person: Dave Gamble
sbom-url = https://github.com/DaveGamble/cJSON
sbom-description = Ultralightweight JSON parser in ANSI C
sbom-hash = 87d8f0961a01bf09bef98ff89bae9fdec42181ee
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls

View File

@ -103,10 +103,10 @@ repos:
name: Check type annotations in python files
entry: tools/ci/check_type_comments.py
additional_dependencies:
- 'mypy==0.940'
- 'mypy-extensions==0.4.3'
- 'types-setuptools==57.4.14'
- 'types-PyYAML==0.1.9'
- 'mypy'
- 'mypy-extensions'
- 'types-setuptools'
- 'types-PyYAML'
- 'types-requests'
exclude: >
(?x)^(
@ -236,6 +236,6 @@ repos:
name: Lint rST files in docs folder using Sphinx Lint
files: ^(docs/en|docs/zh_CN)/.*\.(rst|inc)$
- repo: https://github.com/espressif/esp-idf-kconfig.git
rev: v2.1.0
rev: v2.3.0
hooks:
- id: check-kconfig-files

View File

@ -96,7 +96,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Wno-pointer-bool-conversion")
# mbedTLS md5.c triggers this warning in md5_test_buf (false positive)
list(APPEND compile_options "-Wno-string-concatenation")
# multiple cases of implict convertions between unrelated enum types
# multiple cases of implicit conversions between unrelated enum types
list(APPEND compile_options "-Wno-enum-conversion")
# When IRAM_ATTR is specified both in function declaration and definition,
# it produces different section names, since section names include __COUNTER__.
@ -136,6 +136,10 @@ if(CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE)
list(APPEND compile_definitions "-DNDEBUG")
endif()
if(CONFIG_COMPILER_NO_MERGE_CONSTANTS)
list(APPEND compile_options "-fno-merge-constants")
endif()
if(CONFIG_COMPILER_STACK_CHECK_MODE_NORM)
list(APPEND compile_options "-fstack-protector")
elseif(CONFIG_COMPILER_STACK_CHECK_MODE_STRONG)
@ -215,8 +219,35 @@ endif()
list(APPEND link_options "-fno-lto")
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
# Not all versions of the MacOS linker support the -warn_commons flag.
# ld version 1053.12 (and above) have been tested to support it.
# Hence, we extract the version string from the linker output
# before including the flag.
# Get the ld version, capturing both stdout and stderr
execute_process(
COMMAND ${CMAKE_LINKER} -v
OUTPUT_VARIABLE LD_VERSION_OUTPUT
ERROR_VARIABLE LD_VERSION_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
# Combine stdout and stderr
set(LD_VERSION_OUTPUT "${LD_VERSION_OUTPUT}\n${LD_VERSION_ERROR}")
# Extract the version string
string(REGEX MATCH "PROJECT:(ld|dyld)-([0-9]+)\\.([0-9]+)" LD_VERSION_MATCH "${LD_VERSION_OUTPUT}")
set(LD_VERSION_MAJOR_MINOR "${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
message(STATUS "Linker Version: ${LD_VERSION_MAJOR_MINOR}")
# Compare the version with 1053.12
if(LD_VERSION_MAJOR_MINOR VERSION_GREATER_EQUAL "1053.12")
list(APPEND link_options "-Wl,-warn_commons")
endif()
list(APPEND link_options "-Wl,-dead_strip")
list(APPEND link_options "-Wl,-warn_commons")
else()
list(APPEND link_options "-Wl,--gc-sections")
list(APPEND link_options "-Wl,--warn-common")

37
Kconfig
View File

@ -75,10 +75,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
string
default "$IDF_INIT_VERSION"
config IDF_TARGET_LINUX
bool
default "y" if IDF_TARGET="linux"
config IDF_TARGET_ESP32
bool
default "y" if IDF_TARGET="esp32"
@ -533,6 +529,15 @@ mainmenu "Espressif IoT Development Framework Configuration"
help
Stack smashing protection.
config COMPILER_NO_MERGE_CONSTANTS
bool "Disable merging const sections"
depends on IDF_TOOLCHAIN_GCC
help
Disable merging identical constants (string/floating-point) across compilation units.
This helps in better size analysis of the application binary as the rodata section
distribution is more uniform across libraries. On downside, it may increase
the binary size and hence should be used during development phase only.
config COMPILER_WARN_WRITE_STRINGS
bool "Enable -Wwrite-strings warning flag"
default "n"
@ -607,6 +612,27 @@ mainmenu "Espressif IoT Development Framework Configuration"
default "gcc" if COMPILER_RT_LIB_GCCLIB
default "" if COMPILER_RT_LIB_HOST
choice COMPILER_ORPHAN_SECTIONS
prompt "Orphan sections handling"
default COMPILER_ORPHAN_SECTIONS_PLACE
depends on !IDF_TARGET_LINUX
help
If the linker finds orphan sections, it attempts to place orphan sections after sections of the same
attribute such as code vs data, loadable vs non-loadable, etc.
That means that orphan sections could placed between sections defined in IDF linker scripts.
This could lead to corruption of the binary image. Configure the linker action here.
config COMPILER_ORPHAN_SECTIONS_WARNING
bool "Place with warning"
help
Places orphan sections with a warning message.
config COMPILER_ORPHAN_SECTIONS_PLACE
bool "Place silently"
help
Places orphan sections without a warning/error message.
endchoice
endmenu # Compiler Options
menu "Component config"
@ -627,6 +653,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
- CONFIG_ESPTOOLPY_FLASHFREQ_120M && CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_DTR
- CONFIG_SPIRAM_SPEED_120M && CONFIG_SPIRAM_MODE_OCT
- CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
- CONFIG_MBEDTLS_USE_CRYPTO_ROM_IMPL
- CONFIG_ESP_WIFI_EAP_TLS1_3
- CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
- CONFIG_USB_HOST_EXT_PORT_SUPPORT_LS
- CONFIG_USB_HOST_EXT_PORT_RESET_ATTEMPTS

View File

@ -17,6 +17,7 @@
#include "esp_image_format.h"
#include "esp_secure_boot.h"
#include "esp_flash_encrypt.h"
#include "spi_flash_mmap.h"
#include "sdkconfig.h"
#include "esp_ota_ops.h"

View File

@ -2,6 +2,6 @@
components/app_update/test_apps:
disable:
- if: IDF_TARGET in ["esp32c6", "esp32h2", "esp32p4", "esp32c5"]
- if: IDF_TARGET in ["esp32c6", "esp32h2", "esp32c5"]
temporary: true
reason: target esp32c6, esp32h2, esp32p4, esp32c5 is not supported yet # TODO: IDF-8068, [ESP32C5] IDF-8638
reason: target esp32c6, esp32h2 esp32c5 is not supported yet # TODO: [ESP32C5] IDF-8638

View File

@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |

View File

@ -19,7 +19,7 @@ def run_multiple_stages(dut: Dut, test_case_num: int, stages: int) -> None:
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2', 'esp32p4'], reason='c6/h2/p4 support TBD') # TODO: IDF-8959
@pytest.mark.temp_skip_ci(targets=['esp32c6', 'esp32h2'], reason='c6/h2 support TBD')
@pytest.mark.generic
def test_app_update(dut: Dut) -> None:
extra_data = dut.parse_test_menu()

View File

@ -127,9 +127,15 @@ menu "Bootloader config"
help
This is a helper config for 32bits address flash. Invisible for users.
config BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH
bool
default y if BOOTLOADER_FLASH_NEEDS_32BIT_FEAT && SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP
help
This is a helper config for 32bits address quad flash. Invisible for users.
config BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
bool "Enable cache access to 32-bit-address (over 16MB) range of SPI Flash (READ DOCS FIRST)"
depends on BOOTLOADER_FLASH_NEEDS_32BIT_FEAT && IDF_TARGET_ESP32S3 && IDF_EXPERIMENTAL_FEATURES
depends on BOOTLOADER_FLASH_NEEDS_32BIT_ADDR_QUAD_FLASH && IDF_EXPERIMENTAL_FEATURES
default n
help
Enabling this option allows the CPU to access 32-bit-address flash beyond 16M range.

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -119,6 +119,7 @@ SECTIONS
.dram0.data : ALIGN(0x10)
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -144,6 +145,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -208,12 +210,55 @@ SECTIONS
*/
.xt.prop 0 :
{
KEEP (*(.xt.prop .gnu.linkonce.prop.*))
KEEP (*(.xt.prop .xt.prop.* .gnu.linkonce.prop.*))
}
.xt.lit 0 :
{
KEEP (*(.xt.lit .gnu.linkonce.p.*))
KEEP (*(.xt.lit .xt.lit.* .gnu.linkonce.p.*))
}
.xtensa.info 0: { *(.xtensa.info) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -140,6 +140,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -165,6 +166,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -218,6 +220,57 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}
/**

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -140,6 +140,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -165,6 +166,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -218,6 +220,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}

View File

@ -139,6 +139,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -164,6 +165,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -217,6 +219,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}

View File

@ -138,6 +138,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -163,6 +164,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -216,6 +218,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -138,6 +138,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -163,6 +164,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -216,6 +218,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}

View File

@ -138,6 +138,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -163,6 +164,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -216,6 +218,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -138,7 +138,7 @@ SECTIONS
.dram0.data :
{
_data_start = ABSOLUTE(.);
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -164,6 +164,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -217,6 +218,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}
/**

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -131,9 +131,15 @@ SECTIONS
_bss_end = ABSOLUTE(.);
} > dram_seg
.dram0.data :
.dram0.bootdesc : ALIGN(0x10)
{
_data_start = ABSOLUTE(.);
*(.data_bootloader_desc .data_bootloader_desc.*) /* Should be the first. Bootloader version info. DO NOT PUT ANYTHING BEFORE IT! */
} > dram_seg
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -159,6 +165,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -212,6 +219,58 @@ SECTIONS
_etext = .;
} > iram_seg
.riscv.attributes 0: { *(.riscv.attributes) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
/**
* Discarding .rela.* sections results in the following mapping:
* .rela.text.* -> .text.*
* .rela.data.* -> .data.*
* And so forth...
*/
/DISCARD/ : { *(.rela.*) }
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -108,6 +108,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -133,6 +134,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -205,4 +207,48 @@ SECTIONS
KEEP (*(.xt.lit .gnu.linkonce.p.*))
}
.xtensa.info 0: { *(.xtensa.info) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -142,6 +142,7 @@ SECTIONS
.dram0.data :
{
*(.dram1 .dram1.*) /* catch stray DRAM_ATTR */
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
@ -167,6 +168,7 @@ SECTIONS
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame_hdr)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
@ -239,6 +241,50 @@ SECTIONS
KEEP (*(.xt.lit .gnu.linkonce.p.*))
}
.xtensa.info 0: { *(.xtensa.info) }
/* DWARF 1 */
.debug 0 : { *(.debug) }
.line 0 : { *(.line) }
/* GNU DWARF 1 extensions */
.debug_srcinfo 0 : { *(.debug_srcinfo) }
.debug_sfnames 0 : { *(.debug_sfnames) }
/* DWARF 1.1 and DWARF 2 */
.debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */
.debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) }
.debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) }
.debug_pubtypes 0 : { *(.debug_pubtypes) }
/* DWARF 3 */
.debug_ranges 0 : { *(.debug_ranges) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* GNU DWARF 2 extensions */
.debug_gnu_pubnames 0 : { *(.debug_gnu_pubnames) }
.debug_gnu_pubtypes 0 : { *(.debug_gnu_pubtypes) }
/* DWARF 4 */
.debug_types 0 : { *(.debug_types) }
/* DWARF 5 */
.debug_addr 0 : { *(.debug_addr) }
.debug_line_str 0 : { *(.debug_line_str) }
.debug_loclists 0 : { *(.debug_loclists) }
.debug_macro 0 : { *(.debug_macro) }
.debug_names 0 : { *(.debug_names) }
.debug_rnglists 0 : { *(.debug_rnglists) }
.debug_str_offsets 0 : { *(.debug_str_offsets) }
.comment 0 : { *(.comment) }
.note.GNU-stack 0: { *(.note.GNU-stack) }
}
/**

View File

@ -13,6 +13,9 @@
#include "hal/efuse_ll.h"
#include "hal/efuse_hal.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
#include "hal/spi_flash_ll.h"
#include "rom/spi_flash.h"
#if CONFIG_IDF_TARGET_ESP32
@ -133,6 +136,8 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
#if CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/opi_flash.h"
#elif CONFIG_IDF_TARGET_ESP32P4
#include "esp32p4/rom/opi_flash.h"
#endif
static const char *TAG = "bootloader_flash";
@ -692,7 +697,7 @@ void bootloader_spi_flash_reset(void)
******************************************************************************/
#define XMC_SUPPORT CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT
#define XMC_VENDOR_ID 0x20
#define XMC_VENDOR_ID_1 0x20
#if BOOTLOADER_BUILD
#define BOOTLOADER_FLASH_LOG(level, ...) ESP_EARLY_LOG##level(TAG, ##__VA_ARGS__)
@ -709,7 +714,7 @@ static IRAM_ATTR bool is_xmc_chip_strict(uint32_t rdid)
uint32_t mfid = BYTESHIFT(rdid, 1);
uint32_t cpid = BYTESHIFT(rdid, 0);
if (vendor_id != XMC_VENDOR_ID) {
if (vendor_id != XMC_VENDOR_ID_1) {
return false;
}
@ -742,7 +747,7 @@ esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
// Check the Manufacturer ID in SFDP registers (JEDEC standard). If not XMC chip, no need to run the flow
const int sfdp_mfid_addr = 0x10;
uint8_t mf_id = (bootloader_flash_read_sfdp(sfdp_mfid_addr, 1) & 0xff);
if (mf_id != XMC_VENDOR_ID) {
if (mf_id != XMC_VENDOR_ID_1) {
BOOTLOADER_FLASH_LOG(D, "non-XMC chip detected by SFDP Read (%02X), skip.", mf_id);
return ESP_OK;
}
@ -774,7 +779,7 @@ esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
static IRAM_ATTR bool is_xmc_chip(uint32_t rdid)
{
uint32_t vendor_id = (rdid >> 16) & 0xFF;
return (vendor_id == XMC_VENDOR_ID);
return (vendor_id == XMC_VENDOR_ID_1);
}
esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)

View File

@ -22,7 +22,7 @@
#include "hal/cache_hal.h"
#include "hal/cache_ll.h"
void bootloader_flash_update_id()
void IRAM_ATTR bootloader_flash_update_id()
{
esp_rom_spiflash_chip_t *chip = &rom_spiflash_legacy_data->chip;
chip->device_id = bootloader_read_flash_id();
@ -99,6 +99,15 @@ static void update_flash_config(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
size = 16;
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
size = 32;
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
size = 64;
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
size = 128;
break;
default:
size = 2;
}
@ -175,6 +184,15 @@ static void print_flash_info(const esp_image_header_t *bootloader_hdr)
case ESP_IMAGE_FLASH_SIZE_16MB:
str = "16MB";
break;
case ESP_IMAGE_FLASH_SIZE_32MB:
str = "32MB";
break;
case ESP_IMAGE_FLASH_SIZE_64MB:
str = "64MB";
break;
case ESP_IMAGE_FLASH_SIZE_128MB:
str = "128MB";
break;
default:
str = "2MB";
break;
@ -203,6 +221,9 @@ esp_err_t bootloader_init_spi_flash(void)
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
bootloader_enable_qio_mode();
#endif
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
#endif
print_flash_info(&bootloader_image_hdr);
@ -271,6 +292,10 @@ void bootloader_flash_hardware_init(void)
bootloader_spi_flash_resume();
bootloader_flash_unlock();
#if CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH
bootloader_flash_32bits_address_map_enable(bootloader_flash_get_spi_mode());
#endif
cache_hal_disable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);
update_flash_config(&hdr);
cache_hal_enable(CACHE_LL_LEVEL_EXT_MEM, CACHE_TYPE_ALL);

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -181,6 +181,20 @@ uint32_t bootloader_common_get_chip_ver_pkg(void);
*/
esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type);
#if !CONFIG_IDF_TARGET_ESP32
/**
* @brief Check the eFuse block revision
*
* @param[in] min_rev_full The required minimum revision of the eFuse block
* @param[in] max_rev_full The required maximum revision of the eFuse block
* @return
* - ESP_OK: The eFuse block revision is in the required range.
* - ESP_OK: DISABLE_BLK_VERSION_MAJOR has been set in the eFuse of the SoC. No requirements shall be checked at this time.
* - ESP_FAIL: The eFuse block revision of this chip does not match the requirement of the current image.
*/
esp_err_t bootloader_common_check_efuse_blk_validity(uint32_t min_rev_full, uint32_t max_rev_full);
#endif // !CONFIG_IDF_TARGET_ESP32
/**
* @brief Configure VDDSDIO, call this API to rise VDDSDIO to 1.9V when VDDSDIO regulator is enabled as 1.8V mode.
*/

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2010-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2010-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -10,6 +10,7 @@
#include <stdbool.h>
#include "soc/soc.h"
#include "soc/ext_mem_defs.h"
#include "soc/soc_caps.h"
#include "sdkconfig.h"
#include "esp_attr.h"
@ -179,6 +180,31 @@ inline static bool esp_ptr_in_tcm(const void *p) {
#endif //#if SOC_MEM_TCM_SUPPORTED
/** End of the common section that has to be in sync with esp_memory_utils.h **/
/**
* @brief Check if the pointer is in PSRAM vaddr space
*
* @note This function is only used when in bootloader, where the PSRAM isn't initialised.
* This function simply check if the pointer is the in the PSRAM vaddr space.
* The PSRAM vaddr space is not always the same as the actual PSRAM vaddr range used in APP
*
* @param p pointer
*
* @return true: is in PSRAM; false: not in PSRAM
*/
__attribute__((always_inline))
inline static bool esp_ptr_in_extram(const void *p) {
bool valid = false;
#if SOC_IRAM_PSRAM_ADDRESS_LOW
valid |= ((intptr_t)p >= SOC_IRAM_PSRAM_ADDRESS_LOW && (intptr_t)p < SOC_IRAM_PSRAM_ADDRESS_HIGH);
#endif
#if SOC_DRAM_PSRAM_ADDRESS_LOW
valid |= ((intptr_t)p >= SOC_DRAM_PSRAM_ADDRESS_LOW && (intptr_t)p < SOC_DRAM_PSRAM_ADDRESS_HIGH);
#endif
return valid;
}
/** Don't add new functions below **/
#ifdef __cplusplus

View File

@ -9,9 +9,6 @@
#include "esp_attr.h"
#include "esp_err.h"
#include "soc/soc_caps.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
#include "hal/efuse_ll.h"
#include "sdkconfig.h"

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -37,8 +37,8 @@ esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio(uint32_t num_pin, ui
esp_comm_gpio_hold_t bootloader_common_check_long_hold_gpio_level(uint32_t num_pin, uint32_t delay_sec, bool level)
{
esp_rom_gpio_pad_select_gpio(num_pin);
if (GPIO_PIN_MUX_REG[num_pin]) {
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[num_pin]);
if (((1ULL << num_pin) & SOC_GPIO_VALID_GPIO_MASK) != 0) {
gpio_ll_input_enable(&GPIO, num_pin);
}
esp_rom_gpio_pad_pullup_only(num_pin);
uint32_t tm_start = esp_log_early_timestamp();

View File

@ -27,7 +27,7 @@
#include "esp_rom_caps.h"
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
#define IS_MAX_REV_SET(max_chip_rev_full) (((max_chip_rev_full) != 65535) && ((max_chip_rev_full) != 0))
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
static const char* TAG = "boot_comm";
@ -57,6 +57,31 @@ int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata)
return bootloader_common_select_otadata(two_otadata, valid_two_otadata, true);
}
#if !CONFIG_IDF_TARGET_ESP32
esp_err_t bootloader_common_check_efuse_blk_validity(uint32_t min_rev_full, uint32_t max_rev_full)
{
esp_err_t err = ESP_OK;
#ifndef CONFIG_IDF_ENV_FPGA
// Check whether the efuse block version satisfy the requirements of current image.
uint32_t revision = efuse_hal_blk_version();
uint32_t major_rev = revision / 100;
uint32_t minor_rev = revision % 100;
if (IS_FIELD_SET(min_rev_full) && !ESP_EFUSE_BLK_REV_ABOVE(revision, min_rev_full)) {
ESP_LOGE(TAG, "Image requires efuse blk rev >= v%"PRIu32".%"PRIu32", but chip is v%"PRIu32".%"PRIu32,
min_rev_full / 100, min_rev_full % 100, major_rev, minor_rev);
err = ESP_FAIL;
}
// If burnt `disable_blk_version_major` bit, skip the max version check
if ((IS_FIELD_SET(max_rev_full) && (revision > max_rev_full) && !efuse_hal_get_disable_blk_version_major())) {
ESP_LOGE(TAG, "Image requires efuse blk rev <= v%"PRIu32".%"PRIu32", but chip is v%"PRIu32".%"PRIu32,
max_rev_full / 100, max_rev_full % 100, major_rev, minor_rev);
err = ESP_FAIL;
}
#endif
return err;
}
#endif // !CONFIG_IDF_TARGET_ESP32
esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type)
{
esp_err_t err = ESP_OK;
@ -80,7 +105,7 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd
}
if (type == ESP_IMAGE_APPLICATION) {
unsigned max_rev = img_hdr->max_chip_rev_full;
if ((IS_MAX_REV_SET(max_rev) && (revision > max_rev) && !efuse_hal_get_disable_wafer_version_major())) {
if ((IS_FIELD_SET(max_rev) && (revision > max_rev) && !efuse_hal_get_disable_wafer_version_major())) {
ESP_LOGE(TAG, "Image requires chip rev <= v%d.%d, but chip is v%d.%d",
max_rev / 100, max_rev % 100,
major_rev, minor_rev);

View File

@ -13,7 +13,7 @@
#include "soc/gpio_periph.h"
#include "soc/gpio_sig_map.h"
#include "soc/rtc.h"
#include "hal/gpio_hal.h"
#include "hal/gpio_ll.h"
#if CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/usb/cdc_acm.h"
#include "esp32s2/rom/usb/usb_common.h"
@ -63,17 +63,17 @@ void bootloader_console_init(void)
uart_tx_gpio != UART_NUM_0_TXD_DIRECT_GPIO_NUM ||
uart_rx_gpio != UART_NUM_0_RXD_DIRECT_GPIO_NUM) {
// Change default UART pins back to GPIOs
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[UART_NUM_0_RXD_DIRECT_GPIO_NUM], PIN_FUNC_GPIO);
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[UART_NUM_0_TXD_DIRECT_GPIO_NUM], PIN_FUNC_GPIO);
gpio_ll_func_sel(&GPIO, UART_NUM_0_RXD_DIRECT_GPIO_NUM, PIN_FUNC_GPIO);
gpio_ll_func_sel(&GPIO, UART_NUM_0_TXD_DIRECT_GPIO_NUM, PIN_FUNC_GPIO);
// Route GPIO signals to/from pins
const uint32_t tx_idx = UART_PERIPH_SIGNAL(uart_num, SOC_UART_TX_PIN_IDX);
const uint32_t rx_idx = UART_PERIPH_SIGNAL(uart_num, SOC_UART_RX_PIN_IDX);
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[uart_rx_gpio], PIN_FUNC_GPIO);
PIN_INPUT_ENABLE(GPIO_PIN_MUX_REG[uart_rx_gpio]);
gpio_ll_func_sel(&GPIO, uart_rx_gpio, PIN_FUNC_GPIO);
gpio_ll_input_enable(&GPIO, uart_rx_gpio);
esp_rom_gpio_pad_pullup_only(uart_rx_gpio);
esp_rom_gpio_connect_out_signal(uart_tx_gpio, tx_idx, 0, 0);
esp_rom_gpio_connect_in_signal(uart_rx_gpio, rx_idx, 0);
gpio_hal_iomux_func_sel(GPIO_PIN_MUX_REG[uart_tx_gpio], PIN_FUNC_GPIO);
gpio_ll_func_sel(&GPIO, uart_tx_gpio, PIN_FUNC_GPIO);
// Enable the peripheral
uart_ll_enable_bus_clock(uart_num, true);
uart_ll_reset_register(uart_num);

View File

@ -14,7 +14,6 @@
#include "bootloader_random.h"
#include "bootloader_clock.h"
#include "bootloader_common.h"
#include "esp_flash_encrypt.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
#include "hal/wdt_hal.h"
@ -44,10 +43,17 @@ esp_err_t bootloader_read_bootloader_header(void)
esp_err_t bootloader_check_bootloader_validity(void)
{
unsigned int revision = efuse_hal_chip_revision();
unsigned int major = revision / 100;
unsigned int minor = revision % 100;
ESP_EARLY_LOGI(TAG, "chip revision: v%d.%d", major, minor);
unsigned int chip_revision = efuse_hal_chip_revision();
unsigned int chip_major_rev = chip_revision / 100;
unsigned int chip_minor_rev = chip_revision % 100;
ESP_EARLY_LOGI(TAG, "chip revision: v%d.%d", chip_major_rev, chip_minor_rev);
/* ESP32 doesn't have more memory and more efuse bits for block major version. */
#if !CONFIG_IDF_TARGET_ESP32
unsigned int efuse_revision = efuse_hal_blk_version();
unsigned int efuse_major_rev = efuse_revision / 100;
unsigned int efuse_minor_rev = efuse_revision % 100;
ESP_EARLY_LOGI(TAG, "efuse block revision: v%d.%d", efuse_major_rev, efuse_minor_rev);
#endif // !CONFIG_IDF_TARGET_ESP32
/* compare with the one set in bootloader image header */
if (bootloader_common_check_chip_validity(&bootloader_image_hdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
return ESP_FAIL;

View File

@ -16,7 +16,7 @@
#include "hal/apm_hal.h"
#endif
#if CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION // TODO: IDF-8615 Remove the workaround when APM supported on C5!
#if CONFIG_IDF_TARGET_ESP32C5 // TODO: IDF-8615 Remove the workaround when APM supported on C5!
#include "soc/hp_apm_reg.h"
#include "soc/lp_apm_reg.h"
#include "soc/lp_apm0_reg.h"
@ -33,10 +33,12 @@ void bootloader_init_mem(void)
* So, at boot disabling these filters. They will enable as per the
* use case by TEE initialization code.
*/
#ifdef SOC_APM_CTRL_FILTER_SUPPORTED
apm_hal_apm_ctrl_filter_enable_all(false);
#endif
#endif
#if CONFIG_IDF_TARGET_ESP32C5_BETA3_VERSION // TODO: IDF-8615 Remove the workaround when APM supported on C5!
#if CONFIG_IDF_TARGET_ESP32C5 // TODO: IDF-8615 Remove the workaround when APM supported on C5!
// disable apm filter
REG_WRITE(LP_APM_FUNC_CTRL_REG, 0);
REG_WRITE(LP_APM0_FUNC_CTRL_REG, 0);

View File

@ -53,7 +53,7 @@ void bootloader_random_enable(void)
// create patterns and set them in pattern table
uint32_t pattern_one = (SAR2_CHANNEL << 2) | SAR2_ATTEN; // we want channel 9 with max attenuation
uint32_t pattern_two = SAR1_ATTEN; // we want channel 0 with max attenuation, channel doesn't really matter here
uint32_t pattern_two = (SAR2_CHANNEL << 2) | SAR1_ATTEN; // we want channel 9 with max attenuation
uint32_t pattern_table = 0 | (pattern_two << 3 * PATTERN_BIT_WIDTH) | pattern_one << 2 * PATTERN_BIT_WIDTH;
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, pattern_table);
@ -88,9 +88,6 @@ void bootloader_random_disable(void)
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 0);
// Revert PMU_RF_PWC_REG to it's initial value
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
// disable ADC_CTRL_CLK (SAR ADC function clock)
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);

View File

@ -9,7 +9,7 @@
#include "soc/pmu_reg.h"
#include "soc/regi2c_saradc.h"
#include "soc/hp_sys_clkrst_reg.h"
#include "soc/rtcadc_reg.h"
#include "soc/lp_adc_reg.h"
#include "esp_private/regi2c_ctrl.h"
#include "esp_rom_regi2c.h"

View File

@ -25,6 +25,7 @@
#include "soc/rtc_periph.h"
#include "soc/timer_periph.h"
#include "hal/mmu_hal.h"
#include "hal/mmu_ll.h"
#include "hal/cache_types.h"
#include "hal/cache_ll.h"
#include "hal/cache_hal.h"
@ -34,6 +35,9 @@
#include "esp_app_desc.h"
#include "esp_secure_boot.h"
#include "esp_flash_encrypt.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
#include "esp_flash_partitions.h"
#include "bootloader_flash_priv.h"
#include "bootloader_random.h"
@ -43,6 +47,7 @@
#include "bootloader_sha.h"
#include "bootloader_console.h"
#include "bootloader_soc.h"
#include "bootloader_memory_utils.h"
#include "esp_efuse.h"
#include "esp_fault.h"
@ -715,10 +720,20 @@ static void unpack_load_app(const esp_image_metadata_t *data)
// Find DROM & IROM addresses, to configure MMU mappings
for (int i = 0; i < data->image.segment_count; i++) {
const esp_image_segment_header_t *header = &data->segments[i];
bool text_or_rodata = false;
//`SOC_DROM_LOW` and `SOC_DROM_HIGH` are the same as `SOC_IROM_LOW` and `SOC_IROM_HIGH`, reasons are in above `note`
if (header->load_addr >= SOC_DROM_LOW && header->load_addr < SOC_DROM_HIGH) {
text_or_rodata = true;
}
#if SOC_MMU_PER_EXT_MEM_TARGET
if (header->load_addr >= SOC_EXTRAM_LOW && header->load_addr < SOC_EXTRAM_HIGH) {
text_or_rodata = true;
}
#endif
if (text_or_rodata) {
/**
* D/I are shared, but there should not be a third segment on flash
* D/I are shared, but there should not be a third segment on flash/psram
*/
assert(rom_index < 2);
rom_addr[rom_index] = data->segment_data[i];
@ -785,6 +800,20 @@ static void unpack_load_app(const esp_image_metadata_t *data)
}
#endif //#if SOC_MMU_DI_VADDR_SHARED
//unused for esp32
__attribute__((unused))
static bool s_flash_seg_needs_map(uint32_t vaddr)
{
#if SOC_MMU_PER_EXT_MEM_TARGET
//For these chips, segments on PSRAM will be mapped in app
bool is_psram = esp_ptr_in_extram((void *)vaddr);
return !is_psram;
#else
//For these chips, segments on Flash always need to be mapped
return true;
#endif
}
static void set_cache_and_start_app(
uint32_t drom_addr,
uint32_t drom_load_addr,
@ -822,8 +851,13 @@ static void set_cache_and_start_app(
ESP_EARLY_LOGV(TAG, "after mapping rodata, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", drom_addr_aligned, drom_load_addr_aligned, drom_page_count * SPI_FLASH_MMU_PAGE_SIZE);
#else
uint32_t actual_mapped_len = 0;
mmu_hal_map_region(0, MMU_TARGET_FLASH0, drom_load_addr_aligned, drom_addr_aligned, drom_size, &actual_mapped_len);
ESP_EARLY_LOGV(TAG, "after mapping rodata, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", drom_addr_aligned, drom_load_addr_aligned, actual_mapped_len);
if (s_flash_seg_needs_map(drom_load_addr_aligned)) {
mmu_hal_map_region(0, MMU_TARGET_FLASH0, drom_load_addr_aligned, drom_addr_aligned, drom_size, &actual_mapped_len);
ESP_EARLY_LOGV(TAG, "after mapping rodata, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", drom_addr_aligned, drom_load_addr_aligned, actual_mapped_len);
}
//we use the MMU_LL_END_DROM_ENTRY_ID mmu entry as a map page for app to find the boot partition
mmu_hal_map_region(0, MMU_TARGET_FLASH0, MMU_LL_END_DROM_ENTRY_VADDR, drom_addr_aligned, CONFIG_MMU_PAGE_SIZE, &actual_mapped_len);
ESP_EARLY_LOGV(TAG, "mapped one page of the rodata, from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", drom_addr_aligned, drom_load_addr_aligned, actual_mapped_len);
#endif
//-----------------------MAP IROM--------------------------
@ -840,8 +874,10 @@ static void set_cache_and_start_app(
ESP_LOGV(TAG, "rc=%d", rc);
ESP_EARLY_LOGV(TAG, "after mapping text, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", irom_addr_aligned, irom_load_addr_aligned, irom_page_count * SPI_FLASH_MMU_PAGE_SIZE);
#else
mmu_hal_map_region(0, MMU_TARGET_FLASH0, irom_load_addr_aligned, irom_addr_aligned, irom_size, &actual_mapped_len);
ESP_EARLY_LOGV(TAG, "after mapping text, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", irom_addr_aligned, irom_load_addr_aligned, actual_mapped_len);
if (s_flash_seg_needs_map(irom_load_addr_aligned)) {
mmu_hal_map_region(0, MMU_TARGET_FLASH0, irom_load_addr_aligned, irom_addr_aligned, irom_size, &actual_mapped_len);
ESP_EARLY_LOGV(TAG, "after mapping text, starting from paddr=0x%08" PRIx32 " and vaddr=0x%08" PRIx32 ", 0x%" PRIx32 " bytes are mapped", irom_addr_aligned, irom_load_addr_aligned, actual_mapped_len);
}
#endif
//----------------------Enable corresponding buses----------------

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -29,6 +29,7 @@
#include "bootloader_flash_config.h"
#include "bootloader_mem.h"
#include "esp_private/regi2c_ctrl.h"
#include "soc/chip_revision.h"
#include "soc/regi2c_lp_bias.h"
#include "soc/regi2c_bias.h"
#include "bootloader_console.h"
@ -40,11 +41,13 @@
#include "hal/cache_hal.h"
#include "hal/clk_tree_ll.h"
#include "hal/lpwdt_ll.h"
#include "hal/spimem_flash_ll.h"
#include "soc/lp_wdt_reg.h"
#include "hal/efuse_hal.h"
#include "soc/regi2c_syspll.h"
#include "soc/regi2c_cpll.h"
#include "soc/regi2c_bias.h"
#include "esp_private/periph_ctrl.h"
static const char *TAG = "boot.esp32p4";
@ -89,17 +92,24 @@ static void bootloader_super_wdt_auto_feed(void)
static inline void bootloader_hardware_init(void)
{
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
// regi2c is enabled by default on ESP32P4, do nothing
// On ESP32P4 ECO0, the default (power on reset) CPLL and SPLL frequencies are very high, lower them to avoid bias may not be enough in bootloader
// And we are fixing SPLL to be 480MHz at all runtime
// Suppose to fix the issue on ECO1, will check when chip comes back
// TODO: IDF-8939
REGI2C_WRITE_MASK(I2C_CPLL, I2C_CPLL_OC_DIV_7_0, 6); // lower default cpu_pll freq to 400M
REGI2C_WRITE_MASK(I2C_SYSPLL, I2C_SYSPLL_OC_DIV_7_0, 8); // lower default sys_pll freq to 480M
esp_rom_delay_us(100);
unsigned chip_version = efuse_hal_chip_revision();
if (!ESP_CHIP_REV_ABOVE(chip_version, 1)) {
// On ESP32P4 ECO0, the default (power on reset) CPLL and SPLL frequencies are very high, lower them to avoid bias may not be enough in bootloader
// And we are fixing SPLL to be 480MHz after app is up
REGI2C_WRITE_MASK(I2C_CPLL, I2C_CPLL_OC_DIV_7_0, 6); // lower default cpu_pll freq to 400M
REGI2C_WRITE_MASK(I2C_SYSPLL, I2C_SYSPLL_OC_DIV_7_0, 8); // lower default sys_pll freq to 480M
esp_rom_delay_us(100);
}
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1, 10);
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 10);
// IDF-10019 TODO: This is temporarily for ESP32P4-ECO0, please remove it when eco0 is not widly used.
if (likely(ESP_CHIP_REV_ABOVE(chip_version, 1))) {
spimem_flash_ll_select_clk_source(0, FLASH_CLK_SRC_SPLL);
spimem_ctrlr_ll_set_core_clock(0, 6);
}
}
static inline void bootloader_ana_reset_config(void)
@ -170,7 +180,7 @@ esp_err_t bootloader_init(void)
}
#endif // !CONFIG_APP_BUILD_TYPE_RAM
// check whether a WDT reset happend
// check whether a WDT reset happened
bootloader_check_wdt_reset();
// config WDT
bootloader_config_wdt();

View File

@ -1,9 +1,12 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "soc/lp_analog_peri_reg.h"
#include "soc/soc.h"
#include "hal/brownout_ll.h"
void bootloader_ana_super_wdt_reset_config(bool enable)
{
@ -12,7 +15,9 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
void bootloader_ana_bod_reset_config(bool enable)
{
//TODO: IDF-7514
REG_CLR_BIT(LP_ANALOG_PERI_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
brownout_ll_ana_reset_enable(enable);
}
void bootloader_ana_clock_glitch_reset_config(bool enable)

View File

@ -691,19 +691,28 @@ static esp_err_t process_segment_data(int segment, intptr_t load_addr, uint32_t
const uint32_t *src = data;
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
// Case I: Bootloader verifying application
// Case II: Bootloader verifying bootloader
// Anti-rollback check should handle only Case I from above.
// The esp_app_desc_t structure is located in DROM and is always in segment #0.
// Anti-rollback check and efuse block version check should handle only Case I from above.
if (segment == 0 && metadata->start_addr != ESP_BOOTLOADER_OFFSET) {
/* ESP32 doesn't have more memory and more efuse bits for block major version. */
#if !CONFIG_IDF_TARGET_ESP32
const esp_app_desc_t *app_desc = (const esp_app_desc_t *)src;
esp_err_t ret = bootloader_common_check_efuse_blk_validity(app_desc->min_efuse_blk_rev_full, app_desc->max_efuse_blk_rev_full);
if (ret != ESP_OK) {
bootloader_munmap(data);
return ret;
}
#endif // !CONFIG_IDF_TARGET_ESP32
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
ESP_LOGD(TAG, "additional anti-rollback check 0x%"PRIx32, data_addr);
// The esp_app_desc_t structure is located in DROM and is always in segment #0.
size_t len = process_esp_app_desc_data(src, sha_handle, checksum, metadata);
data_len -= len;
src += len / 4;
// In BOOTLOADER_BUILD, for DROM (segment #0) we do not load it into dest (only map it), do_load = false.
}
#endif // CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
}
for (size_t i = 0; i < data_len; i += 4) {
int w_i = i / 4; // Word index
@ -771,8 +780,14 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
static bool should_map(uint32_t load_addr)
{
return (load_addr >= SOC_IROM_LOW && load_addr < SOC_IROM_HIGH)
|| (load_addr >= SOC_DROM_LOW && load_addr < SOC_DROM_HIGH);
bool is_irom = (load_addr >= SOC_IROM_LOW) && (load_addr < SOC_IROM_HIGH);
bool is_drom = (load_addr >= SOC_DROM_LOW) && (load_addr < SOC_DROM_HIGH);
bool is_psram = false;
#if SOC_MMU_PER_EXT_MEM_TARGET
is_psram = (load_addr >= SOC_EXTRAM_LOW) && (load_addr < SOC_EXTRAM_HIGH);
#endif
return (is_irom || is_drom || is_psram);
}
static bool should_load(uint32_t load_addr)
@ -857,7 +872,7 @@ static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint3
// Case I: Bootloader part
if (part_offset == ESP_BOOTLOADER_OFFSET) {
// For bootloader with secure boot v1, signature stays in an independant flash
// For bootloader with secure boot v1, signature stays in an independent flash
// sector (offset 0x0) and does not get appended to the image.
#if CONFIG_SECURE_BOOT_V2_ENABLED
// Sanity check - secure boot v2 signature block starts on 4K boundary

View File

@ -16,10 +16,15 @@
#include "esp_log.h"
#include "hal/wdt_hal.h"
#if SOC_KEY_MANAGER_SUPPORTED
#include "hal/key_mgr_hal.h"
#if SOC_KEY_MANAGER_FE_KEY_DEPLOY || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32C5
#include "soc/keymng_reg.h"
#endif
#include "soc/pcr_reg.h"
#else /* CONFIG_IDF_TARGET_ESP32C5 */
#include "hal/key_mgr_ll.h"
#include "hal/mspi_timing_tuning_ll.h"
#endif /* !CONFIG_IDF_TARGET_ESP32C5 */
#endif /* SOC_KEY_MANAGER_FE_KEY_DEPLOY */
#ifdef CONFIG_SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
#include "soc/sensitive_reg.h"
@ -216,11 +221,25 @@ static esp_err_t check_and_generate_encryption_keys(void)
ESP_LOGI(TAG, "Using pre-loaded flash encryption key in efuse");
}
#if SOC_KEY_MANAGER_SUPPORTED
#if SOC_KEY_MANAGER_FE_KEY_DEPLOY || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32C5
REG_SET_FIELD(KEYMNG_STATIC_REG, KEYMNG_USE_EFUSE_KEY, 2);
REG_SET_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
REG_CLR_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
#else /* CONFIG_IDF_TARGET_ESP32C5 */
// Enable and reset key manager
// To suppress build errors about spinlock's __DECLARE_RCC_ATOMIC_ENV
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
key_mgr_ll_enable_bus_clock(true);
key_mgr_ll_enable_peripheral_clock(true);
key_mgr_ll_reset_register();
while (key_mgr_ll_get_state() != ESP_KEY_MGR_STATE_IDLE) {
};
// Force Key Manager to use eFuse key for XTS-AES operation
key_mgr_hal_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
#endif
key_mgr_ll_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
_mspi_timing_ll_reset_mspi();
#endif /* !CONFIG_IDF_TARGET_ESP32C5 */
#endif /* SOC_KEY_MANAGER_FE_KEY_DEPLOY */
return ESP_OK;
}
@ -263,13 +282,6 @@ esp_err_t esp_flash_encrypt_contents(void)
esp_partition_info_t partition_table[ESP_PARTITION_TABLE_MAX_ENTRIES];
int num_partitions;
#if CONFIG_IDF_TARGET_ESP32C5 && SOC_KEY_MANAGER_SUPPORTED
// TODO: [ESP32C5] IDF-8622 find a more proper place for these codes
REG_SET_BIT(KEYMNG_STATIC_REG, KEYMNG_USE_EFUSE_KEY_FLASH);
REG_SET_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
REG_CLR_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
#endif
#ifdef CONFIG_SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
REG_WRITE(SENSITIVE_XTS_AES_KEY_UPDATE_REG, 1);
#endif
@ -421,7 +433,7 @@ static esp_err_t encrypt_partition(int index, const esp_partition_info_t *partit
&partition->pos,
&image_data);
should_encrypt = (err == ESP_OK);
#ifdef SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
#ifdef CONFIG_SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
if (should_encrypt) {
// Encrypt only the app image instead of encrypting the whole partition
size = image_data.image_len;

View File

@ -5,6 +5,6 @@ components/bootloader_support/test_apps/rtc_custom_section:
- if: SOC_RTC_MEM_SUPPORTED == 1
reason: this feature is supported on chips that have RTC memory
disable:
- if: IDF_TARGET == "esp32c61"
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
temporary: true
reason: IDF-9260
reason: target(s) is not supported yet # IDF-9260

View File

@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |

View File

@ -49,12 +49,20 @@ set(ble_mesh_include_dirs
"esp_ble_mesh/api/core/include"
"esp_ble_mesh/api/models/include"
"esp_ble_mesh/api"
)
set(ble_mesh_v11_include_dirs
"esp_ble_mesh/lib/include"
"esp_ble_mesh/v1.1/api/core/include"
"esp_ble_mesh/v1.1/api/models/include"
"esp_ble_mesh/v1.1/btc/include"
)
if(CONFIG_IDF_DOC_BUILD)
list(APPEND ble_mesh_include_dirs
${ble_mesh_v11_include_dirs})
endif()
set(bluedroid_include_dirs host/bluedroid/api/include/api)
if(CONFIG_BT_CONTROLLER_ENABLED OR CONFIG_IDF_DOC_BUILD)
@ -92,6 +100,9 @@ if(CONFIG_BT_ENABLED)
elseif(CONFIG_IDF_TARGET_ESP32C2)
list(APPEND srcs "controller/esp32c2/bt.c")
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
list(APPEND srcs "controller/esp32c2/dummy.c")
endif()
set(ldscripts "linker_esp32c2.lf")
elseif(CONFIG_IDF_TARGET_ESP32C6)
@ -117,6 +128,7 @@ if(CONFIG_BT_ENABLED)
common/btc/include
common/include
porting/mem/
porting/include
)
list(APPEND include_dirs ${common_include_dirs})
@ -539,65 +551,93 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/models/server/server_common.c"
"esp_ble_mesh/models/server/state_binding.c"
"esp_ble_mesh/models/server/state_transition.c"
"esp_ble_mesh/models/server/time_scene_server.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_agg_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_brc_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_cm_data_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_df_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_lcd_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_odp_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_prb_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_rpr_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_sar_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_srpl_model_api.c"
"esp_ble_mesh/v1.1/api/models/esp_ble_mesh_mbt_model_api.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_agg_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_brc_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_df_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_lcd_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_mbt_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_odp_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_prb_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_rpr_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_sar_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_srpl_model.c"
"esp_ble_mesh/lib/ext.c")
"esp_ble_mesh/models/server/time_scene_server.c")
if(CONFIG_BLE_MESH_V11_SUPPORT)
list(APPEND include_dirs ${ble_mesh_v11_include_dirs})
if(CONFIG_BLE_MESH_SAR_ENHANCEMENT)
list(APPEND srcs "esp_ble_mesh/core/transport.enh.c")
list(APPEND srcs
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_agg_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_brc_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_cm_data_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_df_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_lcd_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_odp_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_prb_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_rpr_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_sar_model_api.c"
"esp_ble_mesh/v1.1/api/core/esp_ble_mesh_srpl_model_api.c"
"esp_ble_mesh/v1.1/api/models/esp_ble_mesh_mbt_model_api.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_agg_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_brc_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_df_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_lcd_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_mbt_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_odp_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_prb_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_rpr_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_sar_model.c"
"esp_ble_mesh/v1.1/btc/btc_ble_mesh_srpl_model.c"
"esp_ble_mesh/lib/ext.c")
if(CONFIG_BLE_MESH_SAR_ENHANCEMENT)
list(APPEND srcs "esp_ble_mesh/core/transport.enh.c")
else()
list(APPEND srcs "esp_ble_mesh/core/transport.c")
endif()
else()
list(APPEND srcs "esp_ble_mesh/core/transport.c")
list(APPEND srcs
"esp_ble_mesh/core/transport.c")
endif()
endif()
if(CONFIG_BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT)
list(APPEND srcs
"porting/npl/freertos/src/npl_os_freertos.c"
"porting/mem/os_msys_init.c"
"porting/transport/src/hci_transport.c"
)
if(CONFIG_BT_CONTROLLER_DISABLED)
list(APPEND srcs
"porting/npl/freertos/src/npl_os_freertos.c"
"porting/nimble/src/os_msys_init.c"
"host/nimble/nimble/porting/nimble/src/hal_uart.c"
)
if(CONFIG_BT_CONTROLLER_DISABLED)
elseif(CONFIG_BT_LE_HCI_INTERFACE_USE_RAM)
if(CONFIG_BT_NIMBLE_ENABLED)
list(APPEND srcs
"host/nimble/nimble/porting/nimble/src/hal_uart.c"
)
endif()
list(APPEND include_dirs
porting/include
porting/nimble/include
porting/npl/freertos/include
porting/transport/include
)
if(CONFIG_BT_LE_HCI_INTERFACE_USE_UART)
"porting/transport/driver/vhci/hci_driver_nimble.c"
"host/nimble/nimble/nimble/transport/esp_ipc/src/hci_esp_ipc.c"
)
else()
list(APPEND srcs
"porting/transport/uart/hci_uart.c"
)
"porting/transport/driver/vhci/hci_driver_standard.c"
)
endif()
elseif(CONFIG_BT_LE_HCI_INTERFACE_USE_UART)
list(APPEND srcs
"porting/transport/driver/common/hci_driver_util.c"
"porting/transport/driver/common/hci_driver_h4.c"
"porting/transport/driver/common/hci_driver_mem.c"
"porting/transport/driver/uart/hci_driver_uart_config.c"
)
if(CONFIG_BT_LE_UART_HCI_DMA_MODE)
list(APPEND srcs
"porting/transport/driver/uart/hci_driver_uart_dma.c"
)
else()
list(APPEND srcs
"porting/transport/driver/uart/hci_driver_uart.c"
)
endif()
endif()
list(APPEND include_dirs
porting/include
porting/npl/freertos/include
porting/transport/include
)
endif()
if(NOT (CONFIG_BT_LE_CRYPTO_STACK_MBEDTLS OR CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS))
list(APPEND include_dirs
porting/ext/tinycrypt/include
@ -622,7 +662,6 @@ if(CONFIG_BT_ENABLED)
if(CONFIG_BT_NIMBLE_ENABLED)
list(APPEND include_dirs
host/nimble/nimble/nimble/host/include
host/nimble/nimble/nimble/include
host/nimble/nimble/nimble/host/services/ans/include
@ -640,6 +679,7 @@ if(CONFIG_BT_ENABLED)
host/nimble/nimble/nimble/host/services/tps/include
host/nimble/nimble/nimble/host/services/hid/include
host/nimble/nimble/nimble/host/services/sps/include
host/nimble/nimble/nimble/host/services/cte/include
host/nimble/nimble/nimble/host/util/include
host/nimble/nimble/nimble/host/store/ram/include
host/nimble/nimble/nimble/host/store/config/include
@ -662,6 +702,7 @@ if(CONFIG_BT_ENABLED)
"host/nimble/nimble/nimble/host/services/cts/src/ble_svc_cts.c"
"host/nimble/nimble/nimble/host/services/hid/src/ble_svc_hid.c"
"host/nimble/nimble/nimble/host/services/sps/src/ble_svc_sps.c"
"host/nimble/nimble/nimble/host/services/cte/src/ble_svc_cte.c"
"host/nimble/nimble/nimble/host/src/ble_hs_conn.c"
"host/nimble/nimble/nimble/host/src/ble_store_util.c"
"host/nimble/nimble/nimble/host/src/ble_sm.c"
@ -726,11 +767,12 @@ if(CONFIG_BT_ENABLED)
"host/nimble/nimble/porting/npl/freertos/src/nimble_port_freertos.c"
"host/nimble/port/src/nvs_port.c"
)
list(APPEND include_dirs
porting/include
host/nimble/nimble/porting/nimble/include
host/nimble/port/include
host/nimble/nimble/nimble/transport/include
host/nimble/nimble/nimble/include
)
if(CONFIG_BT_CONTROLLER_DISABLED)
@ -756,15 +798,15 @@ if(CONFIG_BT_ENABLED)
endif()
list(APPEND include_dirs
porting/include
host/nimble/nimble/porting/npl/freertos/include
host/nimble/nimble/porting/nimble/include
host/nimble/nimble/nimble/include
)
endif()
if(CONFIG_BT_NIMBLE_LEGACY_VHCI_ENABLE AND CONFIG_BT_CONTROLLER_ENABLED)
list(APPEND srcs
"host/nimble/esp-hci/src/esp_nimble_hci.c"
"host/nimble/nimble/nimble/transport/esp_ipc_legacy/src/hci_esp_ipc_legacy.c"
)
list(APPEND include_dirs ${nimble_hci_include_dirs})
endif()
@ -842,13 +884,29 @@ if(CONFIG_BT_ENABLED)
elseif(CONFIG_IDF_TARGET_ESP32C3)
target_link_directories(${COMPONENT_LIB} INTERFACE
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32c3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app_flash)
else()
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
endif()
elseif(CONFIG_IDF_TARGET_ESP32S3)
target_link_directories(${COMPONENT_LIB} INTERFACE
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app_flash)
else()
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
endif()
elseif(CONFIG_BT_CONTROLLER_ENABLED)
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a")
if(CONFIG_IDF_TARGET_ESP32C6)
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/esp32c6/libble_app.a")
else()
if(CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app_flash.a")
else()
add_prebuilt_library(libble_app "controller/lib_${target}/${target}-bt-lib/libble_app.a")
endif()
endif()
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
endif()
@ -862,7 +920,7 @@ if(CONFIG_BT_ENABLED)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
endif()
if(CONFIG_BLE_MESH)
if(CONFIG_BLE_MESH_V11_SUPPORT)
if(CONFIG_IDF_TARGET_ESP32)
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32/libble_mesh.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)

View File

@ -69,6 +69,12 @@
#include "btc_ble_mesh_prov.h"
#include "btc_ble_mesh_health_model.h"
#include "btc_ble_mesh_config_model.h"
#include "btc_ble_mesh_generic_model.h"
#include "btc_ble_mesh_lighting_model.h"
#include "btc_ble_mesh_sensor_model.h"
#include "btc_ble_mesh_time_scene_model.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "btc_ble_mesh_mbt_model.h"
#include "btc_ble_mesh_agg_model.h"
#include "btc_ble_mesh_brc_model.h"
#include "btc_ble_mesh_df_model.h"
@ -78,11 +84,7 @@
#include "btc_ble_mesh_rpr_model.h"
#include "btc_ble_mesh_sar_model.h"
#include "btc_ble_mesh_srpl_model.h"
#include "btc_ble_mesh_generic_model.h"
#include "btc_ble_mesh_lighting_model.h"
#include "btc_ble_mesh_sensor_model.h"
#include "btc_ble_mesh_time_scene_model.h"
#include "btc_ble_mesh_mbt_model.h"
#endif /* CONFIG_BLE_MESH_V11_SUPPORT */
#endif /* #if CONFIG_BLE_MESH */
#define BTC_TASK_PINNED_TO_CORE (TASK_PINNED_TO_CORE)
@ -295,8 +297,8 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
/**
* transfer an message to another module in the different task.
* @param msg message
* @param arg paramter
* @param arg_len length of paramter
* @param arg parameter
* @param arg_len length of parameter
* @param copy_func deep copy function
* @param free_func deep free function
* @return BT_STATUS_SUCCESS: success
@ -342,7 +344,7 @@ bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg
}
/**
* transfer an message to another module in tha same task.
* transfer an message to another module in the same task.
* @param msg message
* @return BT_STATUS_SUCCESS: success
* others: fail
@ -380,7 +382,7 @@ static void btc_deinit_mem(void) {
btc_profile_cb_tab = NULL;
}
#if (BLE_INCLUDED == TRUE)
#if (BLE_42_FEATURE_SUPPORT == TRUE)
if (gl_bta_adv_data_ptr) {
osi_free(gl_bta_adv_data_ptr);
gl_bta_adv_data_ptr = NULL;
@ -390,7 +392,7 @@ static void btc_deinit_mem(void) {
osi_free(gl_bta_scan_rsp_data_ptr);
gl_bta_scan_rsp_data_ptr = NULL;
}
#endif ///BLE_INCLUDED == TRUE
#endif // BLE_42_FEATURE_SUPPORT
#if GATTS_INCLUDED == TRUE && GATT_DYNAMIC_MEMORY == TRUE
if (btc_creat_tab_env_ptr) {
@ -442,7 +444,8 @@ static bt_status_t btc_init_mem(void) {
}
memset((void *)btc_profile_cb_tab, 0, sizeof(void *) * BTC_PID_NUM);
#if (BLE_INCLUDED == TRUE)
#if BTC_DYNAMIC_MEMORY == TRUE
#if (BLE_42_FEATURE_SUPPORT == TRUE)
if ((gl_bta_adv_data_ptr = (tBTA_BLE_ADV_DATA *)osi_malloc(sizeof(tBTA_BLE_ADV_DATA))) == NULL) {
goto error_exit;
}
@ -452,7 +455,8 @@ static bt_status_t btc_init_mem(void) {
goto error_exit;
}
memset((void *)gl_bta_scan_rsp_data_ptr, 0, sizeof(tBTA_BLE_ADV_DATA));
#endif ///BLE_INCLUDED == TRUE
#endif // (BLE_42_FEATURE_SUPPORT == TRUE)
#endif // BTC_DYNAMIC_MEMORY == TRUE
#if GATTS_INCLUDED == TRUE && GATT_DYNAMIC_MEMORY == TRUE
if ((btc_creat_tab_env_ptr = (esp_btc_creat_tab_t *)osi_malloc(sizeof(esp_btc_creat_tab_t))) == NULL) {

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -124,7 +124,31 @@ static size_t write_value(uint16_t conn_handle, uint16_t attr_handle,
}
}
btc_blufi_recv_handler(&ctxt->om->om_data[0], ctxt->om->om_len);
/* Data may come in linked om. So retrieve all data */
if (SLIST_NEXT(ctxt->om, om_next) != NULL) {
uint8_t *fw_buf = (uint8_t *)malloc(517 * sizeof(uint8_t));
memset(fw_buf, 0x0, 517);
memcpy(fw_buf, &ctxt->om->om_data[0], ctxt->om->om_len);
struct os_mbuf *last;
last = ctxt->om;
uint32_t offset = ctxt->om->om_len;
while (SLIST_NEXT(last, om_next) != NULL) {
struct os_mbuf *temp = SLIST_NEXT(last, om_next);
memcpy(fw_buf + offset , &temp->om_data[0], temp->om_len);
offset += temp->om_len;
last = SLIST_NEXT(last, om_next);
temp = NULL;
}
btc_blufi_recv_handler(fw_buf, offset);
free(fw_buf);
}
else {
btc_blufi_recv_handler(&ctxt->om->om_data[0], ctxt->om->om_len);
}
rc = ble_hs_mbuf_to_flat(ctxt->om, value->buf->om_data,
value->buf->om_len, &len);
if (rc != 0) {
@ -418,8 +442,10 @@ uint8_t esp_blufi_init(void)
void esp_blufi_deinit(void)
{
blufi_env.enabled = false;
btc_msg_t msg;
esp_blufi_cb_param_t param;
btc_msg_t msg;
memset (&msg, 0x0, sizeof (msg));
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;

View File

@ -31,8 +31,8 @@ static const char s_hex_to_char_mapping[16] = {
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};
bt_hci_log_t g_bt_hci_log_data_ctl = {0};
bt_hci_log_t g_bt_hci_log_adv_ctl = {0};
static bt_hci_log_t g_bt_hci_log_data_ctl = {0};
static bt_hci_log_t g_bt_hci_log_adv_ctl = {0};
esp_err_t bt_hci_log_init(void)
{
@ -98,35 +98,35 @@ static char IRAM_ATTR *bt_data_type_to_str(uint8_t data_type)
{
case HCI_LOG_DATA_TYPE_COMMAND:
// hci cmd data
tag = "CMD";
tag = "C";
break;
case HCI_LOG_DATA_TYPE_H2C_ACL:
// host to controller hci acl data
tag = "HAL";
tag = "H";
break;
case HCI_LOG_DATA_TYPE_SCO:
// hci sco data
tag = "SCO";
tag = "S";
break;
case HCI_LOG_DATA_TYPE_EVENT:
// hci event
tag = "EVT";
tag = "E";
break;
case HCI_LOG_DATA_TYPE_ADV:
// controller adv report data
tag = "ADV";
tag = NULL;
break;
case HCI_LOG_DATA_TYPE_C2H_ACL:
// controller to host hci acl data
tag = "CAL";
tag = "D";
break;
case HCI_LOG_DATA_TYPE_SELF_DEFINE:
// self-defining data
tag = "ST";
tag = "S";
break;
default:
// unknown data type
tag = "UK";
tag = "U";
break;
}
@ -305,19 +305,27 @@ void bt_hci_log_data_show(bt_hci_log_t *p_hci_log_ctl)
osi_mutex_unlock(&mutex_lock);
}
static bool enable_hci_log_flag = true;
void bt_hci_log_record_hci_enable(bool enable)
{
enable_hci_log_flag = enable;
}
esp_err_t IRAM_ATTR bt_hci_log_record_hci_data(uint8_t data_type, uint8_t *data, uint8_t data_len)
{
if (!enable_hci_log_flag) return ESP_OK;
return bt_hci_log_record_data(&g_bt_hci_log_data_ctl, NULL, data_type, data, data_len);
}
esp_err_t IRAM_ATTR bt_hci_log_record_custom_data(char *string, uint8_t *data, uint8_t data_len)
{
if (!enable_hci_log_flag) return ESP_OK;
return bt_hci_log_record_data(&g_bt_hci_log_data_ctl, string, HCI_LOG_DATA_TYPE_SELF_DEFINE, data, data_len);
}
esp_err_t IRAM_ATTR bt_hci_log_record_hci_adv(uint8_t data_type, uint8_t *data, uint8_t data_len)
{
if (!enable_hci_log_flag) return ESP_OK;
return bt_hci_log_record_data(&g_bt_hci_log_adv_ctl, NULL, data_type, data, data_len);
}

View File

@ -46,6 +46,7 @@
#define OSI_INITIAL_TRACE_LEVEL UC_BT_LOG_OSI_TRACE_LEVEL
#define BLUFI_INITIAL_TRACE_LEVEL UC_BT_LOG_BLUFI_TRACE_LEVEL
// MEMORY
#if UC_BT_BLE_DYNAMIC_ENV_MEMORY
#define BT_BLE_DYNAMIC_ENV_MEMORY TRUE
#define BTC_DYNAMIC_MEMORY TRUE
@ -64,6 +65,19 @@
#define BT_BLE_DYNAMIC_ENV_MEMORY FALSE
#endif
#if UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST
#define HEAP_ALLOCATION_FROM_SPIRAM_FIRST TRUE
#else
#define HEAP_ALLOCATION_FROM_SPIRAM_FIRST FALSE
#endif
#if UC_BT_ABORT_WHEN_ALLOCATION_FAILS
#define HEAP_ALLOCATION_FAILS_ABORT TRUE
#else
#define HEAP_ALLOCATION_FAILS_ABORT FALSE
#endif
// HCI LOG
#if UC_BT_HCI_LOG_DEBUG_EN
#define BT_HCI_LOG_INCLUDED UC_BT_HCI_LOG_DEBUG_EN
#else

View File

@ -100,13 +100,26 @@
#define UC_BT_BLUFI_ENABLE FALSE
#endif
//MEMORY DEBUG
//MEMORY
#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
#define UC_BT_BLUEDROID_MEM_DEBUG TRUE
#else
#define UC_BT_BLUEDROID_MEM_DEBUG FALSE
#endif
#ifdef CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
#define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
#else
#define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST FALSE
#endif
#ifdef CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS
#define UC_BT_ABORT_WHEN_ALLOCATION_FAILS CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS
#else
#define UC_BT_ABORT_WHEN_ALLOCATION_FAILS FALSE
#endif
//HCI LOG
#ifdef CONFIG_BT_HCI_LOG_DEBUG_EN
#define UC_BT_HCI_LOG_DEBUG_EN TRUE
#else

View File

@ -213,42 +213,30 @@ char *osi_strdup(const char *str)
void *osi_malloc_func(size_t size)
{
#if HEAP_MEMORY_DEBUG
void *p;
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
p = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
p = malloc(size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
osi_mem_dbg_record(p, size, __func__, __LINE__);
void *p = osi_malloc_base(size);
if (size != 0 && p == NULL) {
OSI_TRACE_ERROR("malloc failed (caller=%p size=%u)\n", __builtin_return_address(0), size);
#if HEAP_ALLOCATION_FAILS_ABORT
assert(0);
#endif
}
return p;
#else
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
return malloc(size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
#endif /* #if HEAP_MEMORY_DEBUG */
}
void *osi_calloc_func(size_t size)
{
#if HEAP_MEMORY_DEBUG
void *p;
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
p = heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
p = calloc(1, size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
osi_mem_dbg_record(p, size, __func__, __LINE__);
void *p = osi_calloc_base(size);
if (size != 0 && p == NULL) {
OSI_TRACE_ERROR("calloc failed (caller=%p size=%u)\n", __builtin_return_address(0), size);
#if HEAP_ALLOCATION_FAILS_ABORT
assert(0);
#endif
}
return p;
#else
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
return heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
return calloc(1, size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
#endif /* #if HEAP_MEMORY_DEBUG */
}
void osi_free_func(void *ptr)

View File

@ -29,6 +29,15 @@ void *osi_malloc_func(size_t size);
void *osi_calloc_func(size_t size);
void osi_free_func(void *ptr);
// Memory alloc function without print and assertion
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
#define osi_malloc_base(size) heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#define osi_calloc_base(size) heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#else
#define osi_malloc_base(size) malloc((size))
#define osi_calloc_base(size) calloc(1, (size))
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
#if HEAP_MEMORY_DEBUG
void osi_mem_dbg_init(void);
@ -41,13 +50,10 @@ void osi_men_dbg_set_section_start(uint8_t index);
void osi_men_dbg_set_section_end(uint8_t index);
uint32_t osi_mem_dbg_get_max_size_section(uint8_t index);
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
#define osi_malloc(size) \
({ \
void *p; \
p = heap_caps_malloc_prefer(size, 2, \
MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, \
MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
p = osi_malloc_base(size); \
osi_mem_dbg_record(p, size, __func__, __LINE__); \
(void *)p; \
})
@ -55,34 +61,11 @@ uint32_t osi_mem_dbg_get_max_size_section(uint8_t index);
#define osi_calloc(size) \
({ \
void *p; \
p = heap_caps_calloc_prefer(1, size, 2, \
MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, \
MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL); \
p = osi_calloc_base(size); \
osi_mem_dbg_record(p, size, __func__, __LINE__); \
(void *)p; \
})
#else
#define osi_malloc(size) \
({ \
void *p; \
p = malloc((size)); \
osi_mem_dbg_record(p, size, __func__, __LINE__); \
(void *)p; \
})
#define osi_calloc(size) \
({ \
void *p; \
p = calloc(1, (size)); \
osi_mem_dbg_record(p, size, __func__, __LINE__); \
(void *)p; \
})
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
#if 0
#define osi_malloc(size) \
do { \
@ -122,13 +105,9 @@ do { \
#else
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
#define osi_malloc(size) heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#define osi_calloc(size) heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#else
#define osi_malloc(size) malloc((size))
#define osi_calloc(size) calloc(1, (size))
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
// Memory alloc function with print and assertion when fails
#define osi_malloc(size) osi_malloc_func((size))
#define osi_calloc(size) osi_calloc_func((size))
#define osi_free(p) free((p))
#endif /* HEAP_MEMORY_DEBUG */

View File

@ -271,10 +271,10 @@ _err:
}
for (int i = 0; i < thread->work_queue_num; i++) {
if (thread->work_queues[i]) {
if (thread->work_queues && thread->work_queues[i]) {
osi_work_queue_delete(thread->work_queues[i]);
thread->work_queues[i] = NULL;
}
thread->work_queues[i] = NULL;
}
if (thread->work_queues) {

View File

@ -262,10 +262,10 @@ menu "MODEM SLEEP Options"
the bluetooth low power clock source.
config BTDM_CTRL_LPCLK_SEL_EXT_32K_XTAL
bool "External 32kHz crystal"
depends on RTC_CLK_SRC_EXT_CRYS
bool "External 32kHz crystal/oscillator"
depends on RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC
help
External 32kHz crystal has a nominal frequency of 32.768kHz and provides good frequency
External 32kHz crystal/oscillator has a nominal frequency of 32.768kHz and provides good frequency
stability. If used as Bluetooth low power clock, External 32kHz can support Bluetooth
modem sleep to be used with both DFS and light sleep.
endchoice
@ -406,6 +406,15 @@ config BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.
config BTDM_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
bool "Enable enhanced Access Address check in CONNECT_IND"
default n
help
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
If disabled, only basic checks are applied, improving compatibility.
config BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
depends on (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
@ -440,6 +449,23 @@ config BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD
If you set `BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more.
menu "BLE disconnect when instant passed"
config BTDM_BLE_LLCP_CONN_UPDATE
bool "BLE ACL connection update procedure"
depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM)
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed during connection update procedure.
config BTDM_BLE_LLCP_CHAN_MAP_UPDATE
bool "BLE ACL channel map update procedure"
depends on (BTDM_CTRL_MODE_BLE_ONLY || BTDM_CTRL_MODE_BTDM)
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed in channel map update procedure.
endmenu
config BTDM_RESERVE_DRAM
hex

View File

@ -96,6 +96,7 @@ do{\
#define OSI_VERSION 0x00010005
#define OSI_MAGIC_VALUE 0xFADEBEAD
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL)
/* Types definition
************************************************************************
*/
@ -868,7 +869,21 @@ static int IRAM_ATTR cause_sw_intr_to_core_wrapper(int core_id, int intr_no)
static void *malloc_internal_wrapper(size_t size)
{
return heap_caps_malloc(size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
return heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
}
void *malloc_ble_controller_mem(size_t size)
{
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
if(p == NULL) {
ESP_LOGE(BTDM_LOG_TAG, "Malloc failed");
}
return p;
}
uint32_t get_ble_controller_free_heap_size(void)
{
return heap_caps_get_free_size(BLE_CONTROLLER_MALLOC_CAPS);
}
static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
@ -1432,6 +1447,14 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
.name = "BT Controller Data"
};
/*
* Free data and BSS section for Bluetooth controller ROM code.
* Note that rom mem release must be performed before section _bt_data_start to _bt_data_end is released,
* otherwise `btdm_dram_available_region` will no longer be available when performing rom mem release and
* thus causing heap corruption.
*/
ret = esp_bt_controller_rom_mem_release(mode);
if (mode == ESP_BT_MODE_BTDM) {
/* Start by freeing Bluetooth BSS section */
if (ret == ESP_OK) {
@ -1444,11 +1467,6 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
}
}
/* free data and BSS section for Bluetooth controller ROM code */
if (ret == ESP_OK) {
ret = esp_bt_controller_rom_mem_release(mode);
}
return ret;
}
@ -1620,7 +1638,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
btdm_cfg_mask = btdm_config_mask_load();
if (btdm_controller_init(btdm_cfg_mask, cfg) != 0) {
err = btdm_controller_init(btdm_cfg_mask, cfg);
if (err != 0) {
ESP_LOGE(BTDM_LOG_TAG, "%s %d\n",__func__,err);
err = ESP_ERR_NO_MEM;
goto error;
}

View File

@ -2,15 +2,15 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "Select HCI interface"
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM
config BT_LE_HCI_INTERFACE_USE_RAM
bool "ram"
bool "VHCI"
help
Use RAM as HCI interface
config BT_LE_HCI_INTERFACE_USE_UART
bool "uart"
bool "UART(H4)"
help
Use UART as HCI interface
endchoice
@ -73,12 +73,26 @@ menu "HCI Config"
UART_PARITY_ODD
endchoice
config BT_LE_HCI_UART_TASK_STACK_SIZE
int "HCI uart task stack size"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 1000
config BT_LE_HCI_UART_RX_BUFFER_SIZE
int "The size of rx ring buffer memory"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 512
help
Set the size of uart task stack
The size of rx ring buffer memory
config BT_LE_HCI_UART_TX_BUFFER_SIZE
int "The size of tx ring buffer memory"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 256
help
The size of tx ring buffer memory
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
help
This configures stack size of hci transport task
endmenu
config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
@ -95,86 +109,100 @@ menuconfig BT_LE_50_FEATURE_SUPPORT
help
Enable BLE 5 feature
config BT_LE_LL_CFG_FEAT_LE_2M_PHY
bool "Enable 2M Phy"
depends on BT_LE_50_FEATURE_SUPPORT
default y
help
Enable 2M-PHY
config BT_LE_LL_CFG_FEAT_LE_CODED_PHY
bool "Enable coded Phy"
depends on BT_LE_50_FEATURE_SUPPORT
default y
help
Enable coded-PHY
config BT_LE_EXT_ADV
bool "Enable extended advertising"
depends on BT_LE_50_FEATURE_SUPPORT
default y
help
Enable this option to do extended advertising. Extended advertising
will be supported from BLE 5.0 onwards.
if BT_LE_EXT_ADV
config BT_LE_MAX_EXT_ADV_INSTANCES
int "Maximum number of extended advertising instances."
range 0 4
default 1
depends on BT_LE_EXT_ADV
help
Change this option to set maximum number of extended advertising
instances. Minimum there is always one instance of
advertising. Enter how many more advertising instances you
want.
Each extended advertising instance will take about 0.5k DRAM.
config BT_LE_EXT_ADV_MAX_SIZE
int "Maximum length of the advertising data."
range 0 1650
default 1650
depends on BT_LE_EXT_ADV
help
Defines the length of the extended adv data. The value should not
exceed 1650.
config BT_LE_ENABLE_PERIODIC_ADV
bool "Enable periodic advertisement."
default y
depends on BT_LE_EXT_ADV
help
Enable this option to start periodic advertisement.
config BT_LE_PERIODIC_ADV_SYNC_TRANSFER
bool "Enable Transfer Sync Events"
depends on BT_LE_ENABLE_PERIODIC_ADV
if BT_LE_50_FEATURE_SUPPORT
config BT_LE_LL_CFG_FEAT_LE_2M_PHY
bool "Enable 2M Phy"
depends on BT_LE_50_FEATURE_SUPPORT
default y
help
This enables controller transfer periodic sync events to host
Enable 2M-PHY
config BT_LE_LL_CFG_FEAT_LE_CODED_PHY
bool "Enable coded Phy"
depends on BT_LE_50_FEATURE_SUPPORT
default y
help
Enable coded-PHY
config BT_LE_EXT_ADV
bool "Enable extended advertising"
depends on BT_LE_50_FEATURE_SUPPORT
default y
help
Enable this option to do extended advertising. Extended advertising
will be supported from BLE 5.0 onwards.
if BT_LE_EXT_ADV
config BT_LE_MAX_EXT_ADV_INSTANCES
int "Maximum number of extended advertising instances."
range 0 4
default 1
depends on BT_LE_EXT_ADV
help
Change this option to set maximum number of extended advertising
instances. Minimum there is always one instance of
advertising. Enter how many more advertising instances you
want.
Each extended advertising instance will take about 0.5k DRAM.
config BT_LE_EXT_ADV_MAX_SIZE
int "Maximum length of the advertising data."
range 0 1650
default 1650
depends on BT_LE_EXT_ADV
help
Defines the length of the extended adv data. The value should not
exceed 1650.
config BT_LE_ENABLE_PERIODIC_ADV
bool "Enable periodic advertisement."
default y
depends on BT_LE_EXT_ADV
help
Enable this option to start periodic advertisement.
config BT_LE_PERIODIC_ADV_SYNC_TRANSFER
bool "Enable Transfer Sync Events"
depends on BT_LE_ENABLE_PERIODIC_ADV
default y
help
This enables controller transfer periodic sync events to host
endif
config BT_LE_EXT_SCAN
bool "Enable extended scanning"
depends on BT_LE_50_FEATURE_SUPPORT && BT_LE_ROLE_OBSERVER_ENABLE
default y
help
Enable this option to do extended scanning.
config BT_LE_ENABLE_PERIODIC_SYNC
bool "Enable periodic sync"
default y
depends on BT_LE_EXT_SCAN
help
Enable this option to receive periodic advertisement.
if BT_LE_ENABLE_PERIODIC_SYNC
config BT_LE_MAX_PERIODIC_SYNCS
int "Maximum number of periodic advertising syncs"
range 0 3
default 1 if BT_LE_ENABLE_PERIODIC_ADV
default 0
help
Set this option to set the upper limit for number of periodic sync
connections. This should be less than maximum connections allowed by
controller.
config BT_LE_MAX_PERIODIC_ADVERTISER_LIST
int "Maximum number of periodic advertiser list"
range 1 5
default 5
help
Set this option to set the upper limit for number of periodic advertiser list.
endif
endif
config BT_LE_MAX_PERIODIC_SYNCS
int "Maximum number of periodic advertising syncs"
depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED
range 0 3
default 1 if BT_LE_ENABLE_PERIODIC_ADV
default 0
help
Set this option to set the upper limit for number of periodic sync
connections. This should be less than maximum connections allowed by
controller.
config BT_LE_MAX_PERIODIC_ADVERTISER_LIST
int "Maximum number of periodic advertiser list"
depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED
range 1 5
default 5
help
Set this option to set the upper limit for number of periodic advertiser list.
menu "Memory Settings"
depends on !BT_NIMBLE_ENABLED
@ -280,6 +308,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
@ -349,7 +395,6 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
bool "Override TinyCrypt with mbedTLS for crypto computations"
default y
depends on !BT_NIMBLE_ENABLED
select MBEDTLS_ECP_RESTARTABLE
select MBEDTLS_CMAC_C
help
Enable this option to choose mbedTLS instead of TinyCrypt for crypto
@ -492,6 +537,10 @@ config BT_LE_TX_CCA_ENABLED
help
Enable CCA feature to cancel sending the packet if the signal power is stronger than CCA threshold.
config BT_LE_DTM_ENABLED
bool "Enable Direct Test Mode (DTM) feature"
default n
config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
@ -500,6 +549,10 @@ config BT_LE_CCA_RSSI_THRESH
help
Power threshold of CCA in unit of -1 dBm.
config BT_LE_FEAT_LL_ENCRYPTION
bool "Enable controller ACL encryption"
default y
config BT_LE_ROLE_CENTROL_ENABLE
bool "Enable BLE Centrol role function"
depends on !BT_NIMBLE_ENABLED
@ -527,3 +580,82 @@ config BT_LE_ROLE_OBSERVER_ENABLE
default y
help
Enable observer role function.
choice BT_LE_DFT_TX_POWER_LEVEL_DBM
prompt "BLE default Tx power level(dBm)"
default BT_LE_DFT_TX_POWER_LEVEL_P9
help
Specify default Tx power level(dBm).
config BT_LE_DFT_TX_POWER_LEVEL_N24
bool "-24dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N21
bool "-21dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N18
bool "-18dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N15
bool "-15dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N12
bool "-12dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N9
bool "-9dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N6
bool "-6dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N3
bool "-3dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N0
bool "0dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P3
bool "+3dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P6
bool "+6dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P9
bool "+9dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P12
bool "+12dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P15
bool "+15dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P20
bool "+20dBm"
endchoice
config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
int
default -24 if BT_LE_DFT_TX_POWER_LEVEL_N24
default -21 if BT_LE_DFT_TX_POWER_LEVEL_N21
default -18 if BT_LE_DFT_TX_POWER_LEVEL_N18
default -15 if BT_LE_DFT_TX_POWER_LEVEL_N15
default -12 if BT_LE_DFT_TX_POWER_LEVEL_N12
default -9 if BT_LE_DFT_TX_POWER_LEVEL_N9
default -6 if BT_LE_DFT_TX_POWER_LEVEL_N6
default -3 if BT_LE_DFT_TX_POWER_LEVEL_N3
default 0 if BT_LE_DFT_TX_POWER_LEVEL_N0
default 3 if BT_LE_DFT_TX_POWER_LEVEL_P3
default 6 if BT_LE_DFT_TX_POWER_LEVEL_P6
default 9 if BT_LE_DFT_TX_POWER_LEVEL_P9
default 12 if BT_LE_DFT_TX_POWER_LEVEL_P12
default 15 if BT_LE_DFT_TX_POWER_LEVEL_P15
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
default 0
config BT_CTRL_RUN_IN_FLASH_ONLY
bool "Reduce BLE IRAM usage (READ DOCS FIRST) (EXPERIMENTAL)"
default n
help
Move most IRAM into flash. This will increase the usage of flash and reduce ble performance.
Because the code is moved to the flash, the execution speed of the code is reduced.
To have a small impact on performance, you need to enable flash suspend (SPI_FLASH_AUTO_SUSPEND).
- Only one Tx-Rx can be performed in each connection interval. Therefore, reduce the connection interval
as much as possible to improve the throughput. If you want higher connection performance, you can
enable BT_LE_PLACE_CONN_RELATED_INTO_IRAM to put the connection-related code into iram.
- For HCI_LE_Extended_Create_Connection command, only 1M phy's connection parameters will be applied.
Other phys' will be ignored.
- For extended scanning, we may be unable to receive the extended adv with 300us MAFS.
config BT_LE_PLACE_CONN_RELATED_INTO_IRAM
bool "Place the connection-related code into IRAM"
depends on BT_CTRL_RUN_IN_FLASH_ONLY
default n

View File

@ -16,7 +16,10 @@
#include "sdkconfig.h"
#if CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port.h"
#endif // CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port_freertos.h"
#ifdef ESP_PLATFORM
@ -28,7 +31,7 @@
#endif
#include "nimble/nimble_npl_os.h"
#include "nimble/ble_hci_trans.h"
#include "esp_hci_transport.h"
#include "os/endian.h"
#include "esp_bt.h"
@ -41,16 +44,12 @@
#include "soc/syscon_reg.h"
#include "soc/modem_clkrst_reg.h"
#include "esp_private/periph_ctrl.h"
#include "hci_uart.h"
#include "bt_osi_mem.h"
#ifdef CONFIG_BT_BLUEDROID_ENABLED
#include "hci/hci_hal.h"
#endif
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/sleep_modem.h"
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/esp_modem_clock.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -64,6 +63,7 @@
#include "hal/efuse_ll.h"
#include "soc/rtc.h"
/* Macro definition
************************************************************************
*/
@ -76,17 +76,6 @@
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
#ifdef CONFIG_BT_BLUEDROID_ENABLED
/* ACL_DATA_MBUF_LEADINGSPCAE: The leadingspace in user info header for ACL data */
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED
typedef enum ble_rtc_slow_clk_src {
BT_SLOW_CLK_SRC_MAIN_XTAL,
BT_SLOW_CLK_SRC_32K_XTAL_ON_PIN0,
} ble_rtc_slow_clk_src_t;
/* Types definition
************************************************************************
*/
@ -105,12 +94,12 @@ struct ext_funcs_t {
int (*_esp_intr_free)(void **ret_handle);
void *(* _malloc)(size_t size);
void (*_free)(void *p);
void (*_hal_uart_start_tx)(int);
int (*_hal_uart_init_cbs)(int, hci_uart_tx_char, hci_uart_tx_done, hci_uart_rx_char, void *);
int (*_hal_uart_config)(int, int32_t, uint8_t, uint8_t, uart_parity_t, uart_hw_flowcontrol_t);
int (*_hal_uart_close)(int);
void (*_hal_uart_blocking_tx)(int, uint8_t);
int (*_hal_uart_init)(int, void *);
void (*_rsv1)(int);
int (*_rsv2)(int, int (*)(void *arg), int (*)(void *arg, uint8_t byte), int (*)(void *arg, uint8_t byte), void *);
int (*_rsv3)(int, int32_t, uint8_t, uint8_t, int, int);
int (*_rsv4)(int);
void (*_rsv5)(int, uint8_t);
int (*_rsv6)(int, void *);
int (* _task_create)(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id);
void (* _task_delete)(void *task_handle);
void (*_osi_assert)(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
@ -167,6 +156,10 @@ extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_cou
extern void bt_track_pll_cap(void);
extern char *ble_controller_get_compile_version(void);
extern const char *r_ble_controller_get_rom_compile_version(void);
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
extern void ble_ll_supported_features_init(void);
#endif //CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
#if CONFIG_BT_RELEASE_IRAM
extern uint32_t _iram_bt_text_start;
extern uint32_t _bss_bt_end;
@ -188,16 +181,6 @@ static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status);
static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status);
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id);
static void task_delete_wrapper(void *task_handle);
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no);
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg);
static int hci_uart_config_wrapper(int uart_no, int32_t speed, uint8_t databits, uint8_t stopbits,
uart_parity_t parity, uart_hw_flowcontrol_t flow_ctl);
static int hci_uart_close_wrapper(int uart_no);
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data);
static int hci_uart_init_wrapper(int uart_no, void *cfg);
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in);
static int esp_intr_free_wrapper(void **ret_handle);
@ -209,15 +192,248 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
};
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
default:
assert(0);
}
ret = ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
}
return ret;
}
void esp_bt_ontroller_log_deinit(void)
{
ble_log_deinit_async();
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
assert(log_partition != NULL);
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
ble_log_async_output_dump_all(true);
stop_write = true;
esp_bt_ontroller_log_deinit();
portEXIT_CRITICAL_SAFE(&spinlock);
buffer = (const uint8_t *)mapped_ptr;
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
vTaskDelay(2);
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
}
}
void esp_ble_controller_log_dump_all(bool output)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
@ -226,10 +442,10 @@ static bool s_ble_active = false;
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US (1800)
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
._magic = OSI_COEX_MAGIC_VALUE,
._version = OSI_COEX_VERSION,
@ -245,14 +461,6 @@ struct ext_funcs_t ext_funcs_ro = {
._esp_intr_free = esp_intr_free_wrapper,
._malloc = bt_osi_mem_malloc_internal,
._free = bt_osi_mem_free,
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._hal_uart_start_tx = hci_uart_start_tx_wrapper,
._hal_uart_init_cbs = hci_uart_init_cbs_wrapper,
._hal_uart_config = hci_uart_config_wrapper,
._hal_uart_close = hci_uart_close_wrapper,
._hal_uart_blocking_tx = hci_uart_blocking_tx_wrapper,
._hal_uart_init = hci_uart_init_wrapper,
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._task_create = task_create_wrapper,
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
@ -299,83 +507,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
#endif // CONFIG_SW_COEXIST_ENABLE
}
#ifdef CONFIG_BT_BLUEDROID_ENABLED
bool esp_vhci_host_check_send_available(void)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return false;
}
return true;
}
/**
* Allocates an mbuf for use by the nimble host.
*/
static struct os_mbuf *ble_hs_mbuf_gen_pkt(uint16_t leading_space)
{
struct os_mbuf *om;
int rc;
om = os_msys_get_pkthdr(0, 0);
if (om == NULL) {
return NULL;
}
if (om->om_omp->omp_databuf_len < leading_space) {
rc = os_mbuf_free_chain(om);
assert(rc == 0);
return NULL;
}
om->om_data += leading_space;
return om;
}
/**
* Allocates an mbuf suitable for an HCI ACL data packet.
*
* @return An empty mbuf on success; null on memory
* exhaustion.
*/
struct os_mbuf *ble_hs_mbuf_acl_pkt(void)
{
return ble_hs_mbuf_gen_pkt(4 + 1);
}
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return;
}
if (*(data) == DATA_TYPE_COMMAND) {
struct ble_hci_cmd *cmd = NULL;
cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD);
assert(cmd);
memcpy((uint8_t *)cmd, data + 1, len - 1);
ble_hci_trans_hs_cmd_tx((uint8_t *)cmd);
}
if (*(data) == DATA_TYPE_ACL) {
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
assert(om);
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
ble_hci_trans_hs_acl_tx(om);
}
}
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return ESP_FAIL;
}
ble_hci_trans_cfg_hs(ble_hs_hci_rx_evt, NULL, ble_hs_rx_data, NULL);
return ESP_OK;
}
#endif // CONFIG_BT_BLUEDROID_ENABLED
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth, void *param, uint32_t prio, void *task_handle, uint32_t core_id)
{
return (uint32_t)xTaskCreatePinnedToCore(task_func, name, stack_depth, param, prio, task_handle, (core_id < CONFIG_FREERTOS_NUMBER_OF_CORES ? core_id : tskNO_AFFINITY));
@ -405,59 +536,14 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
hci_uart_start_tx(uart_no);
}
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg)
{
int rc = -1;
rc = hci_uart_init_cbs(uart_no, tx_func, tx_done, rx_func, arg);
return rc;
}
static int hci_uart_config_wrapper(int port_num, int32_t baud_rate, uint8_t data_bits,
uint8_t stop_bits,uart_parity_t parity,
uart_hw_flowcontrol_t flow_ctl)
{
int rc = -1;
rc = hci_uart_config(port_num, baud_rate, data_bits, stop_bits, parity, flow_ctl);
return rc;
}
static int hci_uart_close_wrapper(int uart_no)
{
int rc = -1;
rc = hci_uart_close(uart_no);
return rc;
}
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data)
{
//This function is nowhere to use.
}
static int hci_uart_init_wrapper(int uart_no, void *cfg)
{
//This function is nowhere to use.
return 0;
}
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int ble_hci_unregistered_hook(void*, void*)
{
ESP_LOGD(NIMBLE_PORT_LOG_TAG,"%s ble hci rx_evt is not registered.",__func__);
return 0;
}
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler, void *arg, void **ret_handle_in)
{
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
int rc = esp_intr_alloc(source, flags, handler, arg, (intr_handle_t *)ret_handle_in);
#else
int rc = esp_intr_alloc(source, flags | ESP_INTR_FLAG_IRAM, handler, arg, (intr_handle_t *)ret_handle_in);
#endif
return rc;
}
@ -476,6 +562,20 @@ void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -502,7 +602,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
s_ble_active = true;
}
esp_err_t controller_sleep_init(ble_rtc_slow_clk_src_t slow_clk_src)
esp_err_t controller_sleep_init(modem_clock_lpclk_src_t slow_clk_src)
{
esp_err_t rc = 0;
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
@ -510,7 +610,7 @@ esp_err_t controller_sleep_init(ble_rtc_slow_clk_src_t slow_clk_src)
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0, 500 + BLE_RTC_DELAY_US);
#ifdef CONFIG_PM_ENABLE
if (slow_clk_src == BT_SLOW_CLK_SRC_MAIN_XTAL) {
if (slow_clk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
} else {
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
@ -565,11 +665,11 @@ void controller_sleep_deinit(void)
#endif //CONFIG_PM_ENABLE
}
static void esp_bt_rtc_slow_clk_select(ble_rtc_slow_clk_src_t slow_clk_src)
static void esp_bt_rtc_slow_clk_select(modem_clock_lpclk_src_t slow_clk_src)
{
/* Select slow clock source for BT momdule */
switch (slow_clk_src) {
case BT_SLOW_CLK_SRC_MAIN_XTAL:
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_XTAL32K_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 1, MODEM_CLKRST_LP_TIMER_SEL_XTAL_S);
@ -581,7 +681,7 @@ static void esp_bt_rtc_slow_clk_select(ble_rtc_slow_clk_src_t slow_clk_src)
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 249, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
#endif // CONFIG_XTAL_FREQ_26
break;
case BT_SLOW_CLK_SRC_32K_XTAL_ON_PIN0:
case MODEM_CLOCK_LPCLK_SRC_EXT32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using external 32.768 kHz XTAL as clock source");
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 1, MODEM_CLKRST_LP_TIMER_SEL_XTAL32K_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_XTAL_S);
@ -598,40 +698,40 @@ static void esp_bt_rtc_slow_clk_select(ble_rtc_slow_clk_src_t slow_clk_src)
SET_PERI_REG_BITS(MODEM_CLKRST_ETM_CLK_CONF_REG, 1, 0, MODEM_CLKRST_ETM_CLK_SEL_S);
}
static ble_rtc_slow_clk_src_t ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
static modem_clock_lpclk_src_t ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
ble_rtc_slow_clk_src_t slow_clk_src;
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
#ifdef CONFIG_XTAL_FREQ_26
cfg->rtc_freq = 40000;
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
cfg->rtc_freq = 32000;
#endif // CONFIG_XTAL_FREQ_26
slow_clk_src = BT_SLOW_CLK_SRC_MAIN_XTAL;
#else
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) {
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#endif // CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32768;
slow_clk_src = BT_SLOW_CLK_SRC_32K_XTAL_ON_PIN0;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
#ifdef CONFIG_XTAL_FREQ_26
cfg->rtc_freq = 40000;
#else
cfg->rtc_freq = 32000;
#endif // CONFIG_XTAL_FREQ_26
slow_clk_src = BT_SLOW_CLK_SRC_MAIN_XTAL;
}
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
esp_bt_rtc_slow_clk_select(slow_clk_src);
return slow_clk_src;
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
return s_bt_lpclk_src;
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
ble_rtc_slow_clk_src_t rtc_clk_src;
modem_clock_lpclk_src_t rtc_clk_src;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
@ -652,6 +752,8 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
return ret;
}
/* If we place the ble code into flash, don't need to initialize ROM. */
#if !CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
#if DEFAULT_BT_LE_50_FEATURE_SUPPORT || DEFAULT_BT_LE_ROLE_CENTROL || DEFAULT_BT_LE_ROLE_OBSERVER
extern int esp_ble_rom_func_ptr_init_all(void);
esp_ble_rom_func_ptr_init_all();
@ -660,6 +762,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
extern int esp_ble_rom_func_ptr_init_legacy_adv_and_slave(void);
esp_ble_rom_func_ptr_init_legacy_adv_and_slave();
#endif
#endif //!CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
/* Initialize the function pointers for OS porting */
npl_freertos_funcs_init();
@ -709,6 +812,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#if CONFIG_SW_COEXIST_ENABLE
coex_init();
#endif
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
ble_ll_supported_features_init();
#endif //CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
ret = ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
@ -719,20 +827,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble rom commit:[%s]", r_ble_controller_get_rom_compile_version());
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init(log_output_mode);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto controller_init_err;
@ -748,20 +843,32 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
uint8_t mac[6];
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
esp_ble_ll_set_public_addr(mac);
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hci_unregistered_hook,NULL,
(ble_hci_trans_rx_acl_fn *)ble_hci_unregistered_hook,NULL);
#if CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
hci_transport_mode = HCI_TRANSPORT_VHCI;
#elif CONFIG_BT_LE_HCI_INTERFACE_USE_UART
hci_transport_mode = HCI_TRANSPORT_UART_NO_DMA;
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
ret = hci_transport_init(hci_transport_mode);
if (ret) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "hci transport init failed %d", ret);
goto free_controller;
}
return ESP_OK;
free_controller:
hci_transport_deinit();
controller_sleep_deinit();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
controller_init_err:
ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
modem_deint:
@ -786,10 +893,11 @@ esp_err_t esp_bt_controller_deinit(void)
return ESP_FAIL;
}
hci_transport_deinit();
controller_sleep_deinit();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
@ -1139,30 +1247,6 @@ uint8_t esp_ble_get_chip_rev_version(void)
return efuse_ll_get_chip_wafer_version_minor();
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
}
void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED)
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
#define BLE_SM_KEY_ERR 0x17

View File

@ -0,0 +1,320 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_bt_cfg.h"
#define BLE_ERR_UNKNOWN_HCI_CMD (0x01)
/* LL Features */
#define BLE_LL_FEAT_LE_ENCRYPTION (0x0000000001)
#define BLE_LL_FEAT_CONN_PARM_REQ (0x0000000002)
#define BLE_LL_FEAT_EXTENDED_REJ (0x0000000004)
#define BLE_LL_FEAT_PERIPH_INIT (0x0000000008)
#define BLE_LL_FEAT_LE_PING (0x0000000010)
#define BLE_LL_FEAT_DATA_LEN_EXT (0x0000000020)
#define BLE_LL_FEAT_LL_PRIVACY (0x0000000040)
#define BLE_LL_FEAT_EXT_SCAN_FILT (0x0000000080)
#define BLE_LL_FEAT_LE_2M_PHY (0x0000000100)
#define BLE_LL_FEAT_STABLE_MOD_ID_TX (0x0000000200)
#define BLE_LL_FEAT_STABLE_MOD_ID_RX (0x0000000400)
#define BLE_LL_FEAT_LE_CODED_PHY (0x0000000800)
#define BLE_LL_FEAT_EXT_ADV (0x0000001000)
#define BLE_LL_FEAT_PERIODIC_ADV (0x0000002000)
#define BLE_LL_FEAT_CSA2 (0x0000004000)
#define BLE_LL_FEAT_LE_POWER_CLASS_1 (0x0000008000)
#define BLE_LL_FEAT_MIN_USED_CHAN (0x0000010000)
#define BLE_LL_FEAT_CTE_REQ (0x0000020000)
#define BLE_LL_FEAT_CTE_RSP (0x0000040000)
#define BLE_LL_FEAT_CTE_TX (0x0000080000)
#define BLE_LL_FEAT_CTE_RX (0x0000100000)
#define BLE_LL_FEAT_CTE_AOD (0x0000200000)
#define BLE_LL_FEAT_CTE_AOA (0x0000400000)
#define BLE_LL_FEAT_CTE_RECV (0x0000800000)
#define BLE_LL_FEAT_SYNC_TRANS_SEND (0x0001000000)
#define BLE_LL_FEAT_SYNC_TRANS_RECV (0x0002000000)
#define BLE_LL_FEAT_SCA_UPDATE (0x0004000000)
#define BLE_LL_FEAT_REM_PKEY (0x0008000000)
#define BLE_LL_FEAT_CIS_CENTRAL (0x0010000000)
#define BLE_LL_FEAT_CIS_PERIPH (0x0020000000)
#define BLE_LL_FEAT_ISO_BROADCASTER (0x0040000000)
#define BLE_LL_FEAT_SYNC_RECV (0x0080000000)
#define BLE_LL_FEAT_CIS_HOST (0x0100000000)
#define BLE_LL_FEAT_POWER_CTRL_REQ (0x0200000000)
#define BLE_LL_FEAT_POWER_CHANGE_IND (0x0400000000)
#define BLE_LL_FEAT_PATH_LOSS_MON (0x0800000000)
#define BLE_LL_FEAT_PERIODIC_ADV_ADI (0x1000000000)
#define BLE_LL_FEAT_CONN_SUBRATING (0x2000000000)
#define BLE_LL_FEAT_CONN_SUBRATING_HOST (0x4000000000)
#define BLE_LL_FEAT_CHANNEL_CLASS (0x8000000000)
uint64_t ble_ll_supported_features;
void
ble_ll_supported_features_init(void)
{
ble_ll_supported_features = BLE_LL_FEAT_EXTENDED_REJ;
ble_ll_supported_features |= BLE_LL_FEAT_DATA_LEN_EXT;
#if DEFAULT_BT_LE_ROLE_CENTROL || DEFAULT_BT_LE_ROLE_PERIPHERAL
ble_ll_supported_features |= BLE_LL_FEAT_PERIPH_INIT;
ble_ll_supported_features |= BLE_LL_FEAT_CONN_PARM_REQ;
#endif
#if CONFIG_BT_LE_FEAT_LL_ENCRYPTION
ble_ll_supported_features |= BLE_LL_FEAT_LE_ENCRYPTION;
#endif
ble_ll_supported_features |= (BLE_LL_FEAT_LL_PRIVACY | BLE_LL_FEAT_EXT_SCAN_FILT);
ble_ll_supported_features |= BLE_LL_FEAT_LE_PING;
#if DEFAULT_BT_LE_EXT_ADV
ble_ll_supported_features |= BLE_LL_FEAT_EXT_ADV;
#endif
#if DEFAULT_BT_LE_PERIODIC_ADV
ble_ll_supported_features |= BLE_LL_FEAT_PERIODIC_ADV;
ble_ll_supported_features |= BLE_LL_FEAT_PERIODIC_ADV_ADI;
#endif
#if DEFAULT_BT_LE_PAST
ble_ll_supported_features |= BLE_LL_FEAT_SYNC_TRANS_RECV;
ble_ll_supported_features |= BLE_LL_FEAT_SYNC_TRANS_SEND;
#endif
#if DEGAULT_BT_LE_2M_PHY
ble_ll_supported_features |= BLE_LL_FEAT_LE_2M_PHY;
#endif
#if DEGAULT_BT_LE_CODED_PHY
ble_ll_supported_features |= BLE_LL_FEAT_LE_CODED_PHY;
#endif
#if DEFAULT_BT_LE_50_FEATURE_SUPPORT
ble_ll_supported_features |= BLE_LL_FEAT_CSA2;
ble_ll_supported_features |= BLE_LL_FEAT_SCA_UPDATE;
ble_ll_supported_features |= BLE_LL_FEAT_REM_PKEY;
ble_ll_supported_features |= BLE_LL_FEAT_CHANNEL_CLASS;
#endif
}
#if !DEFAULT_BT_LE_ROLE_BROADCASTER
void r_ble_ll_adv_rpa_timeout(void) { }
void r_ble_lll_adv_halt(void) { }
void r_ble_lll_adv_event_rmvd_from_sched(void) { }
void r_ble_lll_adv_ext_event_rmvd_from_sched(void) { }
int r_ble_ll_adv_enabled(void) { return 0; }
int r_ble_ll_adv_can_chg_whitelist(void) { return 1; }
int r_ble_ll_adv_set_random_addr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
void r_ble_ll_adv_reset(void) { }
void r_ble_ll_adv_init(void) { }
void r_ble_ll_adv_deinit(void) { }
int r_ble_ll_adv_env_init(void) { return 0; }
void r_ble_ll_adv_env_deinit(void) { }
int r_ble_lll_adv_rx_pkt_isr(void) { return -1; }
void r_ble_ll_adv_rx_pkt_in(void) { }
int r_ble_ll_adv_set_adv_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_read_txpwr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_hci_set_adv_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_hci_set_scan_rsp_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_hci_adv_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_vendor_hci_legacy_adv_clear(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_set_data_related_addr_change(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif // !DEFAULT_BT_LE_ROLE_BROADCASTER
#if !DEFAULT_BT_LE_EXT_ADV
bool r_ble_ll_adv_ext_check_data_itvl(void) { return true; }
void r_ble_lll_adv_coex_dpc_update_on_aux_scheduled(void) { }
void r_ble_lll_adv_coex_dpc_calc_pti_update_itvl(void) { }
void r_ble_lll_adv_sec_done(void) { }
int r_ble_lll_adv_sec_schedule_next_aux(void) { return 0; }
void r_ble_lll_adv_sec_event_done(void) { }
int r_ble_lll_adv_secondary_tx_start_cb(void) { return 0; }
void r_ble_lll_adv_aux_schedule(void) { }
void r_ble_lll_adv_update_rsp_offset(void) { }
int r_ble_ll_adv_hci_set_random_addr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_ext_set_param(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_ext_set_adv_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_ext_set_scan_rsp(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_ext_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_rd_max_adv_data_len(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_rd_sup_adv_sets(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_remove(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_clear_all(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_EXT_ADV
#if !DEFAULT_BT_LE_PERIODIC_ADV
void r_ble_ll_adv_sm_stop_periodic(void) { }
void r_ble_lll_adv_periodic_event_done(void) { }
int r_ble_lll_adv_sync_tx_start_cb(void) { return 0; }
void r_ble_lll_adv_sync_tx_end(void) { }
int r_ble_lll_adv_periodic_start(void) { return 0; }
void r_ble_lll_adv_periodic_rmvd_from_sched(void) { }
int r_ble_ll_adv_periodic_set_param(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_periodic_set_data(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_adv_periodic_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_PERIODIC_ADV
#if !DEFAULT_BT_LE_ROLE_OBSERVER
void r_ble_lll_scan_halt(void) { }
void r_ble_ll_scan_end_adv_evt(void) { }
void r_ble_ll_scan_rx_pkt_in(void) { }
int r_ble_lll_scan_rx_pkt_isr(void) { return -1; }
int r_ble_ll_scan_env_init(void) { return 0; }
void r_ble_ll_scan_env_deinit(void) { }
void r_ble_ll_scan_init(void) { }
void r_ble_ll_scan_deinit(void) { }
void r_ble_ll_scan_reset(void) { }
int r_ble_ll_scan_can_chg_whitelist(void) { return 1; }
int r_ble_ll_scan_enabled(void) { return false; }
int r_ble_lll_scan_chk_resume(void) { return -1; }
int r_ble_ll_scan_set_scan_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_hci_scan_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_scan_hci_update_adv_report_flow_ctrl(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_scan_hci_set_adv_report_flow_ctrl(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_ROLE_OBSERVER
#if !DEFAULT_BT_LE_EXT_SCAN
void r_ble_lll_scan_duration_period_timers_restart(void) { }
void r_ble_lll_scan_duration_period_timers_stop(void) { }
int r_ble_ll_hci_send_legacy_ext_adv_report(void) { return -1; }
void r_ble_lll_sched_rmv_elem_type(void) { }
void r_ble_ll_scan_send_truncated(void) { }
void r_ble_ll_scan_aux_data_unref(void) { }
void r_ble_lll_scan_sched_remove(void) { }
void r_ble_lll_scan_aux_data_free(void) { }
void r_ble_lll_aux_scan_drop(void) { }
int r_ble_lll_sched_aux_scan(void) { return -1; }
int r_ble_lll_scan_rx_isr_on_aux(void) { return -1; }
void r_ble_lll_scan_period_timer_cb(void) { }
void r_ble_lll_scan_duration_timer_cb(void) { }
void r_ble_ll_scan_rx_pkt_in_on_aux(void) { }
int r_ble_ll_set_ext_scan_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_hci_ext_scan_set_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_EXT_SCAN
#if !DEFAULT_BT_LE_ROLE_CENTROL
void r_ble_ll_init_rx_pkt_in(void) { }
int r_ble_lll_init_rx_pkt_isr(void) { return -1; }
int r_ble_ll_conn_create(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_create_cancel(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_ROLE_CENTROL
#if !DEFAULT_BT_LE_ROLE_CENTROL || !DEFAULT_BT_LE_EXT_SCAN
int r_ble_ll_ext_conn_create(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_ROLE_CENTROL || !DEFAULT_BT_LE_EXT_SCAN
#if !DEFAULT_BT_LE_ROLE_PERIPHERAL
int r_ble_ll_conn_slave_start(void) { return 0; }
#endif //!DEFAULT_BT_LE_ROLE_PERIPHERAL
#if !DEFAULT_BT_LE_ROLE_CENTROL && !DEFAULT_BT_LE_ROLE_PERIPHERAL
void r_ble_ll_conn_rx_data_pdu(void) { }
int r_ble_lll_conn_rx_pkt_isr(void) { return -1; }
int r_ble_ll_hci_disconnect(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_rd_rem_ver_cmd(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_update(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_rd_chan_map(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_read_rem_features(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_param_rr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_param_nrr(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_ROLE_CENTROL && !DEFAULT_BT_LE_ROLE_PERIPHERAL
#if !CONFIG_BT_LE_FEAT_LL_ENCRYPTION
int r_ble_ll_conn_chk_phy_upd_start(void) { return -1; }
void r_ble_ll_hci_ev_encrypt_chg(void) { }
int r_ble_ll_ctrl_enc_allowed_pdu_rx(void) { return 1; }
int r_ble_ll_ctrl_enc_allowed_pdu_tx(void) { return 1; }
uint8_t r_ble_ll_ctrl_rx_start_enc_rsp(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_pause_enc_rsp(void) { return 0x07; }
int r_ble_ll_hci_le_encrypt(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!CONFIG_BT_LE_FEAT_LL_ENCRYPTION
#if !DEFAULT_BT_LE_ROLE_PERIPHERAL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION
uint8_t r_ble_ll_ctrl_rx_pause_enc_req(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_enc_req(void) { return 0x07; }
int r_ble_ll_conn_hci_le_ltk_reply(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_le_ltk_neg_reply(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_ROLE_PERIPHERAL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION
#if !DEFAULT_BT_LE_ROLE_CENTROL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION
uint8_t r_ble_ll_ctrl_rx_start_enc_req(void) { return 0x07; }
void r_ble_ll_ctrl_rx_enc_rsp(void) { }
void r_ble_ll_ctrl_enc_req_make(void) { }
int r_ble_ll_conn_hci_le_start_encrypt(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_ROLE_CENTROL || !CONFIG_BT_LE_FEAT_LL_ENCRYPTION
#if !DEGAULT_BT_LE_2M_PHY && !DEGAULT_BT_LE_CODED_PHY
void r_ble_ll_ctrl_phy_update_proc_complete(void) { }
void r_ble_ll_ctrl_phy_update_cancel(void) { }
uint8_t r_ble_ll_ctrl_rx_phy_update_ind(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_phy_rsp(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_phy_req(void) { return 0x07; }
void r_ble_ll_ctrl_phy_req_rsp_make(void) { }
#endif //DEGAULT_BT_LE_2M_PHY && DEGAULT_BT_LE_CODED_PHY
#if !DEFAULT_BT_LE_PERIODIC_SYNC
void r_ble_lll_sync_halt(void) { }
void r_ble_lll_sync_rmvd_from_sched(void) { }
int r_ble_ll_sync_list_search(void) { return -1; }
uint8_t r_ble_ll_ctrl_rx_periodic_sync_ind(void) { return 0x07; }
void r_ble_ll_sync_rx_pkt_in(void) { }
int r_ble_lll_sync_rx_pkt_isr(void) { return -1; }
int r_ble_ll_sync_env_init(void) { return 0; }
void r_ble_ll_sync_env_deinit(void) { }
void r_ble_ll_sync_init(void) { }
void r_ble_ll_sync_deinit(void) { }
void r_ble_ll_sync_reset(void) { }
bool r_ble_ll_sync_enabled(void) { return false; }
int r_ble_ll_sync_create(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_cancel(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_terminate(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_list_add(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_list_remove(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_list_clear(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_list_size(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_sync_receive_enable(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_PERIODIC_SYNC
#if !DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_ADV
int r_ble_ll_adv_periodic_set_info_transfer(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_ADV
#if !DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_SYNC
int r_ble_ll_sync_transfer(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_set_sync_transfer_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_set_default_sync_transfer_params(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_PAST || !DEFAULT_BT_LE_PERIODIC_SYNC
#if !DEFAULT_BT_LE_50_FEATURE_SUPPORT
uint8_t r_ble_ll_ctrl_rx_channel_reporting_ind(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_channel_status_ind(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_sca_req(void) { return 0x07; }
uint8_t r_ble_ll_ctrl_rx_sca_rsp(void) { return 0x07; }
void r_ble_ll_ctrl_channel_class_reporting_make(void) { }
void r_ble_ll_ctrl_channel_class_enable_make(void) { }
void r_ble_ll_ctrl_sca_req_rsp_make(void) { }
int r_ble_ll_modify_sca(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_req_peer_sca(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_50_FEATURE_SUPPORT
#if !DEFAULT_BT_LE_50_FEATURE_SUPPORT
int r_ble_ll_conn_hci_le_rd_phy(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_hci_le_set_def_phy(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_ll_conn_hci_le_set_phy(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!DEFAULT_BT_LE_50_FEATURE_SUPPORT
#if !CONFIG_BT_LE_DTM_ENABLED
void r_ble_lll_dtm_rx_pkt_in(void) { }
int r_ble_lll_dtm_rx_isr_end(void) { return -1; }
void r_ble_lll_dtm_reset(void) { }
void r_ble_lll_dtm_init(void) { }
void r_ble_lll_dtm_deinit(void) { }
int r_ble_lll_dtm_env_init(void) { return 0; }
void r_ble_lll_dtm_env_deinit(void) { }
int r_ble_lll_hci_dtm_tx_test(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_lll_hci_dtm_rx_test(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_lll_dtm_end_test(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_lll_hci_dtm_rx_test_v2(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
int r_ble_lll_hci_dtm_tx_test_v2(void) { return BLE_ERR_UNKNOWN_HCI_CMD; }
#endif //!CONFIG_BT_LE_DTM_ENABLED

View File

@ -28,7 +28,6 @@ extern "C" {
#else
#define BLE_LL_SCAN_PHY_NUMBER_N (1)
#endif
#define DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST MYNEWT_VAL(BLE_MAX_PERIODIC_ADVERTISER_LIST)
#define DEFAULT_BT_LE_MAX_PERIODIC_SYNCS MYNEWT_VAL(BLE_MAX_PERIODIC_SYNCS)
#define DEFAULT_BT_LE_MAX_CONNECTIONS MYNEWT_VAL(BLE_MAX_CONNECTIONS)
@ -46,6 +45,14 @@ extern "C" {
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
#endif
#define DEGAULT_BT_LE_2M_PHY (CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY)
#define DEGAULT_BT_LE_CODED_PHY (CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY)
#define DEFAULT_BT_LE_EXT_ADV (CONFIG_BT_NIMBLE_EXT_ADV)
#define DEFAULT_BT_LE_PERIODIC_ADV (CONFIG_BT_NIMBLE_ENABLE_PERIODIC_ADV)
#define DEFAULT_BT_LE_EXT_SCAN (CONFIG_BT_NIMBLE_EXT_SCAN)
#define DEFAULT_BT_LE_PERIODIC_SYNC (CONFIG_BT_NIMBLE_ENABLE_PERIODIC_SYNC)
#define DEFAULT_BT_LE_PAST (CONFIG_BT_NIMBLE_PERIODIC_ADV_SYNC_TRANSFER)
#define DEFAULT_BT_LE_ROLE_OBSERVER MYNEWT_VAL(BLE_ROLE_OBSERVER)
#define DEFAULT_BT_LE_ROLE_CENTROL MYNEWT_VAL(BLE_ROLE_CENTRAL)
#define DEFAULT_BT_LE_ROLE_PERIPHERAL MYNEWT_VAL(BLE_ROLE_PERIPHERAL)
@ -123,12 +130,55 @@ extern "C" {
#else
#define DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT (8)
#endif
#if defined(CONFIG_BT_LE_50_FEATURE_SUPPORT)
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (1)
#else
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
#endif
#if defined(CONFIG_BT_LE_LL_CFG_FEAT_LE_2M_PHY)
#define DEGAULT_BT_LE_2M_PHY (CONFIG_BT_LE_LL_CFG_FEAT_LE_2M_PHY)
#else
#define DEGAULT_BT_LE_2M_PHY (0)
#endif
#if defined(CONFIG_BT_LE_LL_CFG_FEAT_LE_CODED_PHY)
#define DEGAULT_BT_LE_CODED_PHY (CONFIG_BT_LE_LL_CFG_FEAT_LE_CODED_PHY)
#else
#define DEGAULT_BT_LE_CODED_PHY (0)
#endif
#if defined(CONFIG_BT_LE_EXT_ADV)
#define DEFAULT_BT_LE_EXT_ADV (CONFIG_BT_LE_EXT_ADV)
#else
#define DEFAULT_BT_LE_EXT_ADV (0)
#endif
#if defined(CONFIG_BT_LE_ENABLE_PERIODIC_ADV)
#define DEFAULT_BT_LE_PERIODIC_ADV (CONFIG_BT_LE_ENABLE_PERIODIC_ADV)
#else
#define DEFAULT_BT_LE_PERIODIC_ADV (0)
#endif
#if defined(CONFIG_BT_LE_EXT_SCAN)
#define DEFAULT_BT_LE_EXT_SCAN (CONFIG_BT_LE_EXT_SCAN)
#else
#define DEFAULT_BT_LE_EXT_SCAN (0)
#endif
#if defined(CONFIG_BT_LE_ENABLE_PERIODIC_SYNC)
#define DEFAULT_BT_LE_PERIODIC_SYNC (CONFIG_BT_LE_ENABLE_PERIODIC_SYNC)
#else
#define DEFAULT_BT_LE_PERIODIC_SYNC (0)
#endif
#if defined(BT_LE_PERIODIC_ADV_SYNC_TRANSFER)
#define DEFAULT_BT_LE_PAST (BT_LE_PERIODIC_ADV_SYNC_TRANSFER)
#else
#define DEFAULT_BT_LE_PAST (0)
#endif
#if defined(CONFIG_BT_LE_ROLE_CENTROL_ENABLE)
#define DEFAULT_BT_LE_ROLE_CENTROL (1)
#else
@ -152,6 +202,20 @@ extern "C" {
#else
#define DEFAULT_BT_LE_ROLE_OBSERVER (0)
#endif
#if defined (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#if DEFAULT_BT_LE_HCI_UART_FLOW_CTRL
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (CONFIG_BT_LE_HCI_UART_CTS_PIN)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (CONFIG_BT_LE_HCI_UART_RTS_PIN)
#else
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#else
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#endif
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
@ -192,8 +256,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (UART_DATA_8_BITS)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (UART_STOP_BITS_1)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (CONFIG_BT_LE_HCI_UART_TASK_STACK_SIZE)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#else
#define DEFAULT_BT_LE_HCI_UART_TX_PIN (0)
#define DEFAULT_BT_LE_HCI_UART_RX_PIN (0)
@ -202,8 +264,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (0)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#endif
/* Unchanged configuration */
@ -232,7 +292,7 @@ extern "C" {
#define RTC_FREQ_N (32000) /* in Hz */
#endif // CONFIG_XTAL_FREQ_26
#define BLE_LL_TX_PWR_DBM_N (9)
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
#define RUN_BQB_TEST (0)

View File

@ -200,8 +200,8 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
bool "+21dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P20
bool "+20dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
@ -221,11 +221,12 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P20
default 0
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
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)
default y
help
The function is mainly used to enable flow control for advertising reports. When it is enabled,
@ -402,10 +403,10 @@ menu "MODEM SLEEP Options"
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
than other bluetooth low power clock sources.
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
bool "External 32kHz crystal"
depends on RTC_CLK_SRC_EXT_CRYS
bool "External 32kHz crystal/oscillator"
depends on RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC
help
External 32kHz crystal has a nominal frequency of 32.768kHz and provides good frequency
External 32kHz crystal/oscillator has a nominal frequency of 32.768kHz and provides good frequency
stability. If used as Bluetooth low power clock, External 32kHz can support Bluetooth
modem sleep to be used with both DFS and light sleep.
@ -489,3 +490,61 @@ config BT_CTRL_LE_PING_EN
help
If this option is disabled, The Controller will not start the LE authenticated payload timer.
This option is used for some compatibility problems related to LE ping procedure.
menu "BLE disconnect when instant passed"
config BT_CTRL_BLE_LLCP_CONN_UPDATE
bool "BLE ACL connection update procedure"
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed during connection update procedure.
config BT_CTRL_BLE_LLCP_CHAN_MAP_UPDATE
bool "BLE ACL channel map update procedure"
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed in channel map update procedure.
config BT_CTRL_BLE_LLCP_PHY_UPDATE
bool "BLE ACL PHY update procedure"
default n
help
If this option is enabled, Controller will terminate the connection
when instant passed in PHY update procedure.
endmenu
config BT_CTRL_RUN_IN_FLASH_ONLY
bool "Put all BLE Controller code in flash"
default n
help
If this option is enabled, all code for the Bluetooth controller will be moved from ROM and IRAM
to flash, saving over 20K bytes of memory. However, it will require more flash resources and the
performance of Bluetooth will decrease If this option is enabled, Bluetooth may not work properly
during erasing flash. It is recommended to turn on the auto suspend function of flash. After auto
suspend is turned on, Bluetooth interrupts can be executed normally during erasing flash, with less
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_TEST
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE QA test feature"
default n
config BT_CTRL_BLE_SCAN
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE scan feature"
default y
config BT_CTRL_BLE_SECURITY_ENABLE
depends on BT_CTRL_RUN_IN_FLASH_ONLY && BT_CONTROLLER_ONLY
bool "Enable BLE security feature"
default y

View File

@ -115,9 +115,12 @@ do{\
} while(0)
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
#define OSI_VERSION 0x00010008
#define OSI_VERSION 0x00010009
#define OSI_MAGIC_VALUE 0xFADEBEAD
#define BLE_PWR_HDL_INVL 0xFFFF
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA)
/* Types definition
************************************************************************
*/
@ -142,15 +145,24 @@ typedef struct {
typedef void (* osi_intr_handler)(void);
typedef struct {
int source; /*!< ISR source */
int flags; /*!< ISR alloc flag */
void (*fn)(void *); /*!< ISR function */
void *arg; /*!< ISR function args*/
intr_handle_t *handle; /*!< ISR handle */
esp_err_t ret;
} btdm_isr_alloc_t;
/* OSI function */
struct osi_funcs_t {
uint32_t _magic;
uint32_t _version;
void (*_interrupt_set)(int cpu_no, int intr_source, int interrupt_no, int interrpt_prio);
void (*_interrupt_clear)(int interrupt_source, int interrupt_no);
void (*_interrupt_handler_set)(int interrupt_no, intr_handler_t fn, void *arg);
void (*_interrupt_disable)(void);
void (*_interrupt_restore)(void);
int (* _interrupt_alloc)(int cpu_id, int source, intr_handler_t handler, void *arg, void **ret_handle);
int (* _interrupt_free)(void *handle);
void (*_interrupt_handler_set_rsv)(int interrupt_no, intr_handler_t fn, void *arg);
void (*_global_intr_disable)(void);
void (*_global_intr_restore)(void);
void (*_task_yield)(void);
void (*_task_yield_from_isr)(void);
void *(*_semphr_create)(uint32_t max, uint32_t init);
@ -195,8 +207,8 @@ struct osi_funcs_t {
uint32_t (* _coex_schm_interval_get)(void);
uint8_t (* _coex_schm_curr_period_get)(void);
void *(* _coex_schm_curr_phase_get)(void);
void (* _interrupt_on)(int intr_num);
void (* _interrupt_off)(int intr_num);
int (* _interrupt_enable)(void *handle);
int (* _interrupt_disable)(void *handle);
void (* _esp_hw_power_down)(void);
void (* _esp_hw_power_up)(void);
void (* _ets_backup_dma_copy)(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_rem);
@ -245,8 +257,8 @@ extern bool API_vhci_host_check_send_available(void);
extern void API_vhci_host_send_packet(uint8_t *data, uint16_t len);
extern int API_vhci_host_register_callback(const vhci_host_callback_t *callback);
/* TX power */
extern int ble_txpwr_set(int power_type, int power_level);
extern int ble_txpwr_get(int power_type);
extern int ble_txpwr_set(int power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(int power_type, uint16_t handle);
extern uint16_t l2c_ble_link_get_tx_buf_num(void);
extern void coex_pti_v2(void);
@ -277,11 +289,10 @@ extern uint32_t _bt_controller_data_end;
/* Local Function Declare
*********************************************************************
*/
static void interrupt_set_wrapper(int cpu_no, int intr_source, int intr_num, int intr_prio);
static void interrupt_clear_wrapper(int intr_source, int intr_num);
static void interrupt_handler_set_wrapper(int n, intr_handler_t fn, void *arg);
static void interrupt_disable(void);
static void interrupt_restore(void);
static int interrupt_alloc_wrapper(int cpu_id, int source, intr_handler_t handler, void *arg, void **ret_handle);
static int interrupt_free_wrapper(void *handle);
static void global_interrupt_disable(void);
static void global_interrupt_restore(void);
static void task_yield_from_isr(void);
static void *semphr_create_wrapper(uint32_t max, uint32_t init);
static void semphr_delete_wrapper(void *semphr);
@ -319,8 +330,8 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status);
static uint32_t coex_schm_interval_get_wrapper(void);
static uint8_t coex_schm_curr_period_get_wrapper(void);
static void * coex_schm_curr_phase_get_wrapper(void);
static void interrupt_on_wrapper(int intr_num);
static void interrupt_off_wrapper(int intr_num);
static int interrupt_enable_wrapper(void *handle);
static int interrupt_disable_wrapper(void *handle);
static void btdm_hw_mac_power_up_wrapper(void);
static void btdm_hw_mac_power_down_wrapper(void);
static void btdm_backup_dma_copy_wrapper(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
@ -341,11 +352,11 @@ static void bt_controller_deinit_internal(void);
static const struct osi_funcs_t osi_funcs_ro = {
._magic = OSI_MAGIC_VALUE,
._version = OSI_VERSION,
._interrupt_set = interrupt_set_wrapper,
._interrupt_clear = interrupt_clear_wrapper,
._interrupt_handler_set = interrupt_handler_set_wrapper,
._interrupt_disable = interrupt_disable,
._interrupt_restore = interrupt_restore,
._interrupt_alloc = interrupt_alloc_wrapper,
._interrupt_free = interrupt_free_wrapper,
._interrupt_handler_set_rsv = NULL,
._global_intr_disable = global_interrupt_disable,
._global_intr_restore = global_interrupt_restore,
._task_yield = vPortYield,
._task_yield_from_isr = task_yield_from_isr,
._semphr_create = semphr_create_wrapper,
@ -390,8 +401,8 @@ static const struct osi_funcs_t osi_funcs_ro = {
._coex_schm_interval_get = coex_schm_interval_get_wrapper,
._coex_schm_curr_period_get = coex_schm_curr_period_get_wrapper,
._coex_schm_curr_phase_get = coex_schm_curr_phase_get_wrapper,
._interrupt_on = interrupt_on_wrapper,
._interrupt_off = interrupt_off_wrapper,
._interrupt_enable = interrupt_enable_wrapper,
._interrupt_disable = interrupt_disable_wrapper,
._esp_hw_power_down = btdm_hw_mac_power_down_wrapper,
._esp_hw_power_up = btdm_hw_mac_power_up_wrapper,
._ets_backup_dma_copy = btdm_backup_dma_copy_wrapper,
@ -478,35 +489,48 @@ static inline void esp_bt_power_domain_off(void)
esp_wifi_bt_power_domain_off();
}
static void interrupt_set_wrapper(int cpu_no, int intr_source, int intr_num, int intr_prio)
static void btdm_intr_alloc(void *arg)
{
esp_rom_route_intr_matrix(cpu_no, intr_source, intr_num);
#if __riscv
esprv_int_set_priority(intr_num, intr_prio);
esprv_int_set_type(intr_num, 0);
btdm_isr_alloc_t *p = arg;
p->ret = esp_intr_alloc(p->source, p->flags, p->fn, p->arg, p->handle);
}
static int interrupt_alloc_wrapper(int cpu_id, int source, intr_handler_t handler, void *arg, void **ret_handle)
{
btdm_isr_alloc_t p;
p.source = source;
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
p.flags = ESP_INTR_FLAG_LEVEL3;
#else
p.flags = ESP_INTR_FLAG_LEVEL3 | ESP_INTR_FLAG_IRAM;
#endif
p.fn = handler;
p.arg = arg;
p.handle = (intr_handle_t *)ret_handle;
#if CONFIG_FREERTOS_UNICORE
btdm_intr_alloc(&p);
#else
esp_ipc_call_blocking(cpu_id, btdm_intr_alloc, &p);
#endif
return p.ret;
}
static void interrupt_clear_wrapper(int intr_source, int intr_num)
static int interrupt_free_wrapper(void *handle)
{
return esp_intr_free((intr_handle_t)handle);
}
static void interrupt_handler_set_wrapper(int n, intr_handler_t fn, void *arg)
static int interrupt_enable_wrapper(void *handle)
{
esp_cpu_intr_set_handler(n, fn, arg);
return esp_intr_enable((intr_handle_t)handle);
}
static void interrupt_on_wrapper(int intr_num)
static int interrupt_disable_wrapper(void *handle)
{
esp_cpu_intr_enable(1 << intr_num);
return esp_intr_disable((intr_handle_t)handle);
}
static void interrupt_off_wrapper(int intr_num)
{
esp_cpu_intr_disable(1<<intr_num);
}
static void IRAM_ATTR interrupt_disable(void)
static void IRAM_ATTR global_interrupt_disable(void)
{
if (xPortInIsrContext()) {
portENTER_CRITICAL_ISR(&global_int_mux);
@ -515,7 +539,7 @@ static void IRAM_ATTR interrupt_disable(void)
}
}
static void IRAM_ATTR interrupt_restore(void)
static void IRAM_ATTR global_interrupt_restore(void)
{
if (xPortInIsrContext()) {
portEXIT_CRITICAL_ISR(&global_int_mux);
@ -670,13 +694,27 @@ static bool IRAM_ATTR is_in_isr_wrapper(void)
static void *malloc_internal_wrapper(size_t size)
{
void *p = heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA);
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
if(p == NULL) {
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
}
return p;
}
void *malloc_ble_controller_mem(size_t size)
{
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
if(p == NULL) {
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
}
return p;
}
uint32_t get_ble_controller_free_heap_size(void)
{
return heap_caps_get_free_size(BLE_CONTROLLER_MALLOC_CAPS);
}
static int IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
{
int ret = esp_read_mac(mac, ESP_MAC_BT);
@ -747,7 +785,8 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
// 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);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
// recalculate clock drift when Bluetooth using main XTAL during light sleep
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
uncertainty = us_to_sleep * BTDM_RTC_SLOW_CLK_RC_DRIFT_PERCENT / 100;
}
@ -1391,6 +1430,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGI(BT_LOG_TAG, "BT controller compile version [%s]", btdm_controller_get_compile_version());
#if (CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
ESP_LOGI(BT_LOG_TAG,"Put all controller code in flash");
#endif
if ((err = btdm_low_power_mode_init(cfg)) != ESP_OK) {
ESP_LOGE(BT_LOG_TAG, "Low power module initialization failed");
goto error;
@ -1403,7 +1446,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
periph_module_enable(PERIPH_BT_MODULE);
periph_module_reset(PERIPH_BT_MODULE);
if (btdm_controller_init(cfg) != 0) {
err = btdm_controller_init(cfg);
if (err != 0) {
ESP_LOGE(BT_LOG_TAG, "%s %d\n",__func__,err);
err = ESP_ERR_NO_MEM;
goto error;
}
@ -1657,16 +1703,89 @@ esp_bt_controller_status_t esp_bt_controller_get_status(void)
return btdm_controller_status;
}
static int enh_power_type_get(esp_ble_power_type_t power_type)
{
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
return ESP_BLE_ENHANCED_PWR_TYPE_ADV;
case ESP_BLE_PWR_TYPE_SCAN:
return ESP_BLE_ENHANCED_PWR_TYPE_SCAN;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
case ESP_BLE_PWR_TYPE_CONN_HDL2:
case ESP_BLE_PWR_TYPE_CONN_HDL3:
case ESP_BLE_PWR_TYPE_CONN_HDL4:
case ESP_BLE_PWR_TYPE_CONN_HDL5:
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
return ESP_BLE_ENHANCED_PWR_TYPE_CONN;
case ESP_BLE_PWR_TYPE_DEFAULT:
return ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT;
default:
break;
}
return power_type;
}
/* extra functions */
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level)
{
esp_err_t stat = ESP_FAIL;
uint16_t handle = BLE_PWR_HDL_INVL;
int enh_pwr_type = enh_power_type_get(power_type);
if (power_type > ESP_BLE_PWR_TYPE_DEFAULT) {
return ESP_ERR_NOT_SUPPORTED;
}
if (enh_pwr_type == ESP_BLE_ENHANCED_PWR_TYPE_CONN) {
handle = power_type;
}
if (ble_txpwr_set(enh_pwr_type, handle, power_level) == 0) {
stat = ESP_OK;
}
return stat;
}
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
{
esp_power_level_t lvl;
uint16_t handle = BLE_PWR_HDL_INVL;
int enh_pwr_type = enh_power_type_get(power_type);
if (power_type > ESP_BLE_PWR_TYPE_DEFAULT) {
return ESP_PWR_LVL_INVALID;
}
if (enh_pwr_type == ESP_BLE_ENHANCED_PWR_TYPE_CONN) {
handle = power_type;
}
lvl = (esp_power_level_t)ble_txpwr_get(enh_pwr_type, handle);
return lvl;
}
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle,
esp_power_level_t power_level)
{
esp_err_t stat = ESP_FAIL;
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
case ESP_BLE_PWR_TYPE_DEFAULT:
if (ble_txpwr_set(power_type, power_level) == 0) {
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
if (ble_txpwr_set(power_type, BLE_PWR_HDL_INVL, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1678,33 +1797,26 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
return stat;
}
esp_power_level_t esp_ble_tx_power_get(esp_ble_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)
{
esp_power_level_t lvl;
int tx_level = 0;
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
lvl = (esp_power_level_t)ble_txpwr_get(power_type);
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
tx_level = ble_txpwr_get(power_type, BLE_PWR_HDL_INVL);
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
case ESP_BLE_PWR_TYPE_CONN_HDL2:
case ESP_BLE_PWR_TYPE_CONN_HDL3:
case ESP_BLE_PWR_TYPE_CONN_HDL4:
case ESP_BLE_PWR_TYPE_CONN_HDL5:
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
case ESP_BLE_PWR_TYPE_DEFAULT:
lvl = (esp_power_level_t)ble_txpwr_get(ESP_BLE_PWR_TYPE_DEFAULT);
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
tx_level = ble_txpwr_get(power_type, handle);
break;
default:
lvl = ESP_PWR_LVL_INVALID;
break;
return ESP_PWR_LVL_INVALID;
}
return lvl;
return (esp_power_level_t)tx_level;
}
esp_err_t esp_bt_sleep_enable (void)

View File

@ -2,15 +2,15 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "Select HCI interface"
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM
config BT_LE_HCI_INTERFACE_USE_RAM
bool "ram"
bool "VHCI"
help
Use RAM as HCI interface
config BT_LE_HCI_INTERFACE_USE_UART
bool "uart"
bool "UART(H4)"
help
Use UART as HCI interface
endchoice
@ -73,12 +73,26 @@ menu "HCI Config"
UART_PARITY_ODD
endchoice
config BT_LE_HCI_UART_TASK_STACK_SIZE
int "HCI uart task stack size"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 1000
config BT_LE_HCI_UART_RX_BUFFER_SIZE
int "The size of rx ring buffer memory"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 512
help
Set the size of uart task stack
The size of rx ring buffer memory
config BT_LE_HCI_UART_TX_BUFFER_SIZE
int "The size of tx ring buffer memory"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 256
help
The size of tx ring buffer memory
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
help
This configures stack size of hci transport task
endmenu
config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
@ -365,7 +379,6 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
bool "Override TinyCrypt with mbedTLS for crypto computations"
default y
depends on !BT_NIMBLE_ENABLED
select MBEDTLS_ECP_RESTARTABLE
select MBEDTLS_CMAC_C
help
Enable this option to choose mbedTLS instead of TinyCrypt for crypto

View File

@ -15,7 +15,9 @@
#include "sdkconfig.h"
#if CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port.h"
#endif // CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port_freertos.h"
#include "esp_private/esp_modem_clock.h"
@ -28,7 +30,7 @@
#endif // CONFIG_SW_COEXIST_ENABLE
#include "nimble/nimble_npl_os.h"
#include "nimble/ble_hci_trans.h"
#include "esp_hci_transport.h"
#include "os/endian.h"
#include "esp_bt.h"
@ -37,7 +39,6 @@
#include "esp_pm.h"
#include "esp_phy_init.h"
#include "esp_private/periph_ctrl.h"
#include "hci_uart.h"
#include "bt_osi_mem.h"
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
@ -48,10 +49,6 @@
#include "esp_private/sleep_modem.h"
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#ifdef CONFIG_BT_BLUEDROID_ENABLED
#include "hci/hci_hal.h"
#endif // CONFIG_BT_BLUEDROID_ENABLED
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -67,16 +64,11 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20221122
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
#ifdef CONFIG_BT_BLUEDROID_ENABLED
/* ACL_DATA_MBUF_LEADINGSPCAE: The leadingspace in user info header for ACL data */
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED
/* Types definition
************************************************************************
*/
@ -95,12 +87,6 @@ struct ext_funcs_t {
int (*_esp_intr_free)(void **ret_handle);
void *(* _malloc)(size_t size);
void (*_free)(void *p);
void (*_hal_uart_start_tx)(int);
int (*_hal_uart_init_cbs)(int, hci_uart_tx_char, hci_uart_tx_done, hci_uart_rx_char, void *);
int (*_hal_uart_config)(int, int32_t, uint8_t, uint8_t, uart_parity_t, uart_hw_flowcontrol_t);
int (*_hal_uart_close)(int);
void (*_hal_uart_blocking_tx)(int, uint8_t);
int (*_hal_uart_init)(int, void *);
int (* _task_create)(void *task_func, const char *name, uint32_t stack_depth, void *param,
uint32_t prio, void *task_handle, uint32_t core_id);
void (* _task_delete)(void *task_handle);
@ -121,7 +107,7 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
************************************************************************
*/
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_deinit_async(void);
@ -129,12 +115,12 @@ extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
extern void r_ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
extern int ble_controller_disable(void);
extern int r_ble_controller_deinit(void);
extern int r_ble_controller_enable(uint8_t mode);
extern int r_ble_controller_disable(void);
extern int esp_register_ext_funcs (struct ext_funcs_t *);
extern void esp_unregister_ext_funcs (void);
extern int esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int r_esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int esp_register_npl_funcs (struct npl_funcs_t *p_npl_func);
extern void esp_unregister_npl_funcs (void);
extern void npl_freertos_mempool_deinit(void);
@ -149,15 +135,17 @@ extern void os_msys_deinit(void);
extern const sleep_retention_entries_config_t *esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void esp_ble_change_rtc_freq(uint32_t freq);
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern int r_ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int r_ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int r_ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern char *ble_controller_get_compile_version(void);
extern int esp_ble_register_bb_funcs(void);
extern void esp_ble_unregister_bb_funcs(void);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _bt_controller_bss_start;
@ -175,16 +163,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status);
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth,
void *param, uint32_t prio, void *task_handle, uint32_t core_id);
static void task_delete_wrapper(void *task_handle);
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no);
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg);
static int hci_uart_config_wrapper(int uart_no, int32_t speed, uint8_t databits, uint8_t stopbits,
uart_parity_t parity, uart_hw_flowcontrol_t flow_ctl);
static int hci_uart_close_wrapper(int uart_no);
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data);
static int hci_uart_init_wrapper(int uart_no, void *cfg);
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in);
static int esp_intr_free_wrapper(void **ret_handle);
@ -202,7 +180,6 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
@ -211,8 +188,8 @@ const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (2500)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (500)
@ -232,14 +209,6 @@ struct ext_funcs_t ext_funcs_ro = {
._esp_intr_free = esp_intr_free_wrapper,
._malloc = bt_osi_mem_malloc_internal,
._free = bt_osi_mem_free,
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._hal_uart_start_tx = hci_uart_start_tx_wrapper,
._hal_uart_init_cbs = hci_uart_init_cbs_wrapper,
._hal_uart_config = hci_uart_config_wrapper,
._hal_uart_close = hci_uart_close_wrapper,
._hal_uart_blocking_tx = hci_uart_blocking_tx_wrapper,
._hal_uart_init = hci_uart_init_wrapper,
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._task_create = task_create_wrapper,
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
@ -284,75 +253,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
#endif // CONFIG_SW_COEXIST_ENABLE
}
#ifdef CONFIG_BT_BLUEDROID_ENABLED
bool esp_vhci_host_check_send_available(void)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return false;
}
return true;
}
static struct os_mbuf *ble_hs_mbuf_gen_pkt(uint16_t leading_space)
{
struct os_mbuf *om;
int rc;
om = os_msys_get_pkthdr(0, 0);
if (om == NULL) {
return NULL;
}
if (om->om_omp->omp_databuf_len < leading_space) {
rc = os_mbuf_free_chain(om);
assert(rc == 0);
return NULL;
}
om->om_data += leading_space;
return om;
}
struct os_mbuf *ble_hs_mbuf_acl_pkt(void)
{
return ble_hs_mbuf_gen_pkt(4 + 1);
}
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return;
}
if (*(data) == DATA_TYPE_COMMAND) {
struct ble_hci_cmd *cmd = NULL;
cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD);
assert(cmd);
memcpy((uint8_t *)cmd, data + 1, len - 1);
ble_hci_trans_hs_cmd_tx((uint8_t *)cmd);
}
if (*(data) == DATA_TYPE_ACL) {
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
assert(om);
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
ble_hci_trans_hs_acl_tx(om);
}
}
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return ESP_FAIL;
}
ble_hci_trans_cfg_hs(ble_hs_hci_rx_evt, NULL, ble_hs_rx_data, NULL);
return ESP_OK;
}
#endif // CONFIG_BT_BLUEDROID_ENABLED
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth,
void *param, uint32_t prio, void *task_handle, uint32_t core_id)
{
@ -384,56 +284,6 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
hci_uart_start_tx(uart_no);
}
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg)
{
int rc = -1;
rc = hci_uart_init_cbs(uart_no, tx_func, tx_done, rx_func, arg);
return rc;
}
static int hci_uart_config_wrapper(int port_num, int32_t baud_rate, uint8_t data_bits,
uint8_t stop_bits, uart_parity_t parity,
uart_hw_flowcontrol_t flow_ctl)
{
int rc = -1;
rc = hci_uart_config(port_num, baud_rate, data_bits, stop_bits, parity, flow_ctl);
return rc;
}
static int hci_uart_close_wrapper(int uart_no)
{
int rc = -1;
rc = hci_uart_close(uart_no);
return rc;
}
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data)
{
//This function is nowhere to use.
}
static int hci_uart_init_wrapper(int uart_no, void *cfg)
{
//This function is nowhere to use.
return 0;
}
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int ble_hci_unregistered_hook(void*, void*)
{
ESP_LOGD(NIMBLE_PORT_LOG_TAG,"%s ble hci rx_evt is not registered.",__func__);
return 0;
}
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in)
{
@ -483,6 +333,20 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
// }
}
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -528,7 +392,7 @@ static void sleep_modem_ble_mac_modem_state_deinit(void)
sleep_retention_entries_destroy(SLEEP_RETENTION_MODULE_BLE_MAC);
}
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
void IRAM_ATTR sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
esp_ble_set_wakeup_overhead(overhead);
}
@ -549,16 +413,19 @@ esp_err_t controller_sleep_init(void)
BLE_RTC_DELAY_US_MODEM_SLEEP);
#endif /* FREERTOS_USE_TICKLESS_IDLE */
#endif // CONFIG_BT_LE_SLEEP_ENABLE
#ifdef CONFIG_PM_ENABLE
rc = esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "bt", &s_pm_lock);
if (rc != ESP_OK) {
goto error;
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#endif // CONFIG_PM_ENABLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
/* Create a new regdma link for BLE related register restoration */
rc = sleep_modem_ble_mac_modem_state_init(1);
assert(rc == 0);
rc = sleep_modem_ble_mac_modem_state_init(0);
if (rc != ESP_OK) {
goto error;
}
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
@ -571,19 +438,21 @@ esp_err_t controller_sleep_init(void)
sleep_modem_register_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
sleep_modem_mac_bb_power_up_prepare);
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
return rc;
#ifdef CONFIG_PM_ENABLE
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#endif // CONFIG_PM_ENABLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
sleep_modem_unregister_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
sleep_modem_mac_bb_power_up_prepare);
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#ifdef CONFIG_PM_ENABLE
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
@ -596,7 +465,7 @@ error:
void controller_sleep_deinit(void)
{
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
sleep_modem_unregister_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
sleep_modem_mac_bb_power_up_prepare);
@ -684,12 +553,52 @@ void ble_controller_scan_duplicate_config(void)
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_XTAL32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC32K;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
uint8_t mac[6];
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
uint32_t slow_clk_freq = 0;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
@ -723,7 +632,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_mem;
}
ble_get_npl_element_info(cfg, &npl_info);
r_ble_get_npl_element_info(cfg, &npl_info);
npl_freertos_set_controller_npl_info(&npl_info);
if (npl_freertos_mempool_init() != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl mempool init failed");
@ -741,33 +650,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
modem_clock_module_enable(PERIPH_BT_MODULE);
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
/* Select slow clock source for BT momdule */
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC_SLOW);
slow_clk_freq = 30000;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_XTAL32K);
slow_clk_freq = 32768;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC32K);
slow_clk_freq = 32000;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_EXT32K);
slow_clk_freq = 32000;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
ble_rtc_clk_init(cfg);
esp_phy_modem_init();
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
@ -780,13 +663,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
coex_init();
#endif // CONFIG_SW_COEXIST_ENABLE
ret = ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto modem_deint;
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
@ -804,11 +680,22 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto controller_init_err;
goto modem_deint;
}
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
ret = esp_ble_register_bb_funcs();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "esp_ble_register_bb_funcs failed %d", ret);
goto modem_deint;
}
esp_ble_change_rtc_freq(slow_clk_freq);
ret = r_ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "r_ble_controller_init failed %d", ret);
goto modem_deint;
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
ble_controller_scan_duplicate_config();
@ -824,24 +711,35 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
esp_ble_ll_set_public_addr(mac);
r_esp_ble_ll_set_public_addr(mac);
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hci_unregistered_hook,NULL,
(ble_hci_trans_rx_acl_fn *)ble_hci_unregistered_hook,NULL);
return ESP_OK;
#if CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
hci_transport_mode = HCI_TRANSPORT_VHCI;
#elif CONFIG_BT_LE_HCI_INTERFACE_USE_UART
hci_transport_mode = HCI_TRANSPORT_UART_NO_DMA;
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
ret = hci_transport_init(hci_transport_mode);
if (ret) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "hci transport init failed %d", ret);
goto free_controller;
}
return ESP_OK;
free_controller:
hci_transport_deinit();
controller_sleep_deinit();
os_msys_deinit();
r_ble_controller_deinit();
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
controller_init_err:
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
os_msys_deinit();
ble_controller_deinit();
modem_deint:
esp_phy_modem_deinit();
// modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
@ -864,6 +762,7 @@ esp_err_t esp_bt_controller_deinit(void)
return ESP_FAIL;
}
hci_transport_deinit();
controller_sleep_deinit();
os_msys_deinit();
@ -872,10 +771,11 @@ esp_err_t esp_bt_controller_deinit(void)
// modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
#if CONFIG_BT_NIMBLE_ENABLED
/* De-initialize default event queue */
@ -920,7 +820,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
coex_enable();
#endif // CONFIG_SW_COEXIST_ENABLE
if (ble_controller_enable(mode) != 0) {
if (r_ble_controller_enable(mode) != 0) {
ret = ESP_FAIL;
goto error;
}
@ -948,7 +848,7 @@ esp_err_t esp_bt_controller_disable(void)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (ble_controller_disable() != 0) {
if (r_ble_controller_disable() != 0) {
return ESP_FAIL;
}
#if CONFIG_SW_COEXIST_ENABLE
@ -1082,7 +982,7 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
case ESP_BLE_PWR_TYPE_DEFAULT:
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1095,7 +995,7 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1115,13 +1015,13 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
if (r_ble_txpwr_set(power_type, handle, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1141,7 +1041,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
case ESP_BLE_PWR_TYPE_DEFAULT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
@ -1152,7 +1052,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
break;
default:
return ESP_PWR_LVL_INVALID;
@ -1174,11 +1074,11 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
tx_level = ble_txpwr_get(power_type, handle);
tx_level = r_ble_txpwr_get(power_type, handle);
break;
default:
return ESP_PWR_LVL_INVALID;

View File

@ -129,6 +129,21 @@ extern "C" {
#else
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
#endif
#if defined (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#if DEFAULT_BT_LE_HCI_UART_FLOW_CTRL
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (CONFIG_BT_LE_HCI_UART_CTS_PIN)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (CONFIG_BT_LE_HCI_UART_RTS_PIN)
#else
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#else
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#endif
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
@ -169,8 +184,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (UART_DATA_8_BITS)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (UART_STOP_BITS_1)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (CONFIG_BT_LE_HCI_UART_TASK_STACK_SIZE)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#else
#define DEFAULT_BT_LE_HCI_UART_TX_PIN (0)
#define DEFAULT_BT_LE_HCI_UART_RX_PIN (0)
@ -179,8 +192,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (0)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#endif
/* Unchanged configuration */

View File

@ -2,19 +2,37 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "Select HCI interface"
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM
config BT_LE_HCI_INTERFACE_USE_RAM
bool "ram"
bool "VHCI"
help
Use RAM as HCI interface
config BT_LE_HCI_INTERFACE_USE_UART
bool "uart"
bool "UART(H4)"
help
Use UART as HCI interface
endchoice
choice BT_LE_UART_HCI_MODE_CHOICE
prompt "UART HCI mode"
depends on BT_LE_HCI_INTERFACE_USE_UART
default BT_LE_UART_HCI_NO_DMA_MODE
help
Specify UART HCI mode: DMA or No DMA
config BT_LE_UART_HCI_DMA_MODE
bool "UHCI(UART with DMA)(EXPERIMENTAL)"
help
UART HCI Mode with DMA functionality.
config BT_LE_UART_HCI_NO_DMA_MODE
bool "UART(NO DMA)"
help
UART HCI Mode without DMA functionality.
endchoice
config BT_LE_HCI_UART_PORT
int "HCI UART port"
depends on BT_LE_HCI_INTERFACE_USE_UART
@ -73,12 +91,40 @@ menu "HCI Config"
UART_PARITY_ODD
endchoice
config BT_LE_HCI_UART_TASK_STACK_SIZE
int "HCI uart task stack size"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 1000
config BT_LE_HCI_UART_RX_BUFFER_SIZE
int "The size of rx ring buffer memory"
depends on BT_LE_UART_HCI_NO_DMA_MODE
default 512
help
Set the size of uart task stack
The size of rx ring buffer memory
config BT_LE_HCI_UART_TX_BUFFER_SIZE
int "The size of tx ring buffer memory"
depends on BT_LE_UART_HCI_NO_DMA_MODE
default 256
help
The size of tx ring buffer memory
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
help
This configures stack size of hci transport task
config BT_LE_HCI_TRANS_RX_MEM_NUM
int "The amount of rx memory received at the same time"
depends on BT_LE_UART_HCI_DMA_MODE
default 3
help
The amount of rx memory received at the same time
config BT_LE_HCI_LLDESCS_POOL_NUM
int "The amount of lldecs memory for driver dma mode"
depends on BT_LE_UART_HCI_DMA_MODE
default 20
help
The amount of lldecs memory for driver dma mode
endmenu
config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
@ -296,6 +342,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
@ -365,7 +429,6 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
bool "Override TinyCrypt with mbedTLS for crypto computations"
default y
depends on !BT_NIMBLE_ENABLED
select MBEDTLS_ECP_RESTARTABLE
select MBEDTLS_CMAC_C
help
Enable this option to choose mbedTLS instead of TinyCrypt for crypto
@ -576,3 +639,53 @@ config BT_LE_CCA_RSSI_THRESH
default 20
help
Power threshold of CCA in unit of -1 dBm.
choice BT_LE_DFT_TX_POWER_LEVEL_DBM
prompt "BLE default Tx power level(dBm)"
default BT_LE_DFT_TX_POWER_LEVEL_P9
help
Specify default Tx power level(dBm).
config BT_LE_DFT_TX_POWER_LEVEL_N15
bool "-15dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N12
bool "-12dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N9
bool "-9dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N6
bool "-6dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N3
bool "-3dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N0
bool "0dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P3
bool "+3dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P6
bool "+6dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P9
bool "+9dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P12
bool "+12dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P15
bool "+15dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P20
bool "+20dBm"
endchoice
config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
int
default -15 if BT_LE_DFT_TX_POWER_LEVEL_N15
default -12 if BT_LE_DFT_TX_POWER_LEVEL_N12
default -9 if BT_LE_DFT_TX_POWER_LEVEL_N9
default -6 if BT_LE_DFT_TX_POWER_LEVEL_N6
default -3 if BT_LE_DFT_TX_POWER_LEVEL_N3
default 0 if BT_LE_DFT_TX_POWER_LEVEL_N0
default 3 if BT_LE_DFT_TX_POWER_LEVEL_P3
default 6 if BT_LE_DFT_TX_POWER_LEVEL_P6
default 9 if BT_LE_DFT_TX_POWER_LEVEL_P9
default 12 if BT_LE_DFT_TX_POWER_LEVEL_P12
default 15 if BT_LE_DFT_TX_POWER_LEVEL_P15
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
default 0

View File

@ -15,7 +15,9 @@
#include "sdkconfig.h"
#if CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port.h"
#endif // CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port_freertos.h"
#include "esp_private/esp_modem_clock.h"
@ -28,7 +30,7 @@
#endif // CONFIG_ESP_COEX_ENABLED
#include "nimble/nimble_npl_os.h"
#include "nimble/ble_hci_trans.h"
#include "esp_hci_transport.h"
#include "os/endian.h"
#include "esp_bt.h"
@ -39,7 +41,6 @@
#include "esp_phy_init.h"
#endif
#include "esp_private/periph_ctrl.h"
#include "hci_uart.h"
#include "bt_osi_mem.h"
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
@ -50,10 +51,6 @@
#include "esp_private/sleep_modem.h"
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#ifdef CONFIG_BT_BLUEDROID_ENABLED
#include "hci/hci_hal.h"
#endif // CONFIG_BT_BLUEDROID_ENABLED
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -69,16 +66,11 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20221122
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
#ifdef CONFIG_BT_BLUEDROID_ENABLED
/* ACL_DATA_MBUF_LEADINGSPCAE: The leadingspace in user info header for ACL data */
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED
/* Types definition
************************************************************************
*/
@ -97,12 +89,6 @@ struct ext_funcs_t {
int (*_esp_intr_free)(void **ret_handle);
void *(* _malloc)(size_t size);
void (*_free)(void *p);
void (*_hal_uart_start_tx)(int);
int (*_hal_uart_init_cbs)(int, hci_uart_tx_char, hci_uart_tx_done, hci_uart_rx_char, void *);
int (*_hal_uart_config)(int, int32_t, uint8_t, uint8_t, uart_parity_t, uart_hw_flowcontrol_t);
int (*_hal_uart_close)(int);
void (*_hal_uart_blocking_tx)(int, uint8_t);
int (*_hal_uart_init)(int, void *);
int (* _task_create)(void *task_func, const char *name, uint32_t stack_depth, void *param,
uint32_t prio, void *task_handle, uint32_t core_id);
void (* _task_delete)(void *task_handle);
@ -123,7 +109,7 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
************************************************************************
*/
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_deinit_async(void);
@ -131,12 +117,12 @@ extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
extern void r_ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
extern int ble_controller_disable(void);
extern int r_ble_controller_deinit(void);
extern int r_ble_controller_enable(uint8_t mode);
extern int r_ble_controller_disable(void);
extern int esp_register_ext_funcs (struct ext_funcs_t *);
extern void esp_unregister_ext_funcs (void);
extern int esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int r_esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int esp_register_npl_funcs (struct npl_funcs_t *p_npl_func);
extern void esp_unregister_npl_funcs (void);
extern void npl_freertos_mempool_deinit(void);
@ -148,18 +134,20 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern const sleep_retention_entries_config_t *esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void esp_ble_change_rtc_freq(uint32_t freq);
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern int r_ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int r_ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int r_ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern char *ble_controller_get_compile_version(void);
extern int esp_ble_register_bb_funcs(void);
extern void esp_ble_unregister_bb_funcs(void);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _bt_controller_bss_start;
@ -177,16 +165,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status);
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth,
void *param, uint32_t prio, void *task_handle, uint32_t core_id);
static void task_delete_wrapper(void *task_handle);
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no);
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg);
static int hci_uart_config_wrapper(int uart_no, int32_t speed, uint8_t databits, uint8_t stopbits,
uart_parity_t parity, uart_hw_flowcontrol_t flow_ctl);
static int hci_uart_close_wrapper(int uart_no);
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data);
static int hci_uart_init_wrapper(int uart_no, void *cfg);
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in);
static int esp_intr_free_wrapper(void **ret_handle);
@ -198,23 +176,223 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
};
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
default:
assert(0);
}
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
}
return ret;
}
void esp_bt_ontroller_log_deinit(void)
{
r_ble_log_deinit_async();
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
r_ble_log_async_output_dump_all(true);
esp_bt_ontroller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_reconfigure_wdts(5000);
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_reconfigure_wdts(5000);
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (2500)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (500)
@ -234,14 +412,6 @@ struct ext_funcs_t ext_funcs_ro = {
._esp_intr_free = esp_intr_free_wrapper,
._malloc = bt_osi_mem_malloc_internal,
._free = bt_osi_mem_free,
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._hal_uart_start_tx = hci_uart_start_tx_wrapper,
._hal_uart_init_cbs = hci_uart_init_cbs_wrapper,
._hal_uart_config = hci_uart_config_wrapper,
._hal_uart_close = hci_uart_close_wrapper,
._hal_uart_blocking_tx = hci_uart_blocking_tx_wrapper,
._hal_uart_init = hci_uart_init_wrapper,
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._task_create = task_create_wrapper,
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
@ -286,75 +456,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
#endif // CONFIG_SW_COEXIST_ENABLE
}
#ifdef CONFIG_BT_BLUEDROID_ENABLED
bool esp_vhci_host_check_send_available(void)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return false;
}
return true;
}
static struct os_mbuf *ble_hs_mbuf_gen_pkt(uint16_t leading_space)
{
struct os_mbuf *om;
int rc;
om = os_msys_get_pkthdr(0, 0);
if (om == NULL) {
return NULL;
}
if (om->om_omp->omp_databuf_len < leading_space) {
rc = os_mbuf_free_chain(om);
assert(rc == 0);
return NULL;
}
om->om_data += leading_space;
return om;
}
struct os_mbuf *ble_hs_mbuf_acl_pkt(void)
{
return ble_hs_mbuf_gen_pkt(4 + 1);
}
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return;
}
if (*(data) == DATA_TYPE_COMMAND) {
struct ble_hci_cmd *cmd = NULL;
cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD);
assert(cmd);
memcpy((uint8_t *)cmd, data + 1, len - 1);
ble_hci_trans_hs_cmd_tx((uint8_t *)cmd);
}
if (*(data) == DATA_TYPE_ACL) {
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
assert(om);
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
ble_hci_trans_hs_acl_tx(om);
}
}
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return ESP_FAIL;
}
ble_hci_trans_cfg_hs(ble_hs_hci_rx_evt, NULL, ble_hs_rx_data, NULL);
return ESP_OK;
}
#endif // CONFIG_BT_BLUEDROID_ENABLED
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth,
void *param, uint32_t prio, void *task_handle, uint32_t core_id)
{
@ -386,56 +487,6 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
hci_uart_start_tx(uart_no);
}
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg)
{
int rc = -1;
rc = hci_uart_init_cbs(uart_no, tx_func, tx_done, rx_func, arg);
return rc;
}
static int hci_uart_config_wrapper(int port_num, int32_t baud_rate, uint8_t data_bits,
uint8_t stop_bits, uart_parity_t parity,
uart_hw_flowcontrol_t flow_ctl)
{
int rc = -1;
rc = hci_uart_config(port_num, baud_rate, data_bits, stop_bits, parity, flow_ctl);
return rc;
}
static int hci_uart_close_wrapper(int uart_no)
{
int rc = -1;
rc = hci_uart_close(uart_no);
return rc;
}
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data)
{
//This function is nowhere to use.
}
static int hci_uart_init_wrapper(int uart_no, void *cfg)
{
//This function is nowhere to use.
return 0;
}
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int ble_hci_unregistered_hook(void*, void*)
{
ESP_LOGD(NIMBLE_PORT_LOG_TAG,"%s ble hci rx_evt is not registered.",__func__);
return 0;
}
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in)
{
@ -485,6 +536,20 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
}
}
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -518,7 +583,7 @@ static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
{
uint8_t size;
int extra = *(int *)arg;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
sleep_retention_entries_config_t *ble_mac_modem_config = r_esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
@ -549,9 +614,9 @@ static void sleep_modem_ble_mac_modem_state_deinit(void)
}
}
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
void IRAM_ATTR sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
esp_ble_set_wakeup_overhead(overhead);
r_esp_ble_set_wakeup_overhead(overhead);
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
@ -576,10 +641,16 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#endif // CONFIG_PM_ENABLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && !CONFIG_MAC_BB_PD
#error "CONFIG_MAC_BB_PD required for BLE light sleep to run properly"
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && !CONFIG_MAC_BB_PD
/* Create a new regdma link for BLE related register restoration */
rc = sleep_modem_ble_mac_modem_state_init(1);
assert(rc == 0);
if (rc != ESP_OK) {
goto error;
}
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
@ -592,19 +663,21 @@ esp_err_t controller_sleep_init(void)
sleep_modem_register_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
sleep_modem_mac_bb_power_up_prepare);
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
return rc;
#ifdef CONFIG_PM_ENABLE
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#endif // CONFIG_PM_ENABLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
sleep_modem_unregister_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
sleep_modem_mac_bb_power_up_prepare);
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#ifdef CONFIG_PM_ENABLE
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
@ -617,7 +690,7 @@ error:
void controller_sleep_deinit(void)
{
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if SOC_PM_RETENTION_HAS_CLOCK_BUG && CONFIG_MAC_BB_PD
sleep_modem_unregister_mac_bb_module_prepare_callback(sleep_modem_mac_bb_power_down_prepare,
sleep_modem_mac_bb_power_up_prepare);
@ -626,7 +699,7 @@ void controller_sleep_deinit(void)
esp_sleep_disable_bt_wakeup();
sleep_modem_ble_mac_modem_state_deinit();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#ifdef CONFIG_PM_ENABLE
/* lock should be released first */
esp_pm_lock_delete(s_pm_lock);
@ -705,15 +778,54 @@ void ble_controller_scan_duplicate_config(void)
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_XTAL32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC32K;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
uint8_t mac[6];
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
uint32_t slow_clk_freq = 0;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_ERR_INVALID_STATE;
@ -744,7 +856,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_mem;
}
ble_get_npl_element_info(cfg, &npl_info);
r_ble_get_npl_element_info(cfg, &npl_info);
npl_freertos_set_controller_npl_info(&npl_info);
if (npl_freertos_mempool_init() != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl mempool init failed");
@ -762,33 +874,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
modem_clock_module_enable(PERIPH_BT_MODULE);
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
/* Select slow clock source for BT momdule */
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC_SLOW);
slow_clk_freq = 30000;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_XTAL32K);
slow_clk_freq = 32768;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC32K);
slow_clk_freq = 32000;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_EXT32K);
slow_clk_freq = 32000;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
ble_rtc_clk_init(cfg);
esp_phy_modem_init();
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
@ -802,33 +888,25 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = r_ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = r_ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init(log_output_mode);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
}
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
ret = ble_controller_init(cfg);
ret = esp_ble_register_bb_funcs();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "esp_ble_register_bb_funcs failed %d", ret);
goto modem_deint;
}
ret = r_ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "r_ble_controller_init failed %d", ret);
goto modem_deint;
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
@ -843,23 +921,39 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
esp_ble_ll_set_public_addr(mac);
r_esp_ble_ll_set_public_addr(mac);
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hci_unregistered_hook,NULL,
(ble_hci_trans_rx_acl_fn *)ble_hci_unregistered_hook,NULL);
return ESP_OK;
#if CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
hci_transport_mode = HCI_TRANSPORT_VHCI;
#elif CONFIG_BT_LE_HCI_INTERFACE_USE_UART
hci_transport_mode = HCI_TRANSPORT_UART_NO_DMA;
#if CONFIG_BT_LE_UART_HCI_DMA_MODE
hci_transport_mode = HCI_TRANSPORT_UART_UHCI;
#endif // CONFIG_BT_LE_UART_HCI_DMA_MODE
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
ret = hci_transport_init(hci_transport_mode);
if (ret) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "hci transport init failed %d", ret);
goto free_controller;
}
return ESP_OK;
free_controller:
hci_transport_deinit();
controller_sleep_deinit();
os_msys_deinit();
ble_controller_deinit();
r_ble_controller_deinit();
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_phy_modem_deinit();
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
@ -883,6 +977,7 @@ esp_err_t esp_bt_controller_deinit(void)
return ESP_FAIL;
}
hci_transport_deinit();
controller_sleep_deinit();
os_msys_deinit();
@ -891,9 +986,10 @@ esp_err_t esp_bt_controller_deinit(void)
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
ble_controller_deinit();
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@ -939,7 +1035,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
coex_enable();
#endif // CONFIG_SW_COEXIST_ENABLE
if (ble_controller_enable(mode) != 0) {
if (r_ble_controller_enable(mode) != 0) {
ret = ESP_FAIL;
goto error;
}
@ -967,7 +1063,7 @@ esp_err_t esp_bt_controller_disable(void)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (ble_controller_disable() != 0) {
if (r_ble_controller_disable() != 0) {
return ESP_FAIL;
}
#if CONFIG_SW_COEXIST_ENABLE
@ -1101,7 +1197,7 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
case ESP_BLE_PWR_TYPE_DEFAULT:
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1114,7 +1210,7 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1134,13 +1230,13 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
if (r_ble_txpwr_set(power_type, handle, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1160,7 +1256,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
case ESP_BLE_PWR_TYPE_DEFAULT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
@ -1171,7 +1267,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
break;
default:
return ESP_PWR_LVL_INVALID;
@ -1193,11 +1289,11 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
tx_level = ble_txpwr_get(power_type, handle);
tx_level = r_ble_txpwr_get(power_type, handle);
break;
default:
return ESP_PWR_LVL_INVALID;
@ -1213,24 +1309,40 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(1000);
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -129,6 +129,21 @@ extern "C" {
#else
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
#endif
#if defined (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#if DEFAULT_BT_LE_HCI_UART_FLOW_CTRL
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (CONFIG_BT_LE_HCI_UART_CTS_PIN)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (CONFIG_BT_LE_HCI_UART_RTS_PIN)
#else
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#else
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#endif
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
@ -169,8 +184,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (UART_DATA_8_BITS)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (UART_STOP_BITS_1)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (CONFIG_BT_LE_HCI_UART_TASK_STACK_SIZE)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#else
#define DEFAULT_BT_LE_HCI_UART_TX_PIN (0)
#define DEFAULT_BT_LE_HCI_UART_RX_PIN (0)
@ -179,8 +192,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (0)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#endif
/* Unchanged configuration */
@ -205,7 +216,7 @@ extern "C" {
#define RTC_FREQ_N (32768) /* in Hz */
#define BLE_LL_TX_PWR_DBM_N (9)
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
#define RUN_BQB_TEST (0)

View File

@ -2,19 +2,37 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "Select HCI interface"
prompt "HCI mode"
default BT_LE_HCI_INTERFACE_USE_RAM
config BT_LE_HCI_INTERFACE_USE_RAM
bool "ram"
bool "VHCI"
help
Use RAM as HCI interface
config BT_LE_HCI_INTERFACE_USE_UART
bool "uart"
bool "UART(H4)"
help
Use UART as HCI interface
endchoice
choice BT_LE_UART_HCI_MODE_CHOICE
prompt "UART HCI mode"
depends on BT_LE_HCI_INTERFACE_USE_UART
default BT_LE_UART_HCI_NO_DMA_MODE
help
Specify UART HCI mode: DMA or No DMA
config BT_LE_UART_HCI_DMA_MODE
bool "UHCI(UART with DMA)(EXPERIMENTAL)"
help
UART HCI Mode with DMA functionality.
config BT_LE_UART_HCI_NO_DMA_MODE
bool "UART(NO DMA)"
help
UART HCI Mode without DMA functionality.
endchoice
config BT_LE_HCI_UART_PORT
int "HCI UART port"
depends on BT_LE_HCI_INTERFACE_USE_UART
@ -73,12 +91,40 @@ menu "HCI Config"
UART_PARITY_ODD
endchoice
config BT_LE_HCI_UART_TASK_STACK_SIZE
int "HCI uart task stack size"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 1000
config BT_LE_HCI_UART_RX_BUFFER_SIZE
int "The size of rx ring buffer memory"
depends on BT_LE_UART_HCI_NO_DMA_MODE
default 512
help
Set the size of uart task stack
The size of rx ring buffer memory
config BT_LE_HCI_UART_TX_BUFFER_SIZE
int "The size of tx ring buffer memory"
depends on BT_LE_UART_HCI_NO_DMA_MODE
default 256
help
The size of tx ring buffer memory
config BT_LE_HCI_TRANS_TASK_STACK_SIZE
int "HCI transport task stack size"
depends on !BT_LE_HCI_INTERFACE_USE_RAM
default 1024
help
This configures stack size of hci transport task
config BT_LE_HCI_TRANS_RX_MEM_NUM
int "The amount of rx memory received at the same time"
depends on BT_LE_UART_HCI_DMA_MODE
default 3
help
The amount of rx memory received at the same time
config BT_LE_HCI_LLDESCS_POOL_NUM
int "The amount of lldecs memory for driver dma mode"
depends on BT_LE_UART_HCI_DMA_MODE
default 20
help
The amount of lldecs memory for driver dma mode
endmenu
config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
@ -287,6 +333,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED
@ -356,7 +420,6 @@ config BT_LE_CRYPTO_STACK_MBEDTLS
bool "Override TinyCrypt with mbedTLS for crypto computations"
default y
depends on !BT_NIMBLE_ENABLED
select MBEDTLS_ECP_RESTARTABLE
select MBEDTLS_CMAC_C
help
Enable this option to choose mbedTLS instead of TinyCrypt for crypto
@ -568,3 +631,62 @@ config BT_LE_CCA_RSSI_THRESH
default 20
help
Power threshold of CCA in unit of -1 dBm.
choice BT_LE_DFT_TX_POWER_LEVEL_DBM
prompt "BLE default Tx power level(dBm)"
default BT_LE_DFT_TX_POWER_LEVEL_P9
help
Specify default Tx power level(dBm).
config BT_LE_DFT_TX_POWER_LEVEL_N24
bool "-24dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N21
bool "-21dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N18
bool "-18dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N15
bool "-15dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N12
bool "-12dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N9
bool "-9dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N6
bool "-6dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N3
bool "-3dBm"
config BT_LE_DFT_TX_POWER_LEVEL_N0
bool "0dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P3
bool "+3dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P6
bool "+6dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P9
bool "+9dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P12
bool "+12dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P15
bool "+15dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_LE_DFT_TX_POWER_LEVEL_P20
bool "+20dBm"
endchoice
config BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF
int
default -24 if BT_LE_DFT_TX_POWER_LEVEL_N24
default -21 if BT_LE_DFT_TX_POWER_LEVEL_N21
default -18 if BT_LE_DFT_TX_POWER_LEVEL_N18
default -15 if BT_LE_DFT_TX_POWER_LEVEL_N15
default -12 if BT_LE_DFT_TX_POWER_LEVEL_N12
default -9 if BT_LE_DFT_TX_POWER_LEVEL_N9
default -6 if BT_LE_DFT_TX_POWER_LEVEL_N6
default -3 if BT_LE_DFT_TX_POWER_LEVEL_N3
default 0 if BT_LE_DFT_TX_POWER_LEVEL_N0
default 3 if BT_LE_DFT_TX_POWER_LEVEL_P3
default 6 if BT_LE_DFT_TX_POWER_LEVEL_P6
default 9 if BT_LE_DFT_TX_POWER_LEVEL_P9
default 12 if BT_LE_DFT_TX_POWER_LEVEL_P12
default 15 if BT_LE_DFT_TX_POWER_LEVEL_P15
default 18 if BT_LE_DFT_TX_POWER_LEVEL_P18
default 20 if BT_LE_DFT_TX_POWER_LEVEL_P20
default 0

View File

@ -15,7 +15,9 @@
#include "sdkconfig.h"
#if CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port.h"
#endif // CONFIG_BT_NIMBLE_ENABLED
#include "nimble/nimble_port_freertos.h"
#include "esp_private/esp_modem_clock.h"
@ -28,7 +30,7 @@
#endif // CONFIG_ESP_COEX_ENABLED
#include "nimble/nimble_npl_os.h"
#include "nimble/ble_hci_trans.h"
#include "esp_hci_transport.h"
#include "os/endian.h"
#include "esp_bt.h"
@ -37,7 +39,6 @@
#include "esp_pm.h"
#include "esp_phy_init.h"
#include "esp_private/periph_ctrl.h"
#include "hci_uart.h"
#include "bt_osi_mem.h"
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
@ -45,10 +46,6 @@
#include "esp_private/sleep_retention.h"
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#ifdef CONFIG_BT_BLUEDROID_ENABLED
#include "hci/hci_hal.h"
#endif // CONFIG_BT_BLUEDROID_ENABLED
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -59,19 +56,14 @@
************************************************************************
*/
#define NIMBLE_PORT_LOG_TAG "BLE_INIT"
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20221122
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
#ifdef CONFIG_BT_BLUEDROID_ENABLED
/* ACL_DATA_MBUF_LEADINGSPCAE: The leadingspace in user info header for ACL data */
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED
/* Types definition
************************************************************************
*/
@ -90,12 +82,6 @@ struct ext_funcs_t {
int (*_esp_intr_free)(void **ret_handle);
void *(* _malloc)(size_t size);
void (*_free)(void *p);
void (*_hal_uart_start_tx)(int);
int (*_hal_uart_init_cbs)(int, hci_uart_tx_char, hci_uart_tx_done, hci_uart_rx_char, void *);
int (*_hal_uart_config)(int, int32_t, uint8_t, uint8_t, uart_parity_t, uart_hw_flowcontrol_t);
int (*_hal_uart_close)(int);
void (*_hal_uart_blocking_tx)(int, uint8_t);
int (*_hal_uart_init)(int, void *);
int (* _task_create)(void *task_func, const char *name, uint32_t stack_depth, void *param,
uint32_t prio, void *task_handle, uint32_t core_id);
void (* _task_delete)(void *task_handle);
@ -115,7 +101,7 @@ typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
************************************************************************
*/
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int r_ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int r_ble_log_deinit_async(void);
@ -123,35 +109,40 @@ extern void r_ble_log_async_select_dump_buffers(uint8_t buffers);
extern void r_ble_log_async_output_dump_all(bool output);
extern void esp_panic_handler_reconfigure_wdts(uint32_t timeout_ms);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_controller_deinit(void);
extern int ble_controller_enable(uint8_t mode);
extern int ble_controller_disable(void);
extern int r_ble_controller_deinit(void);
extern int r_ble_controller_enable(uint8_t mode);
extern int r_ble_controller_disable(void);
extern int esp_register_ext_funcs (struct ext_funcs_t *);
extern void esp_unregister_ext_funcs (void);
extern int esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int r_esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int esp_register_npl_funcs (struct npl_funcs_t *p_npl_func);
extern void esp_unregister_npl_funcs (void);
extern void npl_freertos_mempool_deinit(void);
extern uint32_t r_os_cputime_get32(void);
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern const sleep_retention_entries_config_t *esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void esp_ble_change_rtc_freq(uint32_t freq);
extern void r_ble_lll_rfmgmt_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg,
void *w_arg, uint32_t us_to_enabled);
extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#if CONFIG_PM_ENABLE
extern void r_esp_ble_stop_wakeup_timing(void);
#endif // CONFIG_PM_ENABLE
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern int r_ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int r_ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int r_ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern char *ble_controller_get_compile_version(void);
extern int esp_ble_register_bb_funcs(void);
extern void esp_ble_unregister_bb_funcs(void);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _bt_controller_bss_start;
@ -169,16 +160,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status);
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth,
void *param, uint32_t prio, void *task_handle, uint32_t core_id);
static void task_delete_wrapper(void *task_handle);
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no);
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg);
static int hci_uart_config_wrapper(int uart_no, int32_t speed, uint8_t databits, uint8_t stopbits,
uart_parity_t parity, uart_hw_flowcontrol_t flow_ctl);
static int hci_uart_close_wrapper(int uart_no);
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data);
static int hci_uart_init_wrapper(int uart_no, void *cfg);
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in);
static int esp_intr_free_wrapper(void **ret_handle);
@ -190,23 +171,222 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
*/
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
};
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
default:
assert(0);
}
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
}
return ret;
}
void esp_bt_ontroller_log_deinit(void)
{
r_ble_log_deinit_async();
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
r_ble_log_async_output_dump_all(true);
esp_bt_ontroller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_reconfigure_wdts(5000);
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_reconfigure_wdts(5000);
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (5100)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (1500)
@ -226,14 +406,6 @@ struct ext_funcs_t ext_funcs_ro = {
._esp_intr_free = esp_intr_free_wrapper,
._malloc = bt_osi_mem_malloc_internal,
._free = bt_osi_mem_free,
#if CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._hal_uart_start_tx = hci_uart_start_tx_wrapper,
._hal_uart_init_cbs = hci_uart_init_cbs_wrapper,
._hal_uart_config = hci_uart_config_wrapper,
._hal_uart_close = hci_uart_close_wrapper,
._hal_uart_blocking_tx = hci_uart_blocking_tx_wrapper,
._hal_uart_init = hci_uart_init_wrapper,
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
._task_create = task_create_wrapper,
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
@ -278,75 +450,6 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
#endif // CONFIG_SW_COEXIST_ENABLE
}
#ifdef CONFIG_BT_BLUEDROID_ENABLED
bool esp_vhci_host_check_send_available(void)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return false;
}
return true;
}
static struct os_mbuf *ble_hs_mbuf_gen_pkt(uint16_t leading_space)
{
struct os_mbuf *om;
int rc;
om = os_msys_get_pkthdr(0, 0);
if (om == NULL) {
return NULL;
}
if (om->om_omp->omp_databuf_len < leading_space) {
rc = os_mbuf_free_chain(om);
assert(rc == 0);
return NULL;
}
om->om_data += leading_space;
return om;
}
struct os_mbuf *ble_hs_mbuf_acl_pkt(void)
{
return ble_hs_mbuf_gen_pkt(4 + 1);
}
void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return;
}
if (*(data) == DATA_TYPE_COMMAND) {
struct ble_hci_cmd *cmd = NULL;
cmd = (struct ble_hci_cmd *) ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_CMD);
assert(cmd);
memcpy((uint8_t *)cmd, data + 1, len - 1);
ble_hci_trans_hs_cmd_tx((uint8_t *)cmd);
}
if (*(data) == DATA_TYPE_ACL) {
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
assert(om);
assert(os_mbuf_append(om, &data[1], len - 1) == 0);
ble_hci_trans_hs_acl_tx(om);
}
}
esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callback)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
return ESP_FAIL;
}
ble_hci_trans_cfg_hs(ble_hs_hci_rx_evt, NULL, ble_hs_rx_data, NULL);
return ESP_OK;
}
#endif // CONFIG_BT_BLUEDROID_ENABLED
static int task_create_wrapper(void *task_func, const char *name, uint32_t stack_depth,
void *param, uint32_t prio, void *task_handle, uint32_t core_id)
{
@ -378,56 +481,6 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
hci_uart_start_tx(uart_no);
}
static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
hci_uart_tx_done tx_done, hci_uart_rx_char rx_func, void *arg)
{
int rc = -1;
rc = hci_uart_init_cbs(uart_no, tx_func, tx_done, rx_func, arg);
return rc;
}
static int hci_uart_config_wrapper(int port_num, int32_t baud_rate, uint8_t data_bits,
uint8_t stop_bits, uart_parity_t parity,
uart_hw_flowcontrol_t flow_ctl)
{
int rc = -1;
rc = hci_uart_config(port_num, baud_rate, data_bits, stop_bits, parity, flow_ctl);
return rc;
}
static int hci_uart_close_wrapper(int uart_no)
{
int rc = -1;
rc = hci_uart_close(uart_no);
return rc;
}
static void hci_uart_blocking_tx_wrapper(int port, uint8_t data)
{
//This function is nowhere to use.
}
static int hci_uart_init_wrapper(int uart_no, void *cfg)
{
//This function is nowhere to use.
return 0;
}
#endif //CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static int ble_hci_unregistered_hook(void*, void*)
{
ESP_LOGD(NIMBLE_PORT_LOG_TAG,"%s ble hci rx_evt is not registered.",__func__);
return 0;
}
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
void *arg, void **ret_handle_in)
{
@ -472,6 +525,20 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
}
}
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -505,7 +572,7 @@ static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
{
uint8_t size;
int extra = *(int *)arg;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
sleep_retention_entries_config_t *ble_mac_modem_config = r_esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
@ -536,11 +603,12 @@ static void sleep_modem_ble_mac_modem_state_deinit(void)
}
}
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
void IRAM_ATTR sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
esp_ble_set_wakeup_overhead(overhead);
r_esp_ble_set_wakeup_overhead(overhead);
}
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
esp_err_t controller_sleep_init(void)
{
@ -562,10 +630,17 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
rc = esp_deep_sleep_register_hook(&r_esp_ble_stop_wakeup_timing);
if (rc != ESP_OK) {
goto error;
}
#endif //CONFIG_PM_ENABLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
/* Create a new regdma link for BLE related register restoration */
rc = sleep_modem_ble_mac_modem_state_init(0);
assert(rc == 0);
if (rc != ESP_OK) {
goto error;
}
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
@ -573,15 +648,18 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
return rc;
#ifdef CONFIG_PM_ENABLE
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#endif // CONFIG_PM_ENABLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#ifdef CONFIG_PM_ENABLE
esp_deep_sleep_deregister_hook(&r_esp_ble_stop_wakeup_timing);
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
@ -594,13 +672,14 @@ error:
void controller_sleep_deinit(void)
{
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#if CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
sleep_modem_ble_mac_modem_state_deinit();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#endif /* CONFIG_BT_LE_SLEEP_ENABLE && CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#ifdef CONFIG_PM_ENABLE
esp_deep_sleep_deregister_hook(&r_esp_ble_stop_wakeup_timing);
/* lock should be released first */
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
@ -678,12 +757,52 @@ void ble_controller_scan_duplicate_config(void)
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_XTAL32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC32K;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
uint8_t mac[6];
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
uint32_t slow_clk_freq = 0;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
@ -716,7 +835,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_mem;
}
ble_get_npl_element_info(cfg, &npl_info);
r_ble_get_npl_element_info(cfg, &npl_info);
npl_freertos_set_controller_npl_info(&npl_info);
if (npl_freertos_mempool_init() != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl mempool init failed");
@ -730,37 +849,11 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
*/
ble_npl_eventq_init(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
/* Enable BT-related clocks */
modem_clock_module_enable(PERIPH_BT_MODULE);
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC_SLOW);
slow_clk_freq = 30000;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_XTAL32K);
slow_clk_freq = 32768;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC32K);
slow_clk_freq = 32000;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_EXT32K);
slow_clk_freq = 32000;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
/* Select slow clock source for BT momdule */
ble_rtc_clk_init(cfg);
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
@ -771,37 +864,28 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#if CONFIG_SW_COEXIST_ENABLE
coex_init();
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = r_ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = r_ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init(log_output_mode);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
}
#endif // CONFIG_BT_CONTROLLER_LOG_ENABLED
ret = ble_controller_init(cfg);
ret = esp_ble_register_bb_funcs();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "esp_ble_register_bb_funcs failed %d", ret);
goto modem_deint;
}
ret = r_ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "r_ble_controller_init failed %d", ret);
goto modem_deint;
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
ret = os_msys_init();
@ -815,24 +899,38 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
esp_ble_ll_set_public_addr(mac);
r_esp_ble_ll_set_public_addr(mac);
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hci_unregistered_hook,NULL,
(ble_hci_trans_rx_acl_fn *)ble_hci_unregistered_hook,NULL);
return ESP_OK;
#if CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
hci_transport_mode = HCI_TRANSPORT_VHCI;
#elif CONFIG_BT_LE_HCI_INTERFACE_USE_UART
hci_transport_mode = HCI_TRANSPORT_UART_NO_DMA;
#if CONFIG_BT_LE_UART_HCI_DMA_MODE
hci_transport_mode = HCI_TRANSPORT_UART_UHCI;
#endif // CONFIG_BT_LE_UART_HCI_DMA_MODE
#endif // CONFIG_BT_LE_HCI_INTERFACE_USE_RAM
ret = hci_transport_init(hci_transport_mode);
if (ret) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "hci transport init failed %d", ret);
goto free_controller;
}
return ESP_OK;
free_controller:
hci_transport_deinit();
controller_sleep_deinit();
os_msys_deinit();
ble_controller_deinit();
r_ble_controller_deinit();
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
@ -855,6 +953,7 @@ esp_err_t esp_bt_controller_deinit(void)
return ESP_FAIL;
}
hci_transport_deinit();
controller_sleep_deinit();
os_msys_deinit();
@ -862,9 +961,10 @@ esp_err_t esp_bt_controller_deinit(void)
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
ble_controller_deinit();
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@ -910,7 +1010,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
coex_enable();
#endif // CONFIG_SW_COEXIST_ENABLE
if (ble_controller_enable(mode) != 0) {
if (r_ble_controller_enable(mode) != 0) {
ret = ESP_FAIL;
goto error;
}
@ -938,7 +1038,7 @@ esp_err_t esp_bt_controller_disable(void)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (ble_controller_disable() != 0) {
if (r_ble_controller_disable() != 0) {
return ESP_FAIL;
}
#if CONFIG_SW_COEXIST_ENABLE
@ -1072,7 +1172,7 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
case ESP_BLE_PWR_TYPE_DEFAULT:
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1085,7 +1185,7 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1105,13 +1205,13 @@ esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
if (r_ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
if (r_ble_txpwr_set(power_type, handle, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1131,7 +1231,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
case ESP_BLE_PWR_TYPE_DEFAULT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
@ -1142,7 +1242,7 @@ esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
break;
default:
return ESP_PWR_LVL_INVALID;
@ -1164,11 +1264,11 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
tx_level = r_ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
tx_level = ble_txpwr_get(power_type, handle);
tx_level = r_ble_txpwr_get(power_type, handle);
break;
default:
return ESP_PWR_LVL_INVALID;
@ -1184,16 +1284,30 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(1000);
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
void esp_ble_controller_log_dump_all(bool output)
{
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#else
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
@ -1202,6 +1316,7 @@ void esp_ble_controller_log_dump_all(bool output)
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -124,12 +124,26 @@ extern "C" {
#else
#define DEFAULT_BT_LE_POWER_CONTROL_ENABLED (0)
#endif
#if defined(CONFIG_BT_LE_50_FEATURE_SUPPORT)
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (1)
#else
#define DEFAULT_BT_LE_50_FEATURE_SUPPORT (0)
#endif
#if defined (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (CONFIG_BT_LE_HCI_UART_FLOWCTRL)
#if DEFAULT_BT_LE_HCI_UART_FLOW_CTRL
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (CONFIG_BT_LE_HCI_UART_CTS_PIN)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (CONFIG_BT_LE_HCI_UART_RTS_PIN)
#else
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#else
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#define DEFAULT_BT_LE_HCI_UART_CTS_PIN (-1)
#define DEFAULT_BT_LE_HCI_UART_RTS_PIN (-1)
#endif
#endif
#define DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
@ -170,8 +184,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (UART_DATA_8_BITS)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (UART_STOP_BITS_1)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (CONFIG_BT_LE_HCI_UART_TASK_STACK_SIZE)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#else
#define DEFAULT_BT_LE_HCI_UART_TX_PIN (0)
#define DEFAULT_BT_LE_HCI_UART_RX_PIN (0)
@ -180,8 +192,6 @@ extern "C" {
#define DEFAULT_BT_LE_HCI_UART_DATA_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_STOP_BITS (0)
#define DEFAULT_BT_LE_HCI_UART_PARITY (0)
#define DEFAULT_BT_LE_HCI_UART_TASK_STACK_SIZE (0)
#define DEFAULT_BT_LE_HCI_UART_FLOW_CTRL (0)
#endif
/* Unchanged configuration */
@ -206,8 +216,7 @@ extern "C" {
#define RTC_FREQ_N (32768) /* in Hz */
#define BLE_LL_TX_PWR_DBM_N (9)
#define BLE_LL_TX_PWR_DBM_N (CONFIG_BT_LE_DFT_TX_POWER_LEVEL_DBM_EFF)
#define RUN_BQB_TEST (0)
#define RUN_QA_TEST (0)

View File

@ -6,6 +6,12 @@ if BLE_MESH
help
It is a temporary solution and needs further modifications.
config BLE_MESH_V11_SUPPORT
bool "Support ESP BLE Mesh v1.1 features (Preview)"
default y
help
Support BLE Mesh v1.1 features
config BLE_MESH_RANDOM_ADV_INTERVAL
bool "Support using random adv interval for mesh packets"
select BT_BLE_HIGH_DUTY_ADV_INTERVAL if BT_BLUEDROID_ENABLED
@ -32,6 +38,7 @@ if BLE_MESH
config BLE_MESH_ACTIVE_SCAN
bool "Support Active Scan in BLE Mesh"
depends on BLE_MESH_V11_SUPPORT
help
Enable this option to allow using BLE Active Scan for BLE Mesh.
@ -281,6 +288,7 @@ if BLE_MESH
config BLE_MESH_PROV_EPA
bool "BLE Mesh enhanced provisioning authentication"
depends on BLE_MESH_PROV
depends on BLE_MESH_V11_SUPPORT
default y
help
Enable this option to support BLE Mesh enhanced provisioning authentication
@ -290,6 +298,7 @@ if BLE_MESH
config BLE_MESH_CERT_BASED_PROV
bool "Support Certificate-based provisioning"
depends on BLE_MESH_PROV
depends on BLE_MESH_V11_SUPPORT
default n
help
Enable this option to support BLE Mesh Certificate-Based Provisioning.
@ -390,6 +399,7 @@ if BLE_MESH
config BLE_MESH_PROXY_SOLIC_PDU_RX
bool "Support receiving Proxy Solicitation PDU"
depends on BLE_MESH_GATT_PROXY_SERVER
depends on BLE_MESH_V11_SUPPORT
help
Enable this option to support receiving Proxy Solicitation PDU.
@ -417,6 +427,7 @@ if BLE_MESH
config BLE_MESH_PROXY_SOLIC_PDU_TX
bool "Support sending Proxy Solicitation PDU"
depends on BLE_MESH_GATT_PROXY_CLIENT
depends on BLE_MESH_V11_SUPPORT
help
Enable this option to support sending Proxy Solicitation PDU.
@ -703,6 +714,7 @@ if BLE_MESH
to perform the IV index recovery procedure.
config BLE_MESH_SAR_ENHANCEMENT
depends on BLE_MESH_V11_SUPPORT
bool "Segmentation and reassembly enhancement"
default n
help
@ -1102,253 +1114,257 @@ if BLE_MESH
help
Enable support for Health Server model.
config BLE_MESH_BRC_CLI
bool "Bridge Configuration Client model"
help
Enable support for Bridge Configuration Client model.
if BLE_MESH_V11_SUPPORT
config BLE_MESH_BRC_SRV
bool "Bridge Configuration Server model"
default n
help
Enable support for Bridge Configuration Server model.
if BLE_MESH_BRC_SRV
config BLE_MESH_MAX_BRIDGING_TABLE_ENTRY_COUNT
int "Maximum number of Bridging Table entries"
range 16 65535
default 16
config BLE_MESH_BRC_CLI
bool "Bridge Configuration Client model"
help
Maximum number of Bridging Table entries that the Bridge Configuration Server can support.
Enable support for Bridge Configuration Client model.
config BLE_MESH_BRIDGE_CRPL
int "Maximum capacity of bridge replay protection list"
default 5
range 1 255
help
This option specifies the maximum capacity of the bridge replay
protection list. The bridge replay protection list is used to
prevent a bridged subnet from replay attack, which will store the
source address and sequence number of the received bridge messages.
endif #BLE_MESH_BRC_SRV
config BLE_MESH_PRB_CLI
bool "Mesh Private Beacon Client model"
help
Enable support for Mesh Private Beacon Client model.
config BLE_MESH_PRB_SRV
bool "Mesh Private Beacon Server model"
help
Enable support for Mesh Private Beacon Server model.
config BLE_MESH_ODP_CLI
bool "On-Demand Private Proxy Client model"
help
Enable support for On-Demand Private Proxy Client model.
config BLE_MESH_ODP_SRV
bool "On-Demand Private Proxy Server model"
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
select BLE_MESH_SRPL_SRV
help
Enable support for On-Demand Private Proxy Server model.
config BLE_MESH_SRPL_CLI
bool "Solicitation PDU RPL Configuration Client model"
help
Enable support for Solicitation PDU RPL Configuration Client model.
config BLE_MESH_SRPL_SRV
bool "Solicitation PDU RPL Configuration Server model"
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
help
Enable support for Solicitation PDU RPL Configuration Server model.
Note:
This option depends on the functionality of receiving Solicitation
PDU. If the device doesn't support receiving Solicitation PDU, then
there is no need to enable this server model.
config BLE_MESH_AGG_CLI
bool "Opcodes Aggregator Client model"
help
Enable support for Opcodes Aggregator Client model.
config BLE_MESH_AGG_SRV
bool "Opcodes Aggregator Server model"
help
Enable support for Opcodes Aggregator Server model.
config BLE_MESH_SAR_CLI
bool "SAR Configuration Client model"
help
Enable support for SAR Configuration Client model.
config BLE_MESH_SAR_SRV
bool "SAR Configuration Server model"
help
Enable support for SAR Configuration Server model.
config BLE_MESH_COMP_DATA_1
bool "Support Composition Data Page 1"
help
Composition Data Page 1 contains information about the relationships
among models.
Each model either can be a root model or can extend other models.
config BLE_MESH_COMP_DATA_128
bool "Support Composition Data Page 128"
help
Composition Data Page 128 is used to indicate the structure of
elements, features, and models of a node after the successful
execution of the Node Address Refresh procedure or the Node
Composition Refresh procedure, or after the execution of the
Node Removal procedure followed by the provisioning process.
Composition Data Page 128 shall be present if the node supports
the Remote Provisioning Server model; otherwise it is optional.
config BLE_MESH_MODELS_METADATA_0
bool "Support Models Metadata Page 0"
help
The Models Metadata state contains metadata of a nodes models.
The Models Metadata state is composed of a number of pages of
information.
Models Metadata Page 0 shall be present if the node supports
the Large Composition Data Server model.
config BLE_MESH_MODELS_METADATA_128
bool "Support Models Metadata Page 128"
depends on BLE_MESH_MODELS_METADATA_0
help
The Models Metadata state contains metadata of a nodes models.
The Models Metadata state is composed of a number of pages of
information.
Models Metadata Page 128 contains metadata for the nodes models
after the successful execution of the Node Address Refresh
procedure or the Node Composition Refresh procedure, or after
the execution of the Node Removal procedure followed by the
provisioning process.
Models Metadata Page 128 shall be present if the node supports
the Remote Provisioning Server model and the node supports the
Large Composition Data Server model.
config BLE_MESH_LCD_CLI
bool "Large Composition Data Client model"
help
Enable support for Large Composition Data Client model.
config BLE_MESH_LCD_SRV
bool "Large Composition Data Server model"
select BLE_MESH_MODELS_METADATA_0
help
Enable support for Large Composition Data Server model.
config BLE_MESH_RPR_CLI
bool "Remote Provisioning Client model"
depends on BLE_MESH_PROVISIONER
select BLE_MESH_PROV
help
Enable support for Remote Provisioning Client model
if BLE_MESH_RPR_CLI
config BLE_MESH_RPR_CLI_PROV_SAME_TIME
int "Maximum number of PB-Remote running at the same time by Provisioner"
range 1 5
default 2
help
This option specifies how many devices can be provisioned at the same time
using PB-REMOTE. For example, if the value is 2, it means a Provisioner can
provision two unprovisioned devices with PB-REMOTE at the same time.
endif # BLE_MESH_RPR_CLI
config BLE_MESH_RPR_SRV
bool "Remote Provisioning Server model"
depends on BLE_MESH_NODE
select BLE_MESH_PB_ADV
help
Enable support for Remote Provisioning Server model
if BLE_MESH_RPR_SRV
config BLE_MESH_RPR_SRV_MAX_SCANNED_ITEMS
int "Maximum number of device information can be scanned"
range 4 255
default 10
help
This option specifies how many device information can a Remote
Provisioning Server store each time while scanning.
config BLE_MESH_RPR_SRV_ACTIVE_SCAN
bool "Support Active Scan for remote provisioning"
select BLE_MESH_ACTIVE_SCAN
help
Enable this option to support Active Scan for remote provisioning.
config BLE_MESH_RPR_SRV_MAX_EXT_SCAN
int "Maximum number of extended scan procedures"
range 1 10
default 1
help
This option specifies how many extended scan procedures can be
started by the Remote Provisioning Server.
endif # BLE_MESH_RPR_SRV
config BLE_MESH_DF_CLI
bool "Directed Forwarding Configuration Client model"
help
Enable support for Directed Forwarding Configuration Client model.
config BLE_MESH_DF_SRV
bool "Directed Forwarding Configuration Server model"
help
Enable support for Directed Forwarding Configuration Server model.
if BLE_MESH_DF_SRV
config BLE_MESH_MAX_DISC_TABLE_ENTRY_COUNT
int "Maximum number of discovery table entries in a given subnet"
range 2 255
default 2
help
Maximum number of Discovery Table entries supported by the node in a given subnet.
config BLE_MESH_MAX_FORWARD_TABLE_ENTRY_COUNT
int "Maximum number of forward table entries in a given subnet"
range 2 64
default 2
help
Maximum number of Forward Table entries supported by the node in a given subnet.
config BLE_MESH_MAX_DEPS_NODES_PER_PATH
int "Maximum number of dependent nodes per path"
range 2 64
default 2
help
Maximum size of dependent nodes list supported by each forward table entry.
config BLE_MESH_PATH_MONITOR_TEST
bool "Enable Path Monitoring test mode"
config BLE_MESH_BRC_SRV
bool "Bridge Configuration Server model"
default n
help
The option only removes the Path Use timer; all other behavior of the
device is not changed.
If Path Monitoring test mode is going to be used, this option should
be enabled.
Enable support for Bridge Configuration Server model.
if BLE_MESH_GATT_PROXY_SERVER
config BLE_MESH_SUPPORT_DIRECTED_PROXY
bool "Enable Directed Proxy functionality"
default y
if BLE_MESH_BRC_SRV
config BLE_MESH_MAX_BRIDGING_TABLE_ENTRY_COUNT
int "Maximum number of Bridging Table entries"
range 16 65535
default 16
help
Support Directed Proxy functionality.
endif
Maximum number of Bridging Table entries that the Bridge Configuration Server can support.
endif # BLE_MESH_DF_SRV
config BLE_MESH_BRIDGE_CRPL
int "Maximum capacity of bridge replay protection list"
default 5
range 1 255
help
This option specifies the maximum capacity of the bridge replay
protection list. The bridge replay protection list is used to
prevent a bridged subnet from replay attack, which will store the
source address and sequence number of the received bridge messages.
endif #BLE_MESH_BRC_SRV
config BLE_MESH_PRB_CLI
bool "Mesh Private Beacon Client model"
help
Enable support for Mesh Private Beacon Client model.
config BLE_MESH_PRB_SRV
bool "Mesh Private Beacon Server model"
help
Enable support for Mesh Private Beacon Server model.
config BLE_MESH_ODP_CLI
bool "On-Demand Private Proxy Client model"
help
Enable support for On-Demand Private Proxy Client model.
config BLE_MESH_ODP_SRV
bool "On-Demand Private Proxy Server model"
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
select BLE_MESH_SRPL_SRV
help
Enable support for On-Demand Private Proxy Server model.
config BLE_MESH_SRPL_CLI
bool "Solicitation PDU RPL Configuration Client model"
help
Enable support for Solicitation PDU RPL Configuration Client model.
config BLE_MESH_SRPL_SRV
bool "Solicitation PDU RPL Configuration Server model"
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
help
Enable support for Solicitation PDU RPL Configuration Server model.
Note:
This option depends on the functionality of receiving Solicitation
PDU. If the device doesn't support receiving Solicitation PDU, then
there is no need to enable this server model.
config BLE_MESH_AGG_CLI
bool "Opcodes Aggregator Client model"
help
Enable support for Opcodes Aggregator Client model.
config BLE_MESH_AGG_SRV
bool "Opcodes Aggregator Server model"
help
Enable support for Opcodes Aggregator Server model.
config BLE_MESH_SAR_CLI
bool "SAR Configuration Client model"
help
Enable support for SAR Configuration Client model.
config BLE_MESH_SAR_SRV
bool "SAR Configuration Server model"
help
Enable support for SAR Configuration Server model.
config BLE_MESH_COMP_DATA_1
bool "Support Composition Data Page 1"
help
Composition Data Page 1 contains information about the relationships
among models.
Each model either can be a root model or can extend other models.
config BLE_MESH_COMP_DATA_128
bool "Support Composition Data Page 128"
help
Composition Data Page 128 is used to indicate the structure of
elements, features, and models of a node after the successful
execution of the Node Address Refresh procedure or the Node
Composition Refresh procedure, or after the execution of the
Node Removal procedure followed by the provisioning process.
Composition Data Page 128 shall be present if the node supports
the Remote Provisioning Server model; otherwise it is optional.
config BLE_MESH_MODELS_METADATA_0
bool "Support Models Metadata Page 0"
help
The Models Metadata state contains metadata of a nodes models.
The Models Metadata state is composed of a number of pages of
information.
Models Metadata Page 0 shall be present if the node supports
the Large Composition Data Server model.
config BLE_MESH_MODELS_METADATA_128
bool "Support Models Metadata Page 128"
depends on BLE_MESH_MODELS_METADATA_0
help
The Models Metadata state contains metadata of a nodes models.
The Models Metadata state is composed of a number of pages of
information.
Models Metadata Page 128 contains metadata for the nodes models
after the successful execution of the Node Address Refresh
procedure or the Node Composition Refresh procedure, or after
the execution of the Node Removal procedure followed by the
provisioning process.
Models Metadata Page 128 shall be present if the node supports
the Remote Provisioning Server model and the node supports the
Large Composition Data Server model.
config BLE_MESH_LCD_CLI
bool "Large Composition Data Client model"
help
Enable support for Large Composition Data Client model.
config BLE_MESH_LCD_SRV
bool "Large Composition Data Server model"
select BLE_MESH_MODELS_METADATA_0
help
Enable support for Large Composition Data Server model.
config BLE_MESH_RPR_CLI
bool "Remote Provisioning Client model"
depends on BLE_MESH_PROVISIONER
select BLE_MESH_PROV
help
Enable support for Remote Provisioning Client model
if BLE_MESH_RPR_CLI
config BLE_MESH_RPR_CLI_PROV_SAME_TIME
int "Maximum number of PB-Remote running at the same time by Provisioner"
range 1 5
default 2
help
This option specifies how many devices can be provisioned at the same time
using PB-REMOTE. For example, if the value is 2, it means a Provisioner can
provision two unprovisioned devices with PB-REMOTE at the same time.
endif # BLE_MESH_RPR_CLI
config BLE_MESH_RPR_SRV
bool "Remote Provisioning Server model"
depends on BLE_MESH_NODE
select BLE_MESH_PB_ADV
help
Enable support for Remote Provisioning Server model
if BLE_MESH_RPR_SRV
config BLE_MESH_RPR_SRV_MAX_SCANNED_ITEMS
int "Maximum number of device information can be scanned"
range 4 255
default 10
help
This option specifies how many device information can a Remote
Provisioning Server store each time while scanning.
config BLE_MESH_RPR_SRV_ACTIVE_SCAN
bool "Support Active Scan for remote provisioning"
select BLE_MESH_ACTIVE_SCAN
help
Enable this option to support Active Scan for remote provisioning.
config BLE_MESH_RPR_SRV_MAX_EXT_SCAN
int "Maximum number of extended scan procedures"
range 1 10
default 1
help
This option specifies how many extended scan procedures can be
started by the Remote Provisioning Server.
endif # BLE_MESH_RPR_SRV
config BLE_MESH_DF_CLI
bool "Directed Forwarding Configuration Client model"
help
Enable support for Directed Forwarding Configuration Client model.
config BLE_MESH_DF_SRV
bool "Directed Forwarding Configuration Server model"
help
Enable support for Directed Forwarding Configuration Server model.
if BLE_MESH_DF_SRV
config BLE_MESH_MAX_DISC_TABLE_ENTRY_COUNT
int "Maximum number of discovery table entries in a given subnet"
range 2 255
default 2
help
Maximum number of Discovery Table entries supported by the node in a given subnet.
config BLE_MESH_MAX_FORWARD_TABLE_ENTRY_COUNT
int "Maximum number of forward table entries in a given subnet"
range 2 64
default 2
help
Maximum number of Forward Table entries supported by the node in a given subnet.
config BLE_MESH_MAX_DEPS_NODES_PER_PATH
int "Maximum number of dependent nodes per path"
range 2 64
default 2
help
Maximum size of dependent nodes list supported by each forward table entry.
config BLE_MESH_PATH_MONITOR_TEST
bool "Enable Path Monitoring test mode"
default n
help
The option only removes the Path Use timer; all other behavior of the
device is not changed.
If Path Monitoring test mode is going to be used, this option should
be enabled.
if BLE_MESH_GATT_PROXY_SERVER
config BLE_MESH_SUPPORT_DIRECTED_PROXY
bool "Enable Directed Proxy functionality"
default y
help
Support Directed Proxy functionality.
endif
endif # BLE_MESH_DF_SRV
endif # BLE_MESH_V11_SUPPORT
endmenu #Support for BLE Mesh Foundation models
@ -1465,6 +1481,7 @@ if BLE_MESH
config BLE_MESH_MBT_CLI
bool "BLOB Transfer Client model"
depends on BLE_MESH_V11_SUPPORT
default n
help
Enable support for BLOB Transfer Client model.
@ -1483,6 +1500,7 @@ if BLE_MESH
config BLE_MESH_MBT_SRV
bool "BLOB Transfer Server model"
depends on BLE_MESH_V11_SUPPORT
default n
help
Enable support for BLOB Transfer Server model.

View File

@ -96,7 +96,7 @@ esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
}
/* Take the Semaphore, wait BLE Mesh de-initialization to finish. */
xSemaphoreTake(semaphore, portMAX_DELAY);
__ASSERT(xSemaphoreTake(semaphore, 3000 / portTICK_PERIOD_MS) == pdTRUE, "BLE Mesh deinit take semaphore failed");
/* Don't forget to delete the semaphore at the end. */
vSemaphoreDelete(semaphore);

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -33,7 +33,10 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
/**
* @brief De-initialize BLE Mesh module.
*
* @note This function shall be invoked after esp_ble_mesh_client_model_deinit().
* @note
* 1. This function shall be invoked after esp_ble_mesh_client_model_deinit().
* 2. This function is strictly forbidden to run in any BTC Task Context
* (e.g. registered Mesh Event Callback).
*
* @param[in] param: Pointer to the structure of BLE Mesh deinit parameters.
*

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -10,11 +10,13 @@
#include "btc_ble_mesh_prov.h"
#include "btc_ble_mesh_config_model.h"
#include "btc_ble_mesh_health_model.h"
#include "btc_ble_mesh_prb_model.h"
#include "btc_ble_mesh_generic_model.h"
#include "btc_ble_mesh_time_scene_model.h"
#include "btc_ble_mesh_sensor_model.h"
#include "btc_ble_mesh_lighting_model.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "btc_ble_mesh_prb_model.h"
#include "btc_ble_mesh_brc_model.h"
#include "btc_ble_mesh_odp_model.h"
#include "btc_ble_mesh_srpl_model.h"
@ -24,6 +26,8 @@
#include "btc_ble_mesh_rpr_model.h"
#include "btc_ble_mesh_df_model.h"
#include "btc_ble_mesh_mbt_model.h"
#include "mesh_v1.1/utils.h"
#endif /* CONFIG_BLE_MESH_V11_SUPPORT */
#include "adv.h"
#include "mesh/kernel.h"
@ -65,12 +69,33 @@
#include "mesh/state_binding.h"
#include "local.h"
#include "mesh_v1.1/utils.h"
#include "esp_ble_mesh_common_api.h"
#include "esp_ble_mesh_provisioning_api.h"
#include "esp_ble_mesh_networking_api.h"
#if CONFIG_BLE_MESH_DEINIT
static SemaphoreHandle_t deinit_comp_semaphore;
#endif
static inline void btc_ble_mesh_prov_cb_to_app_reprocess(esp_ble_mesh_prov_cb_event_t event,
esp_ble_mesh_prov_cb_param_t *param)
{
switch (event) {
#if CONFIG_BLE_MESH_DEINIT
case ESP_BLE_MESH_DEINIT_MESH_COMP_EVT:
assert(deinit_comp_semaphore);
/* Give the semaphore when BLE Mesh de-initialization is finished.
* @note: At nimble host, once this lock is released, it will cause
* the btc task to be deleted.
*/
xSemaphoreGive(deinit_comp_semaphore);
break;
#endif
default:
break;
}
}
static inline void btc_ble_mesh_prov_cb_to_app(esp_ble_mesh_prov_cb_event_t event,
esp_ble_mesh_prov_cb_param_t *param)
{
@ -79,6 +104,8 @@ static inline void btc_ble_mesh_prov_cb_to_app(esp_ble_mesh_prov_cb_event_t even
if (btc_ble_mesh_cb) {
btc_ble_mesh_cb(event, param);
}
btc_ble_mesh_prov_cb_to_app_reprocess(event, param);
}
static inline void btc_ble_mesh_model_cb_to_app(esp_ble_mesh_model_cb_event_t event,
@ -2825,8 +2852,8 @@ void btc_ble_mesh_prov_call_handler(btc_msg_t *msg)
case BTC_BLE_MESH_ACT_DEINIT_MESH:
act = ESP_BLE_MESH_DEINIT_MESH_COMP_EVT;
param.deinit_mesh_comp.err_code = bt_mesh_deinit((struct bt_mesh_deinit_param *)&arg->mesh_deinit.param);
/* Give the semaphore when BLE Mesh de-initialization is finished. */
xSemaphoreGive(arg->mesh_deinit.semaphore);
/* Temporarily save the deinit semaphore and release it after the mesh deinit complete event is handled in the app layer */
deinit_comp_semaphore = arg->mesh_deinit.semaphore;
break;
#endif /* CONFIG_BLE_MESH_DEINIT */
default:

View File

@ -13,7 +13,7 @@
/*
* SPDX-FileCopyrightText: 2016 Intel Corporation
* SPDX-FileCopyrightText: 2011-2014 Wind River Systems, Inc.
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -170,4 +170,18 @@ bt_mesh_atomic_val_t bt_mesh_atomic_inc(bt_mesh_atomic_t *target)
return ret;
}
bool bt_mesh_atomic_cas(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t excepted, bt_mesh_atomic_val_t new_val)
{
bt_mesh_atomic_lock();
if (*target == excepted) {
*target = new_val;
bt_mesh_atomic_unlock();
return true;
}
bt_mesh_atomic_unlock();
return false;
}
#endif /* #ifndef CONFIG_ATOMIC_OPERATIONS_BUILTIN */

View File

@ -147,6 +147,33 @@ static inline bt_mesh_atomic_val_t bt_mesh_atomic_and(bt_mesh_atomic_t *target,
extern bt_mesh_atomic_val_t bt_mesh_atomic_and(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t value);
#endif
/**
* @brief Atomic CAS operation.
*
* This compares the contents of @a *target
* with the contents of @a excepted. If equal,
* the operation is a read-modify-write operation
* that writes @a new_val into @a *target and return true.
* If they are not equal, the operation is a read
* and return false.
*
* @param target Address of atomic variable.
* @param excepted Value of excepted.
* @param new_val Write if target value is equal to expected one.
*
* @return
* - true: Target value updated.
* - false: Target value not updated.
*/
#ifdef CONFIG_ATOMIC_OPERATIONS_BUILTIN
static inline bool bt_mesh_atomic_cas(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t excepted, bt_mesh_atomic_val_t new_val)
{
return __atomic_compare_exchange_n(target, &excepted, &new_val, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
}
#else
extern bool bt_mesh_atomic_cas(bt_mesh_atomic_t *target, bt_mesh_atomic_val_t excepted, bt_mesh_atomic_val_t new_val);
#endif
/**
* @cond INTERNAL_HIDDEN
*/

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -11,6 +11,7 @@
#include <errno.h>
#include "mesh.h"
#include "tag.h"
#include "adv.h"
#include "lpn.h"
#include "friend.h"
@ -22,7 +23,9 @@
#include "fast_prov.h"
#include "pvnr_mgmt.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
#define BLE_MESH_SDU_MAX_LEN 384
@ -814,6 +817,135 @@ static bool ready_to_send(uint16_t dst)
return false;
}
#if !CONFIG_BLE_MESH_V11_SUPPORT
static bool use_friend_cred(uint16_t net_idx, uint16_t dst)
{
/* Currently LPN only supports using NetKey in bt_mesh.sub[0] */
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER) &&
net_idx == 0 &&
bt_mesh_lpn_match(dst)) {
return true;
}
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND) &&
bt_mesh_friend_match(net_idx, dst)) {
return true;
}
return false;
}
bool bt_mesh_valid_security_cred(struct bt_mesh_net_tx *tx)
{
/* If the message is tagged with immutable-credentials,
* then the security credentials shall not be changed
* in lower layers.
* If not, later a better security credentials could be
* chosen for the message.
*/
if (!bt_mesh_tag_immutable_cred(tx->ctx->send_tag)) {
return true;
}
if (tx->ctx->send_cred > BLE_MESH_FRIENDSHIP_CRED) {
return false;
}
if (tx->ctx->send_cred == BLE_MESH_FRIENDSHIP_CRED &&
!use_friend_cred(tx->ctx->net_idx, tx->ctx->addr)) {
return false;
}
return true;
}
void bt_mesh_choose_better_security_cred(struct bt_mesh_net_tx *tx)
{
uint8_t send_cred = 0U;
uint8_t send_tag = 0U;
uint16_t net_idx = 0U;
uint16_t addr = 0U;
send_cred = tx->ctx->send_cred;
send_tag = tx->ctx->send_tag;
net_idx = tx->ctx->net_idx;
addr = tx->ctx->addr;
/* If the message is tagged with immutable-credentials,
* then the security credentials shall not be changed.
*/
if (bt_mesh_tag_immutable_cred(send_tag)) {
return;
}
if (send_cred > BLE_MESH_FRIENDSHIP_CRED) {
BT_INFO("Use managed flooding security credentials");
tx->ctx->send_cred = BLE_MESH_FLOODING_CRED;
return;
}
if (send_cred == BLE_MESH_FRIENDSHIP_CRED) {
if (!use_friend_cred(net_idx, addr)) {
BT_INFO("Use managed flooding security credentials");
tx->ctx->send_cred = BLE_MESH_FLOODING_CRED;
tx->ctx->send_tag = send_tag | BLE_MESH_TAG_IMMUTABLE_CRED;
} else {
/* TODO:
* For LPN, do we need to change the friendship security
* credentials to managed flooding credentials?
* If changed, this could increase the possibility that
* the corresponding Friend node receives this message.
*/
}
return;
}
/* If the message is destinated to a LPN, the following could be
* introduced to send the message with the friendship credentials.
*
* For LPN, this optimization should not be introduced, since it
* may cause the message failed to received by the Friend node,
* using friendship credentials will make the message can not be
* relayed by other mesh nodes.
*/
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND) &&
BLE_MESH_ADDR_IS_UNICAST(addr) &&
bt_mesh_friend_match(net_idx, addr)) {
BT_INFO("Use friendship security credentials");
tx->ctx->send_cred = BLE_MESH_FRIENDSHIP_CRED;
tx->ctx->send_tag = send_tag | BLE_MESH_TAG_IMMUTABLE_CRED;
return;
}
/**
* Spec 3.7.3.1
* The Low power node in friendship should use friendship security
* material.
*
* But in Spec 3.6.6.2
* Depending on the value of the Publish Friendship Credentials Flag
* (see Section 4.2.3.4), the Low Power node model publishes messages
* using either the friendship security credentials or the managed
* flooding security credentials (see Section 3.9.6.3.1).
*
* So use the BLE_MESH_TAG_IMMUTABLE_CRED to indicate that the
* credentials of the message should not be changed when the
* message is sent by model publishing, even though the spec
* didn't require this flag to be set when model publishing.
*/
#if CONFIG_BLE_MESH_LOW_POWER
if (BLE_MESH_ADDR_IS_UNICAST(addr) &&
bt_mesh.lpn.frnd == addr &&
!bt_mesh_tag_immutable_cred(send_tag)) {
tx->ctx->send_cred = BLE_MESH_FRIENDSHIP_CRED;
tx->ctx->send_tag = send_tag | BLE_MESH_TAG_IMMUTABLE_CRED;
return;
}
#endif
}
#endif /* !CONFIG_BLE_MESH_V11_SUPPORT */
static int model_send(struct bt_mesh_model *model,
struct bt_mesh_net_tx *tx, bool implicit_bind,
struct net_buf_simple *msg,
@ -1108,11 +1240,13 @@ size_t bt_mesh_rx_devkey_size(void)
#if CONFIG_BLE_MESH_NODE && !CONFIG_BLE_MESH_PROVISIONER
if (bt_mesh_is_provisioned()) {
size = 1;
#if CONFIG_BLE_MESH_RPR_SRV
if (bt_mesh_dev_key_ca_valid()) {
size += 1;
}
#endif /* CONFIG_BLE_MESH_RPR_SRV */
}
#endif
#endif /* CONFIG_BLE_MESH_NODE && !CONFIG_BLE_MESH_PROVISIONER */
#if !CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PROVISIONER
if (bt_mesh_is_provisioner_en()) {
@ -1122,9 +1256,11 @@ size_t bt_mesh_rx_devkey_size(void)
#if CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PROVISIONER
size = 1;
#if CONFIG_BLE_MESH_RPR_SRV
if (bt_mesh_dev_key_ca_valid()) {
size += 1;
}
#endif /* CONFIG_BLE_MESH_RPR_SRV */
if (bt_mesh_is_provisioner_en()) {
size += 1;
}
@ -1156,7 +1292,9 @@ const uint8_t *bt_mesh_rx_devkey_get(size_t index, uint16_t src)
#if CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PROVISIONER
if (index == 0) {
key = bt_mesh.dev_key;
} else if (index == 1 && bt_mesh_dev_key_ca_valid()) {
} else
#if CONFIG_BLE_MESH_RPR_SRV
if (index == 1 && bt_mesh_dev_key_ca_valid()) {
/* If index == 1, there are two cases.
* 1. bt_mesh_dev_key_ca_valid() is true, it should be return bt_mesh.dev_key_ca.
* 2. bt_mesh_is_provisioner_en() is true, it should be return bt_mesh_provisioner_dev_key_get(src).
@ -1166,7 +1304,9 @@ const uint8_t *bt_mesh_rx_devkey_get(size_t index, uint16_t src)
* Then this round of function bt_mesh_rx_devkey_get(2, src) will return bt_mesh_provisioner_dev_key_get(src).
*/
key = bt_mesh.dev_key_ca;
} else {
} else
#endif
{
key = bt_mesh_provisioner_dev_key_get(src);
}
#endif

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -335,8 +335,7 @@ static void adv_thread(void *p)
}
/* busy == 0 means this was canceled */
if (BLE_MESH_ADV(*buf)->busy) {
BLE_MESH_ADV(*buf)->busy = 0U;
if (bt_mesh_atomic_cas(&BLE_MESH_ADV_BUSY(*buf), 1, 0)) {
#if !CONFIG_BLE_MESH_RELAY_ADV_BUF
if (adv_send(*buf)) {
BT_WARN("Failed to send adv packet");
@ -449,7 +448,7 @@ static void bt_mesh_unref_buf(bt_mesh_msg_t *msg)
if (msg->arg) {
buf = (struct net_buf *)msg->arg;
BLE_MESH_ADV(buf)->busy = 0U;
bt_mesh_atomic_set(&BLE_MESH_ADV_BUSY(buf), 0);
if (buf->ref > 1U) {
buf->ref = 1U;
}
@ -490,7 +489,7 @@ void bt_mesh_adv_send(struct net_buf *buf, uint8_t xmit,
BLE_MESH_ADV(buf)->cb = cb;
BLE_MESH_ADV(buf)->cb_data = cb_data;
BLE_MESH_ADV(buf)->busy = 1U;
bt_mesh_atomic_set(&BLE_MESH_ADV_BUSY(buf), 1);
BLE_MESH_ADV(buf)->xmit = xmit;
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
@ -589,7 +588,7 @@ void bt_mesh_relay_adv_send(struct net_buf *buf, uint8_t xmit,
BLE_MESH_ADV(buf)->cb = cb;
BLE_MESH_ADV(buf)->cb_data = cb_data;
BLE_MESH_ADV(buf)->busy = 1U;
bt_mesh_atomic_set(&BLE_MESH_ADV_BUSY(buf), 1);
BLE_MESH_ADV(buf)->xmit = xmit;
msg.arg = (void *)net_buf_ref(buf);
@ -753,7 +752,7 @@ static void bt_mesh_ble_adv_send(struct net_buf *buf, const struct bt_mesh_send_
BLE_MESH_ADV(buf)->cb = cb;
BLE_MESH_ADV(buf)->cb_data = cb_data;
BLE_MESH_ADV(buf)->busy = 1U;
bt_mesh_atomic_set(&BLE_MESH_ADV_BUSY(buf), 1);
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
@ -772,7 +771,7 @@ static void ble_adv_tx_reset(struct ble_adv_tx *tx, bool unref)
}
bt_mesh_atomic_set(tx->flags, 0);
memset(&tx->param, 0, sizeof(tx->param));
BLE_MESH_ADV(tx->buf)->busy = 0U;
bt_mesh_atomic_set(&BLE_MESH_ADV_BUSY(tx->buf), 0);
if (unref) {
net_buf_unref(tx->buf);
}
@ -961,7 +960,8 @@ int bt_mesh_stop_ble_advertising(uint8_t index)
/* busy 1, ref 1; busy 1, ref 2;
* busy 0, ref 0; busy 0, ref 1;
*/
if (BLE_MESH_ADV(tx->buf)->busy == 1U &&
if (bt_mesh_atomic_get(&BLE_MESH_ADV_BUSY(tx->buf)) &&
tx->buf->ref == 1U) {
unref = false;
}

View File

@ -10,6 +10,7 @@
#ifndef _ADV_H_
#define _ADV_H_
#include "mesh/atomic.h"
#include "mesh/access.h"
#include "mesh/adapter.h"
@ -24,6 +25,7 @@ extern "C" {
#define BLE_MESH_ADV_USER_DATA_SIZE 4
#define BLE_MESH_ADV(buf) (*(struct bt_mesh_adv **)net_buf_user_data(buf))
#define BLE_MESH_ADV_BUSY(buf) (BLE_MESH_ADV(buf)->busy)
uint16_t bt_mesh_pdu_duration(uint8_t xmit);
@ -48,8 +50,10 @@ struct bt_mesh_adv {
const struct bt_mesh_send_cb *cb;
void *cb_data;
uint8_t type:3,
busy:1;
uint8_t type:3;
bt_mesh_atomic_t busy;
uint8_t xmit;
};

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -25,7 +25,9 @@
#include "pvnr_mgmt.h"
#include "mesh/common.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
#if defined(CONFIG_BLE_MESH_UNPROVISIONED_BEACON_INTERVAL)
#define UNPROV_BEACON_INTERVAL K_SECONDS(CONFIG_BLE_MESH_UNPROVISIONED_BEACON_INTERVAL)
@ -472,12 +474,13 @@ void bt_mesh_beacon_recv(struct net_buf_simple *buf, int8_t rssi)
bt_mesh_provisioner_unprov_beacon_recv(buf, rssi);
}
if (IS_ENABLED(CONFIG_BLE_MESH_RPR_SRV) &&
bt_mesh_is_provisioned()) {
#if CONFIG_BLE_MESH_RPR_SRV
if (bt_mesh_is_provisioned()) {
const bt_mesh_addr_t *addr = bt_mesh_get_unprov_dev_addr();
bt_mesh_unprov_dev_fifo_enqueue(buf->data, addr->val, bt_mesh_get_adv_type());
bt_mesh_rpr_srv_unprov_beacon_recv(buf, bt_mesh_get_adv_type(), addr, rssi);
}
#endif
break;
case BEACON_TYPE_SECURE:
secure_beacon_recv(buf);

View File

@ -1,7 +1,7 @@
/*
* SPDX-FileCopyrightText: 2017 Nordic Semiconductor ASA
* SPDX-FileCopyrightText: 2015-2016 Intel Corporation
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -32,7 +32,9 @@
#include "net.h"
#include "beacon.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
struct bt_mesh_dev bt_mesh_dev;
@ -74,7 +76,7 @@ static struct bt_mesh_conn_cb *bt_mesh_gatts_conn_cb;
static tBTA_GATTS_IF bt_mesh_gatts_if;
static uint8_t bt_mesh_gatts_addr[BLE_MESH_ADDR_LEN];
static uint16_t svc_handle, char_handle;
static future_t *future_mesh;
static future_t *gatts_future_mesh;
/* Static Functions */
static struct bt_mesh_gatt_attr *bt_mesh_gatts_find_attr_by_handle(uint16_t handle);
@ -561,6 +563,9 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
case BTA_GATTS_REG_EVT:
if (p_data->reg_oper.status == BTA_GATT_OK) {
bt_mesh_gatts_if = p_data->reg_oper.server_if;
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
} else {
future_ready(gatts_future_mesh, FUTURE_FAIL);
}
break;
case BTA_GATTS_READ_EVT: {
@ -618,27 +623,27 @@ static void bt_mesh_bta_gatts_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
break;
case BTA_GATTS_CREATE_EVT:
svc_handle = p_data->create.service_id;
BT_DBG("svc_handle %d, future_mesh %p", svc_handle, future_mesh);
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
BT_DBG("svc_handle %d, gatts_future_mesh %p", svc_handle, gatts_future_mesh);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_ADD_INCL_SRVC_EVT:
svc_handle = p_data->add_result.attr_id;
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_ADD_CHAR_EVT:
char_handle = p_data->add_result.attr_id;
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_ADD_CHAR_DESCR_EVT:
char_handle = p_data->add_result.attr_id;
if (future_mesh != NULL) {
future_ready(future_mesh, FUTURE_SUCCESS);
if (gatts_future_mesh != NULL) {
future_ready(gatts_future_mesh, FUTURE_SUCCESS);
}
break;
case BTA_GATTS_DELELTE_EVT:
@ -962,11 +967,11 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
if (svc->attrs[i].uuid->type == BLE_MESH_UUID_TYPE_16) {
switch (BLE_MESH_UUID_16(svc->attrs[i].uuid)->val) {
case BLE_MESH_UUID_GATT_PRIMARY_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
bta_uuid_to_bt_mesh_uuid(&bta_uuid, (struct bt_mesh_uuid *)svc->attrs[i].user_data);
BTA_GATTS_CreateService(bt_mesh_gatts_if,
&bta_uuid, 0, svc->attr_count, true);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add primary service");
return ESP_FAIL;
}
@ -976,11 +981,11 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
break;
}
case BLE_MESH_UUID_GATT_SECONDARY_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
bta_uuid_to_bt_mesh_uuid(&bta_uuid, (struct bt_mesh_uuid *)svc->attrs[i].user_data);
BTA_GATTS_CreateService(bt_mesh_gatts_if,
&bta_uuid, 0, svc->attr_count, false);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add secondary service");
return ESP_FAIL;
}
@ -993,11 +998,11 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
break;
}
case BLE_MESH_UUID_GATT_CHRC_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
struct bt_mesh_gatt_char *gatts_chrc = (struct bt_mesh_gatt_char *)svc->attrs[i].user_data;
bta_uuid_to_bt_mesh_uuid(&bta_uuid, gatts_chrc->uuid);
BTA_GATTS_AddCharacteristic(svc_handle, &bta_uuid, bt_mesh_perm_to_bta_perm(svc->attrs[i + 1].perm), gatts_chrc->properties, NULL, NULL);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add characteristic");
return ESP_FAIL;
}
@ -1019,10 +1024,10 @@ int bt_mesh_gatts_service_register(struct bt_mesh_gatt_service *svc)
case BLE_MESH_UUID_ES_CONFIGURATION_VAL:
case BLE_MESH_UUID_ES_MEASUREMENT_VAL:
case BLE_MESH_UUID_ES_TRIGGER_SETTING_VAL: {
future_mesh = future_new();
gatts_future_mesh = future_new();
bta_uuid_to_bt_mesh_uuid(&bta_uuid, svc->attrs[i].uuid);
BTA_GATTS_AddCharDescriptor(svc_handle, bt_mesh_perm_to_bta_perm(svc->attrs[i].perm), &bta_uuid, NULL, NULL);
if (future_await(future_mesh) == FUTURE_FAIL) {
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Failed to add descriptor");
return ESP_FAIL;
}
@ -1768,7 +1773,19 @@ void bt_mesh_gatt_init(void)
CONFIG_BLE_MESH_GATT_PROXY_SERVER
tBT_UUID gatts_app_uuid = {LEN_UUID_128, {0}};
memset(&gatts_app_uuid.uu.uuid128, BLE_MESH_GATTS_APP_UUID_BYTE, LEN_UUID_128);
gatts_future_mesh = future_new();
if (!gatts_future_mesh) {
BT_ERR("Mesh gatts sync lock alloc failed");
return;
}
BTA_GATTS_AppRegister(&gatts_app_uuid, bt_mesh_bta_gatts_cb);
if (future_await(gatts_future_mesh) == FUTURE_FAIL) {
BT_ERR("Mesh gatts app register failed");
return;
}
#endif
#if (CONFIG_BLE_MESH_PROVISIONER && CONFIG_BLE_MESH_PB_GATT) || \

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -30,7 +30,9 @@
#include "mesh/common.h"
#include "heartbeat.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
#define DEFAULT_TTL 7
@ -38,6 +40,158 @@ static struct bt_mesh_cfg_srv *conf;
static struct label labels[CONFIG_BLE_MESH_LABEL_COUNT];
#if !CONFIG_BLE_MESH_V11_SUPPORT
const void *comp_0;
static uint8_t bt_mesh_comp_page_check(uint8_t page, bool largest)
{
/* If the page doesn't exist, TWO situations currently:
* 1. For Composition Data Get:
* With the Page field set to the largest page number of
* the Composition Data that the node supports and that is
* less than the Page field value of the received Config
* Composition Data Get message;
* 2. For Large Composition Data Get:
* The Page field shall be set to the largest page number
* of the Composition Data that the node supports.
*/
ARG_UNUSED(largest);
if (page != 0) {
BT_WARN("Composition Data Page %d not exists", page);
}
return 0;
}
static inline uint16_t get_comp_elem_size(struct bt_mesh_elem *elem)
{
return (4 + elem->model_count * 2 + elem->vnd_model_count * 4);
}
static uint16_t get_comp_data_size(const struct bt_mesh_comp *comp)
{
uint16_t size = 10; /* CID + PID + VID + CRPL + Features */
for (int i = 0; i < comp->elem_count; i++) {
size += get_comp_elem_size(&(comp->elem[i]));
}
return size;
}
static void get_comp_data(struct net_buf_simple *buf,
const struct bt_mesh_comp *comp,
bool full_element)
{
struct bt_mesh_model *model = NULL;
struct bt_mesh_elem *elem = NULL;
uint16_t feat = 0;
if (IS_ENABLED(CONFIG_BLE_MESH_RELAY)) {
feat |= BLE_MESH_FEAT_RELAY;
}
if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER)) {
feat |= BLE_MESH_FEAT_PROXY;
}
if (IS_ENABLED(CONFIG_BLE_MESH_FRIEND)) {
feat |= BLE_MESH_FEAT_FRIEND;
}
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER)) {
feat |= BLE_MESH_FEAT_LOW_POWER;
}
net_buf_simple_add_le16(buf, comp->cid);
net_buf_simple_add_le16(buf, comp->pid);
net_buf_simple_add_le16(buf, comp->vid);
net_buf_simple_add_le16(buf, CONFIG_BLE_MESH_CRPL);
net_buf_simple_add_le16(buf, feat);
for (size_t i = 0; i < comp->elem_count; i++) {
elem = &(comp->elem[i]);
/* If "full_element" is true, which means the complete list
* of models within the element needs to fit in the data,
* otherwise the element shall not be reported.
*/
if (full_element &&
net_buf_simple_tailroom(buf) < get_comp_elem_size(elem)) {
return;
}
net_buf_simple_add_le16(buf, elem->loc);
net_buf_simple_add_u8(buf, elem->model_count);
net_buf_simple_add_u8(buf, elem->vnd_model_count);
for (size_t j = 0; j < elem->model_count; j++) {
model = &(elem->models[j]);
net_buf_simple_add_le16(buf, model->id);
}
for (size_t j = 0; j < elem->vnd_model_count; j++) {
model = &(elem->vnd_models[j]);
net_buf_simple_add_le16(buf, model->vnd.company);
net_buf_simple_add_le16(buf, model->vnd.id);
}
}
}
static int fetch_comp_data(struct net_buf_simple *buf,
const struct bt_mesh_comp *comp,
uint8_t page, uint16_t offset,
bool full_element)
{
uint16_t size = get_comp_data_size(comp);
if (offset >= size) {
BT_WARN("Too large offset %d for comp data %d, size %d",
page, offset, size);
return 0;
}
if (net_buf_simple_tailroom(buf) < 10 ||
size - offset > net_buf_simple_tailroom(buf)) {
BT_ERR("Too small buffer for comp data %d, %d, expected %d",
page, buf->size, size - offset);
return -EINVAL;
}
if (offset) {
struct net_buf_simple *pdu = bt_mesh_alloc_buf(size);
if (pdu == NULL) {
BT_ERR("%s, Out of memory", __func__);
return -ENOMEM;
}
get_comp_data(pdu, comp, false);
/* Get part of Composition Data Page 0/128 */
net_buf_simple_add_mem(buf, pdu->data + offset, pdu->len - offset);
bt_mesh_free_buf(pdu);
} else {
get_comp_data(buf, comp, full_element);
}
return 0;
}
static int bt_mesh_get_comp_data(struct net_buf_simple *buf,
uint8_t page, uint16_t offset,
bool full_element)
{
if (page == 0) {
return fetch_comp_data(buf, comp_0, page, offset, full_element);
}
BT_ERR("Invalid Composition Data Page %d", page);
return -EINVAL;
}
#endif /* !CONFIG_BLE_MESH_V11_SUPPORT */
static void comp_data_get(struct bt_mesh_model *model,
struct bt_mesh_msg_ctx *ctx,
struct net_buf_simple *buf)
@ -2758,7 +2912,7 @@ static void node_reset(struct bt_mesh_model *model,
bt_mesh_model_msg_init(&msg, OP_NODE_RESET_STATUS);
/* Send the response first since we wont have any keys left to
/* Send the response first since we won't have any keys left to
* send it later.
*/
if (bt_mesh_model_send(model, ctx, &msg, NULL, NULL)) {

View File

@ -22,7 +22,9 @@
#include "mesh/common.h"
#include "mesh/adapter.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
#define NET_MIC_LEN(pdu) (((pdu)[1] & 0x80) ? 8 : 4)
#define APP_MIC_LEN(aszmic) ((aszmic) ? 8 : 4)

View File

@ -21,7 +21,9 @@
#include "mesh/common.h"
#include "pvnr_mgmt.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
#ifdef CONFIG_BLE_MESH_FRIEND
@ -183,7 +185,7 @@ static void friend_clear(struct bt_mesh_friend *frnd, uint8_t reason)
/* Cancel the sending if necessary */
if (frnd->pending_buf) {
bt_mesh_adv_buf_ref_debug(__func__, frnd->last, 2U, BLE_MESH_BUF_REF_EQUAL);
BLE_MESH_ADV(frnd->last)->busy = 0U;
bt_mesh_atomic_set(&BLE_MESH_ADV_BUSY(frnd->last), 0);
} else {
bt_mesh_adv_buf_ref_debug(__func__, frnd->last, 1U, BLE_MESH_BUF_REF_EQUAL);
}

View File

@ -10,6 +10,7 @@
#include <errno.h>
#include "crypto.h"
#include "tag.h"
#include "adv.h"
#include "scan.h"
#include "mesh.h"
@ -23,7 +24,9 @@
#include "mesh/cfg_srv.h"
#include "heartbeat.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
#ifdef CONFIG_BLE_MESH_LOW_POWER

View File

@ -2,7 +2,7 @@
/*
* SPDX-FileCopyrightText: 2017 Intel Corporation
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -30,7 +30,9 @@
#include "prov_pvnr.h"
#include "pvnr_mgmt.h"
#if CONFIG_BLE_MESH_V11_SUPPORT
#include "mesh_v1.1/utils.h"
#endif
static bool mesh_init = false;
@ -161,9 +163,9 @@ void bt_mesh_node_reset(void)
bt_mesh_clear_seq();
bt_mesh_clear_dkca();
bt_mesh_clear_role();
if (IS_ENABLED(CONFIG_BLE_MESH_DF_SRV)) {
bt_mesh_clear_all_directed_forwarding_table_data();
}
#if CONFIG_BLE_MESH_DF_SRV
bt_mesh_clear_all_directed_forwarding_table_data();
#endif
}
memset(bt_mesh.flags, 0, sizeof(bt_mesh.flags));
@ -405,12 +407,14 @@ int bt_mesh_init(const struct bt_mesh_prov *prov,
return -EALREADY;
}
#if CONFIG_BLE_MESH_V11_SUPPORT
extern int bt_mesh_v11_ext_init(void);
err = bt_mesh_v11_ext_init();
if (err) {
BT_ERR("Bluetooth Mesh v1.1 init failed");
return err;
}
#endif
bt_mesh_mutex_init();

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