Compare commits

...

1691 Commits

Author SHA1 Message Date
482a8fb2d7 change(version): Update version to 5.1.2 2023-11-10 07:51:59 +05:30
9f2a2dbda6 Merge branch 'bugfix/ble_update_lib_1027_5.1' into 'release/v5.1'
ble: update c6 h2 lib to 5bd7cb83, c2 lib to 1d31e175

See merge request espressif/esp-idf!26711
2023-11-09 16:37:36 +08:00
5b3a8ac503 Merge branch 'bugfix/hal_memcpy_v5.1' into 'release/v5.1'
fix(hal): Fix incorrect behavior of hal_memcpy (v5.1)

See merge request espressif/esp-idf!26910
2023-11-09 14:47:18 +08:00
97aa5781f9 Merge branch 'bugfix/allow_sleep_reject_for_lightsleep' into 'release/v5.1'
bugfix(esp_hw_support): allow reject for lightsleep (backport v5.1)

See merge request espressif/esp-idf!26971
2023-11-09 14:04:07 +08:00
287255026e change(ble): update c2 lib to 6ed444f2
update c6 and h2 lib to 77d09ce0
2023-11-08 18:09:39 +08:00
00f51f74e3 ble: update c2 rom.ld 2023-11-08 18:03:48 +08:00
8353ea3a09 change(ble): added option for msys buffer source 2023-11-08 18:03:48 +08:00
88af68f3c1 ble: update c6 h2 lib to 5bd7cb83, c2 lib to 1d31e175 2023-11-08 18:03:48 +08:00
263a27b26b bugfix(esp_hw_support): allow reject for lightsleep 2023-11-07 11:10:14 +08:00
7e2e82a4a0 fix(hal): Fix incorrect behavior of hal_memcpy
Closes https://github.com/espressif/esp-idf/issues/12489
2023-11-03 15:49:35 +08:00
b6fa48e3b9 Merge branch 'bugfix/fixed_ble_disconnect_under_temp_change_v5.1' into 'release/v5.1'
fix(ble): fixed ble disconnection issue under temperature change

See merge request espressif/esp-idf!26828
2023-11-03 07:21:35 +08:00
e20f68d773 Merge branch 'backport/bugfix/fix_c6_wrong_reg_offset' into 'release/v5.1'
fix(coex): fix esp32c6 wrong reg offset(backport v5.1)

See merge request espressif/esp-idf!26764
2023-11-02 14:19:53 +08:00
8df1e1ae66 Merge branch 'bugfix/install_key_issue_v5.1' into 'release/v5.1'
WiFI: Fix key install issue in PTK renew (v5.1)

See merge request espressif/esp-idf!26851
2023-11-02 14:18:42 +08:00
358c53e6c2 Merge branch 'bugfix/supplicant_tls_fix_v5.1' into 'release/v5.1'
fix(wpa_supplicant): Correct iv lenght passed in mbedtls_cipher_set_iv() (v5.1)

See merge request espressif/esp-idf!26846
2023-11-02 14:04:38 +08:00
zwl
f58e8b3eb4 fix(ble): fixed ble disconnection issue under temperature change 2023-11-02 08:55:33 +08:00
2a96eb9f8f Merge branch 'bugfix/fix_wifi_enabled_macro_v5.1' into 'release/v5.1'
Bugfix/fix wifi enabled macro( v5.1)

See merge request espressif/esp-idf!26774
2023-11-02 08:46:58 +08:00
ed9d5e7db8 fix(wifi): Fix key install issue in PTK renew 2023-11-01 19:49:06 +05:30
095eae5fa3 fix(wpa_supplicant): Correct iv lenght passed in mbedtls_cipher_set_iv() 2023-11-01 18:02:29 +05:30
0e80568bfa Merge branch 'docs/update_nan_docs_v5.1' into 'release/v5.1'
Fix inconsistency in NAN documentation (Backport v5.1)

See merge request espressif/esp-idf!26818
2023-11-01 20:30:50 +08:00
8dd9310925 Merge branch 'bugfix/fix_compilation_issue_v5.1' into 'release/v5.1'
fix(wpa_supplicant): Fix compilation issue in EAP disabled (v5.1)

See merge request espressif/esp-idf!26727
2023-11-01 15:40:55 +08:00
8bea4c4f1d docs(esp_wifi): Fix inconsistency in NAN documentation 2023-11-01 12:53:58 +05:30
6c5b3c5d4c fix(wifi): wpa3 softap fix deauth when assoc req recv before sae is finished 2023-10-31 15:47:07 +05:30
7e1b2a2442 fix(phy): Fix ESP32C6 rx pkts fail in light sleep mode 2023-10-31 15:56:54 +08:00
85fbfae5d2 fix(wifi): Fix bug using CONFIG_WIFI_ENABLED macro 2023-10-31 15:56:21 +08:00
b1ba1dbcb1 fix(coex): fix esp32c6 wrong reg offset 2023-10-31 15:28:38 +08:00
b6a66b7d8c Merge branch 'ci/tune_build_jobs_parallel_count' into 'release/v5.1'
ci: tune build jobs parallel count

See merge request espressif/esp-idf!26612
2023-10-31 14:57:35 +08:00
179bfaca4d Merge branch 'bugfix/disable_fastpbkdf2_hardwaredisable_v5.1' into 'release/v5.1'
fix(wpa_supplicant): implement sha1_finish for fastpbkdf2

See merge request espressif/esp-idf!26683
2023-10-31 14:32:28 +08:00
d9b36afbe6 fix(wpa_supplicant): Fix compilation issue in EAP disabled 2023-10-27 18:08:16 +05:30
f5fec8a720 Merge branch 'bugfix/esp32c6_phy_coex_sleep_issue_v5.1' into 'release/v5.1'
fix(esp_phy): update esp32c6 libphy for coex zb rx and sleep bug (backport v5.1)

See merge request espressif/esp-idf!26668
2023-10-27 20:00:59 +08:00
162e04a641 Merge branch 'backport/support_qa_test_ot_host_config' into 'release/v5.1'
fix(openthread): fix host interface mdoe none(Backport v5.1)

See merge request espressif/esp-idf!26596
2023-10-27 20:00:44 +08:00
99e7db4ce5 fix(wpa_supplicant): implement sha1_finish for fastpbkdf2 2023-10-26 13:30:01 +05:30
d6314b44cc fix(esp_phy): update esp32c6 libphy for coex zb rx and sleep bug 2023-10-25 16:18:35 +08:00
zwx
ad75dc5aea fix(openthread): fix host interface mdoe none 2023-10-20 14:09:29 +08:00
8c6114d0d2 Merge branch 'feature/free_bt_memory_v5.1' into release/v5.1
feat(bt): Frees BLE memory when no longer in use

See merge request espressif/esp-idf!26570
2023-10-20 08:41:19 +08:00
89e7a95f6c Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20230921_v5.1' into 'release/v5.1'
Feature/update openocd to v0.12.0 esp32 20230921 (v5.1)

See merge request espressif/esp-idf!26547
2023-10-20 08:16:36 +08:00
be63dddab4 Merge branch 'bugfix/fix_max_cccds_compilation_issue_v5.1' into 'release/v5.1'
fix(nimble): Fix compilation warnings when max bonds or cccd is set to 0 (v5.1)

See merge request espressif/esp-idf!26415
2023-10-20 08:15:48 +08:00
9e2a1b3109 Merge branch 'bugfix/deepfree' into 'release/v5.1'
fix(ble_mesh): fix compilation failure on using scene model.

See merge request espressif/esp-idf!26356
2023-10-20 08:15:20 +08:00
ae3c28fcc4 Merge branch 'bugfix/update_ble_lib_1018_5_1' into 'release/v5.1'
change(ble): update ble lib on c6 h2 and c2 chip

See merge request espressif/esp-idf!26543
2023-10-20 08:13:01 +08:00
90f9e7a193 Merge branch 'backport/phy_pll_track_corner' into 'release/v5.1'
fix(esp_phy): fix pll track corner case(Backport v5.1)

See merge request espressif/esp-idf!26548
2023-10-19 21:33:40 +08:00
fdacde73e9 Merge branch 'bugfix/deep_sleep_force_to_sleep_v5.1' into 'release/v5.1'
fix(esp_hw_support): Return deep sleep APIs to the original behavior (v5.1)

See merge request espressif/esp-idf!26554
2023-10-19 17:48:43 +08:00
066724f75e ci: tune build jobs parallel count 2023-10-19 11:24:23 +02:00
ea06b047c2 feat(bt): Frees BLE memory when no longer in use
It will free libble.a & libbt all txt, data and bss segment memory.
          This memory is combined into one large memory and put into the heap
          pool.
2023-10-19 14:52:29 +08:00
eccf07022e fix(ble): fixed ble connection timeout issue on ESP32H2 2023-10-19 14:29:52 +08:00
55d3bc2d37 Merge branch 'bugfix/wps_condition_chain_v5.1' into 'release/v5.1'
fix(wifi): Fix static analyzer warning for WPS code (v5.1)

See merge request espressif/esp-idf!26494
2023-10-19 13:51:57 +08:00
zwx
99d68570a6 fix(esp_phy): fix pll track corner case 2023-10-19 10:57:38 +08:00
5457c4c0b8 fix(wifi): Fix static analyzer warning for WPS code 2023-10-18 17:54:40 +05:30
315d4864bb fix(esp_hw_support): Return deep sleep APIs to the original behavior
Closes https://github.com/espressif/esp-idf/issues/12359
2023-10-18 18:18:49 +08:00
bacd3f40bb ble: update controller log module for ESP32-C6, ESP32-H2 and ESP32-C2 2023-10-18 18:11:34 +08:00
zwl
f3447f256f fix(ble): fixed ble connection timeout issue on ESP32H2 2023-10-18 17:10:28 +08:00
20533dccce ble: update controller log module for ESP32-C2 2023-10-18 17:10:28 +08:00
85bc272490 ble: update controller log module for ESP32-H2 and ESP32-C6 2023-10-18 17:10:28 +08:00
1d693ee133 change(ble): update ble lib on c6 h2 and c2 chip 2023-10-18 17:10:19 +08:00
ee6ea577e2 Merge branch 'feature/mbedtls_3_5_0_update_v5.1' into 'release/v5.1'
feat(mbedtls): update to 3.5.0 release (v5.1)

See merge request espressif/esp-idf!26475
2023-10-18 17:06:00 +08:00
4fef94cde2 Merge branch 'bugfix/spurious_beacon_timeout_v51' into 'release/v5.1'
Fixes some WiFi issues(v5.1)

See merge request espressif/esp-idf!26529
2023-10-18 17:03:43 +08:00
1ddbc13499 fix(pytest_gcov): properly extract file path from the gcov output 2023-10-18 10:57:05 +02:00
476ae752eb feat(tools): Update OpenOCD version to v0.12.0-esp32-20230921 2023-10-18 10:57:05 +02:00
bc87e14695 Merge branch 'fix/xtensa-register-corrupted-after-context-switch' into 'release/v5.1'
fix(xtensa): fix registers curruption on context switch

See merge request espressif/esp-idf!26210
2023-10-18 15:25:03 +08:00
6cc6ece701 Merge branch 'backport/openthread_uart_api_refactor' into 'release/v5.1'
feat(openthread): Host connection logic refactor(Backport V5.1)

See merge request espressif/esp-idf!26486
2023-10-18 14:44:11 +08:00
cf16ab59be Merge branch 'bugfix/dpp_bugs_5.1' into 'release/v5.1'
fix(wpa_supplicant): Fix few dpp bugs(v5.1)

See merge request espressif/esp-idf!26464
2023-10-18 14:37:11 +08:00
bdf54031b6 Merge branch 'revert_tcpip_task_priority_macro_v5.1' into 'release/v5.1'
revert(lwip): Revert changes to LWIP task priority macro from MR 25020 (backport v5.1)

See merge request espressif/esp-idf!26512
2023-10-18 14:31:40 +08:00
1aabb5f0d5 Merge branch 'bugfix/revert_pvt_v5.1' into 'release/v5.1'
Revert "feat(volt): chip auto adjust volt for esp32c6 & esp32h2" (v5.1)

See merge request espressif/esp-idf!26485
2023-10-18 10:44:14 +08:00
fb2076c2e9 Merge branch 'bugfix/use_bt_sdp_bqb_include_macro_for_ertm_mode_flag_v5.1' into 'release/v5.1'
fix(bt/bluedroid): Add correct macro for ertm mode included flag (backport v5.1)

See merge request espressif/esp-idf!26455
2023-10-18 10:42:00 +08:00
5abd1ae847 fix(esp_wifi): Fixes issues in beacon_timeout, PMKSA and AID assignment
- Fixes issue wheere beacon timeout would get triggerred multiple times
  leading to a m f probe req.

- Fix missing PMKSA flush scenarios.

- Fix wrong AID assigned to station when multiple stations try to connect
  simultaneously with mixed order of auth-request and assoc-request frames.
2023-10-17 17:24:56 +05:30
e450ee2bcc Merge branch 'fix_esp32s3_irq_names_v5.1' into 'release/v5.1'
fix(interrupts): reorder esp32s3 irq names to align with the respective irq numbers (v5.1)

See merge request espressif/esp-idf!26503
2023-10-17 18:08:31 +08:00
5d4249ec99 Merge branch 'feat/add_support_to_add_auth_data_v5.1' into 'release/v5.1'
fix(esp_http_client): Call event_handler after header value is received (v5.1)

See merge request espressif/esp-idf!26321
2023-10-17 18:08:12 +08:00
7f879a6c48 Merge branch 'bugfix/security_check_order_in_startup_v5.1' into 'release/v5.1'
fix(startup): flip the security configuration check order (v5.1)

See merge request espressif/esp-idf!26361
2023-10-17 18:07:35 +08:00
f3fc7dd924 Merge branch 'bugfix/uart_vfs_select_threadsafe_v5.1' into 'release/v5.1'
fix(vfs/uart): Add support for multi-task call to uart select (v5.1)

See merge request espressif/esp-idf!26317
2023-10-17 18:04:02 +08:00
82d2cdcf5a fix(mbedtls): remove deprecated MBEDTLS_X509_ALLOW_UNSUPPORTED_CRITICAL_EXTENSION
This config has been removed in the upstream mbedTLS starting 3.0
release. Please see mbedTLS changelog for more details.
2023-10-17 10:03:39 +00:00
bf59005fe1 fix(mbedtls): dynamic buffer feature issue with mbedtls 3.5.0
Set max TLS version in the SSL context during setup phase. Dynamic
buffer feature overrides the `mbedtls_ssl_setup` API and hence
this change is required per upstream 3.5.0 codebase change.
2023-10-17 10:03:39 +00:00
e813bbc680 feat(mbedtls): update to 3.5.0 release
Changelog:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.5.0
2023-10-17 10:03:39 +00:00
bf1c39bc03 Merge branch 'protocomm/decouple_wifi_prov_v5_1' into 'release/v5.1'
fix(protocomm): Remove the configuration check of wifi_provisioning for protocomm component(v5.1)

See merge request espressif/esp-idf!26354
2023-10-17 18:03:10 +08:00
63eef40b39 Merge branch 'backport/update_openthread_upstream' into 'release/v5.1'
feat(openthread): update openthread upstream(backportv5.1)

See merge request espressif/esp-idf!26377
2023-10-17 18:02:25 +08:00
143079bfd7 fix(wpa_supplicant/dpp): Ensure dpp follows init->bootstrap->listen path
- esp_supp_dpp_init : Ensures that the mode is set to station before
  the API call.
- Ensures that dpp follows the path of init(esp_supp_dpp_init) ->
  bootstrap(esp_supp_dpp_bootstrap_gen) -> listen(esp_supp_dpp_start_listen)
  by returning errors if any of them is invoked out of order.
2023-10-17 14:27:14 +05:30
cc3b0d9f49 fix(wpa_supplicant): Fix few dpp bugs
1) Fix crash in dpp Listen without bootstrap
  2) Fix crash on receiving dpp auth_req from hostapd with dpp akm
2023-10-17 14:27:14 +05:30
6b492690d3 Merge branch 'ble_dev/added_modem_reset_on_ble_v5_1' into 'release/v5.1'
feat(ble): added modem reset on c2 h2 and c6

See merge request espressif/esp-idf!26449
2023-10-17 15:43:35 +08:00
3f470624de fix(xtensa): fix registers curruption on context switch
a6, a7 registers may be corrupted on multicore ESP chips while FreeRTOS
Kernel SMP context switch
2023-10-17 06:55:46 +00:00
bfe6a24c57 revert(lwip): Revert changes to LWIP task priority macro from MR 25020 (backport v5.1) 2023-10-17 14:39:39 +08:00
0f138dad12 Merge branch 'fix/openthread_mtd_config_typo_backport' into 'release/v5.1'
fix(openthread): fix config typo for mtd (backport v5.1)

See merge request espressif/esp-idf!26397
2023-10-17 14:39:26 +08:00
bbbfa65e2c Merge branch 'bugfix/fix_wrong_mem_caps_in_memory_layout_v5.1' into 'release/v5.1'
fix(heap):  fix the issue on esp32c3 where retention memory was exhausted prematurely and preventing the CPU from powering down  (backport v5.1)

See merge request espressif/esp-idf!26087
2023-10-17 14:38:29 +08:00
da79b8aa5a Merge branch 'bugfix/config_tpoll_fail_v5.1' into 'release/v5.1'
Bugfix/config tpoll fail v5.1

See merge request espressif/esp-idf!26451
2023-10-17 14:34:24 +08:00
5bf6e573ea Merge branch 'bugfix/fix_c6_crash_v5.1' into 'release/v5.1'
fix(phy): fix wifi deinit stuck issue for ESP32C6(v5.1)

See merge request espressif/esp-idf!26478
2023-10-17 14:32:56 +08:00
78ae4c3b8e Merge branch 'bugfix/disable_tsf_tbtt_soc_wakeup_after_wifi_disconnected_v5.1' into 'release/v5.1'
fix(wifi):  fix enable psram wapi dhcp fail issue, fix beacon timeout after connected, fix lightsleep failure after disconnected

See merge request espressif/esp-idf!26400
2023-10-17 14:29:41 +08:00
6d33f7af81 Merge branch 'mqtt/update_submodule_e6afdb_v5.1' into 'release/v5.1'
change(mqtt): Update submodule to e6afdb (v5.1)

See merge request espressif/esp-idf!26257
2023-10-17 14:13:25 +08:00
a7a43973f6 Merge branch 'bugfix/ksz8041_model_number_0x13_v5.1' into 'release/v5.1'
esp_eth: Add model number 0x13 to the list of suported ksz80xx models (backport v5.1)

See merge request espressif/esp-idf!26380
2023-10-17 14:13:00 +08:00
ca8d6f3740 Merge branch 'backport_v5.1' into 'release/v5.1'
Fix some BLE bugs in bluedroid host(backport v5.1)

See merge request espressif/esp-idf!26496
2023-10-17 11:01:55 +08:00
754b2a0de1 fix(interrupts): reorder esp32s3 irq names to align with the respective irq numbers 2023-10-16 22:20:45 +02:00
042fb7834a fix(bt/bluedroid): Fix hid example stack overflow bugs when using esp32s3 2023-10-16 19:56:42 +08:00
296a6cddee fix(bt/bluedroid): Fix remove resolving list error for esp32 2023-10-16 19:56:31 +08:00
f2c3bd38af fix(bt/bluedroid): Fix bugs in ble service change characteristic 2023-10-16 19:56:21 +08:00
3f69d20d4d feat(bt/bluedroid): Support scan response data length zero in BLE 2023-10-16 19:56:12 +08:00
e92c57c6cc fix(bt/bluedroid): Optimize the description of Scan Duplicate in BLE 2023-10-16 19:56:02 +08:00
3bb89e116a feat(openthread): Host connection logic refactor 2023-10-16 15:02:57 +08:00
zlq
17c2931309 feat(bootloader): adjust dbias of bootloader, change clock of H2 to 64
MHz
2023-10-16 14:35:45 +08:00
81dcc61008 Revert "feat(volt): chip auto adjust volt for esp32c6 & esp32h2"
This reverts commit b221f87e00.
2023-10-16 14:35:41 +08:00
0f51501495 Merge branch 'bugfix/h2_i2c1_no_signal_v5.1' into 'release/v5.1'
fix(i2c): I2C port 1 doesn't work on esp32h2 (backport v5.1)

See merge request espressif/esp-idf!26459
2023-10-16 14:13:23 +08:00
42efaf9794 Merge branch 'bugfix/BLEQABR23-632v51' into 'release/v5.1'
fix(ble_mesh): avoid executing bt_mesh_host_init() more than once when using nimble (v5.1)

See merge request espressif/esp-idf!26240
2023-10-16 12:01:28 +08:00
b7d403ddfe fix(ble_mesh): avoid executing bt_mesh_host_init() more than once when using nimble (v5.1) 2023-10-16 12:01:28 +08:00
0bce4b0b72 fix(phy): fix wifi deinit stuck issue for ESP32C6 2023-10-16 11:56:08 +08:00
7781867fbd Merge branch 'bugfix/0925_update_libble_c6_h2_c2_v5.1' into 'release/v5.1'
Bugfix/0925 update libble c6 h2 c2 v5.1

See merge request espressif/esp-idf!26177
2023-10-16 10:50:27 +08:00
21360b9ef3 fix(pm): fix soc wakeup after wifi disconnected, station no respond after m f null, crash when connected to non_trans bssid 2023-10-13 18:17:34 +08:00
7de4e28fdd fix: "erro code" -> "error code" typos 2023-10-13 18:17:34 +08:00
8467bddaea fix(wifi): Fix some wifi issue
1.fix multi antenna issue
2.fix dirty eb when rx HE rate action for C6
3.fix h/w modem state consecutive times when the modem sleep type is modified in runtime
2023-10-13 18:17:34 +08:00
ae604cbbdd fix(i2c): I2C port 1 doesn't work on esp32h2 2023-10-13 15:57:18 +08:00
d62393472c fix(bt/bluedroid): Add correct macro for ertm mode included flag 2023-10-13 14:44:25 +08:00
dc6120ee17 feat(bt/hci): Added Vendor-Specific HCI command to disable DM1 for ACL-U 2023-10-13 14:20:17 +08:00
9fc04635d1 fix(bt/bluedroid): Triggering disconnect event of GAP correctly 2023-10-13 14:20:04 +08:00
fb6a12d24c fix(bt/bluedroid): Fix issue of QoS configuration failure when t_poll is greater than 40 2023-10-13 14:19:47 +08:00
f94b64d820 feat(ble): added modem reset on c2 h2 and c6 2023-10-13 11:42:14 +08:00
CC
9c479e6589 esp_wifi.h typo
typo in esp_wifi_scan_get_ap_num comment
APIs -> APs
2023-10-13 09:29:11 +08:00
c9f7186357 ble: update tx power level index of ESP32-H2 and ESP32-C2 2023-10-12 15:55:29 +08:00
5becfa46bc ble:update c2 libble to 6a8d1f3d, h2 c6 libble to 57ed7949 2023-10-12 15:55:29 +08:00
c1c843f5e2 Merge branch 'bugfix/fix_adc_sar_set_power_mode_no_effect_v5.1' into 'release/v5.1'
ADC: Fixed wrong ADC reading issue caused by ADC and WiFi power conflict on ESP32C6(backport v5.1)

See merge request espressif/esp-idf!26235
2023-10-12 15:18:18 +08:00
46817f4edd Merge branch 'bugfix/parlio_tx_dma_descriptor_v5.1' into 'release/v5.1'
fix(parlio_tx): fix wrong dma descriptor setup (v5.1)

See merge request espressif/esp-idf!26253
2023-10-12 13:39:08 +08:00
f618850370 Merge branch 'change/remove_s3_120_sdr_warning_v5.1' into 'release/v5.1'
mspi: remove s3 120mhz sdr warning (v5.1)

See merge request espressif/esp-idf!26254
2023-10-12 12:36:42 +08:00
1c3b8656d3 Merge branch 'bugfix/rmt_pm_lock_type_v5.1' into 'release/v5.1'
fix(rmt): use ESP_PM_CPU_FREQ_MAX for RMT for non-dma channel (v5.1)

See merge request espressif/esp-idf!26258
2023-10-12 12:31:47 +08:00
2302bc4862 fix(heap): fix memory caps defination in memory_layout
fix the issue on esp32c3 where retention memory was exhausted
prematurely and preventing the CPU from powering down because
all of the last level of RAM is retention dma accessible on
esp32c3.
2023-10-12 11:57:49 +08:00
88093c8618 fix(nimble): Fix compilation issues when max bonds or cccd is set to 0 2023-10-11 14:01:51 +05:30
870d2cac32 (fix)esp_wifi: wifi beacon timeout after connection established 2023-10-11 09:38:51 +08:00
039ef51db5 fix(wifi): fix some wifi issues
1. fix enable psram wapi dhcp fail issue
2. fix c6 esp_wifi_set_max_tx_power fail issue
3. fix wrong wifi mode connect crash issue
4. fix null data sequence number issue
2023-10-10 21:39:56 +08:00
zwx
b0300ed460 fix(openthread): fix config typo for mtd 2023-10-10 20:16:22 +08:00
5a195cdf0a fix(esp_eth): Add model number 0x13 to list of suported models
Add model number 0x13 to KSZ80xx driver's list of supported models
corresonding to KSZ8041RLNI.
2023-10-09 12:42:15 +02:00
zwx
faa2159f06 feat(openthread): update openthread upstream 2023-10-09 16:22:57 +08:00
7745b22cc8 fix(startup): flip the security configuration check order
For cases where the bootloader is not enabled with the security features
ends up receiving an incorrect application with flash encryption enabled
should not really program any security efuses.

In the startup sequence, we first used to program the ROM DL mode
configuration but now we check for the flash encryption related checks
first. If the flash encryption related checks finds that flash
encryption is not enabled on the device then it aborts the boot process.
This is the case with `CONFIG_SECURE_FLASH_CHECK_ENC_EN_IN_APP` enabled.

This would at-least ensure that accidental program of security enabled
application does not really program any ROM DL mode efuses and there is
chance to recover the device.
2023-10-09 03:29:58 +00:00
f75474f359 fix(ble_mesh): fix compilation failure on using scene model. 2023-10-08 16:37:00 +08:00
7bfd475528 fix(protocomm): Remove the configuration check of wifi_provisioning for protocomm component 2023-10-08 16:23:03 +08:00
8a6ca94484 fix(vfs/uart): Add support for multi-task call to uart select (v5.1) 2023-10-05 09:46:30 +02:00
9525da0908 fix(esp_http_client): Call event_handler after header value is received 2023-10-05 10:23:27 +05:30
af53431f59 change(mqtt): Update submodule to e6afdb
Update submodule:
git log --oneline
05b347643f6679cc60a50a9664b86a24ebf3ae10..e6afdb4025fe018ae0add44e3c45249ea1974774

Detailed description of the changes:
* fix: using return value of asprintf now
  - See merge request espressif/esp-mqtt!192
  - See commit https://github.com/espressif/esp-mqtt/commit/c0b40b1
* fix: Uses caps allocation for data buffer instead of item struct
  - See merge request espressif/esp-mqtt!193
  - See commit https://github.com/espressif/esp-mqtt/commit/00ee059
2023-10-02 06:23:35 +00:00
591984aa5d ci(adc): add a test about adc1 work with wifi on c6 2023-09-28 16:24:39 +00:00
0538a7b138 fix(adc): power settings not taking into effect on H2 2023-09-28 16:24:39 +00:00
49013a0560 feat(modem_clock): separate management of modem_adc_common_fe clock and modem_private_fe 2023-09-28 16:24:39 +00:00
b183b88463 fix(adc): power settings not taking into effect on C6 2023-09-28 16:24:39 +00:00
6b1f40b9bf Merge branch 'bugfix/uart_poll_fails_for_pollout_event_v5.1' into 'release/v5.1'
UART: UART_SELECT_WRITE_NOTIF event added in UART driver (v5.1)

See merge request espressif/esp-idf!26191
2023-09-28 13:37:00 +08:00
d02cfc21b7 Merge branch 'feature/walkthrough_for_spp_client_v5.1' into 'release/v5.1'
doc(nimble): Added the tutorial for spp_client example. (v5.1)

See merge request espressif/esp-idf!26201
2023-09-28 13:35:57 +08:00
1adcaf7f99 Merge branch 'feature/support_7.6.1_soc/pvt_auto_dbias_v5.1' into 'release/v5.1'
rtc: auto adjust HP LDO voltage using pvt function(backport 5.1)

See merge request espressif/esp-idf!25995
2023-09-28 13:35:00 +08:00
f837526a0b Merge branch 'bugfix/revert-commits-causing-breaking-change' into 'release/v5.1'
fix(examples): Reverted: Fix example build errors caused by the deep_sleep funcs are returnable

See merge request espressif/esp-idf!26263
2023-09-28 13:07:37 +08:00
f3ac64840e Merge branch 'backport/esp_phy_init_refactor_c3_bt_fix' into 'release/v5.1'
Backport: esp phy init refactor c3 bt fix

See merge request espressif/esp-idf!26262
2023-09-28 12:53:32 +08:00
0122d6cead Merge branch 'feature/add_support_for_ds_peripheral_on_ota_v5.1' into 'release/v5.1'
feat(esp_http_client): Added support for OTA using ds peripheral for TLS (v5.1)

See merge request espressif/esp-idf!26091
2023-09-28 03:23:12 +08:00
d72f2e1305 Merge branch 'bugfix/post_reattempt_cnt_event_v5.1' into 'release/v5.1'
fix(nimble): Add event for reattempt connection count information (v5.1)

See merge request espressif/esp-idf!26111
2023-09-27 23:09:20 +08:00
ea5e7490f3 Merge branch 'bugfix/usb_serial_jtag_write_return_val_v5.1' into 'release/v5.1'
bugfix(usb_serial_jtag): Fix usb_serial_jtag wrong return value, vfs lose data randomly (backport v5.1)

See merge request espressif/esp-idf!26174
2023-09-27 18:37:36 +08:00
1c21f07139 fix(app_update): Reverted: Fix CI test_switch_ota by increasing deepsleep
This reverts commit 7ac7d43541.
2023-09-27 12:26:29 +02:00
1256e6fd6b fix(examples): Reverted: Fix example build errors caused by the deep_sleep funcs are returnable
This reverts commit d521b7d52a.
2023-09-27 12:25:51 +02:00
4c60d48e5b workaround(phy): workaround c3 BT nimble 2M phy issue 2023-09-27 18:21:09 +08:00
c4b6f0cf41 Merge branch 'feature/walkthrough_for_spp_server_v5.1' into 'release/v5.1'
doc(nimble): Added the tutorial for spp_server example. (v5.1)

See merge request espressif/esp-idf!26216
2023-09-27 17:30:11 +08:00
fd7f8ee8f9 Merge branch 'bugfix/fix_condition_to_verify_when_no_SB_v5.1' into 'release/v5.1'
fix(bootloader_support): Fix condition for checking signature in the application (v5.1)

See merge request espressif/esp-idf!26225
2023-09-27 17:20:50 +08:00
86808a09f7 Merge branch 'bugfix/http_client_tcp_config_v5.1' into 'release/v5.1'
http_client: Set common tcp config to both TCP and SSL transport (v5.1)

See merge request espressif/esp-idf!26205
2023-09-27 17:15:10 +08:00
35f1a02ebf fix(rmt): fixed unstable transfer during DFS
Closes https://github.com/espressif/esp-idf/issues/12292
2023-09-27 16:56:47 +08:00
5a06ceebda Merge branch 'bugfix/fix_hid_congestion_v5.1' into 'release/v5.1'
Fix(bt/bluedroid): Fix the issue for HID congestion checking[backport 5.1]

See merge request espressif/esp-idf!26230
2023-09-27 16:24:56 +08:00
584250aa2d Merge branch 'bugfix/temp_clk_gate_v5.1' into 'release/v5.1'
fix(temperature_snesor): Put clock gate enable/disable in to sar_periph_ctrl together(backport v5.1)

See merge request espressif/esp-idf!26171
2023-09-27 15:11:38 +08:00
deea438c23 change(mspi): remove s3 120mhz sdr warning 2023-09-27 14:57:07 +08:00
30529d3916 fix(wifi): Support ESP32 PHY enabled not enter WiFi RX state by default 2023-09-27 14:55:26 +08:00
e5b4308b9d change(ble/controller): disable pll track by default in BLE controller on ESP32-C3 and ESP32-S3 2023-09-27 14:55:26 +08:00
ee087e91c2 fix(CI): fix CI build 2023-09-27 14:55:26 +08:00
f0a4aa4760 fix(phy): move phy tx power track to IDF 2023-09-27 14:55:26 +08:00
zwl
0bbc2805fc fix(phy): Fix ble phy_enable/disable api invoking issue for esp32c2,esp32h2 and esp32c6 2023-09-27 14:55:26 +08:00
9337525cdc fix(phy): Fix PHY enabled enter WiFi RX state default 2023-09-27 14:55:25 +08:00
d4e0de8a6b feat(phy): Add modem type to phy init 2023-09-27 14:55:25 +08:00
e5c8434c6e fix(parlio_tx): fix wrong dma descriptor setup 2023-09-27 14:53:53 +08:00
zlq
7bbe19d92f feat(volt): chip auto adjust volt for esp32c6 & esp32h2 2023-09-27 06:39:59 +00:00
5b45d359d2 Merge branch 'feature/update_esp32h2_sleep_logic_backport_v5.1' into 'release/v5.1'
feat(pm): remove SOC_PM_RETENTION_HAS_CLOCK_BUG for esp32h2 (backport v5.1)

See merge request espressif/esp-idf!26181
2023-09-27 14:38:47 +08:00
cba086c3a8 Merge branch 'bugfix/fix_sleep_risk_vol_param_to_v5.1' into 'release/v5.1'
fix(sleep): fix inproper sleep vol param for esp32c6 & esp32h2 (v5.1)

See merge request espressif/esp-idf!26074
2023-09-27 14:36:10 +08:00
8008dbe624 Merge branch 'test/bqb_test_bt_classic_hfp_v5.1' into 'release/v5.1'
feat(bt/hfp): Add support for HFP BQB auto test (backport v5.1)

See merge request espressif/esp-idf!26222
2023-09-27 14:15:22 +08:00
67e5366863 Merge branch 'bugfix/fix_pma_bad_backup_v5.1' into 'release/v5.1'
fix(sleep): fix pma cfg csr regs bad retention (backport v5.1)

See merge request espressif/esp-idf!26137
2023-09-27 13:47:51 +08:00
4b3cc2aa02 Merge branch 'feature/eth_iram_optimization_v5.1' into 'release/v5.1'
feat(esp_eth): added IRAM optimization option for internal EMAC (v5.1)

See merge request espressif/esp-idf!25842
2023-09-27 10:34:00 +08:00
b5891b61b6 Merge branch 'feature/walkthrough_for_coc_ble_cent_v5.1' into 'release/v5.1'
doc (nimble): Added the tutorial for coc_blecent example. (v5.1)

See merge request espressif/esp-idf!26204
2023-09-27 10:24:29 +08:00
10793c3f7e Merge branch 'bugfix/shared_intr_memory_location_v5.1' into 'release/v5.1'
fix(intr): always allocate memory from internal ram (v5.1)

See merge request espressif/esp-idf!26187
2023-09-27 10:01:46 +08:00
28e62166a0 Merge branch 'test/bqb_test_bt_classic_l2cap_v5.1' into 'release/v5.1'
feat(bt/bluedroid): Add flags for BQB auto test of L2CAP (backport v5.1)

See merge request espressif/esp-idf!26218
2023-09-27 09:52:15 +08:00
98e2f5b391 Merge branch 'feature/locking_layer_for_ecdsa_v5.1' into 'release/v5.1'
feat(esp_hw_support): Added locking mechanism for the ECDSA and ECC peripherals (v5.1)

See merge request espressif/esp-idf!26194
2023-09-27 06:58:14 +08:00
5d0bdce91d Merge branch 'bugfix/fix_modem_reject_deepsleep_v5.1' into 'release/v5.1'
fix(sleep): fix modem reject the deepsleep request (backport v5.1)

See merge request espressif/esp-idf!26102
2023-09-27 05:23:00 +08:00
3a652b2ce0 Merge branch 'update/micro-ecc_submodule_v5.1' into 'release/v5.1'
feat(bootloader): Update micro-ecc version to v1.1 (v5.1)

See merge request espressif/esp-idf!26139
2023-09-26 20:14:59 +08:00
8c74d2795c Merge branch 'feature/walkthrough_for_ble_multi_adv_v5.1' into 'release/v5.1'
doc (nimble): Added the tutorial for ble_multi_adv example. (v5.1)

See merge request espressif/esp-idf!26178
2023-09-26 19:15:55 +08:00
bb307238b4 Merge branch 'ci/increase_all_adc_performance_test_thersh_on_c6_v5.1' into 'release/v5.1'
ci(adc): increase all adc performance test threshold on c6 (v5.1)

See merge request espressif/esp-idf!26138
2023-09-26 17:37:51 +08:00
af4cb757a2 Merge branch 'backport/support_openthread_feature_on_512' into 'release/v5.1'
Backport/support openthread feature for release v5.1.2(backport5.1)

See merge request espressif/esp-idf!26203
2023-09-26 16:40:47 +08:00
f71eccb546 Merge branch 'bugfix/hfp_api_pkt_stat_nums_v5.1' into 'release/v5.1'
fix(bt/bluedroid): Fix the judgment condition for packet transmission status statistics (backport v5.1)

See merge request espressif/esp-idf!26169
2023-09-26 16:37:40 +08:00
e565bc5a1b Merge branch 'bugfix/fix_build_error_in_protocol_examples_v5.1' into 'release/v5.1'
fix: Fix protocols example to build without setting target (v5.1)

See merge request espressif/esp-idf!26200
2023-09-26 16:11:38 +08:00
361b6c00dc fix(nimble): Add event for reattempt connection count information 2023-09-26 13:41:29 +05:30
a4c13f156e fix(bootloader): Update kconfig option 2023-09-26 13:31:43 +05:30
c4e6312687 fix(bootloader_support): Fix condition for SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
Fix the condition to verify the image when SECURE_SIGNED_APPS_ECDSA_V2_SCHEME and
SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT are selected.
2023-09-26 13:31:43 +05:30
83a6683006 fix(bt/bluedroid): Modify the operator name to English in hfp_ag example 2023-09-26 15:10:05 +08:00
8e58ffbd16 fix(bt/bluedroid): Revise the description for index in esp_hf_ag_clcc_response and correct the error return in btc_hf_indchange_notification
1: modify the description of param index in function
esp_hf_ag_clcc_response.
2: fix the error code return of function btc_hf_indchange_notification.
2023-09-26 15:10:04 +08:00
928ece17c1 feat(bt/bluedroid): Add flag to control whether to send AT+CLIP cmd for BQB test 2023-09-26 15:10:04 +08:00
8098e3a9ce feat(bt/bluedroid): Add flag to change HFP client features for BQB test 2023-09-26 15:10:04 +08:00
5734d58c6f feat(bt/bluedroid): Add eSCO S1 support for hfp client BQB test 2023-09-26 15:10:04 +08:00
8996222eb9 feat(bt/bluedroid): Add flag to send BRSF features for hfp ag BQB test 2023-09-26 15:10:04 +08:00
d1c701bfaa feat(bt/bluedroid): Modify the btc hf features for AT+NREC cmd in BQB test 2023-09-26 15:10:04 +08:00
768e15afc5 fix(bt/bluedroid): Fix the process of sending OK in ATD and COPS cmds 2023-09-26 15:10:04 +08:00
e989d9eb32 feat(bt/bluedroid): Add supprot for specific indicator sending from AG to Client 2023-09-26 15:10:04 +08:00
e1ead7ae40 feat(bt/bluedroid): Modify AT+CNUM response api and HFP AG example 2023-09-26 15:10:04 +08:00
186ce934ed feat(bt/bluedroid): Add HFP config for BQB test 2023-09-26 15:10:03 +08:00
aaded3fd59 Merge branch 'bugfix/remove_unused_coex_header_v5.1' into 'release/v5.1'
remove(nimble): Removed unused coex header inclusion (v5.1)

See merge request espressif/esp-idf!26179
2023-09-26 14:27:59 +08:00
f8402c7721 fix(bt/bluedroid): Fix the issue for HID congestion checking 2023-09-26 14:13:36 +08:00
19575dbe3c feat(bt/bluedroid): Add flags for BQB auto test of L2CAP
1: add sdp_bqb_disable_flag to avoid running sdpu_build_n_send_error.
2: add sdp_bqb_inact_timeout_flag to set the SDP inactivity timeout to 90 seconds.
3: add l2cap_bqb_bad_cmd_len_rej_flag to reject the C-Frame with invalid PDU length
4: add l2cap_bqb_ertm_mode_included_flag to set L2CAP_FCR_ERTM_MODE for most L2CAP cases
2023-09-26 14:06:14 +08:00
0d2a52491b Merge branch 'bugfix/check_mapping_target_conflict_v5.1' into 'release/v5.1'
fix(ldgen): check target conflict for entries with section aliases (v5.1)

See merge request espressif/esp-idf!26123
2023-09-26 13:56:27 +08:00
face850973 Merge branch 'feature/rename_wpa2_ent_to_eap_client_v5.1' into 'release/v5.1'
WiFi: Rename WPA2 enterprise APIs to EAP Client. (v5.1)

See merge request espressif/esp-idf!26082
2023-09-26 13:30:52 +08:00
3c8d9a0d77 doc(nimble): Added the tutorial for spp_server example. 2023-09-26 10:23:10 +05:30
4ac53c7cd7 Merge branch 'bugfix/add_params_check_for_hci_v5.1' into 'release/v5.1'
Fixed some HCI commands parameter (backport v5.1)

See merge request espressif/esp-idf!26147
2023-09-26 10:37:02 +08:00
a59f65e68f Merge branch 'bugfix/BLEQABR23-414_v51' into 'release/v5.1'
Fix PB-GATT adv is reported to the app layer too frequently (v5.1)

See merge request espressif/esp-idf!25897
2023-09-26 10:26:30 +08:00
d21aa2330a Fix PB-GATT adv is reported to the app layer too frequently (v5.1) 2023-09-26 10:26:30 +08:00
9e0383cc50 fix(sleep): fix pma cfg csr regs bad retention 2023-09-25 23:52:27 +00:00
b17c8aa3d4 fix(sleep): fix modem reject the deepsleep request 2023-09-25 23:52:01 +00:00
1363566b73 fix(http_client): Set common tcp config to both TCP and SSL transport
Foundation transport contained TCP properties for both TCP and SSL
transport, so it was enough to set the TCP connection properties
(keepalive, interface binding) to one transport only. After merging
5778a7c7 we have separate TCP properties for these transports and need
to set the same for both.
This commit also fixes unnecessary allocation of 1 more byte for if_name

Closes https://github.com/espressif/esp-protocols/issues/322
2023-09-25 14:56:55 +02:00
5caf3b566d doc (nimble): Added the tutorial for coc_blecent example. 2023-09-25 17:57:37 +05:30
b46a32cd92 fix(openthread): update openthread_br lib 2023-09-25 19:42:53 +08:00
3f02e5e901 feat(openthread): enable time sync feature 2023-09-25 19:42:36 +08:00
8a565641c2 feat(openthread): Add some configuration for customer using 2023-09-25 19:41:57 +08:00
d38147037d doc(nimble): Added the tutorial for spp_client example. (v5.1) 2023-09-25 17:04:41 +05:30
7decf3e344 fix: Fix protocols example to build without setting target
Protocol examples used to raise an error if the target was not set
and `idf.py build` command was used. This commit fix this error
and when IDF_TARGET is not set, ESP32 is selected as default target
2023-09-25 16:57:22 +05:30
9a2b707e76 fix(ieee802154): using link0/2 for ieee802154 in esp32h2 chip 2023-09-25 17:26:24 +08:00
f6b589e275 feat(esp_hw_support): Added locking mechanism for the ECDSA and ECC peripheral 2023-09-25 14:33:04 +05:30
710b9d228b feat(esp_hw_support): Add esp_crypto_lock layer for esp32c2 2023-09-25 14:31:18 +05:30
1199806d71 docs(esp_eth): added Ethernet to Improving Network Speed section 2023-09-25 10:54:08 +02:00
80f7e913a0 fix(sleep): fix inproper sleep vol param for esp32c6 & esp32h2 2023-09-25 16:39:46 +08:00
199205026e UART: UART_SELECT_WRITE_NOTIF event added in UART driver
Closes https://github.com/espressif/esp-idf/issues/10986
2023-09-25 10:36:44 +02:00
1cbed4e2c1 fix(intr): always allocate memory from internal ram
Closes https://github.com/espressif/esp-idf/issues/12271
2023-09-25 15:41:15 +08:00
179e3293be change: remove has clock bug macro for esp32h2 2023-09-25 13:40:26 +08:00
0e668ddf63 feat(ble): update ble sleep logic for esp32h2 2023-09-25 13:40:10 +08:00
1d02b6c1c6 feat(ieee802154): update ieee802154 sleep logic and support modem sleep 2023-09-25 13:39:59 +08:00
a9714ebe11 change(wifi): Add dependency of group 19 for MbedTLS crypto 2023-09-25 10:55:07 +05:30
52120cde26 change(wifi): Add supplicant's public API header files to doc 2023-09-25 10:54:52 +05:30
d49c020750 remove(nimble): Removed unused coex header inclusion 2023-09-25 10:38:27 +05:30
c542d62d21 doc (nimble): Added the tutorial for ble_multi_adv example. 2023-09-25 10:35:39 +05:30
518212a8f6 fix(usb_serial_jtag): Clean-up usb_serial_jtag lose byte fix, Closes https://github.com/espressif/esp-idf/pull/11344 2023-09-25 11:05:05 +08:00
0ed7093fb2 [Usb Serial JTAG] printing to console could sometimes skip bytes 2023-09-25 11:04:55 +08:00
69d283b9ae fix(usb_serial_jtag): Fix usb_serial_jtag wrong return value, vfs lose data randomly,
Closes https://github.com/espressif/esp-idf/issues/12119,
Closes https://github.com/espressif/esp-idf/pull/11344,
Closes https://github.com/espressif/esp-idf/issues/9318
Closes https://github.com/espressif/esp-idf/issues/11192
2023-09-25 11:04:16 +08:00
73c78c20a6 fix(temperature_snesor): Put clock gate enable/disable in to sar_periph_ctrl together 2023-09-25 10:57:06 +08:00
36563c86be fix(bt/bluedroid): Fix the judgment condition for packet transmission status statistics 2023-09-25 10:29:34 +08:00
09f6dfa2c4 feat(esp_eth): added IRAM optimization option for internal EMAC 2023-09-25 02:10:29 +00:00
7a32d72409 Merge branch 'doc/fix_misleading_vref_to_vdd_in_dac_doc_v5.1' into 'release/v5.1'
docs(dac): added the explanation to Vref (v5.1)

See merge request espressif/esp-idf!26143
2023-09-22 22:36:08 +08:00
22ab7ff325 fix(bt/controller): Fixed some HCI commands parameter
1: add param check for HCI_Recevie_Synchronization_Train.
2: add param check for HCI_Set_Connectionless_Peripheral_Broadcast.
3: fix slave cannot take a secure authentication.
2023-09-22 15:02:17 +08:00
1880ddca9e docs(dac): added the explanation to Vref (v5.1) 2023-09-22 14:24:13 +08:00
85239ce2af feat(bootloader): Update micro-ecc version to v1.1
This fix ensures that https://nvd.nist.gov/vuln/detail/CVE-2020-27209 is not
reported by the ESP-IDF SBOM tool. Please note that, this CVE was anyways not
applicable for ESP32 platform, as the bootloader (user of micro-ecc library)
do not perform signing on the device, its only verification that happens in
secure-boot-v1 case.
2023-09-22 10:49:43 +05:30
d57651b13c ci(adc): increase all adc performance test threshold on c6 (v5.1) 2023-09-22 12:37:44 +08:00
6ff4bb0994 Merge branch 'refactor/esp_timer_etm_test_v5.1' into 'release/v5.1'
test(etm): refactor systimer etm test case (v5.1)

See merge request espressif/esp-idf!26093
2023-09-22 11:09:55 +08:00
cef55b1712 Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/clk_trees.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/clk_tree.rst (Backport v5.1)

See merge request espressif/esp-idf!26108
2023-09-22 10:52:59 +08:00
198ea10c59 docs: provide CN translation for api-reference/peripherals/clk_tree.rst (Backport v5.1) 2023-09-22 10:52:56 +08:00
c395dd3781 Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/spi_slave_hd.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/spi_slave_hd.rst (Backport v5.1)

See merge request espressif/esp-idf!26107
2023-09-22 10:52:31 +08:00
fb969a4411 docs: provide CN translation for api-reference/peripherals/spi_slave_hd.rst (Backport v5.1) 2023-09-22 10:52:31 +08:00
6d9046a64d Merge branch 'docs/add_Chinese_translation_for_api-reference_peripherals_sdspi_host.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/sdspi_host.rst (Backport v5.1)

See merge request espressif/esp-idf!26106
2023-09-22 10:52:18 +08:00
44351d691b docs: provide CN translation for api-reference/peripherals/sdspi_host.rst (Backport v5.1) 2023-09-22 10:52:18 +08:00
d3b6d0ac18 Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/adc_oneshot.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/adc_oneshot.rst (Backport v5.1)

See merge request espressif/esp-idf!26105
2023-09-22 10:52:00 +08:00
c4df51cb66 docs: provide CN translation for api-reference/peripherals/adc_oneshot.rst (Backport v5.1) 2023-09-22 10:52:00 +08:00
687b97d901 Merge branch 'feature/update_h2_wifi_docs_backport_v5.1' into 'release/v5.1'
feat(doc): update wifi sections for H2 (Backport V5.1)

See merge request espressif/esp-idf!26099
2023-09-22 10:12:53 +08:00
5d8433ec56 fix(ldgen): duplicate entries in the generated .ld file 2023-09-21 19:38:49 +08:00
de93968670 fix(ldgen): check target conflict for entries with section alias 2023-09-21 19:38:49 +08:00
aececf745f Merge branch 'bugfix/some_wifi_fixes_v5.1' into 'release/v5.1'
fix(esp_wifi): Some Wi-Fi bug fixes

See merge request espressif/esp-idf!26084
2023-09-21 18:46:02 +08:00
02ea722492 Merge branch 'change/optimize_sniff_request_v5.1' into 'release/v5.1'
Change(bt/bluedroid): Limit sniff request when pending mode change event[backport 5.1]

See merge request espressif/esp-idf!26053
2023-09-21 17:19:06 +08:00
9f6fe72a46 Merge branch 'bugfix/coex_ble_scan_rate_v5.1' into 'release/v5.1'
fix(esp_coex): Fix esp32 ble scan not restart when wifi start stop (Backport v5.1)

See merge request espressif/esp-idf!26000
2023-09-21 16:18:57 +08:00
5c3f7ed2fd Merge branch 'feature/support_pd_hp_aon_domain_in_deepsleep_v5.1' into 'release/v5.1'
feat(pm/deepsleep): support pd hp aon domain in deepsleep (backport v5.1)

See merge request espressif/esp-idf!26078
2023-09-21 15:36:19 +08:00
2a0a080c9f feat(doc): update wifi sections for H2 2023-09-21 14:28:12 +08:00
1c15c2aded refactor(etm): systimer etm test case
previously we use the systimer event to toggling a GPIO and assert the GPIO level,
which is not stable in CI.
Now we swicth to clear the GPIO at the systimer event.
2023-09-21 13:03:49 +08:00
5fffeddf79 feat(esp_http_client): Added support for OTA using ds peripheral for TLS 2023-09-21 10:21:02 +05:30
25f031c6e1 Merge branch 'backport/optimize-zb-core-implementation-v5.1' into 'release/v5.1'
feat(zigbee): optimize Zigbee example implementation (backport v5.1)

See merge request espressif/esp-idf!26064
2023-09-21 10:34:51 +08:00
08262e1975 Merge branch 'bugfix/fix_cpu_switches_freq_bug_s2s3_to_v5.1' into 'release/v5.1'
EspS2/S3: fixed the bug of insufficient voltage when the CPU switches frequency(V5.1)

See merge request espressif/esp-idf!26044
2023-09-21 10:22:48 +08:00
af7ce38507 Merge branch 'feat/warn_on_unpulled_mqtt_sub_v5.1' into 'release/v5.1'
feat(mqtt): Stop cmake process if submodule is missing (v5.1)

See merge request espressif/esp-idf!26032
2023-09-21 10:12:18 +08:00
941811a0b5 Merge branch 'feature/docker_image_update_qemu8.0.0_v5.1' into 'release/v5.1'
tools: Docker: update QEMU to 8.0.0 version, with xtensa and riscv32 chip support (v5.1)

See merge request espressif/esp-idf!26009
2023-09-21 10:11:22 +08:00
19d710dd61 Merge branch 'gdb_panic_server_remove_v5.1' into 'release/v5.1'
fix(tools): remove unused gdp_panic_server; replace with new esp-idf-panic-decoder package (v5.1)

See merge request espressif/esp-idf!25878
2023-09-21 10:09:07 +08:00
cb174b0fe1 Merge branch 'remove_monitor_tests_v5.1' into 'release/v5.1'
feat(tools/monitor): move target tests to monitor repo (v5.1)

See merge request espressif/esp-idf!26068
2023-09-21 01:57:35 +08:00
7f9b241f7e fix(wifi): fix some esp32c6 wifi bugs 2023-09-20 19:50:44 +08:00
55fcae23c9 esp_wifi: support connectionless manually pwr mgmt 2023-09-20 19:50:05 +08:00
b439f7568c sleep_modem: split esp_wifi_internal_mac_sleep_configure, add lock for pm functions 2023-09-20 19:49:54 +08:00
f66740362e fix(sleep_modem): fix lightsleep failure if enable lightsleep at phy disabled 2023-09-20 19:49:42 +08:00
ae3f3f7a10 feat(esp_wifi):static buf for management,control,qos null,null data rx packet 2023-09-20 19:48:46 +08:00
3d056fd748 fix(esp_wifi): Fix issues with extended caps IE, scan and HT40 mode
-Merges the addition of extended caps IE for assoc req, probe resp
 and beacons in a single place. This ensures that there are no
 duplicate Extended Caps IE in the frame. Moves the capability
 indication for BTM and HT20/40 from supplicant to wifi libs.

-Fix issue with frequent disconections when scanning for only a single
 channel.

-Prints error message and returns ESP_ERR_NOT_SUPPORTED in case
 esp32c2 tries to set bandwidth to HT40.
2023-09-20 19:44:57 +08:00
6c9692ecef change(example): Update eap-fast example 2023-09-20 17:07:00 +05:30
d490e99f74 change(example): Update wifi enterprise example 2023-09-20 17:06:59 +05:30
981086ba30 change(esp_wifi): Rename WiFi enterprise connection APIs 2023-09-20 17:06:59 +05:30
3dc3ee0817 feat(pm/deepsleep): support pd hp aon domain in deepsleep 2023-09-20 19:26:35 +08:00
41d8715dfe Merge branch 'feat/add_internal_pull_up_or_pull_down_option_for_deepsleep_wakeup_prepare_v5.1' into 'release/v5.1'
feat(pm): add internal pull-up/downs option for gpio used for deepsleep wakeup (backport v5.1)

See merge request espressif/esp-idf!26040
2023-09-20 19:15:48 +08:00
013c52afe4 Merge branch 'test/bqb_test_bt_classic_avdtp_v5.1' into 'release/v5.1'
feat(bt/bqb): Add avdt abort function for BQB test (backport v5.1)

See merge request espressif/esp-idf!26045
2023-09-20 19:12:25 +08:00
f37ac82c2b fix(esp_coex): Fix esp32 ble scan not restart when wifi start stop 2023-09-20 17:02:17 +08:00
013a0d4fab Merge branch 'bugfix/update_ble_phy_example_v5.1' into 'release/v5.1'
fix(nimble): Updated BLE Phy example (v5.1)

See merge request espressif/esp-idf!26015
2023-09-20 16:14:48 +08:00
e3beb8ce26 Merge branch 'contrib/github_pr_12179_v5.1' into 'release/v5.1'
fix(uart): Fix uart_ll_set_baudrate div-by-zero crash due to uint32_t overflow (backport v5.1)

See merge request espressif/esp-idf!26014
2023-09-20 16:13:20 +08:00
732dbe8556 feat(tools/monitor): move target tests to monitor repo 2023-09-20 09:23:42 +02:00
e666df3345 feat(zigbee): optimize Zigbee example implementation 2023-09-20 12:38:51 +08:00
ffc8da6ee1 Merge branch 'backport/rcp_size_opt_config' into 'release/v5.1'
Backport/rcp size opt config

See merge request espressif/esp-idf!26010
2023-09-20 11:36:21 +08:00
b8d3ee9844 Merge branch 'contrib/github_pr_12258_v5.1' into 'release/v5.1'
fix(vfs): Fix event_write may not exit critical section (GitHub PR) (v5.1)

See merge request espressif/esp-idf!26047
2023-09-19 20:40:22 +08:00
fe5734b4f1 change(bt/bluedroid): Limit sniff request when pending mode change event 2023-09-19 20:08:04 +08:00
15c7cf4cab feat(bt/bluedroid): Add avdt abort function for BQB test
1: add new AVDTP abort function for BQB test
2023-09-19 19:02:29 +08:00
614024106e feat(openthread): rcp size optimization configurations 2023-09-19 17:15:03 +08:00
d5f3f73f51 fix(openthread): copy the networkname with a null terminator 2023-09-19 17:15:03 +08:00
35535a6b6e Merge branch 'bugfix/suppress_compiler_warning_silent_reboot_is_enabled_v5.1' into 'release/v5.1'
fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled(backport v5.1)

See merge request espressif/esp-idf!26036
2023-09-19 17:13:30 +08:00
20219b8ee6 fix(vfs): Fix event_write may not exit critical section
This commit fixes the event_write() function where the critical section
was unbalanced.

Merges https://github.com/espressif/esp-idf/pull/12258
2023-09-19 08:52:36 +02:00
da6625faae fix(docs): update esp32h2 gpio docs about pin led out 2023-09-19 12:12:05 +08:00
d167087f2d fix(docs): Improve the DFS and Peripheral Drivers section in power_management.rst 2023-09-19 12:12:05 +08:00
b7ed76110c fix(uart): Add 8/16-bit register field access workaround to ESP32C2 2023-09-19 12:12:05 +08:00
9cd0aee51b fix(uart): Fix uart_ll_set_baudrate div-by-zero crash due to uint32_t overflow
Merges https://github.com/espressif/esp-idf/pull/12179
2023-09-19 12:12:05 +08:00
c7132d3f15 Merge branch 'bugfix/error_param_in_BTA_AG_WBS_EVT_v5.1' into 'release/v5.1'
Bugfix/error param in bta ag wbs evt (v5.1)

See merge request espressif/esp-idf!26001
2023-09-19 12:01:11 +08:00
bb33a2bf6b fix cpu switches freq bug s2s3 to v5.1 2023-09-19 11:27:08 +08:00
86e5252d63 feat(pm): add internal pull-up/downs option for gpio used for deepsleep wakeup 2023-09-19 10:59:57 +08:00
a96f2c7674 fix(esp_system): suppress compiler warning if ESP_SYSTEM_PANIC_SILENT_REBOOT is enabled 2023-09-19 10:37:23 +08:00
5badfeefac Merge branch 'bugfix/pthread_cond_var_link_hook_v5.1' into 'release/v5.1'
bugfix(pthread): fixed pthread_condvar linker hook (v5.1)

See merge request espressif/esp-idf!26004
2023-09-19 10:35:57 +08:00
80307247aa feat(mqtt): Stop cmake process if submodule is missing
Closes https://github.com/espressif/esp-idf/issues/12202
2023-09-18 14:34:02 +02:00
783cc77a29 fix(nimble): Updated BLE Phy example
The existing example has some issues which are now fixed.

1. Original example had legacy_pdu set which was not causing
   the PHY to actually change. Fixed this
2. Added a way to initiate connection directly on 2M or Coded Phy.
2023-09-18 13:25:30 +05:30
7fc23046e2 Merge branch 'feat/add_sbom_manifest_file_v5.1' into 'release/v5.1'
feat(nimble): Update nimble submodule pointer for SPDX manifest addition for SBOM tool (v5.1)

See merge request espressif/esp-idf!25994
2023-09-18 15:35:29 +08:00
66c9fb087d Merge branch 'feature/extenal_coexist_slave_support_v5.1' into 'release/v5.1'
feat(esp_coex): add external coex slave support (backport v5.1)

See merge request espressif/esp-idf!25976
2023-09-18 15:06:11 +08:00
8cdc795435 feat(tools/docker): update QEMU to 8.0.0 version, with xtensa and riscv32 chip support 2023-09-18 13:02:36 +07:00
62ad7658ed fix(pthread): fixed pthread_condvar linker hook 2023-09-18 12:31:25 +08:00
8ce86c32d0 Merge branch 'bugfix/fix_some_wifi_bugs_230913_v5.1' into 'release/v5.1'
fix(wifi): fix some wifi bugs 20230913(Backport v5.1)

See merge request espressif/esp-idf!25960
2023-09-18 12:09:31 +08:00
d41661be42 Merge branch 'bugfix/freertos_private_critical_section_macro_v5.1' into 'release/v5.1'
fix(freertos): Fixed bug with prvENTER/EXIT_CRITICAL_OR_MASK_ISR() macro (v5.1)

See merge request espressif/esp-idf!25706
2023-09-18 11:05:21 +08:00
a99bb2e32f Merge branch 'backport/suppport_ot_message_pool_using_PSRAM' into 'release/v5.1'
feat(openthread): support to allocate message pool from PSRAM(backport v5.1)

See merge request espressif/esp-idf!25990
2023-09-18 10:55:41 +08:00
7698a413bc Merge branch 'bugfix/fix_120_ddr_pll_cali_issue_5.1' into 'release/v5.1'
mspi: fixed bbpll calibration issue (v5.1)

See merge request espressif/esp-idf!25980
2023-09-16 00:44:04 +08:00
c546540ef1 feat(nimble): Added SBOM manifest file for SPDX file generation 2023-09-15 17:37:28 +05:30
331cc97d01 feat(openthread): Add support to allocate message pool from PSRAM 2023-09-15 18:30:42 +08:00
7275ae17bd Merge branch 'backport_v5.1' into 'release/v5.1'
fix(bt/bluedroid): Fix set periodic advertising data error(backport v5.1)

See merge request espressif/esp-idf!25956
2023-09-15 11:59:02 +08:00
0b9748f096 Merge branch 'bugfix/usb/host/urb_check_revert_v5.1' into 'release/v5.1'
[USB Host] Fix transfer determination during argument checking for regular EP transfer (backport v5.1)

See merge request espressif/esp-idf!25965
2023-09-15 11:38:13 +08:00
dcddd48d6a Docs: add CN translation for api-guides/performance/speed.rst 2023-09-15 10:53:07 +08:00
85dd7ed731 Merge branch 'bugfix/esp32h2_sleep_current_issue_v5.1' into 'release/v5.1'
fix(esp_phy): fix esp32h2 tx-power incorrect issue after wakeup (backport v5.1)

See merge request espressif/esp-idf!25977
2023-09-15 10:45:26 +08:00
cd193469f2 fix(mspi): fixed bbpll calibration issue 2023-09-15 10:38:44 +08:00
9e756359cc Merge branch 'bugfix/use_xtal_for_c3_wdt_v5.1' into 'release/v5.1'
fix(wdt): changed ESP32-C3 WDT to use XTAL as clock (v5.1)

See merge request espressif/esp-idf!25946
2023-09-15 10:27:38 +08:00
bb8f10533f Merge branch 'docs/docker_image_flashing_v5.1' into 'release/v5.1'
docs(docker): Update Using Remote Serial Port chapter (backport v5.1)

See merge request espressif/esp-idf!25852
2023-09-15 10:26:37 +08:00
6609e5e785 Merge branch 'bugfix/ulp_i2c_fail_opt_v5.1' into 'release/v5.1'
fix(ulp-i2c): fixed ulp i2c not working from main cpu if compiled with 0S or O2 (v5.1)

See merge request espressif/esp-idf!25947
2023-09-15 08:09:03 +08:00
667b83db0e Merge branch 'mqtt/update_submodule_05b3476_v5.1' into 'release/v5.1'
feat(mqtt): Update submodule to 05b3476(v5.1)

See merge request espressif/esp-idf!25768
2023-09-14 19:56:04 +08:00
e7cf51ebec fix(esp_phy): fix esp32h2 tx-power incorrect issue after wakeup 2023-09-14 18:09:30 +08:00
ca37e4dee6 feat(esp_coex): add external coex slave support 2023-09-14 17:59:30 +08:00
b2b9b904f1 Merge branch 'bugfix/set_eir_when_no_eir_data_v5.1' into 'release/v5.1'
change(bt/bluedroid): Send a name tag with zero length when there is no EIR data

See merge request espressif/esp-idf!25949
2023-09-14 15:55:43 +08:00
a28f50d062 fix(wifi): fix ccmp and gcmp PN became large issue 2023-09-14 11:12:48 +08:00
1c7b1b8db0 Merge branch 'bugfix/bugfix_for_esp32c2_esp32c6_esp32h2_v5.1' into 'release/v5.1'
Bugfix/bugfix for esp32c2 esp32c6 esp32h2 v5.1

See merge request espressif/esp-idf!25836
2023-09-14 10:44:12 +08:00
8f9c2c6891 Merge branch 'bugfix/fix_dhcp_server_address_pool_issue_5.1' into 'release/v5.1'
fix(dhcp server): Fix dhcp server address pool issue 5.1

See merge request espressif/esp-idf!25817
2023-09-14 10:39:21 +08:00
ae6fdffcd7 fix(esp_wifi): WPA3 enterprise 192 bit fix and config modification
1. Added SOC caps dependency for enabling 192 bit security in wifi enterprise example
2. Fixed authmode in log and connected event for WPA3 enterprise 192 bit security
2023-09-14 10:14:13 +08:00
45b22c5ef0 Apply 1 suggestion(s) to 1 file(s) 2023-09-14 10:14:13 +08:00
b74c293505 feat(wifi): optimize esp32c6 iperf performance 2023-09-14 10:14:13 +08:00
71c201617e fix(esp_wifi): Skip PMK cache usage if configured password is incorrect 2023-09-14 10:14:13 +08:00
05915fee6e docs(wifi): Update wifi and wifi security documentation
1. Update documentation for WPA3 Enterprise and WPA3 Enterprise 192-bit
mode
2. Update documentation for WPA3 OWE and OWE transition mode
3. Update documentation related to SAE PK, SAE PWE and Transition Disable
4. Update documnetation for wifi connect API
5. Fix config paramter information for wifi scan start
6. Fix documentation related to scan threshold config setting
7. Replace ESP_ERR_WIFI_ARG error code as ESP_ERR_INVALID_ARG
8. Update documentation for 802.11R Fast transition
2023-09-14 10:14:13 +08:00
554e6880bc fix(wifi): fix some bugs in LR and bandwidth
1. Fix the LR rate set fail for espnow and 80211 tx
2. Check phy bandwidth when setting espnow peer rate

Closes https://github.com/espressif/esp-idf/issues/11751
2023-09-14 10:14:13 +08:00
75b1a135ad bugfix(usb/host): Fix transfer direction determination during argument checking for regular EP transfer 2023-09-13 21:51:24 +02:00
1fa048191a Merge branch 'bugfix/failed_module_import_v5.1' into 'release/v5.1'
fix(tools): extend error message for failed python module import (v5.1)

See merge request espressif/esp-idf!25868
2023-09-14 01:50:22 +08:00
5438cfa49f fix(bt/bluedroid): Fix set periodic advertising data error 2023-09-13 17:28:15 +08:00
fc9ce3b5f4 ci(esp_wifi): unit test for fast PBKDF2 validation 2023-09-13 16:33:19 +08:00
4756c22ffa change(esp_wifi): Port fast_pbkdf2 implementation for mbedlts
Add changes to use fast_pbkdf2 as default for PMK calculations.
fast_pbkdf2 is significantly faster than current implementations
for esp chips.

Also removes unnecessary code for pbkdf-sha256 and pbkdf-sha512.
2023-09-13 16:33:19 +08:00
e62d11ef41 change(esp_wifi): Copy fastpbkdf2 implementation
Copy pbkdf2 implementation from https://github.com/ctz/fastpbkdf2(3c56895)
2023-09-13 16:33:19 +08:00
8f05165284 Merge branch 'test/bqb_test_bt_classic_sdp_v5.1' into 'release/v5.1'
feat(bt/bluedroid): Add language base attr list to SDP record for BQB test (backport v5.1)

See merge request espressif/esp-idf!25929
2023-09-13 14:48:41 +08:00
6e1b968d0a Merge branch 'fix/vtaskdelay_caused_etm_test_failure_v5.1' into 'release/v5.1'
fix(test_etm): fix vTaskDelay caused ci failure (v5.1)

See merge request espressif/esp-idf!25945
2023-09-13 14:39:24 +08:00
a79ba4f1bf change(bt/bluedroid): Send a name tag with zero length when there is no EIR data 2023-09-13 14:09:11 +08:00
da33cd2170 feat(mqtt): Update submodule to 05b3476
* Update submodule:
git log --oneline dffabb067fb3c39f486033d2e47eb4b1416f0c82..05b347643f6679cc60a50a9664b86a24ebf3ae10

Detailed description of the changes:
* Fix: Mock test should include idf_additions.h
  - See merge request espressif/esp-mqtt!191
  - fix: Mock tests include idf_additions.h (espressif/esp-mqtt@f35aaa1)
* Adds missing documentation to outbox configuration.
  - See merge request espressif/esp-mqtt!190
  - docs: Adds missing documentation to outbox configuration. (espressif/esp-mqtt@c355e0b)
* fix: Added missing update to message data
  - See merge request espressif/esp-mqtt!189
  - See commit https://github.com/espressif/esp-mqtt/commit/cc41d1b
* PR: fixing typos in `mqtt5_error_reason_code`
  - See merge request espressif/esp-mqtt!188
  - feat: Add enum definition with typo to keep backwards compatibility (espressif/esp-mqtt@90b4a45)
  - fixing typos in `mqtt5_error_reason_code` (espressif/esp-mqtt@dc775bb)
* docs: Clarify keepalive timeout
  - See merge request espressif/esp-mqtt!186
  - See commit https://github.com/espressif/esp-mqtt/commit/cb1e6cf
* fix: LOG format strings
  - See merge request espressif/esp-mqtt!187
  - See commit https://github.com/espressif/esp-mqtt/commit/a3b04f2
* Fix: Stop client only if it's running.
  - See merge request espressif/esp-mqtt!183
  - See commit https://github.com/espressif/esp-mqtt/commit/36eec6f
* fix: Error on publish message creation was ignored.
  - See merge request espressif/esp-mqtt!185
  - See commit https://github.com/espressif/esp-mqtt/commit/585e3ba
* Fix: Allocation for connection buffer was incorrectly done.
  - See merge request espressif/esp-mqtt!182
  - See commit https://github.com/espressif/esp-mqtt/commit/6c849c6
* Adds mqtt host tests to Ci
  - See merge request espressif/esp-mqtt!181
  - See commit https://github.com/espressif/esp-mqtt/commit/4050df4
* Fix: Outbox was leaked in case of initialization failure
  - See merge request espressif/esp-mqtt!180
  - See commit https://github.com/espressif/esp-mqtt/commit/5d491a4
* feat: Add option to bind interface of use
  - See merge request espressif/esp-mqtt!179
  - Closes https://github.com/espressif/esp-mqtt/issues/253
  - See commit https://github.com/espressif/esp-mqtt/commit/363fbf7
* Add outbox size control feature
  - See merge request espressif/esp-mqtt!141
  - feat: Introduces outbox limit (espressif/esp-mqtt@372ab7b)
  - Removes unused outbox functions. (espressif/esp-mqtt@21a5491)
  - refactor: Group access to output buffer in mqtt_connection_t (espressif/esp-mqtt@122875b)
* Add custom transport configuration
  - See merge request espressif/esp-mqtt!169
  - feat: Add custom transport configuration (espressif/esp-mqtt@a5c1b44)
* Removes leftover calls to event_handler
  - See merge request espressif/esp-mqtt!178
  - See commit https://github.com/espressif/esp-mqtt/commit/a492935
* PR: Added support to set server common name.
  - See merge request espressif/esp-mqtt!173
  - Added support to set server common name. (espressif/esp-mqtt@6195762)
* Merge branch 'bugfix/return_on_qos0_disconnected' into 'master'
  - See merge request espressif/esp-mqtt!175
  - See commit https://github.com/espressif/esp-mqtt/commit/5bd9724
* Merge branch 'bugfix/cpp_compilation' into 'master'
  - See merge request espressif/esp-mqtt!174
  - See commit https://github.com/espressif/esp-mqtt/commit/70cbaca
* bug: Incorrect return on disconnect qos0 publish
  - See merge request espressif/esp-mqtt!172
* Fix: Compilation in C++ with multiple subscribe
  - See merge request espressif/esp-mqtt!171
* ci: Fix qemu build against 5.1
  - See merge request espressif/esp-mqtt!170
  - See commit https://github.com/espressif/esp-mqtt/commit/94defb8
* Minor cleanups on mqtt client
  - See merge request espressif/esp-mqtt!168
  - Removes pending message count (espressif/esp-mqtt@da6d38a)
  - Bugfix: Dispatch transport error on all write operations (espressif/esp-mqtt@5729048)
  - Merge enqueue functions (espressif/esp-mqtt@72833c7)
* Adds a configuration for outbox data destination
  - See merge request espressif/esp-mqtt!166
  - feat: Adds a configuration for outbox data destination (espressif/esp-mqtt@2c71f9e)
* CI: Add configuration for ttfw
  - See merge request espressif/esp-mqtt!167
  - See commit https://github.com/espressif/esp-mqtt/commit/d71dcf3
* mqtt5: Fix flow control will increase count when send fragmented packet
  - See merge request espressif/esp-mqtt!164
  - Closes https://github.com/espressif/esp-mqtt/issues/255
  - See commit https://github.com/espressif/esp-mqtt/commit/5cce2c4
* Add license information to queue
  - See merge request espressif/esp-mqtt!163
  - See commit https://github.com/espressif/esp-mqtt/commit/36f0faa
* MQTTv5: Fixes and additions from GitHub PRs
  - See merge request espressif/esp-mqtt!162
  - Merges https://github.com/espressif/esp-mqtt/pull/250
  - fix: Allow MQTT v5 zero length payload (espressif/esp-mqtt@65a4fda)
  - feature: Include subscribe_id in esp_mqtt5_event_property_t (espressif/esp-mqtt@1011e63)
* Feature:  Enable SUBSCRIBE to multiple topics
  - See merge request espressif/esp-mqtt!156
  - See commit https://github.com/espressif/esp-mqtt/commit/3210255
* Adds Kconfig option to configure poll read timeout
  - See merge request espressif/esp-mqtt!159
  - Closes: https://github.com/espressif/esp-mqtt/issues/245
  - See commit https://github.com/espressif/esp-mqtt/commit/2fa945d
* Fix formatting when using printf nano
  - See merge request espressif/esp-mqtt!160
  - See commit https://github.com/espressif/esp-mqtt/commit/e9b865e
* mqtt5: Fix flow control will regard the DUP packet and not consider PUBCOMP packet
  - See merge request espressif/esp-mqtt!158
  - Closes https://github.com/espressif/esp-mqtt/issues/243
  - See commit https://github.com/espressif/esp-mqtt/commit/ed76036
* Remove possible null pointer dereferences
  - See merge request espressif/esp-mqtt!157
  - Bugfix: Remove Remove possible null pointer dereferences (espressif/esp-mqtt@f80772b)
2023-09-13 06:08:13 +00:00
9d8af9748b Merge branch 'bugfix/fix_compilation_issue_enc_adv_v5.1' into 'release/v5.1'
fix(nimble): Fix compilation issue of unknown MYNEWT_VAL(v5.1)

See merge request espressif/esp-idf!25856
2023-09-13 13:31:36 +08:00
c7532e27fa fix(ulp-i2c): fixed ulp i2c not working from main cpu if compiled with 0S or O2
Compiler would optimize register write to use s8i which do not work for IO registers

Closes https://github.com/espressif/esp-idf/issues/12214
2023-09-13 11:47:36 +08:00
e29d4bd428 fix(dhcp server):fix set dhcp server poll fail issue 2023-09-13 10:49:21 +08:00
41a291fee0 fix(wdt): changed WDT clock source to XTAL for C6/H2
Previously it used PLL, but PLL could potentially be powered down by power-management
when CPU frequency changed.
2023-09-13 10:45:51 +08:00
c192ea478e fix(wdt): changed ESP32-C3 WDT to use XTAL as clock
This clock is unchanged even when CPU/APB frequency changes (e.g. due to esp_pm),
which means timeout period is correct even after such a change.
2023-09-13 10:45:49 +08:00
111779db5a Merge branch 'feature/configurable_wpa2_ent_v5.1' into 'release/v5.1'
Make enterprise support configurable to save binary size.(v5.1)

See merge request espressif/esp-idf!25558
2023-09-13 10:18:05 +08:00
f99b98a0f6 Merge branch 'doc/fix_xts_key_length_256_desc_v5.1' into 'release/v5.1'
fix(doc): Fix incorrect description for xts_key_length_256 efuse (v5.1)

See merge request espressif/esp-idf!25931
2023-09-13 10:06:24 +08:00
25922444a6 fix(test_etm): fix vTaskDelay caused ci failure 2023-09-13 10:04:30 +08:00
09c1bfe6b3 Merge branch 'bugfix/fix_hidd_send_rpt_without_connection_v5.1' into 'release/v5.1'
Change(bt/bluedroid): Optimize HIDD sending interrupt report behavior[backport 5.1]

See merge request espressif/esp-idf!25917
2023-09-13 09:13:33 +08:00
5d7bcdcf82 Merge branch 'bugfix/esp32c6_udp_bc_mc_short_time_cause_packet_loss_v5.1' into 'release/v5.1'
backport v5.1: optimize the retention step of the APM and TEE modules to set only the critical parts to level 2 priority

See merge request espressif/esp-idf!25837
2023-09-12 20:50:12 +08:00
8088c7216e fix(freertos): Fixed bug with prvENTER/EXIT_CRITICAL_OR_MASK_ISR() macro
Fixed an undiscovered bug with prvENTER_CRITICAL_OR_MASK_ISR() and
prvEXIT_CRITICAL_OR_MASK_ISR() where the `uxInterruptStatus` argument was not
used.

However, all calls of this macro provide a local `uxSavedInterruptStatus`
variable, leading to this bug being hidden.
2023-09-12 20:18:23 +08:00
a86522d614 fix(nimble): Fix compilation issue of unknown MYNEWT_VAL 2023-09-12 16:49:57 +05:30
da575a6afa Merge branch 'bugfix/ext_adv_log_v5.1' into 'release/v5.1'
fix(nimble): added log for extended advertisement (v5.1)

See merge request espressif/esp-idf!25928
2023-09-12 19:17:55 +08:00
2c1334ef1c change(ble): update controller log print interface 2023-09-12 15:50:54 +08:00
d612db3bca fix(doc): Fix incorrect description for xts_key_length_256 efuse 2023-09-12 14:52:48 +08:00
393530fb56 feat(bt/bluedroid): Add language base attr list to SDP record for BQB test 2023-09-12 13:04:23 +08:00
fc8d7e7f89 fix(nimble): added log for extended advertisement 2023-09-12 10:26:36 +05:30
5baf0197f0 Merge branch 'feature/modify_mcpwm_clock_pre_scale_v5.1' into 'release/v5.1'
feat(mcpwm): Make the MCPWM capture timer's resolution configurable (v5.1)

See merge request espressif/esp-idf!25904
2023-09-12 11:30:39 +08:00
40c6f1390d Merge branch 'update/docs_api_refs_modbus_esp32h2_v51' into 'release/v5.1'
docs: updated modbus api reference documents for target esp32h2 (Backport v5.1)

See merge request espressif/esp-idf!24972
2023-09-12 10:10:40 +08:00
4c06791a40 docs: updated modbus api reference documents for target esp32h2 2023-09-11 13:41:07 +00:00
1963f75fa7 change(bt/bluedroid): Optimize HIDD sending interrupt report behavior
HID device is allowed to trigger reconnection by sending an interrupt
report. When reconnection is in progress, no more interrupt report can
be sent until the procedure is accomplished.
2023-09-11 20:12:35 +08:00
649b8bc6d5 Merge branch 'feature/support_ot_bugfixing' into 'release/v5.1'
Feature/support ot bugfixing(backport v5.1)

See merge request espressif/esp-idf!25676
2023-09-11 20:07:28 +08:00
a8790378e9 fix(bt/bluedroid): Fixed incorrect arrangement in type esp_hf_dial_type_t 2023-09-11 19:45:30 +08:00
36ba902bfe change(bt/bluedroid): Added line information printing when error occurs CHECK_HF_IDX 2023-09-11 19:45:30 +08:00
ca1ef30aa7 fix(bt/bluedroid): Fixed the issue of uninitialized parameters in event BTA_AG_WBS_EVT 2023-09-11 19:45:29 +08:00
a432b1459e Merge branch 'feature/lp_wdt_h2_5.1' into 'release/v5.1'
LP-WDT: add support for H2 (v5.1)

See merge request espressif/esp-idf!25863
2023-09-11 19:04:00 +08:00
31aa471af8 Merge branch 'contrib/github_pr_11869_v5.1' into 'release/v5.1'
bugfix: avoid warning in espcoredump when log disabled (GitHub PR) (v5.1)

See merge request espressif/esp-idf!25143
2023-09-11 14:42:10 +08:00
be9d8ef709 Merge branch 'feature/freertos_add_sbom_file_v5.1' into 'release/v5.1'
feat(freertos): Added SBOM manifest file for SPDX file generation (v5.1)

See merge request espressif/esp-idf!25891
2023-09-11 13:48:28 +08:00
0c27d2467d Merge branch 'bugfix/pbc_overlap_in_wps_pin_method_v5.1' into 'release/v5.1'
Fix for issue of wps-pbc overlap in wps-pin method(v5.1)

See merge request espressif/esp-idf!25695
2023-09-11 12:12:29 +08:00
d8e5b2ac41 feat(mcpwm): Set group clock prescale dynamically
MCPWM group clock pre scale was originally fixed to 2, which is
inconvenient. Set group clock prescale dynamically. Now the maximum
resolution of the MCPWM timer is up to 160MHz(when the prescale set
to 1). And add a resulotion config for MCPWM capture.
2023-09-11 11:29:28 +08:00
1d91310e0f Merge branch 'bugfix/wps_wpa3_passphrase_v5.1' into 'release/v5.1'
WiFi: get passphrase in WPS if AP support SAE (v5.1)

See merge request espressif/esp-idf!25885
2023-09-11 10:54:18 +08:00
680a254b18 Merge branch 'bugfix/hf_ag_report_event_with_null_bdaddr_v5.1' into 'release/v5.1'
Bugfix/fixed bugs of HFP in BlueDroid (v5.1)

See merge request espressif/esp-idf!25827
2023-09-11 10:54:09 +08:00
123fcbbf36 Merge branch 'fix/spiffs_log_errors_v5.1' into 'release/v5.1'
fix(spiffs): SPIFFS print formatter errors out (v5.1)

See merge request espressif/esp-idf!25392
2023-09-11 10:10:23 +08:00
79cd68f969 Merge branch 'fix/nvs_tool_invalid_entry_none_check_v5.1' into 'release/v5.1'
NVS: nvs_tool.py entry.data None check fix (v5.1)

See merge request espressif/esp-idf!24495
2023-09-11 10:09:08 +08:00
c99a5e6185 Merge branch 'feature/walkthrough_for_ble_periodic_adv_and_ble_periodic_sync_v5.1' into 'release/v5.1'
doc (nimble): Added the tutorial for ble_periodic_adv and ble_periodic_sync_examples. (v5.1)

See merge request espressif/esp-idf!25729
2023-09-11 10:07:54 +08:00
c1e0210285 Merge branch 'feature/walkthrough_for_nimble_examples_v5.1' into 'release/v5.1'
doc (nimble): Added Walkthrough tutorial for phy_cent example (v5.1)

See merge request espressif/esp-idf!24650
2023-09-11 10:07:40 +08:00
da07a096d0 Merge branch 'test/bqb_test_bt_classic_hid_v5.1' into 'release/v5.1'
feat(bt/bqb): Add setting local di record function for specific hid case of bqb auto test (backport v5.1)

See merge request espressif/esp-idf!25833
2023-09-11 07:36:25 +08:00
697e3e8eac Merge branch 'fix/click-port-compl_v5.1' into 'release/v5.1'
fix(tools): fix autocomplete for --port option (v5.1)

See merge request espressif/esp-idf!25874
2023-09-08 23:05:43 +08:00
4afb2a86e2 Merge branch 'backport_v5.1' into 'release/v5.1'
fix(bt/bluedroid): Fix memory no free issue when disconneting for mesh(backport v5.1)

See merge request espressif/esp-idf!25859
2023-09-08 20:39:49 +08:00
b717333177 Merge branch 'bugfix/reduce_bss_logging_v5.1' into 'release/v5.1'
wifi: Reduce BSS logging in wpa_supplicant

See merge request espressif/esp-idf!25825
2023-09-08 19:19:43 +08:00
4d8644bfa8 feat(freertos): Added SBOM manifest file for SPDX file generation
This commit adds the SBOM manifest file for the FreeRTOS-Kernel to aid
SPDX file generation.
2023-09-08 12:55:47 +02:00
797ec25a3f fix(wifi): Get passphrase in WPS if AP support SAE
Also add changes to send NACK if WPS message received twice.
2023-09-08 15:21:56 +05:30
9eceef649b Merge branch 'bugfix/esp32h2_update_desc_ecdsa_workmode_v5.1' into 'release/v5.1'
fix(soc/esp32h2): Update the description of the ECDSA_WORK_MODE (backport v5.1)

See merge request espressif/esp-idf!25818
2023-09-08 16:09:42 +08:00
27f84d88dc ble: support esp32c2 wakeup overhead 2023-09-08 15:52:23 +08:00
3d8c34efd5 feat(tools): remove gdb_panic_server and use just a wrapper for script
gdb_panic_server is now part of esp-idf-panic-decoder
2023-09-08 09:34:12 +02:00
b83a56512a fix(tools): fix autocomplete for --port option
Closes https://github.com/espressif/esp-idf/issues/7970
2023-09-08 09:25:33 +02:00
2c3c4adaa3 docs(docker): Update Using Remote Serial Port chapter
By default some shells such as zsh has NOMATCH option set (https://zsh.sourceforge.io/Doc/Release/Options.html).
The root cause of the problem is that while bash expands the parameter to itself if it does not match any filename, the zsh reports an error. IOW if we do % setopt nonomatch it will work even in zsh.

Closes https://github.com/espressif/esp-idf/issues/12060
2023-09-08 09:15:30 +02:00
9896ee353b ble: update esp32h2 and esp32c6 libble to a9fa2002 2023-09-08 14:27:48 +08:00
dff4ec6fbf fix(tools): extend error message for failed python module import
Currently idf.py reports just "Please use idf.py only in an ESP-IDF shell environment".
Sometimes it may be useful to know for which module the import failed.
Also the problem does not have to be related to shell environment only, but the
python venv can be corrupted. This adds a little bit more verbose error
message.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-09-08 07:29:43 +02:00
5f55496f51 feat(openthread): support BR deinit 2023-09-08 12:24:36 +08:00
0a6d6c085a feat(wdt): add LL functions for WDT on H2 2023-09-08 11:01:25 +08:00
03be63636a fix(bt/bluedroid): Fix memory no free issue when disconneting for mesh 2023-09-08 10:33:42 +08:00
ab7ad8a848 Merge branch 'bugfix/fix_some_ble_bugs_v5.1' into 'release/v5.1'
Fixed some BLE bugs (backport v5.1)

See merge request espressif/esp-idf!25776
2023-09-08 10:19:40 +08:00
b3717678c3 Merge branch 'docs/update_multi_antenna_switch_docs_v5.1' into 'release/v5.1'
Docs/update multi antenna switch docs v5.1(Backport v5.1)

See merge request espressif/esp-idf!25822
2023-09-08 10:18:43 +08:00
8d0858060a Merge branch 'feature/management_modem_etm_clock_indepently_v5.1' into 'release/v5.1'
feat(esp_hw_support): manage modem_etm clock in modem_clock for bt/154 indepently (backport v5.1)

See merge request espressif/esp-idf!25793
2023-09-08 10:16:59 +08:00
ef451cab0f Merge branch 'bugfix/sntp_cpp_compat_v5.1' into 'release/v5.1'
esp_netif: Fix invalid conversion from int to enumeration in c++ build (GitHub PR) (v5.1)

See merge request espressif/esp-idf!25041
2023-09-08 10:16:21 +08:00
5aa01470d5 ci(bt/bluedroid): Add CI build test for HFP examples with voice over HCI enabled 2023-09-08 00:52:07 +00:00
7e406acb95 feat(bt/api): Add new apis for hfp to get the numbers of packet status received and sent 2023-09-08 00:52:07 +00:00
26600a8fcf fix(bt/bluedroid): Deleted the redundant 'memset' in btc_hf_cb_handler 2023-09-08 00:52:07 +00:00
c6e62a9817 docs(bt/bluedroid): Changed the description of esp_hf_client_reject_call 2023-09-08 00:52:07 +00:00
2584ab84fc fix(bt/bluedroid): Fixed invalid access to freed semaphore 2023-09-08 00:52:07 +00:00
eed85adaeb fix(bt/bluedroid): Fixed wrong indexes of HF-AG indicators 2023-09-08 00:52:07 +00:00
71ec923e55 fix(bt/bluedroid): Added peer Bluetooth device address into HF callback parameters 2023-09-08 00:52:07 +00:00
7037ee47f9 fix(bt/bluedroid): Changed log level from WARNING to DEBUG in bta_ag_sco_read_cback 2023-09-08 00:52:07 +00:00
0167b14411 fix(bt/bluedroid): Fixed wrong code logic in 'AT+CIND?' of HFP 2023-09-08 00:52:07 +00:00
17d1b66d47 fix(bt/bluedroid): Fixed errors in parsing ATD command in HFP AG 2023-09-08 00:52:07 +00:00
19185a65fd fix(bt/bluedroid): Fixed NULL Bluetooth device address in HF-AG events was reported to application layer 2023-09-08 00:52:07 +00:00
c1d8013330 Merge branch 'bugfix/backport_phy_v5.1' into 'release/v5.1'
fix(phy): backport some phy fix(v5.1)

See merge request espressif/esp-idf!25734
2023-09-08 06:18:58 +08:00
752a99d3d1 Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/temp_sensor.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/temp_sensor.rst (backport v5.1)

See merge request espressif/esp-idf!25821
2023-09-07 18:05:02 +08:00
f0dec1b1a6 docs: provide CN translation for api-reference/peripherals/temp_sensor.rst (backport v5.1) 2023-09-07 18:05:01 +08:00
8254175931 wpa_supplicant: Fix for issue of wps-pbc overlap in wps-pin method 2023-09-07 15:14:35 +05:30
fefa61a7c7 Merge branch 'feature/esp_lcd_st7789_rgb_data_endian_config_v5.1' into 'release/v5.1'
feat(st7789): add data endian config (v5.1)

See merge request espressif/esp-idf!25802
2023-09-07 16:33:49 +08:00
zwl
325bf39c89 feat(ble): enable adv report flow control on esp32c2 2023-09-07 16:27:50 +08:00
zwl
615f9bd602 fix(ble): fixed crash when memory is insufficient on esp32c2 2023-09-07 16:27:42 +08:00
cbb2a3f8fa fix(esp32c6/power save): optimize the retention step of the APM and TEE modules to set only the critical parts that affect wifi data frame receipt to level 2 priority 2023-09-07 14:31:12 +08:00
648bc35612 feat(bt/bluedroid): Add setting local di record function for bt classic hid device bqb test 2023-09-07 14:18:03 +08:00
e29b67c02a fix(bt/bluedroid): Changed HID related copyright automatically 2023-09-07 14:17:42 +08:00
63bc27fb2d Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/adc_calibration.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/adc_calibration.rst (backport v5.1)

See merge request espressif/esp-idf!25820
2023-09-07 14:02:24 +08:00
3c0e72887a docs: provide CN translation for api-reference/peripherals/adc_calibration.rst (backport v5.1) 2023-09-07 14:02:24 +08:00
cbee3f67b2 Merge branch 'docs/add_Chinese_translation_for_api-guides/cplusplus.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-guides/cplusplus.rst (backport v5.1)

See merge request espressif/esp-idf!25755
2023-09-07 13:15:27 +08:00
36376e0eab docs: provide CN translation for api-guides/cplusplus.rst (backport v5.1) 2023-09-07 13:15:27 +08:00
397206d050 change(wifi): Reduce BSS logging in wpa_supplicant 2023-09-07 10:19:02 +05:30
01ebf0775e esp_wifi: update multi antenna switch docs 2023-09-07 11:06:28 +08:00
e0e3bbd042 esp_wifi: the antenna parameter of example is not correct 2023-09-07 11:06:18 +08:00
3874281107 update esp32 bt-lib (7b24543)
- Support BLE RX error packet count record
- Fixed instant setting for LLC procedures with instants
- Fixed adv random delay when adv interval is less than 20ms
2023-09-07 11:05:10 +08:00
c315a246e6 Update bt lib for ESP32-C3 and ESP32-S3(59725b5)
- Support BLE RX error packet count record
- Fixed adv random delay when adv interval is less than 20ms
- Fixed adv random address setting when owner address type is public
2023-09-07 11:05:10 +08:00
5b7fcd80d2 Update bt lib for ESP32-C3 and ESP32-S3(ff6efe7)
- fix(bt/controller): Fixed PHY enable and disable
- feat(bt/controller): Support DAA and LBT mode for BLE CCA
2023-09-07 11:05:10 +08:00
0f6a7ac7b1 fix(bt): Fix bugs about updating connect param 2023-09-07 11:05:10 +08:00
e3c5c4fb7b fix(bt): Fix bug while calculating block cipher using aes-128 2023-09-07 11:05:10 +08:00
98f59569b0 docs(bt): Update comment in ble 2023-09-07 11:05:10 +08:00
cc9c5b78b9 feat(bt/bluedroid): Support periodic adv adi feature 2023-09-07 11:05:09 +08:00
985f6a4892 fix(bt/bluedroid): Fixed BLE disconnect event report when disconnecting 2023-09-07 11:05:09 +08:00
9df464d7bb fix(bt/bluedroid): Fixed GATTC cache address save when list is full 2023-09-07 11:05:09 +08:00
35af1c03e2 feat(bt/bluedroid): Support high duty adv interval setting 2023-09-07 11:05:09 +08:00
52a0a10ef4 fix(bt/bluedroid): Fix address check when using NRPA as random device address 2023-09-07 11:05:09 +08:00
9aeafb006e fix(dhcp server): Fix dhcp server address pool issue 2023-09-07 10:35:52 +08:00
9ed6944c0d fix(soc/esp32h2): Update the description of the ECDSA_WORK_MODE 2023-09-07 10:34:36 +08:00
4a221b0346 Merge branch 'feature/ble_lib_update_h2_c6_v5.1' into 'release/v5.1'
ble: update h2 c6 libble to 5d7af429

See merge request espressif/esp-idf!25692
2023-09-07 10:25:18 +08:00
d22e640579 Merge branch 'bugfix/aes_dma_descriptor_setup_issue_v5.1' into 'release/v5.1'
fix(aes): correct the linking of the DMA descriptors (v5.1)

See merge request espressif/esp-idf!25784
2023-09-07 10:24:09 +08:00
9331e240fc fix(phy): backport some phy fix
1. WIFI RX multipath optimization for all chips
2. BLE TX sideband optimization for C3/S3
3. Optimize ht40 tx side band issue
2023-09-07 02:23:06 +00:00
98f4ce2011 Merge branch 'bugfix/fix_some_hci_cmd_param_check_v5.1' into 'release/v5.1'
fix(bt/controller): Fixed some HCI commands parameter check (Backport v5.1)

See merge request espressif/esp-idf!25712
2023-09-07 07:41:15 +08:00
94ad8f1a6a Merge branch 'feature/dynamic_services_v5.1' into 'release/v5.1'
Nimble: Add support for dynamic service addition / deletion (v5.1)

See merge request espressif/esp-idf!25742
2023-09-06 17:18:27 +08:00
9d535c05f7 feat(st7789): add data endian config
Closes https://github.com/espressif/esp-idf/issues/11416
2023-09-06 16:59:13 +08:00
d3bfaf8f5f feat(esp_hw_support): manage modem_etm clock in modem_clock for bt/154 indepently 2023-09-06 15:48:37 +08:00
8ff8486735 Merge branch 'fix/spi_polling_api_buslock_logic_v5.1' into 'release/v5.1'
fix(spi_master): polling_transmit forgot release bus lock when alloc DMA buffer failed (v5.1)

See merge request espressif/esp-idf!25576
2023-09-06 14:01:25 +08:00
5605189398 fix(aes): correct the linking of the DMA descriptors
For certain data lengths, the last input descriptor was not getting appended
correctly and hence the EOF flag in the DMA descriptor link list was
set at incorrect location. This was resulting in the peripheral being
stalled expecting more data and eventually the code used to timeout
waiting for the AES completion interrupt.

Required configs for this issue:

CONFIG_MBEDTLS_HARDWARE_AES
CONFIG_SOC_AES_SUPPORT_DMA

This observation is similar to the issue reported in:
https://github.com/espressif/esp-idf/issues/10647

To recreate this issue, start the AES-GCM DMA operation with data length
12280 bytes and this should stall the operation forever.

In this fix, we are tracing the entire descriptor list and then appending the
extra bytes descriptor at correct position (as the last node).
2023-09-06 08:28:43 +05:30
2fbe919e4c fix(aes-gcm): correct the DMA completion wait condition for hardware GCM case
DMA operation completion must wait until the last DMA descriptor
ownership has been changed to hardware, that is hardware is completed
the write operation for entire data. Earlier for the hardware GCM case,
the first DMA descriptor was checked and it could have resulted in some
race condition for non interrupt (MBEDTLS_AES_USE_INTERRUPT disabled) case.
2023-09-06 08:28:43 +05:30
c67381dce6 doc (nimble): Added Walkthrough tutorial for phy_cent example 2023-09-05 16:24:21 +05:30
1efe80af9b Merge branch 'feature/esp_lcd_panel_add_data_and_type_v5.1' into 'release/v5.1'
feat(esp_lcd): add user data and init cmd (v5.1)

See merge request espressif/esp-idf!25721
2023-09-05 16:09:39 +08:00
90da6ebfec change: print assert info before dump log 2023-09-05 15:10:54 +08:00
6f89300764 change: changed ble msys init for controller 2023-09-05 15:10:38 +08:00
d94c9d141b feat: added ble wake up overhead support 2023-09-05 15:10:38 +08:00
d3e8242db1 feat: Support esp32c2 BLE power save example 2023-09-05 15:10:38 +08:00
56894b1bca ble: update h2 c6 libble to 5d7af429 2023-09-05 15:10:38 +08:00
0954c0a231 Merge branch 'docs/add_Chinese_translation_for_api-guides/core_dump.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-guides/core_dump.rst and api-guides/core_dump_internals.rst (Backport v5.1)

See merge request espressif/esp-idf!25740
2023-09-05 14:44:29 +08:00
75e176fd21 docs: provide CN translation for api-guides/core_dump.rst and api-guides/core_dump_internals.rst (Backport v5.1) 2023-09-05 14:44:29 +08:00
1520984157 feat(nimble): Added support for dynamic services
Added support for dynamic services
2023-09-05 11:52:17 +05:30
54c81ddfc9 Merge branch 'feature/walkthrough_for_blecent_v5.1' into 'release/v5.1'
doc(nimble): Added the tutorial for blecent example. (v5.1)

See merge request espressif/esp-idf!25667
2023-09-05 14:15:23 +08:00
bf204d4150 Merge branch 'feature/adv_queue_congestion_v5.1' into 'release/v5.1'
feat(nimble): Added adv queue congestion check (v5.1)

See merge request espressif/esp-idf!25726
2023-09-05 14:14:35 +08:00
aec971572f Merge branch 'feature/specify_rmt_intr_priority_v5.1' into 'release/v5.1'
feat(rmt): specify interrupt priority (v5.1)

See merge request espressif/esp-idf!25718
2023-09-05 12:09:44 +08:00
537198b15d Merge branch 'docs/add_Chinese_translation_for_three_short_docs_of_api-guides_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for three short docs of api-guides (backport v5.1)

See merge request espressif/esp-idf!25743
2023-09-05 11:11:27 +08:00
ef5c85158d docs: provide CN translation for three short docs of api-guides (backport v5.1) 2023-09-05 11:11:27 +08:00
cc27c579ad Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/touch_element.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/touch_element.rst (backport v5.1)

See merge request espressif/esp-idf!25746
2023-09-05 10:22:17 +08:00
b93ffc1cb4 docs: provide CN translation for api-reference/peripherals/touch_element.rst (backport v5.1) 2023-09-05 10:22:16 +08:00
c9a51b83a5 Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/etm.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/etm.rst (backport v5.1)

See merge request espressif/esp-idf!25745
2023-09-05 10:21:18 +08:00
1e656013d7 docs: provide CN translation for api-reference/peripherals/etm.rst (backport v5.1) 2023-09-05 10:21:17 +08:00
1b87f35f0f Merge branch 'feature/support_ble_53_host_feat_v5.1' into 'release/v5.1'
Support BLE host feature for PTS (backport v5.1)

See merge request espressif/esp-idf!25645
2023-09-04 15:32:23 +08:00
2264828ae5 (doc) nimble: Added the tutorial for ble_periodic_adv and ble_periodic_syncexamples. 2023-09-04 11:45:29 +05:30
6983b86528 feat(nimble): Added adv queue congestion check 2023-09-04 11:25:20 +05:30
559df9640c feat(esp_lcd): add user data and init cmd 2023-09-04 13:25:39 +08:00
3b9c57ac32 feat(rmt): specify interrupt priority 2023-09-04 13:12:02 +08:00
f629029d4a fix(bt/controller): Fixed some HCI commands parameter check
Fixed HCI_Change_Connection_Packet_Type Command parameter check
Fixed HCI_Accpet_Synchronous_Connection_Request Command parameter check
Fixed HCI_Set_Connectionless_Peripheral_Broadcast_Data Command parameter check
2023-09-04 11:03:33 +08:00
f0437b945f Merge branch 'feature/esp32c2_add_trace_function_v5.1' into 'release/v5.1'
ble: supported trace function and adv report flow control on esp32c2

See merge request espressif/esp-idf!25640
2023-09-01 20:10:45 +08:00
865b48039d Merge branch 'feature/openthread_disable_nd6_timer_v5.1' into 'release/v5.1'
feat(openthread): disable lwip nd6 in openthread sleepy device (backport v5.1)

See merge request espressif/esp-idf!25631
2023-09-01 16:09:31 +08:00
a9aea676e7 Merge branch 'ci/connect_at_different_phase_v5.1' into 'release/v5.1'
ci(wifi): Test connect api at different phase (backports v5.1)

See merge request espressif/esp-idf!25674
2023-09-01 10:24:48 +08:00
9619d85027 Merge branch 'test/bqb_test_bt_classic_a2dp_v5.1' into 'release/v5.1'
feat(bt/bqb): Add setting SBC encoder and reject invalid codec type support for a2dp BQB test (backport v5.1)

See merge request espressif/esp-idf!25684
2023-09-01 10:21:15 +08:00
6aa9086206 fix(spi_master): polling_transmit forgot release bus lock when alloc DMA buffer failed
Close https://github.com/espressif/esp-idf/issues/11845
2023-08-31 21:15:14 +08:00
e10e95282d Merge branch 'fix/bp_wp_in_panic_v5.1' into 'release/v5.1'
fix(breakpoint): fix bp/wp logic when debugger is connected (v5.1)

See merge request espressif/esp-idf!25633
2023-08-31 19:50:11 +08:00
87135459a7 feat(bt/bqb): Set SBC encoder as PTS required for BQB test
1: set SBC encoder as PTS required. The encoder is effective first.
But it changes to default after media start.
2023-08-31 19:11:43 +08:00
4ea52074b4 fix(bt/avdtp): Reject SET CONFIGURATION command with error code INVALID_CODEC_TYPE
1: reset p_scb->avdt_handle in cleanup function.
2: cancel comparing p_scb->codec_type and p_scb->seps[xx].codec_type to
   send the error INVALID_CODEC_TYPE.
2023-08-31 19:11:43 +08:00
9ba0647a8f Merge branch 'dependency_check_fix_v5.1' into 'release/v5.1'
bug(tools): dependency check catch exception when package not installed (v5.1)

See merge request espressif/esp-idf!25656
2023-08-31 18:22:52 +08:00
4988c1a3d1 feat(openthread): add mesh local prefix configuration 2023-08-31 17:08:41 +08:00
f7fd03a79a fix(openthread): fix openthread settings get next empty index 2023-08-31 17:08:27 +08:00
3f2ff9af34 bugfix(esp_phy): fix using wrong macro 2023-08-31 17:08:16 +08:00
23a38f0f6f bug(tools): dependency check catch exception when package not installed 2023-08-31 10:24:06 +02:00
38b0cb6e98 doc(nimble): Added tutorial for the blecent example. 2023-08-31 11:22:08 +05:30
71083039f6 Merge branch 'bugfix/esp32c6_udp_bc_mc_rx_loss_rate_is_high_v5.1' into 'release/v5.1'
backport v5.1: fix esp32c6 UDP BC/MC RX loss rate is high when light sleep is enabled

See merge request espressif/esp-idf!25628
2023-08-31 13:28:48 +08:00
zwl
bd21c215c7 ble: supported trace function and adv report flow control on esp32c2 2023-08-31 12:02:00 +08:00
b58706c1d2 Merge branch 'feature/support_hp_regi2c_for_esp32c6_v5.1' into 'release/v5.1'
feat(esp_rom): support hp regi2c for esp32c6(backport v5.1)

See merge request espressif/esp-idf!25644
2023-08-31 10:49:58 +08:00
b3011ed759 Merge branch 'feature/coredump_panic_details_v5.1' into 'release/v5.1'
feat(coredump): add panic details to the elf file (v5.1)

See merge request espressif/esp-idf!25597
2023-08-30 22:23:41 +08:00
d0c5c2e13a ci(wifi): Test connect api at different phase 2023-08-30 17:04:26 +08:00
61cb60c6af Merge branch 'bugfix/fix_ieee802154_test_issue_v5.1' into 'release/v5.1'
fix(ieee802154): fix ieee802154_test issue(backport 5.1)

See merge request espressif/esp-idf!25630
2023-08-30 15:13:20 +08:00
5fa0d2a83d Merge branch 'contrib/github_pr_9694_v5.1' into 'release/v5.1'
add low power doc and picture (GitHub PR)(backport v5.1)

See merge request espressif/esp-idf!25590
2023-08-30 14:56:31 +08:00
b3860800ae bluedroid: add GATT read multi variable API and evt 2023-08-30 14:50:21 +08:00
e451b967d6 bluedroid: add periodic adv sync transfer API and EVT 2023-08-30 14:50:21 +08:00
97dd2dc88e bluedroid: support gatts show local database 2023-08-30 14:50:21 +08:00
05cd295a28 fix(esp_rom): fix esp32c6, esp32h2 hp_regi2c ops data conflict with phy ops 2023-08-30 14:28:55 +08:00
d2730608d2 feature(esp_rom): support_hp_regi2c_for_esp32c6 2023-08-30 14:28:37 +08:00
be7cf3dffb Merge branch 'bugfix/fix_adc_continuous_driver_isr_flag_issue_v5.1' into 'release/v5.1'
adc: fix continuous hal func not in iram when gdma isr iram (v5.1)

See merge request espressif/esp-idf!25505
2023-08-30 10:51:36 +08:00
1c27df8189 fix(breakpoint): fix bp/wp logic when debugger is connected 2023-08-29 12:32:06 +02:00
0a17c0831e feat(openthread): disable lwip nd6 in openthread sleepy device 2023-08-29 17:35:27 +08:00
b1a946dd60 fix(ieee802154): fix ieee802154_test issue
* pti do not set in ieee802154 test
* ack_time_out do not using in ieee802154 test
2023-08-29 16:49:41 +08:00
6e852f86d9 fix(esp32c6/power save): improve TEE and APM module retention priority to 2 to avoid the wifi fail to read the rxbuf link and trigger the rxbuf overflow error 2023-08-29 16:30:02 +08:00
8e6bf6c3a0 Merge branch 'feat/add_high_duty_adv_interval_v5.1' into 'release/v5.1'
feat(nimble): Added support for high duty adv interval (v5.1)

See merge request espressif/esp-idf!25553
2023-08-29 14:51:45 +08:00
df8a4d3335 Merge branch 'feature/configurable_gcov_task_size_v5.1' into 'release/v5.1'
feat(gcov): make gcov dump task size configurable (v5.1)

See merge request espressif/esp-idf!25600
2023-08-29 09:43:51 +08:00
568c397822 feat(coredump): add panic details to the elf file 2023-08-28 18:48:16 +02:00
8f51aee8fa feat(nimble): Added support for high duty adv interval 2023-08-28 17:53:16 +05:30
81ae481d7f Merge branch 'feat/add_set_data_related_addr_change_cmd_v5.1' into 'release/v5.1'
feat(nimble): Add support for LE Data Set Related Address Change command (v5.1)

See merge request espressif/esp-idf!25583
2023-08-28 20:21:50 +08:00
09954c1d29 Merge branch 'feature/config_device_name_in_eir_v5.1' into 'release/v5.1'
feat(bt/bluedroid): Add option whether to include device name in extended inquiry response

See merge request espressif/esp-idf!25541
2023-08-28 19:02:07 +08:00
261af82d1f Merge branch 'bugfix/ble_hci_issues_chain_mbuf_v5.1' into 'release/v5.1'
fix hci issues when chain mbuf exists

See merge request espressif/esp-idf!25532
2023-08-28 18:39:37 +08:00
c300ef7efa feat(gcov): make gcov dump task size configurable 2023-08-28 12:01:49 +02:00
2fa873408c docs: update power save part 2023-08-28 14:08:02 +08:00
164d5df66a add low power doc and picture
Merges https://github.com/espressif/esp-idf/pull/9694
2023-08-28 14:07:45 +08:00
d3f2e4dab5 Merge branch 'fix/esp_prov_recent_changes_v5.1' into 'release/v5.1'
fix(esp_prov): update devices tuple usage due to API deprecations (v5.1)

See merge request espressif/esp-idf!25536
2023-08-28 14:07:35 +08:00
3eed68cc9c Merge branch 'bugfix/update_supplicant_copyrights_v5.1' into 'release/v5.1'
Update copyright info for wpa_supplicant (v5.1)

See merge request espressif/esp-idf!25526
2023-08-28 13:49:25 +08:00
8da2c57889 Merge branch 'feature/mcpwm_interrupt_prioity_v5.1' into 'release/v5.1'
feat(MCPWM): Support set interrupt priority(v5.1)

See merge request espressif/esp-idf!25573
2023-08-28 11:21:55 +08:00
2a80451b24 Merge branch 'feature/add_mcpwm_carrier_clk_source_v5.1' into 'release/v5.1'
feat(MCPWM): Add mcpwm carrier clk source(v5.1)

See merge request espressif/esp-idf!25572
2023-08-28 11:11:04 +08:00
dabbc8b70e Merge branch 'feature/pcnt_interrupt_prioity_v5.1' into 'release/v5.1'
feat(pcnt): support set interrupt priority(v5.1)

See merge request espressif/esp-idf!25575
2023-08-28 10:58:25 +08:00
4299b9346b Merge branch 'bugfix/supplicant_osi_violation_v5.1' into 'release/v5.1'
Fix abstraction violation in wpa_supplicant (Backport v5.1)

See merge request espressif/esp-idf!25565
2023-08-28 10:30:37 +08:00
b20c3f8a79 Merge branch 'bugfix/remove_deprecated_err_code_v5.1' into 'release/v5.1'
fix(bt): Removed an incorrectly defined HCI error code (5.1)

See merge request espressif/esp-idf!25288
2023-08-28 10:30:00 +08:00
88e436f85a Merge branch 'feature/add_ci_for_esp_wifi_powersave_example_v5.1' into 'release/v5.1'
ci(wifi): add pytest case for wifi powersave example (backport v5.1)

See merge request espressif/esp-idf!25499
2023-08-28 10:28:44 +08:00
99a80eddc3 Merge branch 'ci/fix_example_test_advanced_ota_v5.1' into 'release/v5.1'
ci(fix): example test advanced_https_ota_example_bluedroid_gatts (v5.1)

See merge request espressif/esp-idf!25524
2023-08-28 10:26:31 +08:00
609ac084c5 Merge branch 'feature/esp_lcd_spi_support_quad_mode_v5.1' into 'release/v5.1'
esp_lcd: spi support quad mode (v5.1)

See merge request espressif/esp-idf!25561
2023-08-28 10:26:17 +08:00
4a7cbc9b96 Merge branch 'feat/update_cjson_submodule_v5.1' into 'release/v5.1'
feat: Update cJSON version to v1.7.16 (v5.1)

See merge request espressif/esp-idf!25137
2023-08-28 10:25:14 +08:00
69d0872cd6 Merge branch 'docs/fatfs_add_api_reference_v5.1' into 'release/v5.1'
docs(fatfs): Move mentioned APIs to a separate API reference section (v5.1)

See merge request espressif/esp-idf!25349
2023-08-28 10:24:53 +08:00
de4d72c5b5 Merge branch 'bugfix/ccmp_decrypt_log_v5.1' into 'release/v5.1'
esp_wifi: Move ccmp mgmt enc/decrypt logs to verbose (v5.1)

See merge request espressif/esp-idf!25168
2023-08-28 10:24:20 +08:00
3a34b768a9 Merge branch 'contrib/github_pr_12039_v5.1' into 'release/v5.1'
docs(iperf): Update documentation with console interface details(v5.1)

See merge request espressif/esp-idf!25512
2023-08-28 10:23:59 +08:00
6e403fb140 Merge branch 'docs/add_protocomm_trans_backport_v5.1' into 'release/v5.1'
Docs: add CN translation for api-reference/provisioning/protocomm.rst (backport v5.1)

See merge request espressif/esp-idf!25037
2023-08-28 10:23:21 +08:00
67f59c8ddb Docs: add CN translation for api-reference/provisioning/protocomm.rst (backport v5.1) 2023-08-28 10:23:21 +08:00
fae05ace21 Merge branch 'bugfix/fix_duplicate_disable_compile_issue_backport_5_1' into 'release/v5.1'
bugfix(ble): Fix compile issue when disable duplicate config option in kconfig.

See merge request espressif/esp-idf!25177
2023-08-28 10:22:50 +08:00
d7020c02f4 Merge branch 'backport_v5.1' into 'release/v5.1'
fix(bt): Fix ble periodic advertising data length 0 error(backport v5.1)

See merge request espressif/esp-idf!25005
2023-08-28 10:22:11 +08:00
60143c7f68 Merge branch 'bugfix/fix_idfgh_10045_v5.1' into 'release/v5.1'
Bluedroid: fixed compile warning when optimize for performance (backport v5.1)

See merge request espressif/esp-idf!24844
2023-08-28 10:21:37 +08:00
5a25786a8a Merge branch 'bugfix/lp_i2c_bugfixes_v5.1' into 'release/v5.1'
Fixed multiple LP I2C bugs (v5.1)

See merge request espressif/esp-idf!25277
2023-08-28 10:20:40 +08:00
2baf418119 feat(nimble): Add support for LE Data Set Related Address Change command 2023-08-26 20:42:40 +05:30
ce6d7ba1bb Merge branch 'feature/default_clock_source_can_leave_empty_v5.1' into 'release/v5.1'
feat(mcpwm): default clock source setting can leave empty (v5.1)

See merge request espressif/esp-idf!25548
2023-08-26 17:52:21 +08:00
cd979e293c Merge branch 'bugfix/usb/host/urb_compliance_verification_add_v5.1' into 'release/v5.1'
[USB Host] added URB check args and transfer check compliance for regular EP transfer submit (v5.1)

See merge request espressif/esp-idf!25467
2023-08-25 23:17:32 +08:00
6a859a6cc5 fix(bt): Removed an incorrectly defined HCI error code 2023-08-25 11:54:39 +00:00
92cc9fca07 feat(pcnt): support set interrupt priority 2023-08-25 17:47:52 +08:00
d3aba34baa feat(MCPWM): Support set interrupt priority 2023-08-25 17:41:31 +08:00
c240a1f46b feat(MCPWM): Add mcpwm carrier clk source
The MCPWM carrier is part of the operator and can work independently
without the MCPWM timer being enabled. This commit add the MCPWM
carrier clk source.
2023-08-25 17:34:58 +08:00
c15472b12e fix(supplicant): Fix abstraction violation in wpa_supplicant 2023-08-25 12:30:44 +05:30
06a4943e41 Merge branch 'fix/bin_names_with_dots_v5.1' into 'release/v5.1'
fix(build_system): Allow dots in the name of an app binary (backport v5.1)

See merge request espressif/esp-idf!25276
2023-08-25 14:42:32 +08:00
c8970d8205 Merge branch 'feature/requires_hints_v5.1' into 'release/v5.1'
feat(tools): show hints for component dependencies (v5.1)

See merge request espressif/esp-idf!25386
2023-08-25 14:28:13 +08:00
84e5d91b4e Merge branch 'docs/uninstall_idf_v5.1' into 'release/v5.1'
docs(idf-tools): Add uninstallation instructions (backport v5.1)

See merge request espressif/esp-idf!25494
2023-08-25 14:27:54 +08:00
88c5511503 Merge branch 'bugfix/ps_export_extra_paths_v5.1' into 'release/v5.1'
tools: export.ps1: define functions for helper python tools (v5.1)

See merge request espressif/esp-idf!25139
2023-08-25 14:26:05 +08:00
a1be2f3613 Merge branch 'bugfix/sbom_hash_check_v5.1' into 'release/v5.1'
fix(test_submodules.py): don't rely on submodule init (v5.1)

See merge request espressif/esp-idf!25057
2023-08-25 14:21:18 +08:00
e7722dc79e Merge branch 'bugfix/debug_ext_ctrl_c_v5.1' into 'release/v5.1'
tools: fix waiting on gdb process when interrupted with CTRL+C (v5.1)

See merge request espressif/esp-idf!24933
2023-08-25 14:20:40 +08:00
50e098d5e2 Merge branch 'ci/update_pre_commit_copyright_checker_v5.1' into 'release/v5.1'
ci(pre-commit): Use the newest copyright checker (v5.1)

See merge request espressif/esp-idf!24907
2023-08-25 14:20:04 +08:00
cc380696e4 Merge branch 'docs/monitor_rom_address_decoding_v5.1' into 'release/v5.1'
docs(esp_idf_monitor): ROM ELF address decoding (backport v5.1)

See merge request espressif/esp-idf!24856
2023-08-25 14:19:44 +08:00
3c9f407c1d feat(esp_lcd): spi add support for quad mode 2023-08-25 14:18:31 +08:00
f96a9ad84c feat(esp_lcd): rgb add callback when bounce buffer finish 2023-08-25 14:18:31 +08:00
0624d5e58f esp_wifi: Make enterprise support configurable to save binary size. 2023-08-25 11:20:58 +05:30
6503758ec0 ble: Assert when getting memory fail 2023-08-25 12:25:33 +08:00
01fbc285b0 ble: Fix hci issues when chain mbuf exists 2023-08-25 12:25:11 +08:00
9080a7ac7c Merge branch 'bugfix/fix_legacy_adc_continuous_driver_dma_descriptor_not_internal_issue_v5.1' into 'release/v5.1'
adc: fixed legacy adc continuous driver dma descriptor not in internal ram issue (v5.1)

See merge request espressif/esp-idf!25508
2023-08-25 10:38:09 +08:00
860e0477ee Merge branch 'bugfix/fix_adc_filter_acquire_logic_v5.1' into 'release/v5.1'
adc: fix adc filter driver acquire logic (v5.1)

See merge request espressif/esp-idf!25507
2023-08-25 10:37:05 +08:00
842f5385a3 feat(mcpwm): default clock source setting can leave empty 2023-08-25 10:29:57 +08:00
48052e4d1f Merge branch 'bugfix/fix_current_issue_after_ble_init_5.1' into 'release/v5.1'
ble: move phy enabled/disable to controller enable/disable

See merge request espressif/esp-idf!25081
2023-08-25 10:25:11 +08:00
3d8744476b fix(adc): invalid assertion on the adc_unit 2023-08-25 10:18:03 +08:00
9332a31d27 Merge branch 'bugfix/usb_hcd_interrupt_alloc_error_return_v5.1' into 'release/v5.1'
USB Host: Fix coverity issues with hcd_install() (v5.1)

See merge request espressif/esp-idf!25463
2023-08-24 22:48:00 +08:00
f0cd979746 Merge branch 'lwip/dhcp_client_fix_forwardportV5.1' into 'release/v5.1'
Fix: Added check to ensure safe restart of dhcp fine timer (v5.1)

See merge request espressif/esp-idf!24706
2023-08-24 21:03:17 +08:00
920ca1c882 Merge branch 'contrib/github_pr_11923_v5.1' into 'release/v5.1'
fix(esp-tls): fix pointer cast and condition for CONFIG_ATECC608A_TCUSTOM (GitHub PR) (v5.1)

See merge request espressif/esp-idf!25500
2023-08-24 20:08:48 +08:00
6340713fef feat(bt/bluedroid): Add option whether to include device name in extended inquiry response 2023-08-24 19:37:35 +08:00
9396753e1a Merge branch 'feature/enc_adv_data_v5.1' into 'release/v5.1'
NimBLE: Added support of encrypted advertising data (v5.1)

See merge request espressif/esp-idf!25325
2023-08-24 19:12:55 +08:00
c3987d2163 Merge branch 'test/bqb_test_bt_classic_spp_rfcomm_5.1' into 'release/v5.1'
feat(bt/bqb): Add BQB enabling and rfcomm msc command sending support (backport v5.1)

See merge request espressif/esp-idf!25091
2023-08-24 18:59:15 +08:00
667493584c Merge branch 'bugfix/fix_psram_size_doc_s3_v5.1' into 'release/v5.1'
doc: update s3 psram vaddr max range size (v5.1)

See merge request espressif/esp-idf!25503
2023-08-24 17:36:48 +08:00
7b961d7734 fix(esp_prov): update devices tuple usage due to API deprecations
- a recent commit fixed the API deprecations,
and the BLEDevice object now needs to be accessed through a tuple.
- thus the changes were made in the code wherein the object was used,
but updating the usage in the condition when de
vname is not None got skipped.
2023-08-24 14:48:25 +05:30
2de3e90c21 Merge branch 'feature/periodic_adv_enhancement_v5.1' into 'release/v5.1'
NimBLE : Added periodic Adv Feature Updates in BLE 5.3 (v5.1)

See merge request espressif/esp-idf!25489
2023-08-24 17:14:43 +08:00
eca9a818c5 Merge branch 'feature/add_duplicate_excep_list_vsc_v5.1' into 'release/v5.1'
feat(mesh): Add support for Duplicate Exception list update VSC for Nimble (v5.1)

See merge request espressif/esp-idf!25131
2023-08-24 17:13:57 +08:00
0c4ac54fcf Merge branch 'bugfix/fix_pcl_set_rssi_vsc_v5.1' into 'release/v5.1'
fix(nimble): Add API to send pcl set rssi vsc (v5.1)

See merge request espressif/esp-idf!25434
2023-08-24 17:13:25 +08:00
79d403a713 Merge branch 'bugfix/esp_timer_prevents_delay_for_isr_dispatch_callbacks_v5.1' into 'release/v5.1'
fix(esp_timer): Fix delay in ISR dispatch callbacks (v5.1)

See merge request espressif/esp-idf!25471
2023-08-24 14:54:19 +08:00
4d044ab25d Merge branch 'bugfix/v5.1_ble_issues_bugfix_c2' into 'release/v5.1'
update btlib to f9db7b90, some esp32c2 issues bugfixed

See merge request espressif/esp-idf!25433
2023-08-24 14:13:39 +08:00
ccfa68c827 Merge branch 'feat/psram_support_d2wd_single_clk_u4wdh_v5.1' into 'release/v5.1'
spiram: Add support for U4WDH, and fixed D0WD/D2WD cannot share CLK pins (v5.1)

See merge request espressif/esp-idf!25171
2023-08-24 12:49:46 +08:00
a22ba76f33 change(esp_wifi): Update copyright info for wpa_supplicant 2023-08-24 10:05:39 +05:30
0a3ab5863a ci(fix): example test advanced_https_ota_example_bluedroid_gatts 2023-08-24 12:24:50 +08:00
d42d86b369 bugfix: avoid warning in espcoredump when log disabled 2023-08-24 04:17:33 +00:00
5758b66a9f Merge branch 'ci/fix_test_switch_ota_v5.1' into 'release/v5.1'
fix(app_update): Fix CI test_switch_ota by increasing deepsleep (v5.1)

See merge request espressif/esp-idf!25465
2023-08-24 12:16:51 +08:00
240f420f1a feat: Update cJSON version to v1.7.16
Changelog: https://github.com/DaveGamble/cJSON/releases/tag/v1.7.16
2023-08-24 04:14:08 +00:00
3c41beee68 Merge branch 'bugfix/l2cap_coc_more_one_pkt_v5.1' into 'release/v5.1'
NimBLE: Fixed crash when L2CAP COC sends large amount of data. (v5.1)

See merge request espressif/esp-idf!25059
2023-08-24 12:04:21 +08:00
29a38ceeca usb_host: added URB check args and transfer check compliance for regular EP transfer submit 2023-08-24 12:02:49 +08:00
6b585fe542 usb_host: Fix coverity issues with hcd_install()
- Use single "err_ret" variable for returning errors
- Simplify bail out procedure by using more labels
2023-08-24 12:01:50 +08:00
9dbefdbb41 Merge branch 'refactor/usb_host_usbh_interface_v5.1' into 'release/v5.1'
USB Host: Refactor USBH interface (v5.1)

See merge request espressif/esp-idf!24210
2023-08-24 11:16:02 +08:00
c7a7bb62c6 esp_wifi: Move ccmp mgmt enc/decrypt logs to verbose 2023-08-24 03:11:42 +00:00
8b6957a99c test(adc): continuous driver iram test with gdma iram safe option only 2023-08-24 11:04:43 +08:00
879b5d4401 fix(adc): fix adc continuous hal func not in iram when gdma isr iram 2023-08-24 11:04:43 +08:00
927183e744 Merge branch 'docs/add_CN_trans_for_contribute/index.rst_backport_v5.1' into 'release/v5.1'
docs:Provide CN translation for contribute/index.rst_backport_v5.1

See merge request espressif/esp-idf!25270
2023-08-24 10:52:29 +08:00
a66f61e33f Merge branch 'feature/usb_host_restrict_ahb_errata_workaround_to_esp32s2_eco0_v5.1' into 'release/v5.1'
USB Host: Restrict ESP32-S2 AHB errata workaround to only ECO0 chips (v5.1)

See merge request espressif/esp-idf!25054
2023-08-24 10:12:48 +08:00
3a79e3694c Merge branch 'bugfix/twai_install_returns_error_on_intr_alloc_fail_v5.1' into 'release/v5.1'
TWAI: twai_driver_install() returns error on interrupt allocation failure (GitHub PR) (v5.1)

See merge request espressif/esp-idf!24823
2023-08-24 10:11:57 +08:00
0bd405be7b Merge branch 'feature/modbus_add_support_esp32h2_v51' into 'release/v5.1'
examples: modbus add support for target esp32h2 (Backport v5.1)

See merge request espressif/esp-idf!24970
2023-08-24 10:10:44 +08:00
3cc358102b Merge branch 'bugfix/i80_lcd_reset_gpio_config_v5.1' into 'release/v5.1'
fix(i80_lcd): reset cs gpio on exit (v5.1)

See merge request espressif/esp-idf!25243
2023-08-24 10:08:03 +08:00
ed6e997d4c Merge branch 'feature/gptimer_interrupt_priority_v5.1' into 'release/v5.1'
feat(gptimer): support set interrupt priority (v5.1)

See merge request espressif/esp-idf!25199
2023-08-24 10:07:48 +08:00
54ef954292 Merge branch 'contrib/github_pr_11878_v5.1' into 'release/v5.1'
feat(mcpwm): Allow for pull up/down to be configurable on generators (GitHub PR) (v5.1)

See merge request espressif/esp-idf!24893
2023-08-24 10:07:35 +08:00
fad1874ae2 Merge branch 'docs/add_Chinese_translation_for_api-guides_hardware-abstraction.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN tranlsation for api-guides/hardware-abstraction.rst (backport v5.1)

See merge request espressif/esp-idf!25045
2023-08-24 10:06:39 +08:00
faf5941978 Merge branch 'docs/add_Chinese_translation_for_api-guides/performance/ram-usage.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-guides/performance/ram-usage.rst (backport v5.1)

See merge request espressif/esp-idf!25038
2023-08-24 10:05:57 +08:00
9838675d3b Merge branch 'bugfix/intr_flags_to_level_v5.1' into 'release/v5.1'
fix(intr_flags_to_level): fix value returned one more than correct value (v5.1)

See merge request espressif/esp-idf!25424
2023-08-24 08:34:37 +08:00
36abbe8fc8 Merge branch 'docs/get_started_h2_v5.1' into 'release/v5.1'
docs: add H2 to list of supported series to front page doc (v5.1)

See merge request espressif/esp-idf!25042
2023-08-24 08:10:09 +08:00
f41df5641a Merge branch 'bugfix/gptimer_hal_placement_wrong_condition_v5.1' into 'release/v5.1'
fix(gptimer): hal function placement under wrong condition (v5.1)

See merge request espressif/esp-idf!25280
2023-08-23 23:21:20 +08:00
59a06a8ad2 fix: Added check to ensure safe restart of dhcp fine timer 2023-08-24 00:51:36 +10:00
d57466da3c feat(nimble): Added periodic Adv Feature Updates in BLE 5.3 2023-08-23 18:53:51 +05:30
db5b50af2c NimBLE: Added support of encrypted advertising data 2023-08-23 18:18:23 +05:30
64926fd137 Merge branch 'doc_5.1/c2_h2_c6' into 'release/v5.1'
c2 h2 c6 headfile re-organized

See merge request espressif/esp-idf!25079
2023-08-23 20:18:31 +08:00
4b512c5e7b fix(nimble): Add API to send pcl set rssi vsc 2023-08-23 17:43:22 +05:30
b638cb3335 Merge branch 'bringup/esp32h2_deep_sleep_for_rebase_v5.1' into 'release/v5.1'
esp32h2: support deep_sleep(backport v5.1)

See merge request espressif/esp-idf!24962
2023-08-23 20:12:01 +08:00
acc08b9421 feat(mesh): Add support for Duplicate Exception list update VSC for
Nimble
2023-08-23 17:41:18 +05:30
6e3c700bf6 Merge branch 'bugfix/handle_NULL_data_periodic_adv_v5.1' into 'release/v5.1'
fix(nimble): Add check to set length only if data is valid in periodic adv (v5.1)

See merge request espressif/esp-idf!25178
2023-08-23 20:09:13 +08:00
4fc363546e Merge branch 'bugfix/netif_default_sta_init_v5.1' into 'release/v5.1'
wifi: Fix default wifi-netif creation to assert if no event loop (v5.1)

See merge request espressif/esp-idf!25344
2023-08-23 19:57:06 +08:00
5b3ed2f794 docs(iperf): Update documentation with console interface details
Closes https://github.com/espressif/esp-idf/pull/12039
2023-08-23 19:54:54 +08:00
372a34f6d5 Merge branch 'fix/wifi_wps_pbc_overlap_v5.1' into 'release/v5.1'
fix(wpa_supplicant): Add support to detect PBC overlap in wps registrar mode (Backport v5.1)

See merge request espressif/esp-idf!25440
2023-08-23 19:54:50 +08:00
43d6f90d72 Merge branch 'bugfix/ignore_eapol_nonkey_v5.1' into 'release/v5.1'
Ignore EAPOL non-key frames in EAPOL txdone callback (Backport v5.1)

See merge request espressif/esp-idf!25453
2023-08-23 19:54:14 +08:00
5256c317f9 Merge branch 'bugfix/role_switch_enc_mode_lmp_timeout_v5.1' into 'release/v5.1'
bt: Fix disconnection due to lmp messages not being processed by both sides(v5.1)

See merge request espressif/esp-idf!25202
2023-08-23 19:53:29 +08:00
c57e42471c Merge branch 'bugfix/fix_variable_type_v5.1' into 'release/v5.1'
fix(bt): Fix argument type of ESP_LOGI for spp examples about format error (backport v5.1)

See merge request espressif/esp-idf!25324
2023-08-23 19:52:25 +08:00
d00077e5a9 Merge branch 'bugfix/incr_sdp_max_conns_v5.1' into 'release/v5.1'
fix(bt): Increased SDP maximum connections to avoid connection exhausted (v5.1)

See merge request espressif/esp-idf!25429
2023-08-23 19:51:39 +08:00
71f2f98b60 adc: fixed legacy adc continuous driver dma descriptor not in internal ram issue 2023-08-23 19:44:25 +08:00
888ccfe0cb adc: added adc filter exhausted allocation test 2023-08-23 19:41:15 +08:00
628162d71e adc: fix adc filter acquire logic 2023-08-23 19:41:02 +08:00
1fc5a5a3a4 NimBLE: Fixed crash when L2CAP COC sends large amount of data. 2023-08-23 11:15:12 +00:00
83bab7591e doc: update s3 psram vaddr max range size 2023-08-23 19:10:58 +08:00
13f261a8ea Merge branch 'docs/add_Chinese_translation_for_api-guides/openthread.rst_backport_v5.1' into 'release/v5.1'
provide CN translation for api-guides/openthread.rst (backport v5.1)

See merge request espressif/esp-idf!25048
2023-08-23 19:09:08 +08:00
60164a230c provide CN translation for api-guides/openthread.rst (backport v5.1) 2023-08-23 19:09:07 +08:00
842eb0ffd4 Merge branch 'doc/update_kconfig_example_ext_adv_usage_v5.1' into 'release/v5.1'
doc(nimble): Update Kconfig help section for Example Ext Adv (v5.1)

See merge request espressif/esp-idf!24913
2023-08-23 19:03:37 +08:00
1360b5fa83 fix(esp-tls): fix pointer cast and condition for CONFIG_ATECC608A_TCUSTOM
Closes https://github.com/espressif/esp-idf/pull/11923
2023-08-23 15:49:56 +05:30
a6b5c93ed5 Merge branch 'esp_prov/update_deprecation_warnings_v5.1' into 'release/v5.1'
fix(esp_prov): Fixed the deprecation APIs warnings (v5.1)

See merge request espressif/esp-idf!25150
2023-08-23 18:18:59 +08:00
4d95619595 Merge branch 'fix/mmu_hal_valid_vaddr_check_v5.1' into 'release/v5.1'
fix(hal): Fix the external memory vaddr region validity check (v5.1)

See merge request espressif/esp-idf!25154
2023-08-23 18:17:53 +08:00
10e100f584 Merge branch 'feature/update_mbedtls_v5.1' into 'release/v5.1'
feat(mbedtls): Update to release/v3.4.1 (v5.1)

See merge request espressif/esp-idf!25394
2023-08-23 18:17:20 +08:00
75692c96e2 Merge branch 'feature/support_mbedtls_ecp_fixed_point_configurable_v5.1' into 'release/v5.1'
feat(mbedtls): support ecp fixed-point multiplication configurable (backport v5.1)

See merge request espressif/esp-idf!25286
2023-08-23 18:16:20 +08:00
a1defb4fd9 Merge branch 'feature/wifi_prov_event_security_session_v5.1' into 'release/v5.1'
wifi_prov: Exposed events for secure session establishment and credential mismatch (v5.1)

See merge request espressif/esp-idf!25474
2023-08-23 18:16:07 +08:00
0f849d4c40 Merge branch 'bugfix/secure_ota_without_padding_v5.1' into 'release/v5.1'
fix(secure_ota): secure app verification issue without padding bytes (v5.1)

See merge request espressif/esp-idf!25211
2023-08-23 18:15:30 +08:00
1d0b4ceeef ci(wifi): add wifi powersave pytest case 2023-08-23 18:02:03 +08:00
b9186e7b22 feat(esp_wifi): support get AP info from stdin in wifi powersave example 2023-08-23 18:00:48 +08:00
c517a15dd2 fix(light_sleep): shouldn't backup uart fifo reg in pd_top light sleep 2023-08-23 18:00:48 +08:00
fa806d758a ble: move phy enabled/disable to controller enable/disable 2023-08-23 17:56:33 +08:00
6cca4bddd2 Merge branch 'bugfix/esp32c6_heap_corruption_v5.1' into 'release/v5.1'
Bugfix/esp32c6 heap corruption v5.1

See merge request espressif/esp-idf!25333
2023-08-23 17:52:31 +08:00
3a3c9a73f0 docs: Update CN translation for get-started/index.rst 2023-08-23 11:19:43 +02:00
4e88f767cd docs(idf-tools): Add uninstallation instructions 2023-08-23 11:19:33 +02:00
d710a83982 Merge branch 'bugfix/sha_dma_mode_incorrect_result_v5.1' into 'release/v5.1'
fix(sha): DMA mode iteration calculation issue for certain data lengths (v5.1)

See merge request espressif/esp-idf!25127
2023-08-23 17:11:44 +08:00
99d0cff1ba docs: Provide CN translation for contribute/index.rst 2023-08-23 15:48:42 +08:00
f35959d7d1 ble: update btlib to f9db7b90, some esp32c2 issues bugfixed 2023-08-23 10:21:20 +08:00
a0da805f2b fix(hal): Fix the external memory vaddr region validity check
- For c6 and h2, the vaddr end calculated was off by 1
  byte.
2023-08-22 15:24:02 +05:30
9d905d18bb wifi_prov: Fix build issue when building only for sec1 or sec2 2023-08-22 15:21:48 +05:30
fcb98e5851 wifi_prov: Exposed events for secure session establishment 2023-08-22 15:21:48 +05:30
c93310956a refactor(esp_timer): Remove duplicate code and move it to a common file 2023-08-22 17:22:24 +08:00
eef3a90871 fix(esp_timer): Fix delay in ISR dispatch callbacks
Set the following alarm before calling the alarm handler.

Closes https://github.com/espressif/esp-idf/pull/11637
Closes https://github.com/espressif/esp-idf/issues/11636
2023-08-22 17:22:24 +08:00
d521b7d52a fix(examples): Fix example build errors caused by the deep_sleep funcs are returnable 2023-08-22 16:17:32 +08:00
7ac7d43541 fix(app_update): Fix CI test_switch_ota by increasing deepsleep
It increases the deepsleep time from 2000 to 20000.
2000 is too small for esp32-s3 chip.
2023-08-22 16:10:49 +08:00
d3c99ed3b8 Merge branch 'update/version_5_1_1' into 'release/v5.1'
Update version to 5.1.1

See merge request espressif/esp-idf!25443
2023-08-22 14:40:50 +08:00
c05a0b4c50 fix(supplicant): Ignore EAPOL non-key frames in EAPOL txdone callback 2023-08-21 18:06:32 +05:30
e088c3766b versions: Update version to 5.1.1 2023-08-21 14:24:40 +05:50
2791508094 fix(wpa_supplicant): Add support to detect PBC overlap in wps registrar mode 2023-08-21 12:35:50 +05:30
757bd78247 update btlib to f9db7b90, some esp32c2 issues bugfixed 2023-08-21 11:49:14 +08:00
3638d265ed fix(bt): Increased SDP maximum connections to avoid connection exhausted 2023-08-21 11:21:56 +08:00
e5394440df fix(intr_flags_to_level): fix value returned one more than correct value 2023-08-21 10:08:49 +08:00
62f5905be2 bluedroid: fixed compile warning when optimize for performance 2023-08-19 12:26:19 +08:00
8d2dbd461f Merge branch 'bugfix/eapol_txdone_cb_issue_v5.1' into 'release/v5.1'
Fix EAPOL Key TxDone callback implementation (Backport v5.1)

See merge request espressif/esp-idf!25381
2023-08-18 14:36:25 +08:00
7eae1e4534 feat(mbedtls): Update to release/v3.4.1 2023-08-17 17:33:22 +05:30
c99a036b43 fix(spiffs): SPIFFS print formatter errors out
Closes https://github.com/espressif/esp-idf/issues/11922
2023-08-17 11:46:25 +02:00
96b312ddde soc: Move revision MAX/MIN static assert to esp_hw_support
Previously, "soc/chip_revision.h" contained a static assert to check that the
CONFIG_ESP_REV_MIN_FULL <= CONFIG_ESP_REV_MAX_FULL. There are two issues with
this assert:

- Contained in a header file, so it is only compiled if the "chip_revision.h"
is included somewhere
- CONFIG_ESP_REV_MIN_FULL and CONFIG_ESP_REV_MAX_FULL are defined in
"esp_hw_support", which is a G0 component. This creates a reverse dependency
of G0 on G1.

This commit moves the static assert "revision.c" in "esp_hw_support".
2023-08-17 15:26:23 +08:00
c98aa927f6 usb_host: Restrict ESP32-S2 AHB errata workaround to only ECO0 chips 2023-08-17 15:26:23 +08:00
5d78511eac Merge branch 'bugfix/temperature_get_value_negative_v5.11' into 'release/v5.1'
bugfix(temperature_sensor): Fix issue that get the value is negative (backport v5.1)

See merge request espressif/esp-idf!25251
2023-08-17 15:24:29 +08:00
3e8b1a90cc ci(tools): fix test_hints.py to run on windows
1. The original test, before hint modules support was added, used
tempfile.NamedTemporaryFile in a way which is not supported on windows.
It was having the file open, which the hints tried to read it, leading
the EPERM exception. The docs[1] says this is not supported.
<quote>
Whether the name can be used to open the file a second time, while the
named temporary file is still open, varies across platforms (it can be
so used on Unix; it cannot on Windows)
</quote>

2. The hint module component_requirements test used the idf.py directly,
which is idf.py.exe on windows.Now it's starting idf.py through python.
We could probably used shell=True, but this approach is used in other
tests too.

Anyway the test are now passing on windows.

[1] https://docs.python.org/3/library/tempfile.html

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-17 07:57:39 +02:00
41f029d654 ci(tools): add tests for component_requirements.py hints module
Following tests were added.

1. Test for missing header directory in component's INCLUDE_DIRS
2. Test for missing dependency in component's PRIV_REQUIRES
3. Test for missing dependency in component's REQUIRES
4. Test for dependency in PRIV_REQUIRES which should be in REQUIRES

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-17 07:57:38 +02:00
0a029f4bf4 feat(tools): idf.py: implement hints for component reqs
Implementation of hint module for component dependency. It can provide
hint about missing header directory in component's INCLUDE_DIRS or
about missing component dependency in REQUIRES or PRIV_REQUIRES.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-17 07:57:38 +02:00
924857d0b4 feat(tools): idf_monitor: support for loadable hint provider modules
Currently hints are supported based on hints.yml only, which may be
limiting for some use cases. This introduces a generic plugin approach,
which allows to implement hint module that doesn't require entry in hints.yml.
Such module has the full command output available and it is not limited to
a single regex in hints.yml.

Note that regex in hint.yml expects the output concatenated into a single line,
but hint modules are getting the output unchanged.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-17 07:57:38 +02:00
148b7f9a56 feat(tools): add global build context
Introduces get_build_context() helper, which allows to get build context, e.g.
project description, at places where this info is not available. The
build context is set within ensure_build_directory.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-08-17 07:57:38 +02:00
cd2172935d Merge branch 'bugfix/fix_esp32h2_wakeup_pll_enable_access_flash' into 'release/v5.1'
fix(esp_hw_support): fix esp32h2 wakeup process access flash cause stuck on v5.1

See merge request espressif/esp-idf!25379
2023-08-17 11:53:19 +08:00
77b74ab091 Merge branch 'bugfix/spi_bus_unify_defualt_mosi_level_v5.1' into 'release/v5.1'
spi: unify default mosi level on all targets (v5.1)

See merge request espressif/esp-idf!25014
2023-08-17 10:13:05 +08:00
45288496fb bugfix(temperature_sensor): Fix issue that get the value is negative 2023-08-17 10:06:22 +08:00
feecbad7db fix(wifi): Fix EAPOL Key TxDone callback implementation
Fix issues arising due to not distinguishing between M2 and M4
TxDone during 4-way handshake. Also fix EAPOL frame rate to lowest
possible rate.
2023-08-16 19:26:22 +05:30
d5396e1d84 fix(esp_hw_support): fix esp32h2 wakeup process access flash cause crash 2023-08-16 20:44:16 +08:00
zwl
05e44b1021 ble: Added adv report flow control config on ESP32C6 and ESP32H2 2023-08-16 19:37:09 +08:00
zwl
fb6f00158e ble: fixed heap corruption on esp32c6 and esp32h2 2023-08-16 19:37:03 +08:00
461db723f1 Merge branch 'bugfix/fix_disassociation_callback_miss_free_key_lead_memory_leak_issue_v5.1' into 'release/v5.1'
fix(wifi): fix disassociation callback miss free key issue(Backport v5.1)

See merge request espressif/esp-idf!25360
2023-08-16 19:18:28 +08:00
98c39e28c8 fix(wifi): fix disassociation callback miss free key issue 2023-08-15 18:01:43 +08:00
075bbb526c twai: twai_driver_install() returns error on interrupt allocation failure
This commit updates twai_driver_install() so that an error is returned when
esp_intr_alloc() fails, instead of aborting.

Closes https://github.com/espressif/esp-idf/pull/11494

[darian@espressif.com: Refactored object allocation and free procedures]
[darian@espressif.com: Updated commit message]
Signed-off-by: Darian Leung <darian@espressif.com>
2023-08-15 03:26:10 +00:00
c623b0701b docs: Provide CN translation for wear-levelling.rst 2023-08-14 12:46:20 +02:00
756c61b628 docs(fatfs): Move mentioned APIs to a separate API reference section 2023-08-14 12:44:53 +02:00
597810bf96 fix(c++): invalid conversion from int to enumeration 2023-08-14 07:49:02 +00:00
67327ed47a fix(wifi): Fix default wifi-netif creation to assert if no event loop
- Added ESP_ERROR_CHECK() checks to `esp_wifi_set_default_wifi_..._handlers()` calls
- Added ESP_ERROR_CHECH() to `esp_netif_attach_wifi_...()` calls
- Updated documentation to reflect the changes

Closes https://github.com/espressif/esp-idf/issues/11580
2023-08-14 09:16:29 +02:00
5e0129c91b fix(secure_ota): secure app verification issue without padding bytes
For the following configuration case:

 - CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME
 - CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
 - CONFIG_SECURE_BOOT_ALLOW_SHORT_APP_PARTITION

verification of the application was failing because the externally
padded bytes were not considered in the hash (checksum) process.

This commit fixes the problem by enabling relevant code for secure OTA
without secure boot case.

Closes https://github.com/espressif/esp-idf/issues/11995
2023-08-14 03:29:44 +00:00
25876e8f49 Merge branch 'bluedroid/memory_full_v5.1' into 'release/v5.1'
fix (Bluedroid) : Fix the memory corruption issue(v5.1)

See merge request espressif/esp-idf!25181
2023-08-14 10:40:50 +08:00
b7aea79cb8 fix(gptimer): hal function placement under wrong condition
timer_hal_capture_and_get_counter_value
should be placed in the IRAM for speed optimization
because the default ISR handler is placed in the IRAM.

Closes https://github.com/espressif/esp-idf/issues/12021
2023-08-14 02:31:16 +00:00
c113507ad7 feat(gptimer): add gptimer linker.lf to control the placement of driver and hal
since the linker placement of the hal functions are controlled by the Kconfig in the driver component,
we should create the linker.lf in the driver component, not in the hal component.
2023-08-14 02:31:16 +00:00
6c0270c788 fix(i80_lcd): reset cs gpio on exit 2023-08-14 02:30:54 +00:00
5d49509969 Fix the mem corruption 2023-08-11 18:22:58 +00:00
6b1292284e fix(lp_i2c): Fixed a bug where the LP_I2C did not send NACK for 16-byte reads
This commit updates the LP_I2C driver used by the LP CPU wherein the
driver did not send out a NACK when we do a read of multiple of the FIFO
depth bytes. This was because the LP I2C controller was configured to
send an ACK when the Rx FIFO reaches the threshold instead of a NACK.
This commit updates the behavior.
2023-08-11 14:43:15 +00:00
a9ef76b031 fix(lp_i2c): Fixed a bug where LP I2C write got stuck
This commit fixes a bug where an I2C write got stuck when using the
lp_core_i2c_master_write_read_device() API. This was because the LP I2C
HW was not programmed with an END condition and therefore did not know
the end of a transaction.

Closes: https://github.com/espressif/esp-idf/issues/11958
2023-08-11 14:43:15 +00:00
ee8adce5ea fix(lp_i2c): Fixed incorrect clock setting for LP_I2C
The LP_I2C clock setting was incorrect and a lower frequency value was
being set during initialization. This commit fixes the behavior.
2023-08-11 14:43:15 +00:00
3fd0eff833 Merge branch 'fix/tools_idf_tools_tests_keep_constraints_v5.1' into 'release/v5.1'
fix(tools): idf_tools.py test improvements (v5.1)

See merge request espressif/esp-idf!25328
2023-08-11 19:44:53 +08:00
fdc8654c55 docs: add new mbedtls configuration option in optimize size 2023-08-11 16:40:38 +08:00
e9a1a7add5 feat(mbedtls): support ecp fixed-point multiplication configurable 2023-08-11 16:40:38 +08:00
8f91dfed12 fix(tools): Increase timeout in idf_tools.py Python tests 2023-08-11 09:25:52 +02:00
951f3300ed fix(tools): Keep the original Python environment when idf_tools.py tests are run 2023-08-11 09:25:52 +02:00
dced82b949 fix(tools): idf_tools.py tests should keep the original constraint file 2023-08-11 09:25:52 +02:00
68ac16c010 Merge branch 'version_check_fix_dev_5.1' into 'release/v5.1'
fix(tools): check_python_version accept dev releases as requirement (v5.1)

See merge request espressif/esp-idf!25186
2023-08-11 15:16:57 +08:00
2708ffece1 fix(bt): Fix argument type of ESP_LOGI for spp examples about format error
Closes https://github.com/espressif/esp-idf/pull/11819
2023-08-11 14:46:53 +08:00
e72cf8c908 fix(build_system): Allow dots in the name of an app binary 2023-08-08 15:13:25 +02:00
0be661f8bf fix(tools): check_python_version accept dev releases as requirement 2023-08-04 14:06:35 +02:00
e5199390a3 Merge branch 'bugfix/manage_i2c_clock_with_modem_clock_driver_v5.1' into 'release/v5.1'
fix(esp_hw_support): manage i2c_ana_mst clock witch modem clock driver (backport v5.1)

See merge request espressif/esp-idf!25164
2023-08-04 17:39:14 +08:00
94d129df76 fix(light_sleep): save vddsdio_config before lightsleep 2023-08-04 12:04:51 +08:00
aaf04f514f fix(esp_hw_support): manage i2c_ana_mst clock witch modem clock driver 2023-08-04 12:04:40 +08:00
3b48ccb343 fix(bt/controller): Fix disconnection due to lmp messages not being processed by both sides
The master sent lmp_enc_mode_req, and the slave sent lmp_switch_req.
However, both sides failed to handle the LMP message, resulting in LMP timeout.
2023-08-04 10:59:25 +08:00
b68519cb17 feat(gptimer): support set interrupt priority
Related forum post: https://esp32.com/viewtopic.php?f=13&t=34959
2023-08-04 10:20:07 +08:00
6ec52679c3 Merge branch 'bugfix/action_tx_sleep_fix_v5.1' into 'release/v5.1'
Trigger null data frame TX before going offchannel.(v5.1)

See merge request espressif/esp-idf!25095
2023-08-04 08:36:16 +08:00
2c196590d3 Merge branch 'bugfix/vtasksteptick_assert_failed_issue_v5.1' into 'release/v5.1'
backport v5.1:  fix the issue of esp32c6 enable light sleep, vTaskStepTick assert failed caused by wifi baseband sleep retention linked list

See merge request espressif/esp-idf!25147
2023-08-04 02:37:01 +08:00
96934613fb fix(wifi): Fix error propagation while initiating FTM 2023-08-03 19:55:55 +08:00
c97181ad5e fix(esp_wifi): Fix some OWE issues
1. Allow flow of traffic after 4 way handshake is completed
2. Fix beacon timeout issue in transition mode
2023-08-03 19:55:15 +08:00
b4df07185c fix (nimble): Add check to set length only if data is valid in periodic adv 2023-08-03 14:44:07 +05:30
de0e027bd1 fix(ble): Fix compile issue when disable duplicate config option in kconfig. 2023-08-03 17:07:02 +08:00
830a627362 remove(pm/deep_sleep): enable CI test for esp32h2 deepsleep 2023-08-03 16:46:55 +08:00
5859b83232 docs(pm/sleep): rewrite_all_low_to_any_low_when_not_esp32 2023-08-03 16:46:55 +08:00
badef66538 change(pm/deepsleep): rewrite the option all low as any low for esp32s2, esp32s3, esp32c6 and esp32h2 2023-08-03 16:46:55 +08:00
7c1e797008 change(pm/deepsleep): remove disable rtcio before hold it when ext1 wakeup 2023-08-03 16:46:55 +08:00
a4dd1b2bb3 feat(pm/deepsleep): Support EXT1 wakeup pin select 2023-08-03 16:46:55 +08:00
b27e57db7b feat(pm/deepsleep): Support EXT1 wakeup for esp32h2 deep_sleep 2023-08-03 16:46:55 +08:00
6768f098dc change(driver/rtcio): Describe RTCIO CAPS with more accurate note 2023-08-03 16:46:55 +08:00
8833c2bc87 change(pm/deepsleep): Update deep_sleep pmu analog parameter for esp32h2 2023-08-03 16:46:54 +08:00
4bc5e24f82 feat(pm/deepsleep): Support deep_sleep example and deep_sleep_wake_stub example for esp32h2 2023-08-03 16:46:54 +08:00
6dab947f68 spiram: Support configure CLK onto the same pin as flash for ESP32-D0WD
When using PSRAM of rev0, the Flash and PSRAM should use different clock pins. But if using newer PSRAM, this is not necesary. This MR fixed the issue that allocating CLK of PSRAM to the same pin as Flash may crash.
2023-08-03 15:44:22 +08:00
602d021263 Merge branch 'ble_mesh/esp32c6_BLEQABR23-266v5.1' into 'release/v5.1'
ble mesh: stack: return error when scanning failed to be enabled(v5.1)

See merge request espressif/esp-idf!24776
2023-08-03 11:15:42 +08:00
d6c18ad4c5 ble mesh: stack: return error when scanning failed to be enabled(v5.1) 2023-08-03 11:15:41 +08:00
a56ea11f91 Merge branch 'bugfix/fix_gpio_driver_calloc_v5.1' into 'release/v5.1'
fix(gpio): fix potential crash when processing gpio isr (v5.1)

See merge request espressif/esp-idf!24901
2023-08-03 11:13:47 +08:00
761af9869f fix(esp_wifi): fix no mac retention at wifi start 2023-08-03 10:54:31 +08:00
d73f61ebc9 fix(wifi): Prevent PMF config overwritten by tx_cb 2023-08-03 10:54:31 +08:00
bba48079a2 Fix(esp_wifi):revert send wake up and sleep null between scaning 2023-08-03 10:54:31 +08:00
6eb872f7d2 fix(wifi): fix some wifi bugs
1. fix the RX error when softAP and ESP-NOW both encrypted
2.Trigger null data frame TX before offchan channel switch.
2023-08-03 10:54:05 +08:00
0169ae545d fix(esp_prov): Fixed the deprecation APIs warnings
- Updated the extraction of service_uuids using AdvertisementData
- Replaced the `get_services()` API with the `services` property
2023-08-02 17:22:04 +05:30
827d863865 fix(wifi/phy): fix the issue of vTaskStepTick assert failed caused by wifi baseband retention linked list 2023-08-02 19:18:22 +08:00
4c7b2cb4e3 feat(tools): add espsecure.py to the Windows export scripts
This is not needed on Linux/macOS where the path to esptool directory
is added to PATH.
2023-08-02 10:43:54 +02:00
e449ec8f8e change(tools): export.ps1: define functions for helper python tools
Follows the approach used in Initialise-Idf.ps1 created by the tools
installer. This is the closes equivalent of "alias" used in export.bat

Closes https://github.com/espressif/esp-idf/issues/9849
2023-08-02 10:43:54 +02:00
bef0eaf2c7 ci(test): add SHA DMA mode test for large data in PSRAM
Covers a test scenario described in following issue:
https://github.com/espressif/esp-idf/issues/11915
2023-08-02 04:48:40 +00:00
b966103800 fix(sha): DMA mode iteration calculation issue for certain data lengths
SHA hardware DMA mode calculation had off-by-one error for specific
input lengths. This was causing last chunk of the input data not being
fed to the hardware accelerator and hence resulting in an incorrect
final result.

Closes: https://github.com/espressif/esp-idf/issues/11915
2023-08-02 04:48:40 +00:00
afcf3e261b Merge branch 'bugfix/fix_cache_data_mem_corrupt_after_sleep_v5.1' into 'release/v5.1'
fix(lightsleep): Suspend cache before goto sleep to avoid cache load wrong data (backport v5.1)

See merge request espressif/esp-idf!25087
2023-08-02 11:21:33 +08:00
01c6fc6511 Merge branch 'bugfix/minor_enterprise_fixes_v5.1' into 'release/v5.1'
Drop Eapol msg if EAP success is not processed (Backport v5.1)

See merge request espressif/esp-idf!25065
2023-08-02 10:48:56 +08:00
4cb955461f Merge branch 'backport/openthread_feature_to_v51' into 'release/v5.1'
Openthread: backport some features

See merge request espressif/esp-idf!25113
2023-08-02 10:47:32 +08:00
adcc697082 Merge branch 'bugfix/neighbour_report_crash_v51' into 'release/v5.1'
Fix crash in RRM neighbour report requests.(v5.1)

See merge request espressif/esp-idf!25114
2023-08-02 10:13:40 +08:00
ffaef9971a Merge branch 'docs/update_bluetooth_power_save_readme_v5.1' into 'release/v5.1'
Docs: update bluetooth power save readme(v5.1)

See merge request espressif/esp-idf!24843
2023-08-02 10:10:38 +08:00
727f7cbb3a Merge branch 'bugfix/sync_master_esp32c6_and_esp32h2_uart_ll_inline_attr' into 'release/v5.1'
fix(hal): sync esp32c6 and esp32h2 uart ll inline attr from master  to v5.1

See merge request espressif/esp-idf!24961
2023-08-01 16:18:16 +08:00
0ba37a2b85 fix(rrm) : Fix crash in RRM neighbour report requests.
Fix crash in sending new RRM neighbour report requests by removing
the call to neighbour report request timeout callback in case of
already ongoing neighbour report request timer.
2023-08-01 13:12:00 +05:30
12f1c165e3 feat(thread): update openthread lib 2023-08-01 14:59:07 +08:00
31212f284a feat(openthread): enable openthread border agent id support 2023-08-01 14:58:57 +08:00
c2681f00aa fix(openthread): Use the existing dataset for autostart 2023-08-01 14:58:35 +08:00
4fc329fc10 Merge branch 'bugfix/mbedtls_sha_test_fail_when_run_twice_v5.1' into 'release/v5.1'
fix(mbedtls): sha test will fail when run twice (backport v5.1)

See merge request espressif/esp-idf!24827
2023-08-01 10:57:25 +08:00
a4d64dab30 Merge branch 'backport/fix_ieee802154_state' into 'release/v5.1'
ieee802154: fix ieee802154 sleep state (backport v5.1)

See merge request espressif/esp-idf!24841
2023-08-01 10:55:51 +08:00
2f9bb7937a Merge branch 'bugfix/remove__warning_for_rc_fast_calibration_h2_v5.1' into 'release/v5.1'
remove(clk): remove warning log if RC_FAST clock calibration is needed on esp32h2 (v5.1)

See merge request espressif/esp-idf!25075
2023-08-01 10:53:46 +08:00
fbfdd97343 Merge branch 'bugfix/esp32h2_revision_config_prompt_v5.1' into 'release/v5.1'
fix(esp32h2): correct typo in chip revision prompt (v5.1)

See merge request espressif/esp-idf!25024
2023-08-01 10:53:26 +08:00
5dfbd1eb8d Merge branch 'bugfix/malloc_free_removal_v5.1' into 'release/v5.1'
change(esp_wifi): Remove direct call of malloc() and free() (v5.1)

See merge request espressif/esp-idf!24932
2023-08-01 10:53:10 +08:00
58a01eb10b fix(hal): sync esp32c6 & esp32h2 uart_ll inline attr from master 2023-08-01 02:32:55 +00:00
c5703cff8d fix(lightsleep): fix access pu_cfg after sleep wake wakeup which is linked to flash 2023-07-31 21:41:56 +08:00
dab45c243a Merge branch 'bugfix/handle_conn_type_and_array_reset_v5.1' into 'release/v5.1'
fix(nimble): Update connection type in reattempt connection code (v5.1)

See merge request espressif/esp-idf!24915
2023-07-31 20:31:00 +08:00
2b8e8e832a fix(bt/bqb): Modify BQB related configurations 2023-07-31 15:28:33 +08:00
f05c0a36e8 feat(bt): Add BQB enabling and rfcomm msc command sending support
1: add the CONFIG_BT_BQB_ENABLED for some functions of bqb test.
2: add bqb_rfc_send_msc_cmd function to send rfcomm msc command with
   only address arg input.
2023-07-31 15:28:20 +08:00
1acc14bf72 fix(lightsleep): suspend cache before goto sleep to avoid cache load wrong data after spi io isolation 2023-07-31 14:52:03 +08:00
bb845e1841 cache: refactor cache_utils into cache_hal instade 2023-07-31 14:52:03 +08:00
45eb0b6271 cache: fix cache suspended/resumed twice on S3 2023-07-31 14:52:03 +08:00
dc4731101d c2 h2 c6 headfile re-organized
c2 c6 h2 cfg_t and addr_t documented

comments for controller_enable
2023-07-31 12:41:52 +08:00
56eef9151f fix(nimble): Update connection type in reattempt connection code
Added change to set connection type correctly and clear array when it is
    full in reattempt connection flow
2023-07-31 09:30:45 +05:30
59672cee17 remove(clk): remove warning log if RC_FAST clock calibration is needed on esp32h2 2023-07-31 10:48:55 +08:00
d83fe16c93 Merge branch 'bugfix/revert_26mhz_esp32c2_bad_apb_clock_fix' into 'release/v5.1'
Revert "fix(soc): fix wrong freq definition for 26Mhz version esp32c2 soc" (v5.1)

See merge request espressif/esp-idf!24983
2023-07-31 10:26:58 +08:00
d026b92c75 Merge branch 'bugfix/fix_c6_wrong_pwdet_register_v5.1' into 'release/v5.1'
pwdet: fix pwdet wrong base address on c6 h2 (v5.1)

See merge request espressif/esp-idf!25025
2023-07-31 10:22:57 +08:00
b98bcd75aa Merge branch 'bugfix/backport_wifi_fixes_v5.1' into 'release/v5.1'
Backport some wifi fixes to v5.1

See merge request espressif/esp-idf!24948
2023-07-31 10:22:14 +08:00
a28ef8df5b Merge branch 'bugfix/cache_writeback_bug_v5.1' into 'release/v5.1'
esp_rom: patch Cache_WriteBack_Addr (backport v5.1)

See merge request espressif/esp-idf!24941
2023-07-31 10:17:10 +08:00
9fa9621a8f Merge branch 'bugfix/enable_i2c_master_clock_in_bbpll_configure_v5.1' into 'release/v5.1'
fix(rtc_clk): fix i2c master clock missing in bbpll configure (backport v5.1)

See merge request espressif/esp-idf!24852
2023-07-31 10:16:20 +08:00
a0d882c25e fix(esp32h2): correct typo in chip revision prompt 2023-07-28 13:45:28 +00:00
bc16331ba0 fix(test_submodules.py): don't rely on submodule init
Current version of the test is using "git-submodule foreach", which
requires submodules to be initialized. Non-initialized submodules are
ignored. Our CI is not performing submodule initialization, but instead
it only downloads the submodule content in tools/ci/ci_fetch_submodule.py
from cache and copies it into the submodule path.

Since we already know the submodule path from .gitconfig, we can use it
as argument to git-ls-tree and avoid calling git-submodule at all. This
allows to perform the test even if the submodules are not initialization
and also it makes the code simpler.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-07-28 12:13:32 +02:00
c612f36786 fix(esp_wifi): Drop Eapol msg if EAP success is not processed 2023-07-28 15:11:44 +05:30
4cf31c3194 Merge branch 'feature/services_health_therm_v5.1' into 'release/v5.1'
NimBLE: Added health thermometer profile (v5.1)

See merge request espressif/esp-idf!24830
2023-07-28 15:37:35 +08:00
6fb014d535 Merge branch 'feature/add_ble_multi_conn_example_with_vs_hci_5.1' into 'release/v5.1'
feat(ble): Added ble examples for multiple connections

See merge request espressif/esp-idf!24814
2023-07-28 15:35:54 +08:00
2e8dea7622 docs: provide CN tranlsation for api-guides/hardware-abstraction.rst 2023-07-28 14:42:03 +08:00
4b8fd7df41 docs: add H2 to list of supported series to front page doc 2023-07-28 14:02:16 +08:00
d5c6719a69 docs: provide CN translation for api-guides/performance/ram-usage.rst 2023-07-28 11:59:21 +08:00
5e60fb9924 docs(bt/example): Updated bluetooth power save readme 2023-07-27 07:54:36 +00:00
ce1a619252 docs(sleep_modes): Updated Wi-Fi/Bluetooth and Sleep Modes in docs 2023-07-27 07:54:36 +00:00
c4b984734f docs(esp_idf_monitor): ROM ELF address decoding 2023-07-27 06:50:36 +00:00
c7654d7c6b Merge branch 'ci/fix_failures_in_esp_http_client_example_v5.1' into 'release/v5.1'
CI: fix esp_http_client example failures in CI. Timeout was observed in the... (v5.1)

See merge request espressif/esp-idf!24949
2023-07-27 12:42:10 +08:00
fcb3ae32cb fix(pwdet): fix pwdet wrong base address on c6 h2 2023-07-27 12:30:44 +08:00
125014d242 fix(gpio): fix potential crash when processing gpio isr
If CONFIG_SPIRAM_USE_MALLOC is enabled, and cache is disabled when GPIO ISR is triggered,
it would lead to Guru Meditation Error due to "Cache disabled but cached memory region accessed".

Closes https://github.com/espressif/esp-idf/issues/11876
2023-07-26 12:42:11 +00:00
7a30edc412 fix(all): unify default mosi level to low on all targets 2023-07-26 20:34:25 +08:00
79b1379662 Merge branch 'bugfix/ble_issues_bugfix_v5.1' into 'release/v5.1'
ble: bugfix for esp32c6 and esp32h2

See merge request espressif/esp-idf!24952
2023-07-26 18:14:28 +08:00
b1799a7042 fix(bt): Fix bug with address resolution enabling during non-connected activities 2023-07-26 16:36:19 +08:00
063e62f30a docs(bt): Organize header files for esp32c3 and esp32s3 2023-07-26 16:36:08 +08:00
d01fa70ba8 fix(bt): Fix ble periodic advertising data length 0 error
- Fixed issues about data length 0 when set ext adv data,ext scan rsp data and periodic adv data
2023-07-26 16:35:57 +08:00
5f6f20ea30 fix(esp_pm): fix bad apb_max_freq for 26mhz esp32c2 2023-07-25 13:54:24 +08:00
e0e4642ff8 Revert "fix(esp_pm): Constrains the minimum frequency of APB_MAX when the modem is working"
This reverts commit 9158cba846.
2023-07-25 13:51:37 +08:00
c64231564a Revert "fix(soc): fix wrong freq definition for 26Mhz version esp32c2 soc"
This reverts commit d2fb32ed70.
2023-07-25 13:51:32 +08:00
c624b0a45e esp_rom_printf 2023-07-24 21:45:11 +08:00
c41579d2d3 examples: modbus add support for target esp32h2 2023-07-24 10:58:02 +02:00
99c0715962 ble update for doc: bugfix for esp32c6 and esp32h2 2023-07-24 10:59:19 +08:00
020eba74c6 change(esp_wifi): Remove direct call of malloc() and free() 2023-07-22 07:13:53 +00:00
87ad40140e docs(nimble): Update Kconfig help section for Example Ext Adv 2023-07-21 14:32:12 +00:00
14819cb409 ble update: bugfix for esp32c6 and esp32h2 2023-07-21 20:25:01 +08:00
de15b6f819 fix(mbedtls): sha test will fail when run twice 2023-07-21 12:06:26 +00:00
b8bbd90ad4 fix(ieee802154): fix ieee802154 sleep state 2023-07-21 11:03:23 +00:00
9df77e015a fix(rtc_clk): fix i2c master clock missing in bbpll configure 2023-07-21 11:01:56 +00:00
6406620712 fix(debug_ext): CTRL+C handling while waiting on gdb process
idf.py spawns gdb process within a thread and uses Thread.join() to wait
for the gdb process to finish. As CTRL+C(SIGINT) is used by gdb to interrupt the
running program, we catch the SIGINT while waiting on the gdb to finish,
and try Thread.join() again.

With cpython's commit

	commit a22be4943c119fecf5433d999227ff78fc2e5741
	Author: Victor Stinner <vstinner@python.org>
	Date:   Mon Sep 27 14:20:31 2021 +0200

	    bpo-45274: Fix Thread._wait_for_tstate_lock() race condition (GH-28532)

this logic doesn't work anymore, because cpython internally marks the
thread as stopped when join() is interrupted with an exception. IMHO
this is broken in cpython and there is a bug report about this
https://github.com/python/cpython/issues/90882. Problem is that
waiting on a thread to finish is based on acquiring a lock. Meaning
join() is waiting on _tstate_lock. If this wait is interrupted, the
above referenced commit adds a logic that checks if the lock is help,
meaning the thread is done and marks the thread as stopped. But there is
no way to tell if the lock was acquired by us running join() or if it's
held by someone else e.g. still by the thread bootstrap code. Meaning
the thread is still running.

I may be missing something, but I don't see any reason why to spawn gdb
process within a thread. This change removes the thread and spawns gdb
directly. Instead waiting on a thread, we wait on the process to finish,
replacing join() with wait() and avoiding this problem.

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

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-07-21 12:37:19 +02:00
2aaa5579f0 fix(ci): update HTTP client example tests runner assignment
HTTP client example tests now connect with locally hosted httpbin service
for more stable results across multiple runs
2023-07-21 15:21:41 +05:30
3298a8a483 CI: fix esp_http_client example failures in CI. Timeout was observed in the logs while performing HTTP requests. Changing the endpoint when testing in CI 2023-07-21 15:20:09 +05:30
dbe7c4a78d fix(esp_wifi): Backport some wifi fixes
1. Fix memory leak caused by assoc IE and retry timer
2. Discard commit frame received at confirmed state in SAE
3. Ignore immediate assoc req received from the station while we are
processing the older one. Fix regression caused by 4cb4faa9
2023-07-21 15:06:09 +05:30
aff298be18 fix(cache): no longer use freeze in esp_cache_msync
Writeback and invalidation don't need cache to be frozen first
2023-07-21 17:19:11 +08:00
3b8853b3c0 NimBLE: Added health thermometer profile 2023-07-21 05:36:32 +00:00
c8ec729252 feat(mcpwm): support open drain output for generator IO
Closes https://github.com/espressif/esp-idf/issues/11877
2023-07-21 05:08:20 +00:00
c818ddd282 feat(mcpwm): Allow for pull up/down to be configurable on generators 2023-07-21 05:08:20 +00:00
1b2b046f9a ci(pre-commit): Use the newest copyright checker 2023-07-21 04:41:18 +00:00
3187b8b326 Merge branch 'ci/fix_build_examples_v5.1' into 'release/v5.1'
CI: fix build examples import future

See merge request espressif/esp-idf!24864
2023-07-21 12:40:11 +08:00
38d54b4b62 fix(esp32s3): patch Cache_WriteBack_Addr api
Need to ensure that the cacheline being written back will not be
accessed during the write back process.
2023-07-21 11:44:56 +08:00
c4377e8dcc ci(esp_prov): remove import future usage 2023-07-19 14:03:12 +08:00
ff8c4f79d2 usb_host: Run formatting script 2023-07-15 12:56:45 +02:00
a3e4e9c772 usb_host: Fix spelling errors 2023-07-15 12:56:45 +02:00
b891aa0443 usb_host: Refactor USBH and USB Host Library calls to HCD
This commit refactors the USBH and the USB Host Library in the following ways:

- USBH now presents an abstraction of an endpoint (via usbh_ep_handle_t)
    - Added separate functions to enqueue/dequeue URBs to a particular endpoint
    - USB Host Library no longer calls HCD API directly. Calls USBH endpoint API
      instead.
- Renamed "notif_cb" to "proc_req_cb" (Processing Request Callback)
    - This is to avoid confusion with FreerTOS task notifications and Host
      Library client event notifications.
    - The processing functions of each layer (i.e., "xxx_process()") request
      calls via the "proc_req_cb"
    - The main handling function (i.e., usb_host_lib_handle_events()) is
      responsible for calling the required "xxx_process()" of each layer
2023-07-15 12:56:45 +02:00
b530d768e6 Merge branch 'fix/esp_aes_return_values_v5.1' into 'release/v5.1'
fix(mbedtls): fix return values of esp-aes APIs (v5.1)

See merge request espressif/esp-idf!24804
2023-07-15 12:24:25 +08:00
d84e6c3dda Merge branch 'bugfix/fix_esp32c2_wifi_works_on_too_low_apb_clk_v5.1' into 'release/v5.1'
fix(esp_pm): fix esp32c2 modem works on too low apb clk (backport v5.1)

See merge request espressif/esp-idf!24811
2023-07-15 12:18:09 +08:00
077cb8d150 Merge branch 'feature/usb_host_interface_claim_debug_info_v5.1' into 'release/v5.1'
USB Host: better debugging information during usb_host_interface_claim() (backport v5.1)

See merge request espressif/esp-idf!23456
2023-07-15 08:37:32 +08:00
b21005487d Merge branch 'bugfix/fix_sleep_cache_spi_safe_issues_backport_v5.1' into 'release/v5.1'
Power Management: fix cache spi flash related issues in sleep process (backport v5.1)

See merge request espressif/esp-idf!24812
2023-07-15 08:36:46 +08:00
d2fb32ed70 fix(soc): fix wrong freq definition for 26Mhz version esp32c2 soc 2023-07-15 01:57:07 +08:00
9158cba846 fix(esp_pm): Constrains the minimum frequency of APB_MAX when the modem is working 2023-07-15 01:56:55 +08:00
16d849b95e fix(esp_pm): fix flash access after light sleep wakeup 2023-07-15 01:41:03 +08:00
34dccf840e refactor(mbedtls): refactored the return values check in some esp-aes APIs 2023-07-14 20:51:47 +05:30
77f6f72b83 Merge branch 'fix/mbedtls_internal_shaX_process_api_port_v5.1' into 'release/v5.1'
fix(mbedtls): Fix the port for mbedtls_internal_shaX_process api (v5.1)

See merge request espressif/esp-idf!24809
2023-07-14 22:53:13 +08:00
f447ee35b8 Merge branch 'pkg_res_deprecation_5.1' into 'release/v5.1'
fix(tools/python_dep_check): replace deprecated pkg_resources with importlib (backport v5.1)

See merge request espressif/esp-idf!24817
2023-07-14 22:44:05 +08:00
77429e3ef7 fix(tools/python_dep_check): replace deprecated pkg_resources with importlib
Closes https://github.com/espressif/esp-idf/issues/11712
2023-07-14 14:16:10 +02:00
2d1544b863 feat(ble): Added ble examples for multiple connections 2023-07-14 19:01:11 +08:00
82fde1e823 Merge branch 'backport_v5.1' into 'release/v5.1'
fix(bt): Fix the issue of not printing the Bluetooth MAC address for ESP32(backport v5.1)

See merge request espressif/esp-idf!24780
2023-07-14 18:17:32 +08:00
ec35c2ab60 fix(esp_pm): put vddsdio configure api always in iram if pd_flash is enabled
- Put vddsdio configure api always in iram if pd_flash is enabled to ensure access flash at flash unavailable time
2023-07-14 17:48:27 +08:00
f69ea24d15 fix(esp_pm): wait spi bus idle before hold CS pin
- Wait for spi bus idle before holding CS pin to prevent hold selected state during sleep
2023-07-14 17:48:20 +08:00
bba66a1566 Merge branch 'fix/esp_ptr_check_sign_compare_v5.1' into 'release/v5.1'
fix(esp_hw_support): Fix different signed comparison in `esp_ptr_in_drom` (v5.1)

See merge request espressif/esp-idf!24798
2023-07-14 17:27:54 +08:00
4f37aeb747 Merge branch 'update/ble_mesh_debug_log_level_update_v5.1' into 'release/v5.1'
update(ble_mesh: stack): Update provisioning bearer check debug log to INFO level (v5.1)

See merge request espressif/esp-idf!24769
2023-07-14 16:56:19 +08:00
895d86621b fix(mbedtls): Fixed the transmission of return values of the esp-aes APIs
- Earlier, some intermediate return values were not stored and returned,
thus incorrect return values used to get transmitted to the upper layer of APIs.

- Also, zeroised the output buffer in case of error condition.
2023-07-14 14:20:47 +05:30
8692da51a0 fix(mbedtls): Fix the port for the mbedtls_internal_shaX_process API
- Also added the fix to update intermediate SHA state in the mbedtls_shaX_update API
2023-07-14 14:20:20 +05:30
e9a3a3eeea Merge branch 'bugfix/fix_some_wifi_bugs_24063_to_v5.1' into 'release/v5.1'
fix(wifi): Backport some wifi bugs 24063 to v5.1(Backport v5.1)

See merge request espressif/esp-idf!24794
2023-07-14 16:41:49 +08:00
fa95b46a0d Merge branch 'bugfix/fix_miss_annotate_ld_function_issue_v5.1' into 'release/v5.1'
fix(wifi): missed annotate ld function from txop fix(Backport v5.1)

See merge request espressif/esp-idf!24800
2023-07-14 16:41:04 +08:00
da8b9ad59d Merge branch 'bugfix/esp32c6_eco1_ble_lpclk_main_xtal_v5.1' into 'release/v5.1'
backport v5.1:  support 40 MHz XTAL as BLE low power clock source of esp32c6 eco1

See merge request espressif/esp-idf!24789
2023-07-14 16:34:09 +08:00
1296991b2f Merge branch 'backport/fix_br_issues_of_cert' into 'release/v5.1'
OpenThread: fix issues found in certification(backport v5.1)

See merge request espressif/esp-idf!24079
2023-07-14 15:01:07 +08:00
727a8cdb9e fix(wifi): missed annotate ld function from txop fix 2023-07-14 14:04:14 +08:00
8abdb33072 fix(esp_hw_support): Fix different signed comparison in esp_ptr_in_drom
- Closes https://github.com/espressif/esp-idf/issues/11653
- Closes https://github.com/espressif/esp-idf/issues/11865
2023-07-14 10:52:19 +05:30
fabe338a7a Merge branch 'backport/enrich_ieee802154_assert_info' into 'release/v5.1'
ieee802154: add debug feature for driver (Backport v5.1)

See merge request espressif/esp-idf!24793
2023-07-14 13:17:32 +08:00
7ae116e3b2 Merge branch 'backport/backport_ci_for_zigbee' into 'release/v5.1'
feat(zigbee): Update Zigbee examples based on latest library (Backport v5.1)

See merge request espressif/esp-idf!24792
2023-07-14 12:02:38 +08:00
7148d826eb Merge branch 'bugfix/wifi_bcn_timeout_m_f_probe_req_l0_v5.1' into 'release/v5.1'
backport v5.1: fix bcn_timeout and disconnect with error code 201, m f probe req l=0 issue

See merge request espressif/esp-idf!24781
2023-07-14 11:35:31 +08:00
5ec30e6fc2 ble : remove extra retention cnt upon deinit temporarily 2023-07-14 11:07:56 +08:00
6c62d13550 ble: support eco1 BLE light sleep 2023-07-14 11:07:49 +08:00
ee3452d410 light sleep: enable system clock in PMU HP sleep state when selecting a 40 MHz XTAL as low power clock source of ble 2023-07-14 11:07:41 +08:00
78683c7c33 modem clock: provide a protected wifipwr clock enable/disable interface to fix the bug of selecting xtal as the low power clock source for ble 2023-07-14 11:07:34 +08:00
a98db6dbd3 modem clock: gatable clock interface which can gate or ungate modem clock domain 2023-07-14 11:07:27 +08:00
6a5d4e40d2 Wi-Fi/power save: fix the some mac issues of wifi power save
Some APs are configured to hide the SSID, the length field of the SSID element
in the Beacon frame is set to 0. This can cause incorrect parsing of the Beacon
by the Wi-Fi MAC hardware.

Some APs send two beacon frames with different BSSID in a TBTT cycle. After
correctly parsing the beacon of the associated AP, it continue to receive the
other beacon frame, which will cause the MAC to remain in a wait RX/TXING
state, blocking the Wi-Fi go to sleep.
2023-07-14 10:51:47 +08:00
395ad3edc0 feat(wifi): itwt support itwt wake duration unit 2023-07-14 10:51:26 +08:00
cb6946cf00 feat(zigbee): Update zigbee examples based on latest library 2023-07-14 10:28:43 +08:00
e6ddff69da fix(ci): remove the check of a inexistent host 2023-07-14 10:16:04 +08:00
6585c521b3 feat(openthread): openthread upstream update 2023-07-14 10:15:59 +08:00
cb29bfa6b4 openthread: forbid otPlatUdp to connect to address 0.0.0.0 and port 0 2023-07-14 09:54:52 +08:00
dd0afffde3 openthread cli: set dua feature optional 2023-07-14 09:54:52 +08:00
77c60765ca openthread rcp: set link metrics feature optional 2023-07-14 09:54:52 +08:00
320f8ebe7d Merge branch 'fix/mpi_incorrect_assert_v5.1' into 'release/v5.1'
fix(mbedtls): Fix incorrect assert for H/W MPI operations (v5.1)

See merge request espressif/esp-idf!24784
2023-07-14 09:49:01 +08:00
7d6a86062b Merge branch 'bugfix/multiple_btm_rrm_task_v51' into 'release/v5.1'
Fix race conditions in btm task deletion(v5.1)

See merge request espressif/esp-idf!24764
2023-07-14 08:10:39 +08:00
bf4e212950 Merge branch 'feature/improve_pd_vddsido_help_doc_v5.1' into 'release/v5.1'
Power Management: improve ESP_SLEEP_PSRAM/FLASH_LEAKAGE_WORKAROUND help doc (backport v5.1)

See merge request espressif/esp-idf!24758
2023-07-14 06:38:02 +08:00
d7604b580a Merge branch 'bugfix/fix_some_wifi_bugs_230713_v5.1' into 'release/v5.1'
Wifi: Backport some wifi bugs 230713 to v5.1(Backport v5.1)

See merge request espressif/esp-idf!24753
2023-07-14 03:33:03 +08:00
77876e5bea ieee802154: add debug feature for driver 2023-07-14 03:13:04 +08:00
d0a2424151 Merge branch 'bugfix/sae_crypto_optimization_esp32_v5.1' into 'release/v5.1'
esp_wifi: Optimize sae crypto operations for esp32 (v5.1)

See merge request espressif/esp-idf!24760
2023-07-14 00:12:21 +08:00
aa5b7e0100 Merge branch 'bugfix/fix_some_bluedroid_bugs_v5.1' into 'release/v5.1'
Fixed some bluedroid bugs( backport v5.1)

See merge request espressif/esp-idf!24748
2023-07-14 00:11:43 +08:00
f195d48764 Merge branch 'bugfix/fix_s3_adc1_wrong_clk_div_v5.1' into 'release/v5.1'
adc: fix adc oneshot mode clk div issue on esp32, esp32s2 and esp32s3 (v5.1)

See merge request espressif/esp-idf!24743
2023-07-13 21:40:54 +08:00
8e25eb1e08 fix(mbedtls): Fix incorrect assert for H/W MPI operations
- Closes https://github.com/espressif/esp-idf/issues/11850
2023-07-13 16:24:44 +05:30
aba746cdc2 Merge branch 'refactor/s_adc_tsen_enabled_logic_v5.1' into 'release/v5.1'
refactor(adc): maintain s_adc_tsen_enabled in adc driver (v5.1)

See merge request espressif/esp-idf!24629
2023-07-13 18:49:01 +08:00
b188085ce8 usb_host: better debugging information during hcd_pipe_alloc() when usb_host_interface_claim() is being fulfiled. 2023-07-13 12:42:00 +02:00
9021fab579 Merge branch 'feature/use_esp_rom_delay_us_to_test_the_accuracy_of_gptimer_v5.1' into 'release/v5.1'
refactor(driver/gptimer): replace vTaskDelay with esp_rom_delay_us in test_apps(v5.1)

See merge request espressif/esp-idf!24724
2023-07-13 17:38:40 +08:00
d8db9235ff Merge branch 'backport/update_docs_for_openthread' into 'release/v5.1'
docs(openthread): update openthread README for H2 and C6 (Backport v5.1)

See merge request espressif/esp-idf!24750
2023-07-13 17:10:36 +08:00
ae5f8dc139 Merge branch 'bugfix/fix_sometimes_sta_can_not_get_ip_from_softap_issue_v5.1' into 'release/v5.1'
lower the dhcp discover and request retry backoff time (Backport v5.1)

See merge request espressif/esp-idf!24742
2023-07-13 17:09:04 +08:00
958ae62197 power save: fix bcn_timeout and disconnect with error code 201, m f probe req l=0 issue 2023-07-13 17:02:50 +08:00
2b1269d4fb fix(bt): Fix the issue of not printing the Bluetooth MAC address for ESP32
- Add a log statement to print the Bluetooth MAC address
2023-07-13 16:43:37 +08:00
124cce0de3 fix(bt): Fix ble advertising data length 0 error
- Fixed an issue where the BLE advertisement length of 0 was causing an error
2023-07-13 16:43:37 +08:00
78e641a4b0 Merge branch 'backport/bugfix_openthread_sleep_esp32s3_build' into 'release/v5.1'
fix(openthread): call sleep api only in native radio (Backport v5.1)

See merge request espressif/esp-idf!24754
2023-07-13 16:38:36 +08:00
04b0929d94 Merge branch 'bugfix/fix_idf_monitor_parsing_pc_with_wrong_rom_out_v5.1' into 'release/v5.1'
bugfix: fix idf passing wrong chip revision to idf_monitor  (backport v5.1)

See merge request espressif/esp-idf!24756
2023-07-13 16:35:53 +08:00
f718d26d31 update(ble_mesh: stack): Update provisioning bearer check debug log to INFO level 2023-07-13 14:38:23 +08:00
cfa70abe0e Merge branch 'bugfix/fix_adc_cali_workround_wrong_range_v5.1' into 'release/v5.1'
fix(regi2c): wrong ADC_CALI_PD_WORKAROUND on c6, h2 (v5.1)

See merge request espressif/esp-idf!24747
2023-07-13 14:17:27 +08:00
adc2bf1e93 Merge branch 'bugfix/fix_adc_continuous_driver_conv_frame_issue_v5.1' into 'release/v5.1'
adc: fix adc continuous driver conv_frame_size not bigger than 4092 issue / pr 11500, use circular dma descriptors in adc continuous mode (v5.1)

See merge request espressif/esp-idf!24739
2023-07-13 14:16:15 +08:00
d938559efb Fix(esp_wifi): Fix race conditions in btm task deletion 2023-07-13 10:13:57 +05:30
02aa8e1a89 esp_wifi: Optimize sae crypto operations for esp32 2023-07-13 09:47:09 +05:30
34b4936a7d fix(bt/bluedroid): Fix memory leak of gattc cache upon disconnection 2023-07-13 12:14:16 +08:00
62bd3973f6 bluedroid: fixed gatt tcb free when disconnecting 2023-07-13 12:13:47 +08:00
d4bb163e32 lower the dhcp discover and request retry backoff time 2023-07-13 11:49:12 +08:00
649541e6e3 refactor(driver/gptimer): replace vTaskDelay
with esp_rom_delay_us in test_apps

This commit replaces vTaskDelay with esp_rom_delay_us in the gptimer
driver. The former function can introduce millisecond jitter due to
OS task switching, while the latter has less jitter because of the
polling delay. Therefore this commit reduces the delta values for
various timer tests.

Changes made in this commit include:
- Replacing vTaskDelay with esp_rom_delay_us
- Adjusting delta values for various timer tests
2023-07-13 11:29:39 +08:00
3fc984690f change(Kconfig): improve ESP_SLEEP_PSRAM/FLASH_LEAKAGE_WORKAROUND help doc
Closes https://github.com/espressif/esp-idf/issues/11558
2023-07-13 11:02:44 +08:00
73e380cc3a fix: fix idf passing wrong chip revision to idf_monitor 2023-07-13 10:46:32 +08:00
7c4cd75fe7 feat(external coex): add set tx line flag api 2023-07-13 10:37:53 +08:00
2f56bd8aac external coex: rename coex gpio struct field names 2023-07-13 10:37:53 +08:00
5cd0b6216a external coex: add slave mode support 2023-07-13 10:37:53 +08:00
2c70cda9b6 external_coex: add extern coex wire 4 2023-07-13 10:37:53 +08:00
ef805e64a2 iperf: apply txline 2023-07-13 10:37:53 +08:00
00ef8391af external coex: add txline, apply coex schm and half tx, apply lowest pti 2023-07-13 10:37:53 +08:00
19d8bdbd10 fix(wifi): Add bugfixes and improvements
1. Update wifi security mode
2. Add check for memory allocation in tx buffers
3. Fix association refused temporarily comeback time set to zero issue
2023-07-13 10:37:53 +08:00
8f7829d94e doc: remove WEP as security mode
Signed-off-by: zhangyanjiao <zhangyanjiao@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/10015
2023-07-13 10:37:53 +08:00
1f0982c0fc spelling correction in documentation
Signed-off-by: zhangyanjiao <zhangyanjiao@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/9721
2023-07-13 10:37:53 +08:00
dc46fe5343 fix(esp_wifi): Enable FTM for ESP32C2, fix other FTM issues
Enable FTM for ESP32C2 and update wifi libs with below fixes -

1. Bugfixes in Initiator and Responder mode
2. Fix wrong RTT value in first FTM procedure without connection
3. Update FTM calibration values for ESP32S2, S3, C3 and C2
4. Update distance estimation logic
5. Add some useful command parameters in FTM example
6. Fix bug when number of FTM measurement frames received is more
   than (number_of_brusts * FTMs per brust).

Co-authored-by: Sarvesh Bodakhe <sarvesh.bodakhe@espressif.com>
2023-07-13 10:37:53 +08:00
a2d8225c9d feat(wifi): Add API to get RSSI info after station connects to AP
- Add esp_wifi_sta_get_rssi() function to retrieve RSSI info after station connects to AP
2023-07-13 10:37:53 +08:00
5492f382f9 fix(openthread): call sleep api only in native radio 2023-07-13 10:29:08 +08:00
a300e79589 Merge branch 'backport/openthread_light_sleep' into 'release/v5.1'
Backportv5.1/openthread light sleep

See merge request espressif/esp-idf!24736
2023-07-13 10:20:38 +08:00
9745b7fab0 Merge branch 'bugfix/update_esp_rom_include_v5.1' into 'release/v5.1'
fix(esp_rom): remove unsupported rom headers (backport v5.1)

See merge request espressif/esp-idf!24735
2023-07-13 09:46:42 +08:00
e2e5894bc2 Merge branch 'bugfix/fix_exception_in_wifi_prov_v5.1' into 'release/v5.1'
Nimble: Increase the number of semaphore count for allocation (v5.1)

See merge request espressif/esp-idf!24469
2023-07-13 08:31:53 +08:00
bcd5eea0ea Merge branch 'bugfix/btm_scan_done_crash_v51' into 'release/v5.1'
wpa_supplicant : Fix occasional crash during btm roam.

See merge request espressif/esp-idf!24731
2023-07-13 03:00:30 +08:00
5ed5b83f70 Merge branch 'bufix/update_esp_phy_h_comments_5.1' into 'release/v5.1'
esp_phy:update comments in esp_phy_init.h_5.1

See merge request espressif/esp-idf!24704
2023-07-12 22:36:21 +08:00
7a455c15f7 Merge branch 'bugfix/fix_crash_issue_cause_by_proto_cmd_v5.1' into 'release/v5.1'
fix proto cmd crash problem in iperf example (backport v5.1)

See merge request espressif/esp-idf!24727
2023-07-12 21:36:58 +08:00
30c5638ce6 docs(openthread): update openthread README for H2 and C6 2023-07-12 20:51:58 +08:00
73f16d0af2 Merge branch 'fix/mqtt_esp32h2_examples_v5.1' into 'release/v5.1'
protocols/examples: Disable Wifi connection if not supported (v5.1)

See merge request espressif/esp-idf!24249
2023-07-12 19:00:18 +08:00
cab8159187 Nimble: Increase the number of semaphore count to allow more semaphore
allocation
2023-07-12 15:31:46 +05:30
51cef99b71 Merge branch 'itwt/rename_connect_handler_v5.1' into 'release/v5.1'
Update itwt.c (backport v5.1)

See merge request espressif/esp-idf!24730
2023-07-12 17:29:21 +08:00
6acc155516 fix(regi2c): wrong ADC_CALI_PD_WORKAROUND on c6, h2 2023-07-12 17:28:01 +08:00
d21e332281 fix(adc): fixed esp32, esp32s2,esp32s3 adc oneshot mode clk div issue 2023-07-12 17:10:58 +08:00
e27b44e661 Merge branch 'bugfix/handle_signed_power_level_pcl_v5.1' into 'release/v5.1'
fix(nimble): Fix data type of power level and delta to handle negative values (v5.1)

See merge request espressif/esp-idf!24712
2023-07-12 16:54:23 +08:00
074850e87c wifi: Fix typos and formatting issues with wifi.rst
- Used code-blocks for correct highlighting
- Use inline literals for macros
- Fixed some typos
2023-07-12 16:44:17 +08:00
d8ee45ce08 adc: port gh pr to current adc continuous mode driver
DMA EOF may happens per multiple dma descriptors, instead of only one.

Closes https://github.com/espressif/esp-idf/pull/11500
2023-07-12 16:41:24 +08:00
5da5e1801b Fix #10804 by running continuous ADC DMA in endless loop instead of restarting after each run (descriptor chain) to avoid losing samples. Use descriptor error callback for GDMA to check for DMA buffer overrun.
Signed-off-by: Armando <douyiwen@espressif.com>
2023-07-12 16:41:19 +08:00
f76f3dc83f adc: fix adc continuous driver conv_frame_size not bigger than 4092 issue
Closes https://github.com/espressif/esp-idf/issues/11385
2023-07-12 16:41:11 +08:00
dd9bcef9ea refactor(adc): maintain s_adc_tsen_enabled in adc driver 2023-07-12 16:35:51 +08:00
e1a4d33575 Wifi: Fixed typo in wifi.rst
Closes https://github.com/espressif/esp-idf/pull/11640

[darian@espressif.com: Updated commit message]
Signed-off-by: Darian Leung <darian@espressif.com>
2023-07-12 16:23:34 +08:00
6c4c0c0c78 fix(esp_rom): remove unsupported rom headers 2023-07-12 01:06:04 -07:00
cadf80e875 Merge branch 'bugfix/fpu_registers_overwritten_v5.1' into 'release/v5.1'
Xtensa: fix a bug that altered CPU registers in FPU exception handlers (backport v5.1)

See merge request espressif/esp-idf!24607
2023-07-12 14:53:21 +08:00
7f722715b9 fix(openthread): Fixed light sleep lock issue 2023-07-12 14:38:36 +08:00
68910618fc openthread: disable HW AES (IDF-7704) 2023-07-12 14:38:18 +08:00
eb04ccaf0b openthread: change readme about specific target to 802.15.4 Soc 2023-07-12 14:38:08 +08:00
b422504d10 ieee802154: exclude sleep file when do not define CONFIG_FREERTOS_USE_TICKLESS_IDLE 2023-07-12 14:37:53 +08:00
55d30cdf2a openthread sleepy device: remove HW acceleration in sdkconfig 2023-07-12 14:37:40 +08:00
6b1e3924af ieee802154: update radio state in test 2023-07-12 14:37:29 +08:00
043893a49f ieee802154: change light sleep config in ieee802154 2023-07-12 14:37:18 +08:00
aee329de2b ieee802154: change BLE_BB/ieee802154_BB 2023-07-12 14:36:55 +08:00
2ac7558da2 openthread: add openthread autostart for sleep device 2023-07-12 14:36:41 +08:00
b4d951fa6a ieee802154: add sleep state 2023-07-12 14:36:21 +08:00
4f537d3b98 ieee802154: support light sleep 2023-07-12 14:32:28 +08:00
65bf500d29 Merge branch 'backport/openthread_feature' into 'release/v5.1'
Backport some Openthread related MR to 5.1(Backport5.1)

See merge request espressif/esp-idf!24285
2023-07-12 14:25:22 +08:00
cc1526c570 protocols/examples: Disable Wifi connection if not supported
- Disable Kconfig option for Wifi if not supported by the SoC
- Enable building mqtt examples when target is set to esp32h2
2023-07-12 06:19:20 +00:00
9fb1b59054 Merge branch 'bringup/esp32h2_light_sleep_for_rebase_backport_v5.1' into 'release/v5.1'
esp32h2: support light_sleep(backport v5.1)

See merge request espressif/esp-idf!24697
2023-07-12 13:39:49 +08:00
3095888aaf fix(wpa_supplicant) : Fix occasional crash during btm roam.
Fix crash due to premature deallocation of neighbour report elements
by scan_done. Post event to btm_rrm_t task to handle scan_done serially
rather than when btm_rrm_t task is processing btm request rx frame.
2023-07-12 10:39:05 +05:30
0c7e2a9d14 Merge branch 'bugfix/bod_intr__v5.1' into 'release/v5.1'
brownout: Disable the hardware BOD when BOD interrupt is enabled(backportv5.1)

See merge request espressif/esp-idf!24692
2023-07-12 11:17:58 +08:00
a0e8f5aa03 Merge branch 'contrib/github_pr_10811_5.1' into 'release/v5.1'
i2c: introduce chip specific cmd register number(backport v5.1)

See merge request espressif/esp-idf!24694
2023-07-12 11:15:03 +08:00
168c47f896 Update itwt.c
Change name from `connect_handler` to `start_handler`
2023-07-12 10:50:55 +08:00
26046c054e Merge branch 'contrib/github_pr_11810_v5.1' into 'release/v5.1'
ledc.c: Fix frequency calculation. (GitHub PR) (v5.1)

See merge request espressif/esp-idf!24696
2023-07-12 10:46:36 +08:00
a09b89b36d fix proto cmd crash problem in iperf example 2023-07-12 10:44:12 +08:00
196fc559b4 Merge branch 'feature/ble_mesh_example_support_duplicate_scan_v5.1' into 'release/v5.1'
Feature/ble mesh example support duplicate scan(v5.1)

See merge request espressif/esp-idf!24700
2023-07-12 10:38:05 +08:00
7d11517a68 Merge branch 'asyncio_error_v5.1' into 'release/v5.1'
fix(tools/hints): add guide to fix error with unsupported asyncio (v5.1)

See merge request espressif/esp-idf!24701
2023-07-12 10:34:23 +08:00
966312e54f Merge branch 'backport/ieee802154_feature' into 'release/v5.1'
Backport some IEEE802154 related MR to 5.1(Backport 5.1)

See merge request espressif/esp-idf!24678
2023-07-12 07:23:43 +08:00
788f1def16 Merge branch 'bugfix/esp_netif_recieve_returns_v5.1' into 'release/v5.1'
esp_netif: Report error if esp_netif_receive() fails (v5.1)

See merge request espressif/esp-idf!24655
2023-07-12 04:07:17 +08:00
6b2209c41d Merge branch 'backport/phy_track_pll_to_v51' into 'release/v5.1'
Backport: phy track pll logic refactor to V5.1(Backport v5.1)

See merge request espressif/esp-idf!24689
2023-07-12 00:13:50 +08:00
7f69e29bff Merge branch 'docs/h2_timer_docs_v5.1' into 'release/v5.1'
docs: updated misc docs with H2 specific information. (v5.1)

See merge request espressif/esp-idf!24136
2023-07-11 23:44:35 +08:00
fa8f99249c fix (nimble): Fix data type of power level and delta to handle negative values 2023-07-11 17:18:09 +05:30
ba54ce8657 esp_phy:update comments in esp_phy_init.h 2023-07-11 17:37:13 +08:00
174c38ba5c Merge branch 'bugfix/fix-esp-even-compile-error-v5.1' into 'release/v5.1'
esp_event: fix build error related to format (v5.1)

See merge request espressif/esp-idf!24664
2023-07-11 17:08:38 +08:00
819da74d9f Merge branch 'bugfix/improve-git-describe-handling-v5.1' into 'release/v5.1'
build system: more accurate error information for git_describe (v5.1)

See merge request espressif/esp-idf!24665
2023-07-11 17:07:40 +08:00
8e2de1b594 Merge branch 'ble_dev/esp32c6_support_power_save_example_5.1' into 'release/v5.1'
ble: support esp32c6 power save example

See merge request espressif/esp-idf!24386
2023-07-11 16:55:22 +08:00
3fc633e326 fix(tools/hints): add guide to fix error with unsupported asyncio
Closes https://github.com/espressif/esp-idf/issues/11732
2023-07-11 10:53:29 +02:00
7db5541c9f Merge branch 'docs/add_Chinese_translation_for_api-guides/tools/idf-py_backport_v5.1' into 'release/v5.1'
docs: add CN translation for api-guides/tools/idf-py.rst (backport v5.1)

See merge request espressif/esp-idf!24190
2023-07-11 16:34:23 +08:00
6f253e2d37 docs: add CN translation for api-guides/tools/idf-py.rst (backport v5.1) 2023-07-11 16:34:23 +08:00
7e3463768f Merge branch 'bugfix/saving-esp-idf-env-as-utf8-v5.1' into 'release/v5.1'
build system: fix init.bat crash in windows when folder contains unicode characters (v5.1)

See merge request espressif/esp-idf!24666
2023-07-11 16:00:15 +08:00
3603611af1 freertos: add a unit test for FPU context switch 2023-07-11 15:55:40 +08:00
f002aeae3d Xtensa: fix a bug that altered CPU registers in FPU exception handlers
* Fixes https://github.com/espressif/esp-idf/issues/11690
2023-07-11 15:55:35 +08:00
573755a8d2 feat(ble_mesh: stack: esp32c6/h2): update Kconfig file to support duplicate scan. 2023-07-11 15:54:48 +08:00
e5e25c89e7 feat(ble_mesh: example: esp32c6/h2): update config file to support duplicate scan. 2023-07-11 15:54:41 +08:00
1d158ddd10 fix(ledc): fix frequency calculation
ledc.c: Fix frequency calculation.
Round int instead of truncate.

Merges https://github.com/espressif/esp-idf/pull/11810
2023-07-11 15:22:34 +08:00
af5a2fe4fd bugfix: update pm trace io num for esp32h2 2023-07-11 15:06:01 +08:00
28cdaa58bb docs: updated misc docs with H2 specific information. 2023-07-11 07:05:53 +00:00
efc9761ff0 Merge branch 'fix/heap-test-h2_v5.1' into 'release/v5.1'
heap: remove exclusion of esp32h2 as a target for heap pytest (v5.1)

See merge request espressif/esp-idf!24567
2023-07-11 15:05:07 +08:00
ee299b2d53 bugfix: set FORCE_INLINE_ATTR for resume_uart 2023-07-11 15:04:19 +08:00
c2b8a1d95c i2c: introduce chip specific cmd register number
Merges https://github.com/espressif/esp-idf/pull/10811
2023-07-11 14:55:46 +08:00
d191b0c540 Power Management: fix hp xtal wait bug for esp32h2 and esp32c6 2023-07-11 14:53:43 +08:00
60a3e5053e Power Management: support pu xtal in light sleep for esp32h2 2023-07-11 14:53:15 +08:00
7599d07c3f bugfix: remove the workaround implemented in MR 22773 about the lp_timer 2023-07-11 14:53:02 +08:00
6e15f589cc Power Management: move lp_timer_hal.c to upper hal layer for esp32h2 and esp32c6 2023-07-11 14:52:46 +08:00
8aaa256aa9 Power Management: support RC32K or Crystal32K powered down 2023-07-11 14:52:35 +08:00
c15c8664ca codeclean: fix prefix to LP_AON and add LP_AON_STORE8_REG 2023-07-11 14:52:24 +08:00
f44e8a8a8f brownout: Disable the hardware BOD when BOD interrupt is enabled 2023-07-11 14:32:40 +08:00
bdc49fbff4 ieee802154: update test code 2023-07-11 14:28:54 +08:00
91d17e0073 ieee802154: support ieee802154 test 2023-07-11 14:28:54 +08:00
c80ee99c6a ieee802154: add a patch for ieee802154 test 2023-07-11 14:28:54 +08:00
bba902cc46 ieee802154: add CONFIG_IEEE802154_TEST for supporting ieee802154 test 2023-07-11 14:28:54 +08:00
e88adc3401 IEEE802154: match C6 max txpower value with datasheet 2023-07-11 14:28:54 +08:00
b135270e68 ieee802154: add modem reset and fix ieee802154 test app reg command error 2023-07-11 14:28:54 +08:00
181ed29c3a feat(openthread): Add event post for thread role changed and integrate all the thread state change callbacks 2023-07-11 14:27:05 +08:00
bcd99bb58d fix(openthread): fix ot settings out of range issue 2023-07-11 14:21:19 +08:00
a125e8f7ed Merge branch 'feature/services_proximity_v5.1' into 'release/v5.1'
NimBLE : Added proximity sensor as a service (v5.1)

See merge request espressif/esp-idf!24649
2023-07-11 14:04:31 +08:00
2c9a2a76f7 example: bringup light sleep example for esp32h2 2023-07-11 13:58:08 +08:00
2abfeb19c8 Power Management: change the IO hold interface for esp32c6 2023-07-11 12:04:20 +08:00
8ef8459c0d Power Management: update pmu init and sleep parameter 2023-07-11 12:04:09 +08:00
3b40ce4d9b Power Management: fix REGDMA clock issue when wake up form light sleep 2023-07-11 12:03:59 +08:00
e5e0a0918a Power Management: support MODEM domain powered down in light sleep for esp32h2 2023-07-11 12:03:46 +08:00
c39a0cc0b5 Power Management: fix REGDMA power issue when TOP domain powered down during light sleep for esp32h2 2023-07-11 12:03:36 +08:00
113366820b Power Management: support TOP domain powered down in light sleep for esp32h2 2023-07-11 12:03:25 +08:00
24486dd069 Power Management: support PAU REGDMA feature for esp32h2 2023-07-11 12:03:13 +08:00
c12d7f5463 Power Management: support CPU powered down in light sleep for esp32h2 2023-07-11 12:03:02 +08:00
356fa3ab4b Power Management: support DFS and PMU feature for esp32h2 2023-07-11 12:02:39 +08:00
62b20b5518 Merge branch 'bugfix/esp_event_err_docs_v5.1' into 'release/v5.1'
fix(core-system/esp event): Fixed missing error return  documentation for... (v5.1)

See merge request espressif/esp-idf!24573
2023-07-11 11:46:43 +08:00
2bee46a354 esp_phy: phy track pll logic refactor 2023-07-11 10:50:29 +08:00
244be856b2 openthread: enable HW AES in ot_cli example 2023-07-11 10:39:34 +08:00
72cc92578d Openthread: fix dead lock related to ot and lwip 2023-07-11 10:39:34 +08:00
26c0a23598 openthread: change partition table to nvs flash 2023-07-11 10:39:34 +08:00
d4dd3dfa2b openthread: introduce the auto start API 2023-07-11 10:39:34 +08:00
f3924e5aa8 openthread: add source address selection hook 2023-07-11 10:39:34 +08:00
bcb9e6b5eb lwip: add a hook for ip6 source address selection 2023-07-11 10:39:34 +08:00
e9a8456279 Merge branch 'fix/mbedtls_ecdsa_veriy_restartable_v5.1' into 'release/v5.1'
mbedtls: update submodule (v5.1)

See merge request espressif/esp-idf!24636
2023-07-11 10:18:27 +08:00
87426b8fbd Merge branch 'fix/esp32s3_sysview_trace_corrupt_v5.1' into 'release/v5.1'
fix(app_trace): Fix apptrace data corruption on ESP32-S3 (v5.1)

See merge request espressif/esp-idf!24680
2023-07-11 08:37:55 +08:00
37ff7a92bf Merge branch 'bugfix/wps_deauth_sent_before_eap_failure_v5.1' into 'release/v5.1'
Fix for sending deauth before Eap-Failure in WPS (v5.1)

See merge request espressif/esp-idf!24368
2023-07-11 06:43:27 +08:00
18a8f86ecb Merge branch 'bugfix/lwip_dhcps_hook_types_v5.1' into 'release/v5.1'
lwip: Fix incorrect invocation of the hook `LWIP_HOOK_DHCPS_POST_APPEND_OPTS` (v5.1)

See merge request espressif/esp-idf!24658
2023-07-11 03:31:31 +08:00
1dbbd97749 ble: support esp32c6 power save example 2023-07-10 18:08:37 +00:00
0cf0757224 Merge branch 'bugfix/ulp_fsm_ci_v5.1' into 'release/v5.1'
ulp-system/ulp-fsm: clean up test cases (v5.1)

See merge request espressif/esp-idf!24070
2023-07-11 01:46:39 +08:00
6cd4e61149 Merge branch 'bigfix/examples_ping_console_v5.1' into 'release/v5.1'
examples: Fix icmp-echo to auto connect to Ethernet/WiFi if selected (v5.1)

See merge request espressif/esp-idf!24654
2023-07-11 01:45:54 +08:00
cf517e3e39 Merge branch 'bugfix/tempsensor_wifi_conflict_v5.1' into 'release/v5.1'
temperature_sensor: Fix issue that have conflict with phy / Fix phy pwdet and tsens power cannot be set twice issue (v5.1)

See merge request espressif/esp-idf!24064
2023-07-11 01:38:04 +08:00
bdbb717be9 mbedtls: update submodule to include:
fix: mbedtls_ecdsa_can_do was not being defined when ECDSA_SIGN_ALT is defined but ECDSA_VERIFY_ALT is not defined causing mbedtls_ecdsa_verify_restartable to always fail.
feature: initial version of the sbom.yml file
2023-07-10 14:11:51 +00:00
a09a503073 Merge branch 'bugfix/nan_sd_dp_fixes_v5.1' into 'release/v5.1'
NAN Service discovery and datapath bugfixes (Backport v5.1)

See merge request espressif/esp-idf!24383
2023-07-10 21:44:49 +08:00
24011f1e6c Merge branch 'fix/update_doc_for_spi_slave_hd_protocol_v5.1' into 'release/v5.1'
fix(all): update documentaion for spi slave hd protocols (v5.1)

See merge request espressif/esp-idf!24635
2023-07-10 19:39:45 +08:00
3eacf08267 fix(app_trace): Fix apptrace data corruption on ESP32-S3
Close https://github.com/espressif/esp-idf/issues/10604
diff --git a/components/soc/esp32s3/include/soc/tracemem_config.h b/components/soc/esp32s3/include/soc/tracemem_config.h
index 55c9b907dd..75fd87419b 100644
--- a/components/soc/esp32s3/include/soc/tracemem_config.h
+++ b/components/soc/esp32s3/include/soc/tracemem_config.h
@@ -10,7 +10,7 @@ extern "C" {
 #endif

 #define TRACEMEM_MUX_BLK0_NUM                   22
-#define TRACEMEM_MUX_BLK1_NUM                   23
+#define TRACEMEM_MUX_BLK1_NUM                   26

 #if (TRACEMEM_MUX_BLK0_NUM < 6) || (TRACEMEM_MUX_BLK0_NUM > 29)
 #error Invalid TRAX block 0 num!
2023-07-10 13:06:02 +03:00
e21fc0dc50 Merge branch 'feature/update_ble_libs_5.1' into 'release/v5.1'
ble: Added APIs for QA test

See merge request espressif/esp-idf!24651
2023-07-10 17:21:51 +08:00
e68d4a7177 Merge branch 'feature/update_ble_duplicte_vs_hci_lib_fix_5_1' into 'release/v5.1'
Feature/update ble duplicte vs hci lib fix 5 1

See merge request espressif/esp-idf!24638
2023-07-10 15:09:18 +08:00
fed2e21594 Merge branch 'feature/usb/host/hid_example_update_v5.1' into 'release/v5.1'
USB Host (HID): HID Host example update (backport v5.1)

See merge request espressif/esp-idf!24532
2023-07-10 13:31:53 +08:00
7bce53cc0d build system: fix init.bat crash in windows when folder contains unicode characters 2023-07-10 11:33:01 +08:00
d636754e70 build system: more accurate error information for git_describe
Closes https://github.com/espressif/esp-idf/issues/9071

See merge request espressif/esp-idf!23891
2023-07-10 11:31:32 +08:00
e29e39f9d6 esp_event: fix build error related to format
Closes https://github.com/espressif/esp-idf/issues/11428

See merge request !23833
2023-07-10 11:28:03 +08:00
0954babbd6 temperature_sensor: make as a weak link 2023-07-10 11:16:09 +08:00
a33541f036 phy: fix phy pwdet and tsens power cannot be set twice issue
Closes https://github.com/espressif/esp-idf/issues/11627
2023-07-10 11:16:09 +08:00
e493a99da2 temperature_sensor: Apply new-shared interface in temperature sensor driver 2023-07-10 11:16:09 +08:00
acc6d99572 temperature_sensor: Add new interface and reference counts so that phy and driver can use together 2023-07-10 11:16:09 +08:00
4a1c291389 fix(all): update documentaion for spi slave hd protocols 2023-07-10 03:00:45 +00:00
3b7dc69e90 Merge branch 'feature/sync_libphy_v5.1' into 'release/v5.1'
sync libphy to v5.1

See merge request espressif/esp-idf!24588
2023-07-10 10:38:41 +08:00
bd985deee6 Merge branch 'doc/add_timing_diagram_for_bt_l2cap_server_and_client_v5.1' into 'release/v5.1'
docs(examples/bluetooth): Add the sequence diagram for L2CAP connection and the discription for the diagram (backport v5.1)

See merge request espressif/esp-idf!24661
2023-07-10 10:30:27 +08:00
0930b5ca1e Merge branch 'bugfix/fix_spi_flash_api_concurrency_issue_v5.1' into 'release/v5.1'
spi_flash: fix concurrency issue when concurrently calling esp_flash apis (v5.1)

See merge request espressif/esp-idf!24508
2023-07-10 10:24:51 +08:00
c558904661 Merge branch 'bugfix/handle_correct_return_value_v5.1' into 'release/v5.1'
Nimble: Corrected conditional check during connection to handle failure case (v5.1)

See merge request espressif/esp-idf!24644
2023-07-10 10:24:18 +08:00
28860655af Merge branch 'bugfix/update_esp_rom_layout_v5.1' into 'release/v5.1'
esp_rom: fix rom layout issues (backport v5.1)

See merge request espressif/esp-idf!24639
2023-07-10 10:23:16 +08:00
33aff4c5a0 Fix for sending deauth before Eap-Failure in WPS 2023-07-10 02:20:51 +00:00
59f91c5f37 Merge branch 'bugfix/fix_deepsleep_wakestub_example_ci_failure_v5.1' into 'release/v5.1'
ci: fix deepsleep wakestub example ci failure (backort v5.1)

See merge request espressif/esp-idf!24465
2023-07-10 10:19:40 +08:00
625ebbf829 docs(examples/bluetooth): Add the sequence diagram of L2CAP connection and the discription for the sequence diagram
1: add the sequence diagram for the bluetooth example projects,bt_l2cap_server and bt_l2cap_client, which implenment the L2CAP connection.
2: add the discription for the sequence diagram.
2023-07-08 12:38:42 +08:00
575a433c98 Fix incorrect invocation of the hook LWIP_HOOK_DHCPS_POST_APPEND_OPTS
Fix https://github.com/espressif/esp-idf/issues/11373
2023-07-07 14:14:02 +02:00
cf4c39a225 esp_netif: Make esp_netif_receive() return value configurable 2023-07-07 13:56:13 +02:00
39b8218750 esp_netif: Report error if esp_netif_receive() fails
Closes https://github.com/espressif/esp-idf/issues/10770
2023-07-07 13:56:13 +02:00
7865676159 examples: Fix icmp-echo to auto connect to Ethernet/WiFi if selected
Closes https://github.com/espressif/esp-idf/issues/10655
2023-07-07 13:53:47 +02:00
a7b62bbcaf Merge branch 'bufix/fix_assert_while_stack_deinit_v5.1' into 'release/v5.1'
NimBLE :  Fix assert due to controller event while stack deinit (v5.1)

See merge request espressif/esp-idf!24620
2023-07-07 19:41:52 +08:00
027e6ecab9 ble: Added APIs for QA test 2023-07-07 19:40:48 +08:00
5c11366e01 Merge branch 'feature/support_adc_calibration_on_c6_v5.1' into 'release/v5.1'
adc_cali: supported adc calibration on esp32c6 (v5.1)

See merge request espressif/esp-idf!23936
2023-07-07 18:29:11 +08:00
18ffa02b72 esp_wifi : Fix collection of issues during sta scan and roam.
1) Fix issue during split scan to allow for data tx.
2) Fix issue when parsing wpa_ie to set correct authmode when AP
   supports both WPA_EAP and WPA_EAP_SHA256 authmode.
   Closes https://github.com/espressif/esp-idf/issues/11202
3) Fix an occasional crash during sta roam.
4) Add home_channel_dwell_time to wifi_scan_config_t. This allows
   configuration of the time spent between scanning consecutive
   channels for tx.
2023-07-07 18:11:38 +08:00
43604dffbe esp_wifi: fix ret when setting channel at wifi not started, fix timer callback 2023-07-07 18:09:29 +08:00
6cb39b4485 Merge branch 'bugfix/concurrency_while_eloop_register_v5.1' into 'release/v5.1'
esp_wifi: Bugfix concurrency observed while doing eloop register (v5.1)

See merge request espressif/esp-idf!24570
2023-07-07 18:00:49 +08:00
8592f19a95 esp_phy: fix rtc_printf and libbtbb version print 2023-07-07 17:39:25 +08:00
044baf90e5 sync libphy to v5.1 2023-07-07 17:38:01 +08:00
66f384cad0 Merge branch 'bugfix/added_chip_based_cca_config_v5.1' into 'release/v5.1'
ble: fix cca for esp32c2

See merge request espressif/esp-idf!24426
2023-07-07 17:31:00 +08:00
893967f596 feat (NimBLE): Add proximity sensor as a service 2023-07-07 14:59:22 +05:30
64ba835d05 Merge branch 'feat/improve_wifi_rx_in_high_interference_v5.1' into 'release/v5.1'
esp_phy: update esp32c2 phy lib to fix some issues(v5.1)

See merge request espressif/esp-idf!24163
2023-07-07 17:19:27 +08:00
a787b927c7 Nimble: Corrected conditional check during connection to handle failure case 2023-07-07 14:33:44 +05:30
a8c9665ae2 Merge branch 'ble_dev/support_esp32h2_modem_clock_selection_5.1' into 'release/v5.1'
ble: support esp32h2 modem clock selection

See merge request espressif/esp-idf!24388
2023-07-07 16:57:22 +08:00
68654bfd5f Merge branch 'feature/add_support_pcl_vsc_v5.1' into 'release/v5.1'
fix(Nimble): Add VSC / VSE handling code and structure for PCL Set RSSI (v5.1)

See merge request espressif/esp-idf!24608
2023-07-07 16:27:26 +08:00
fc7d4488bf esp_rom: fix rom layout issues 2023-07-07 01:02:07 -07:00
730d8e18d8 fix(ble): Fix duplicate var length issue 2023-07-07 14:29:21 +08:00
1398605873 fix(ci): Fix declaration isn't a prototype issue 2023-07-07 14:29:21 +08:00
0359d0df5d feat(ble): Update ble lib to 6f9ef119 2023-07-07 14:29:21 +08:00
eea7df273c change(ble): Enable pdu type trig in duplicate in default mode as before 2023-07-07 14:29:21 +08:00
a5f127ec88 feat(ble): Add duplicate refersh function support for esp32h2 2023-07-07 14:29:21 +08:00
2b195191b3 feat(ble): Add support to scan period refresh duplicate cache list 2023-07-07 14:29:21 +08:00
a357fd17c2 feat(ble): Add duplicate filter feature enable on ble for h2. 2023-07-07 14:29:21 +08:00
6dc7d9b63f feat(ble): Add duplicate filter feature enable on ble for c6. 2023-07-07 14:29:21 +08:00
a7f00f503a spi_flash: rename spi_flash_os_func_app: spi_start, spi_end
spi_start -> s_acquire_spi_bus_lock
spi_end -> s_release_spi_bus_lock
2023-07-07 10:13:28 +08:00
f142415475 spiflash: added esp_flash API concurrency pressure test 2023-07-07 10:13:28 +08:00
faa8c2bc8f spi_flash: fix concurrency issue when calling esp_flash apis under xip_psram or auto_suspen 2023-07-07 10:13:28 +08:00
d2e8dccd40 spiflash: fix not calling on_spi_acquired when CONFIG_SPI_FLASH_SHARE_SPI1_BUS issue 2023-07-07 10:13:28 +08:00
7c6ab05f50 feat(nimble): Add support for PCL Set RSSI VSC and example code for its usage
This commit adds support for sending Vendor Specific HCI commands and handling Vendor Specific HCI
Events in the Nimble stack. It also includes the necessary configuration options and APIs to handle
these commands and events.

The following changes were made:
- Added configuration option to enable support for VSC and VSE
- Added API to send Vendor Specific HCI commands
- Added example code for using the Set RSSI VSC for Power Control

This commit also includes some minor code improvements and bug fixes
2023-07-06 19:54:19 +05:30
022ce314c3 Nimble: Add APIs to handle vs HCI commands and events 2023-07-06 19:54:19 +05:30
bb3bd09b93 esp_phy: update esp32c2 phy lib to fix some issues
1. improve Wi-Fi rx 11b pkts for AC-DC power supply modules.
2. fix Wi-Fi disconnect in low temperature.
3. fix RTC_SW_CPU_RST occur in Wi-Fi start and stop process.
2023-07-06 17:09:09 +08:00
f1b9af72fd Merge branch 'bugfix/sync_reporting_files_v5.1' into 'release/v5.1'
NimBLE : Sync common porting and nimble submodule files (v5.1)

See merge request espressif/esp-idf!24277
2023-07-06 15:05:54 +08:00
d25df894fa Merge branch 'bugfix/host_flw_ctrl_v5.1' into 'release/v5.1'
NimBLE: Fixed mismatch of number of completed packtes in host flow control (v5.1)

See merge request espressif/esp-idf!23854
2023-07-06 14:33:06 +08:00
7b70e2eb34 ble: fix cca for esp32c2 2023-07-06 14:05:43 +08:00
fe05003a8f fix(nimble): Fix assert due to controller event while stack deinit 2023-07-06 10:30:36 +05:30
57312e6e3e adc_calib: support calibration v2 on esp32c6 2023-07-06 10:36:29 +08:00
5e3488396a Merge branch 'bugfix/fix_some_bt_controller_bug_v5.1' into 'release/v5.1'
component_bt:Fixed some bluetooth bugs(v5.1)

See merge request espressif/esp-idf!24579
2023-07-06 00:54:40 +08:00
16ff61b36e Merge branch 'ble_dev/support_ble_light_sleep_using_extra_link_5.1' into 'release/v5.1'
Ble dev/support ble light sleep using extra link 5.1

See merge request espressif/esp-idf!24192
2023-07-05 20:32:56 +08:00
71a5663786 Merge branch 'bugfix/hfp_packet_type_err_v5.1' into 'release/v5.1'
Revised (e)SCO configuration parameter sets (v5.1)

See merge request espressif/esp-idf!24346
2023-07-05 20:05:59 +08:00
d682fbeb07 Merge branch 'bugfix/alarm_not_free_when_a2dp_deinit_v5.1' into 'release/v5.1'
bugfix/Fixed the issue of alarm leak (v5.1)

See merge request espressif/esp-idf!24351
2023-07-05 19:53:09 +08:00
425b660583 Merge branch 'feature/update_avrcp_v1.5_v5.1' into 'release/v5.1'
change(bt/Bluedroid): Update AVRCP version to 1.5 (v5.1)

See merge request espressif/esp-idf!24582
2023-07-05 19:52:09 +08:00
4474b0ac8c Merge branch 'bugfix/resume_ext_scan_pti_in_time_v5.1' into 'release/v5.1'
bt: fix the issue that BLE scan uses high priority incorrectly and causes Wi-Fi unable to work normally on ESP32-C3 and ESP32-S3(backport v5.1)

See merge request espressif/esp-idf!24403
2023-07-05 19:49:05 +08:00
51ed7ef9f1 Merge branch 'bugfix/fix_hang_during_sleep_process_v5.1' into 'release/v5.1'
Power Management: fix hang on pd_top sleep process (backport v5.1)

See merge request espressif/esp-idf!24459
2023-07-05 19:48:19 +08:00
60163c3b0f Merge branch 'bugfix/memory_cleanup_optimization_v5.1' into 'release/v5.1'
Nimble: Fixes for memory leak / optimization (v5.1)

See merge request espressif/esp-idf!24139
2023-07-05 19:42:58 +08:00
97b0cb9d14 Merge branch 'contrib/github_pr_11337_v5.1' into 'release/v5.1'
w5500: mac: poll VERSIONR to ensure the chip is initialised (GitHub PR) (v5.1)

See merge request espressif/esp-idf!24551
2023-07-05 19:34:10 +08:00
87b960121a Merge branch 'contrib/github_pr_10987_v5.1' into 'release/v5.1'
Allow to config the maximum number of VFS entries. (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23871
2023-07-05 19:32:32 +08:00
40f93bcc41 Merge branch 'ci/tcp_transport_test_app_v5.1' into 'release/v5.1'
ci: Migrate unit test for tcp_transport to unit test app (v5.1)

See merge request espressif/esp-idf!24248
2023-07-05 19:30:44 +08:00
aa434942c1 Merge branch 'backport/fix_multipan_api_error_and_coex_delay_reg' into 'release/v5.1'
ieee802154: fix multipan api error and update coex_arb_delay reg(Backport v5.1)

See merge request espressif/esp-idf!24399
2023-07-05 19:30:07 +08:00
9658469de2 Merge branch 'backport/modification_when_154_stop_tx_rx_ack' into 'release/v5.1'
Fix OpenThread/IEEE802.15.4 bugs found in test(backport v5.1)

See merge request espressif/esp-idf!24060
2023-07-05 19:28:43 +08:00
b8cfb56c43 Merge branch 'bugfix/tx_only_link_up_v5.1' into 'release/v5.1'
Ethernet minor fixes (v5.1)

See merge request espressif/esp-idf!23968
2023-07-05 19:25:46 +08:00
46396d7c16 Merge branch 'bugfix/usb_serial_jtag_select_poll_crash_v5.1' into 'release/v5.1'
vfs: select sanity NULL check (v5.1)

See merge request espressif/esp-idf!23946
2023-07-05 19:25:25 +08:00
5d05aa9942 fix(esp_wifi): NAN Service discovery and datapath bugfixes
1. Increase timeout value for NDP Accepted/Rejected events
2. Update publisher ID incase publisher restarts(service)
3. Ignore service discovery frames with invalid/inactive service ID
4. Update NAN documentation
2023-07-05 14:33:56 +05:30
f3e2681766 Merge branch 'contrib/github_pr_11743_v5.1' into 'release/v5.1'
docs(jtag): Update chip revisions to follow ESP32-C3 errata (GitHub PR) (v5.1)

See merge request espressif/esp-idf!24589
2023-07-05 15:26:26 +08:00
1e7d3425e5 bt-coexist: fix the issue for BLE scan in using whitelist that scan PTI keeps high and not resumes after reception of ADV_EXT_IND but no AUX_ADV_IND followed on ESP32-C3 and ESP32-S3, which causes Wi-Fi unable to work normally 2023-07-05 12:54:59 +08:00
6f673e95c9 adc_oneshot: move power acquire back to adc_oneshot_new_unit
Revert and fix of d197c59eaa in !23575

adc_cali: fix the condition of ocode calibration
2023-07-05 12:48:11 +08:00
e90a2d50c4 adc_cali: supported channel compensation of adc calibration on esp32c6 2023-07-05 12:48:11 +08:00
0b7485db02 efuse(c6): Adds adc calib efuses 2023-07-05 12:48:11 +08:00
6336a9e2b5 adc_cali: supported adc calibration on esp32c6 2023-07-05 12:48:11 +08:00
a41f5387c1 NimBLE : Sync porting files 2023-07-05 10:02:58 +05:30
a2a674a107 NimBLE: Fixed mismatch of number of completed packtes in host flow control 2023-07-05 10:01:46 +05:30
e0b98b75e7 Merge branch 'docs/add_provisioning_CN_trans_backport_v5.1' into 'release/v5.1'
Docs: add CN translation for api-reference/provisioning/provisioning.rst (backport v5.1)

See merge request espressif/esp-idf!24486
2023-07-05 12:29:45 +08:00
deca1e79ba Docs: add CN translation for api-reference/provisioning/provisioning.rst (backport v5.1) 2023-07-05 12:29:45 +08:00
bcde9d944e Merge branch 'docs/add_Chinese_translation_for_linux-host-requirements.rst_and_external-ram-esp32-notes.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for linux-host-requirements.rst and external-ram-esp32-notes.rst (backport v5.1)

See merge request espressif/esp-idf!24491
2023-07-05 12:29:08 +08:00
4e2acf1af7 docs: provide CN translation for linux-host-requirements.rst and external-ram-esp32-notes.rst (backport v5.1) 2023-07-05 12:29:08 +08:00
2cffd23655 Merge branch 'bugfix/pmu_wait_xtal_stable_time_issue' into 'release/v5.1'
fix PMU wait xtal stable time issue for esp32c6

See merge request espressif/esp-idf!24259
2023-07-05 12:27:26 +08:00
7c696fcb71 Merge branch 'bugfix/rtc_clk_int_rc32k_miss_calib_cycles_config_v5.1' into 'release/v5.1'
backport v5.1: fix the issue of missing configuration for calibration cycles of the internal 32 kHz RC

See merge request espressif/esp-idf!24584
2023-07-05 12:27:08 +08:00
9d47a58750 Merge branch 'bugfix/macro_changes_in_nimble-1.5_v5.1' into 'release/v5.1'
NimBLE : Update macro name changes in nimble-1.5 (v5.1)

See merge request espressif/esp-idf!23745
2023-07-05 12:24:52 +08:00
8051cb704c Merge branch 'bugfix/fix_bootloader_wrong_spi_freq_print_v5.1' into 'release/v5.1'
bugfix: fix esp32c6 bootloader print wrong spi speed mode (backport v5.1)

See merge request espressif/esp-idf!24460
2023-07-05 12:24:16 +08:00
bd0343c9c3 Merge branch 'bugfix/fix_config_option_v5.1' into 'release/v5.1'
Nimble: Fixed setting macro values based on selected configuration (v5.1)

See merge request espressif/esp-idf!24137
2023-07-05 12:16:36 +08:00
bcef59f33c Merge branch 'bugfix/mbedtls_dyanmic_buffer_with_dhm_build_v5.1' into 'release/v5.1'
fix(mbedtls): Build issue in dynamic buffer feature (v5.1)

See merge request espressif/esp-idf!24537
2023-07-05 12:04:00 +08:00
051965af52 Merge branch 'bugfix/fix_pcl_enh_rsp_v5.1' into 'release/v5.1'
Nimble: Removed the extra status field in the enh read transmit power level (v5.1)

See merge request espressif/esp-idf!23883
2023-07-05 12:00:25 +08:00
4b761af41b Merge branch 'docs/walkthrough_for_multi_adv_examples_v5.1' into 'release/v5.1'
Nimble: Added Example Walkthrough tutorial for Multi Adv example (v5.1)

See merge request espressif/esp-idf!24509
2023-07-05 11:58:46 +08:00
4ea182eaa2 Merge branch 'docs/add_a_note_about_RMT_preipheral_in_the_programming_guide_v5.1' into 'release/v5.1'
rmt: add a note about binding channels to the same GPIO (v5.1)

See merge request espressif/esp-idf!24566
2023-07-05 10:08:33 +08:00
b875331c31 Merge branch 'bugfix/remove_python_examples_ttfw_v5.1' into 'release/v5.1'
Nimble:Removed files referring to old TTFW framework (v5.1)

See merge request espressif/esp-idf!23497
2023-07-05 10:08:03 +08:00
c6bc222d54 Merge branch 'feature/walkthrough_for_htp_examples_v5.1' into 'release/v5.1'
Nimble: Added Example Walkthrough tutorial for HTP example in nimble (v5.1)

See merge request espressif/esp-idf!24534
2023-07-05 10:07:37 +08:00
c66e4a8a50 Merge branch 'bugfix/ringbuf_static_object_size_v5.1' into 'release/v5.1'
Ringbuf: Fix ordering of StaticRingbuffer_t (v5.1)

See merge request espressif/esp-idf!24593
2023-07-05 09:45:02 +08:00
163f0721dd feat(usb): update HID Host example 2023-07-05 00:52:13 +00:00
09808b7fb4 Merge branch 'doc/updata_adc_migration_guide_v5.1' into 'release/v5.1'
migration_guide: update adc calibration api part (v5.1)

See merge request espressif/esp-idf!24257
2023-07-05 08:49:26 +08:00
8cb70f0d12 ringbuf: Fix ordering of StaticRingbuffer_t
When building on linux/host compilers (e.g., GCC), the compiler may add padding
depending on the size and order of the member types.

This commit fixes the ordering or the StaticRingbuffer_t such that it matches
the internal Ringbuffer_t. The "_Static_assert" is always enabled for all
compilers.

Closes https://github.com/espressif/esp-idf/issues/11726
2023-07-04 21:30:43 +01:00
c81bc8c819 Merge branch 'bugfix/aes_dma_align_issue_v5.1' into 'release/v5.1'
aes: fix DMA descriptor calculation for the alignment case (v5.1)

See merge request espressif/esp-idf!24093
2023-07-04 19:57:10 +08:00
8f0d41d02b docs(jtag): Update CN translation of 'api-guides/jtag-debugging/index.rst' 2023-07-04 19:29:24 +08:00
1737366af7 docs(jtag): Update chip revisions to follow ESP32-C3 errata (GitHub PR) 2023-07-04 19:29:24 +08:00
7b6af86814 docs(rmt): add a note about binding channels to the same GPIO
Added a note about RX Channel and TX Channel initialization order when
bound RX and TX to the same gpio.

Closes https://github.com/espressif/esp-idf/issues/11768
2023-07-04 19:26:33 +08:00
3ded61323d Nimble: Added Example Walkthrough tutorial for Multi Adv example 2023-07-04 15:55:04 +05:30
3345092a44 Nimble: Added Example Walkthrough tutorial for HTP example in nimble 2023-07-04 15:54:34 +05:30
40bf1ed65e Merge branch 'bugfix/add_event_cb_for_pcl_v5.1' into 'release/v5.1'
Nimble: Add support to send power control event in registered callback (v5.1)

See merge request espressif/esp-idf!23583
2023-07-04 18:18:59 +08:00
1ed419e23c Nimble: Removed the extra status field in the enh read transmit power level 2023-07-04 15:48:38 +05:30
4e1ec90525 Nimble: Fixed setting macro values based on selected configuration 2023-07-04 15:48:16 +05:30
73639cf0b4 Nimble: Fixes for memory leak / optimization 2023-07-04 15:45:22 +05:30
d39b4d849e Merge branch 'docs/add_Chinese_translation_for_api-reference/peripherals/rmt.rst_backport_v5.1' into 'release/v5.1'
docs: provide CN translation for api-reference/peripherals/rmt.rst (backport v5.1)

See merge request espressif/esp-idf!24540
2023-07-04 18:12:46 +08:00
9216bdc078 Power Management: fix PMU wait xtal stable time issue 2023-07-04 16:22:00 +08:00
94a10372cc feature: skip console uart flush and sleep when estimated uart flush time exceeds the sleep duration to avoid rtos tick jump failed 2023-07-04 16:14:20 +08:00
963fac95d7 fix(rtc_clk): fix the issue of missing configuration for calibration cycles of the internal 32 kHz RC 2023-07-04 16:06:37 +08:00
015555c6fb change(bt/Bluedroid): Update AVRCP version to 1.5 2023-07-04 15:52:29 +08:00
6e9dabe659 bt: Fixed some bluetooth bugs
1. Fixed LC_AFH_UPDATE_IND  has not benn processed causing memory exhaustion
2. Fixed no free elt in prog push
3. Fixed disconnect due to sniff with error Dsniff
4. Fixed the problem that the host continued to send ACL data to the controller after disconnection, which caused the connection to fail again
2023-07-04 15:03:10 +08:00
4bf8f8895c Update bt-lib for esp32
- Fixed memory leak when setting adv data
2023-07-04 15:03:05 +08:00
50904e9353 components/bt: Fix crash due to NULL point 2023-07-04 14:55:04 +08:00
b5cab579fe fix(core-system/esp event): Fixed missing error return documentation for esp_event_loop_create_default
ESP_ERR_INVALID_STATE was not listed as a possible return error code.

Closes https://github.com/espressif/esp-idf/issues/11745
2023-07-04 13:41:51 +08:00
0e1bcddd70 Merge branch 'bugfix/throughput_watchdog_on_c6_v5.1' into 'release/v5.1'
Nimble: Fix watchdog timer issue in throughput app (v5.1)

See merge request espressif/esp-idf!24266
2023-07-04 13:35:12 +08:00
d9426fc255 Merge branch 'contrib/github_pr_11652_v5.1' into 'release/v5.1'
Fix ULP FSM register macros with addr[9:0] > 0xFF (GitHub PR) (v5.1)

See merge request espressif/esp-idf!24268
2023-07-04 13:27:52 +08:00
29f52acbfe Merge branch 'bugfix/increase_pm_dump_time_field_length_v5.1' into 'release/v5.1'
Power Management: increase pm_dump time field width (backport v5.1)

See merge request espressif/esp-idf!24450
2023-07-04 12:16:38 +08:00
b0717c6852 Merge branch 'feature/enable_sleep_reject_for_deep_sleep_v5.1' into 'release/v5.1'
sleep: enable sleep reject when entering deepsleep (backport v5.1)

See merge request espressif/esp-idf!24440
2023-07-04 12:16:11 +08:00
159e80246b Merge branch 'feature/add_modem_module_rst_api_v5.1' into 'release/v5.1'
modem_clock: add modem module mac reset api (backport v5.1)

See merge request espressif/esp-idf!24441
2023-07-04 12:15:33 +08:00
11d34b143f Merge branch 'bugfix/sdp_32_and_128_bit_UUID_v5.1' into 'release/v5.1'
bt:Fixed SDP not being able to configure 32-bit and 128-bit UUID(v5.1)

See merge request espressif/esp-idf!24442
2023-07-04 12:15:01 +08:00
09f2ab841f Merge branch 'docs/update_esp_hid_host_v5.1' into 'release/v5.1'
[docs] fix documents for Bluetooth HID Host API reference (backport v5.1)

See merge request espressif/esp-idf!24389
2023-07-04 12:14:22 +08:00
c020194656 Revised (e)SCO configuration parameter sets 2023-07-04 04:12:35 +00:00
4ce9023cd4 Fixed the issue of alarm leak in hf-ag 2023-07-04 04:12:24 +00:00
ced0a5747b Fixed the issue of alarm leak in A2DP 2023-07-04 04:12:24 +00:00
38e2a6fce6 esp_wifi: Bugfix concurrency observed while doing eloop register 2023-07-04 09:42:18 +05:30
56bb50b85e Merge branch 'bugfix/fix_some_ble_bugs_v5.1' into 'release/v5.1'
FIxed some BLE bugs (backport v5.1)

See merge request espressif/esp-idf!24275
2023-07-04 12:11:35 +08:00
207e589917 Merge branch 'bugfix/support_esp32c6_sleep_retention_extra_link_v5.1' into 'release/v5.1'
backport v5.1: support extra linked list retention for BLE and 15.4

See merge request espressif/esp-idf!24220
2023-07-04 12:11:04 +08:00
54360507f3 Merge branch 'bugfix/malloc_free_removal_v5.1' into 'release/v5.1'
Backport some wifi fixes (backport v5.1)

See merge request espressif/esp-idf!24264
2023-07-04 12:10:21 +08:00
f93f08bcd2 Merge branch 'bugfix/fix_wps_with_sae_enabled_ap_v5.1' into 'release/v5.1'
esp_wifi: Fix WPS issue for WPA3+WPA2 mode (v5.1)

See merge request espressif/esp-idf!24152
2023-07-04 12:09:50 +08:00
30a67ed72c btbb: support register retention in esp32c6 2023-07-04 12:09:22 +08:00
e72359fc66 ble:added esp32c6 light sleep support 2023-07-04 12:09:22 +08:00
b2b0940516 Merge branch 'bugfix/fix_Cache_Count_Flash_bug_v5.1' into 'release/v5.1'
cache: patch some rom cache api, rename those apis in ld (backport v5.1)

See merge request espressif/esp-idf!24289
2023-07-04 12:07:25 +08:00
27a5a6fcae Merge branch 'bugfix/fix_esp32s3_psram_access_failed_in_dfs_v5.1' into 'release/v5.1'
esp_pm: fix esp32s3 psram access failed when dfs is enabled (backport v5.1)

See merge request espressif/esp-idf!24202
2023-07-04 12:06:42 +08:00
4647045388 Merge branch 'bugfix/support_esp326_xtal_xpd_v5.1' into 'release/v5.1'
esp32c6: support xtal xpd (backport v5.1)

See merge request espressif/esp-idf!24253
2023-07-04 12:04:51 +08:00
d4bfed373e Merge branch 'rebase/add_ble_version_support_for_c6_eco1' into 'release/v5.1'
ble:add version num support for esp32c6 chip v5.1

See merge request espressif/esp-idf!23610
2023-07-04 12:03:36 +08:00
8181da4fee heap: remove exclusion of esp32h2 as a target for no/light/comprehensive_poisoning tests 2023-07-04 11:08:59 +08:00
e70c174643 Merge branch 'contrib/github_pr_11405_v5.1' into 'release/v5.1'
Fix initialization macros for twai_timing_config_t not setting .clk_src and .brp (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23983
2023-07-04 11:04:22 +08:00
0e4c071519 Merge branch 'bugfix/fix_i2s_ll_cpp_compilation_failure_v5.1' into 'release/v5.1'
i2s: fixed i2s_ll compiling failure under C++ environment (v5.1)

See merge request espressif/esp-idf!24401
2023-07-04 11:03:35 +08:00
934bdca370 Merge branch 'feature/add_log_when_mspi_timing_tuning_is_enabled_v5.1' into 'release/v5.1'
mspi: added timing tuning start, and success log (v5.1)

See merge request espressif/esp-idf!24053
2023-07-04 11:02:20 +08:00
ee91a42a33 ulp-system/ulp-fsm: clean up test cases 2023-07-04 02:59:15 +00:00
0f0b77b192 Merge branch 'refactor/pump_up_dependency_version_of_es8311_example_v5.1' into 'release/v5.1'
feati(example): bump up dependency version of examples (v5.1)

See merge request espressif/esp-idf!24554
2023-07-04 10:34:18 +08:00
1bf26b2def Merge branch 'bugfix/incorrect_time_after_ota_v5.1' into 'release/v5.1'
esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around (v5.1)

See merge request espressif/esp-idf!24408
2023-07-03 20:37:40 +08:00
0a3fc51ae0 Merge branch 'feature/esp_ipc_isr_fix_v5.1' into 'release/v5.1'
esp_system: Fix a race-condition in esp_ipc_isr (in QEMU env) (v5.1)

See merge request espressif/esp-idf!23991
2023-07-03 20:35:33 +08:00
7d72773d88 Merge branch 'bugfix/systick_loop_v5.1' into 'release/v5.1'
freertos: Fix Systick stuck when systimer was not reset (v5.1)

See merge request espressif/esp-idf!24321
2023-07-03 20:34:58 +08:00
bac32e9c43 feat(example): bump up version of es8311 lvgl in the example 2023-07-03 16:33:42 +08:00
3d181f5346 ble:add version num support for esp32c6 chip 2023-07-03 16:16:06 +08:00
f963c7c009 Merge branch 'bugfix/vfs_uart_outof_bounds_read_v5.1' into 'release/v5.1'
vfs_uart: fix out-of-bounds read (v5.1)

See merge request espressif/esp-idf!24312
2023-07-03 16:13:06 +08:00
4f0f317d54 Merge branch 'bugfix/mcpwm_legacy_typo_v5.1' into 'release/v5.1'
mcpwm: fix typo in backward compatible macro name (v5.1)

See merge request espressif/esp-idf!24227
2023-07-03 16:11:20 +08:00
098e559d46 w5500: rework version check to avoid a false alarm on fault detection
See: https://github.com/espressif/esp-idf/issues/11331
2023-07-03 06:51:15 +00:00
cacb45d450 Merge branch 'bugfix/coverity_scan_fix_driver_v5.1' into 'release/v5.1'
ADC: Fixed potential multiply overflow in the calibration code (v5.1)

See merge request espressif/esp-idf!24091
2023-07-03 13:40:22 +08:00
a17bdbd3ef Merge branch 'bugfix/rgb_pixel_copy_bpp8_v5.1' into 'release/v5.1'
rgb_lcd: Support LCD rotation for LCD whose pixel size is one byte (v5.1)

See merge request espressif/esp-idf!24208
2023-07-03 13:40:07 +08:00
fb0cc7189a NimBLE : Update macro name changes in nimble-1.5 2023-07-03 04:58:43 +00:00
81b03f6d32 Nimble: Add support to send power control event in registered callback 2023-07-03 09:52:59 +05:30
4a27fde8e4 Merge branch 'docs/trans_wifi_provisioning_backport_v5.1' into 'release/v5.1'
Docs: add CN translation for api-reference/provisioning/wifi_provisioning.rst (backport v5.1)

See merge request espressif/esp-idf!24479
2023-07-03 12:18:35 +08:00
1e3f330130 Docs: add CN translation for api-reference/provisioning/wifi_provisioning.rst (backport v5.1) 2023-07-03 12:18:34 +08:00
ec8268d863 fix(mbedtls): Build issue in dynamic buffer feature
Fix build issue in mbedTLS dynamic buffer feature with
`CONFIG_MBEDTLS_DHM_C` enabled case.

Closes https://github.com/espressif/esp-idf/issues/11770
2023-07-03 04:01:19 +00:00
ebb5fb9e88 ble:support esp32h2 power save example 2023-07-03 11:45:16 +08:00
1eb43094c5 phy: update phy enable/disable for h2 light sleep 2023-07-03 11:45:16 +08:00
06c6281add ble: support esp32h2 modem clock selection 2023-07-03 11:45:16 +08:00
c44624c056 Merge branch 'feature/esp_rom_update_cpu_freq_v5.1' into 'release/v5.1'
bootloader_support: add missing esp_rom_sys.h to bootloader_flash.c bootloader build (v5.1)

See merge request espressif/esp-idf!24014
2023-07-03 11:38:38 +08:00
cd4845e431 Merge branch 'bugfix/fixed_ble_create_sync_fail_v5.1' into 'release/v5.1'
Bugfix/fixed ble create sync fail v5.1

See merge request espressif/esp-idf!24305
2023-07-03 10:59:49 +08:00
952998aacd Merge branch 'bugfix/spi_master_assert_failure_v5.1' into 'release/v5.1'
spi_master: fix the assertion on a NULL desired_dev (v5.1)

See merge request espressif/esp-idf!24004
2023-07-03 10:50:28 +08:00
32928e630d Merge branch 'bugfix/led_strip_potential_buffer_overwrite_v5.1' into 'release/v5.1'
example: fix led strip memory overwrite before trans done (v5.1)

See merge request espressif/esp-idf!23938
2023-07-03 10:49:24 +08:00
657586e6ba docs: provide CN translation for api-reference/peripherals/rmt.rst 2023-07-03 10:34:00 +08:00
423931c2fa Merge branch 'bugfix/linux_heap_realloc_v5.1' into 'release/v5.1'
core-system/linux-target: fixed heap_caps_realloc not correctly allocating the... (v5.1)

See merge request espressif/esp-idf!23976
2023-07-03 10:31:40 +08:00
61524a2675 Merge branch 'bugfix/esp32c2_slave_report_address_error_v5.1' into 'release/v5.1'
Bugfix/esp32c2 slave report address error v5.1

See merge request espressif/esp-idf!23923
2023-07-03 10:31:20 +08:00
8c5e1c1d49 Merge branch 'docs/fix_typo_in_api-reference_system_ota_v5.1' into 'release/v5.1'
fix a typo in api-reference/system/ota (v5.1)

See merge request espressif/esp-idf!24444
2023-07-03 09:27:20 +08:00
a4bf7dd65c Merge branch 'docs/update_installation_prerequisites_for_ubuntu_debian_v5.1' into 'release/v5.1'
docs: update installation prerequisites for Ubuntu and Debian system (v5.1)

See merge request espressif/esp-idf!24451
2023-07-03 09:27:07 +08:00
cc74be8dbb Merge branch 'docs/update_code_how_to_configure_multiple_antennas_of_wifi_v5.1' into 'release/v5.1'
docs: update code of how to configure multiple antennas of wifi (v5.1)

See merge request espressif/esp-idf!24456
2023-07-03 09:26:50 +08:00
679ac08d77 Merge branch 'docs/fix_typo_in_api_guides_usb_otg_console_v5.1' into 'release/v5.1'
docs: fix a typo in api-guides/usb-otg-console (v5.1)

See merge request espressif/esp-idf!24453
2023-07-03 09:26:37 +08:00
d7986f9b22 Merge branch 'docs/update_interrupt_number_esp32h2_v5.1' into 'release/v5.1'
docs: update the number of interrupts for esp32h2 (v5.1)

See merge request espressif/esp-idf!24458
2023-07-03 09:26:17 +08:00
f34139e379 Merge branch 'support/esp_coredump_logs_config_v5.1' into 'release/v5.1'
Optionally disable logs in espcoredump component (v5.1)

See merge request espressif/esp-idf!24482
2023-07-02 22:04:59 +08:00
0bf93134f4 Merge branch 'feature/anti_dpa_configuration_c6_h2_v5.1' into 'release/v5.1'
esp32c6/esp32h2: crypto: add support for DPA protection configuration (v5.1)

See merge request espressif/esp-idf!24128
2023-06-30 23:50:44 +08:00
86eb7862ec Merge branch 'bugfix/fix_memory_leak_in_ws_server_example_v5.1' into 'release/v5.1'
example: Fix memory leak in ws_echo_server when httpd_queue_work failed (backport v5.1)

See merge request espressif/esp-idf!23955
2023-06-30 23:49:30 +08:00
d93007b44a Merge branch 'fix/xts_aes_register_prefix_discrepancy_c6_h2_v5.1' into 'release/v5.1'
fix: xts aes register prefix discrepancy for ESP32H2 and ESP32C6 (v5.1)

See merge request espressif/esp-idf!24263
2023-06-30 23:48:57 +08:00
9bf3bfe85c Merge branch 'bugfix/add_esp32h2_chip_id_v5.1' into 'release/v5.1'
Add ESP32-H2 chip id in `esp_chip_id_t` enum in esp_app_format.h header file (v5.1)

See merge request espressif/esp-idf!24111
2023-06-30 23:48:28 +08:00
633d072d05 Merge branch 'bugfix/expose_clear_all_wl_api_v5.1' into 'release/v5.1'
fix(Nimble): Expose API to clear all addresses in whitelist out of stack (v5.1)

See merge request espressif/esp-idf!24307
2023-06-30 22:10:04 +08:00
5d35a45a53 Merge branch 'feature/extend_proj_desc_json_v5.1' into 'release/v5.1'
extend information in project_description.json (v5.1)

See merge request espressif/esp-idf!24125
2023-06-30 21:17:05 +08:00
d4652daec6 Merge branch 'fix/idf_tools_certificate_v5.1' into 'release/v5.1'
Tools: Update the certificate of idf_tools.py (v5.1)

See merge request espressif/esp-idf!23928
2023-06-30 21:16:32 +08:00
df7ab11865 Merge branch 'fix/hints-print-control-characters_v5.1' into 'release/v5.1'
tools: fix control characters print if hints enabled (v5.1)

See merge request espressif/esp-idf!23889
2023-06-30 21:15:48 +08:00
c8ea97984f Merge branch 'bugfix/removed_working_directory_error_v5.1' into 'release/v5.1'
Tools bugfix: Removed working directory when using idf.py (v5.1)

See merge request espressif/esp-idf!24150
2023-06-30 21:06:34 +08:00
b48beba60f Merge branch 'feature/tools_add_ulp_linux_i686_toolchain_v5.1' into 'release/v5.1'
tools: add ULP toolchain for linux-i686 platform (v5.1)

See merge request espressif/esp-idf!24194
2023-06-30 21:05:29 +08:00
9ceed8a0c9 Merge branch 'feature/submodules_sbom_v5.1' into 'release/v5.1'
tools: add sbom information for submodules (v5.1)

See merge request espressif/esp-idf!24240
2023-06-30 21:05:02 +08:00
7985943ec2 Merge branch 'bugfix/bump_check_copyright_v5.1' into 'release/v5.1'
tools: bump check-copyright in .pre-commit-config.yaml (v5.1)

See merge request espressif/esp-idf!24341
2023-06-30 21:04:09 +08:00
e0fff7b2cc Merge branch 'fix/pyparsing_3.1.0_compatibility_v5.1' into 'release/v5.1'
fix: Compatibility with pyparsing>=3.1.0 (backport v5.1)

See merge request espressif/esp-idf!24369
2023-06-30 21:03:50 +08:00
d4efb0e369 Merge branch 'docs/fix_error_in_esp32-s2-devkitc-1_pin_layout_diagram_v5.1' into 'release/v5.1'
Docs/Fix error in esp32-s2-devkitc-1 pin layout diagram (v5.1)

See merge request espressif/esp-idf!24122
2023-06-30 20:10:12 +08:00
152055933d Merge branch 'docs/update_cn_for_api-conventions_backport_v5.1' into 'release/v5.1'
Docs: Translate api-conventions.rst (backport v5.1)

See merge request espressif/esp-idf!24121
2023-06-30 20:08:14 +08:00
f84139451a NVS: nvs_tool.py entry.data None check fix 2023-06-29 11:07:03 +02:00
7687c5200c Added description to disable coredump logs to ram_usage.rst
Signed-off-by: Vikram <vikram.dattu@espressif.com>
2023-06-29 11:50:48 +05:30
207ac93d43 Optionally disable logs in espcoredump component
Early log strings used by this component are placed in DRAM.
Disabling these logs saves ~5KB of internal memory

Signed-off-by: Vikram <vikram.dattu@espressif.com>
2023-06-29 11:50:48 +05:30
3381782661 ci: increase timeout threshold to solve deepsleep wakestub example ci failure 2023-06-28 18:15:57 +08:00
cbce221e88 Merge branch 'bugfix/mac_ext_order_for_c6_h2_v5.1' into 'release/v5.1'
efuse: Fix byte order in MAC_EXT (for C6 and H2) (v5.1)

See merge request espressif/esp-idf!23990
2023-06-28 17:33:53 +08:00
88289c3fda bugfix: fix bootloader print wrong spi speed mode 2023-06-28 16:12:09 +08:00
13e546fa20 docs: update the number of interrupts for esp32h2 2023-06-28 15:07:46 +08:00
09d8803687 docs: update code of how to configure multiple antennas of wifi 2023-06-28 14:43:37 +08:00
c820d8181c docs: fix a typo in api-guides/usb-otg-console 2023-06-28 14:40:44 +08:00
790b6a2ad8 docs: update installation prerequisites for Ubuntu and Debian system 2023-06-28 14:38:41 +08:00
171544ded4 bugfix: increase pm_dump time field width
Closes https://github.com/espressif/esp-idf/issues/11704
2023-06-28 14:37:27 +08:00
58ee786bfd fix a typo in api-reference/system/ota 2023-06-28 14:25:01 +08:00
0b7e61b95a btc_sdp: add_raw_sdp: fix 32 and 128-bit uuid configuration
Added proper conversion of 4 and 16-byte UUIDs values to binary streams.
UUIDs now set with SDP_AddAttribute() instead of
SDP_AddServiceClassIdList().
2023-06-28 14:11:34 +08:00
afc889e934 esp_wifi: implement wifi_reset_mac_wrapper 2023-06-28 14:01:43 +08:00
2e5a194f62 esp_hw_support: add modem module mac reset api 2023-06-28 14:01:29 +08:00
981701755d ci: fix failed ci test jobs 2023-06-28 13:55:26 +08:00
1c12743d44 sleep: enable sleep reject when entering deep sleep and return err if sleep request is rejected 2023-06-28 13:55:16 +08:00
bb6d154f11 freertos: Fix Systick stuck when systimer was not reset
Relates to OTA update for C3/S3 chips from IDF version 4.3 to v5.0 and above
2023-06-26 12:21:28 +00:00
6d0d2366f7 esp_hw_support: Fix invalid system time if s_esp_rtc_time_us & s_rtc_last_ticks were moved around
The commit fixes the case:
If variables in RTC RAM have been moved around by the linker,
they will be filled with garbage data. Any reset other than OTA would work fine
because the variables would still be initialized from the initial bootup.

So now system time will be valid even after OTA.

Closes https://github.com/espressif/esp-idf/issues/9448
2023-06-26 18:12:30 +08:00
13e74d5573 i2s: fixed i2s_ll compiling failure under C++ evironment
Closes: https://github.com/espressif/esp-idf/issues/11625
2023-06-26 15:42:36 +08:00
b615fd7f8f touch_element: fix unintended integer division 2023-06-26 07:07:52 +00:00
0e68d6fb29 usbh: fix invalid assert on desc_status 2023-06-26 07:07:52 +00:00
641a07950d vfs_uart: fix out-of-bounds read
when open uart device "/2" on chips only have 2 UART peripherals
2023-06-26 07:07:52 +00:00
fc49f10bb4 ieee802154: fix multipan api error and update coex_arb_delay reg 2023-06-26 10:57:17 +08:00
8ed82f11ae fix: Compatibility with pyparsing>=3.1.0 2023-06-25 19:59:13 +02:00
zwl
503de45dd8 ble: Fixed the issue of occasional failure to create sync on ESP32-H2 2023-06-25 21:46:41 +08:00
zwl
5d00fd4d60 ble: Fixed the issue of occasional failure to create sync on ESP32-C6 2023-06-25 21:46:13 +08:00
5fa5f7b2fe component/docs: enable generation of API-reference documents for Bluetooth HID host 2023-06-25 15:37:41 +08:00
e5899f6a70 resolve the conflicts 2023-06-25 15:37:41 +08:00
3a9762ce57 Nimble: Removed files referring to old TTFW framework 2023-06-25 11:43:30 +05:30
a2daceb791 Nimble: Expose API to clear all addresses in whitelist out of stack 2023-06-25 10:13:39 +05:30
c570f67461 Merge branch 'ci/fix_extra_backslash' into 'release/v5.1'
build_template_app: Remove extra backslash

See merge request espressif/esp-idf!24374
2023-06-23 19:39:05 +08:00
2fb799c52e build_template_app: Remove extra backslash 2023-06-23 15:01:53 +05:30
79e12a1840 Merge branch 'ci/ignore_pkg_resources_deprecation_warning_v5.1' into 'release/v5.1'
ci: ignore pkg_resources deprecation warning (v5.1)

See merge request espressif/esp-idf!24339
2023-06-21 15:37:40 +08:00
fbbc548e7f tools: bump check-copyright in .pre-commit-config.yaml
Newer check-copyright version 1.0.2 contains fixes for copyrights
with single year and also the proposed date update is applied only
if number of changed lines is greater or equal to a limit. The default
limit is 5 and can be changed with the --lines-changed option if needed.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-06-21 07:06:01 +02:00
3cad4ca937 ci: ignore pkg_resources deprecation warning 2023-06-21 07:27:15 +08:00
4ba10243f4 cache: patch some rom cache api, rename those apis in ld
1. Cache_Count_Flash_Pages, fix this api return enexpected + 1
2. Cache_Suspend_I/DCache, add wait cache idle after suspend cache
3. Cache_Freeze_I/DCache_Enable, add wait cache idle after freeze
2023-06-19 10:53:51 +08:00
f0860ac590 ci: add access psram with DFS unity test 2023-06-19 10:21:46 +08:00
96a1de0af8 bugfix: use avaliable gpio for esp32s3 pm_trace 2023-06-19 10:21:46 +08:00
ad1605a464 bugfix: fix esp32s3 psram access failed when dfs is enabled 2023-06-19 10:21:42 +08:00
b4dcd3bf21 Update bt-lib for esp32
1 Fixed disconnection delay on peripheral when slave latency is not zero
2 Fixed LLCP info init for central and peripheral
3 Fixed sent cmd status evt twice when process disconnect cmd
2023-06-16 11:06:12 +08:00
db68d45702 Update bt lib for ESP32-C3 and ESP32-S3
- Fixed crash when controller initialization fails due to insufficient memory
2023-06-16 11:05:49 +08:00
3758e37024 bluedroid: fixed default extended connection params 2023-06-16 11:02:17 +08:00
4001888e69 esp_hid: fixed ble hid battery level setting 2023-06-16 11:01:40 +08:00
0602ed3b4c esp_wifi: Remove direct call of malloc() and free() 2023-06-15 22:38:48 +05:30
b20922c6d5 esp_wifi: fix some txop issues 2023-06-15 22:38:44 +05:30
e707ad166d fix ULP FSM reg ops with addr > 0xFF 2023-06-15 14:00:45 +02:00
dbb6fddcbc Introduced delay to avoid watchdog timer in throughput app 2023-06-15 15:15:25 +05:30
96767058df esp32c6: xts-aes register preefix discrepency 2023-06-15 13:53:35 +05:30
2fb7d32cd3 esp32h2: xts-aes register prefix discrepency 2023-06-15 13:53:35 +05:30
3edc3e9b48 migration_guide: update adc calibration api part 2023-06-15 11:46:31 +08:00
896b382015 mcpwm: fix typo in backward compatible macro name 2023-06-15 10:58:15 +08:00
8aa7e85e31 sleep: Fix domain power down status cannot get updated accordingly with the allowance of retention in runtime 2023-06-15 10:26:59 +08:00
f0b6e8f37e feature: support xtal_xpd pmu parameters 2023-06-15 10:22:33 +08:00
e1f2e656e2 ci: Migrate unit test for tcp_transport to unit test app 2023-06-14 16:01:00 +02:00
18969310e2 tools: do not disable pytest-embedded
As pointed out by Fu Hanxi, the pytest_build_system job is currently
using --parallel-index and --parallel-count, which are provided by
pytest-embedded, so we should not disable it. Moreover to properly
disable pytest-embedded we should use "no:pytest_embedded". Meaning
this probably was not working as indented anyway.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-06-14 12:42:50 +02:00
dbff74bee4 tools: add sbom information for submodules
This adds SBOM information for submodules, which are not managed
by Espressif. Meaning there is no fork for them in the espressif
namespace. Other submodules should add sbom.yml manifest file to
the root of their git repository.

The SBOM information for submodules is stored in the .gitmodules file.
Each SBOM related variable has the "sbom-" prefix and the following
variables may be used:

sbom-version:
   submodule version

sbom-cpe:
   CPE record if available in NVD. This will be used by the SBOM
   tool to check for possible submodule vulnerabilities. The
   version in the CPE can be replaced with the "{}" placeholder,
   which will be replaced by the "sbom-version" value from above.

sbom-supplier:
   Person or organization who is providing the submodule.
   It has to start with "Person:" or "Organization:" prefix
   as required by the SPDX-2.2 standard.

sbom-url:
   URL to the project if exists, e.g. github.

sbom-description:
   Project description.

sbom-hash:
   Submodule SHA as recorded in the git-tree. This field is used by
   CI to check that the submodule checkout hash and info in .gitmodules
   are in sync. IOW if submodule is updated and it has SBOM info in
   .gitmodules, the .gitmodules has to be updated too. The test is
   part of this commit. The checkout has of the submodule can be found
   by using "git submodule status".

Example for micro-ecc submodule
---8<---
[submodule "components/bootloader/subproject/components/micro-ecc/micro-ecc"]
	path = components/bootloader/subproject/components/micro-ecc/micro-ecc
	url = ../../kmackay/micro-ecc.git
	sbom-version = 1.0
	sbom-cpe = cpe:2.3🅰️micro-ecc_project:micro-ecc:{}:*:*:*:*:*:*:*
	sbom-supplier = Person: Ken MacKay
	sbom-url = https://github.com/kmackay/micro-ecc
	sbom-description = A small and fast ECDH and ECDSA implementation for 8-bit, 32-bit, and 64-bit processors
	sbom-hash = d037ec89546fad14b5c4d5456c2e23a71e554966
---8<---

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-06-14 12:38:12 +02:00
ec51060d45 pau: fix logic error in extra link retention 2023-06-13 21:06:29 +08:00
ccd4ff2945 sleep retention: implement the extra linked list retention for modules with retention clock bugs 2023-06-13 21:05:36 +08:00
ef4c0a7753 sleep retention: fix crash issue caused by destroying the module after the module node creation fails 2023-06-13 21:04:38 +08:00
8b18591982 rgb_lcd: support pixel copy for 8bpp
Closes https://github.com/espressif/esp-idf/issues/11581
2023-06-13 18:21:21 +08:00
e44a6888ea mac_addr(C6 and H2): Fix byte order of MAC_EXT and change format of IEEE802154 MAC
The changes only related to C6 and H2 chips where CONFIG_SOC_IEEE802154_SUPPORTED=y.
For this case these APIs return 8 bytes
    esp_efuse_mac_get_default() -> 8 bytes
    esp_efuse_mac_get_custom() -> 8 bytes
    esp_read_mac(..., ESP_MAC_IEEE802154) -> 8 bytes
The rest cases len is 6 bytes
2023-06-13 16:56:13 +08:00
ee7554c1c4 esp_system: Fix a race-condition in esp_ipc_isr (in QEMU env)
The race condition is very unlikely on real hardware but can be observed with
qemu under heavy load.
Also add missing `memw` instructions which are generated by the C compiler but
absent in the assembly code.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
Signed-off-by: KonstantinKondrashov <konstantin@espressif.com>

Merges https://github.com/espressif/esp-idf/pull/11447
Closes https://github.com/espressif/esp-idf/issues/11433
2023-06-13 08:10:00 +00:00
9538dc203d tools: add ULP toolchain for linux-i686 platform
Closes https://github.com/espressif/esp-idf/issues/11561
2023-06-13 12:50:04 +07:00
3d7f7c32e3 adc: fix out of bound read
when SOC_ADC_PERIPH_NUM==1, the adc_unit should only be assigned with 0
2023-06-12 15:19:17 +08:00
778a045e66 mspi: added timing tuning start, and success log 2023-06-12 11:49:05 +08:00
7c2743f379 esp_wifi: Fix WPS issue for WPA3+WPA2 mode 2023-06-09 18:22:59 +05:30
8a9f12eaa4 Tools bugfix: Removed working directory when using idf.py
Added check for existence of current working directory when using idf.py

Closes https://github.com/espressif/esp-idf/issues/11476
2023-06-09 14:24:29 +02:00
1764a0bd28 crypto: add support for DPA protection configuration in C6/H2
- Technical details covered in section "15.3.2 Anti-DPA Attack Security
Control" chapter of the ESP32-C6 TRM
- Default configuration sets the security level low for the DPA
protection
- This change applies to all the crypto peripherals where the clock
frequency is dynamically adjusted to create randomness in the power
consumption trajectory
- This configuration helps to make the SCA attacks difficult on the
crypto peripherals
2023-06-08 20:37:03 +05:30
03162bb276 tools: extend information in project_description.json
This extends information provided in the project_description.json file.
Newly added information can be used in the SBOM generating tool and
also to improve hints regarding the the component dependency issues.

Added fields

version:
   This adds versioning to the project_description.json file,
   so it's easy to identify if it contains the required information.

project_version:
   Can be used as a version for the resulting binary e.g. `hello_world.bin`.

idf_path:
   This one is probably not necessary, but it allows tools to run even without
   esp-idf environment exported(e.g. export.sh).

c_compiler:
   The `CMAKE_C_COMPILER` value with full path to the compiler binary. This can
   be used to get information about toolchain, which was used to build the project.

common_component_reqs:
   List of common components as presented in cmake's __COMPONENT_REQUIRES_COMMON
   and set in tools/cmake/build.cmake:__build_init().

build_component_info:
   Detailed information about components used during build. It's a
   dictionary with the component name as a key and each component has
   a dictionary with detailed information. Following is an example for
   the efuse component.

   "efuse": {
       "alias": "idf::efuse",
       "target": "___idf_efuse",
       "prefix": "idf",
       "dir": "/home/fhrbata/work/esp-idf/components/efuse",
       "type": "LIBRARY",
       "lib": "__idf_efuse",
       "reqs": [],
       "priv_reqs": [ "bootloader_support", "soc", "spi_flash" ],
       "managed_reqs": [],
       "managed_priv_reqs": [],
       "file": "/home/fhrbata/work/blink/build/esp-idf/efuse/libefuse.a",
       "sources": [ "/home/fhrbata/work/esp-idf/components/efuse/esp32s3/esp_efuse_table.c", ... ],
       "include_dirs": [ "include", "esp32s3/include" ]
   }

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-06-08 14:29:53 +02:00
0f781c718c tools: fix make_json_list to return empty json list for empty cmake list
Currently make_json_list() returns '[ "" ]' for empty cmake list. Fix this
so empty json list is returned instead.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-06-08 14:29:53 +02:00
ae86d26f7e openthread: fix assert when parsing security key failed 2023-06-08 17:15:16 +08:00
7cb730a6e8 fix_error_in_esp32-s2-devkitc-1_pin_layout_diagram 2023-06-08 16:51:09 +08:00
66c3265a26 Docs: Translate api-conventions.rst 2023-06-08 16:32:26 +08:00
4866e7c6d0 Add ESP32-H2 chip id in esp_chip_id_t enum in esp_app_format.h header file 2023-06-08 10:34:23 +05:30
69bcbe97f4 aes: fix DMA descriptor calculation for the alignment case
The number of the DMA descriptors allocated for certain length (e.g.,
8176) were not sufficient (off by 1 error). This used to result in the
dynamic memory corruption as the region was modified beyond the
allocated range.

This change fixes the DMA descriptor calculation part and allocates
sufficient DMA descriptors based on the data length alignment considerations.

Test has also been added to cover the specific scenario in the CI.

Closes https://github.com/espressif/esp-idf/issues/11310
2023-06-07 04:29:32 +00:00
f9cf8db97e drivers: fix issue reported by coverity 2023-06-07 11:42:11 +08:00
a9d12c0fe9 adc: fixed the issue that multiply overflow before type expand 2023-06-07 11:40:56 +08:00
e74a2565e4 Fix initialization macros for twai_timing_config_t not setting .clk_src and .brp 2023-06-07 01:45:26 +00:00
57e70c0d2c IEEE802154: modification of the action when stop tx/rx ack 2023-06-05 17:56:01 +08:00
zwl
50d30f7ff1 esp_phy:Update phy lib for ESP32-C2 2023-06-05 16:49:48 +08:00
zwl
80f3ad1f1b ble:fixed the issue that slave reports the wrong address for master when address resolution disable 2023-06-05 16:49:48 +08:00
4bc762621d Merge branch 'bugfix/fix_bleqabr23_222_v5.1' into 'release/v5.1'
Revert "bluedroid: report disconnect event after BLE link closed" (backport 5.1)

See merge request espressif/esp-idf!24036
2023-06-03 08:43:09 +08:00
42592552b5 Merge branch 'feature/itwt_add_setup_timeout_timer_backport_v5.1' into 'release/v5.1'
esp_wifi: itwt add setup timeout timer to track response frame (backport v5.1)

See merge request espressif/esp-idf!24040
2023-06-03 08:40:41 +08:00
5a21bea309 esp_wifi: itwt add setup timeout timer to track response frame 2023-06-02 19:46:15 +08:00
cb88d20f9e Merge branch 'bugfix/fix_wakeup_failed_if_powerdown_flash_in_lightsleep_v5.1' into 'release/v5.1'
Power Management: fixed flash funcs called in sleep wakeup process (backport v5.1)

See merge request espressif/esp-idf!24009
2023-06-02 19:18:36 +08:00
d28cb4a954 esp_wifi:
1. mesh: layer2 node will scan all channels when fixed root leave
2. show warning info when setting max connection num for softAP
2023-06-02 17:27:28 +08:00
c5e580e522 Revert "bluedroid: report disconnect event after BLE link closed"
This reverts commit d751960b27.
2023-06-02 16:51:07 +08:00
ddc16a47fe Merge branch 'bugfix/wpsreg_ap_assoc_respone_v5.1' into 'release/v5.1'
esp_wifi: Bugfix wpsreg AP not responding to assoc req (v5.1)

See merge request espressif/esp-idf!24027
2023-06-02 13:30:22 +08:00
03832dbd5e bugfix: fix some flash funcs called in sleep wakeup process 2023-06-02 02:53:51 +00:00
ecf46dd5da Merge branch 'docs/update_esp32c6_wifi_api_guides_backport_v5.1' into 'release/v5.1'
docs: update esp32c6 api guides about wifi part (backport v5.1)

See merge request espressif/esp-idf!24020
2023-06-01 19:24:50 +08:00
e8d9104953 esp_wifi: Bugfix wpsreg AP not responding to assoc req
Fixed regression caused by 2b8e40e7
2023-06-01 15:36:54 +05:30
6cd76ba321 docs: update for esp32c6 2023-06-01 14:27:19 +08:00
5a9cff0d34 docs: update esp32c6 api guides about wifi part 2023-06-01 14:26:37 +08:00
aa741b90ad Merge branch 'docs/c6_misc_updates_v5.1' into 'release/v5.1'
Docs: c6 misc updates (v5.1)

See merge request espressif/esp-idf!23999
2023-06-01 11:03:42 +08:00
4b20d27caf bootloader_support: add missing esp_rom_sys.h to bootloader_flash.c bootloader build
Missing esp_rom_sys.h header could cause declaration issues.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2023-06-01 10:57:16 +08:00
d5fb4ff7c8 esp_rom: add common ROM API to update CPU tick rate 2023-06-01 10:57:13 +08:00
b845c66748 spi_master: fix the assertion on a NULL desired_dev
Closes https://github.com/espressif/esp-idf/issues/11536
2023-06-01 02:50:45 +00:00
22adf838c9 Merge branch 'bugfix/c6_h2_decrease_rng_frequency_v5.1' into 'release/v5.1'
esp_hw_support: decrease RNG read frequency for C6 and H2 (v5.1)

See merge request espressif/esp-idf!24001
2023-06-01 00:54:49 +08:00
f4f45345ee esp_hw_support: decrease RNG read frequency on C6 and H2
* The RNG reading frequency of 200 KHz has been too high for
  C6 and H2 since on these chips the RNG output is combined
  with the RTC slow clock which is only 150KHz. Reduced the max
  reading frequency via esp_random() from 200KHz to 62.5KHz,
  which show best results in tests.
  Also updated the bootloader_fill_random() max frequency to the
  same value to be in line, even though it was just 83KHz.
2023-05-31 16:16:25 +00:00
7b09d12c89 Merge branch 'bugfix/efuse_summary_v5.1' into 'release/v5.1'
system-hardware/efuse: fixed efuse summary description containing ; breaking efuse-summary (v5.1)

See merge request espressif/esp-idf!23979
2023-05-31 22:57:37 +08:00
30f8f83d52 Merge branch 'bugfix/add_warning_for_rc_fast_calibration_h2_v5.1' into 'release/v5.1'
clk: Add warning log if RC_FAST clock calibration is needed on esp32h2 (v5.1)

See merge request espressif/esp-idf!23935
2023-05-31 20:21:11 +08:00
5cd24826bb Merge branch 'bugfix/fix_rc_fast_calibration_v5.1' into 'release/v5.1'
rtc_clk: fix esp32c6/esp32h2 eco chip `RC_FAST` bad calibration value (backport v5.1)

See merge request espressif/esp-idf!23940
2023-05-31 17:40:28 +08:00
0d13f6f09d Merge branch 'bugfix/fix_hang_during_sleep_process_v5.1' into 'release/v5.1'
bugfix: fix hang on pd_top sleep process (backport v5.1)

See merge request espressif/esp-idf!23852
2023-05-31 17:40:02 +08:00
871dd9e21a docs: updated misc C6 programming guide docs with minor changes. 2023-05-31 15:47:26 +08:00
273d973489 idocs: updated Storage API reference documents for ESP32H2 2023-05-31 15:46:42 +08:00
8df4a852f5 docs: updated Storage API reference documents for ESP32C6 2023-05-31 15:46:41 +08:00
bb4218285b system-hardware/efuse: fixed efuse summary description containing ; breaking efuse-summary
If the efuse description from esptool contained semi-colons it would be interpretted as
a list delimiter in CMake. Summary is now passed as in quotes to escape this behavior.
2023-05-30 14:07:50 +08:00
c337759e24 core-system/linux-target: fixed heap_caps_realloc not correctly allocating the requested number of bytes
Closes https://github.com/espressif/esp-idf/issues/11523
2023-05-30 13:27:46 +08:00
888e4339f9 esp_eth: fixed esp_eth_transmit_vargs to transmit only when link is up
esp_eth test: clear unicast Rx event before wait
2023-05-29 11:22:11 +00:00
997f9dd183 example: Fix memory leak in ws_echo_server when httpd_queue_work failed
Closes https://github.com/espressif/esp-idf/issues/11507
2023-05-26 20:02:58 +08:00
3da76d4bd7 vfs: select sanity NULL check
https://github.com/espressif/esp-idf/issues/9964
2023-05-26 13:46:11 +02:00
ea5e0ff298 Merge branch 'backport/fix_matter_commissioning_ble_disconnect_issue' into 'release/v5.1'
openthread: Add some backports related to openthread(Backport v5.1)

See merge request espressif/esp-idf!23893
2023-05-26 15:37:14 +08:00
125d00c0f7 Merge branch 'feature/c6_bootloader_rng_v5.1' into 'release/v5.1'
Feature/c6 bootloader rng (v5.1)

See merge request espressif/esp-idf!23896
2023-05-26 15:36:45 +08:00
8c714acfb5 bugfix: fix rc_fast bad calibration value 2023-05-26 13:59:25 +08:00
1a68d8ddd5 example: fix led strip memory overwrite before trans done
Closes https://github.com/espressif/esp-idf/issues/11487
2023-05-26 13:28:31 +08:00
702afbb0f7 clk: Add warning log if RC_FAST clock calibration is needed on esp32h2 2023-05-26 11:45:00 +08:00
41047c16c9 Tools: Update the certificate of idf_tools.py 2023-05-25 16:29:56 +02:00
b0e2f33082 esp_hw_support/bootloader: made ESP32-C6 and ESP32-H2 RNG available 2023-05-24 09:43:21 +05:30
7eb9af5806 openthread: fix frame counter when re-transmition 2023-05-24 10:43:16 +08:00
2016bddbda openthread: add kconfig for enabling mac filter 2023-05-24 10:42:52 +08:00
d9e289a5fb esp_phy: updating lib phy to adapt the voltage changes 2023-05-24 10:35:39 +08:00
71f1bc4453 tools: fix control characters print if hints enabled
Closes https://github.com/espressif/esp-idf/issues/11351
2023-05-23 18:30:22 +08:00
6ad6fb9755 Merge branch 'feature/update_ble_doc_for_esp32c6_esp32h2_v5.1' into 'release/v5.1'
ble docs: Update ble doc for esp32c6 and esp32h2

See merge request espressif/esp-idf!23801
2023-05-23 15:33:51 +08:00
aea087b793 vfs: VFS_MAX_COUNT should be non-zero even without IO support 2023-05-22 12:30:24 +02:00
de4e003256 Allow to config the maximum number of VFS entries. 2023-05-22 12:30:24 +02:00
56677dabe8 Merge branch 'add_c6_in_supported_targets_in_prov_example_v5.1' into 'release/v5.1'
Add ESP32-C6 in supported targets (v5.1)

See merge request espressif/esp-idf!23846
2023-05-20 07:41:54 +08:00
9310ed608e Merge branch 'contrib/github_pr_10532_v5.1' into 'release/v5.1'
[SDMMC Mount] fix infinite loop when SD card is not responsive (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23527
2023-05-20 07:35:38 +08:00
057cf2b8ee Merge branch 'bugfix/wifi_backport_v5.1' into 'release/v5.1'
esp_wifi: backport some wifi fixes to v5.1

See merge request espressif/esp-idf!23847
2023-05-20 07:34:41 +08:00
829fdd172c Merge branch 'feature/add_support_for_lp_i2c_v5.1' into 'release/v5.1'
lp-i2c: Added support for LP I2C peripheral to LP core (v5.1)

See merge request espressif/esp-idf!23850
2023-05-20 04:38:59 +08:00
8cecbafe18 Merge branch 'bugfix/close_phy_tsens_before_sleep_v5.1' into 'release/v5.1'
sleep: fix deepsleep current leakage caused by phy_tsens (backport v5.1)

See merge request espressif/esp-idf!23843
2023-05-19 20:29:22 +08:00
786faa3cac Merge branch 'doc/update_efuse_info_v5.1' into 'release/v5.1'
doc: Update all efuse info files (v5.1)

See merge request espressif/esp-idf!23853
2023-05-19 20:28:15 +08:00
6477500cf1 sdmmc: incrementally increase delay of vTaskDelay
Prevents unnecessary slowdown in polling functions
2023-05-19 14:01:43 +02:00
3ef8c77588 esp_dpp: Fix retry with esp_supp_dpp_start_listen after failure
This fixes a subtle bug in which ESP_ERR_DPP_TX_FAILURE errors would
call esp_supp_dpp_stop_listen which sets the s_dpp_stop_listening flag
to true.  Subsequent attempts to restart listening with
esp_supp_dpp_start_listen then only attempt to listen once more for
500ms before reading the s_dpp_stop_listening flag again and giving up.

This contributes greatly to #10615, but the fix here is still largely
a work-around as it sometimes requires manually retrying a couple times
before it works.  Without this fix, any number of retries by
deinit/init again will seemingly not work as the retries for currently
unknown reasons.

Signed-off-by: Shreyas Sheth <shreyas.sheth@espressif.com>

Closes https://github.com/espressif/esp-idf/pull/10865
2023-05-19 17:17:18 +08:00
9aedb4bd83 wpa_supplicant : Fix scan results for GCMP and GCMP-256 cipher.
Add support for recognising GCMP and GCMP-256 ciphers if used by AP.
Update the scan example to show the correct cipher.
2023-05-19 16:58:51 +08:00
576489f8cf wpa_supplicant : Add MBO ie in probe request.
Adds the MBO information element in the probe request frame by resetting
scan_ie after set_config is done.
2023-05-19 16:58:40 +08:00
a32201f6ec Merge branch 'bugfix/fix_compilation_error_optimization_v5.1' into 'release/v5.1'
Nimble: Fix compilation issues seen while enabling -O2 optimization (v5.1)

See merge request espressif/esp-idf!23717
2023-05-19 16:48:18 +08:00
774696285d Merge branch 'bugfix/fix_lp_bod_if_bt_i154_init_phy_before_wifi_v5.1' into 'release/v5.1'
fix(phy): fix lp_bod reset if bt/i154 init phy before wifi

See merge request espressif/esp-idf!23831
2023-05-19 16:25:11 +08:00
d345beb02a Merge branch 'contrib/github_pr_11402_v5.1' into 'release/v5.1'
esp_ds: ignore releasing mutex if not called from same task (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23840
2023-05-19 16:11:15 +08:00
cb6b14a0f8 doc: Update efuse info files 2023-05-19 15:17:16 +08:00
eccb5318f9 Kconfig: add more help info for pm related options help 2023-05-19 13:51:29 +08:00
1df2dcc9fe bugfix: treat too short sleep duration as sleep reject by software 2023-05-19 13:51:24 +08:00
00e777aff9 bugfix: fix pmp retention and add pma retention 2023-05-19 13:51:20 +08:00
267c5e37a2 lp-i2c: Added support for LP I2C peripheral to LP core
This commit adds support for the LP I2C peripheral driver to be used by
the LP core. An example is also added to demonstrate the usage of the LP
I2C peripheral from the LP core.
2023-05-19 07:33:01 +02:00
2220a07ec1 1. Support NAN ifx for API's esp_wifi_internal_set_fix_rate and esp_wifi_set_protocol
2. Remove user configurable flag fsd_reqd from NAN publish config
3. Fix issue wherein NDL of previously cancelled service is obtained in peer record of new service with no NDL
2023-05-19 12:46:39 +08:00
a3ecb8fe93 Add esp32c6 in supported target for ota examples 2023-05-19 10:03:45 +05:30
d9de899ed7 Add ESP32-C6 in supported targets for wifi_prov_mgr example 2023-05-19 10:03:45 +05:30
871bbdcec3 netdb:fixed bug for getaddrinfo returns null when IPV4 mapped address
Closes https://github.com/espressif/esp-idf/issues/9693
2023-05-19 12:26:07 +08:00
050367ea37 esp_wifi: fix softap nvs <ssid,password,pmk> not match issue
Closes FCS-1196
2023-05-19 12:23:20 +08:00
8bfb5c837e esp_wifi: Fix tx_callback issue for ESP32C6 2023-05-19 12:19:54 +08:00
7412d1a1a9 wpa_supplicant: Use 'mbedtls_pk_parse_public_key' to parse compressed EC public key and remove unnecessary code
Support to parse compressed EC public key is added from 'mbedtls-3.4.0'
2023-05-19 12:19:08 +08:00
edf9f9eff7 esp-wifi: add station SAE-PK (Public Key) configuration note 2023-05-19 12:18:49 +08:00
fc5fe1132a bugfix: close phy_tsens before deepsleep 2023-05-19 11:04:17 +08:00
ed32d7a267 Merge branch 'bugfix/move_adc_onshot_power_management_to_shot_read_func_v5.1' into 'release/v5.1'
Sleep: Fixed abnormal deepsleep base current of ULP ADC on esp32s2/esp32s3 chips (backport v5.1)

See merge request espressif/esp-idf!23828
2023-05-19 11:03:54 +08:00
0d12613ab9 ble docs: Update the ble docs for esp32c6 and esp32h2 2023-05-19 11:03:11 +08:00
cc7c851cb2 Merge branch 'feature/use_api_to_enable_modem_on_esp32h2_v5.1' into 'release/v5.1'
ble: use modem_clock api to set clocks on ESP32-H2

See merge request espressif/esp-idf!23806
2023-05-19 11:01:44 +08:00
501c7d1101 esp_ds: ignore releasing mutex if not called from same task 2023-05-19 08:31:34 +05:30
05c98d8b53 Merge branch 'bugfix/sync-contribution-guide_v5.1' into 'release/v5.1'
docs: updated contribution agreement (v5.1)

See merge request espressif/esp-idf!23839
2023-05-19 10:54:51 +08:00
19f300fa24 Merge branch 'bugfix/use_safe_noreturn_attr_v5.1' into 'release/v5.1'
compiler: replaced noreturn by __noreturn__ in header files (v5.1)

See merge request espressif/esp-idf!23811
2023-05-19 09:37:50 +08:00
c58915842e Merge branch 'bugfix/eth-start-spi-initialize-failure-v5.1' into 'release/v5.1'
Fix eth_start initializes spi bus with SPI_DMA_CH_AUTO (backport v5.1)

See merge request espressif/esp-idf!23815
2023-05-19 09:12:22 +08:00
6cc4ab56e4 docs: updated contribution agreement 2023-05-18 16:27:45 +02:00
bd0f9b8512 fix(phy): fix lp_bod reset if bt/i154 init phy before wifi 2023-05-18 20:57:57 +08:00
43a67a5da3 Merge branch 'feature/esp32c2_enable_rf_temp_compensation_v5.1' into 'release/v5.1'
Feature/esp32c2 enable rf temp compensation v5.1

See merge request espressif/esp-idf!23730
2023-05-18 20:34:30 +08:00
ed076c2bc8 bugfix: move adc_oneshot_power_acquire/release to adc_oneshot_read
Closes https://github.com/espressif/esp-idf/issues/10595
Closes https://github.com/espressif/esp-idf/issues/11386
2023-05-18 20:08:47 +08:00
7fcba0fbf8 Merge branch 'bugfix/fix_some_ble_bug_v5.1' into 'release/v5.1'
Fixed some BLE bugs (backport v5.1)

See merge request espressif/esp-idf!23699
2023-05-18 20:08:25 +08:00
8b7cd4dc08 Merge branch 'bugfix/hfp_ag_idx_invalid_v5.1' into 'release/v5.1'
bt: Fixed out of bounds access due to variable length array(v5.1)

See merge request espressif/esp-idf!23665
2023-05-18 20:07:21 +08:00
57b31ed545 Merge branch 'feature/add_bluetooth_nimble_lightsleep_example_v5.1' into 'release/v5.1'
bt: Added an example of Bluetooth using light sleep(v5.1)

See merge request espressif/esp-idf!23686
2023-05-18 20:06:16 +08:00
2010d70892 Merge branch 'bugfix/a2dp_source_app_state_error_v5.1' into 'release/v5.1'
bt: Fixed the issue that the a2dp source would not send the media start command due to the connection initiated by the peer device(v5.1)

See merge request espressif/esp-idf!23557
2023-05-18 20:04:45 +08:00
f503b0f621 Merge branch 'fix/sdcard_example_blocker_v5.1' into 'release/v5.1'
CI: fix sdcard examples timeout (v5.1)

See merge request espressif/esp-idf!23477
2023-05-18 20:03:59 +08:00
5b4c95c50f Merge branch 'bugfix/update_esp32c6eco1_sleep_fosc_cal_cycles_backport_v5.1' into 'release/v5.1'
bugfix: update esp32c6 eco1 fosc calibration cycles during sleep(backport v5.1)

See merge request espressif/esp-idf!23490
2023-05-18 19:52:05 +08:00
79fab2eb92 Merge branch 'backport/fix_ieee802154_typo' into 'release/v5.1'
ieee802154: fix a typo in set_channel API(Backport v5.1)

See merge request espressif/esp-idf!23809
2023-05-18 17:07:06 +08:00
f79088f115 Merge branch 'bugfix/add_len_check_per_spi_master_transaction_v5.1' into 'release/v5.1'
spi master: added transaction length check to refuse longer than hardware supported length (v5.1)

See merge request espressif/esp-idf!23747
2023-05-18 16:47:18 +08:00
38a1cfe59c Nimble: Fix compilation issues seen while enabling -O2 optimization 2023-05-18 14:00:33 +05:30
0814386710 Merge branch 'refactor/driver_ut_to_test_app_v5.1' into 'release/v5.1'
CI: Move all UT in driver to test_app(backport v5.1)

See merge request espressif/esp-idf!23708
2023-05-18 16:18:26 +08:00
431f5b81a2 Merge branch 'bugfix/fix_doc_blufi_eror_v5.1' into 'release/v5.1'
fix blufi doc error (backport v5.1)

See merge request espressif/esp-idf!23724
2023-05-18 15:04:17 +08:00
e8dba711ff Merge branch 'bugfix/fix_iphone_disconnects_immediately_after_connecting_when_BLE_wifi_coexist_v5.1' into 'release/v5.1'
Fix the bug that the iPhone disconnects immediately after connecting when BLE and wifi coexist(backport v5.1)

See merge request espressif/esp-idf!23786
2023-05-18 15:04:14 +08:00
bd5b1008de comm_components: eth_start initializes spi bus with SPI_DMA_CH_AUTO
Close https://github.com/espressif/esp-idf/issues/11083
2023-05-18 14:46:09 +08:00
9f7475dd98 Merge branch 'contrib/github_pr_11215_v5.1' into 'release/v5.1'
improve thread safety in esp_timer (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23539
2023-05-18 13:06:46 +08:00
a6cbf68991 compiler: replaced noreturn by __noreturn__ in header files
* noreturn may be replaced by third-party macros,
  rendering it ineffective

* Closes https://github.com/espressif/esp-idf/issues/11339
2023-05-18 12:49:40 +08:00
6ba1c6c44f ieee802154: fix a typo in set_channel API 2023-05-18 10:39:51 +08:00
82c6c8149c Merge branch 'bug/interactive_hints_v5.1' into 'release/v5.1'
tools: fix hints processing in interactive mode (v5.1)

See merge request espressif/esp-idf!23795
2023-05-18 00:09:16 +08:00
b3bde42d8c Merge branch 'bugfix/update_test_dl_esp_cert_v5.1' into 'release/v5.1'
tests: update Root certificate for the test endpoints (v5.1)

See merge request espressif/esp-idf!23797
2023-05-17 21:39:09 +08:00
83ac726851 ble: use modem_clock api to set clock on ESP32-C6 2023-05-17 20:04:07 +08:00
133e19d6ee tests: update Root certificate for the test endpoints
Use Root certificate (`DigiCert Global Root G2`) for the
`dl.espressif.com` and `espressif.com` test endpoints.

This fixes the test failure introduced due to renewal of
the intermediate certificate.
2023-05-17 15:27:24 +05:30
8702e49057 spi: added an API to get max transaction length and use in spi lcd driver 2023-05-17 09:03:26 +00:00
4943844764 spi: added transaction length check to refuse longer than hardware supported length 2023-05-17 09:03:26 +00:00
b525e273ce tools: fix hints processing in interactive mode
Currently hints are processed only once the process is finished and
exits with non-error exit code. In interactive mode, e.g. for monitor,
we want to process ouput lines for hints right away.

This adds a simple buffer, which keeps the last line and once EOL is
reached, it is processed for hints.

Since the original hints processing was file based, a new helper
function was added to allow processing hints in string.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-05-17 10:56:39 +02:00
0ed8499898 Merge branch 'bugfix/a2dp_source_crash_connect_to_Bose_speaker_v5.1' into 'release/v5.1'
Bugfix/a2dp source crash connect to bose speaker (v5.1)

See merge request espressif/esp-idf!23574
2023-05-17 15:10:34 +08:00
0122794a4e Merge branch 'bugfix/deinit_ble_v5.1' into 'release/v5.1'
bugfix: deinit ble for specifies ESP_BT_MODE_BTDM (backport v5.1)

See merge request espressif/esp-idf!23068
2023-05-17 15:09:29 +08:00
c92ddbbf6f Merge branch 'bugfix/reduce_logging_for_SAE' into 'release/v5.1'
Modify log level for SAE (Backport v5.1)

See merge request espressif/esp-idf!23547
2023-05-17 14:02:39 +08:00
5bd2b5bc41 fix blufi doc error 2023-05-17 04:06:11 +00:00
b311a3ffc2 Merge branch 'contrib/github_pr_11388_v5.1' into 'release/v5.1'
Update esp_cpu.h to include esp_attr.h (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23738
2023-05-17 09:24:38 +08:00
8adb48cbfd Merge branch 'fix/console-build-error_v5.1' into 'release/v5.1'
console: Fix building issue when serial JTAG is set (v5.1)

See merge request espressif/esp-idf!23735
2023-05-17 08:39:03 +08:00
e86b8136bd Merge branch 'bugfix/c2_wdt_reset_reason_v5.1' into 'release/v5.1'
wdt: fix IWDT reset reason for esp32c2 (v5.1)

See merge request espressif/esp-idf!23740
2023-05-17 08:38:45 +08:00
9b73003628 Fix the bug that the iPhone disconnects immediately after connecting when BLE and wifi coexist 2023-05-16 17:54:06 +08:00
3bdbad6aa7 Merge branch 'feature/remove_coredump_tests_v5.1' into 'release/v5.1'
coredump: remove tests (moved to esp-coredump repo) (v5.1)

See merge request espressif/esp-idf!23767
2023-05-16 17:40:26 +08:00
df7a27e36d CI: Move all UT in driver to test_app 2023-05-16 16:42:28 +08:00
b62cbebb81 Merge branch 'feature/expose_addr_resolv_out_stack_v5.1' into 'release/v5.1'
Nimble:Added change to expose addr resolution API outside stack (v5.1)

See merge request espressif/esp-idf!23491
2023-05-16 16:34:11 +08:00
zwl
c907f489d6 ble:fixed build error when disable smp 2023-05-16 16:08:54 +08:00
zwl
9b61156746 ble:esp32c2 add rf temperature compensation 2023-05-16 16:08:54 +08:00
b8bd147466 ci: re-enable reset reason tests for all targets except H2. 2023-05-16 05:22:07 +00:00
e0b91b748e esp-system: fixed int WDT reset reason being reported as task WDT on C2 2023-05-16 05:22:07 +00:00
726ed144e4 coredump: remove tests (moved to esp-coredump repo) 2023-05-16 12:43:04 +08:00
accb45f466 Update esp_cpu.h
If esp_attr.h is not included then there are no definitions for the symbol 'FORCE_INLINE_ATTR'.
2023-05-16 04:37:17 +00:00
c5003e6220 console: Fix building issue when serial JTAG is set
Closes https://github.com/espressif/esp-idf/issues/10707
2023-05-16 04:37:09 +00:00
96e1f6e7a2 Merge branch 'openthread/default_dnsserver_address_v5_1' into 'release/v5.1'
openthread: Add menuconfig to set the default dns server address(v5.1)

See merge request espressif/esp-idf!23757
2023-05-16 12:36:20 +08:00
d17ab36645 Merge branch 'feature/c6_ulp_timer_v5.1' into 'release/v5.1'
ulp: lp timer support for lp core (v5.1)

See merge request espressif/esp-idf!23659
2023-05-16 09:19:56 +08:00
a056e655d8 openthread: Add menuconfig to set the default dns server address 2023-05-15 19:30:14 +08:00
aed737b351 Merge branch 'feature/efuse_settings_v5.1' into 'release/v5.1'
hal: Explicit setting of efuse time settings (v5.1)

See merge request espressif/esp-idf!23725
2023-05-15 19:16:30 +08:00
0edb7ee43a Merge branch 'bugfix/ulp_i2c_timeout_config_v5.1' into 'release/v5.1'
ulp-riscv-i2c: Add ULP RISC-V I2C read/write timeout config option (v5.1)

See merge request espressif/esp-idf!23657
2023-05-15 16:03:15 +08:00
689db30956 Merge branch 'contrib/github_pr_11025_v5.1' into 'release/v5.1'
Enable support for C++23 in esp-idf (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23421
2023-05-15 16:02:54 +08:00
59b6634a9a Merge branch 'feature/add_missed_settings_for_bootloader_reserve_rtc_mem_for_c6_h2_v5.1' into 'release/v5.1'
esp_system (C6 & H2): Enables BOOTLOADER_RESERVE_RTC_MEM feature for bootloader (v5.1)

See merge request espressif/esp-idf!23402
2023-05-15 16:02:35 +08:00
24ae831b3d Merge branch 'contrib/github_pr_11394_v5.1' into 'release/v5.1'
docs: Fix typo in Linux/macOS getting started docs (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23732
2023-05-15 10:50:34 +08:00
78d88afbef Merge branch 'bugfix/i2c_timing_wrong_v5.1' into 'release/v5.1'
i2c: fix a bug in sda sample timing (backport v5.1)

See merge request espressif/esp-idf!23379
2023-05-15 10:47:35 +08:00
b8365dced6 Merge branch 'Bugfix/fix_tsen_issue_v5.1' into 'release/v5.1'
Temperature sensor: fix return value issue @low temp on H2(backport v5.1)

See merge request espressif/esp-idf!23719
2023-05-15 10:46:11 +08:00
b7199e88b7 Merge branch 'bugfix/mcpwm_bldc_example_v5.1' into 'release/v5.1'
mcpwm: test generator force level with dead time module (v5.1)

See merge request espressif/esp-idf!23714
2023-05-15 10:00:00 +08:00
2701677eb6 Fix typo in Linux/macOS getting started docs
`hello_word` -> `hello_world`
2023-05-15 09:34:48 +08:00
2165ff386e hal: Explicit setting of efuse time settings
EFUSE_PWR_ON_NUM in C3 has default value = 0x2880, now = 0x3000
2023-05-12 21:42:38 +08:00
zlq
79a2cc224c H2:fix temp sensor issue @low temp 2023-05-12 17:00:58 +08:00
6cfc6f53be Merge branch 'bugfix/enable_i_pdm_example_pytest_on_h2_v5.1' into 'release/v5.1'
i2s_pdm: enable example pytest on h2 (v5.1)

See merge request espressif/esp-idf!23642
2023-05-12 16:47:25 +08:00
e35897db33 Merge branch 'feature/heap-in-flash_v5.1' into 'release/v5.1'
heap: Add a configuration that places all the heap component in flash (v5.1)

See merge request espressif/esp-idf!23377
2023-05-12 15:57:31 +08:00
7e49268933 bugfix: deinit ble for specifies ESP_BT_MODE_BTDM 2023-05-12 14:53:56 +08:00
a7021c3e44 mcpwm: fix bldc example force output level inverted
set_force_level can only set the generator level before the deadtime module.
if the deadtime module enables the inverter, then the real output level is inverted accordingly
2023-05-12 14:40:10 +08:00
190e9e7212 Merge branch 'bugfix/fix_several_bugs_in_i2s_v5.1' into 'release/v5.1'
i2s: fix several bugs in std and tdm mode (v5.1)

See merge request espressif/esp-idf!23669
2023-05-12 11:05:34 +08:00
fc69e53e40 Merge branch 'ci/fix_system_invalid_kconfigs_v5.1' into 'release/v5.1'
ci: fix invalid kconfig options in system test apps (v5.1)

See merge request espressif/esp-idf!23660
2023-05-12 11:04:08 +08:00
6f459d4ea8 Merge branch 'feature/reset_mcpwm_in_restart_v5.1' into 'release/v5.1'
mcpwm: reset peripheral in restart, panic and halt (v5.1)

See merge request espressif/esp-idf!23651
2023-05-12 10:12:58 +08:00
1d89e24199 Merge branch 'bugfix/fix_mspi_octal_psram_timing_tuning_point_fallback_id_v5.1' into 'release/v5.1'
mspi: modified mspi 80mhz octal psram timing tuning point fallback id on s3 (v5.1)

See merge request espressif/esp-idf!23689
2023-05-11 21:24:44 +08:00
2379ee36ab cxx: gnu++23 -> gnu++2b for clang compatibility, added docs and test
* Using -std=gnu++2b now for both gcc and clang as clang
  does not recognize gnu++23 yet
* Added a build test app to check the C++ standard in IDF
* Updated english docs to reflect the change to C++23
2023-05-11 17:48:38 +08:00
58fa57af93 Enable support for C++23 in esp-idf 2023-05-11 17:45:20 +08:00
b1c85cc1d5 Merge branch 'contrib/github_pr_10895_v5.1' into 'release/v5.1'
Fix possible conversion errors by using __builtin_ffsll (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23690
2023-05-11 16:45:44 +08:00
cf5e2c3962 Merge branch 'doc/update_mcpwm_deadtime_v5.1' into 'release/v5.1'
MCPWM: don't allow to apply the same delay module to multiple generators (v5.1)

See merge request espressif/esp-idf!23663
2023-05-11 16:13:23 +08:00
b77479df39 bluedroid: fix ble ext adv rand addr setting for NRPA 2023-05-11 14:36:39 +08:00
ac42a8f2c7 bluedroid: fix ble adv data construct for device name 2023-05-11 14:36:39 +08:00
e6f018a309 bluedroid: fix ble smp key distribution setting 2023-05-11 14:36:39 +08:00
2afb56d189 Update bt lib for ESP32-C3 and ESP32-S3
- Fixed remote mic error during encryption procedure
2023-05-11 14:36:39 +08:00
d751960b27 bluedroid: report disconnect event after BLE link closed 2023-05-11 14:36:39 +08:00
7ddb440384 bt: Deleted some redundant variables in HFP_AG 2023-05-11 06:09:06 +00:00
a891aa7e4d bt: Fixed the problem of out-of-bounds access caused by the variable-length array introduced in 3268075231
Closes https://github.com/espressif/esp-idf/issues/11264
2023-05-11 06:09:06 +00:00
d3d73ed8b2 bt: Fixed codec mode error in ESP_HF_WBS_RESPONSE_EVT 2023-05-11 06:09:06 +00:00
a498871111 Merge branch 'bugfix/fix_wrong_hp_ldo_h2_to_v5.1' into 'release/v5.1'
ESP32H2: Fix too low hp ldo dbias (v5.1)

See merge request espressif/esp-idf!23598
2023-05-11 11:59:26 +08:00
5d6b59109b Merge branch 'ci/newlib_pytest_v5.1' into 'release/v5.1'
ci: move newlib tests to pytest (v5.1)

See merge request espressif/esp-idf!23685
2023-05-11 11:49:48 +08:00
48ab527148 cxx/esp_hw_support: added build test, changed parameter types
Changed rv_utils_intr_edge_ack and esp_cpu_intr_edge_ack to
take uint32_t instead of int to avoid build errors.

The test is to test in particular that __builtin_ffsll, used in
xt_utils.h, which is included via esp_cpu.h, compiles fine
in C++20 with -Wsign-conversion enabled.

Closes https://github.com/espressif/esp-idf/pull/10895
2023-05-11 11:16:45 +08:00
51a9057d9e Fix possible conversion errors by using __builtin_ffsll instead of __builtin_ffs
Signed-off-by: term_est <62337595+term-est@users.noreply.github.com>
2023-05-11 11:16:45 +08:00
6ae2c3c240 mspi: modified mspi 80mhz octal psram timing tuning point fallback id on s3 2023-05-11 11:13:32 +08:00
8b8a6a4450 bt: Added an example of Bluetooth using light sleep 2023-05-11 10:24:00 +08:00
6b0d93efd4 ci: misc fixes for newlib test app
Enabled additional tests for C2, added config for testing with newlib nano
as well as cleaned up old configs
2023-05-11 09:27:09 +08:00
d795abeb03 newlib: move test to pytest 2023-05-11 09:26:39 +08:00
70feed14dd Merge branch 'feature/update-OpenOCD-to-v0.12.0-esp32-20230419_v5.1' into 'release/v5.1'
tools: update OpenOCD version to v0.12.0-esp32-20230419 (v5.1)

See merge request espressif/esp-idf!23677
2023-05-11 01:55:34 +08:00
ae4d1c1f81 Merge branch 'feature/esp32c6_esp32h2_enable_panic_tests_v5.1' into 'release/v5.1'
tests: panic: esp32c6/esp32h2 enable (v5.1)

See merge request espressif/esp-idf!23683
2023-05-11 00:27:22 +08:00
eec03e6a32 Merge branch 'feature/freertos_add_create_task_with_caps_v5.1' into 'release/v5.1'
FreeRTOS: Add xTaskCreateWithCaps() (v5.1)

See merge request espressif/esp-idf!23382
2023-05-10 22:34:17 +08:00
6b31235f3f tests: panic: add esp32c6 esp32h2 2023-05-10 19:19:47 +08:00
2744e6ce07 Merge branch 'feature/refactor_gdbstub_v5.1' into 'release/v5.1'
esp_gdbstub: refactor code (v5.1)

See merge request espressif/esp-idf!23513
2023-05-10 19:11:39 +08:00
b3c5ee767a tools: update OpenOCD version to v0.12.0-esp32-20230419 2023-05-10 13:15:19 +03:00
ad5044c5f6 freertos: Add task creation with caps functions
This commit adds the corresponding CreateWithCaps functions for tasks:

- xTaskCreatePinnedToCoreWithCaps()
- xTaskCreateWithCaps()
- vTaskDeleteWithCaps()

Documentation and migraiton guide have been updated accordingly.

Closes https://github.com/espressif/esp-idf/issues/11216
2023-05-10 17:55:49 +08:00
4a35536244 Merge branch 'feature/freertos_get_static_buffers_v5.1' into 'release/v5.1'
FreeRTOS: Add GetStaticBuffer and CreateWithCaps functions (v5.1)

See merge request espressif/esp-idf!23381
2023-05-10 17:53:26 +08:00
670996f484 Merge branch 'bugfix/make_clean_files_v5.1' into 'release/v5.1'
build-system: replace ADDITIONAL_MAKE_CLEAN_FILES with ADDITIONAL_CLEAN_FILES (v5.1)

See merge request espressif/esp-idf!23661
2023-05-10 13:46:56 +08:00
8bb8c144c7 i2s_doc: fixed the data of stereo left/right state 2023-05-10 12:36:00 +08:00
653ba59b23 i2s_tdm: fixed half sample bit calculation and added check for slot mask 2023-05-10 12:34:14 +08:00
319e0689a5 i2s_std: fixed mclk check for 24-bit data and enable left alignment as default 2023-05-10 12:32:38 +08:00
6b86fc7ad7 Merge branch 'test/enlarge_gptimer_test_threshold_v5.1' into 'release/v5.1'
gptimer: enlarge test threshold (v5.1)

See merge request espressif/esp-idf!23622
2023-05-10 10:39:45 +08:00
f4c5fdbd1a Merge branch 'ci/migrate_peripherals_examples_v5.1' into 'release/v5.1'
ci: migrate peripherals ttfw test scripts (v5.1)

See merge request espressif/esp-idf!23403
2023-05-10 10:25:40 +08:00
7b93cf91aa mcpwm: can't apply the same delay module to multiple generators
This is a hardware limitation, one delay module can only be used by one generator at one time.

Closes https://github.com/espressif/esp-idf/issues/11327
2023-05-10 10:09:48 +08:00
63153794c9 build-system: replace ADDITIONAL_MAKE_CLEAN_FILES with ADDITIONAL_CLEAN_FILES
ADDITIONAL_MAKE_CLEAN_FILES is deprecated and only worked with make.
Replaced with the new ADDITIONAL_CLEAN_FILES (CMake 3.15) which also works with ninja.
2023-05-10 09:53:55 +08:00
19a2e42770 ci: fix invalid kconfig options in system test apps 2023-05-10 09:42:12 +08:00
45fd8feba3 ulp: add support for using lp timer with lp core on C6 2023-05-10 09:39:24 +08:00
f5020d3f1b Merge branch 'bugfix/freertos_nested_sched_suspension_v5.1' into 'release/v5.1'
freertos-idf: Fixed incorrect scheduler suspension check in xTaskRemoveFromEventList() (v5.1)

See merge request espressif/esp-idf!23650
2023-05-10 01:41:34 +08:00
08600cb1a3 ulp-riscv-i2c: Add ULP RISC-V I2C read/write timeout config option
The commit 88e4c06028 introduced a loop timeout for all ULP RISC-V I2C
transactions to avoid getting stuck in a forever loop. The loop timeout
was set to 500 msec by default. This commit improves on the concept by
making the loop timeout configurable via a Kconfig option in terms of
CPU ticks. If the timeout is set to -1 value then the transaction loops
will never timeout, therefore restoring the driver behavior before the
timeout was introduced.

The commit also updates the I2C Fast mode timings for esp32s2 which need
to be adjusted due to bus timing constraints.

Closes https://github.com/espressif/esp-idf/issues/11154
2023-05-09 15:07:50 +02:00
236d601e98 mcpwm: reset peripheral in restart, panic and halt
mcpwm is commonly used in power eletronic area, when restart happens,
make sure the mcpwm generator is not working.

closes https://github.com/espressif/esp-idf/issues/11324
2023-05-09 18:30:46 +08:00
ee18b19b8f freertos-idf: Fixed incorrect scheduler suspension check in xTaskRemoveFromEventList()
This commit fixes a bug in xTaskRemoveFromEvenetList() where in the
check for scheduler suspension did not account for nested suspensions.
Additionally, this commit updates all checks for scheduler
suspension to follow a uniform way.
2023-05-09 12:25:09 +02:00
27f044bd7f i2s_pdm: enable example pytest on h2 (v5.1) 2023-05-09 17:30:40 +08:00
5a353ab1ca Merge branch 'docs/add_cn_trans_i2s_v5.1' into 'release/v5.1'
Docs: add CN translation for i2s.rst (backport v5.1)

See merge request espressif/esp-idf!23625
2023-05-09 15:13:45 +08:00
bac34f23bc Docs: add CN translation for i2s.rst (backport v5.1) 2023-05-09 15:13:44 +08:00
8a08cfe7d1 Merge branch 'bugfix/fix_own_addr_is_rap_random_err_v5.1' into 'release/v5.1'
Fixed no error report when own address type is rpa_random and no random address setting(backport v5.1)

See merge request espressif/esp-idf!23623
2023-05-08 20:20:53 +08:00
242713ceee Merge branch 'bugfix/ana_cmpr_negative_enum_v5.1' into 'release/v5.1'
driver: Fix ana_cmpr negative enum comparison and bad test (v5.1)

See merge request espressif/esp-idf!23630
2023-05-08 19:44:56 +08:00
1d3a08d06f Merge branch 'docs/provide_CN_trans_for_22939_backport_v5.1' into 'release/v5.1'
docs: update links in mdns.rst (backport_v5.1)

See merge request espressif/esp-idf!23633
2023-05-08 19:43:31 +08:00
e6de764ca1 docs: update links in mdns.rst_backport_v5.1 2023-05-08 17:46:58 +08:00
3948949019 driver: Fix ana_cmpr negative enum comparison
The C17 standard (sec 6.7.2.2) indicates that the underlying type of an enum is
implementation defined (i.e., can be signed or unsigned). Thus, comparing
"-1 >= some_enum" where "some_enum" is always 0 or largert can return true if
the compiler uses unsigned for enums.

This commit fixes the following issues with ana_cmpr:

- Fixed incorrect comparison in ana_cmpr_del_unit() that relied on enums being
signed, thus would always return true.
- Fixed incorrect expected argument in the "ana_cmpr_unit_install_uninstall"
test. This was not picked up due to the incorrect enum comparison above.
2023-05-08 17:11:52 +08:00
24cc2d714e Fixed BLE disconnection failure on ESP32 2023-05-08 12:17:09 +08:00
16696d98c1 Fixed battery profile wrong condition 2023-05-08 11:31:22 +08:00
zwj
daf2622a5b Fixed no error report when own address type is rpa_random and no random address setting 2023-05-08 11:31:06 +08:00
864f5532fa gptimer: enlarge test threshold 2023-05-08 10:18:58 +08:00
d4a3427eaf Merge branch 'bugfix/gdma_log_nano_v5.1' into 'release/v5.1'
gdma: fixed crash from logging when using newlib nano (v5.1)

See merge request espressif/esp-idf!23585
2023-05-08 10:13:55 +08:00
94d6614c88 Merge branch 'ci/fix_overwrite_pytest_configs_v5.1' into 'release/v5.1'
ci: fixed test apps overriding pytest configs (v5.1)

See merge request espressif/esp-idf!23495
2023-05-06 17:40:58 +08:00
de5a9ac1f3 Merge branch 'bugfix/check_filter_range_v5.1' into 'release/v5.1'
rmt: check filter and idle threashold (v5.1)

See merge request espressif/esp-idf!23604
2023-05-06 14:00:20 +08:00
46f104b3ae gdma: fixed crash from logging when using newlib nano
Newlib nano printf formatting do not support %z, and will crash if such an identifier
is followed by a %s indentifier.

Closes https://github.com/espressif/esp-idf/issues/9631
2023-05-06 13:47:51 +08:00
dd747bd54d Merge branch 'contrib/github_pr_11326_v5.1' into 'release/v5.1'
correct typo in reference to ESP-IDF repo (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23551
2023-05-06 13:09:33 +08:00
7d96d9e306 Merge branch 'backport/fix_openthread_ci' into 'release/v5.1'
OpenThread CI: add a function for executing commands(backport v5.1)

See merge request espressif/esp-idf!23602
2023-05-06 10:34:06 +08:00
1111fd2630 Merge branch 'contrib/github_pr_11296_v5.1' into 'release/v5.1'
Fix references to IDF_ADD_PATHS_EXTRAS before being assigned (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23599
2023-05-05 21:12:11 +08:00
d12ad17373 rmt: check filter and idle threashold
Closes https://github.com/espressif/esp-idf/issues/11262
2023-05-05 19:07:59 +08:00
4db113a2eb Merge branch 'bugfix/hf_cind_ind_index_v5.1' into 'release/v5.1'
bt: Fixed the inconsistency between the indicator event received by the HF application layer and the actually received indicator(v5.1)

See merge request espressif/esp-idf!23559
2023-05-05 18:47:45 +08:00
bba2581f1a Merge branch 'bugfix/fatfs_open_O_CREAT_fails_v5.1' into 'release/v5.1'
fatfs: fix "open("xx",O_CREAT|O_WRONLY,0666)" call failure (v5.1)

See merge request espressif/esp-idf!23561
2023-05-05 18:13:51 +08:00
938bcc0337 OpenThread CI: add a function for executing commands 2023-05-05 18:05:02 +08:00
845efafc76 Fix references to IDF_ADD_PATHS_EXTRAS before being declared 2023-05-05 11:17:24 +02:00
cje
78b9f5e151 fix too low hp ldo dbias bug for h2 2023-05-05 17:04:18 +08:00
8dbe966d89 fix a2dp source crash when connect to Bose speaker 2023-05-04 19:00:20 +08:00
38570b052b pm: fix invalid trace pins for C6 and H2 2023-05-04 14:42:17 +08:00
4477f3e559 bugfix: fix for fatfs "open("xx",O_CREAT|O_WRONLY,0666)" call failure
fatfs 'open' with only O_CREAT flag fails to creat new file

Closes https://github.com/espressif/esp-idf/issues/1817
2023-05-04 11:45:37 +05:30
25e8069532 bt: Fixed the inconsistency between the indicator event received by the HF application layer and the actually received indicator.
Closes https://github.com/espressif/esp-idf/issues/6486
2023-05-04 14:08:30 +08:00
90e354a723 wpa_supplicant: Reduce logging for SAE 2023-05-04 11:23:55 +05:30
2004bf4e11 Merge branch 'bugfix/rmt_one-wire_v5.1' into 'release/v5.1'
rmt_onewire: refactor example with component registry (v5.1)

See merge request espressif/esp-idf!23509
2023-05-04 13:32:18 +08:00
a0a6e34f4f docs: fix wrong link to esp-adf github issues in migration guide 2023-05-04 12:57:08 +08:00
6b5b7f09f9 i2c: fix a bug in sda sample timing
* Closes https://github.com/espressif/esp-idf/issues/9777

This bug prevented SCL line to work properly after a NACK was received in master mode.
2023-05-04 12:14:43 +08:00
42d5b865dd Fixed the issue that the a2dp source would not send the media start command due to the connection initiated by the peer device
Closes https://github.com/espressif/esp-idf/issues/11170
2023-05-04 12:13:27 +08:00
123da6baa7 bugfix: fix esp32c6eco1 fosc calibration cycles during sleep 2023-05-04 11:47:54 +08:00
2654d29bc5 correct typo in reference to ESP-IDF repo
There's a reference to the ESP-ADF repo that looks like it was intended to be a reference to the ESP-IDF repo. This branch fixes the reference.
2023-05-04 11:43:08 +08:00
b3b85cafb1 Merge branch 'bugfix/fix_ble_hop_sel_v5.1' into 'release/v5.1'
Fixed BLE connection failed to be established when disabled 5.0 feature (backport 5.1)

See merge request espressif/esp-idf!23530
2023-05-04 11:38:06 +08:00
21fd9aaee8 ci: small cleanup for the dependencies.yml 2023-05-04 11:21:40 +08:00
8fd3b342aa ci: add pattern ccs811 2023-05-04 11:21:39 +08:00
1c1c6d59b3 ci: migrate peripherals ttfw test scripts 2023-05-04 11:21:29 +08:00
f2d144166a sdio_example: fix meaningless print in host, make shared reg access more readable in slave 2023-05-04 11:21:10 +08:00
e704f72356 Merge branch 'backport/ble_bugfix_5_1' into 'release/v5.1'
ble: [ESP32C6][ESP32H2][ESP32C2] updata libble

See merge request espressif/esp-idf!23523
2023-05-04 10:52:01 +08:00
4f1fc73fc2 Merge branch 'bugfix/eth_driver_cleanup_v5.1' into 'release/v5.1'
Ethernet driver and documentation clean-up (v5.1)

See merge request espressif/esp-idf!23545
2023-05-04 10:05:25 +08:00
2508350137 Merge branch 'bugfix/eth_l2_test_switch_v5.1' into 'release/v5.1'
LAN8720 & IP101 L2 Test Fix (v5.1)

See merge request espressif/esp-idf!23535
2023-05-04 10:04:46 +08:00
058bb0edd0 docs: update translation for esp_eth 2023-05-03 07:39:24 +00:00
71d19fa9c9 Ethernet driver and documentation clean-up 2023-05-03 07:39:24 +00:00
07d1e19107 improve thread safety in esp_timer
Inadequate locking in the esp_timer component allowed corruption
of the s_timers linked list:

1. timer_armed(timer) returns false
2. another task arms the timer and adds it to s_timers
3. the list is locked
4. the timer is inserted into s_timers again

The last step results in a loop in the s_timers list, which causes
an infinite loop when iterated. This change always locks the
list before checking if the timer is already armed avoiding
the data race.
2023-05-02 20:22:24 +02:00
1042115566 esp_eth pytest: increased robustness of the L2 test
Added filtering frames based on MAC address
2023-05-02 10:25:58 +02:00
b97cf6ca7c Merge branch 'fix/ecdsa_hal_v5.1' into 'release/v5.1'
ecdsa: Support multiple ECDSA keys (v5.1)

See merge request espressif/esp-idf!23444
2023-05-02 11:48:17 +08:00
5775e1d3b7 esp_system (C6 & H2): Enables BOOTLOADER_RESERVE_RTC_MEM feature for bootloader
This option reserves an area in RTC FAST memory for the following features:
- "Skip image validation when exiting deep sleep"
- "Reserve RTC FAST memory for custom purposes"
- "GPIO triggers factory reset"
2023-05-01 06:27:11 +00:00
4a74ae4921 ci: Add patterns and target-tests for ecdsa_efuse runner 2023-04-30 11:48:46 +05:30
5fac5b0191 mbedtls/ecdsa: Add ECDSA signature generation test 2023-04-30 11:47:35 +05:30
abc099ce9f ecdsa: Support multiple ECDSA keys
Add provision to choose which efuse block should be used as ECDSA
private key
2023-04-30 11:47:35 +05:30
174ef6c4a3 ecdsa_hal.c: Add missing configuration for signature generation 2023-04-30 11:47:35 +05:30
89c06b3c51 Update bt lib for ESP32-C3 and ESP32-S3
- Fixed ble hopping selection for connection when disabled 5.0 feature
2023-04-28 19:30:45 +08:00
62a5ad5fc1 sdmmc: add vTaskDelay to loops to prevent potential WDT trigger
Also change timeout to 120 seconds in fatfs sdcard pytest to prevent failing during formatting.
2023-04-28 12:39:08 +02:00
c7ca30e62f [SDMMC] add reasonable timeouts to all while loops
Closes: https://github.com/espressif/esp-idf/pull/10532
2023-04-28 12:39:06 +02:00
6ff1059da7 [SDMMC Mount] fix infinite loop when SD card is not responsive
Closes: https://github.com/espressif/esp-idf/pull/10532
2023-04-28 12:37:27 +02:00
d6a1ccb27f ble: [ESP32C6][ESP32H2][ESP32C2] updata libble
Fixed the occasional mic error caused by wrong tx cnt
Fixed the BLE connection timeout issue
2023-04-28 17:27:36 +08:00
zwl
e575e0b44a Ble: bugfix for packet loss issue during connection on ESP32C6 2023-04-28 17:27:08 +08:00
cbd210b431 Merge branch 'refactor/rename_to_esp_clk_tree_prefix_v5.1' into 'release/v5.1'
esp_clk_tree: Rename clk_tree_xxx to esp_clk_tree_xxx (v5.1)

See merge request espressif/esp-idf!23449
2023-04-28 17:11:46 +08:00
14dac35540 rmt_onewire: refactor example with component manager
Closes https://github.com/espressif/esp-idf/issues/10790
2023-04-28 13:38:33 +08:00
71a19d238c esp_gdbstub: refactor code 2023-04-28 12:38:26 +08:00
961018d882 Merge branch 'bugfix/pmkid_sha256_bug_v5.1' into 'release/v5.1'
wpa_supplicant: Fix PMKID SHA-256 related regression (Backport v5.1)

See merge request espressif/esp-idf!23494
2023-04-28 07:52:52 +08:00
c710a69952 Merge branch 'bugfix/fix_softap_pairwise_cipher_issue_v5.1' into 'release/v5.1'
esp_wifi: update pairwise cipher in softAP(Backport v5.1)

See merge request espressif/esp-idf!23503
2023-04-28 04:45:59 +08:00
eeea0a7ea8 Merge branch 'feature/esp_tls_add_getter_setter_v5.1' into 'release/v5.1'
esp-tls: Added getter/setter function for the conn_state. (v5.1)

See merge request espressif/esp-idf!23408
2023-04-28 04:36:25 +08:00
5fdb9b00c5 CI: fix sdcard examples timeout 2023-04-27 17:47:12 +02:00
310e5e71ed Merge branch 'bugfix/spp_notify_v5.1' into 'release/v5.1'
NimBLE: Removed indicate flag from gatt db and added subscription case in spp_server example (v5.1)

See merge request espressif/esp-idf!23458
2023-04-27 23:36:24 +08:00
9a58988bae Merge branch 'test/removed_emmc_esp32_ut_v5.1' into 'release/v5.1'
emmc: removed esp32 emmc ut_017 (v5.1)

See merge request espressif/esp-idf!23485
2023-04-27 23:34:24 +08:00
d89db7e4a7 Merge branch 'feature/spi_hal_move_out_iram_v5.1' into 'release/v5.1'
spi: change linker file to move spi hal out from iram (v5.1)

See merge request espressif/esp-idf!23448
2023-04-27 23:31:16 +08:00
c0c9227883 Merge branch 'fix/sdio_sd_cards_not_detected_correctly_v5.1' into 'release/v5.1'
sdmmc: sdio combination cards correct setup (v5.1)

See merge request espressif/esp-idf!23478
2023-04-27 23:28:28 +08:00
c49dce48eb Merge branch 'fix/esp32s3_ununsed_dcache_as_dram_v5.1' into 'release/v5.1'
esp_hw_support: Update the memory ptr location/property checks to include the unused DCACHE added to DRAM (v5.1)

See merge request espressif/esp-idf!23303
2023-04-27 22:09:55 +08:00
1a03cb02c2 Merge branch 'feature/support_fosc_calibration_c6_eco1_to_v5.1' into 'release/v5.1'
ESP32C6: Fix fosc calibration fail bug for ECO1 & Above (v5.1)

See merge request espressif/esp-idf!23467
2023-04-27 20:38:31 +08:00
193f581cec esp_wifi: update pairwise cipher in softAP 2023-04-27 20:07:48 +08:00
f03e3c164e esp_supplicant: When the softAP authentication mode is set to WPA2_PSK, WPA2_WPA3_PSK, or WPA3_PSK, the pairwise cipher will be overwritten with WIFI_CIPHER_TYPE_CCMP 2023-04-27 20:07:39 +08:00
8d383980a1 esp_supplicant: wpa pmf should be disabled 2023-04-27 20:07:30 +08:00
202b18b5fa esp_clk_tree: Rename clk_tree_xxx to esp_clk_tree_xxx, add compilation warning to clk_tree.h 2023-04-27 11:11:18 +00:00
3048251be0 Merge branch 'ci/pytest_case_tester_script_fix_v5.1' into 'release/v5.1'
ci: pytest automation script increase timeout time (v5.1)

See merge request espressif/esp-idf!23447
2023-04-27 17:35:51 +08:00
c35f7cad45 Merge branch 'feature/c6_ulp_sleep_v5.1' into 'release/v5.1'
ulp: added sleep support for lp core (v5.1)

See merge request espressif/esp-idf!23484
2023-04-27 17:07:24 +08:00
1b4e46428d Merge branch 'bugfix/reject_tkip_in_owe_v5.1' into 'release/v5.1'
Reject TKIP cipher incase of OWE connection (Backport v5.1)

See merge request espressif/esp-idf!23462
2023-04-27 16:51:15 +08:00
5bba395bc8 Merge branch 'bugfix/wifi_prov_deinit_github_v5.1' into 'release/v5.1'
wifi_prov_mgr: Fixed memory leak after bluetooth stack was stopping. (v5.1)

See merge request espressif/esp-idf!23436
2023-04-27 16:33:53 +08:00
8719a45d97 Merge branch 'ci/fix_no_test_script_corner_case_v5.1' into 'release/v5.1'
ci: fix build script when no test script found (v5.1)

See merge request espressif/esp-idf!23404
2023-04-27 16:10:10 +08:00
0e484e1daa Merge branch 'feature/bt_uses_creationg_with_caps_functions_v5.1' into 'release/v5.1'
BT: Remove "create static" calls from OSI (v5.1)

See merge request espressif/esp-idf!23337
2023-04-27 16:06:10 +08:00
0be6802198 Merge branch 'backport/ieee802154_open_src' into 'release/v5.1'
ieee802154: drive code open source (backport v5.1)

See merge request espressif/esp-idf!23461
2023-04-27 16:02:09 +08:00
9f80af3770 Merge branch 'bugfix/ble_mesh_fix_heartbeat_set_v5.1' into 'release/v5.1'
ble_mesh: stack: Update the heartbeat filter entry add/remove handling (v5.1)

See merge request espressif/esp-idf!23460
2023-04-27 14:38:27 +08:00
411c392d97 Merge branch 'feature/support_fosc_calibration_h2_eco2_to_v5.1' into 'release/v5.1'
ESP32H2: Fix fosc calibration fail bug for ECO2 & Above (v5.1)

See merge request espressif/esp-idf!23469
2023-04-27 14:38:01 +08:00
3724bf6256 ci: fixed test apps overriding pytest configs 2023-04-27 14:29:06 +08:00
a64cbdea10 wpa_supplicant: Fix PMKID SHA-256 related regression
Fixed regression caused by commit 38e9c8b4
2023-04-27 11:35:20 +05:30
728c1ffe59 Merge branch 'backport/openthread_ci_fix' into 'release/v5.1'
Openthread: add delay to ensure that the dut can receive input command(BackportV5.1)

See merge request espressif/esp-idf!23486
2023-04-27 13:56:46 +08:00
2bc721739c Merge branch 'bugfix/i2s_tdm_multi_dev_on_h2_v5.1' into 'release/v5.1'
i2s: fixed tdm multi dev test on h2 (v5.1)

See merge request espressif/esp-idf!23475
2023-04-27 13:20:03 +08:00
34e0ed613a Nimble:Added change to expose addr resolution API outside stack 2023-04-27 10:33:47 +05:30
7492e0a2c7 Merge branch 'support/backport_154_related_feature' into 'release/v5.1'
openthread: backport Thread related fixes (backport v5.1)

See merge request espressif/esp-idf!23427
2023-04-27 11:57:47 +08:00
ea65b1fefb esp_phy: remove esp32h4 phylib 2023-04-27 11:28:12 +08:00
a33c60a36f ieee802154: remove libieee802154.a for target esp32h4 2023-04-27 11:28:12 +08:00
3178718a3d ieee802154: support driver opensrc 2023-04-27 11:27:57 +08:00
deedc51cf1 Merge branch 'ci/chip_support_network_invalid_kconfig_v5.1' into 'release/v5.1'
ci: remove redundent ci configs for chip support and network components (v5.1)

See merge request espressif/esp-idf!23471
2023-04-27 11:10:54 +08:00
f7e3f76899 openthread CI: add delay to ensure that the dut can receive input command 2023-04-27 10:54:19 +08:00
46511c8fd1 Merge branch 'bugfix/fix_wrong_frame_ptr_after_wake_restore_backportv5.1' into 'release/v5.1'
bugfix: fix wrong RvCoreCriticalSleepFrame ptr value after wake restore (backport v5.1)

See merge request espressif/esp-idf!23473
2023-04-27 10:45:04 +08:00
96b3f52c4e emmc: temporarily removed esp32 emmc ut_017 2023-04-27 10:30:38 +08:00
2117b7a1dc Merge branch 'contrib/github_pr_11113_v5.1' into 'release/v5.1'
Fix usb enumeration stage error for some device (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23332
2023-04-27 10:12:12 +08:00
3ae079ac12 Merge branch 'bugfix/fix_duplicate_scan_cycle_refresh_not_accurate_v5.1' into 'release/v5.1'
Fixed duplicate scan refresh cycle is not accurate after restarting scan on ESP32(backport v5.1)

See merge request espressif/esp-idf!23405
2023-04-27 10:02:17 +08:00
0bac174058 ulp: added sleep support for lp core
Added support for running LP core while hp core sleeps, as well
as waking up the hp core.
2023-04-27 09:51:41 +08:00
856cfa4ae2 Merge branch 'refactor/remove_esp32h4_target_v5.1' into 'release/v5.1'
esp32h4: remove esp32h4 target (v5.1)

See merge request espressif/esp-idf!23422
2023-04-27 09:37:51 +08:00
0d13dbbb1f OpenThread border router: support border router to connect with SSED 2023-04-27 09:16:10 +08:00
51c058d80f ieee802154: increase the timeout for ieee802.15.4 CI test 2023-04-27 09:16:10 +08:00
aea120b98b openthread: fix the spi conflict between ot-spinel and ethernet 2023-04-27 09:16:10 +08:00
7909394274 openthread: fix platform udp send rules for OT netif 2023-04-27 09:16:10 +08:00
6bfa2b7078 openthread port: set ipv6 address zone with netif index when udp joining or leaving group 2023-04-27 09:16:10 +08:00
86a673946c openthread: Add check for lock acquire and release 2023-04-27 09:16:10 +08:00
aedcec9be5 Merge branch 'feature/emmc_example_v5.1' into 'release/v5.1'
SDMMC Host: added an example to communicate with an eMMC chip and also a bugfix for Host timing (v5.1)

See merge request espressif/esp-idf!23283
2023-04-26 22:41:15 +08:00
934f0477a4 Merge branch 'bugfix/allow_no_specify_uart_clk_src_v5.1' into 'release/v5.1'
uart: Allow omitting source_clk parameter to uart_param_config (v5.1)

See merge request espressif/esp-idf!23451
2023-04-26 20:32:35 +08:00
81988b0007 Merge branch 'docs/add_Chinese_translation_for_api-reference/error-codes_backport_v5.1' into 'release/v5.1'
docs: provide translation for docs/zh_CN/api-reference/error-codes.rst (backport v5.1)

See merge request espressif/esp-idf!23397
2023-04-26 19:47:13 +08:00
de45fb1c33 docs: provide translation for docs/zh_CN/api-reference/error-codes.rst (backport v5.1) 2023-04-26 19:47:13 +08:00
29be39086f Merge branch 'docs/update_out_of_sync_api-reference_docs_backport_v5.1' into 'release/v5.1'
docs: update out-of-sync api reference docs (backport v5.1)

See merge request espressif/esp-idf!23399
2023-04-26 19:45:23 +08:00
934c2c3a58 sdmmc: sdio combination cards correct setup
Co-authored-by: Mau Abata <mauabata@gmail.com>
Closes https://github.com/espressif/esp-idf/issues/9822
Closes https://github.com/espressif/esp-idf/issues/10280
2023-04-26 13:27:59 +02:00
0aad1efe15 i2s: fixed tdm multi dev test on h2 2023-04-26 18:55:36 +08:00
87328d594f esp32h4: checked all the corner stuffs of the removal 2023-04-26 18:53:12 +08:00
954a6a2cff esp32h4: removed esp32h4 related codes 2023-04-26 18:53:12 +08:00
cae47ce37e esp32h4: removed esp32h4 related files 2023-04-26 18:53:12 +08:00
8f24b34f21 esp32h4: remove esp32h4 target from ci 2023-04-26 18:53:12 +08:00
804a9ea1f6 esp32h4: remove esp32h4 target from peripherals 2023-04-26 18:53:10 +08:00
46deef434f esp_pm: check sleep retention frame integrity in ci UT 2023-04-26 17:36:46 +08:00
5ccf93d788 bugfix: fix wrong RvCoreCriticalSleepFrame ptr value after wake restore 2023-04-26 17:36:42 +08:00
4c3c6b7f99 ci: remove redundent ci configs for chip support and network components
CI would build psram config test apps even for target with no psram.
2023-04-26 17:29:51 +08:00
70fc0bde01 support h2 eco2 fosc calibration for v5.1 2023-04-26 17:08:09 +08:00
1564884cc1 support c6 eco1 fosc calibration for v5.1 2023-04-26 16:32:28 +08:00
86226770b8 esp_wifi: Reject TKIP cipher incase of OWE connection 2023-04-26 12:10:33 +05:30
e121775d6c ble_mesh: stack: Update the heartbeat filter entry add/remove handling 2023-04-26 14:17:11 +08:00
ef3da6b372 NimBLE: Removed indicate flag from gatt db, added subscription case and corrected indentation
in spp_server example.
2023-04-26 11:39:09 +05:30
1b6461b9f8 Merge branch 'bugfix/bod_glitch_reset_c6_v5.1' into 'release/v5.1'
bootloader: fix BOD and glitch reset on C6 and H2 (v5.1)

See merge request espressif/esp-idf!23380
2023-04-26 13:09:32 +08:00
16f3317496 soc/esp32s3: Fix the SOC_MEM_INTERNAL_HIGH value
- As per the memory block diagram for ESP32-S3, the
  internal memory address ranges as follows:
  DRAM: 0x3FC88000 (== SOC_MEM_INTERNAL_LOW) <-> 0x3FCF0000
  IRAM: 0x40378000 <-> 0x403E0000 (== SOC_MEM_INTERNAL_HIGH)
2023-04-26 04:01:38 +00:00
3118120659 esp_hw_support: Update memory ptr location/property checks
- to acknowledge the unused DCACHE added to DRAM for ESP32-S3

- For ESP32-S3, when the DCACHE size is set to 16 kB, the unused 48 kB is added to
  the heap in 2 blocks of 32 kB (from 0x3FCF0000) and 16 kB (from 0x3C000000).
- But, if we try allocating memory from the 16 kB block and run an `esp_ptr_internal`
  check on that memory pointer, it fails as the address block from 0x3C000000
  corresponds to the external memory symbols SOC_DROM_LOW and SOC_EXTRAM_DATA_LOW.
  (E.g. freertos - If the IDLE task stack buffer gets allocated from this region,
  the firmware will abort due to this failure).
- Thus, the checks `esp_ptr_internal`, `esp_ptr_in_drom` and `esp_ptr_byte_accessible`
  have been updated to acknowledge this memory as a part of the DRAM.

Co-authored-by: Mahavir Jain <mahavir@espressif.com>
2023-04-26 04:01:38 +00:00
e1b89eeae0 Merge branch 'feature/s2_ulp_riscv_adc_v5.1' into 'release/v5.1'
ulp-riscv: enable ULP-RISCV ADC example for esp32s2 (v5.1)

See merge request espressif/esp-idf!23371
2023-04-26 11:59:20 +08:00
cfcb57333b Merge branch 'bugfix/fix_chip_broken_bug_in_monitor_mode_S2_v5.1' into 'release/v5.1'
ESP32S2/C3/C2: fixed S2 dangerous power parameters in sleep modes and support S2/C3/C2 different sleep mode (v5.1)

See merge request espressif/esp-idf!23378
2023-04-26 11:41:09 +08:00
24bfb8a8e5 uart: Allow the users to not specify the source_clk in uart_config_t when calling uart_param_config 2023-04-26 11:24:16 +08:00
f61e219667 spi: change linker file let spi hal able to out from iram 2023-04-26 11:15:30 +08:00
40b0dbae10 spi_flash: fix config SPI_FLASH_SHARE_SPI1_BUS dependency 2023-04-26 11:15:30 +08:00
ee4e5c014a sdio: test_sdio add unity sync signals 2023-04-26 11:11:59 +08:00
4dcd055612 ci: pytest automation script increase timeout time 2023-04-26 11:11:59 +08:00
6b28967b64 Merge branch 'bugfix/fix_adc_continuouus_example_pytest_potential_failure_v5.1' into 'release/v5.1'
adc: fix adc_continuous example pytest potential failure (v5.1)

See merge request espressif/esp-idf!23425
2023-04-25 19:59:43 +08:00
f6e0867eb8 wifi_prov_mgr: Fixed memory leak after bluetooth stack was stopping. 2023-04-25 15:48:09 +05:30
30cc0769ac Merge branch 'refactor/remove_esp_mm_kconfig_as_no_kconfig_option_now_v5.1' into 'release/v5.1'
esp_mm: removed empty kconfig files (v5.1)

See merge request espressif/esp-idf!23284
2023-04-25 17:52:35 +08:00
f793584c68 Merge branch 'docs/update_cn_trans_api_guides' into 'release/v5.1'
Docs: Update cn trans api guides (backport v5.1)

See merge request espressif/esp-idf!23384
2023-04-25 17:16:43 +08:00
3a34660d54 Docs: Update cn trans api guides (backport v5.1) 2023-04-25 17:16:43 +08:00
d54af90022 Merge branch 'ci/disable_test_dram_reg2_execute_violation_v5.1' into 'release/v5.1'
ci: disable test_dram_reg2_execute_violation on esp32s2 (v5.1)

See merge request espressif/esp-idf!23420
2023-04-25 14:28:16 +08:00
a0df46d342 Merge branch 'bugfix/wifi_backport_v5.1' into 'release/v5.1'
esp_wifi: backport some wifi fixes to v5.1

See merge request espressif/esp-idf!23389
2023-04-25 13:52:44 +08:00
959f92e744 Merge branch 'docs/esp_protocols_docs_migration_v5.1' into 'release/v5.1'
docs: migrated documentation from github.io to docs.espressif.com (v5.1)

See merge request espressif/esp-idf!23319
2023-04-25 13:49:13 +08:00
e23ce8209d fix adc_continuous example pytest potential failure 2023-04-25 12:26:34 +08:00
92965cd124 Merge branch 'feature/sram1_iram_v5.1' into 'release/v5.1'
system: add kconfig option for using parts of SRAM1 for IRAM (v5.1)

See merge request espressif/esp-idf!23370
2023-04-25 11:35:08 +08:00
8c11edb852 Merge branch 'feature/update_mbedtls_v5.1' into 'release/v5.1'
mbedtls: Update to release/v3.4.0 (v5.1)

See merge request espressif/esp-idf!23398
2023-04-25 11:04:44 +08:00
f67a860cf0 ci: disable test_dram_reg2_execute_violation on esp32s2 2023-04-25 10:02:00 +08:00
9d114e30b5 Merge branch 'feature/esp_sys_iram_cleanup_v5.1' into 'release/v5.1'
esp-system: move uncessary IRAM functions to flash (v5.1)

See merge request espressif/esp-idf!23376
2023-04-25 09:51:25 +08:00
e104fa1904 Merge branch 'bugfix/esp32_pico_v3_2_chip_info_v5.1' into 'release/v5.1'
system: fix esp32 chip info not listing esp32 pico v3-02 as having embedded spiram (v5.1)

See merge request espressif/esp-idf!23393
2023-04-25 09:46:25 +08:00
d7b344c97a heap: Add a configuration that places all the heap component and related functionalities in flash when enabled
Add test configuration to run all tests with heap component in the flash.
Add reference to this new configuration in performance section of the documentation.
2023-04-25 01:12:10 +00:00
5bea8592d9 Merge branch 'ci/run_readme_checks_not_in_parallel' into 'release/v5.1'
ci: run readme check when constants.py or check script updated (v5.1)

See merge request espressif/esp-idf!23386
2023-04-25 09:00:59 +08:00
0f8bf38913 ci: run readme check when constants.py or check script updated 2023-04-25 08:51:22 +08:00
e24e674e2f esp-tls: Added getter/setter function for the conn_state.
* Added the setter function to set the connection sockfd value
Closes https://github.com/espressif/esp-idf/issues/10871
2023-04-24 14:49:26 +05:30
zwj
52ca53746f Fixed disconnection due to consecutive CRC errors in first 6 intervals 2023-04-24 15:49:36 +08:00
zwj
a26449844f Fixed duplicate scan refresh cycle is not accurate after restarting scan on ESP32 2023-04-24 15:49:12 +08:00
d020a58be1 Merge branch 'ci/soc_caps_docs_build_v5.1' into 'release/v5.1'
ci: build all docs if soc_caps.h changed (v5.1)

See merge request espressif/esp-idf!23374
2023-04-24 15:48:15 +08:00
4f40bfd864 ci: fix build script when no test script found 2023-04-24 15:47:58 +08:00
75002dce56 Merge branch 'contrib/github_pr_11163_v5.1' into 'release/v5.1'
Make custom bootloader message match actual output (GitHub PR) (v5.1)

See merge request espressif/esp-idf!23375
2023-04-24 15:46:58 +08:00
b8718506cd mbedtls: fix ci failures for update v3.4.0
- While updating to mbedtls release/v3.4.0, building mbedtls/library/psa_crypto.c,
clang produced an unreachable-code warning, so added `-Wno-unreachable-code` compile option for clang.
- In `mbedtls/v3.4.0`, the ECDSA restartable sign and verify functions (`ecdsa.c`) were made public.
- But the `mbedtls_ecdsa_sign_det_restartable` function prototype was declared in the file `ecdsa.h`,
only when `MBEDTLS_ECDSA_SIGN_ALT` was not defined.
- added a patch in mbedtls library to fix it.
2023-04-24 11:56:56 +05:30
0116dcb578 mbedtls: replace low-level sha apis with md apis in esp_ssl_tls 2023-04-24 11:56:56 +05:30
3152dea192 mbedtls: Update config options as per release/v3.4.0
- Added a Kconfig option for the newly added mbedtls option MBEDTLS_PKCS7_C
2023-04-24 11:56:56 +05:30
31e42e77de mbedtls: Update to release/v3.4.0
- Release Notes: https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.4.0
2023-04-24 11:56:56 +05:30
f0b2bd5c81 docs: update out-of-sync api reference docs 2023-04-24 14:23:35 +08:00
83a682ca1a Merge branch 'monitor_win_color-v5.1' into 'release/v5.1'
bug(idf_monitor): fix color on windows with hints (v5.1)

See merge request espressif/esp-idf!23346
2023-04-24 14:00:05 +08:00
9ddd08c502 system: fix esp32 chip info not listing esp32 pico v3-02 as having embedded spiram
Closes https://github.com/espressif/esp-idf/issues/11233
2023-04-24 13:53:26 +08:00
4e73cb77e5 Merge branch 'esptool_extra-v5.1' into 'release/v5.1'
feat(esptool): allow to set force for write_flash (v5.1)

See merge request espressif/esp-idf!23338
2023-04-24 13:44:41 +08:00
f9ebbdf6ea esp_wifi:Enable wpsreg to initialize in APSTA mode 2023-04-24 12:32:47 +08:00
39caffc592 esp_wifi: espnow support using 11ax rate to send frame 2023-04-24 12:32:27 +08:00
ce5444d349 esp_wifi: Bugfix store authmode security in NVS 2023-04-24 12:32:08 +08:00
79dabf50b0 esp_wifi: Install keys after successful transmission of EAPOL 4/4 Message 2023-04-24 12:31:21 +08:00
a4dbb3a0a1 esp_wifi: Update wifi libs
Fix some NAN issues related to followup and matching filters
2023-04-24 12:30:54 +08:00
8438887cb4 esp_wifi: update phy_init_data.h for c6 mcs 8 9 power issue 2023-04-24 12:30:30 +08:00
7a410499f3 esp_wifi: Validate softap interface when sending beacon frame 2023-04-24 12:30:04 +08:00
c020a68e1e Update the ESP-NOW frame length in docs 2023-04-24 12:29:32 +08:00
55d44e0bee wifi_mesh: fix the heap corrupt issue in MTXON task 2023-04-24 12:29:19 +08:00
5736694dbc Merge branch 'bugfix/adds_iram_attr_for_some_esp_timer_apis_v5.1' into 'release/v5.1'
esp_timer: Adds IRAM_ATTR for esp_timer_restart and esp_timer_is_active (v5.1)

See merge request espressif/esp-idf!23309
2023-04-24 11:48:02 +08:00
6102cfdd27 sdmmc: in/out phase adapted to esp32 and esp32s3 2023-04-24 03:45:29 +00:00
5b18007d92 sdmmc: I/O phase adjustments
1. Fix incorrect meaning of SDMMC.clock bits, synchronize the names
   with the TRM.
2. Choose input and output phases to satisfy typical timing
   requirements.
3. Move use_hold_reg setting into the host driver, since it is related
   to timing.

Closes https://github.com/espressif/esp-idf/issues/8521
Related to https://github.com/espressif/esp-idf/issues/8257
2023-04-24 03:45:29 +00:00
bead0d741b sdmmc: add an example communicating with eMMC chip on S3 2023-04-24 03:45:29 +00:00
a218144f4c esp_mm: removed empty kconfig files
- MMU configuration related kconfig options will be in soc, or
esp_hw_support
- Cache configuration related kconfig options will be in soc, or
esp_hw_support
- mmap driver and msync driver kconfig options will be still in esp_mm.
As there's no kconfig options for them yet, removed kconfig files
2023-04-24 03:45:00 +00:00
46fe70fb46 freertos: Add unit tests for ...WithCaps() functions 2023-04-24 11:44:46 +08:00
c5fe3ec05d freertos: Add wrapper functions to create objects with capabilities
This commit adds various ...WithCaps() functions to create FreeRTOS objects
with specific memory capabilities.
2023-04-24 11:44:46 +08:00
3562cb8051 freertos: Add GetStaticBuffer functions
This commit adds the various ...GetStaticBuffer() functions from upstream
FreeRTOS. See https://github.com/FreeRTOS/FreeRTOS-Kernel/pull/641 for more
details.
2023-04-24 11:44:46 +08:00
7b41d6004a freertos: Fix idf_additions.h include order error
When building for CONFIG_FREERTOS_SMP, "idf_additions.h" was previously
implicitly included by "task.h" so that other ESP-IDF components still have
access to IDF API additions without needing to include "idf_additions.h"
directly.

However, some FreeRTOS headers (e.g., queue.h) will include task.h before
declaring any types (e.g., QueueHandle_t). Thus if any of those types are used
in idf_additions.h, we get a missing type error.

This commit moves the implicity include of idf_additions.h to FreeRTOS.h
2023-04-24 11:44:46 +08:00
5c88e0d801 bootloader: enable super WDT and BOD reset on C2 2023-04-24 11:32:23 +08:00
c6559a9b64 bootloader: cleanup ana reset config code 2023-04-24 11:32:23 +08:00
ca3d871a21 bootloader: fixed super watchdog not enabled issue on C3, S3, H4 2023-04-24 11:32:23 +08:00
113e4dc520 bootloader: removed unavailable rtc features 2023-04-24 11:32:23 +08:00
80315b77a0 bootloader: fix analog reset on C6 and H2 2023-04-24 11:32:23 +08:00
aeabe8d742 Merge branch 'feature/hfp_ag_hints_v5.1' into 'release/v5.1'
tools: Update idf-py hints with Bluedroid HFP AG info[backport 5.1]

See merge request espressif/esp-idf!23289
2023-04-24 10:42:24 +08:00
1644050652 Merge branch 'bugfix/fix_some_ble_bug_v5.1' into 'release/v5.1'
Fixed some BLE bugs (backport v5.1)

See merge request espressif/esp-idf!23324
2023-04-24 10:41:59 +08:00
a12e124410 Merge branch 'bugfix/bt_diable_enbale_crash_v5.1' into 'release/v5.1'
bt:Fixed esp32 controller bug (v5.1)

See merge request espressif/esp-idf!23365
2023-04-24 10:39:58 +08:00
36d6a927d1 Merge branch 'bugfix/fix_some_esp32c3_s3_ble_bugs_230422' into 'release/v5.1'
Fixed some ESP32C3/S3 BLE bugs 23-04-22(backport v5.1)

See merge request espressif/esp-idf!23353
2023-04-24 10:38:34 +08:00
cje
93eeb4265c fix chip broken bug when run in monitor mode of S2 and modify voltage param to fit all sleep mode of S2/C2/C3 2023-04-24 10:37:57 +08:00
f608431421 Merge branch 'bugfix/spi_lcd_max_trans_size_v5.1' into 'release/v5.1'
spi_lcd: maximum transfer size should respect bus configuration (v5.1)

See merge request espressif/esp-idf!23229
2023-04-24 10:31:51 +08:00
21c536c563 Merge branch 'bugfix/lcd_align_before_cache_write_back_v5.1' into 'release/v5.1'
manually align the color buffer before cache write back (v5.1)

See merge request espressif/esp-idf!23243
2023-04-24 10:28:16 +08:00
de33225c31 riscv: moved some interrupt functions from IRAM to flash
These functions dont need to be in IRAM.
2023-04-24 10:27:31 +08:00
b07a534984 esp-system: move uncessary IRAM functions to flash 2023-04-24 10:27:31 +08:00
b0a1c0d045 Make custom bootloader message match actual output
Fixes the custom bootloader README.md so that the example output matches
what will actually be output by default in the custom bootloader.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2023-04-24 10:25:22 +08:00
73f895217b ci: build all docs if soc_caps.h changed
soc_caps.h is thightly coupled with the docs build. Should build all docs
after changing it to make sure nothing broke.
2023-04-24 10:18:11 +08:00
0fb6316888 Merge branch 'bugfix/rmt_encode_state_init_v5.1' into 'release/v5.1'
rmt: define RMT_ENCODING_RESET in rmt_encode_state_t (v5.1)

See merge request espressif/esp-idf!23239
2023-04-24 10:18:08 +08:00
be8727cf88 Merge branch 'bugfix/i2s_fix_intr_flag_for_pdm_rx_v5.1' into 'release/v5.1'
i2s: fix interrupt flag of pdm rx mode (v5.1)

See merge request espressif/esp-idf!23125
2023-04-24 10:13:41 +08:00
8b0860ef95 ulp-riscv: enable ULP-RISCV ADC example for esp32s2
ADC can now be used from the ULP-RISCV on S2 after the RTC power parameters were
fixed in a624d8d061

Closes https://github.com/espressif/esp-idf/issues/11052
Closes https://github.com/espressif/esp-idf/issues/11040
2023-04-24 10:12:00 +08:00
6bb4dc35ab docs: update CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM docs to better reflect the limitations 2023-04-24 09:55:00 +08:00
34fea0d38f system: add kconfig option for using parts of SRAM1 for IRAM
Using parts of SRAM1 for IRAM allows apps with more statically allocated IRAM

Closes https://github.com/espressif/esp-idf/issues/9824
2023-04-24 09:54:47 +08:00
a6b1ebce31 Merge branch 'maint/release_v5.1_codeowners' into 'release/v5.1'
gitlab: simplify approvals for backports (v5.1)

See merge request espressif/esp-idf!23285
2023-04-24 05:19:37 +08:00
b5357e8b01 bt:Fixed esp32 controller bug
1. Fixed crash after controller disable and re-enable
2. Fixed the crash caused by processing the HCI_Read_Remote_Extented_Features command in the non-connected state

Closes https://github.com/espressif/esp-idf/issues/11164
Closes https://github.com/espressif/esp-idf/issues/10835
2023-04-23 20:26:56 +08:00
59666637bc Disable controller 5.0 feature bits if host 5.0 feature is not enabled 2023-04-22 20:49:30 +08:00
zwj
48c5f74cbc improve scan performance when scan and sync coexist on ESP32-C3 and ESP32-S3 2023-04-22 20:49:10 +08:00
8e41186ac8 Update bt lib for ESP32-C3 and ESP32-S3
- Fixed non-connectable and non-scannable directed adv can't be scanned
2023-04-22 20:48:38 +08:00
49718b20a5 bug(idf_monitor): fix color on windows with hints
Closes https://github.com/espressif/esp-idf/issues/9610
2023-04-21 14:42:26 +02:00
f1a2bc777e usb_host: Use up-to-date syntax in pytest 2023-04-21 15:45:42 +08:00
0ed6610212 feat(esptool): allow to set force for write_flash 2023-04-21 09:36:18 +02:00
51405fd9d4 bt: Remove FreeRTOS static allocation from OSI functions
Previously, the BT OSI would use various FreeRTOS "create static" functions to
ensure that semaphores and queues were always allocated to internal memory.
However, from commit e21ab0332b onwards, all
dynamic memory allocated by FreeRTOS will default to internal RAM.

Thus, the extra "create static" calls can be removed to simply the code.
2023-04-21 15:19:29 +08:00
71786a7413 usb_host: Update docs and comments regarding first configuration enumeration
This commit updates some comments and documentation regarding changes made in
PR https://github.com/espressif/esp-idf/pull/11113.
2023-04-21 12:49:18 +08:00
4102628a3b Fix usb enumeration stage error for some device 2023-04-21 12:49:18 +08:00
d0011b778a bluedroid: report status after clearing the BLE white list 2023-04-20 18:58:38 +08:00
c2fe7be50e bluedroid: fix GATTC cache address save 2023-04-20 18:57:23 +08:00
13e3480f03 docs: migrated documentetation from github.io to docs.espressif.com 2023-04-20 13:38:16 +04:00
024e201097 esp_timer: Adds IRAM_ATTR for esp_timer_restart and esp_timer_is_active
Closes https://github.com/espressif/esp-idf/issues/10522
Closes https://github.com/espressif/esp-idf/issues/10859
2023-04-20 15:14:52 +08:00
62467fbca5 tools: Update idf-py hints with Bluedroid HFP AG info 2023-04-19 19:10:00 +08:00
84f81437a3 gitlab: simplify approvals for backports (v5.1) 2023-04-19 12:19:55 +02:00
c00759ad34 lcd: test send color buffers in multiple steps 2023-04-18 10:08:38 +08:00
472cc06f6c i80_lcd: align before cache sync 2023-04-18 10:08:38 +08:00
b5572b1db0 rmt: define RMT_ENCODING_RESET in rmt_encode_state_t
Closes https://github.com/espressif/esp-idf/issues/11200
2023-04-17 21:28:45 +08:00
2b461df8a8 spi_lcd: test spi lcd io can transfer color data to a fixed window region
also test the io tx_param and tx_color can skip the command phase
2023-04-17 16:25:14 +08:00
7a716377a3 spi_lcd: maximum transfer size should respect bus configuration
Also this commit added the SPI_TRANS_CS_KEEP_ACTIVE flag for io_tx_color
2023-04-17 16:25:14 +08:00
965e9abd7b i2s: fixed the test case I2S_thread_concurrent_safety_test 2023-04-10 15:29:22 +08:00
a47169f450 i2s: fix interrupt flag of pdm rx mode
Forgot to update in PR https://github.com/espressif/esp-idf/pull/10997
2023-04-10 15:29:22 +08:00
2574 changed files with 74623 additions and 146465 deletions

View File

@ -2,214 +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
/.github/workflows/ @esp-idf-codeowners/ci
/.gitlab-ci.yml @esp-idf-codeowners/ci
/.gitlab/ci/ @esp-idf-codeowners/ci
/.gitlab/dangerjs/ @esp-idf-codeowners/ci @esp-idf-codeowners/tools
/.pre-commit-config.yaml @esp-idf-codeowners/ci
/.readthedocs.yml @esp-idf-codeowners/docs
/CMakeLists.txt @esp-idf-codeowners/build-config
/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/tools
/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_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154
/components/esp_common/ @esp-idf-codeowners/system
/components/esp_eth/ @esp-idf-codeowners/network
/components/esp_event/ @esp-idf-codeowners/system
/components/esp_gdbstub/ @esp-idf-codeowners/tools
/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_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_wifi/ @esp-idf-codeowners/wifi
/components/espcoredump/ @esp-idf-codeowners/tools
/components/esptool_py/ @esp-idf-codeowners/tools
/components/fatfs/ @esp-idf-codeowners/storage
/components/fatfs/**/*.py @esp-idf-codeowners/tools
/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/tools
/components/nvs_flash/ @esp-idf-codeowners/storage
/components/openthread/ @esp-idf-codeowners/ieee802154
/components/partition_table/ @esp-idf-codeowners/system
/components/perfmon/ @esp-idf-codeowners/tools
/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-reference/bluetooth/ @esp-idf-codeowners/bluetooth
/docs/**/api-reference/network/ @esp-idf-codeowners/network
/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
/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/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/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/esp_prov/ @esp-idf-codeowners/app-utilities
/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/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/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/tools/test_apps/security/ @esp-idf-codeowners/security
/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/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

@ -215,14 +215,6 @@ build_pytest_examples_esp32c2:
IDF_TARGET: esp32c2
TEST_DIR: examples
build_pytest_examples_esp32h4:
extends:
- .build_pytest_no_jtag_template
- .rules:build:example_test-esp32h4
variables:
IDF_TARGET: esp32h4
TEST_DIR: examples
build_pytest_examples_jtag: # for all targets
extends:
- .build_pytest_jtag_template
@ -244,6 +236,7 @@ build_pytest_examples_esp32h2:
extends:
- .build_pytest_template
- .rules:build:example_test-esp32h2
parallel: 2
variables:
IDF_TARGET: esp32h2
TEST_DIR: examples
@ -410,7 +403,7 @@ build_only_tools_test_apps:
extends:
- .build_cmake_template
- .rules:build:custom_test
parallel: 9
parallel: 8
script:
# CI specific options start from "--collect-size-info xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py tools/test_apps -v
@ -644,24 +637,16 @@ build_examples_cmake_esp32c3:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32c3
parallel: 6
parallel: 8
variables:
IDF_TARGET: esp32c3
TEST_DIR: examples
build_examples_cmake_esp32h4:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32h4
variables:
IDF_TARGET: esp32h4
TEST_DIR: examples
build_examples_cmake_esp32c6:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32c6
parallel: 6
parallel: 10
variables:
IDF_TARGET: esp32c6
TEST_DIR: examples
@ -670,7 +655,7 @@ build_examples_cmake_esp32h2:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32h2
parallel: 2
parallel: 6
variables:
IDF_TARGET: esp32h2
TEST_DIR: examples
@ -729,13 +714,6 @@ build_clang_test_apps_esp32c6:
variables:
IDF_TARGET: esp32c6
build_clang_test_apps_esp32h4:
extends:
- .build_clang_test_apps_riscv
- .rules:build:custom_test-esp32h4
variables:
IDF_TARGET: esp32h4
.test_build_system_template:
stage: host_test
extends:

View File

@ -3,7 +3,6 @@
- esp32s2
- esp32s3
- esp32c3
- esp32h4
- esp32c2
- esp32c6
- esp32h2
@ -133,13 +132,15 @@ build:integration_test:
- *target_test
- *all_targets
- - bt # example_test_005
- wifi # example_test_002, example_test*wifi*
- ethernet # example_test*ethernet*
- sdio # component_ut_pytest_esp32_sdio
- wifi # pytest*wifi*
- ethernet # pytest*ethernet*
- sdio # pytest*sdio*
- usb # USB Device & Host tests
- adc # component_ut_pytest_esp32x_adc
- adc # pytest*adc*
- i154
- flash_multi
- ecdsa
- ccs811 # pytest*ccs811*
patterns:
- "{0}-{1}-{2}"
- "{0}-{2}"
@ -213,31 +214,10 @@ build:integration_test:
#################################
# Triggered Only By Labels Jobs #
#################################
"labels:iperf_stress_test": # example_test
labels:
- iperf_stress_test
included_in:
- build:example_test
- build:example_test-esp32
- build:target_test
"labels:weekend_test": # custom test
labels:
- weekend_test
included_in:
- build:custom_test
- build:custom_test-esp32
- build:target_test
"labels:nvs_coverage": # host_test
labels:
- nvs_coverage
"labels:fuzzer_test-weekend_test": # host test
labels:
- fuzzer_test
- weekend_test
"labels-protected:lan8720": # UT # FIXME: IDFCI-1176 temporary run this on master/release or with label
labels:
- lan8720

View File

@ -3,6 +3,7 @@
- "docs/**/*"
- "**/*.rst"
- "CONTRIBUTING.rst"
- "**/soc_caps.h"
.patterns-docs-partial: &patterns-docs-partial
- "components/**/*.h"
@ -43,6 +44,9 @@
.doc-rules:build:docs-partial:
rules:
- <<: *if-dev-push
changes: *patterns-docs-full
when: never
- <<: *if-dev-push
changes: *patterns-docs-partial

View File

@ -185,30 +185,6 @@ test_efuse_table_on_host_esp32c6:
variables:
IDF_TARGET: esp32c6
test_efuse_table_on_host_esp32h4:
extends: .test_efuse_table_on_host_template
variables:
IDF_TARGET: esp32h4
test_espcoredump:
extends: .host_test_template
artifacts:
when: always
paths:
- components/espcoredump/test/**/.coverage
- components/espcoredump/test/**/output
expire_in: 1 week
variables:
IDF_COREDUMP_ELF_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/idf/idf-coredump-elf.git"
IDF_COREDUMP_ELF_TAG: idf-20220928
# install CMake version specified in tools.json
SETUP_TOOLS_LIST: "all"
script:
- eval $($IDF_PATH/tools/idf_tools.py export)
- retry_failed git clone ${IDF_COREDUMP_ELF_REPO} -b $IDF_COREDUMP_ELF_TAG
- cd ${IDF_PATH}/components/espcoredump/test/
- ./test_espcoredump.sh ${CI_PROJECT_DIR}/idf-coredump-elf
test_logtrace_proc:
extends: .host_test_template
artifacts:
@ -247,6 +223,14 @@ test_mkuf2:
- cd ${IDF_PATH}/tools/test_mkuf2
- ./test_mkuf2.py
test_sbom:
extends:
- .host_test_template
- .rules:patterns:sbom
script:
- cd ${IDF_PATH}/tools/test_sbom
- pytest
test_autocomplete:
extends:
- .host_test_template

View File

@ -54,9 +54,10 @@
- "tools/ci/ci_build_apps.py"
- "tools/test_build_system/**/*"
.patterns-custom_test: &patterns-custom_test
- "components/espcoredump/**/*"
.patterns-sbom: &patterns-sbom
- "tools/test_sbom/*"
.patterns-custom_test: &patterns-custom_test
- "tools/ci/python_packages/gitlab_api.py"
- "tools/ci/python_packages/tiny_test_fw/**/*"
- "tools/ci/python_packages/ttfw_idf/**/*"
@ -246,6 +247,7 @@
- "components/driver/include/driver/sdio*.h"
- "components/driver/include/driver/sdmmc*.h"
- "components/sdmmc/**/*"
- "examples/peripherals/sdio/**/*"
# for jobs: component_ut_pytest_sdio related
.patterns-component_ut-sdio: &patterns-component_ut-sdio
@ -259,6 +261,13 @@
- "components/driver/include/driver/sdmmc*.h"
- "components/sdmmc/**/*"
.patterns-example_test-ccs811: &patterns-example_test-ccs811
# components
- "examples/system/console/advanced/components/**/*"
- "components/driver/i2c/**/*"
# tests
- "examples/peripherals/i2c/i2c_tools/**/*"
# for jobs: UT_xx_SDSPI related
.patterns-unit_test-sdio: &patterns-unit_test-sdio
- "components/hal/sdio*.c"
@ -306,6 +315,11 @@
- "components/efuse/**/*"
- "examples/peripherals/adc/**/*"
.patterns-target_test-ecdsa: &patterns-target_test-ecdsa
- "components/hal/**/*"
- "components/efuse/**/*"
- "components/mbedtls/port/ecdsa/*"
##############
# if anchors #
##############
@ -414,6 +428,14 @@
- <<: *if-dev-push
changes: *patterns-sonarqube-files
.rules:patterns:sbom:
rules:
- <<: *if-protected
- <<: *if-dev-push
changes: *patterns-sbom
- <<: *if-dev-push
changes: *patterns-submodule
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# DO NOT place comments or maintain any code from this line
#
@ -447,9 +469,6 @@
.if-label-component_ut_esp32h2: &if-label-component_ut_esp32h2
if: '$BOT_LABEL_COMPONENT_UT_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32h2(?:,[^,\n\r]+)*$/i'
.if-label-component_ut_esp32h4: &if-label-component_ut_esp32h4
if: '$BOT_LABEL_COMPONENT_UT_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32h4(?:,[^,\n\r]+)*$/i'
.if-label-component_ut_esp32s2: &if-label-component_ut_esp32s2
if: '$BOT_LABEL_COMPONENT_UT_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*component_ut_esp32s2(?:,[^,\n\r]+)*$/i'
@ -474,9 +493,6 @@
.if-label-custom_test_esp32h2: &if-label-custom_test_esp32h2
if: '$BOT_LABEL_CUSTOM_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32h2(?:,[^,\n\r]+)*$/i'
.if-label-custom_test_esp32h4: &if-label-custom_test_esp32h4
if: '$BOT_LABEL_CUSTOM_TEST_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32h4(?:,[^,\n\r]+)*$/i'
.if-label-custom_test_esp32s2: &if-label-custom_test_esp32s2
if: '$BOT_LABEL_CUSTOM_TEST_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*custom_test_esp32s2(?:,[^,\n\r]+)*$/i'
@ -504,18 +520,12 @@
.if-label-example_test_esp32h2: &if-label-example_test_esp32h2
if: '$BOT_LABEL_EXAMPLE_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32h2(?:,[^,\n\r]+)*$/i'
.if-label-example_test_esp32h4: &if-label-example_test_esp32h4
if: '$BOT_LABEL_EXAMPLE_TEST_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32h4(?:,[^,\n\r]+)*$/i'
.if-label-example_test_esp32s2: &if-label-example_test_esp32s2
if: '$BOT_LABEL_EXAMPLE_TEST_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32s2(?:,[^,\n\r]+)*$/i'
.if-label-example_test_esp32s3: &if-label-example_test_esp32s3
if: '$BOT_LABEL_EXAMPLE_TEST_ESP32S3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*example_test_esp32s3(?:,[^,\n\r]+)*$/i'
.if-label-fuzzer_test: &if-label-fuzzer_test
if: '$BOT_LABEL_FUZZER_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*fuzzer_test(?:,[^,\n\r]+)*$/i'
.if-label-host_test: &if-label-host_test
if: '$BOT_LABEL_HOST_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*host_test(?:,[^,\n\r]+)*$/i'
@ -528,9 +538,6 @@
.if-label-integration_test_wifi: &if-label-integration_test_wifi
if: '$BOT_LABEL_INTEGRATION_TEST_WIFI || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*integration_test_wifi(?:,[^,\n\r]+)*$/i'
.if-label-iperf_stress_test: &if-label-iperf_stress_test
if: '$BOT_LABEL_IPERF_STRESS_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*iperf_stress_test(?:,[^,\n\r]+)*$/i'
.if-label-lan8720: &if-label-lan8720
if: '$BOT_LABEL_LAN8720 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*lan8720(?:,[^,\n\r]+)*$/i'
@ -567,18 +574,12 @@
.if-label-unit_test_esp32h2: &if-label-unit_test_esp32h2
if: '$BOT_LABEL_UNIT_TEST_ESP32H2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32h2(?:,[^,\n\r]+)*$/i'
.if-label-unit_test_esp32h4: &if-label-unit_test_esp32h4
if: '$BOT_LABEL_UNIT_TEST_ESP32H4 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32h4(?:,[^,\n\r]+)*$/i'
.if-label-unit_test_esp32s2: &if-label-unit_test_esp32s2
if: '$BOT_LABEL_UNIT_TEST_ESP32S2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32s2(?:,[^,\n\r]+)*$/i'
.if-label-unit_test_esp32s3: &if-label-unit_test_esp32s3
if: '$BOT_LABEL_UNIT_TEST_ESP32S3 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*unit_test_esp32s3(?:,[^,\n\r]+)*$/i'
.if-label-weekend_test: &if-label-weekend_test
if: '$BOT_LABEL_WEEKEND_TEST || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*weekend_test(?:,[^,\n\r]+)*$/i'
.if-label-windows: &if-label-windows
if: '$BOT_LABEL_WINDOWS || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*windows(?:,[^,\n\r]+)*$/i'
@ -607,7 +608,6 @@
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32c6
- <<: *if-label-component_ut_esp32h2
- <<: *if-label-component_ut_esp32h4
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-lan8720
@ -618,7 +618,6 @@
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32c6
- <<: *if-label-unit_test_esp32h2
- <<: *if-label-unit_test_esp32h4
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
@ -637,6 +636,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -670,6 +671,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -702,6 +705,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -734,6 +739,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -766,6 +773,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -798,6 +807,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -830,6 +841,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -862,6 +875,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -879,11 +894,9 @@
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32c6
- <<: *if-label-custom_test_esp32h2
- <<: *if-label-custom_test_esp32h4
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-target_test
- <<: *if-label-weekend_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
@ -894,6 +907,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -908,7 +923,6 @@
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-target_test
- <<: *if-label-weekend_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
@ -919,6 +933,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -943,6 +959,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -967,6 +985,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -991,6 +1011,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1016,29 +1038,7 @@
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
changes: *patterns-target_test-wifi
.rules:build:custom_test-esp32h4:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32h4
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-custom_test
- <<: *if-dev-push
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1063,6 +1063,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1087,6 +1089,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1121,10 +1125,8 @@
- <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32c6
- <<: *if-label-example_test_esp32h2
- <<: *if-label-example_test_esp32h4
- <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-label-iperf_stress_test
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
@ -1138,6 +1140,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1150,6 +1154,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1164,7 +1170,6 @@
- <<: *if-label-build
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-iperf_stress_test
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
@ -1178,6 +1183,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1190,6 +1197,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1216,6 +1225,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1228,6 +1239,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1255,6 +1268,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1267,6 +1282,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1293,6 +1310,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1305,6 +1324,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1332,43 +1353,7 @@
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
changes: *patterns-example_test-i154
- <<: *if-dev-push
changes: *patterns-example_test-sdio
- <<: *if-dev-push
changes: *patterns-example_test-usb
- <<: *if-dev-push
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
changes: *patterns-target_test-wifi
.rules:build:example_test-esp32h4:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32h4
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1381,6 +1366,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1407,6 +1394,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1419,6 +1408,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1445,6 +1436,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1457,6 +1450,8 @@
changes: *patterns-example_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1509,7 +1504,6 @@
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-component_ut_esp32c6
- <<: *if-label-component_ut_esp32h2
- <<: *if-label-component_ut_esp32h4
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-custom_test
@ -1518,7 +1512,6 @@
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-custom_test_esp32c6
- <<: *if-label-custom_test_esp32h2
- <<: *if-label-custom_test_esp32h4
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-example_test
@ -1527,13 +1520,11 @@
- <<: *if-label-example_test_esp32c3
- <<: *if-label-example_test_esp32c6
- <<: *if-label-example_test_esp32h2
- <<: *if-label-example_test_esp32h4
- <<: *if-label-example_test_esp32s2
- <<: *if-label-example_test_esp32s3
- <<: *if-label-integration_test
- <<: *if-label-integration_test_ble
- <<: *if-label-integration_test_wifi
- <<: *if-label-iperf_stress_test
- <<: *if-label-lan8720
- <<: *if-label-target_test
- <<: *if-label-unit_test
@ -1542,10 +1533,8 @@
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32c6
- <<: *if-label-unit_test_esp32h2
- <<: *if-label-unit_test_esp32h4
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-label-weekend_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
@ -1568,6 +1557,8 @@
changes: *patterns-example_test
- <<: *if-dev-push
changes: *patterns-example_test-bt
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
- <<: *if-dev-push
changes: *patterns-example_test-ethernet
- <<: *if-dev-push
@ -1584,6 +1575,8 @@
changes: *patterns-integration_test-wifi
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1609,7 +1602,6 @@
- <<: *if-label-unit_test_esp32c3
- <<: *if-label-unit_test_esp32c6
- <<: *if-label-unit_test_esp32h2
- <<: *if-label-unit_test_esp32h4
- <<: *if-label-unit_test_esp32s2
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
@ -1620,6 +1612,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1649,6 +1643,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1677,6 +1673,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1705,6 +1703,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1733,6 +1733,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1761,6 +1763,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1789,6 +1793,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -1817,6 +1823,8 @@
changes: *patterns-downloadable-tools
- <<: *if-dev-push
changes: *patterns-target_test-adc
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
- <<: *if-dev-push
changes: *patterns-target_test-i154
- <<: *if-dev-push
@ -2085,6 +2093,19 @@
- <<: *if-dev-push
changes: *patterns-target_test-adc
.rules:test:component_ut-esp32h2-ecdsa:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32h2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-target_test-ecdsa
.rules:test:component_ut-esp32s2:
rules:
- <<: *if-revert-branch
@ -2338,6 +2359,19 @@
- <<: *if-dev-push
changes: *patterns-example_test-bt
.rules:test:example_test-esp32-ccs811:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-example_test-ccs811
.rules:test:example_test-esp32-ethernet:
rules:
- <<: *if-revert-branch

View File

@ -97,6 +97,22 @@ pytest_examples_esp32_jtag:
SETUP_TOOLS: "1" # need gdb openocd
PYTEST_EXTRA_FLAGS: "--log-cli-level DEBUG"
pytest_examples_esp32_ccs811:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32-ccs811
needs:
- build_pytest_examples_esp32
tags: [ esp32, ccs811 ]
pytest_examples_esp32_sdio:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32-sdio
needs:
- build_pytest_examples_esp32
tags: [ esp32, sdio_master_slave ]
pytest_examples_esp32s2_generic:
extends:
- .pytest_examples_dir_template
@ -249,6 +265,14 @@ pytest_examples_esp32_ethernet:
- build_pytest_examples_esp32
tags: [ esp32, ethernet]
pytest_examples_esp32_ethernet_httpbin:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32-ethernet
needs:
- build_pytest_examples_esp32
tags: [ esp32, httpbin]
pytest_examples_esp32_8mb_flash:
extends:
- .pytest_examples_dir_template
@ -488,6 +512,14 @@ pytest_examples_esp32h2_adc:
- build_pytest_examples_esp32h2
tags: [ esp32h2, adc ]
example_test_pytest_esp32s3_emmc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32s3
needs:
- build_pytest_examples_esp32s3
tags: [ esp32s3, emmc ]
.pytest_components_dir_template:
extends: .pytest_template
variables:
@ -884,6 +916,14 @@ pytest_components_esp32h2_adc:
- build_pytest_components_esp32h2
tags: [ esp32h2, adc ]
component_ut_pytest_esp32h2_ecdsa:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32h2-ecdsa
needs:
- build_pytest_components_esp32h2
tags: [ esp32h2, ecdsa_efuse ]
pytest_components_esp32c6_generic_multi_device:
extends:
- .pytest_components_dir_template
@ -1090,12 +1130,6 @@ example_test_001C:
- ESP32
- Example_GENERIC
.example_test_003:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_SDIO
example_test_005:
extends:
- .example_test_esp32_template
@ -1104,12 +1138,6 @@ example_test_005:
- ESP32
- Example_WIFI_BT
example_test_007:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_I2C_CCS811_SENSOR
example_test_C3_GENERIC:
extends: .example_test_esp32c3_template
tags:
@ -1203,19 +1231,12 @@ UT_006:
- UT_T1_SPIMODE
- psram
UT_017:
.UT_017:
extends: .unit_test_esp32_template
tags:
- ESP32_IDF
- EMMC
UT_022:
extends: .unit_test_esp32_template
tags:
- ESP32_IDF
- UT_T2_I2C
- psram
UT_028:
extends: .unit_test_esp32_template
tags:
@ -1288,12 +1309,6 @@ UT_C3_FLASH:
- ESP32C3_IDF
- UT_T1_ESP_FLASH
UT_C3_I2C:
extends: .unit_test_esp32c3_template
tags:
- ESP32C3_IDF
- UT_T2_I2C
UT_C3_SDSPI:
extends:
- .unit_test_esp32c3_template

53
.gitmodules vendored
View File

@ -2,6 +2,26 @@
# All the relative URL paths are intended to be GitHub ones
# For Espressif's public projects please use '../../espressif/proj', not a '../proj'
#
# Submodules SBOM information
# ---------------------------
# Submodules, which are used directly and not forked into espressif namespace should
# contain SBOM information here. Other submodules should have the SBOM manifest file
# included in the root of their project's repository.
#
# The sbom-hash entry records the submodule's checkout SHA as presented in git-tree
# commit object. For example spiffs submodule
#
# $ git ls-tree HEAD components/spiffs/spiffs
# 160000 commit 0dbb3f71c5f6fae3747a9d935372773762baf852 components/spiffs/spiffs
#
# The hash can be also obtained with git submodule command
#
# $ git submodule status components/spiffs/spiffs
# 0dbb3f71c5f6fae3747a9d935372773762baf852 components/spiffs/spiffs (0.2-255-g0dbb3f71c5f6)
#
# The submodule SHA recorded here has to match with SHA, which is presented in git-tree.
# This is checked by CI. Also please don't forget to update the submodule version
# if you are changing the sbom-hash. This is important for SBOM generation.
[submodule "components/bt/controller/lib_esp32"]
path = components/bt/controller/lib_esp32
@ -10,14 +30,31 @@
[submodule "components/bootloader/subproject/components/micro-ecc/micro-ecc"]
path = components/bootloader/subproject/components/micro-ecc/micro-ecc
url = ../../kmackay/micro-ecc.git
sbom-version = 1.1
sbom-cpe = cpe:2.3:a:micro-ecc_project:micro-ecc:{}:*:*:*:*:*:*:*
sbom-supplier = Person: Ken MacKay
sbom-url = https://github.com/kmackay/micro-ecc
sbom-description = A small and fast ECDH and ECDSA implementation for 8-bit, 32-bit, and 64-bit processors
sbom-hash = 24c60e243580c7868f4334a1ba3123481fe1aa48
[submodule "components/spiffs/spiffs"]
path = components/spiffs/spiffs
url = ../../pellepl/spiffs.git
sbom-version = 0.2-255-g0dbb3f71c5f6
sbom-supplier = Person: Peter Andersson
sbom-url = https://github.com/pellepl/spiffs
sbom-description = Wear-leveled SPI flash file system for embedded devices
sbom-hash = 0dbb3f71c5f6fae3747a9d935372773762baf852
[submodule "components/json/cJSON"]
path = components/json/cJSON
url = ../../DaveGamble/cJSON.git
sbom-version = 1.7.16
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 = cb8693b058ba302f4829ec6d03f609ac6f848546
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls
@ -34,10 +71,21 @@
[submodule "components/protobuf-c/protobuf-c"]
path = components/protobuf-c/protobuf-c
url = ../../protobuf-c/protobuf-c.git
sbom-version = 1.4.1
sbom-cpe = cpe:2.3:a:protobuf-c_project:protobuf-c:{}:*:*:*:*:*:*:*
sbom-supplier = Organization: protobuf-c community <https://groups.google.com/g/protobuf-c>
sbom-url = https://github.com/protobuf-c/protobuf-c
sbom-description = Protocol Buffers implementation in C
sbom-hash = abc67a11c6db271bedbb9f58be85d6f4e2ea8389
[submodule "components/unity/unity"]
path = components/unity/unity
url = ../../ThrowTheSwitch/Unity.git
sbom-version = v2.4.3-51-g7d2bf62b7e6a
sbom-supplier = Organization: ThrowTheSwitch community <http://www.throwtheswitch.org>
sbom-url = https://github.com/ThrowTheSwitch/Unity
sbom-description = Simple Unit Testing for C
sbom-hash = 7d2bf62b7e6afaf38153041a9d53c21aeeca9a25
[submodule "components/bt/host/nimble/nimble"]
path = components/bt/host/nimble/nimble
@ -50,6 +98,11 @@
[submodule "components/cmock/CMock"]
path = components/cmock/CMock
url = ../../ThrowTheSwitch/CMock.git
sbom-version = v2.5.2-2-geeecc49ce8af
sbom-supplier = Organization: ThrowTheSwitch community <http://www.throwtheswitch.org>
sbom-url = https://github.com/ThrowTheSwitch/CMock
sbom-description = CMock - Mock/stub generator for C
sbom-hash = eeecc49ce8af123cf8ad40efdb9673e37b56230f
[submodule "components/openthread/openthread"]
path = components/openthread/openthread

View File

@ -139,7 +139,8 @@ repos:
name: Check if all apps readme files match given .build-test-rules.yml files. Modify the supported target tables
entry: tools/ci/check_build_test_rules.py check-readmes
language: python
files: 'tools/test_apps/.+|examples/.+|components/.+'
files: 'tools/test_apps/.+|examples/.+|components/.+|tools/idf_py_actions/constants.py|tools/ci/check_build_test_rules.py'
require_serial: true
additional_dependencies:
- PyYAML == 5.3.1
- idf_build_apps
@ -157,7 +158,7 @@ repos:
- id: file-contents-sorter
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt|check_copyright_ignore\.txt)'
- repo: https://github.com/espressif/check-copyright/
rev: v1.0.1
rev: v1.0.3
hooks:
- id: check-copyright
args: ['--ignore', 'tools/ci/check_copyright_ignore.txt', '--config', 'tools/ci/check_copyright_config.yaml']

24
Kconfig
View File

@ -66,28 +66,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
config IDF_TARGET_ESP32H4
bool
default "y" if IDF_TARGET="esp32h4"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
choice IDF_TARGET_ESP32H4_BETA_VERSION
prompt "ESP32-H4 beta version"
depends on IDF_TARGET_ESP32H4
default IDF_TARGET_ESP32H4_BETA_VERSION_2
help
Currently ESP32-H4 has several beta versions for internal use only.
Select the one that matches your chip model.
config IDF_TARGET_ESP32H4_BETA_VERSION_1
bool
prompt "ESP32-H4 beta1"
config IDF_TARGET_ESP32H4_BETA_VERSION_2
bool
prompt "ESP32-H4 beta2"
endchoice
config IDF_TARGET_ESP32C2
bool
default "y" if IDF_TARGET="esp32c2"
@ -116,10 +94,8 @@ mainmenu "Espressif IoT Development Framework Configuration"
default 0x0002 if IDF_TARGET_ESP32S2
default 0x0005 if IDF_TARGET_ESP32C3
default 0x0009 if IDF_TARGET_ESP32S3
default 0x000A if IDF_TARGET_ESP32H4_BETA_VERSION_1
default 0x000C if IDF_TARGET_ESP32C2
default 0x000D if IDF_TARGET_ESP32C6
default 0x000E if IDF_TARGET_ESP32H4_BETA_VERSION_2 # ESP32-TODO: IDF-3475
default 0x0010 if IDF_TARGET_ESP32H2
default 0xFFFF

View File

@ -389,4 +389,11 @@ menu "Application Level Tracing"
help
Enables support for GCOV data transfer to host.
config APPTRACE_GCOV_DUMP_TASK_STACK_SIZE
int "Gcov dump task stack size"
depends on APPTRACE_GCOV_ENABLE
default 2048
help
Configures stack size of Gcov dump task
endmenu

View File

@ -76,7 +76,8 @@ gcov_exit:
void gcov_create_task(void *arg)
{
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", 2048, (void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", CONFIG_APPTRACE_GCOV_DUMP_TASK_STACK_SIZE,
(void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
}
void gcov_create_task_tick_hook(void)

View File

@ -8,7 +8,7 @@
#define HEAP_TRACE_SRCFILE /* don't warn on inclusion here */
#include "esp_heap_trace.h"
#undef HEAP_TRACE_SRCFILE
#include "esp_heap_caps.h"
#if CONFIG_APPTRACE_SV_ENABLE
#include "esp_app_trace.h"
#include "esp_sysview_trace.h"
@ -85,7 +85,7 @@ void heap_trace_dump_caps(__attribute__((unused)) const uint32_t caps)
}
/* Add a new allocation to the heap trace records */
static IRAM_ATTR void record_allocation(const heap_trace_record_t *record)
static HEAP_IRAM_ATTR void record_allocation(const heap_trace_record_t *record)
{
if (!s_tracing) {
return;
@ -100,7 +100,7 @@ static IRAM_ATTR void record_allocation(const heap_trace_record_t *record)
For HEAP_TRACE_ALL, this means filling in the freed_by pointer.
For HEAP_TRACE_LEAKS, this means removing the record from the log.
*/
static IRAM_ATTR void record_free(void *p, void **callers)
static HEAP_IRAM_ATTR void record_free(void *p, void **callers)
{
if (!s_tracing) {
return;

View File

@ -37,8 +37,6 @@
#include "esp32c3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32H4
#include "esp32h4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C2
#include "esp32c2/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C6

View File

@ -334,7 +334,7 @@ typedef enum {
/**
* @brief Revokes the old signature digest. To be called in the application after the rollback logic.
*
* Relevant for Secure boot v2 on ESP32-S2, ESP32-S3, ESP32-C3, ESP32-H4 where upto 3 key digests can be stored (Key \#N-1, Key \#N, Key \#N+1).
* Relevant for Secure boot v2 on ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6, ESP32-H2 where upto 3 key digests can be stored (Key \#N-1, Key \#N, Key \#N+1).
* When key \#N-1 used to sign an app is invalidated, an OTA update is to be sent with an app signed with key \#N-1 & Key \#N.
* After successfully booting the OTA app should call this function to revoke Key \#N-1.
*

View File

@ -704,14 +704,12 @@ menu "Security features"
config SECURE_BOOT_VERIFICATION_KEY
string "Secure boot public signature verification key"
depends on SECURE_SIGNED_APPS && !SECURE_BOOT_BUILD_SIGNED_BINARIES && !SECURE_SIGNED_APPS_RSA_SCHEME
depends on SECURE_SIGNED_APPS && SECURE_SIGNED_APPS_ECDSA_SCHEME && !SECURE_BOOT_BUILD_SIGNED_BINARIES
default "signature_verification_key.bin"
help
Path to a public key file used to verify signed images.
Secure Boot V1: This ECDSA public key is compiled into the bootloader and/or
app, to verify app images.
Secure Boot V2: This RSA public key is compiled into the signature block at
the end of the bootloader/app.
Key file is in raw binary format, and can be extracted from a
PEM formatted private key using the espsecure.py

View File

@ -148,5 +148,5 @@ endif()
#
# So for now we just have the top-level build remove the final build products...
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
ADDITIONAL_CLEAN_FILES
${bootloader_binary_files})

View File

@ -25,7 +25,7 @@ MEMORY
*/
iram_seg (RWX) : org = 0x40080400, len = 0xfc00
/* 64k at the end of DRAM, after ROM bootloader stack */
dram_seg (RW) : org = 0x3FFF0000, len = 0x10000
dram_seg (RW) : org = 0x3FFF0000, len = 0x6000
}
/* Default entry point: */

View File

@ -1,9 +0,0 @@
PROVIDE ( ets_update_cpu_frequency = 0x40008550 ); /* Updates g_ticks_per_us on the current CPU only; not on the other core */
PROVIDE ( MD5Final = 0x4005db1c );
PROVIDE ( MD5Init = 0x4005da7c );
PROVIDE ( MD5Update = 0x4005da9c );
/* bootloader will use following functions from xtensa hal library */
xthal_get_ccount = 0x4000c050;
xthal_get_ccompare = 0x4000c078;
xthal_set_ccompare = 0x4000c058;

View File

@ -1,240 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/** Simplified memory map for the bootloader.
* Make sure the bootloader can load into main memory without overwriting itself.
*
* ESP32-H4 ROM static data usage is as follows:
* - 0x3fccb900 - 0x3fcdd210: Shared buffers, used in UART/USB/SPI download mode only
* - 0x3fcdd210 - 0x3fcdf210: PRO CPU stack, can be reclaimed as heap after RTOS startup
* - 0x3fcdf210 - 0x3fce0000: ROM .bss and .data (not easily reclaimable)
*
* The 2nd stage bootloader can take space up to the end of ROM shared
* buffers area (0x3fce9704). For alignment purpose we shall use value (0x3fce9700).
*/
/* The offset between Dbus and Ibus. Used to convert between 0x403xxxxx and 0x3fcxxxxx addresses. */
iram_dram_offset = 0x700000;
/* We consider 0x3fce9700 to be the last usable address for 2nd stage bootloader stack overhead, dram_seg,
* and work out iram_seg and iram_loader_seg addresses from there, backwards.
*/
/* These lengths can be adjusted, if necessary: */
bootloader_usable_dram_end = 0x3fcdd120;
bootloader_stack_overhead = 0x2000; /* For safety margin between bootloader data section and startup stacks */
bootloader_dram_seg_len = 0x5000;
bootloader_iram_loader_seg_len = 0x7000;
bootloader_iram_seg_len = 0x2000;
/* Start of the lower region is determined by region size and the end of the higher region */
bootloader_dram_seg_end = bootloader_usable_dram_end - bootloader_stack_overhead;
bootloader_dram_seg_start = bootloader_dram_seg_end - bootloader_dram_seg_len;
bootloader_iram_loader_seg_start = bootloader_dram_seg_start - bootloader_iram_loader_seg_len + iram_dram_offset;
bootloader_iram_seg_start = bootloader_iram_loader_seg_start - bootloader_iram_seg_len;
MEMORY
{
iram_seg (RWX) : org = bootloader_iram_seg_start, len = bootloader_iram_seg_len
iram_loader_seg (RWX) : org = bootloader_iram_loader_seg_start, len = bootloader_iram_loader_seg_len
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
}
/* Default entry point: */
ENTRY(call_start_cpu0);
SECTIONS
{
.iram_loader.text :
{
. = ALIGN (16);
_loader_text_start = ABSOLUTE(.);
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
*liblog.a:(.literal .text .literal.* .text.*)
*libgcc.a:(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_common_loader.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_flash.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_random.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_disable .text.bootloader_random_disable)
*libbootloader_support.a:bootloader_random*.*(.literal.bootloader_random_enable .text.bootloader_random_enable)
*libbootloader_support.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_utility.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_sha.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_console_loader.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_panic.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:bootloader_soc.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:esp_image_format.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:flash_encrypt.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:flash_partitions.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:secure_boot.*(.literal .text .literal.* .text.*)
*libbootloader_support.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
*libmicro-ecc.a:*.*(.literal .text .literal.* .text.*)
*libspi_flash.a:*.*(.literal .text .literal.* .text.*)
*libhal.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
*libhal.a:mmu_hal.*(.literal .text .literal.* .text.*)
*libhal.a:cache_hal.*(.literal .text .literal.* .text.*)
*libhal.a:efuse_hal.*(.literal .text .literal.* .text.*)
*libesp_hw_support.a:rtc_clk.*(.literal .text .literal.* .text.*)
*libesp_hw_support.a:rtc_time.*(.literal .text .literal.* .text.*)
*libesp_hw_support.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
*libefuse.a:*.*(.literal .text .literal.* .text.*)
*(.fini.literal)
*(.fini)
*(.gnu.version)
_loader_text_end = ABSOLUTE(.);
} > iram_loader_seg
.iram.text :
{
. = ALIGN (16);
*(.entry.text)
*(.init.literal)
*(.init)
} > iram_seg
/* Shared RAM */
.dram0.bss (NOLOAD) :
{
. = ALIGN (8);
_dram_start = ABSOLUTE(.);
_bss_start = ABSOLUTE(.);
*(.dynsbss)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
*(.dynbss)
*(.bss)
*(.bss.*)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN (8);
_bss_end = ABSOLUTE(.);
} > dram_seg
.dram0.data :
{
_data_start = ABSOLUTE(.);
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
*(.data1)
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.gnu.linkonce.s2.*)
*(.jcr)
_data_end = ABSOLUTE(.);
} > dram_seg
.dram0.rodata :
{
_rodata_start = ABSOLUTE(.);
*(.rodata)
*(.rodata.*)
*(.gnu.linkonce.r.*)
*(.rodata1)
*(.sdata2 .sdata2.* .srodata .srodata.*)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* C++ constructor and destructor tables, properly ordered: */
__init_array_start = ABSOLUTE(.);
KEEP (*crtbegin.*(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.*) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__init_array_end = ABSOLUTE(.);
KEEP (*crtbegin.*(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.*) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
/* C++ exception handlers table: */
__XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
*(.xt_except_desc)
*(.gnu.linkonce.h.*)
__XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
*(.xt_except_desc_end)
*(.dynamic)
*(.gnu.version_d)
_rodata_end = ABSOLUTE(.);
/* Literals are also RO data. */
_lit4_start = ABSOLUTE(.);
*(*.lit4)
*(.lit4.*)
*(.gnu.linkonce.lit4.*)
_lit4_end = ABSOLUTE(.);
. = ALIGN(4);
_dram_end = ABSOLUTE(.);
} > dram_seg
.iram.text :
{
_stext = .;
_text_start = ABSOLUTE(.);
*(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.iram .iram.*) /* catch stray IRAM_ATTR */
*(.fini.literal)
*(.fini)
*(.gnu.version)
/** CPU will try to prefetch up to 16 bytes of
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
* safe access to up to 16 bytes after the last real instruction, add
* dummy bytes to ensure this
*/
. += 16;
_text_end = ABSOLUTE(.);
_etext = .;
} > iram_seg
}
/**
* Appendix: Memory Usage of ROM bootloader
*
* 0x3fccb81c ------------------> _dram0_0_start
* | |
* | |
* | | 1. Large buffers that are only used in certain boot modes, see shared_buffers.h
* | |
* | |
* 0x3fcdd120 ------------------> __stack_sentry
* | |
* | | 2. Startup pro cpu stack (freed when IDF app is running)
* | |
* 0x3fcdf120 ------------------> __stack (pro cpu)
* | |
* | |
* | | 3. Shared memory only used in startup code or nonos/early boot*
* | | (can be freed when IDF runs)
* | |
* | |
* 0x3fcdfa6c ------------------> _dram0_rtos_reserved_start
* | |
* | |
* | | 4. Shared memory used in startup code and when IDF runs
* | |
* | |
* 0x3fcdfe40 ------------------> _dram0_rtos_reserved_end
* | |
* 0x3fcdfe4c ------------------> _data_start_interface
* | |
* | | 5. End of DRAM is the 'interface' data with constant addresses (ECO compatible)
* | |
* 0x3fce0000 ------------------> _data_end_interface
*/

View File

@ -1,6 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/* No definition for ESP32-H4 target */

View File

@ -1,13 +0,0 @@
/*
* ESP32S2 ROM address table
* Generated for ROM with MD5sum: 0a2c7ec5109c17884606d23b47045796
*/
PROVIDE (ets_update_cpu_frequency = 0x4000d8a4);
PROVIDE (MD5Final = 0x4000530c);
PROVIDE (MD5Init = 0x4000526c);
PROVIDE (MD5Update = 0x4000528c);
/* bootloader will use following functions from xtensa hal library */
xthal_get_ccount = 0x4001aa90;
xthal_get_ccompare = 0x4001aabc;
xthal_set_ccompare = 0x4001aa98;

View File

@ -1,6 +0,0 @@
/**
* ESP32S3 ROM address table
* Generated for ROM with MD5sum: d20fb231463ce337432b1fa9cba0b3c9
*/
PROVIDE ( ets_update_cpu_frequency = 0x40043164 );

View File

@ -5,7 +5,3 @@ components/bootloader_support/test_apps/rtc_custom_section:
- if: IDF_TARGET == "esp32c2"
temporary: false
reason: esp32c2 does not have RTC memory
disable_test:
- if: IDF_TARGET == "esp32h2"
temporary: true
reason: target esp32h2 is not supported yet

View File

@ -164,7 +164,7 @@ if(CONFIG_SECURE_SIGNED_APPS AND (CONFIG_SECURE_BOOT_V1_ENABLED OR CONFIG_SECURE
target_add_binary_data(${COMPONENT_LIB} "${secure_boot_verification_key}" "BINARY"
RENAME_TO signature_verification_key_bin)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
APPEND PROPERTY ADDITIONAL_CLEAN_FILES
"${secure_boot_verification_key}")
endif()

View File

@ -120,6 +120,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
#include "esp32/rom/cache.h"
#endif
#include "esp_rom_spiflash.h"
#include "esp_rom_sys.h"
#include "hal/mmu_hal.h"
#include "hal/mmu_ll.h"
#include "hal/cache_hal.h"

View File

@ -200,6 +200,12 @@ esp_err_t bootloader_init_spi_flash(void)
bootloader_enable_qio_mode();
#endif
// Since the workaround in IDF-6709, the spi_speed value in the bootloader header
// is not the real value, overwrite it.
#if CONFIG_ESPTOOLPY_FLASHFREQ_80M
bootloader_image_hdr.spi_speed = ESP_IMAGE_SPI_SPEED_DIV_1;
#endif
print_flash_info(&bootloader_image_hdr);
update_flash_config(&bootloader_image_hdr);
//ensure the flash is write-protected

View File

@ -1,250 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include <assert.h>
#include "string.h"
#include "sdkconfig.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_rom_gpio.h"
#include "esp_rom_efuse.h"
#include "esp32h4/rom/gpio.h"
#include "esp32h4/rom/spi_flash.h"
#include "esp32h4/rom/efuse.h"
#include "soc/gpio_periph.h"
#include "soc/efuse_reg.h"
#include "soc/spi_reg.h"
#include "soc/spi_mem_reg.h"
#include "soc/soc_caps.h"
#include "flash_qio_mode.h"
#include "bootloader_flash_config.h"
#include "bootloader_common.h"
#include "bootloader_flash_priv.h"
#include "bootloader_init.h"
#include "hal/mmu_hal.h"
#include "hal/cache_hal.h"
#include "hal/mmu_ll.h"
#define FLASH_IO_MATRIX_DUMMY_40M 0
#define FLASH_IO_MATRIX_DUMMY_80M 0
void bootloader_flash_update_id()
{
esp_rom_spiflash_chip_t *chip = &rom_spiflash_legacy_data->chip;
chip->device_id = bootloader_read_flash_id();
}
void IRAM_ATTR bootloader_flash_cs_timing_config()
{
SET_PERI_REG_MASK(SPI_MEM_USER_REG(0), SPI_MEM_CS_HOLD_M | SPI_MEM_CS_SETUP_M);
SET_PERI_REG_BITS(SPI_MEM_CTRL2_REG(0), SPI_MEM_CS_HOLD_TIME_V, 0, SPI_MEM_CS_HOLD_TIME_S);
SET_PERI_REG_BITS(SPI_MEM_CTRL2_REG(0), SPI_MEM_CS_SETUP_TIME_V, 0, SPI_MEM_CS_SETUP_TIME_S);
SET_PERI_REG_MASK(SPI_MEM_USER_REG(1), SPI_MEM_CS_HOLD_M | SPI_MEM_CS_SETUP_M);
SET_PERI_REG_BITS(SPI_MEM_CTRL2_REG(1), SPI_MEM_CS_HOLD_TIME_V, 1, SPI_MEM_CS_HOLD_TIME_S);
SET_PERI_REG_BITS(SPI_MEM_CTRL2_REG(1), SPI_MEM_CS_SETUP_TIME_V, 0, SPI_MEM_CS_SETUP_TIME_S);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
{
uint32_t spi_clk_div = 0;
switch (pfhdr->spi_speed) {
case ESP_IMAGE_SPI_SPEED_DIV_1:
spi_clk_div = 1;
break;
case ESP_IMAGE_SPI_SPEED_DIV_2:
spi_clk_div = 2;
break;
case ESP_IMAGE_SPI_SPEED_DIV_3:
spi_clk_div = 3;
break;
case ESP_IMAGE_SPI_SPEED_DIV_4:
spi_clk_div = 4;
break;
default:
break;
}
esp_rom_spiflash_config_clk(spi_clk_div, 0);
}
void IRAM_ATTR bootloader_flash_set_dummy_out(void)
{
REG_SET_BIT(SPI_MEM_CTRL_REG(0), SPI_MEM_FDUMMY_OUT | SPI_MEM_D_POL | SPI_MEM_Q_POL);
REG_SET_BIT(SPI_MEM_CTRL_REG(1), SPI_MEM_FDUMMY_OUT | SPI_MEM_D_POL | SPI_MEM_Q_POL);
}
void IRAM_ATTR bootloader_flash_dummy_config(const esp_image_header_t *pfhdr)
{
bootloader_configure_spi_pins(1);
bootloader_flash_set_dummy_out();
}
static const char *TAG = "boot.esp32h4";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
if (spiconfig == 0) {
} else {
clk_gpio_num = spiconfig & 0x3f;
q_gpio_num = (spiconfig >> 6) & 0x3f;
d_gpio_num = (spiconfig >> 12) & 0x3f;
cs0_gpio_num = (spiconfig >> 18) & 0x3f;
hd_gpio_num = (spiconfig >> 24) & 0x3f;
wp_gpio_num = wp_pin;
}
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);
esp_rom_gpio_pad_set_drv(cs0_gpio_num, drv);
if (hd_gpio_num <= MAX_PAD_GPIO_NUM) {
esp_rom_gpio_pad_set_drv(hd_gpio_num, drv);
}
if (wp_gpio_num <= MAX_PAD_GPIO_NUM) {
esp_rom_gpio_pad_set_drv(wp_gpio_num, drv);
}
}
static void update_flash_config(const esp_image_header_t *bootloader_hdr)
{
uint32_t size;
switch (bootloader_hdr->spi_size) {
case ESP_IMAGE_FLASH_SIZE_1MB:
size = 1;
break;
case ESP_IMAGE_FLASH_SIZE_2MB:
size = 2;
break;
case ESP_IMAGE_FLASH_SIZE_4MB:
size = 4;
break;
case ESP_IMAGE_FLASH_SIZE_8MB:
size = 8;
break;
case ESP_IMAGE_FLASH_SIZE_16MB:
size = 16;
break;
default:
size = 2;
}
cache_hal_disable(CACHE_TYPE_ALL);
// Set flash chip size
esp_rom_spiflash_config_param(rom_spiflash_legacy_data->chip.device_id, size * 0x100000, 0x10000, 0x1000, 0x100, 0xffff); // TODO: set mode
cache_hal_enable(CACHE_TYPE_ALL);
}
static void print_flash_info(const esp_image_header_t *bootloader_hdr)
{
ESP_EARLY_LOGD(TAG, "magic %02x", bootloader_hdr->magic);
ESP_EARLY_LOGD(TAG, "segments %02x", bootloader_hdr->segment_count);
ESP_EARLY_LOGD(TAG, "spi_mode %02x", bootloader_hdr->spi_mode);
ESP_EARLY_LOGD(TAG, "spi_speed %02x", bootloader_hdr->spi_speed);
ESP_EARLY_LOGD(TAG, "spi_size %02x", bootloader_hdr->spi_size);
const char *str;
switch (bootloader_hdr->spi_speed) {
case ESP_IMAGE_SPI_SPEED_DIV_2:
str = "24MHz";
break;
case ESP_IMAGE_SPI_SPEED_DIV_3:
str = "16MHz";
break;
case ESP_IMAGE_SPI_SPEED_DIV_4:
str = "12MHz";
break;
case ESP_IMAGE_SPI_SPEED_DIV_1:
str = "48MHz";
break;
default:
str = "12MHz";
break;
}
ESP_EARLY_LOGI(TAG, "SPI Speed : %s", str);
/* SPI mode could have been set to QIO during boot already,
so test the SPI registers not the flash header */
uint32_t spi_ctrl = REG_READ(SPI_MEM_CTRL_REG(0));
if (spi_ctrl & SPI_MEM_FREAD_QIO) {
str = "QIO";
} else if (spi_ctrl & SPI_MEM_FREAD_QUAD) {
str = "QOUT";
} else if (spi_ctrl & SPI_MEM_FREAD_DIO) {
str = "DIO";
} else if (spi_ctrl & SPI_MEM_FREAD_DUAL) {
str = "DOUT";
} else if (spi_ctrl & SPI_MEM_FASTRD_MODE) {
str = "FAST READ";
} else {
str = "SLOW READ";
}
ESP_EARLY_LOGI(TAG, "SPI Mode : %s", str);
switch (bootloader_hdr->spi_size) {
case ESP_IMAGE_FLASH_SIZE_1MB:
str = "1MB";
break;
case ESP_IMAGE_FLASH_SIZE_2MB:
str = "2MB";
break;
case ESP_IMAGE_FLASH_SIZE_4MB:
str = "4MB";
break;
case ESP_IMAGE_FLASH_SIZE_8MB:
str = "8MB";
break;
case ESP_IMAGE_FLASH_SIZE_16MB:
str = "16MB";
break;
default:
str = "2MB";
break;
}
ESP_EARLY_LOGI(TAG, "SPI Flash Size : %s", str);
}
static void IRAM_ATTR bootloader_init_flash_configure(void)
{
bootloader_flash_dummy_config(&bootloader_image_hdr);
bootloader_flash_cs_timing_config();
}
static void bootloader_spi_flash_resume(void)
{
bootloader_execute_flash_command(CMD_RESUME, 0, 0, 0);
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
}
esp_err_t bootloader_init_spi_flash(void)
{
bootloader_init_flash_configure();
#ifndef CONFIG_SPI_FLASH_ROM_DRIVER_PATCH
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
if (spiconfig != ESP_ROM_EFUSE_FLASH_DEFAULT_SPI && spiconfig != ESP_ROM_EFUSE_FLASH_DEFAULT_HSPI) {
ESP_EARLY_LOGE(TAG, "SPI flash pins are overridden. Enable CONFIG_SPI_FLASH_ROM_DRIVER_PATCH in menuconfig");
return ESP_FAIL;
}
#endif
bootloader_spi_flash_resume();
bootloader_flash_unlock();
#if CONFIG_ESPTOOLPY_FLASHMODE_QIO || CONFIG_ESPTOOLPY_FLASHMODE_QOUT
bootloader_enable_qio_mode();
#endif
print_flash_info(&bootloader_image_hdr);
update_flash_config(&bootloader_image_hdr);
//ensure the flash is write-protected
bootloader_enable_wp();
return ESP_OK;
}

View File

@ -18,12 +18,8 @@ typedef enum {
ESP_CHIP_ID_ESP32C3 = 0x0005, /*!< chip ID: ESP32-C3 */
ESP_CHIP_ID_ESP32S3 = 0x0009, /*!< chip ID: ESP32-S3 */
ESP_CHIP_ID_ESP32C2 = 0x000C, /*!< chip ID: ESP32-C2 */
#if CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_2
ESP_CHIP_ID_ESP32H4 = 0x000E, /*!< chip ID: ESP32-H4 Beta2*/ // ESP32H4-TODO: IDF-3475
#elif CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_1
ESP_CHIP_ID_ESP32H4 = 0x000A, /*!< chip ID: ESP32-H4 Beta1 */
#endif
ESP_CHIP_ID_ESP32C6 = 0x000D, /*!< chip ID: ESP32-C6 */
ESP_CHIP_ID_ESP32H2 = 0x0010, /*!< chip ID: ESP32-H2 */
ESP_CHIP_ID_INVALID = 0xFFFF /*!< Invalid chip ID (we defined it to make sure the esp_chip_id_t is 2 bytes size) */
} __attribute__((packed)) esp_chip_id_t;

View File

@ -17,8 +17,6 @@
#include "esp32c3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32H4
#include "esp32h4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C2
#include "esp32c2/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C6

View File

@ -45,7 +45,7 @@ int bootloader_utility_get_selected_boot_partition(const bootloader_state_t *bs)
* @param[in] bs Bootloader state structure.
* @param[in] start_index The index from which the search for images begins.
*/
__attribute__((noreturn)) void bootloader_utility_load_boot_image(const bootloader_state_t *bs, int start_index);
__attribute__((__noreturn__)) void bootloader_utility_load_boot_image(const bootloader_state_t *bs, int start_index);
#ifdef CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP
/**
@ -65,7 +65,7 @@ void bootloader_utility_load_boot_image_from_deep_sleep(void);
*
* It is not recommended to call this function from an app (if called, the app will abort).
*/
__attribute__((noreturn)) void bootloader_reset(void);
__attribute__((__noreturn__)) void bootloader_reset(void);
/**
* @brief Do any cleanup before exiting the bootloader, before starting the app or resetting

View File

@ -121,22 +121,6 @@ int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata,
#if CONFIG_BOOTLOADER_RESERVE_RTC_MEM
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
_Static_assert(RTC_RETAIN_MEM_ADDR >= SOC_RTC_DRAM_LOW, "rtc_retain_mem_t structure size is bigger than the RTC memory size. Consider reducing RTC reserved memory size.");
rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
#ifndef BOOTLOADER_BUILD
#include "heap_memory_layout.h"
/* The app needs to be told this memory is reserved, important if configured to use RTC memory as heap.
Note that keeping this macro here only works when other symbols in this file are referenced by the app, as
this feature is otherwise 100% part of the bootloader. However this seems to happen in all apps.
*/
SOC_RESERVE_MEMORY_REGION(RTC_RETAIN_MEM_ADDR, RTC_RETAIN_MEM_ADDR + sizeof(rtc_retain_mem_t), rtc_retain_mem);
#endif
static uint32_t rtc_retain_mem_size(void) {
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
/* A custom memory has been reserved by the user, do not consider this memory into CRC calculation as it may change without
@ -144,29 +128,31 @@ static uint32_t rtc_retain_mem_size(void) {
* minus the size of everything after (including) `custom` */
return offsetof(rtc_retain_mem_t, custom);
#else
return sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc);
return sizeof(rtc_retain_mem_t) - sizeof(bootloader_common_get_rtc_retain_mem()->crc);
#endif
}
static bool is_retain_mem_valid(void)
{
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
return esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size()) == rtc_retain_mem->crc && rtc_retain_mem->crc != UINT32_MAX;
}
static void update_rtc_retain_mem_crc(void)
{
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size());
}
NOINLINE_ATTR void bootloader_common_reset_rtc_retain_mem(void)
{
hal_memset(rtc_retain_mem, 0, sizeof(rtc_retain_mem_t));
hal_memset(bootloader_common_get_rtc_retain_mem(), 0, sizeof(rtc_retain_mem_t));
}
uint16_t bootloader_common_get_rtc_retain_mem_reboot_counter(void)
{
if (is_retain_mem_valid()) {
return rtc_retain_mem->reboot_counter;
return bootloader_common_get_rtc_retain_mem()->reboot_counter;
}
return 0;
}
@ -176,12 +162,13 @@ void bootloader_common_set_rtc_retain_mem_factory_reset_state(void)
if (!is_retain_mem_valid()) {
bootloader_common_reset_rtc_retain_mem();
}
rtc_retain_mem->flags.factory_reset_state = true;
bootloader_common_get_rtc_retain_mem()->flags.factory_reset_state = true;
update_rtc_retain_mem_crc();
}
bool bootloader_common_get_rtc_retain_mem_factory_reset_state(void)
{
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
if (is_retain_mem_valid()) {
bool factory_reset_state = rtc_retain_mem->flags.factory_reset_state;
if (factory_reset_state == true) {
@ -196,13 +183,14 @@ bool bootloader_common_get_rtc_retain_mem_factory_reset_state(void)
esp_partition_pos_t* bootloader_common_get_rtc_retain_mem_partition(void)
{
if (is_retain_mem_valid()) {
return &rtc_retain_mem->partition;
return &bootloader_common_get_rtc_retain_mem()->partition;
}
return NULL;
}
void bootloader_common_update_rtc_retain_mem(esp_partition_pos_t* partition, bool reboot_counter)
{
rtc_retain_mem_t* rtc_retain_mem = bootloader_common_get_rtc_retain_mem();
if (reboot_counter) {
if (!is_retain_mem_valid()) {
bootloader_common_reset_rtc_retain_mem();
@ -224,7 +212,14 @@ void bootloader_common_update_rtc_retain_mem(esp_partition_pos_t* partition, boo
rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
{
return rtc_retain_mem;
#ifdef BOOTLOADER_BUILD
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
return s_bootloader_retain_mem;
#else
static __attribute__((section(".bootloader_data_rtc_mem"))) rtc_retain_mem_t s_bootloader_retain_mem;
return &s_bootloader_retain_mem;
#endif // !BOOTLOADER_BUILD
}
#endif // CONFIG_BOOTLOADER_RESERVE_RTC_MEM

View File

@ -27,9 +27,6 @@ int bootloader_clock_get_rated_freq_mhz(void)
#elif CONFIG_IDF_TARGET_ESP32C3
return 160;
#elif CONFIG_IDF_TARGET_ESP32H4
return 96;
#elif CONFIG_IDF_TARGET_ESP32C6
return 160;

View File

@ -8,6 +8,10 @@
#include "esp_cpu.h"
#include "soc/wdev_reg.h"
#if SOC_LP_TIMER_SUPPORTED
#include "hal/lp_timer_hal.h"
#endif
#ifndef BOOTLOADER_BUILD
#include "esp_random.h"
#include "esp_private/periph_ctrl.h"
@ -20,9 +24,14 @@
#else
#if !defined CONFIG_IDF_TARGET_ESP32S3
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 32 * 2) /* extra factor of 2 is precautionary */
#if (defined CONFIG_IDF_TARGET_ESP32C6 || defined CONFIG_IDF_TARGET_ESP32H2)
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 16) // Keep the byte sampling frequency in the ~62KHz range which has been
// tested.
#else
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 32 * 2) /* extra factor of 2 is precautionary */
#endif
#else
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 23) /* 45 KHz reading frequency is the maximum we have tested so far on S3 */
#define RNG_CPU_WAIT_CYCLE_NUM (80 * 23) /* 45 KHz reading frequency is the maximum we have tested so far on S3 */
#endif
__attribute__((weak)) void bootloader_fill_random(void *buffer, size_t length)
@ -34,6 +43,21 @@
assert(buffer != NULL);
for (size_t i = 0; i < length; i++) {
#if SOC_LP_TIMER_SUPPORTED
random = REG_READ(WDEV_RND_REG);
start = esp_cpu_get_cycle_count();
do {
random ^= REG_READ(WDEV_RND_REG);
now = esp_cpu_get_cycle_count();
} while (now - start < RNG_CPU_WAIT_CYCLE_NUM);
// XOR the RT slow clock, which is asynchronous, to add some entropy and improve
// the distribution
uint32_t current_rtc_timer_counter = (lp_timer_hal_get_cycle_count() & 0xFF);
random = random ^ current_rtc_timer_counter;
buffer_bytes[i] = random & 0xFF;
#else
if (i == 0 || i % 4 == 0) { /* redundant check is for a compiler warning */
/* in bootloader with ADC feeding HWRNG, we accumulate 1
bit of entropy per 40 APB cycles (==80 CPU cycles.)
@ -50,6 +74,7 @@
} while (now - start < RNG_CPU_WAIT_CYCLE_NUM);
}
buffer_bytes[i] = random >> ((i % 4) * 8);
#endif
}
}

View File

@ -1,22 +1,99 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/soc.h"
#include "soc/pcr_reg.h"
#include "soc/apb_saradc_reg.h"
#include "soc/pmu_reg.h"
#include "hal/regi2c_ctrl.h"
#include "soc/regi2c_saradc.h"
#include "esp_log.h"
static const char *TAG = "bootloader_random";
static const uint32_t SAR2_CHANNEL = 9;
static const uint32_t PATTERN_BIT_WIDTH = 6;
static const uint32_t SAR1_ATTEN = 1;
static const uint32_t SAR2_ATTEN = 1;
void bootloader_random_enable(void)
{
// TODO: IDF-5352
ESP_EARLY_LOGW(TAG, "bootloader_random_enable() has not been implemented yet");
// pull SAR ADC out of reset
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
// enable SAR ADC APB clock
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_CLK_EN);
// enable ADC_CTRL_CLK (SAR ADC function clock)
REG_SET_BIT(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_EN);
// select XTAL clock (40 MHz) source for ADC_CTRL_CLK
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_SEL, 0);
// set the clock divider for ADC_CTRL_CLK to default value (in case it has been changed)
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_DIV_NUM, 0);
// some ADC sensor registers are in power group PERIF_I2C and need to be enabled via PMU
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
// Config ADC circuit (Analog part) with I2C(HOST ID 0x69) and chose internal voltage as sampling source
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR , 2);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR , 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x66);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0x08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0x66);
// 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_table = 0 | (pattern_two << 3 * PATTERN_BIT_WIDTH) | pattern_one << 2 * PATTERN_BIT_WIDTH;
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, pattern_table);
// set pattern length to 2 (APB_SARADC_SAR_PATT_LEN counts from 0)
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_PATT_LEN, 1);
// Same as in C3
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_CLK_DIV, 15);
// set timer expiry (timer is ADC_CTRL_CLK)
REG_SET_FIELD(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_TARGET, 200);
// enable timer
REG_SET_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
}
void bootloader_random_disable(void)
{
// TODO: IDF-5352
ESP_EARLY_LOGW(TAG, "bootloader_random_enable() has not been implemented yet");
// disable timer
REG_CLR_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
// Write reset value of this register
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, 0xFFFFFF);
// Revert ADC I2C configuration and initial voltage source setting
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR, 0);
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);
// Set PCR_SARADC_CONF_REG to initial state
REG_WRITE(PCR_SARADC_CONF_REG, 0x5);
}

View File

@ -1,21 +1,88 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/soc.h"
#include "soc/pcr_reg.h"
#include "soc/apb_saradc_reg.h"
#include "soc/pmu_reg.h"
#include "hal/regi2c_ctrl.h"
#include "soc/regi2c_saradc.h"
#include "esp_log.h"
static const char *TAG = "bootloader_random";
static const uint32_t SAR2_CHANNEL = 9;
static const uint32_t PATTERN_BIT_WIDTH = 6;
static const uint32_t SAR1_ATTEN = 1;
static const uint32_t SAR2_ATTEN = 1;
void bootloader_random_enable(void)
{
// ESP32H2-TODO: IDF-6274
ESP_EARLY_LOGW(TAG, "bootloader_random_enable() has not been implemented yet");
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_CLK_EN);
REG_SET_BIT(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_EN);
// select XTAL clock (40 MHz) source for ADC_CTRL_CLK
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_SEL, 0);
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_DIV_NUM, 0);
// some ADC sensor registers are in power group PERIF_I2C and need to be enabled via PMU
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_DTEST, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_ENT_SAR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_EN_TOUT_SAR1_BUS, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR2_INIT_CODE_MSB, 0X08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR2_INIT_CODE_LSB, 0X66);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR1_INIT_CODE_MSB, 0X08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR1_INIT_CODE_LSB, 0X66);
// create patterns and set them in pattern table
uint32_t pattern_one = (SAR2_CHANNEL << 2) | SAR2_ATTEN;
uint32_t pattern_two = SAR1_ATTEN; // we want channel 0 with max attenuation, channel doesn't really matter here
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);
// set pattern length to 2 (APB_SARADC_SAR_PATT_LEN counts from 0)
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_PATT_LEN, 0);
// Same as in C3
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_CLK_DIV, 15);
// set timer expiry (timer is ADC_CTRL_CLK)
REG_SET_FIELD(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_TARGET, 200);
// ENABLE_TIMER
REG_SET_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
}
void bootloader_random_disable(void)
{
// ESP32H2-TODO: IDF-6274
ESP_EARLY_LOGW(TAG, "bootloader_random_disable() has not been implemented yet");
// disable timer
REG_CLR_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
// Write reset value of this register
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, 0xFFFFFF);
// Revert ADC I2C configuration and initial voltage source setting
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR2_INIT_CODE_MSB, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR2_INIT_CODE_LSB, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR1_INIT_CODE_MSB, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_SAR1_INIT_CODE_LSB, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_DTEST, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_ENT_SAR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SARADC_EN_TOUT_SAR1_BUS, 0);
// disable ADC_CTRL_CLK (SAR ADC function clock)
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);
// Set PCR_SARADC_CONF_REG to initial state
REG_WRITE(PCR_SARADC_CONF_REG, 0x5);
}

View File

@ -1,24 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "esp_log.h"
#include "soc/syscon_reg.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/apb_saradc_reg.h"
#include "soc/system_reg.h"
#include "esp_private/regi2c_ctrl.h"
// ESP32H4-TODO: IDF-3381
void bootloader_random_enable(void)
{
}
void bootloader_random_disable(void)
{
}

View File

@ -28,12 +28,6 @@
#include "esp32c3/rom/uart.h"
#include "esp32c3/rom/gpio.h"
#include "esp32c3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32H4
#include "esp32h4/rom/efuse.h"
#include "esp32h4/rom/crc.h"
#include "esp32h4/rom/uart.h"
#include "esp32h4/rom/gpio.h"
#include "esp32h4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C2
#include "esp32c2/rom/efuse.h"
#include "esp32c2/rom/crc.h"

View File

@ -3,18 +3,10 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
void bootloader_ana_super_wdt_reset_config(bool enable)
{
(void)enable;
}
void bootloader_ana_bod_reset_config(bool enable)
{
(void)enable;
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
(void)enable;

View File

@ -34,6 +34,7 @@
#include "bootloader_mem.h"
#include "bootloader_console.h"
#include "bootloader_flash_priv.h"
#include "bootloader_soc.h"
#include "esp_private/bootloader_flash_internal.h"
#include "esp_efuse.h"
#include "hal/mmu_hal.h"
@ -78,10 +79,19 @@ static void bootloader_super_wdt_auto_feed(void)
REG_WRITE(RTC_CNTL_SWD_WPROTECT_REG, 0);
}
static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
}
esp_err_t bootloader_init(void)
{
esp_err_t ret = ESP_OK;
bootloader_ana_reset_config();
bootloader_super_wdt_auto_feed();
// In RAM_APP, memory will be initialized in `call_start_cpu0`

View File

@ -3,19 +3,34 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "soc/rtc_cntl_reg.h"
void bootloader_ana_super_wdt_reset_config(bool enable)
{
(void)enable; // ESP32-C2 has none of these features.
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_SUPER_WDT_RST);
if (enable) {
REG_CLR_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
} else {
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
(void)enable; // ESP32-C2 has none of these features.
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
} else {
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
(void)enable; // ESP32-C2 has none of these features.
(void)enable;
}

View File

@ -96,29 +96,29 @@ static inline void bootloader_hardware_init(void)
static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
/*
For origin chip & ECO1: only support swt reset;
For ECO2: fix brownout reset bug, support swt & brownout reset;
For ECO3: fix clock glitch reset bug, support all reset, include: swt & brownout & clock glitch reset.
For origin chip & ECO1: brownout & clock glitch reset not available
For ECO2: fix brownout reset bug
For ECO3: fix clock glitch reset bug
*/
switch (efuse_hal_chip_revision()) {
case 0:
case 1:
//Enable WDT reset. Disable BOR and GLITCH reset
bootloader_ana_super_wdt_reset_config(true);
//Disable BOD and GLITCH reset
bootloader_ana_bod_reset_config(false);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 2:
//Enable WDT and BOR reset. Disable GLITCH reset
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset. Disable GLITCH reset
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 3:
default:
//Enable WDT, BOR, and GLITCH reset
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD, and GLITCH reset
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(true);
break;

View File

@ -12,15 +12,15 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_SUPER_WDT_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
} else {
REG_CLR_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
} else {
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOR_RST);
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);

View File

@ -103,33 +103,10 @@ static inline void bootloader_hardware_init(void)
static inline void bootloader_ana_reset_config(void)
{
// TODO: IDF-5990 copied from C3, need update
// Have removed bootloader_ana_super_wdt_reset_config for now; can be evaluated later to see whether needs to add it back
/*
For origin chip & ECO1: only support swt reset;
For ECO2: fix brownout reset bug, support swt & brownout reset;
For ECO3: fix clock glitch reset bug, support all reset, include: swt & brownout & clock glitch reset.
*/
uint8_t chip_version = efuse_hal_get_minor_chip_version();
switch (chip_version) {
case 0:
case 1:
//Disable BOR and GLITCH reset
bootloader_ana_bod_reset_config(false);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 2:
//Enable BOR reset. Disable GLITCH reset
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 3:
default:
//Enable BOR, and GLITCH reset
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(true);
break;
}
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
}
esp_err_t bootloader_init(void)

View File

@ -1,15 +1,24 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include <assert.h>
#include "soc/soc.h"
#include "soc/lp_analog_peri_reg.h"
void bootloader_ana_super_wdt_reset_config(bool enable)
{
//C6 doesn't support bypass super WDT reset
assert(enable);
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOR_RST);
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
} else {
@ -17,12 +26,8 @@ void bootloader_ana_bod_reset_config(bool enable)
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_GLITCH_RST);
if (enable) {
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_CK_GLITCH_CNTL_REG, LP_ANALOG_PERI_LP_ANA_CK_GLITCH_RESET_ENA);
} else {
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_CK_GLITCH_CNTL_REG, LP_ANALOG_PERI_LP_ANA_CK_GLITCH_RESET_ENA);
}
(void)enable;
}

View File

@ -86,40 +86,16 @@ static void bootloader_super_wdt_auto_feed(void)
static inline void bootloader_hardware_init(void)
{
// TODO: IDF-6267
/* Enable analog i2c master clock */
SET_PERI_REG_MASK(MODEM_LPCON_CLK_CONF_REG, MODEM_LPCON_CLK_I2C_MST_EN);
}
static inline void bootloader_ana_reset_config(void)
{
// TODO: IDF-5990 copied from C6, need update
// Have removed bootloader_ana_super_wdt_reset_config for now; can be evaluated later to see whether needs to add it back
/*
For origin chip & ECO1: only support swt reset;
For ECO2: fix brownout reset bug, support swt & brownout reset;
For ECO3: fix clock glitch reset bug, support all reset, include: swt & brownout & clock glitch reset.
*/
uint8_t chip_version = efuse_hal_get_minor_chip_version();
switch (chip_version) {
case 0:
case 1:
//Disable BOR and GLITCH reset
bootloader_ana_bod_reset_config(false);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 2:
//Enable BOR reset. Disable GLITCH reset
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 3:
default:
//Enable BOR, and GLITCH reset
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(true);
break;
}
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
}
esp_err_t bootloader_init(void)

View File

@ -1,20 +1,22 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "soc/soc.h"
#include "soc/lp_analog_peri_reg.h"
void bootloader_ana_super_wdt_reset_config(bool enable)
{
// ESP32H2 has removed the super wdt
//H2 doesn't support bypass super WDT reset
assert(enable);
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOR_RST);
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
} else {
@ -22,12 +24,8 @@ void bootloader_ana_bod_reset_config(bool enable)
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_GLITCH_RST);
if (enable) {
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_CK_GLITCH_CNTL_REG, LP_ANALOG_PERI_LP_ANA_CK_GLITCH_RESET_ENA);
} else {
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_CK_GLITCH_CNTL_REG, LP_ANALOG_PERI_LP_ANA_CK_GLITCH_RESET_ENA);
}
(void)enable;
}

View File

@ -1,155 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include "sdkconfig.h"
#include "esp_attr.h"
#include "esp_log.h"
#include "esp_image_format.h"
#include "flash_qio_mode.h"
#include "esp_rom_gpio.h"
#include "esp_rom_efuse.h"
#include "esp_rom_uart.h"
#include "esp_rom_sys.h"
#include "esp_rom_spiflash.h"
#include "soc/efuse_reg.h"
#include "soc/gpio_sig_map.h"
#include "soc/io_mux_reg.h"
#include "soc/assist_debug_reg.h"
#include "esp_cpu.h"
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/spi_periph.h"
#include "soc/extmem_reg.h"
#include "soc/io_mux_reg.h"
#include "soc/system_reg.h"
#include "esp32h4/rom/efuse.h"
#include "esp32h4/rom/ets_sys.h"
#include "bootloader_common.h"
#include "bootloader_init.h"
#include "bootloader_clock.h"
#include "bootloader_flash_config.h"
#include "bootloader_mem.h"
#include "bootloader_console.h"
#include "bootloader_flash_priv.h"
#include "bootloader_soc.h"
#include "esp_private/bootloader_flash_internal.h"
#include "hal/mmu_hal.h"
#include "hal/cache_hal.h"
static const char *TAG = "boot.esp32h4";
static void wdt_reset_cpu0_info_enable(void)
{
REG_SET_BIT(SYSTEM_CPU_PERI_CLK_EN_REG, SYSTEM_CLK_EN_ASSIST_DEBUG);
REG_CLR_BIT(SYSTEM_CPU_PERI_RST_EN_REG, SYSTEM_RST_EN_ASSIST_DEBUG);
REG_WRITE(ASSIST_DEBUG_CORE_0_RCD_EN_REG, ASSIST_DEBUG_CORE_0_RCD_PDEBUGEN | ASSIST_DEBUG_CORE_0_RCD_RECORDEN);
}
static void wdt_reset_info_dump(int cpu)
{
(void) cpu;
// saved PC was already printed by the ROM bootloader.
// nothing to do here.
}
static void bootloader_check_wdt_reset(void)
{
int wdt_rst = 0;
soc_reset_reason_t rst_reason = esp_rom_get_reset_reason(0);
if (rst_reason == RESET_REASON_CORE_RTC_WDT || rst_reason == RESET_REASON_CORE_MWDT0 || rst_reason == RESET_REASON_CORE_MWDT1 ||
rst_reason == RESET_REASON_CPU0_MWDT0 || rst_reason == RESET_REASON_CPU0_MWDT1 || rst_reason == RESET_REASON_CPU0_RTC_WDT) {
ESP_LOGW(TAG, "PRO CPU has been reset by WDT.");
wdt_rst = 1;
}
if (wdt_rst) {
// if reset by WDT dump info from trace port
wdt_reset_info_dump(0);
}
wdt_reset_cpu0_info_enable();
}
static void bootloader_super_wdt_auto_feed(void)
{
REG_WRITE(RTC_CNTL_SWD_WPROTECT_REG, RTC_CNTL_SWD_WKEY_VALUE);
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_AUTO_FEED_EN);
REG_WRITE(RTC_CNTL_SWD_WPROTECT_REG, 0);
}
static inline void bootloader_hardware_init(void)
{
}
static inline void bootloader_ana_reset_config(void)
{
//Enable WDT, BOR, and GLITCH reset
bootloader_ana_super_wdt_reset_config(true);
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(true);
}
esp_err_t bootloader_init(void)
{
esp_err_t ret = ESP_OK;
bootloader_hardware_init();
bootloader_ana_reset_config();
bootloader_super_wdt_auto_feed();
// In RAM_APP, memory will be initialized in `call_start_cpu0`
#if !CONFIG_APP_BUILD_TYPE_RAM
// protect memory region
bootloader_init_mem();
/* check that static RAM is after the stack */
assert(&_bss_start <= &_bss_end);
assert(&_data_start <= &_data_end);
// clear bss section
bootloader_clear_bss_section();
#endif // !CONFIG_APP_BUILD_TYPE_RAM
// config clock
bootloader_clock_configure();
// initialize console, from now on, we can use esp_log
bootloader_console_init();
/* print 2nd bootloader banner */
bootloader_print_banner();
#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
//init cache hal
cache_hal_init(); //TODO IDF-4649
//init mmu
mmu_hal_init();
// update flash ID
bootloader_flash_update_id();
// Check and run XMC startup flow
if ((ret = bootloader_flash_xmc_startup()) != ESP_OK) {
ESP_LOGE(TAG, "failed when running XMC startup flow, reboot!");
return ret;
}
#if !CONFIG_APP_BUILD_TYPE_RAM
// read bootloader header
if ((ret = bootloader_read_bootloader_header()) != ESP_OK) {
return ret;
}
// read chip revision and check if it's compatible to bootloader
if ((ret = bootloader_check_bootloader_validity()) != ESP_OK) {
return ret;
}
#endif // !CONFIG_APP_BUILD_TYPE_RAM
// initialize spi flash
if ((ret = bootloader_init_spi_flash()) != ESP_OK) {
return ret;
}
#endif // #if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
// check whether a WDT reset happend
bootloader_check_wdt_reset();
// config WDT
bootloader_config_wdt();
// enable RNG early entropy source
bootloader_enable_random();
return ret;
}

View File

@ -1,40 +0,0 @@
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "bootloader_sha.h"
#include <stdbool.h>
#include <string.h>
#include <assert.h>
#include <sys/param.h>
#include "esp32h4/rom/sha.h"
static SHA_CTX ctx;
bootloader_sha256_handle_t bootloader_sha256_start()
{
// Enable SHA hardware
ets_sha_enable();
ets_sha_init(&ctx, SHA2_256);
return &ctx; // Meaningless non-NULL value
}
void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data, size_t data_len)
{
assert(handle != NULL);
assert(data_len % 4 == 0);
ets_sha_update(&ctx, data, data_len, false);
}
void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest)
{
assert(handle != NULL);
if (digest == NULL) {
bzero(&ctx, sizeof(ctx));
return;
}
ets_sha_finish(&ctx, digest);
}

View File

@ -1,41 +0,0 @@
/*
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
#include "soc/soc.h"
#include "soc/rtc_cntl_reg.h"
void bootloader_ana_super_wdt_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_SUPER_WDT_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
} else {
REG_CLR_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOR_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
} else {
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
}
}
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_GLITCH_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_GLITCH_RST_EN);
} else {
REG_CLR_BIT(RTC_CNTL_ANA_CONF_REG, RTC_CNTL_GLITCH_RST_EN);
}
}

View File

@ -1,59 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <strings.h>
#include "esp_flash_encrypt.h"
#include "esp_secure_boot.h"
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp_log.h"
#include "sdkconfig.h"
static __attribute__((unused)) const char *TAG = "flash_encrypt";
esp_err_t esp_flash_encryption_enable_secure_features(void)
{
#ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_ENC
ESP_LOGI(TAG, "Disable UART bootloader encryption...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT);
#else
ESP_LOGW(TAG, "Not disabling UART bootloader encryption");
#endif
#ifndef CONFIG_SECURE_FLASH_UART_BOOTLOADER_ALLOW_CACHE
ESP_LOGI(TAG, "Disable UART bootloader cache...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DOWNLOAD_ICACHE);
#else
ESP_LOGW(TAG, "Not disabling UART bootloader cache - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
ESP_LOGI(TAG, "Disable JTAG...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_USB_JTAG);
#else
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#if defined(CONFIG_SECURE_BOOT_V2_ENABLED) && !defined(CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS)
// This bit is set when enabling Secure Boot V2, but we can't enable it until this later point in the first boot
// otherwise the Flash Encryption key cannot be read protected
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
#endif
#ifndef CONFIG_SECURE_FLASH_SKIP_WRITE_PROTECTION_CACHE
// Set write-protection for DIS_ICACHE to prevent bricking chip in case it will be set accidentally.
// esp32h4 has DIS_ICACHE. Write-protection bit = 2.
// List of eFuses with the same write protection bit:
// DIS_ICACHE, DIS_USB_JTAG, POWERGLITCH_EN, DIS_FORCE_DOWNLOAD, SPI_DOWNLOAD_MSPI_DIS,
// DIS_TWAI, JTAG_SEL_ENABLE, DIS_PAD_JTAG, DIS_DOWNLOAD_MANUAL_ENCRYPT
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_DIS_ICACHE);
#endif
return ESP_OK;
}

View File

@ -1,70 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <strings.h>
#include "esp_flash_encrypt.h"
#include "esp_secure_boot.h"
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp_log.h"
#include "sdkconfig.h"
static __attribute__((unused)) const char *TAG = "secure_boot";
esp_err_t esp_secure_boot_enable_secure_features(void)
{
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
esp_err_t err = esp_efuse_enable_rom_secure_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not enable Security download mode...");
return err;
}
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
ESP_LOGI(TAG, "Disable ROM Download mode...");
esp_err_t err = esp_efuse_disable_rom_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
return err;
}
#else
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_USB_JTAG);
esp_efuse_write_field_cnt(ESP_EFUSE_SOFT_DIS_JTAG, ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count);
#else
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
#endif
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool rd_dis_now = true;
#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
/* If flash encryption is not enabled yet then don't read-disable efuses yet, do it later in the boot
when Flash Encryption is being enabled */
rd_dis_now = esp_flash_encryption_enabled();
#endif
if (rd_dis_now) {
ESP_LOGI(TAG, "Prevent read disabling of additional efuses...");
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
}
#else
ESP_LOGW(TAG, "Allowing read disabling of additional efuses - SECURITY COMPROMISED");
#endif
return ESP_OK;
}

View File

@ -3,18 +3,10 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdbool.h>
void bootloader_ana_super_wdt_reset_config(bool enable)
{
(void)enable;
}
void bootloader_ana_bod_reset_config(bool enable)
{
(void)enable;
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
(void)enable;

View File

@ -130,7 +130,7 @@ static void bootloader_super_wdt_auto_feed(void)
static inline void bootloader_ana_reset_config(void)
{
//Enable WDT, BOR, and GLITCH reset
//Enable WDT, BOD, and GLITCH reset
bootloader_ana_super_wdt_reset_config(true);
bootloader_ana_bod_reset_config(true);
bootloader_ana_clock_glitch_reset_config(true);

View File

@ -12,15 +12,15 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_SUPER_WDT_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
} else {
REG_CLR_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
} else {
REG_SET_BIT(RTC_CNTL_SWD_CONF_REG, RTC_CNTL_SWD_BYPASS_RST);
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOR_RST);
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);

View File

@ -29,8 +29,6 @@
#include "esp32s3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32H4
#include "esp32h4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C2
#include "esp32c2/rom/rtc.h"
#include "esp32c2/rom/secure_boot.h"
@ -866,7 +864,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
bootloader_munmap(simple_hash);
}
#if CONFIG_SECURE_BOOT_V2_ENABLED
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
// End of the image needs to be padded all the way to a 4KB boundary, after the simple hash
// (for apps they are usually already padded due to --secure-pad-v2, only a problem if this option was not used.)
uint32_t padded_end = ALIGN_UP(end, FLASH_SECTOR_SIZE);
@ -876,7 +874,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
bootloader_munmap(padding);
end = padded_end;
}
#endif
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME
bootloader_sha256_finish(sha_handle, image_digest);

View File

@ -144,9 +144,9 @@ static esp_err_t secure_boot_v2_check(bool *need_fix)
#endif
#endif // CONFIG_SECURE_BOOT
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
#if (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
static void rsa_check_signature_on_update_check(void)
static void check_signature_on_update_check(void)
{
// We rely on the keys used to sign this app to verify the next app on OTA, so make sure there is at
// least one to avoid a stuck firmware
@ -164,7 +164,7 @@ static void rsa_check_signature_on_update_check(void)
}
#endif
}
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
#endif // (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
void esp_secure_boot_init_checks(void)
{
@ -184,9 +184,9 @@ void esp_secure_boot_init_checks(void)
#endif // CONFIG_SECURE_BOOT
#if CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
rsa_check_signature_on_update_check();
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
#if (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
check_signature_on_update_check();
#endif // (CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME || CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME) && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
}

View File

@ -13,8 +13,6 @@
#include "esp32c3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32S3
#include "esp32s3/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32H4
#include "esp32h4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C2
#include "esp32c2/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C6

View File

@ -4,8 +4,7 @@ cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(SDKCONFIG_DEFAULTS "$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.debug_helpers")
list(APPEND SDKCONFIG_DEFAULTS "sdkconfig.defaults")
list(PREPEND SDKCONFIG_DEFAULTS "$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.debug_helpers" "sdkconfig.defaults")
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

View File

@ -4,8 +4,7 @@ cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(SDKCONFIG_DEFAULTS "$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.debug_helpers")
list(APPEND SDKCONFIG_DEFAULTS "sdkconfig.defaults")
list(PREPEND SDKCONFIG_DEFAULTS "$ENV{IDF_PATH}/tools/test_apps/configs/sdkconfig.debug_helpers" "sdkconfig.defaults")
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
set(COMPONENTS main)

View File

@ -9,6 +9,7 @@ from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32c3
@pytest.mark.esp32c6
@pytest.mark.esp32h2
@pytest.mark.esp32s2
@pytest.mark.esp32s3
def test_rtc_reserved_memory(dut: Dut) -> None:

View File

@ -2,6 +2,7 @@ if(CONFIG_BT_ENABLED)
set(srcs "")
set(include_dirs "")
set(ldfragments "linker.lf")
if(CONFIG_IDF_TARGET_ESP32)
list(APPEND srcs "controller/esp32/bt.c"
@ -17,11 +18,8 @@ if(CONFIG_BT_ENABLED)
list(APPEND srcs "controller/esp32c3/bt.c")
list(APPEND include_dirs include/esp32c3/include)
elseif(CONFIG_IDF_TARGET_ESP32H4)
list(APPEND srcs "controller/esp32h4/bt.c")
list(APPEND include_dirs include/esp32h4/include)
elseif(CONFIG_IDF_TARGET_ESP32C2)
set(ldfragments "linker.lf.esp32c2")
list(APPEND srcs "controller/esp32c2/bt.c")
list(APPEND include_dirs include/esp32c2/include)
@ -532,9 +530,11 @@ if(CONFIG_BT_ENABLED)
host/nimble/nimble/nimble/host/services/gap/include
host/nimble/nimble/nimble/host/services/gatt/include
host/nimble/nimble/nimble/host/services/hr/include
host/nimble/nimble/nimble/host/services/htp/include
host/nimble/nimble/nimble/host/services/ias/include
host/nimble/nimble/nimble/host/services/ipss/include
host/nimble/nimble/nimble/host/services/lls/include
host/nimble/nimble/nimble/host/services/prox/include
host/nimble/nimble/nimble/host/services/tps/include
host/nimble/nimble/nimble/host/util/include
host/nimble/nimble/nimble/host/store/ram/include
@ -549,10 +549,12 @@ if(CONFIG_BT_ENABLED)
"host/nimble/nimble/nimble/host/services/ipss/src/ble_svc_ipss.c"
"host/nimble/nimble/nimble/host/services/ans/src/ble_svc_ans.c"
"host/nimble/nimble/nimble/host/services/hr/src/ble_svc_hr.c"
"host/nimble/nimble/nimble/host/services/htp/src/ble_svc_htp.c"
"host/nimble/nimble/nimble/host/services/gap/src/ble_svc_gap.c"
"host/nimble/nimble/nimble/host/services/bas/src/ble_svc_bas.c"
"host/nimble/nimble/nimble/host/services/dis/src/ble_svc_dis.c"
"host/nimble/nimble/nimble/host/services/lls/src/ble_svc_lls.c"
"host/nimble/nimble/nimble/host/services/prox/src/ble_svc_prox.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"
@ -571,6 +573,8 @@ if(CONFIG_BT_ENABLED)
"host/nimble/nimble/nimble/host/src/ble_hs_mqueue.c"
"host/nimble/nimble/nimble/host/src/ble_hs_periodic_sync.c"
"host/nimble/nimble/nimble/host/src/ble_att.c"
"host/nimble/nimble/nimble/host/src/ble_ead.c"
"host/nimble/nimble/nimble/host/src/ble_aes_ccm.c"
"host/nimble/nimble/nimble/host/src/ble_gattc.c"
"host/nimble/nimble/nimble/host/src/ble_store.c"
"host/nimble/nimble/nimble/host/src/ble_sm_lgcy.c"
@ -693,13 +697,12 @@ if(CONFIG_BT_ENABLED)
endif()
# requirements can't depend on config
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
REQUIRES esp_timer esp_wifi
PRIV_REQUIRES nvs_flash soc esp_pm esp_phy esp_coex mbedtls driver vfs
LDFRAGMENTS "linker.lf")
INCLUDE_DIRS "${include_dirs}"
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
REQUIRES esp_timer esp_wifi
PRIV_REQUIRES nvs_flash soc esp_pm esp_phy esp_coex mbedtls driver vfs
LDFRAGMENTS "${ldfragments}")
if(CONFIG_BT_ENABLED)
target_compile_options(${COMPONENT_LIB} PRIVATE -Wno-implicit-fallthrough -Wno-unused-const-variable)
@ -716,15 +719,6 @@ if(CONFIG_BT_ENABLED)
target_link_directories(${COMPONENT_LIB} INTERFACE
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
elseif(CONFIG_IDF_TARGET_ESP32H4)
if(CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_1)
# TODO: rename esp32h2 to esp32h4 [BT-2875]
add_prebuilt_library(libble_app "controller/lib_esp32h2/esp32h2-bt-lib/beta1/libble_app.a")
elseif(CONFIG_IDF_TARGET_ESP32H4_BETA_VERSION_2)
# TODO: rename esp32h2 to esp32h4 [BT-2875]
add_prebuilt_library(libble_app "controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a")
endif()
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
elseif(CONFIG_IDF_TARGET_ESP32C2)
add_prebuilt_library(libble_app "controller/lib_esp32c2/esp32c2-bt-lib/libble_app.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)

View File

@ -68,6 +68,17 @@ menu "Bluetooth"
source "$IDF_PATH/components/bt/controller/$IDF_TARGET/Kconfig.in"
endmenu
config BT_RELEASE_IRAM
depends on BT_ENABLED && BT_LE_RELEASE_IRAM_SUPPORTED
bool "Release Bluetooth text (READ DOCS FIRST)"
default n
help
This option release Bluetooth text section and merge Bluetooth data, bss & text into
a large free heap region when esp_bt_mem_release is called, total saving ~21kB or more of IRAM.
ESP32-C2 only 3 configurable PMP entries available, rest of them are hard-coded.
We cannot split the memory into 3 different regions (IRAM, BLE-IRAM, DRAM).
So this option will disable the PMP (ESP_SYSTEM_PMP_IDRAM_SPLIT)
endmenu
menuconfig BLE_MESH

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -111,7 +111,6 @@ typedef struct {
typedef struct {
void *handle;
void *storage;
} btdm_queue_item_t;
/* OSI function */
@ -555,17 +554,8 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t init)
void *handle = NULL;
#if !CONFIG_SPIRAM_USE_MALLOC
/* IDF FreeRTOS guarantees that all dynamic memory allocation goes to internal RAM. */
handle = (void *)xSemaphoreCreateCounting(max, init);
#else
StaticQueue_t *queue_buffer = NULL;
queue_buffer = heap_caps_malloc(sizeof(StaticQueue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue_buffer);
semphr->storage = queue_buffer;
handle = (void *)xSemaphoreCreateCountingStatic(max, init, queue_buffer);
#endif
assert(handle);
#if CONFIG_BTDM_CTRL_HLI
@ -601,11 +591,6 @@ static void semphr_delete_wrapper(void *semphr)
if (handle) {
vSemaphoreDelete(handle);
}
#ifdef CONFIG_SPIRAM_USE_MALLOC
if (semphr_item->storage) {
free(semphr_item->storage);
}
#endif
free(semphr);
}
@ -691,18 +676,9 @@ static void *queue_create_wrapper(uint32_t queue_len, uint32_t item_size)
queue = (btdm_queue_item_t*)heap_caps_malloc(sizeof(btdm_queue_item_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue);
#if CONFIG_SPIRAM_USE_MALLOC
queue->storage = heap_caps_calloc(1, sizeof(StaticQueue_t) + (queue_len*item_size), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue->storage);
queue->handle = xQueueCreateStatic( queue_len, item_size, ((uint8_t*)(queue->storage)) + sizeof(StaticQueue_t), (StaticQueue_t*)(queue->storage));
assert(queue->handle);
#else
/* IDF FreeRTOS guarantees that all dynamic memory allocation goes to internal RAM. */
queue->handle = xQueueCreate( queue_len, item_size);
assert(queue->handle);
#endif
return queue;
}
@ -714,13 +690,6 @@ static void queue_delete_wrapper(void *queue)
if(queue_item->handle){
vQueueDelete(queue_item->handle);
}
#if CONFIG_SPIRAM_USE_MALLOC
if (queue_item->storage) {
free(queue_item->storage);
}
#endif
free(queue_item);
}
}
@ -895,7 +864,11 @@ static void *malloc_internal_wrapper(size_t size)
static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
{
return esp_read_mac(mac, ESP_MAC_BT);
int ret = esp_read_mac(mac, ESP_MAC_BT);
ESP_LOGI(BTDM_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
return ret;
}
static void IRAM_ATTR srand_wrapper(unsigned int seed)
@ -964,7 +937,7 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
static void btdm_sleep_enter_phase2_wrapper(void)
{
if (btdm_controller_get_sleep_mode() == BTDM_MODEM_SLEEP_MODE_ORIG) {
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
#ifdef CONFIG_PM_ENABLE
if (s_pm_lock_acquired) {
esp_pm_lock_release(s_pm_lock);
@ -972,7 +945,7 @@ static void btdm_sleep_enter_phase2_wrapper(void)
}
#endif
} else if (btdm_controller_get_sleep_mode() == BTDM_MODEM_SLEEP_MODE_EVED) {
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
// pause bluetooth baseband
periph_module_disable(PERIPH_BT_BASEBAND_MODULE);
}
@ -988,7 +961,7 @@ static void btdm_sleep_exit_phase3_wrapper(void)
#endif
if (btdm_controller_get_sleep_mode() == BTDM_MODEM_SLEEP_MODE_ORIG) {
esp_phy_enable();
esp_phy_enable(PHY_MODEM_BT);
btdm_check_and_init_bb();
#ifdef CONFIG_PM_ENABLE
esp_timer_stop(s_btdm_slp_tmr);
@ -996,7 +969,7 @@ static void btdm_sleep_exit_phase3_wrapper(void)
} else if (btdm_controller_get_sleep_mode() == BTDM_MODEM_SLEEP_MODE_EVED) {
// resume bluetooth baseband
periph_module_enable(PERIPH_BT_BASEBAND_MODULE);
esp_phy_enable();
esp_phy_enable(PHY_MODEM_BT);
}
}
@ -1668,7 +1641,7 @@ static void bt_shutdown(void)
#else
bt_controller_shutdown(NULL);
#endif
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
return;
}
@ -1694,7 +1667,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
esp_pm_lock_acquire(s_pm_lock);
#endif
esp_phy_enable();
esp_phy_enable(PHY_MODEM_BT);
#if CONFIG_SW_COEXIST_ENABLE
coex_enable();
@ -1712,7 +1685,7 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
#ifdef CONFIG_PM_ENABLE
if (!s_btdm_allow_light_sleep) {
esp_pm_lock_release(s_light_sleep_pm_lock);
@ -1752,7 +1725,7 @@ esp_err_t esp_bt_controller_disable(void)
coex_disable();
#endif
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
esp_unregister_shutdown_handler(bt_shutdown);

View File

@ -253,6 +253,33 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task
config BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Enable controller log
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
bool "enable controller log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
range 1 5
@ -373,24 +400,45 @@ config BT_LE_SLEEP_ENABLE
help
Enable BLE sleep
choice BT_LE_WAKEUP_SOURCE
prompt "BLE light sleep wakeup source"
depends on BT_LE_SLEEP_ENABLE
default BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
config BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
bool "Use ESP timer to wakeup CPU"
help
Use esp timer to wakeup CPU
config BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
bool "Use BLE rtc timer to wakeup CPU"
help
Use BLE rtc timer to wakeup CPU
endchoice
config BT_LE_USE_ESP_TIMER
bool "Use Esp Timer for callout"
depends on !BT_NIMBLE_ENABLED
default y
help
Set this option to use Esp Timer which has higher priority timer instead of FreeRTOS timer
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
default y
help
The function is mainly used to enable flow control for advertising reports. When it is enabled,
advertising reports will be discarded by the controller if the number of unprocessed advertising
reports exceeds the size of BLE adv report flow control.
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM
int "BLE adv report flow control number"
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
range 50 1000
default 100
help
The number of unprocessed advertising report that bluetooth host can save.If you set
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
If you set `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, bluetooth host may cache a
lot of adv packets and this may cause system memory run out. For example, if you set
it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
packets as fast as possible, otherwise it will cause adv packets lost.
config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
int "BLE adv lost event threshold value"
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
range 1 1000
default 20
help
When adv report flow control is enabled, The ADV lost event will be generated when the number
of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
If you set `BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more.
config BT_LE_RELEASE_IRAM_SUPPORTED
bool
default y

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -46,6 +46,10 @@
#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 "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -54,6 +58,8 @@
#include "soc/syscon_reg.h"
#include "soc/dport_access.h"
#include "hal/efuse_ll.h"
/* Macro definition
************************************************************************
*/
@ -70,12 +76,12 @@
#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
#endif // CONFIG_BT_BLUEDROID_ENABLED
/* Types definition
************************************************************************
*/
struct osi_coex_funcs_t {
uint32_t _magic;
uint32_t _version;
@ -108,13 +114,20 @@ struct ext_funcs_t {
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int ble_log_deinit_async(void);
extern void ble_log_async_output_dump_all(bool output);
#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);
@ -130,6 +143,9 @@ extern uint32_t r_os_cputime_get32(void);
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
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);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern void esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern int os_msys_init(void);
extern void os_msys_buf_free(void);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
@ -139,14 +155,15 @@ 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 uint32_t _bt_bss_start;
extern void bt_track_pll_cap(void);
#if CONFIG_BT_RELEASE_IRAM
extern uint32_t _iram_bt_text_start;
extern uint32_t _bss_bt_end;
#else
extern uint32_t _bt_bss_end;
extern uint32_t _nimble_bss_start;
extern uint32_t _nimble_bss_end;
extern uint32_t _nimble_data_start;
extern uint32_t _nimble_data_end;
extern uint32_t _bt_data_start;
extern uint32_t _bt_data_end;
extern uint32_t _bt_controller_data_start;
#endif
/* Local Function Declaration
*********************************************************************
@ -164,36 +181,37 @@ static int hci_uart_config_wrapper(int uart_no, int32_t speed, uint8_t databits,
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
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler, void *arg, void **ret_handle_in);
#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);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#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[] = {2048, 1024, 1024};
#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 /* #ifdef CONFIG_PM_ENABLE */
#endif // CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#define BLE_RTC_DELAY_US (1800)
#endif
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US (0)
static void ble_sleep_timer_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_ble_sleep_timer = NULL;
#endif
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
@ -223,9 +241,10 @@ struct ext_funcs_t ext_funcs_ro = {
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = ble_sm_alg_gen_key_pair,
._ecc_gen_dh_key = ble_sm_alg_gen_dhkey,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
._esp_bt_track_pll_cap = NULL,
.magic = EXT_FUNC_MAGIC_VALUE,
};
@ -235,9 +254,13 @@ static void IRAM_ATTR esp_reset_rpa_moudle(void)
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, BLE_RPA_REST_BIT);
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2)
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
BT_ASSERT_PRINT("BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_ble_controller_log_dump_all(true);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
assert(0);
}
@ -250,17 +273,17 @@ static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status)
{
#if CONFIG_SW_COEXIST_ENABLE
coex_schm_status_bit_set(type, status);
#endif
#endif // CONFIG_SW_COEXIST_ENABLE
}
static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
{
#if CONFIG_SW_COEXIST_ENABLE
coex_schm_status_bit_clear(type, status);
#endif
#endif // CONFIG_SW_COEXIST_ENABLE
}
#ifdef CONFIG_BT_BLUEDROID_ENABLED
#ifdef CONFIG_BT_BLUEDROID_ENABLED
bool esp_vhci_host_check_send_available(void)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
@ -313,6 +336,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
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);
}
@ -323,7 +347,6 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
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)
@ -336,8 +359,7 @@ esp_err_t esp_vhci_host_register_callback(const esp_vhci_host_callback_t *callba
return ESP_OK;
}
#endif
#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 < portNUM_PROCESSORS ? core_id : tskNO_AFFINITY));
@ -348,6 +370,25 @@ static void task_delete_wrapper(void *task_handle)
vTaskDelete(task_handle);
}
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv)
{
int rc = -1;
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
rc = ble_sm_alg_gen_key_pair(pub, priv);
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
return rc;
}
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey)
{
int rc = -1;
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
rc = ble_sm_alg_gen_dhkey(peer_pub_key_x, peer_pub_key_y, our_priv_key, out_dhkey);
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
@ -363,8 +404,9 @@ static int hci_uart_init_cbs_wrapper(int uart_no, hci_uart_tx_char tx_func,
}
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)
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);
@ -411,43 +453,23 @@ static int esp_intr_free_wrapper(void **ret_handle)
return rc;
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
esp_ble_set_wakeup_overhead(overhead);
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
return;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
uint32_t delta_tick;
uint32_t us_to_sleep;
uint32_t sleep_tick;
uint32_t tick_invalid = *(uint32_t*)(arg);
assert(arg != NULL);
if (!tick_invalid) {
sleep_tick = r_os_cputime_get32();
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
delta_tick = enable_tick - sleep_tick;
if (delta_tick & 0x80000000) {
return;
}
us_to_sleep = r_os_cputime_ticks_to_usecs(delta_tick);
if (us_to_sleep <= BTDM_MIN_TIMER_UNCERTAINTY_US) {
return;
}
esp_err_t err = esp_timer_start_once(s_ble_sleep_timer, us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
if (err != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ESP timer start failed\n");
return;
}
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
r_ble_rtc_wake_up_state_clr();
#endif
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
s_ble_active = false;
}
@ -456,7 +478,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
if (s_ble_active) {
return;
}
esp_phy_enable();
esp_phy_enable(PHY_MODEM_BT);
// need to check if need to call pm lock here
#ifdef CONFIG_PM_ENABLE
esp_pm_lock_acquire(s_pm_lock);
@ -464,16 +486,6 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
s_ble_active = true;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
static void ble_sleep_timer_callback(void * arg)
{
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif // CONFIG_PM_ENABLE
esp_err_t controller_sleep_init(void)
{
esp_err_t rc = 0;
@ -493,73 +505,43 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
esp_pm_lock_acquire(s_pm_lock);
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
esp_timer_create_args_t create_args = {
.callback = ble_sleep_timer_callback,
.arg = NULL,
.name = "btSlp"
};
rc = esp_timer_create(&create_args, &s_ble_sleep_timer);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
rc = esp_pm_register_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
if (rc != ESP_OK) {
goto error;
}
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is ESP timer");
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
return rc;
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_release(s_pm_lock);
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_disable_bt_wakeup();
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif //CONFIG_PM_ENABLE
return rc;
}
void controller_sleep_deinit(void)
{
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#ifdef CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#ifdef CONFIG_PM_ENABLE
/*lock should release first and then delete*/
if (s_ble_active) {
esp_pm_lock_release(s_pm_lock);
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif //CONFIG_PM_ENABLE
}
@ -650,27 +632,43 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif
esp_phy_modem_init();
periph_module_enable(PERIPH_BT_MODULE);
// init phy
esp_phy_enable();
s_ble_active = true;
// init bb
bt_bb_v2_init_cmplx(1);
periph_module_reset(PERIPH_BT_MODULE);
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");
ret = ESP_ERR_INVALID_ARG;
goto free_controller;
goto modem_deint;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_init();
#endif
#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
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);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto free_controller;
goto modem_deint;
}
ret = controller_sleep_init();
@ -694,8 +692,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
free_controller:
controller_sleep_deinit();
ble_controller_deinit();
esp_phy_disable();
modem_deint:
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_phy_modem_deinit();
periph_module_disable(PERIPH_BT_MODULE);
#if CONFIG_BT_NIMBLE_ENABLED
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
@ -717,13 +719,13 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
if (s_ble_active) {
esp_phy_disable();
s_ble_active = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
periph_module_disable(PERIPH_BT_MODULE);
#if CONFIG_BT_NIMBLE_ENABLED
/* De-initialize default event queue */
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
@ -758,6 +760,17 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (!s_ble_active) {
#if CONFIG_PM_ENABLE
esp_pm_lock_acquire(s_pm_lock);
#endif // CONFIG_PM_ENABLE
// init phy
esp_phy_enable(PHY_MODEM_BT);
s_ble_active = true;
}
// init bb
bt_bb_v2_init_cmplx(1);
#if CONFIG_SW_COEXIST_ENABLE
coex_enable();
#endif
@ -773,6 +786,13 @@ error:
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
if (s_ble_active) {
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
s_ble_active = false;
}
return ret;
}
@ -785,6 +805,14 @@ esp_err_t esp_bt_controller_disable(void)
if (ble_controller_disable() != 0) {
return ESP_FAIL;
}
if (s_ble_active) {
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
s_ble_active = false;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
@ -815,34 +843,30 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
{
intptr_t mem_start, mem_end;
if (mode == ESP_BT_MODE_BLE) {
mem_start = (intptr_t)&_bt_bss_start;
#if CONFIG_BT_RELEASE_IRAM && CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
/* Release Bluetooth text section and merge Bluetooth data, bss & text into a large free heap
* region when esp_bt_mem_release is called, total saving ~21kB or more of IRAM. ESP32-C2 has
* only 3 configurable PMP entries available, rest of them are hard-coded. We cannot split the
* memory into 3 different regions (IRAM, BLE-IRAM, DRAM). So `ESP_SYSTEM_PMP_IDRAM_SPLIT` needs
* to be disabled.
*/
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "`ESP_SYSTEM_PMP_IDRAM_SPLIT` should be disabled!");
assert(0);
#endif // CONFIG_BT_RELEASE_IRAM && CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT
if (mode & ESP_BT_MODE_BLE) {
#if CONFIG_BT_RELEASE_IRAM
mem_start = (intptr_t)MAP_IRAM_TO_DRAM((intptr_t)&_iram_bt_text_start);
mem_end = (intptr_t)&_bss_bt_end;
#else
mem_start = (intptr_t)&_bt_controller_data_start;
mem_end = (intptr_t)&_bt_bss_end;
#endif // CONFIG_BT_RELEASE_IRAM
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Release BLE [0x%08x] - [0x%08x], len %d", mem_start,
mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_bt_data_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_bss_start;
mem_end = (intptr_t)&_nimble_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_data_start;
mem_end = (intptr_t)&_nimble_data_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
return ESP_OK;
@ -970,6 +994,33 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
return (esp_power_level_t)tx_level;
}
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;
portENTER_CRITICAL_SAFE(&spinlock);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED == true)

View File

@ -78,15 +78,29 @@ config BT_CTRL_ADV_DUP_FILT_MAX
help
The maxinum number of suplicate scan filter
config BT_CTRL_HW_CCA
bool "HW CCA check enable"
default n
choice BT_BLE_CCA_MODE
prompt "BLE CCA mode"
default BT_BLE_CCA_MODE_NONE
help
It enables HW CCA feature in controller
Define BT BLE CCA mode
config BT_BLE_CCA_MODE_NONE
bool "NONE"
config BT_BLE_CCA_MODE_HW
bool "Hardware"
config BT_BLE_CCA_MODE_SW
bool "Software"
endchoice
config BT_BLE_CCA_MODE
int
default 0 if BT_BLE_CCA_MODE_NONE
default 1 if BT_BLE_CCA_MODE_HW
default 2 if BT_BLE_CCA_MODE_SW
config BT_CTRL_HW_CCA_VAL
int "CCA threshold value"
range 20 60
range 20 100
default 20
help
It is the threshold value of HW CCA, if the value is 30, it means CCA threshold is -30 dBm.
@ -265,20 +279,19 @@ choice BT_CTRL_SCAN_DUPL_TYPE
config BT_CTRL_SCAN_DUPL_TYPE_DEVICE
bool "Scan Duplicate By Device Address"
help
This way is to use advertiser address filtering. The adv packet of the same address is only
allowed to be reported once
Advertising packets with the same address, address type, and advertising type are reported once.
config BT_CTRL_SCAN_DUPL_TYPE_DATA
bool "Scan Duplicate By Advertising Data"
help
This way is to use advertising data filtering. All same advertising data only allow to be reported
once even though they are from different devices.
Advertising packets with identical advertising data, address type, and advertising type
are reported only once, even if they originate from different devices.
config BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE
bool "Scan Duplicate By Device Address And Advertising Data"
help
This way is to use advertising data and device address filtering. All different adv packets with
the same address are allowed to be reported.
Advertising packets with the same address, advertising data, address type,
and advertising type are reported only once.
endchoice
config BT_CTRL_SCAN_DUPL_TYPE

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -112,7 +112,7 @@ do{\
} while(0)
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
#define OSI_VERSION 0x00010006
#define OSI_VERSION 0x00010007
#define OSI_MAGIC_VALUE 0xFADEBEAD
/* Types definition
@ -135,7 +135,6 @@ typedef struct vhci_host_callback {
typedef struct {
void *handle;
void *storage;
} btdm_queue_item_t;
typedef void (* osi_intr_handler)(void);
@ -194,6 +193,8 @@ struct osi_funcs_t {
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);
void (* _ets_delay_us)(uint32_t us);
void (* _btdm_rom_table_ready)(void);
};
@ -245,6 +246,7 @@ extern bool btdm_deep_sleep_mem_init(void);
extern void btdm_deep_sleep_mem_deinit(void);
extern void btdm_ble_power_down_dma_copy(bool copy);
extern uint8_t btdm_sleep_clock_sync(void);
extern void sdk_config_extend_set_pll_track(bool enable);
#if CONFIG_MAC_BB_PD
extern void esp_mac_bb_power_down(void);
@ -252,6 +254,8 @@ extern void esp_mac_bb_power_up(void);
extern void ets_backup_dma_copy(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
#endif
extern void btdm_cca_feature_enable(void);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _btdm_bss_start;
@ -311,6 +315,7 @@ static void interrupt_off_wrapper(int intr_num);
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);
static void btdm_funcs_table_ready_wrapper(void);
static void btdm_slp_tmr_callback(void *arg);
@ -375,6 +380,8 @@ static const struct osi_funcs_t osi_funcs_ro = {
._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,
._ets_delay_us = esp_rom_delay_us,
._btdm_rom_table_ready = btdm_funcs_table_ready_wrapper,
};
static DRAM_ATTR struct osi_funcs_t *osi_funcs_p;
@ -511,16 +518,10 @@ static void *semphr_create_wrapper(uint32_t max, uint32_t init)
btdm_queue_item_t *semphr = heap_caps_calloc(1, sizeof(btdm_queue_item_t), MALLOC_CAP_8BIT|MALLOC_CAP_INTERNAL);
assert(semphr);
#if !CONFIG_SPIRAM_USE_MALLOC
/* IDF FreeRTOS guarantees that all dynamic memory allocation goes to internal RAM. */
semphr->handle = (void *)xSemaphoreCreateCounting(max, init);
#else
semphr->storage = heap_caps_malloc(sizeof(StaticQueue_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(semphr->storage);
semphr->handle = (void *)xSemaphoreCreateCountingStatic(max, init, semphr->storage);
#endif
assert(semphr->handle);
return semphr;
}
@ -535,11 +536,6 @@ static void semphr_delete_wrapper(void *semphr)
if (semphr_item->handle) {
vSemaphoreDelete(semphr_item->handle);
}
#ifdef CONFIG_SPIRAM_USE_MALLOC
if (semphr_item->storage) {
free(semphr_item->storage);
}
#endif
free(semphr);
}
@ -595,18 +591,9 @@ static void *queue_create_wrapper(uint32_t queue_len, uint32_t item_size)
queue = (btdm_queue_item_t*)heap_caps_malloc(sizeof(btdm_queue_item_t), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue);
#if CONFIG_SPIRAM_USE_MALLOC
queue->storage = heap_caps_calloc(1, sizeof(StaticQueue_t) + (queue_len*item_size), MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
assert(queue->storage);
queue->handle = xQueueCreateStatic( queue_len, item_size, ((uint8_t*)(queue->storage)) + sizeof(StaticQueue_t), (StaticQueue_t*)(queue->storage));
assert(queue->handle);
#else
/* IDF FreeRTOS guarantees that all dynamic memory allocation goes to internal RAM. */
queue->handle = xQueueCreate( queue_len, item_size);
assert(queue->handle);
#endif
return queue;
}
@ -618,13 +605,6 @@ static void queue_delete_wrapper(void *queue)
if(queue_item->handle){
vQueueDelete(queue_item->handle);
}
#if CONFIG_SPIRAM_USE_MALLOC
if (queue_item->storage) {
free(queue_item->storage);
}
#endif
free(queue_item);
}
}
@ -768,7 +748,7 @@ static void btdm_sleep_enter_phase2_wrapper(void)
{
if (btdm_controller_get_sleep_mode() == ESP_BT_SLEEP_MODE_1) {
if (s_lp_stat.phy_enabled) {
esp_phy_disable();
esp_phy_disable(PHY_MODEM_BT);
s_lp_stat.phy_enabled = 0;
} else {
assert(0);
@ -797,7 +777,7 @@ static void btdm_sleep_exit_phase3_wrapper(void)
if (btdm_controller_get_sleep_mode() == ESP_BT_SLEEP_MODE_1) {
if (s_lp_stat.phy_enabled == 0) {
esp_phy_enable();
esp_phy_enable(PHY_MODEM_BT);
s_lp_stat.phy_enabled = 1;
}
}
@ -899,6 +879,13 @@ static void async_wakeup_request_end(int event)
return;
}
static void btdm_funcs_table_ready_wrapper(void)
{
#if BT_BLE_CCA_MODE == 2
btdm_cca_feature_enable();
#endif
}
static void coex_schm_status_bit_set_wrapper(uint32_t type, uint32_t status)
{
#if CONFIG_SW_COEXIST_ENABLE
@ -1327,14 +1314,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);
esp_phy_enable();
s_lp_stat.phy_enabled = 1;
if (btdm_controller_init(cfg) != 0) {
err = ESP_ERR_NO_MEM;
goto error;
}
coex_pti_v2();
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
@ -1364,11 +1347,6 @@ static void bt_controller_deinit_internal(void)
{
periph_module_disable(PERIPH_BT_MODULE);
if (s_lp_stat.phy_enabled) {
esp_phy_disable();
s_lp_stat.phy_enabled = 0;
}
// deinit low power control resources
do {
@ -1462,6 +1440,12 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
return ESP_ERR_INVALID_ARG;
}
/* Enable PHY when enabling controller to reduce power dissipation after controller init
* Notice the init order: esp_phy_enable() -> bt_bb_v2_init_cmplx() -> coex_pti_v2()
*/
esp_phy_enable(PHY_MODEM_BT);
s_lp_stat.phy_enabled = 1;
#if CONFIG_SW_COEXIST_ENABLE
coex_enable();
#endif
@ -1481,11 +1465,16 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
}
} while (0);
// Disable pll track by default in BLE controller on ESP32-C3 and ESP32-S3
sdk_config_extend_set_pll_track(false);
if (btdm_controller_enable(mode) != 0) {
ret = ESP_ERR_INVALID_STATE;
goto error;
}
coex_pti_v2();
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_ENABLED;
return ret;
@ -1508,6 +1497,10 @@ error:
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
if (s_lp_stat.phy_enabled) {
esp_phy_disable(PHY_MODEM_BT);
s_lp_stat.phy_enabled = 0;
}
return ret;
}
@ -1526,6 +1519,10 @@ esp_err_t esp_bt_controller_disable(void)
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
if (s_lp_stat.phy_enabled) {
esp_phy_disable(PHY_MODEM_BT);
s_lp_stat.phy_enabled = 0;
}
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;

View File

@ -212,6 +212,15 @@ menu "Memory Settings"
help
Dynamic memory size of block 2
config BT_LE_MSYS_BUF_FROM_HEAP
bool "Get Msys Mbuf from heap"
default y
depends on BT_LE_MSYS_INIT_IN_CONTROLLER
help
This option sets the source of the shared msys mbuf memory between
the Host and the Controller. Allocate the memory from the heap if
this option is sets, from the mempool otherwise.
config BT_LE_ACL_BUF_COUNT
int "ACL Buffer count"
default 10
@ -260,6 +269,33 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task
config BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Enable controller log
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
bool "enable controller log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
range 1 5
@ -340,7 +376,7 @@ config BT_LE_LL_SCA
config BT_LE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
depends on !BT_NIMBLE_ENABLED
range 1 9
range 1 70
default 3
help
Defines maximum number of concurrent BLE connections. For ESP32, user
@ -380,19 +416,24 @@ config BT_LE_SLEEP_ENABLE
help
Enable BLE sleep
choice BT_LE_WAKEUP_SOURCE
prompt "BLE light sleep wakeup source"
depends on BT_LE_SLEEP_ENABLE
default BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
config BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
bool "Use ESP timer to wakeup CPU"
choice BT_LE_LP_CLK_SRC
prompt "BLE low power clock source"
default BT_LE_LP_CLK_SRC_MAIN_XTAL
config BT_LE_LP_CLK_SRC_MAIN_XTAL
bool "Use main XTAL as RTC clock source"
help
Use esp timer to wakeup CPU
User main XTAL as RTC clock source.
This option is recommended if external 32.768k XTAL is not available.
Using the external 32.768 kHz XTAL will have lower current consumption
in light sleep compared to using the main XTAL.
config BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
bool "Use BLE rtc timer to wakeup CPU"
config BT_LE_LP_CLK_SRC_DEFAULT
bool "Use system RTC slow clock source"
help
Use BLE rtc timer to wakeup CPU
Use the same slow clock source as system RTC
Using any clock source other than external 32.768 kHz XTAL supports only
legacy ADV and SCAN due to low clock accuracy.
endchoice
config BT_LE_USE_ESP_TIMER
@ -402,3 +443,110 @@ config BT_LE_USE_ESP_TIMER
help
Set this option to use Esp Timer which has higher priority timer
instead of FreeRTOS timer
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
default y
help
The function is mainly used to enable flow control for advertising reports. When it is enabled,
advertising reports will be discarded by the controller if the number of unprocessed advertising
reports exceeds the size of BLE adv report flow control.
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM
int "BLE adv report flow control number"
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
range 50 1000
default 100
help
The number of unprocessed advertising report that bluetooth host can save.If you set
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
If you set `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, bluetooth host may cache a
lot of adv packets and this may cause system memory run out. For example, if you set
it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
packets as fast as possible, otherwise it will cause adv packets lost.
config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
int "BLE adv lost event threshold value"
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
range 1 1000
default 20
help
When adv report flow control is enabled, The ADV lost event will be generated when the number
of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
If you set `BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more.
config BT_LE_SCAN_DUPL
bool "BLE Scan Duplicate Options"
default y
help
This select enables parameters setting of BLE scan duplicate.
choice BT_LE_SCAN_DUPL_TYPE
prompt "Scan Duplicate Type"
default BT_LE_SCAN_DUPL_TYPE_DEVICE
depends on BT_LE_SCAN_DUPL
help
Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use
advertiser address filtering. The adv packet of the same address is only allowed to be reported once.
Another way is "Scan Duplicate By Device Address And Advertising Data". This way is to use advertising
data and device address filtering. All different adv packets with the same address are allowed to be
reported. The last way is "Scan Duplicate By Advertising Data". This way is to use advertising data
filtering. All same advertising data only allow to be reported once even though they are from
different devices.
config BT_LE_SCAN_DUPL_TYPE_DEVICE
bool "Scan Duplicate By Device Address"
help
This way is to use advertiser address filtering. The adv packet of the same address is only
allowed to be reported once
config BT_LE_SCAN_DUPL_TYPE_DATA
bool "Scan Duplicate By Advertising Data"
help
This way is to use advertising data filtering. All same advertising data only allow to be reported
once even though they are from different devices.
config BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
bool "Scan Duplicate By Device Address And Advertising Data"
help
This way is to use advertising data and device address filtering. All different adv packets with
the same address are allowed to be reported.
endchoice
config BT_LE_SCAN_DUPL_TYPE
int
depends on BT_LE_SCAN_DUPL
default 0 if BT_LE_SCAN_DUPL_TYPE_DEVICE
default 1 if BT_LE_SCAN_DUPL_TYPE_DATA
default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
default 0
config BT_LE_SCAN_DUPL_CACHE_SIZE
int "Maximum number of devices in scan duplicate filter"
depends on BT_LE_SCAN_DUPL
range 10 1000
default 100
help
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BT_LE_SCAN_DUPL
range 0 1000
default 0
help
If the period value is non-zero, the controller will periodically clear the device information
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
Host in advertising report events.
There are two scenarios where the ADV packet will be repeatedly reported:
1. The duplicate scan cache is full, the controller will delete the oldest device information and
add new device information.
2. When the refresh period is up, the controller will clear all device information and start filtering
again.
config BT_LE_MSYS_INIT_IN_CONTROLLER
bool "Msys Mbuf Init in Controller"
default y

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -40,6 +40,14 @@
#include "hci_uart.h"
#include "bt_osi_mem.h"
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
#include "esp_private/sleep_retention.h"
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#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
@ -50,6 +58,8 @@
#include "esp_private/periph_ctrl.h"
#include "esp_sleep.h"
#include "hal/efuse_hal.h"
#include "soc/rtc.h"
/* Macro definition
************************************************************************
*/
@ -67,7 +77,6 @@
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED
/* Types definition
************************************************************************
*/
@ -104,12 +113,21 @@ struct ext_funcs_t {
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int ble_log_deinit_async(void);
extern void ble_log_async_select_dump_buffers(uint8_t buffers);
extern void ble_log_async_output_dump_all(bool output);
#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);
@ -119,14 +137,18 @@ extern int 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 int os_msys_buf_alloc(void);
extern uint32_t r_os_cputime_get32(void);
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
extern void 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 ble_rtc_wake_up_state_clr(void);
extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_buf_free(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);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void 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);
@ -167,13 +189,22 @@ static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#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[] = {6144, 1024, 2048};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
@ -181,15 +212,8 @@ static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#define BLE_RTC_DELAY_US (1100)
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US (0)
static void ble_sleep_timer_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_ble_sleep_timer = NULL;
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (2500)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (500)
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
._magic = OSI_COEX_MAGIC_VALUE,
@ -218,8 +242,8 @@ struct ext_funcs_t ext_funcs_ro = {
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = ble_sm_alg_gen_key_pair,
._ecc_gen_dh_key = ble_sm_alg_gen_dhkey,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE,
};
@ -233,6 +257,9 @@ static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
BT_ASSERT_PRINT("BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_ble_controller_log_dump_all(true);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
assert(0);
}
@ -299,6 +326,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
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);
}
@ -335,6 +363,25 @@ static void task_delete_wrapper(void *task_handle)
vTaskDelete(task_handle);
}
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv)
{
int rc = -1;
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
rc = ble_sm_alg_gen_key_pair(pub, priv);
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
return rc;
}
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey)
{
int rc = -1;
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
rc = ble_sm_alg_gen_dhkey(peer_pub_key_x, peer_pub_key_y, our_priv_key, out_dhkey);
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
@ -401,47 +448,54 @@ static int esp_intr_free_wrapper(void **ret_handle)
return rc;
}
void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
{
/* Select slow clock source for BT momdule */
switch (slow_clk_src) {
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
uint32_t chip_version = efuse_hal_chip_revision();
if (chip_version == 0) {
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (400 - 1));
} else{
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
}
break;
case MODEM_CLOCK_LPCLK_SRC_RC_SLOW:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_XTAL32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using external 32.768 kHz XTAL as clock source");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (1 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_RC32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 32 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (1 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_EXT32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 32 kHz oscillator as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (1 - 1));
break;
default:
}
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
return;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
uint32_t delta_tick;
uint32_t us_to_sleep;
uint32_t sleep_tick;
uint32_t tick_invalid = *(uint32_t*)(arg);
assert(arg != NULL);
if (!tick_invalid) {
sleep_tick = r_os_cputime_get32();
/* start a timer to wake up and acquire the pm_lock before modem_sleep awakes */
delta_tick = enable_tick - sleep_tick;
if (delta_tick & 0x80000000) {
return;
}
us_to_sleep = r_os_cputime_ticks_to_usecs(delta_tick);
if (us_to_sleep <= BTDM_MIN_TIMER_UNCERTAINTY_US) {
return;
}
esp_err_t err = esp_timer_start_once(s_ble_sleep_timer,
us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
if (err != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ESP timer start failed\n");
return;
}
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_rtc_wake_up_state_clr();
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
sleep_retention_do_extra_retention(true);
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
esp_phy_disable(PHY_MODEM_BT);
#ifdef CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_disable();
s_ble_active = false;
}
@ -450,37 +504,54 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
if (s_ble_active) {
return;
}
esp_phy_enable();
#ifdef CONFIG_PM_ENABLE
esp_pm_lock_acquire(s_pm_lock);
r_ble_rtc_wake_up_state_clr();
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE && SOC_PM_RETENTION_HAS_CLOCK_BUG
sleep_retention_do_extra_retention(false);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE && SOC_PM_RETENTION_HAS_CLOCK_BUG */
#endif //CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
s_ble_active = true;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
static void ble_sleep_timer_callback(void * arg)
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra)
{
uint8_t size;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_5, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
}
return err;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif // CONFIG_PM_ENABLE
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)
{
esp_ble_set_wakeup_overhead(overhead);
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
esp_err_t controller_sleep_init(void)
{
esp_err_t rc = 0;
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled\n");
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled");
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
500 + BLE_RTC_DELAY_US);
#ifdef CONFIG_PM_ENABLE
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
#endif // CONFIG_PM_ENABLE
BLE_RTC_DELAY_US_LIGHT_SLEEP);
#else
ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
BLE_RTC_DELAY_US_MODEM_SLEEP);
#endif /* FREERTOS_USE_TICKLESS_IDLE */
#endif // CONFIG_BT_LE_SLEEP_ENABLE
#ifdef CONFIG_PM_ENABLE
@ -488,85 +559,128 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
esp_pm_lock_acquire(s_pm_lock);
#if 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);
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
esp_timer_create_args_t create_args = {
.callback = ble_sleep_timer_callback,
.arg = NULL,
.name = "btSlp"
};
rc = esp_timer_create(&create_args, &s_ble_sleep_timer);
rc = esp_pm_register_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
if (rc != ESP_OK) {
goto error;
}
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is ESP timer");
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
return rc;
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_release(s_pm_lock);
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_disable_bt_wakeup();
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif //CONFIG_PM_ENABLE
#endif // CONFIG_PM_ENABLE
return rc;
}
void controller_sleep_deinit(void)
{
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
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 */
#ifdef CONFIG_PM_ENABLE
/* lock should be released first */
if (s_ble_active) {
esp_pm_lock_release(s_pm_lock);
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif //CONFIG_PM_ENABLE
}
typedef enum {
FILTER_DUPLICATE_PDUTYPE = BIT(0),
FILTER_DUPLICATE_LENGTH = BIT(1),
FILTER_DUPLICATE_ADDRESS = BIT(2),
FILTER_DUPLICATE_ADVDATA = BIT(3),
FILTER_DUPLICATE_DEFAULT = FILTER_DUPLICATE_PDUTYPE | FILTER_DUPLICATE_ADDRESS,
FILTER_DUPLICATE_PDU_ALL = 0xF,
FILTER_DUPLICATE_EXCEPTION_FOR_MESH = BIT(4),
FILTER_DUPLICATE_AD_TYPE = BIT(5),
}disc_duplicate_mode_t;
extern void filter_duplicate_mode_enable(disc_duplicate_mode_t mode);
extern void filter_duplicate_mode_disable(disc_duplicate_mode_t mode);
extern void filter_duplicate_set_ring_list_max_num(uint32_t max_num);
extern void scan_duplicate_cache_refresh_set_time(uint32_t period_time);
int
ble_vhci_disc_duplicate_mode_enable(int mode)
{
// TODO: use vendor hci to update
filter_duplicate_mode_enable(mode);
return true;
}
int
ble_vhci_disc_duplicate_mode_disable(int mode)
{
// TODO: use vendor hci to update
filter_duplicate_mode_disable(mode);
return true;
}
int ble_vhci_disc_duplicate_set_max_cache_size(int max_cache_size){
// TODO: use vendor hci to update
filter_duplicate_set_ring_list_max_num(max_cache_size);
return true;
}
int ble_vhci_disc_duplicate_set_period_refresh_time(int refresh_period_time){
// TODO: use vendor hci to update
scan_duplicate_cache_refresh_set_time(refresh_period_time);
return true;
}
/**
* @brief Config scan duplicate option mode from menuconfig (Adapt to the old configuration method.)
*/
void ble_controller_scan_duplicate_config(void)
{
uint32_t duplicate_mode = FILTER_DUPLICATE_DEFAULT;
uint32_t cache_size = 100;
#if CONFIG_BT_LE_SCAN_DUPL == true
cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 0) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_PDUTYPE;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 1) {
duplicate_mode = FILTER_DUPLICATE_ADVDATA;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 2) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_ADVDATA;
}
duplicate_mode |= FILTER_DUPLICATE_EXCEPTION_FOR_MESH;
ble_vhci_disc_duplicate_set_period_refresh_time(CONFIG_BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD);
#endif
ble_vhci_disc_duplicate_mode_disable(0xFFFFFFFF);
ble_vhci_disc_duplicate_mode_enable(duplicate_mode);
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
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;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
@ -608,43 +722,89 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_mem;
}
/* Initialize the global memory pool */
ret = os_msys_buf_alloc();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "os msys alloc failed");
goto free_mem;
}
os_msys_init();
#if CONFIG_BT_NIMBLE_ENABLED
/* ble_npl_eventq_init() needs to use npl functions in rom and
* must be called after esp_bt_controller_init().
*/
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_select_lp_clock_source(PERIPH_BT_MODULE, MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL, 249);
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 */
esp_phy_modem_init();
esp_phy_enable();
esp_btbb_enable();
s_ble_active = true;
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");
ret = ESP_ERR_INVALID_ARG;
goto free_controller;
goto modem_deint;
}
#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 = 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
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);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto modem_deint;
}
esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
ret = os_msys_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "msys_init failed %d", ret);
goto free_controller;
}
@ -653,7 +813,6 @@ 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));
swap_in_place(mac, 6);
esp_ble_ll_set_public_addr(mac);
@ -666,9 +825,12 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
free_controller:
controller_sleep_deinit();
os_msys_deinit();
ble_controller_deinit();
esp_btbb_disable();
esp_phy_disable();
modem_deint:
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_phy_modem_deinit();
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
@ -676,7 +838,6 @@ free_controller:
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
free_mem:
os_msys_buf_free();
npl_freertos_mempool_deinit();
esp_unregister_npl_funcs();
npl_freertos_funcs_deinit();
@ -694,16 +855,15 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
esp_btbb_disable();
os_msys_deinit();
if (s_ble_active) {
esp_phy_disable();
s_ble_active = false;
}
esp_phy_modem_deinit();
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
#if CONFIG_BT_NIMBLE_ENABLED
@ -711,8 +871,6 @@ esp_err_t esp_bt_controller_deinit(void)
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
os_msys_buf_free();
esp_unregister_npl_funcs();
esp_unregister_ext_funcs();
@ -739,7 +897,14 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (!s_ble_active) {
#if CONFIG_PM_ENABLE
esp_pm_lock_acquire(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
esp_btbb_enable();
s_ble_active = true;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_enable();
#endif // CONFIG_SW_COEXIST_ENABLE
@ -755,6 +920,14 @@ error:
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
if (s_ble_active) {
esp_btbb_disable();
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
s_ble_active = false;
}
return ret;
}
@ -770,6 +943,19 @@ esp_err_t esp_bt_controller_disable(void)
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
if (s_ble_active) {
esp_btbb_disable();
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
s_ble_active = false;
} else {
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
/* Avoid consecutive backup of register cause assertion */
sleep_retention_module_deinit();
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
}
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
return ESP_OK;
}
@ -983,6 +1169,29 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
return (esp_power_level_t)tx_level;
}
#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;
portENTER_CRITICAL_SAFE(&spinlock);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED == true)
#define BLE_SM_KEY_ERR 0x17

View File

@ -196,7 +196,7 @@ extern "C" {
#define BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N (3000)
#define RTC_FREQ_N (160000) /* in Hz */
#define RTC_FREQ_N (32768) /* in Hz */
#define BLE_LL_TX_PWR_DBM_N (9)

View File

@ -260,6 +260,33 @@ config BT_LE_CONTROLLER_TASK_STACK_SIZE
help
This configures stack size of NimBLE controller task
config BT_LE_CONTROLLER_LOG_ENABLED
bool "Controller log enable"
default n
help
Enable controller log
config BT_LE_CONTROLLER_LOG_CTRL_ENABLED
bool "enable controller log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable controller log module
config BT_LE_CONTROLLER_LOG_HCI_ENABLED
bool "enable HCI log module"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Enable hci log module
config BT_LE_CONTROLLER_LOG_DUMP_ONLY
bool "Controller log dump mode only"
depends on BT_LE_CONTROLLER_LOG_ENABLED
default y
help
Only operate in dump mode
config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
range 1 5
@ -340,7 +367,7 @@ config BT_LE_LL_SCA
config BT_LE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
depends on !BT_NIMBLE_ENABLED
range 1 9
range 1 35
default 3
help
Defines maximum number of concurrent BLE connections. For ESP32, user
@ -380,19 +407,24 @@ config BT_LE_SLEEP_ENABLE
help
Enable BLE sleep
choice BT_LE_WAKEUP_SOURCE
prompt "BLE light sleep wakeup source"
depends on BT_LE_SLEEP_ENABLE
default BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
config BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
bool "Use ESP timer to wakeup CPU"
choice BT_LE_LP_CLK_SRC
prompt "BLE low power clock source"
default BT_LE_LP_CLK_SRC_MAIN_XTAL
config BT_LE_LP_CLK_SRC_MAIN_XTAL
bool "Use main XTAL as RTC clock source"
help
Use esp timer to wakeup CPU
User main XTAL as RTC clock source.
This option is recommended if external 32.768k XTAL is not available.
Using the external 32.768 kHz XTAL will have lower current consumption
in light sleep compared to using the main XTAL.
config BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
bool "Use BLE rtc timer to wakeup CPU"
config BT_LE_LP_CLK_SRC_DEFAULT
bool "Use system RTC slow clock source"
help
Use BLE rtc timer to wakeup CPU
Use the same slow clock source as system RTC
Using any clock source other than external 32.768 kHz XTAL supports only
legacy ADV and SCAN due to low clock accuracy.
endchoice
config BT_LE_USE_ESP_TIMER
@ -402,3 +434,112 @@ config BT_LE_USE_ESP_TIMER
help
Set this option to use Esp Timer which has higher priority timer
instead of FreeRTOS timer
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
default y
help
The function is mainly used to enable flow control for advertising reports. When it is enabled,
advertising reports will be discarded by the controller if the number of unprocessed advertising
reports exceeds the size of BLE adv report flow control.
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM
int "BLE adv report flow control number"
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
range 50 1000
default 100
help
The number of unprocessed advertising report that bluetooth host can save.If you set
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a small value, this may cause adv packets lost.
If you set `BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` to a large value, bluetooth host may cache a
lot of adv packets and this may cause system memory run out. For example, if you set
it to 50, the maximum memory consumed by host is 35 * 50 bytes. Please set
`BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_NUM` according to your system free memory and handle adv
packets as fast as possible, otherwise it will cause adv packets lost.
config BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD
int "BLE adv lost event threshold value"
depends on BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
range 1 1000
default 20
help
When adv report flow control is enabled, The ADV lost event will be generated when the number
of ADV packets lost in the controller reaches this threshold. It is better to set a larger value.
If you set `BT_CTRL_BLE_ADV_REPORT_DISCARD_THRSHOLD` to a small value or printf every adv lost event, it
may cause adv packets lost more.
config BT_LE_SCAN_DUPL
bool "BLE Scan Duplicate Options"
default y
help
This select enables parameters setting of BLE scan duplicate.
choice BT_LE_SCAN_DUPL_TYPE
prompt "Scan Duplicate Type"
default BT_LE_SCAN_DUPL_TYPE_DEVICE
depends on BT_LE_SCAN_DUPL
help
Scan duplicate have three ways. one is "Scan Duplicate By Device Address", This way is to use
advertiser address filtering. The adv packet of the same address is only allowed to be reported once.
Another way is "Scan Duplicate By Device Address And Advertising Data". This way is to use advertising
data and device address filtering. All different adv packets with the same address are allowed to be
reported. The last way is "Scan Duplicate By Advertising Data". This way is to use advertising data
filtering. All same advertising data only allow to be reported once even though they are from
different devices.
config BT_LE_SCAN_DUPL_TYPE_DEVICE
bool "Scan Duplicate By Device Address"
help
This way is to use advertiser address filtering. The adv packet of the same address is only
allowed to be reported once
config BT_LE_SCAN_DUPL_TYPE_DATA
bool "Scan Duplicate By Advertising Data"
help
This way is to use advertising data filtering. All same advertising data only allow to be reported
once even though they are from different devices.
config BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
bool "Scan Duplicate By Device Address And Advertising Data"
help
This way is to use advertising data and device address filtering. All different adv packets with
the same address are allowed to be reported.
endchoice
config BT_LE_SCAN_DUPL_TYPE
int
depends on BT_LE_SCAN_DUPL
default 0 if BT_LE_SCAN_DUPL_TYPE_DEVICE
default 1 if BT_LE_SCAN_DUPL_TYPE_DATA
default 2 if BT_LE_SCAN_DUPL_TYPE_DATA_DEVICE
default 0
config BT_LE_SCAN_DUPL_CACHE_SIZE
int "Maximum number of devices in scan duplicate filter"
depends on BT_LE_SCAN_DUPL
range 10 1000
default 100
help
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BT_LE_SCAN_DUPL
range 0 1000
default 0
help
If the period value is non-zero, the controller will periodically clear the device information
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
Host in advertising report events.
There are two scenarios where the ADV packet will be repeatedly reported:
1. The duplicate scan cache is full, the controller will delete the oldest device information and
add new device information.
2. When the refresh period is up, the controller will clear all device information and start filtering
again.
config BT_LE_MSYS_INIT_IN_CONTROLLER
bool
default y

View File

@ -40,6 +40,11 @@
#include "hci_uart.h"
#include "bt_osi_mem.h"
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/sleep_modem.h"
#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
@ -49,7 +54,7 @@
#include "esp_private/periph_ctrl.h"
#include "esp_sleep.h"
#include "soc/rtc.h"
/* Macro definition
************************************************************************
*/
@ -67,7 +72,6 @@
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif // CONFIG_BT_BLUEDROID_ENABLED
/* Types definition
************************************************************************
*/
@ -104,12 +108,20 @@ struct ext_funcs_t {
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t*addr, bool end);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int ble_controller_init(esp_bt_controller_config_t *cfg);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
extern int ble_log_init_async(interface_func_t bt_controller_log_interface, bool task_create, uint8_t buffers, uint32_t *bufs_size);
extern int ble_log_deinit_async(void);
extern void ble_log_async_select_dump_buffers(uint8_t buffers);
extern void ble_log_async_output_dump_all(bool output);
#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);
@ -119,14 +131,18 @@ extern int 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 int os_msys_buf_alloc(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 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 ble_rtc_wake_up_state_clr(void);
extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_buf_free(void);
extern void os_msys_deinit(void);
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);
@ -167,13 +183,22 @@ static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#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[] = {6144, 1024, 2048};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
@ -181,15 +206,8 @@ static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#define BLE_RTC_DELAY_US (1100)
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US (0)
static void ble_sleep_timer_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_ble_sleep_timer = NULL;
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (5100)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (1500)
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
._magic = OSI_COEX_MAGIC_VALUE,
@ -218,8 +236,8 @@ struct ext_funcs_t ext_funcs_ro = {
._task_delete = task_delete_wrapper,
._osi_assert = osi_assert_wrapper,
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = ble_sm_alg_gen_key_pair,
._ecc_gen_dh_key = ble_sm_alg_gen_dhkey,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE,
};
@ -233,6 +251,9 @@ static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
BT_ASSERT_PRINT("BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_ble_controller_log_dump_all(true);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
assert(0);
}
@ -299,6 +320,7 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
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);
}
@ -335,6 +357,25 @@ static void task_delete_wrapper(void *task_handle)
vTaskDelete(task_handle);
}
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv)
{
int rc = -1;
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
rc = ble_sm_alg_gen_key_pair(pub, priv);
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
return rc;
}
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey)
{
int rc = -1;
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
rc = ble_sm_alg_gen_dhkey(peer_pub_key_x, peer_pub_key_y, our_priv_key, out_dhkey);
#endif // CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
return rc;
}
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
static void hci_uart_start_tx_wrapper(int uart_no)
{
@ -401,47 +442,46 @@ static int esp_intr_free_wrapper(void **ret_handle)
return rc;
}
void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
{
/* Select slow clock source for BT momdule */
switch (slow_clk_src) {
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (320 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_RC_SLOW:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 136 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (5 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_XTAL32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using external 32.768 kHz XTAL as clock source");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (1 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_RC32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 32 kHz RC as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (1 - 1));
break;
case MODEM_CLOCK_LPCLK_SRC_EXT32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using 32 kHz oscillator as clock source, can only run legacy ADV or SCAN due to low clock accuracy!");
modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, slow_clk_src, (1 - 1));
break;
default:
}
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
return;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
uint32_t delta_tick;
uint32_t us_to_sleep;
uint32_t sleep_tick;
uint32_t tick_invalid = *(uint32_t*)(arg);
assert(arg != NULL);
if (!tick_invalid) {
sleep_tick = r_os_cputime_get32();
/* start a timer to wake up and acquire the pm_lock before modem_sleep awakes */
delta_tick = enable_tick - sleep_tick;
if (delta_tick & 0x80000000) {
return;
}
us_to_sleep = r_os_cputime_ticks_to_usecs(delta_tick);
if (us_to_sleep <= BTDM_MIN_TIMER_UNCERTAINTY_US) {
return;
}
esp_err_t err = esp_timer_start_once(s_ble_sleep_timer,
us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
if (err != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ESP timer start failed\n");
return;
}
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_rtc_wake_up_state_clr();
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
esp_phy_disable(PHY_MODEM_BT);
#ifdef CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_disable();
s_ble_active = false;
}
@ -450,37 +490,50 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
if (s_ble_active) {
return;
}
esp_phy_enable();
#ifdef CONFIG_PM_ENABLE
esp_pm_lock_acquire(s_pm_lock);
r_ble_rtc_wake_up_state_clr();
#endif //CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
s_ble_active = true;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
static void ble_sleep_timer_callback(void * arg)
#ifdef CONFIG_FREERTOS_USE_TICKLESS_IDLE
static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra)
{
uint8_t size;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_5, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
}
return err;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif // CONFIG_PM_ENABLE
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)
{
esp_ble_set_wakeup_overhead(overhead);
}
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_err_t controller_sleep_init(void)
{
esp_err_t rc = 0;
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled\n");
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled");
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
500 + BLE_RTC_DELAY_US);
#ifdef CONFIG_PM_ENABLE
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
#endif // CONFIG_PM_ENABLE
BLE_RTC_DELAY_US_LIGHT_SLEEP);
#else
ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0,
BLE_RTC_DELAY_US_MODEM_SLEEP);
#endif /* FREERTOS_USE_TICKLESS_IDLE */
#endif // CONFIG_BT_LE_SLEEP_ENABLE
#ifdef CONFIG_PM_ENABLE
@ -488,104 +541,120 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
esp_pm_lock_acquire(s_pm_lock);
#if 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);
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
esp_timer_create_args_t create_args = {
.callback = ble_sleep_timer_callback,
.arg = NULL,
.name = "btSlp"
};
rc = esp_timer_create(&create_args, &s_ble_sleep_timer);
rc = esp_pm_register_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
if (rc != ESP_OK) {
goto error;
}
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is ESP timer");
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_enable_bt_wakeup();
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
return rc;
error:
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_release(s_pm_lock);
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_disable_bt_wakeup();
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif //CONFIG_PM_ENABLE
#endif // CONFIG_PM_ENABLE
return rc;
}
void controller_sleep_deinit(void)
{
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
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 */
#ifdef CONFIG_PM_ENABLE
/* lock should be released first */
if (s_ble_active) {
esp_pm_lock_release(s_pm_lock);
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif //CONFIG_PM_ENABLE
}
#define REG_MODEM_SYSCON_BASE 0x600A5400
#define REG_MODEM_LPCON_BASE 0x600AD000
#define DR_REG_MODEM_SYSCON_BASE REG_MODEM_SYSCON_BASE
typedef enum {
FILTER_DUPLICATE_PDUTYPE = BIT(0),
FILTER_DUPLICATE_LENGTH = BIT(1),
FILTER_DUPLICATE_ADDRESS = BIT(2),
FILTER_DUPLICATE_ADVDATA = BIT(3),
FILTER_DUPLICATE_DEFAULT = FILTER_DUPLICATE_PDUTYPE | FILTER_DUPLICATE_ADDRESS,
FILTER_DUPLICATE_PDU_ALL = 0xF,
FILTER_DUPLICATE_EXCEPTION_FOR_MESH = BIT(4),
FILTER_DUPLICATE_AD_TYPE = BIT(5),
}disc_duplicate_mode_t;
#define MODEM_SYSCON_CLK_CONF_REG (DR_REG_MODEM_SYSCON_BASE + 0x4)
#define MODEM_SYSCON_CLK_CONF1_REG (DR_REG_MODEM_SYSCON_BASE + 0x10)
#define MODEM_LPCON_CLK_CONF_REG (REG_MODEM_LPCON_BASE + 0x0008)
#define MODEM_LPCON_CLK_CONF_FORCE_ON_REG (REG_MODEM_LPCON_BASE + 0x000C)
#include "hal/clk_tree_ll.h"
extern void filter_duplicate_mode_enable(disc_duplicate_mode_t mode);
extern void filter_duplicate_mode_disable(disc_duplicate_mode_t mode);
extern void filter_duplicate_set_ring_list_max_num(uint32_t max_num);
extern void scan_duplicate_cache_refresh_set_time(uint32_t period_time);
static void enable_chip_clk(void)
int
ble_vhci_disc_duplicate_mode_enable(int mode)
{
WRITE_PERI_REG(MODEM_SYSCON_CLK_CONF_REG,0xFFFFFFFF);
WRITE_PERI_REG(MODEM_SYSCON_CLK_CONF1_REG,0xFFFFFFFF);
WRITE_PERI_REG(MODEM_LPCON_CLK_CONF_REG ,0xFFFFFFFF);
// SET BIT for BLE RTC clk
SET_PERI_REG_MASK(PMU_HP_SLEEP_LP_CK_POWER_REG,PMU_HP_SLEEP_XPD_XTAL32K);
// REG_SET_FIELD(LP_CLKRST_LPPERI_REG,LP_CLKRST_LP_SEL_XTAL32K,1);
// REG_SET_FIELD(LP_CLKRST_LPPERI_REG,LP_CLKRST_LP_BLETIMER_DIV_NUM,0);
// TODO: use vendor hci to update
filter_duplicate_mode_enable(mode);
return true;
}
/* For chip */
WRITE_PERI_REG(MODEM_LPCON_CLK_CONF_REG ,0xFFFFFFFF);
WRITE_PERI_REG(MODEM_LPCON_CLK_CONF_FORCE_ON_REG ,0xFFFFFFFF);
int
ble_vhci_disc_duplicate_mode_disable(int mode)
{
// TODO: use vendor hci to update
filter_duplicate_mode_disable(mode);
return true;
}
int ble_vhci_disc_duplicate_set_max_cache_size(int max_cache_size){
// TODO: use vendor hci to update
filter_duplicate_set_ring_list_max_num(max_cache_size);
return true;
}
int ble_vhci_disc_duplicate_set_period_refresh_time(int refresh_period_time){
// TODO: use vendor hci to update
scan_duplicate_cache_refresh_set_time(refresh_period_time);
return true;
}
/**
* @brief Config scan duplicate option mode from menuconfig (Adapt to the old configuration method.)
*/
void ble_controller_scan_duplicate_config(void)
{
uint32_t duplicate_mode = FILTER_DUPLICATE_DEFAULT;
uint32_t cache_size = 100;
#if CONFIG_BT_LE_SCAN_DUPL == true
cache_size = CONFIG_BT_LE_SCAN_DUPL_CACHE_SIZE;
if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 0) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_PDUTYPE;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 1) {
duplicate_mode = FILTER_DUPLICATE_ADVDATA;
} else if (CONFIG_BT_LE_SCAN_DUPL_TYPE == 2) {
duplicate_mode = FILTER_DUPLICATE_ADDRESS | FILTER_DUPLICATE_ADVDATA;
}
duplicate_mode |= FILTER_DUPLICATE_EXCEPTION_FOR_MESH;
ble_vhci_disc_duplicate_set_period_refresh_time(CONFIG_BT_LE_SCAN_DUPL_CACHE_REFRESH_PERIOD);
#endif
ble_vhci_disc_duplicate_mode_disable(0xFFFFFFFF);
ble_vhci_disc_duplicate_mode_enable(duplicate_mode);
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
@ -593,9 +662,9 @@ 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;
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;
@ -612,8 +681,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
return ret;
}
enable_chip_clk();
/* Initialize the function pointers for OS porting */
npl_freertos_funcs_init();
struct npl_funcs_t *p_npl_funcs = npl_freertos_funcs_get();
@ -636,15 +703,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_mem;
}
/* Initialize the global memory pool */
ret = os_msys_buf_alloc();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "os msys alloc failed");
goto free_mem;
}
os_msys_init();
#if CONFIG_BT_NIMBLE_ENABLED
/* ble_npl_eventq_init() needs to use npl functions in rom and
* must be called after esp_bt_controller_init().
@ -653,26 +711,80 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_BT_NIMBLE_ENABLED
/* Enable BT-related clocks */
// modem_clock_module_enable(PERIPH_BT_MODULE);
// modem_clock_select_lp_clock_source(PERIPH_BT_MODULE, MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL, 249);
// esp_phy_modem_init();
esp_phy_enable();
esp_btbb_enable();
s_ble_active = true;
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 */
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");
ret = ESP_ERR_INVALID_ARG;
goto free_controller;
goto modem_deint;
}
#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 = 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
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);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto modem_deint;
}
esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
ret = os_msys_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "msys_init failed %d", ret);
goto free_controller;
}
@ -694,17 +806,18 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
free_controller:
controller_sleep_deinit();
os_msys_deinit();
ble_controller_deinit();
esp_btbb_disable();
esp_phy_disable();
// esp_phy_modem_deinit();
// modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
// modem_clock_module_disable(PERIPH_BT_MODULE);
modem_deint:
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
#if CONFIG_BT_NIMBLE_ENABLED
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
free_mem:
os_msys_buf_free();
npl_freertos_mempool_deinit();
esp_unregister_npl_funcs();
npl_freertos_funcs_deinit();
@ -722,16 +835,14 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
esp_btbb_disable();
os_msys_deinit();
if (s_ble_active) {
esp_phy_disable();
s_ble_active = false;
}
// esp_phy_modem_deinit();
// modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
// modem_clock_module_disable(PERIPH_BT_MODULE);
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
#if CONFIG_BT_NIMBLE_ENABLED
@ -739,8 +850,6 @@ esp_err_t esp_bt_controller_deinit(void)
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
os_msys_buf_free();
esp_unregister_npl_funcs();
esp_unregister_ext_funcs();
@ -767,7 +876,14 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
}
if (!s_ble_active) {
#if CONFIG_PM_ENABLE
esp_pm_lock_acquire(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_enable(PHY_MODEM_BT);
s_ble_active = true;
}
esp_btbb_enable();
#if CONFIG_SW_COEXIST_ENABLE
coex_enable();
#endif // CONFIG_SW_COEXIST_ENABLE
@ -783,6 +899,14 @@ error:
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
esp_btbb_disable();
if (s_ble_active) {
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
s_ble_active = false;
}
return ret;
}
@ -798,6 +922,14 @@ esp_err_t esp_bt_controller_disable(void)
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
esp_btbb_disable();
if (s_ble_active) {
esp_phy_disable(PHY_MODEM_BT);
#if CONFIG_PM_ENABLE
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
s_ble_active = false;
}
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
return ESP_OK;
}
@ -1011,6 +1143,29 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
return (esp_power_level_t)tx_level;
}
#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;
portENTER_CRITICAL_SAFE(&spinlock);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT("]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED == true)
#define BLE_SM_KEY_ERR 0x17

View File

@ -1,392 +0,0 @@
menu "HCI Config"
choice BT_LE_HCI_INTERFACE
prompt "Select HCI interface"
default BT_LE_HCI_INTERFACE_USE_RAM
config BT_LE_HCI_INTERFACE_USE_RAM
bool "ram"
help
Use RAM as HCI interface
config BT_LE_HCI_INTERFACE_USE_UART
bool "uart"
help
Use UART as HCI interface
endchoice
config BT_LE_HCI_UART_PORT
int "HCI UART port"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 1
help
Set the port number of HCI UART
config BT_LE_HCI_UART_FLOWCTRL
bool "HCI uart Hardware Flow ctrl"
depends on BT_LE_HCI_INTERFACE_USE_UART
default n
config BT_LE_HCI_UART_TX_PIN
int "HCI uart Tx gpio"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 19
config BT_LE_HCI_UART_RX_PIN
int "HCI uart Rx gpio"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 10
config BT_LE_HCI_UART_RTS_PIN
int "HCI uart RTS gpio"
depends on BT_LE_HCI_UART_FLOWCTRL
default 4
config BT_LE_HCI_UART_CTS_PIN
int "HCI uart CTS gpio"
depends on BT_LE_HCI_UART_FLOWCTRL
default 5
config BT_LE_HCI_UART_BAUD
int "HCI uart baudrate"
depends on BT_LE_HCI_INTERFACE_USE_UART
default 921600
help
HCI uart baud rate 115200 ~ 1000000
choice BT_LE_HCI_UART_PARITY
prompt "select uart parity"
depends on BT_LE_HCI_INTERFACE_USE_UART
default BT_LE_HCI_UART_UART_PARITY_DISABLE
config BT_LE_HCI_UART_UART_PARITY_DISABLE
bool "PARITY_DISABLE"
help
UART_PARITY_DISABLE
config BT_LE_HCI_UART_UART_PARITY_EVEN
bool "PARITY_EVEN"
help
UART_PARITY_EVEN
config BT_LE_HCI_UART_UART_PARITY_ODD
bool "PARITY_ODD"
help
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
help
Set the size of uart task stack
endmenu
config BT_LE_CONTROLLER_NPL_OS_PORTING_SUPPORT
bool
default y
help
Enable NPL porting for controller.
menuconfig BT_LE_50_FEATURE_SUPPORT
bool "Enable BLE 5 feature"
depends on !BT_NIMBLE_ENABLED
default y
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 Transer 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_MAX_PERIODIC_SYNCS
int "Maximum number of periodic advertising syncs"
depends on BT_LE_50_FEATURE_SUPPORT && !BT_NIMBLE_ENABLED
range 0 8
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
config BT_LE_MSYS_1_BLOCK_COUNT
int "MSYS_1 Block Count"
default 12
help
MSYS is a system level mbuf registry. For prepare write & prepare
responses MBUFs are allocated out of msys_1 pool. For NIMBLE_MESH
enabled cases, this block count is increased by 8 than user defined
count.
config BT_LE_MSYS_1_BLOCK_SIZE
int "MSYS_1 Block Size"
default 256
help
Dynamic memory size of block 1
config BT_LE_MSYS_2_BLOCK_COUNT
int "MSYS_2 Block Count"
default 24
help
Dynamic memory count
config BT_LE_MSYS_2_BLOCK_SIZE
int "MSYS_2 Block Size"
default 320
help
Dynamic memory size of block 2
config BT_LE_ACL_BUF_COUNT
int "ACL Buffer count"
default 10
help
The number of ACL data buffers.
config BT_LE_ACL_BUF_SIZE
int "ACL Buffer size"
default 517
help
This is the maximum size of the data portion of HCI ACL data packets.
It does not include the HCI data header (of 4 bytes)
config BT_LE_HCI_EVT_BUF_SIZE
int "HCI Event Buffer size"
default 257 if BT_LE_EXT_ADV
default 70
help
This is the size of each HCI event buffer in bytes. In case of
extended advertising, packets can be fragmented. 257 bytes is the
maximum size of a packet.
config BT_LE_HCI_EVT_HI_BUF_COUNT
int "High Priority HCI Event Buffer count"
default 30
help
This is the high priority HCI events' buffer size. High-priority
event buffers are for everything except advertising reports. If there
are no free high-priority event buffers then host will try to allocate a
low-priority buffer instead
config BT_LE_HCI_EVT_LO_BUF_COUNT
int "Low Priority HCI Event Buffer count"
default 8
help
This is the low priority HCI events' buffer size. Low-priority event
buffers are only used for advertising reports. If there are no free
low-priority event buffers, then an incoming advertising report will
get dropped
endmenu
config BT_LE_CONTROLLER_TASK_STACK_SIZE
int "Controller task stack size"
default 5120 if BLE_MESH
default 4096
help
This configures stack size of NimBLE controller task
config BT_LE_LL_RESOLV_LIST_SIZE
int "BLE LL Resolving list size"
range 1 5
default 4
help
Configure the size of resolving list used in link layer.
menuconfig BT_LE_SECURITY_ENABLE
bool "Enable BLE SM feature"
depends on !BT_NIMBLE_ENABLED
default y
help
Enable BLE sm feature
config BT_LE_SM_LEGACY
bool "Security manager legacy pairing"
depends on BT_LE_SECURITY_ENABLE
default y
help
Enable security manager legacy pairing
config BT_LE_SM_SC
bool "Security manager secure connections (4.2)"
depends on BT_LE_SECURITY_ENABLE
default y
help
Enable security manager secure connections
config BT_LE_SM_SC_DEBUG_KEYS
bool "Use predefined public-private key pair"
default n
depends on BT_LE_SECURITY_ENABLE && BT_LE_SM_SC
help
If this option is enabled, SM uses predefined DH key pair as described
in Core Specification, Vol. 3, Part H, 2.3.5.6.1. This allows to
decrypt air traffic easily and thus should only be used for debugging.
config BT_LE_LL_CFG_FEAT_LE_ENCRYPTION
bool "Enable LE encryption"
depends on BT_LE_SECURITY_ENABLE
default y
help
Enable encryption connection
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
computations.
config BT_LE_WHITELIST_SIZE
int "BLE white list size"
range 1 15
default 12
depends on !BT_NIMBLE_ENABLED
help
BLE list size
config BT_LE_LL_DUP_SCAN_LIST_COUNT
int "BLE duplicate scan list count"
range 1 100
default 20
help
config the max count of duplicate scan list
config BT_LE_LL_SCA
int "BLE Sleep clock accuracy"
range 0 500
default 60
help
Sleep clock accuracy of our device (in ppm)
config BT_LE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
depends on !BT_NIMBLE_ENABLED
range 1 9
default 3
help
Defines maximum number of concurrent BLE connections. For ESP32, user
is expected to configure BTDM_CTRL_BLE_MAX_CONN from controller menu
along with this option. Similarly for ESP32-C3 or ESP32-S3, user is expected to
configure BT_CTRL_BLE_MAX_ACT from controller menu.
Each connection will take about 1k DRAM.
choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
default BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
depends on !BT_NIMBLE_ENABLED
help
When using PHY-Coded in BLE connection, limitation on max tx/rx time can be applied to
better avoid dramatic performance deterioration of Wi-Fi.
config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
bool "Force Enable"
help
Always enable the limitation on max tx/rx time for Coded-PHY connection
config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
bool "Force Disable"
help
Disable the limitation on max tx/rx time for Coded-PHY connection
endchoice
config BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF
int
depends on !BT_NIMBLE_ENABLED
default 1 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
default 0 if BT_LE_COEX_PHY_CODED_TX_RX_TLIM_DIS
config BT_LE_SLEEP_ENABLE
bool "Enable BLE sleep"
default n
help
Enable BLE sleep
choice BT_LE_WAKEUP_SOURCE
prompt "BLE light sleep wakeup source"
depends on BT_LE_SLEEP_ENABLE
default BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
config BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
bool "Use ESP timer to wakeup CPU"
help
Use esp timer to wakeup CPU
endchoice
config BT_LE_USE_ESP_TIMER
bool "Use Esp Timer for callout"
depends on !BT_NIMBLE_ENABLED
default y
help
Set this option to use Esp Timer which has higher priority timer
instead of FreeRTOS timer

File diff suppressed because it is too large Load Diff

View File

@ -8,11 +8,12 @@ if BLE_MESH
config BLE_MESH_USE_DUPLICATE_SCAN
bool "Support Duplicate Scan in BLE Mesh"
depends on BT_BLUEDROID_ENABLED
select BTDM_BLE_SCAN_DUPL if IDF_TARGET_ESP32
select BTDM_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32
select BT_CTRL_BLE_SCAN_DUPL if IDF_TARGET_ESP32C3
select BT_CTRL_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32C3
select BT_LE_SCAN_DUPL if IDF_TARGET_ESP32C6
select BT_LE_SCAN_DUPL if IDF_TARGET_ESP32H2
default y
help
Enable this option to allow using specific duplicate scan filter

View File

@ -79,7 +79,7 @@ void btc_ble_mesh_time_scene_client_arg_deep_free(btc_msg_t *msg)
{
btc_ble_mesh_time_scene_client_args_t *arg = NULL;
if (!msg || !msg->arg) {
if (!msg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
@ -166,7 +166,7 @@ static void btc_ble_mesh_time_scene_client_free_req_data(btc_msg_t *msg)
{
esp_ble_mesh_time_scene_client_cb_param_t *arg = NULL;
if (!msg || !msg->arg) {
if (!msg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
@ -293,7 +293,7 @@ void btc_ble_mesh_time_scene_client_call_handler(btc_msg_t *msg)
esp_ble_mesh_time_scene_client_cb_param_t cb = {0};
bt_mesh_client_common_param_t common = {0};
if (!msg || !msg->arg) {
if (!msg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}
@ -353,7 +353,7 @@ void btc_ble_mesh_time_scene_client_cb_handler(btc_msg_t *msg)
{
esp_ble_mesh_time_scene_client_cb_param_t *param = NULL;
if (!msg || !msg->arg) {
if (!msg) {
BT_ERR("%s, Invalid parameter", __func__);
return;
}

View File

@ -45,6 +45,8 @@ void btc_ble_mesh_time_scene_client_cb_handler(btc_msg_t *msg);
void btc_ble_mesh_time_scene_client_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src);
void btc_ble_mesh_time_scene_client_arg_deep_free(btc_msg_t *msg);
void btc_ble_mesh_time_scene_client_publish_callback(uint32_t opcode, struct bt_mesh_model *model,
struct bt_mesh_msg_ctx *ctx,
struct net_buf_simple *buf);

View File

@ -502,7 +502,7 @@ int bt_le_update_white_list(struct bt_mesh_white_list *wl)
}
if (BTM_BleUpdateAdvWhitelist(wl->add_remove, wl->remote_bda,
wl->addr_type, (tBTM_ADD_WHITELIST_CBACK *)wl->update_wl_comp_cb) == false) {
wl->addr_type, (tBTM_UPDATE_WHITELIST_CBACK *)wl->update_wl_comp_cb) == false) {
return -EIO;
}
@ -1615,6 +1615,7 @@ static void bt_mesh_bta_gattc_cb(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
}
break;
case BTA_GATTC_CLOSE_EVT:
bta_gattc_clcb_dealloc_by_conn_id(p_data->close.conn_id);
BT_DBG("BTA_GATTC_CLOSE_EVT");
break;
case BTA_GATTC_CONNECT_EVT: {

View File

@ -197,6 +197,8 @@ static bool prov_bearers_valid(bt_mesh_prov_bearer_t bearers)
int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
{
int err = 0;
if (bt_mesh_is_provisioned()) {
BT_WARN("%s, Already", __func__);
return -EALREADY;
@ -232,7 +234,11 @@ int bt_mesh_prov_enable(bt_mesh_prov_bearer_t bearers)
if (IS_ENABLED(CONFIG_BLE_MESH_PB_ADV) &&
(bearers & BLE_MESH_PROV_ADV)) {
/* Make sure we're scanning for provisioning invitations */
bt_mesh_scan_enable();
err = bt_mesh_scan_enable();
if (err) {
return err;
}
/* Enable unprovisioned beacon sending */
bt_mesh_beacon_enable();
}
@ -637,7 +643,10 @@ int bt_mesh_provisioner_enable(bt_mesh_prov_bearer_t bearers)
bt_mesh_beacon_enable();
}
bt_mesh_scan_enable();
err = bt_mesh_scan_enable();
if (err) {
return err;
}
return 0;
}

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-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -88,7 +88,8 @@ int bt_mesh_host_init(void)
int rc;
if (init == true) {
return -EALREADY;
BT_WARN("Already initialized host for mesh!");
return 0;
}
rc = btc_init();
@ -1943,9 +1944,43 @@ int bt_mesh_encrypt_be(const uint8_t key[16], const uint8_t plaintext[16],
}
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint8_t type, void *info)
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
{
BT_ERR("Unsupported for NimBLE host");
return 0;
uint8_t value[6] = {0};
int rc = 0;
#if MYNEWT_VAL(BLE_HCI_VS)
struct ble_hci_vs_duplicate_exception_list_cp cmd;
#endif
if ((sub_code > BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN) ||
(sub_code < BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
type > BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV) ||
(sub_code == BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
!(type & BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST))) {
BT_ERR("%s, Invalid parameter", __func__);
return -EINVAL;
}
if (type == BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID) {
if (!info) {
BT_ERR("Invalid Provisioning Link ID");
return -EINVAL;
}
sys_memcpy_swap(value, info, sizeof(uint32_t));
}
BT_DBG("%s exceptional list, type 0x%08x", sub_code ? "Remove" : "Add", type);
#if MYNEWT_VAL(BLE_HCI_VS)
cmd.operation = sub_code;
cmd.type = htole32(type);
memcpy(&cmd.device_info, value, 6);
rc = ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST,
&cmd, sizeof(cmd), NULL, 0);
#endif
return rc;
}
#endif

View File

@ -1547,13 +1547,8 @@ int bt_mesh_provisioner_store_node_info(struct bt_mesh_node *node)
#define HEARTBEAT_FILTER_ADD 0x00
#define HEARTBEAT_FILTER_REMOVE 0x01
#define HEARTBEAT_FILTER_WITH_SRC BIT(0)
#define HEARTBEAT_FILTER_WITH_DST BIT(1)
#define HEARTBEAT_FILTER_WITH_BOTH (BIT(1) | BIT(0))
static struct heartbeat_recv {
struct heartbeat_filter {
uint8_t type; /* Indicate if using src or dst or both to filter heartbeat messages */
uint16_t src; /* Heartbeat source address (unicast address) */
uint16_t dst; /* Heartbeat destination address (unicast address or group address) */
} filter[CONFIG_BLE_MESH_PROVISIONER_RECV_HB_FILTER_SIZE];
@ -1590,19 +1585,6 @@ int bt_mesh_provisioner_set_heartbeat_filter_type(uint8_t type)
return 0;
}
static inline uint8_t get_filter_addr_type(uint16_t src, uint16_t dst)
{
if (BLE_MESH_ADDR_IS_UNICAST(src)) {
if (BLE_MESH_ADDR_IS_UNICAST(dst) || BLE_MESH_ADDR_IS_GROUP(dst)) {
return HEARTBEAT_FILTER_WITH_BOTH;
} else {
return HEARTBEAT_FILTER_WITH_SRC;
}
} else {
return HEARTBEAT_FILTER_WITH_DST;
}
}
static int hb_filter_alloc(uint16_t src, uint16_t dst)
{
int i;
@ -1612,7 +1594,6 @@ static int hb_filter_alloc(uint16_t src, uint16_t dst)
if (filter->src == BLE_MESH_ADDR_UNASSIGNED &&
filter->dst == BLE_MESH_ADDR_UNASSIGNED) {
filter->type = get_filter_addr_type(src, dst);
filter->src = src;
filter->dst = dst;
return 0;
@ -1627,8 +1608,8 @@ static int hb_filter_add(uint16_t src, uint16_t dst)
{
int i;
if (!BLE_MESH_ADDR_IS_UNICAST(src) &&
!BLE_MESH_ADDR_IS_UNICAST(dst) && !BLE_MESH_ADDR_IS_GROUP(dst)) {
if (!(BLE_MESH_ADDR_IS_UNICAST(src) &&
(BLE_MESH_ADDR_IS_UNICAST(dst) || BLE_MESH_ADDR_IS_GROUP(dst)))) {
BT_ERR("Invalid filter address, src 0x%04x, dst 0x%04x", src, dst);
return -EINVAL;
}
@ -1637,10 +1618,9 @@ static int hb_filter_add(uint16_t src, uint16_t dst)
for (i = 0; i < ARRAY_SIZE(hb_rx.filter); i++) {
struct heartbeat_filter *filter = &hb_rx.filter[i];
if ((BLE_MESH_ADDR_IS_UNICAST(src) && filter->src == src) ||
((BLE_MESH_ADDR_IS_UNICAST(dst) || BLE_MESH_ADDR_IS_GROUP(dst)) &&
filter->dst == dst)) {
memset(filter, 0, sizeof(struct heartbeat_filter));
if (filter->src == src && filter->dst == dst) {
BT_WARN("Filter already exists, src 0x%04x dst 0x%04x", filter->src, filter->dst);
return 0;
}
}
@ -1651,8 +1631,8 @@ static int hb_filter_remove(uint16_t src, uint16_t dst)
{
int i;
if (!BLE_MESH_ADDR_IS_UNICAST(src) &&
!BLE_MESH_ADDR_IS_UNICAST(dst) && !BLE_MESH_ADDR_IS_GROUP(dst)) {
if (!(BLE_MESH_ADDR_IS_UNICAST(src) &&
(BLE_MESH_ADDR_IS_UNICAST(dst) || BLE_MESH_ADDR_IS_GROUP(dst)))) {
BT_ERR("Invalid filter address, src 0x%04x, dst 0x%04x", src, dst);
return -EINVAL;
}
@ -1660,9 +1640,7 @@ static int hb_filter_remove(uint16_t src, uint16_t dst)
for (i = 0; i < ARRAY_SIZE(hb_rx.filter); i++) {
struct heartbeat_filter *filter = &hb_rx.filter[i];
if ((BLE_MESH_ADDR_IS_UNICAST(src) && filter->src == src) ||
((BLE_MESH_ADDR_IS_UNICAST(dst) || BLE_MESH_ADDR_IS_GROUP(dst)) &&
filter->dst == dst)) {
if (filter->src == src && filter->dst == dst) {
memset(filter, 0, sizeof(struct heartbeat_filter));
}
}
@ -1689,26 +1667,8 @@ static bool filter_with_rejectlist(uint16_t hb_src, uint16_t hb_dst)
for (i = 0; i < ARRAY_SIZE(hb_rx.filter); i++) {
struct heartbeat_filter *filter = &hb_rx.filter[i];
switch (filter->type) {
case HEARTBEAT_FILTER_WITH_SRC:
if (hb_src == filter->src) {
return true;
}
break;
case HEARTBEAT_FILTER_WITH_DST:
if (hb_dst == filter->dst) {
return true;
}
break;
case HEARTBEAT_FILTER_WITH_BOTH:
if (hb_src == filter->src && hb_dst == filter->dst) {
return true;
}
break;
default:
BT_DBG("Unknown filter addr type 0x%02x", filter->type);
break;
if (hb_src == filter->src && hb_dst == filter->dst) {
return true;
}
}
@ -1721,26 +1681,8 @@ static bool filter_with_acceptlist(uint16_t hb_src, uint16_t hb_dst)
for (i = 0; i < ARRAY_SIZE(hb_rx.filter); i++) {
struct heartbeat_filter *filter = &hb_rx.filter[i];
switch (filter->type) {
case HEARTBEAT_FILTER_WITH_SRC:
if (hb_src == filter->src) {
return false;
}
break;
case HEARTBEAT_FILTER_WITH_DST:
if (hb_dst == filter->dst) {
return false;
}
break;
case HEARTBEAT_FILTER_WITH_BOTH:
if (hb_src == filter->src && hb_dst == filter->dst) {
return false;
}
break;
default:
BT_DBG("Unknown filter addr type 0x%02x", filter->type);
break;
if (hb_src == filter->src && hb_dst == filter->dst) {
return false;
}
}

View File

@ -19,6 +19,8 @@
#include "provisioner_prov.h"
#include "provisioner_main.h"
#define PROV_SVC_ADV_RX_CHECK(pre, cur) ((cur) < (pre) ? ((cur) + (UINT32_MAX - (pre)) >= 200) : ((cur) - (pre) >= 200))
#if CONFIG_BLE_MESH_PROVISIONER
_Static_assert(BLE_MESH_MAX_CONN >= CONFIG_BLE_MESH_PBG_SAME_TIME,
@ -3426,6 +3428,21 @@ int bt_mesh_provisioner_prov_deinit(bool erase)
}
#endif /* CONFIG_BLE_MESH_DEINIT */
static bool bt_mesh_prov_svc_adv_filter(void)
{
static uint32_t timestamp = 0;
static uint32_t pre_timestamp = 0;
timestamp = k_uptime_get_32();
if (PROV_SVC_ADV_RX_CHECK(pre_timestamp, timestamp)) {
pre_timestamp = timestamp;
return false;
}
return true;
}
static bool is_unprov_dev_info_callback_to_app(bt_mesh_prov_bearer_t bearer, const uint8_t uuid[16],
const bt_mesh_addr_t *addr, uint16_t oob_info, int8_t rssi)
{
@ -3443,6 +3460,11 @@ static bool is_unprov_dev_info_callback_to_app(bt_mesh_prov_bearer_t bearer, con
if (i == ARRAY_SIZE(unprov_dev)) {
BT_DBG("Device not in queue, notify to app layer");
if (adv_type == BLE_MESH_ADV_IND && bt_mesh_prov_svc_adv_filter()) {
return true;
}
if (notify_unprov_adv_pkt_cb) {
notify_unprov_adv_pkt_cb(addr->val, addr->type, adv_type, uuid, oob_info, bearer, rssi);
}
@ -3470,7 +3492,7 @@ void bt_mesh_provisioner_unprov_beacon_recv(struct net_buf_simple *buf, int8_t r
uint16_t oob_info = 0U;
if (!(prov_ctx.bearers & BLE_MESH_PROV_ADV)) {
BT_WARN("Not support PB-ADV bearer");
BT_INFO("Not support PB-ADV bearer");
return;
}
@ -3506,7 +3528,7 @@ void bt_mesh_provisioner_prov_adv_recv(struct net_buf_simple *buf,
uint16_t oob_info = 0U;
if (!(prov_ctx.bearers & BLE_MESH_PROV_GATT)) {
BT_WARN("Not support PB-GATT bearer");
BT_INFO("Not support PB-GATT bearer");
return;
}

View File

@ -47,6 +47,13 @@ config BT_CLASSIC_ENABLED
help
For now this option needs "SMP_ENABLE" to be set to yes
config BT_CLASSIC_BQB_ENABLED
bool "Host Qualitifcation support for Classic Bluetooth"
depends on BT_CLASSIC_ENABLED
default n
help
This enables functionalities of Host qualification for Classic Bluetooth.
config BT_A2DP_ENABLE
bool "A2DP"
depends on BT_CLASSIC_ENABLED
@ -1136,3 +1143,24 @@ config BT_BLE_42_FEATURES_SUPPORTED
default n
help
This enables BLE 4.2 features.
config BT_BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
bool "Enable BLE periodic advertising sync transfer feature"
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
default n
help
This enables BLE periodic advertising sync transfer feature
config BT_BLE_FEAT_PERIODIC_ADV_ENH
bool "Enable periodic adv enhancements(adi support)"
depends on (BT_BLUEDROID_ENABLED && BT_BLE_50_FEATURES_SUPPORTED && SOC_ESP_NIMBLE_CONTROLLER)
default n
help
Enable the periodic advertising enhancements
config BT_BLE_HIGH_DUTY_ADV_INTERVAL
bool "Enable BLE high duty advertising interval feature"
depends on BT_BLUEDROID_ENABLED
default n
help
This enable BLE high duty advertising interval feature

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -138,7 +138,7 @@ esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params)
if (ESP_BLE_IS_VALID_PARAM(params->min_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(params->max_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(params->timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
(params->latency <= ESP_BLE_CONN_LATENCY_MAX || params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
(params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
((params->timeout * 10) >= ((1 + params->latency) * ((params->max_int * 5) >> 1))) && params->min_int <= params->max_int) {
msg.sig = BTC_SIG_API_CALL;
@ -354,7 +354,7 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
if (ESP_BLE_IS_VALID_PARAM(min_conn_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(max_conn_int, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(supervision_tout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
(slave_latency <= ESP_BLE_CONN_LATENCY_MAX || slave_latency == ESP_BLE_CONN_PARAM_UNDEF) &&
(slave_latency <= ESP_BLE_CONN_LATENCY_MAX) &&
((supervision_tout * 10) >= ((1 + slave_latency) * ((max_conn_int * 5) >> 1))) && min_conn_int <= max_conn_int) {
msg.sig = BTC_SIG_API_CALL;
@ -431,8 +431,7 @@ esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_l
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (raw_data == NULL
|| (raw_data_len <= 0 || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX)) {
if ((raw_data_len != 0 && raw_data == NULL) || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX) {
return ESP_ERR_INVALID_ARG;
}
@ -471,8 +470,7 @@ esp_err_t esp_ble_gap_config_scan_rsp_data_raw(uint8_t *raw_data, uint32_t raw_d
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (raw_data == NULL
|| (raw_data_len <= 0 || raw_data_len > ESP_BLE_SCAN_RSP_DATA_LEN_MAX)) {
if ((raw_data_len != 0 && raw_data == NULL) || raw_data_len > ESP_BLE_ADV_DATA_LEN_MAX) {
return ESP_ERR_INVALID_ARG;
}
@ -1053,8 +1051,13 @@ esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_ga
}
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
const uint8_t *data, bool only_update_did)
#else
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
const uint8_t *data)
#endif
{
btc_msg_t msg;
btc_ble_5_gap_args_t arg;
@ -1068,13 +1071,22 @@ esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t le
arg.periodic_adv_cfg_data.instance = instance;
arg.periodic_adv_cfg_data.len = length;
arg.periodic_adv_cfg_data.data = (uint8_t *)data;
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
arg.periodic_adv_cfg_data.only_update_did = only_update_did;
#else
arg.periodic_adv_cfg_data.only_update_did = false;
#endif
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), btc_gap_ble_arg_deep_copy,
btc_gap_ble_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance,bool include_adi)
#else
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance)
#endif
{
btc_msg_t msg;
btc_ble_5_gap_args_t arg;
@ -1085,6 +1097,11 @@ esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance)
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_PERIODIC_ADV_START;
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
arg.periodic_adv_start.include_adi = include_adi;
#else
arg.periodic_adv_start.include_adi = false;
#endif
arg.periodic_adv_start.instance = instance;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
@ -1299,7 +1316,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
if (ESP_BLE_IS_VALID_PARAM(phy_1m_conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(phy_1m_conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(phy_1m_conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
(phy_1m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX || phy_1m_conn_params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
(phy_1m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
((phy_1m_conn_params->supervision_timeout * 10) >= ((1 + phy_1m_conn_params->latency) * ((phy_1m_conn_params->interval_max * 5) >> 1))) &&
(phy_1m_conn_params->interval_min <= phy_1m_conn_params->interval_max)) {
@ -1323,7 +1340,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
if (ESP_BLE_IS_VALID_PARAM(phy_2m_conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(phy_2m_conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(phy_2m_conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
(phy_2m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX || phy_2m_conn_params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
(phy_2m_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
((phy_2m_conn_params->supervision_timeout * 10) >= ((1 + phy_2m_conn_params->latency) * ((phy_2m_conn_params->interval_max * 5) >> 1))) &&
(phy_2m_conn_params->interval_min <= phy_2m_conn_params->interval_max)) {
@ -1347,7 +1364,7 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
if (ESP_BLE_IS_VALID_PARAM(phy_coded_conn_params->interval_min, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(phy_coded_conn_params->interval_max, ESP_BLE_CONN_INT_MIN, ESP_BLE_CONN_INT_MAX) &&
ESP_BLE_IS_VALID_PARAM(phy_coded_conn_params->supervision_timeout, ESP_BLE_CONN_SUP_TOUT_MIN, ESP_BLE_CONN_SUP_TOUT_MAX) &&
(phy_coded_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX || phy_coded_conn_params->latency == ESP_BLE_CONN_PARAM_UNDEF) &&
(phy_coded_conn_params->latency <= ESP_BLE_CONN_LATENCY_MAX) &&
((phy_coded_conn_params->supervision_timeout * 10) >= ((1 + phy_coded_conn_params->latency) * ((phy_coded_conn_params->interval_max * 5) >> 1))) &&
(phy_coded_conn_params->interval_min <= phy_coded_conn_params->interval_max)) {
@ -1371,3 +1388,95 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
}
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
esp_err_t esp_ble_gap_periodic_adv_recv_enable(uint16_t sync_handle, uint8_t enable)
{
btc_msg_t msg;
btc_ble_5_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_PERIODIC_ADV_RECV_ENABLE;
arg.periodic_adv_recv_en.sync_handle = sync_handle;
arg.periodic_adv_recv_en.enable = enable;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_periodic_adv_sync_trans(esp_bd_addr_t addr, uint16_t service_data, uint16_t sync_handle)
{
btc_msg_t msg;
btc_ble_5_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (addr == NULL) {
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_PERIODIC_ADV_SYNC_TRANS;
memcpy(arg.periodic_adv_sync_trans.addr, addr, sizeof(esp_bd_addr_t));
arg.periodic_adv_sync_trans.service_data = service_data;
arg.periodic_adv_sync_trans.sync_handle = sync_handle;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_periodic_adv_set_info_trans(esp_bd_addr_t addr, uint16_t service_data, uint8_t adv_handle)
{
btc_msg_t msg;
btc_ble_5_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (addr == NULL) {
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS;
memcpy(arg.periodic_adv_set_info_trans.addr, addr, sizeof(esp_bd_addr_t));
arg.periodic_adv_set_info_trans.service_data = service_data;
arg.periodic_adv_set_info_trans.adv_handle = adv_handle;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr, const esp_ble_gap_past_params_t *params)
{
btc_msg_t msg;
btc_ble_5_gap_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (params == NULL) {
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BLE;
msg.act = BTC_GAP_BLE_SET_PERIODIC_ADV_SYNC_TRANS_PARAMS;
if (addr) {
memcpy(arg.set_periodic_adv_sync_trans_params.addr, addr, sizeof(esp_bd_addr_t));
} else {
memset(arg.set_periodic_adv_sync_trans_params.addr, 0, sizeof(esp_bd_addr_t));
}
memcpy(&arg.set_periodic_adv_sync_trans_params.params, params, sizeof(esp_ble_gap_past_params_t));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_5_gap_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)

View File

@ -412,6 +412,10 @@ esp_err_t esp_bt_gap_set_qos(esp_bd_addr_t remote_bda, uint32_t t_poll)
return ESP_ERR_INVALID_STATE;
}
if (t_poll < ESP_BT_GAP_TPOLL_MIN || t_poll > ESP_BT_GAP_TPOLL_MAX) {
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GAP_BT;
msg.act = BTC_GAP_BT_ACT_SET_QOS;

View File

@ -447,6 +447,41 @@ esp_err_t esp_ble_gattc_read_multiple(esp_gatt_if_t gattc_if,
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gattc_read_multiple_variable(esp_gatt_if_t gattc_if,
uint16_t conn_id, esp_gattc_multi_t *read_multi,
esp_gatt_auth_req_t auth_req)
{
btc_msg_t msg = {0};
btc_ble_gattc_args_t arg;
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
tGATT_TCB *p_tcb = gatt_get_tcb_by_idx(conn_id);
if (!gatt_check_connection_state_by_tcb(p_tcb)) {
LOG_WARN("%s, The connection not created.", __func__);
return ESP_ERR_INVALID_STATE;
}
if (L2CA_CheckIsCongest(L2CAP_ATT_CID, p_tcb->peer_bda)) {
LOG_DEBUG("%s, the l2cap chanel is congest.", __func__);
return ESP_FAIL;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GATTC;
msg.act = BTC_GATTC_ACT_READ_MULTIPLE_VARIABLE_CHAR;
arg.read_multiple.conn_id = BTC_GATT_CREATE_CONN_ID(gattc_if, conn_id);
arg.read_multiple.num_attr = read_multi->num_attr;
arg.read_multiple.auth_req = auth_req;
if (read_multi->num_attr > 0) {
memcpy(arg.read_multiple.handles, read_multi->handles, sizeof(uint16_t)*read_multi->num_attr);
} else {
LOG_ERROR("%s(), the num_attr should not be 0.", __func__);
return ESP_FAIL;
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gattc_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_gattc_read_char_descr (esp_gatt_if_t gattc_if,
uint16_t conn_id, uint16_t handle,

View File

@ -421,4 +421,17 @@ static esp_err_t esp_ble_gatts_add_char_desc_param_check(esp_attr_value_t *char_
return ESP_OK;
}
esp_err_t esp_ble_gatts_show_local_database(void)
{
btc_msg_t msg = {0};
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GATTS;
msg.act = BTC_GATTS_ACT_SHOW_LOCAL_DATABASE;
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif ///GATTS_INCLUDED

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -255,6 +255,27 @@ esp_err_t esp_hf_ag_devices_status_indchange(esp_bd_addr_t remote_addr,
return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
esp_err_t esp_hf_ag_ciev_report(esp_bd_addr_t remote_addr, esp_hf_ciev_report_type_t ind_type, int value)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
msg.act = BTC_HF_CIEV_REPORT_EVT;
btc_hf_args_t arg;
memset(&arg, 0, sizeof(btc_hf_args_t));
memcpy(&(arg.ciev_rep.remote_addr), remote_addr, sizeof(esp_bd_addr_t));
arg.ciev_rep.ind.type = ind_type;
arg.ciev_rep.ind.value = value;
/* Switch to BTC context */
bt_status_t state = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL);
return (state == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
esp_err_t esp_hf_ag_cind_response(esp_bd_addr_t remote_addr,
esp_hf_call_status_t call_state,
esp_hf_call_setup_status_t call_setup_state,
@ -337,11 +358,14 @@ esp_err_t esp_hf_ag_clcc_response(esp_bd_addr_t remote_addr, int index, esp_hf_c
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_hf_subscriber_service_type_t type)
esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, int number_type, esp_hf_subscriber_service_type_t service_type)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
if (number == NULL) {
return ESP_ERR_INVALID_ARG;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
@ -351,7 +375,8 @@ esp_err_t esp_hf_ag_cnum_response(esp_bd_addr_t remote_addr, char *number, esp_h
memset(&arg, 0, sizeof(btc_hf_args_t));
memcpy(&(arg.cnum_rep), remote_addr, sizeof(esp_bd_addr_t));
arg.cnum_rep.number = number; //deep_copy
arg.cnum_rep.type = type;
arg.cnum_rep.number_type = number_type;
arg.cnum_rep.service_type = service_type;
/* Switch to BTC context */
bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t),
@ -512,10 +537,30 @@ esp_err_t esp_hf_ag_register_data_callback(esp_hf_incoming_data_cb_t recv, esp_h
}
#if (BTM_SCO_HCI_INCLUDED == TRUE)
esp_err_t esp_hf_ag_pkt_stat_nums_get(uint16_t sync_conn_handle)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF;
msg.act = BTC_HF_REQUEST_PKT_STAT_EVT;
btc_hf_args_t arg;
memset(&arg, 0, sizeof(btc_hf_args_t));
arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle;
/* Switch to BTC context */
bt_status_t status = btc_transfer_context(&msg, &arg, sizeof(btc_hf_args_t), NULL, NULL);
return (status == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
void esp_hf_ag_outgoing_data_ready(void)
{
btc_hf_ci_sco_data();
}
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
#endif // BTC_HF_INCLUDED

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -515,8 +515,27 @@ esp_err_t esp_hf_client_register_data_callback(esp_hf_client_incoming_data_cb_t
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#if (BTM_SCO_HCI_INCLUDED == TRUE)
esp_err_t esp_hf_client_pkt_stat_nums_get(uint16_t sync_conn_handle)
{
if (esp_bluedroid_get_status() != ESP_BLUEDROID_STATUS_ENABLED) {
return ESP_ERR_INVALID_STATE;
}
btc_msg_t msg;
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_HF_CLIENT;
msg.act = BTC_HF_CLIENT_REQUEST_PKT_STAT_EVT;
btc_hf_client_args_t arg;
memset(&arg, 0, sizeof(btc_hf_client_args_t));
arg.pkt_sync_hd.sync_conn_handle = sync_conn_handle;
/* Switch to BTC context */
bt_status_t stat = btc_transfer_context(&msg, &arg, sizeof(btc_hf_client_args_t), NULL, NULL);
return (stat == BT_STATUS_SUCCESS) ? ESP_OK : ESP_FAIL;
}
#if (BTM_SCO_HCI_INCLUDED == TRUE )
void esp_hf_client_outgoing_data_ready(void)
{
BTA_HfClientCiData();
@ -537,6 +556,6 @@ int32_t esp_hf_client_pcm_resample(void *src, uint32_t in_bytes, void *dst)
return BTA_DmPcmResample(src, in_bytes, dst);
}
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE ) */
#endif /* #if (BTM_SCO_HCI_INCLUDED == TRUE) */
#endif /* BTC_HF_CLIENT_INCLUDED */

View File

@ -47,7 +47,6 @@ typedef enum {
ESP_BT_STATUS_MEMORY_FULL = 20, /* relate to BT_STATUS_MEMORY_FULL in bt_def.h */
ESP_BT_STATUS_EIR_TOO_LARGE, /* relate to BT_STATUS_EIR_TOO_LARGE in bt_def.h */
ESP_BT_STATUS_HCI_SUCCESS = ESP_BT_STATUS_BASE_FOR_HCI_ERR,
ESP_BT_STATUS_HCI_PENDING,
ESP_BT_STATUS_HCI_ILLEGAL_COMMAND,
ESP_BT_STATUS_HCI_NO_CONNECTION,
ESP_BT_STATUS_HCI_HW_FAILURE,
@ -126,18 +125,20 @@ typedef uint8_t esp_link_key[ESP_BT_OCTET16_LEN]; /* Link Key */
/// Default GATT interface id
#define ESP_DEFAULT_GATT_IF 0xff
#if BLE_HIGH_DUTY_ADV_INTERVAL
#define ESP_BLE_PRIM_ADV_INT_MIN 0x000008 /*!< Minimum advertising interval for undirected and low duty cycle directed advertising */
#else
#define ESP_BLE_PRIM_ADV_INT_MIN 0x000020 /*!< Minimum advertising interval for undirected and low duty cycle directed advertising */
#endif
#define ESP_BLE_PRIM_ADV_INT_MAX 0xFFFFFF /*!< Maximum advertising interval for undirected and low duty cycle directed advertising */
#define ESP_BLE_CONN_INT_MIN 0x0006 /*!< relate to BTM_BLE_CONN_INT_MIN in stack/btm_ble_api.h */
#define ESP_BLE_CONN_INT_MAX 0x0C80 /*!< relate to BTM_BLE_CONN_INT_MAX in stack/btm_ble_api.h */
#define ESP_BLE_CONN_LATENCY_MAX 499 /*!< relate to ESP_BLE_CONN_LATENCY_MAX in stack/btm_ble_api.h */
#define ESP_BLE_CONN_SUP_TOUT_MIN 0x000A /*!< relate to BTM_BLE_CONN_SUP_TOUT_MIN in stack/btm_ble_api.h */
#define ESP_BLE_CONN_SUP_TOUT_MAX 0x0C80 /*!< relate to ESP_BLE_CONN_SUP_TOUT_MAX in stack/btm_ble_api.h */
#define ESP_BLE_CONN_PARAM_UNDEF 0xffff /* use this value when a specific value not to be overwritten */ /* relate to ESP_BLE_CONN_PARAM_UNDEF in stack/btm_ble_api.h */
#define ESP_BLE_SCAN_PARAM_UNDEF 0xffffffff /* relate to ESP_BLE_SCAN_PARAM_UNDEF in stack/btm_ble_api.h */
/// Check the param is valid or not
#define ESP_BLE_IS_VALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) || ((x) == ESP_BLE_CONN_PARAM_UNDEF))
#define ESP_BLE_IS_VALID_PARAM(x, min, max) (((x) >= (min) && (x) <= (max)) )
/// UUID type
typedef struct {
@ -167,10 +168,10 @@ typedef uint8_t esp_bd_addr_t[ESP_BD_ADDR_LEN];
/// BLE device address type
typedef enum {
BLE_ADDR_TYPE_PUBLIC = 0x00,
BLE_ADDR_TYPE_RANDOM = 0x01,
BLE_ADDR_TYPE_RPA_PUBLIC = 0x02,
BLE_ADDR_TYPE_RPA_RANDOM = 0x03,
BLE_ADDR_TYPE_PUBLIC = 0x00, /*!< Public Device Address */
BLE_ADDR_TYPE_RANDOM = 0x01, /*!< Random Device Address. To set this address, use the function esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr) */
BLE_ADDR_TYPE_RPA_PUBLIC = 0x02, /*!< Resolvable Private Address (RPA) with public identity address */
BLE_ADDR_TYPE_RPA_RANDOM = 0x03, /*!< Resolvable Private Address (RPA) with random identity address. To set this address, use the function esp_ble_gap_set_rand_addr(esp_bd_addr_t rand_addr) */
} esp_ble_addr_type_t;
/// white list address type

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -133,7 +133,7 @@ typedef enum {
ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT, /*!< When scan parameters set complete, the event comes */
ESP_GAP_BLE_SCAN_RESULT_EVT, /*!< When one scan result ready, the event comes each time */
ESP_GAP_BLE_ADV_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw advertising data set complete, the event comes */
ESP_GAP_BLE_SCAN_RSP_DATA_RAW_SET_COMPLETE_EVT, /*!< When raw scan response data set complete, the event comes */
ESP_GAP_BLE_ADV_START_COMPLETE_EVT, /*!< When start advertising complete, the event comes */
ESP_GAP_BLE_SCAN_START_COMPLETE_EVT, /*!< When start scan complete, the event comes */
//BLE_INCLUDED
@ -202,6 +202,12 @@ typedef enum {
ESP_GAP_BLE_SC_OOB_REQ_EVT, /*!< Secure Connection OOB request event */
ESP_GAP_BLE_SC_CR_LOC_OOB_EVT, /*!< Secure Connection create OOB data complete event */
ESP_GAP_BLE_GET_DEV_NAME_COMPLETE_EVT, /*!< When getting BT device name complete, the event comes */
//BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER
ESP_GAP_BLE_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT, /*!< when set periodic advertising receive enable complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT, /*!< when periodic advertising sync transfer complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT, /*!< when periodic advertising set info transfer complete, the event comes */
ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT, /*!< when set periodic advertising sync transfer params complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT, /*!< when periodic advertising sync transfer received, the event comes */
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
} esp_gap_ble_cb_event_t;
@ -650,6 +656,7 @@ typedef enum {
typedef enum{
ESP_BLE_WHITELIST_REMOVE = 0X00, /*!< remove mac from whitelist */
ESP_BLE_WHITELIST_ADD = 0X01, /*!< add address to whitelist */
ESP_BLE_WHITELIST_CLEAR = 0x02, /*!< clear all device in whitelist */
} esp_ble_wl_operation_t;
#if (BLE_42_FEATURE_SUPPORT == TRUE)
typedef enum {
@ -909,6 +916,25 @@ typedef struct {
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
/// Periodic advertising sync trans mode
#define ESP_BLE_GAP_PAST_MODE_NO_SYNC_EVT (0x00) /*!< No attempt is made to sync and no periodic adv sync transfer received event */
#define ESP_BLE_GAP_PAST_MODE_NO_REPORT_EVT (0x01) /*!< An periodic adv sync transfer received event and no periodic adv report events */
#define ESP_BLE_GAP_PAST_MODE_DUP_FILTER_DISABLED (0x02) /*!< Periodic adv report events will be enabled with duplicate filtering disabled */
#define ESP_BLE_GAP_PAST_MODE_DUP_FILTER_ENABLED (0x03) /*!< Periodic adv report events will be enabled with duplicate filtering enabled */
typedef uint8_t esp_ble_gap_past_mode_t;
/**
* @brief periodic adv sync transfer parameters
*/
typedef struct {
esp_ble_gap_past_mode_t mode; /*!< periodic advertising sync transfer mode */
uint16_t skip; /*!< the number of periodic advertising packets that can be skipped */
uint16_t sync_timeout; /*!< synchronization timeout for the periodic advertising train */
uint8_t cte_type; /*!< periodic advertising sync transfer CET type */
} esp_ble_gap_past_params_t;
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
/**
* @brief Gap callback parameters union
*/
@ -1307,6 +1333,50 @@ typedef union {
esp_ble_gap_periodic_adv_report_t params; /*!< periodic advertising report parameters */
} period_adv_report; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT */
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
/**
* @brief ESP_GAP_BLE_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT
*/
struct ble_periodic_adv_recv_enable_cmpl_param {
esp_bt_status_t status; /*!< Set periodic advertising receive enable status */
} period_adv_recv_enable; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_RECV_ENABLE_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT
*/
struct ble_periodic_adv_sync_trans_cmpl_param {
esp_bt_status_t status; /*!< Periodic advertising sync transfer status */
esp_bd_addr_t bda; /*!< The remote device address */
} period_adv_sync_trans; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT
*/
struct ble_periodic_adv_set_info_trans_cmpl_param {
esp_bt_status_t status; /*!< Periodic advertising set info transfer status */
esp_bd_addr_t bda; /*!< The remote device address */
} period_adv_set_info_trans; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SET_INFO_TRANS_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT
*/
struct ble_set_past_params_cmpl_param {
esp_bt_status_t status; /*!< Set periodic advertising sync transfer params status */
esp_bd_addr_t bda; /*!< The remote device address */
} set_past_params; /*!< Event parameter of ESP_GAP_BLE_SET_PAST_PARAMS_COMPLETE_EVT */
/**
* @brief ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT
*/
struct ble_periodic_adv_sync_trans_recv_param {
esp_bt_status_t status; /*!< Periodic advertising sync transfer received status */
esp_bd_addr_t bda; /*!< The remote device address */
uint16_t service_data; /*!< The value provided by the peer device */
uint16_t sync_handle; /*!< Periodic advertising sync handle */
uint8_t adv_sid; /*!< Periodic advertising set id */
uint8_t adv_addr_type; /*!< Periodic advertiser address type */
esp_bd_addr_t adv_addr; /*!< Periodic advertiser address */
esp_ble_gap_phy_t adv_phy; /*!< Periodic advertising PHY */
uint16_t adv_interval; /*!< Periodic advertising interval */
uint8_t adv_clk_accuracy; /*!< Periodic advertising clock accuracy */
} past_received; /*!< Event parameter of ESP_GAP_BLE_PERIODIC_ADV_SYNC_TRANS_RECV_EVT */
#endif // #if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
} esp_ble_gap_cb_param_t;
/**
@ -1431,9 +1501,17 @@ esp_err_t esp_ble_gap_update_conn_params(esp_ble_conn_update_params_t *params);
esp_err_t esp_ble_gap_set_pkt_data_len(esp_bd_addr_t remote_device, uint16_t tx_data_length);
/**
* @brief This function sets the static Random Address and Non-Resolvable Private Address for the application
* @brief This function allows configuring either a Non-Resolvable Private Address or a Static Random Address
*
* @param[in] rand_addr: the random address which should be setting
* @param[in] rand_addr: The address to be configured. Refer to the table below for possible address subtypes:
*
* | address [47:46] | Address Type |
* |-----------------|--------------------------|
* | 0b00 | Non-Resolvable Private |
* | | Address |
* |-----------------|--------------------------|
* | 0b11 | Static Random Address |
* |-----------------|--------------------------|
*
* @return
* - ESP_OK : success
@ -1455,7 +1533,7 @@ esp_err_t esp_ble_gap_clear_rand_addr(void);
/**
* @brief Enable/disable privacy on the local device
* @brief Enable/disable privacy (including address resolution) on the local device
*
* @param[in] privacy_enable - enable/disable privacy on remote device.
*
@ -1536,6 +1614,7 @@ esp_err_t esp_ble_gap_set_prefer_conn_params(esp_bd_addr_t bd_addr,
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief Set device name to the local device
* Note: This API don't affect the advertising data
*
* @param[in] name - device name.
*
@ -1584,7 +1663,7 @@ uint8_t *esp_ble_resolve_adv_data(uint8_t *adv_data, uint8_t type, uint8_t *leng
* @brief This function is called to set raw advertising data. User need to fill
* ADV data by self.
*
* @param[in] raw_data : raw advertising data
* @param[in] raw_data : raw advertising data with the format: [Length 1][Data Type 1][Data 1][Length 2][Data Type 2][Data 2] ...
* @param[in] raw_data_len : raw advertising data length , less than 31 bytes
*
* @return
@ -2037,6 +2116,22 @@ esp_err_t esp_ble_gap_ext_adv_set_clear(void);
*/
esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_gap_periodic_adv_params_t *params);
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
/**
* @brief This function is used to set the data used in periodic advertising PDUs.
*
* @param[in] instance : identifies the advertising set whose periodic advertising parameters are being configured.
* @param[in] length : the length of periodic data
* @param[in] data : periodic data information
* @param[in] only_update_did : If true, only the Advertising DID of the periodic advertising will be updated, and the length and data parameters will be ignored.
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
const uint8_t *data, bool only_update_did);
#else
/**
* @brief This function is used to set the data used in periodic advertising PDUs.
*
@ -2050,6 +2145,21 @@ esp_err_t esp_ble_gap_periodic_adv_set_params(uint8_t instance, const esp_ble_ga
*/
esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t length,
const uint8_t *data);
#endif
#if (CONFIG_BT_BLE_FEAT_PERIODIC_ADV_ENH)
/**
* @brief This function is used to request the Controller to enable the periodic advertising for the advertising set specified
*
* @param[in] instance : Used to identify an advertising set
* @param[in] include_adi : If true, the ADI (Advertising Data Info) field will be included in AUX_SYNC_IND PDUs
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance,bool include_adi);
#else
/**
* @brief This function is used to request the Controller to enable the periodic advertising for the advertising set specified
*
@ -2060,6 +2170,7 @@ esp_err_t esp_ble_gap_config_periodic_adv_data_raw(uint8_t instance, uint16_t le
*
*/
esp_err_t esp_ble_gap_periodic_adv_start(uint8_t instance);
#endif
/**
* @brief This function is used to request the Controller to disable the periodic advertising for the advertising set specified
@ -2196,6 +2307,61 @@ esp_err_t esp_ble_gap_prefer_ext_connect_params_set(esp_bd_addr_t addr,
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
/**
* @brief This function is used to set periodic advertising receive enable
*
* @param[in] sync_handle : Handle of periodic advertising sync
* @param[in] enable : Determines whether reporting and duplicate filtering are enabled or disabled
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_periodic_adv_recv_enable(uint16_t sync_handle, uint8_t enable);
/**
* @brief This function is used to transfer periodic advertising sync
*
* @param[in] addr : Peer device address
* @param[in] service_data : Service data used by Host
* @param[in] sync_handle : Handle of periodic advertising sync
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_periodic_adv_sync_trans(esp_bd_addr_t addr,
uint16_t service_data, uint16_t sync_handle);
/**
* @brief This function is used to transfer periodic advertising set info
*
* @param[in] addr : Peer device address
* @param[in] service_data : Service data used by Host
* @param[in] adv_handle : Handle of advertising set
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_periodic_adv_set_info_trans(esp_bd_addr_t addr,
uint16_t service_data, uint8_t adv_handle);
/**
* @brief This function is used to set periodic advertising sync transfer params
*
* @param[in] addr : Peer device address
* @param[in] params : Params of periodic advertising sync transfer
*
* @return - ESP_OK : success
* - other : failed
*
*/
esp_err_t esp_ble_gap_set_periodic_adv_sync_trans_params(esp_bd_addr_t addr,
const esp_ble_gap_past_params_t *params);
#endif //#if (BLE_FEAT_PERIODIC_ADV_SYNC_TRANSFER == TRUE)
#ifdef __cplusplus
}
#endif

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