Compare commits

...

671 Commits

Author SHA1 Message Date
3f2f35bd5e Merge branch 'bugfix/esp32s3_efuse_wafer_major_v5.0' into 'release/v5.0'
esp32s3: fixed bug chip v0.0 detected as vX.0 (v5.0)

See merge request espressif/esp-idf!21016
2022-11-10 12:04:31 +08:00
5b0448eaed esp32s3: fixed bug chip v0.0 detected as vX.0
A typical value is 2.0.
2022-11-09 18:21:43 +08:00
166effd4b8 Merge branch 'feature/partition_api_new_component_v5.0' into 'release/v5.0'
Storage: Partition APIs moved to the new component 'esp_partition' (v5.0)

See merge request espressif/esp-idf!20855
2022-11-04 14:58:51 +08:00
a8ef7570ca Merge branch 'examples/remove_c2_build_disable_yml_v5.0' into 'release/v5.0'
example: remove build disable rules of spi_xxx example for c2 in build-test-rules.yml (v5.0)

See merge request espressif/esp-idf!20594
2022-11-03 10:07:57 +08:00
ed92569ed1 Merge branch 'contrib/github_pr_10087_v5.0' into 'release/v5.0'
fixed url to console component (GitHub PR) (v5.0)

See merge request espressif/esp-idf!20900
2022-11-03 10:01:10 +08:00
a8ebd8ad04 unity: add linux port
This allows using unity fixture in Linux host tests
2022-11-02 21:49:15 +01:00
af81bd1b0a Storage: Partition APIs moved to the new component 'esp_partition'
All the partition handling API functions and data-types were moved from the 'spi_flash' component to the new one named 'esp_partition'. See Storage 5.x migration guide for more details
2022-11-02 21:49:08 +01:00
725eacbf16 Merge branch 'feature/usb/voltage_monitoring_backport_v5.0' into 'release/v5.0'
tinyusb: TinyUSB in IDF v5.0.0 (backport v5.0)

See merge request espressif/esp-idf!20673
2022-11-02 17:26:22 +08:00
940530c505 doc: redirect console page
Previous the console doc is moved from api-guide to api-reference, which
broken the URL as well, this commit added a redirect link to ensure the
old URL can still work.
2022-11-02 16:11:24 +08:00
3305987d66 Merge branch 'bugfix/esp32c2_create_sync_lost_v5.0' into 'release/v5.0'
Fixed occasional failure to establish sync and occasional wdt timeout issues on ESP32C2

See merge request espressif/esp-idf!20862
2022-11-02 11:35:00 +08:00
e63724adce Merge branch 'bugfix/fix_ble_array_access_out_of_bounds_v5.0' into 'release/v5.0'
Fixed BLE array access out of bounds (backport v5.0)

See merge request espressif/esp-idf!20875
2022-11-01 21:00:20 +08:00
53075e44ad Merge branch 'contrib/github_pr_10083_v5.0' into 'release/v5.0'
temperature_sensor: fix typo (github PR) (v5.0)

See merge request espressif/esp-idf!20888
2022-11-01 19:23:27 +08:00
79aea89853 Merge branch 'bugfix/add_protection_for_mac_rst_v5.0' into 'release/v5.0'
esp_wifi: add protection for mac reset (backport 5.0)

See merge request espressif/esp-idf!20871
2022-11-01 18:45:01 +08:00
bc225c8886 Fixed typo 2022-11-01 14:36:44 +08:00
88482af17a Merge branch 'bugfix/i2s_tx_auto_clear_not_totally_clean_the_buf_v5.0' into 'release/v5.0'
i2s: fix tx incomplete auto clear (v5.0)

See merge request espressif/esp-idf!20570
2022-11-01 10:14:54 +08:00
a6d2c65fdc Merge branch 'bugfix/2nd_bootloader_uart1_baudrate_issues_v5.0' into 'release/v5.0'
esp_rom: fix 2nd bootloader custom uart1 baudrate issue (backport to v5.0)

See merge request espressif/esp-idf!20653
2022-11-01 10:11:28 +08:00
c35b14bb49 Fixed BLE array access out of bounds 2022-10-31 20:13:26 +08:00
eb71cf38bb Merge branch 'feature/move_eloop_to_pptask_v5.0' into 'release/v5.0'
wpa_supplicant: Run eloop timer in ppTask context (v5.0)

See merge request espressif/esp-idf!20864
2022-10-31 20:11:44 +08:00
07d0cd15c3 Merge branch 'bugfix/softap_pmf_espnow_issues_v5.0' into 'release/v5.0'
Fix some SoftAP PMF and espnow key issues (Backport v5.0)

See merge request espressif/esp-idf!20853
2022-10-31 19:27:11 +08:00
eb61f5835a esp_wifi: add protection for mac reset (backport 5.0) 2022-10-31 17:55:03 +08:00
cbee4d4328 esp_wifi: Update wifi libs
Fix some SoftAP PMF and espnow key management related issues
2022-10-31 12:49:48 +05:30
34bb7af431 wpa_supplicant: Run eloop timer in ppTask context
Currently eloop runs in timer context which may cause some
inconsistent behavior.

Add changes to run eloop in ppTask context
2022-10-31 10:38:01 +05:30
zwl
3bc38b7ff4 Fixed occasional failure to establish sync and occasional wdt timeout issues on ESP32C2 2022-10-31 12:01:35 +08:00
20949d444f Merge branch 'bugfix/rtc_function_needs_disable_usj_pads_esp32s3_v5.0' into 'release/v5.0'
rtcio: Disable USB Serial JTAG pad when setting pins 19 and 20 as RTC function on ESP32S3 (backport v5.0)

See merge request espressif/esp-idf!20550
2022-10-31 11:57:07 +08:00
b1c856022c Merge branch 'bugfix/spi2_add_device_cs_more_than_3_v5.0' into 'release/v5.0'
spi_master:fix error when use `spi_bus_add_device` more than 3 device(v5.0)

See merge request espressif/esp-idf!20073
2022-10-31 11:46:16 +08:00
ad5b5ed4ed Merge branch 'bugfix/fixed_signal_gap_in_i2s_adc_dac_example_v5.0' into 'release/v5.0'
i2s_example: fixed i2s_adc_dac output gap (v5.0)

See merge request espressif/esp-idf!20355
2022-10-31 11:37:43 +08:00
9108dcafd1 Merge branch 'refactor/use_managed_component_in_es7210_example_v5.0' into 'release/v5.0'
es8311: update the version of es8311  (v5.0)

See merge request espressif/esp-idf!20849
2022-10-31 11:34:46 +08:00
2635a18df2 Merge branch 'bufix/Backport_some_wifi_lwip_bugs_for_5.0_0821' into 'release/v5.0'
Bufix/backport some wifi lwip bugs for 5.0 0821

See merge request espressif/esp-idf!20732
2022-10-28 16:33:50 +08:00
237a5a0585 Merge branch 'bugfix/eloop_timer_crash_v5.0' into 'release/v5.0'
wpa_supplicant: Validate eloop struct before deleting it (v5.0)

See merge request espressif/esp-idf!20846
2022-10-28 16:29:34 +08:00
838abedbc8 es7210: use managed component 2022-10-28 14:59:33 +08:00
2444d99612 wpa_supplicant: Validate eloop struct before deleting it 2022-10-28 09:44:32 +05:30
a43a6809c7 Merge branch 'feature/esp32c2_optimize_npl_os_freertos_ram_v5.0' into 'release/v5.0'
Feature/esp32c2 optimize npl os freertos ram v5.0

See merge request espressif/esp-idf!20776
2022-10-28 11:42:16 +08:00
78773966c3 Merge branch 'feature/rgb_lcd_yuv_converter_v5.0' into 'release/v5.0'
RGB-YUV converter (v5.0)

See merge request espressif/esp-idf!20362
2022-10-28 10:07:48 +08:00
8481fbf752 Merge branch 'bugfix/change_clock_name_v5.0' into 'release/v5.0'
mcpwm: fix wrong return value in the legacy MCPWM driver (5.0)

See merge request espressif/esp-idf!20693
2022-10-28 10:02:40 +08:00
a13d5ef224 Merge branch 'bugfix/update_duty_on_tez_tep_v5.0' into 'release/v5.0'
mcpwm: update compare value on both tep and tez (v5.0)

See merge request espressif/esp-idf!20766
2022-10-28 10:00:36 +08:00
108274f6c0 Merge branch 'bugfix/esp32_hardware_mpi_fix_v5.0' into 'release/v5.0'
esp32: mpi: add workaround for data corruption issue observed with IDF 5.x toolchain (v5.0)

See merge request espressif/esp-idf!20819
2022-10-27 20:43:11 +08:00
0830a47b60 Merge branch 'bugfix/http_cached_data_in_redirection_v5.0' into 'release/v5.0'
esp_http_client: free cached data in case connection gets closed for redirection (v5.0)

See merge request espressif/esp-idf!20791
2022-10-27 20:42:37 +08:00
1af8f48a22 Merge branch 'bugfix/fix_wifi_retry_v5.0' into 'release/v5.0'
wifi_provisioning: fix error codes for wifi connect retry (v5.0)

See merge request espressif/esp-idf!20716
2022-10-27 20:42:20 +08:00
ba76bffb8b Merge branch 'esp_prov/update_deprecated_api_v5.0' into 'release/v5.0'
esp_prov: Update deprecated APIs (v5.0)

See merge request espressif/esp-idf!20793
2022-10-27 20:41:55 +08:00
dbffc26bac Merge branch 'bugfix/wifi_prov_sec2_bluedroid_v5.0' into 'release/v5.0'
protocomm: Increase Bluedroid-BLE maximum buffer size (v5.0)

See merge request espressif/esp-idf!20820
2022-10-27 20:41:30 +08:00
8becd5a856 protocomm: Increase Bluedroid-BLE maximum buffer size
- For the security2 scheme, the payload size is quite larger
  than that for security1.
2022-10-27 09:56:10 +05:30
84b0254fbf esp32: mpi: add workaround for data corruption issue observed with IDF 5.x toolchain
This fix adds a workaround to disable compiler optimization flag "-ftree-loop-distribute-patterns"
for `mpi_to_mem_block` routine. It was observed that compiler with release configuration was falling
back to `memset` call from ROM library causing an issue in correctly zero initializing MPI peripheral
block.

Please see following linked issue for more discussion and context on this issue.

Closes https://github.com/espressif/esp-idf/issues/8710
Closes https://github.com/espressif/esp-idf/issues/9371
Closes https://github.com/espressif/esp-idf/issues/9256
Closes IDFGH-7102
Closes IDFGH-7842
Closes IDFGH-7714
Closes IDFCI-1452
Closes IDF-6029
2022-10-27 09:54:26 +05:30
9a97071501 esp_prov: Update deprecated APIs
- Updated deprecated APIs for bleak module
- Updated README and troubleshooting reference for
  BLE transport
2022-10-26 10:49:30 +05:30
f93304d36e esp_http_client: free cached data in case connection gets closed for redirection
In case of `esp_http_client_read` based workflow, we cache data that is received
during fetch header stage. In case, there is URL redirection and we have to close
the connection on URL, port change then we must discard earlier cached data.

Closes AUD-4158
2022-10-26 10:11:09 +05:30
zwl
333c3db233 Modify ESP32C2's default ble tx output power 2022-10-25 16:50:21 +08:00
zwl
be07eb4757 Reduced the RAM size of npl_os_freertos.c file 2022-10-25 16:50:07 +08:00
dbcf640261 Merge branch 'bugfix/handle_buffers_for_ext_adv_rpt_v5.0' into 'release/v5.0'
Nimble: Allocate memory for ext adv reports from lower priority pool. (v5.0)

See merge request espressif/esp-idf!20730
2022-10-25 16:48:20 +08:00
e2cac5bf58 mcpwm: update compare value on both tep and tez
Closes https://github.com/espressif/esp-idf/issues/9904
2022-10-25 13:20:33 +08:00
61191a5ce5 tinyusb: Use TinyUSB from component registry 2022-10-25 06:44:56 +02:00
0179edb71d tinyusb: Add VBUS voltage monitoring feature
VBUS voltage monitoring is mandated by USB specification for self-powered devices.
This implementation maps selected GPIO to bvalid signal of USB-OTG peripheral.

Closes https://github.com/espressif/esp-idf/issues/7747
2022-10-25 06:44:56 +02:00
125ff0050e usb: Allow settings of all signals in usb_phy
Until now, only usb_phy signals for external PHY were defined.
This is now extended with all OTG signals.
2022-10-25 06:44:55 +02:00
6099844644 examples: support spi master examples on esp32cxx 2022-10-25 12:04:22 +08:00
a26c47be0f example: remove build disable rules of spi_xxx example for c2 in build-test-rules.yml 2022-10-25 12:04:22 +08:00
dbf8cd5b43 Merge branch 'refactor/remove_deprecated_can_stuffs_v5.0' into 'release/v5.0'
twai: remove the deprecated "CAN" driver code (v5.0)

See merge request espressif/esp-idf!20755
2022-10-25 11:37:37 +08:00
acb3b06ed6 twai: remove deprecated code and add hint
name "CAN" has been deprecated for a long time, this commit just remove
it from the code base.

Please use "TWAI" driver instead.
2022-10-24 18:39:45 +08:00
f7b10c99c2 Merge branch 'bugfix/backup_dma_stall_when_sw_rst_v5.0' into 'release/v5.0'
backport v5.0: force clear reset signal to fix the backup dma operation failure...

See merge request espressif/esp-idf!20637
2022-10-24 14:10:25 +08:00
b306b48aa3 backup dma: force clear reset signal to fix the backup dma operation failure caused by RTC_SW_CPU_RST 2022-10-24 04:27:54 +00:00
cd58bad218 Lwip:add TCP Fin2 timeout configuration 2022-10-21 16:23:54 +08:00
9948de101d lwip:bugfix for increase ping task stack size 2022-10-21 16:21:06 +08:00
af02784331 esp_wifi:bugfix sniffer mode can not capture control packet 2022-10-21 16:15:56 +08:00
0db5909b47 mcpwm: new function to fetch capture resolution 2022-10-21 07:37:36 +00:00
1af428dff3 mcpwm: fix wrong return value in the legacy driver
For APIs that not return esp_err_t value, we can't use macros like
ESP_RETURN_ON_xxx
2022-10-21 07:37:36 +00:00
2a50dd8a8f mcpwm: default clock cource is PLL160M
On esp32, the default clock source is also PLL160M
2022-10-21 07:37:36 +00:00
94d9c529f3 Merge branch 'feature/backport_c2_adc_runner_v5.0' into 'release/v5.0'
esp_adc: added esp32c2 adc runners (v5.0)

See merge request espressif/esp-idf!20706
2022-10-21 15:37:05 +08:00
11c44c9838 Nimble: Added check to allocate memory for extended adv
reports from lower prioirty buffers instead of high prioirty pool.
2022-10-21 12:47:14 +05:30
12628677c5 wifi_provisioning: fix error codes for wifi connect retry
Closes: https://github.com/espressif/esp-idf/issues/9399
2022-10-21 11:32:56 +05:30
903cb5eae8 Merge branch 'fix/softap_pmf_disconnect_v5.0' into 'release/v5.0'
Fix deauth and disassoc issue for softap pmf connections (Backport v5.0)

See merge request espressif/esp-idf!20545
2022-10-21 13:59:56 +08:00
ac7ce5bd02 Merge branch 'bugfix/revert_commit_da44fc9c_v5.0' into 'release/v5.0'
Revert "fixed the issue iOS devices cannot initiate connection" (v5.0)

See merge request espressif/esp-idf!20666
2022-10-21 13:59:33 +08:00
46d3627e66 esp_adc: added esp32c2 adc runners 2022-10-21 11:20:41 +08:00
28f9ddee74 Merge branch 'doc/usj_sw_reset_alive_bbpll_doc_v5.0' into 'release/v5.0'
usb_serial_jtag: fixed the docs that we can use usj in sleep modes (v5.0)

See merge request espressif/esp-idf!20287
2022-10-20 01:34:54 +08:00
3314fcfdf7 Revert "fixed the issue iOS devices cannot initiate connection"
This reverts commit da44fc9cbe.
2022-10-18 19:47:10 +08:00
c4aca02d7e esp_wifi: Fix deauth and disassoc issues for SoftAP PMF 2022-10-18 09:52:19 +05:30
9adf4dc240 esp_rom: fix 2nd bootloader custom uart1 baudrate issue 2022-10-18 11:02:25 +08:00
792ff9ce8c Merge branch 'tools/fixed_coredump_version_print_v5.0' into 'release/v5.0'
tools: fixed the coredump package's suppressed print (v5.0)

See merge request espressif/esp-idf!20648
2022-10-17 20:15:01 +08:00
79c0514f2b tools: fixed the coredump package's suppressed print 2022-10-17 17:54:39 +08:00
5c2a41d659 Merge branch 'bugfix/close_stack_callback_during_ble_stop_v5.0' into 'release/v5.0'
Nimble: Added check to deregister stack callback with controller during (v5.0)

See merge request espressif/esp-idf!20603
2022-10-16 11:14:46 +08:00
244ef221e3 Merge branch 'bugfix/fix_mbedlts_ds_memory_leak_v5.0' into 'release/v5.0'
esp-tls: Fix memory leak in mbedtls ds peripheral when MBEDTLS_THREADING_C enabled (backport v5.0)

See merge request espressif/esp-idf!20597
2022-10-16 11:01:28 +08:00
6713c745c2 Merge branch 'bugfix/esp32c2_scan_assert_v5.0' into 'release/v5.0'
Fixed occasional crash during scanning

See merge request espressif/esp-idf!20580
2022-10-16 11:01:13 +08:00
7bd5af7f1e Merge branch 'bugfix/a2dp_can_not_connect_after_ble_connected_v5.0' into 'release/v5.0'
fixed the issue iOS devices cannot initiate connection (v5.0)

See merge request espressif/esp-idf!20403
2022-10-14 17:15:15 +08:00
d6ea9b9643 Nimble: Added check to deregister stack callback with controller during 2022-10-14 12:08:15 +05:30
d1b989dae2 Merge branch 'bugfix/reorder_stack_deinit_function_v5.0' into 'release/v5.0'
Nimble: Removed extra deinit for flow timer (v5.0)

See merge request espressif/esp-idf!20308
2022-10-14 13:58:53 +08:00
2209831dd2 Merge branch 'feat/sdio_slave_disable_hs_v5.0' into 'release/v5.0'
sdio_slave: allow disabling highspeed mode (v5.0)

See merge request espressif/esp-idf!20456
2022-10-14 12:11:14 +08:00
1729c79577 Merge branch 'feature/mcpwm_update_compare_iram_safe_5.0' into 'release/v5.0'
mcpwm: make set_compare_value iram safe (5.0)

See merge request espressif/esp-idf!20304
2022-10-14 11:58:55 +08:00
dec4052ed7 fixed the issue iOS devices cannot initiate connection
to ESP32 while there is a BLE connection to this ESP32

Closes https://github.com/espressif/esp-idf/issues/6557
2022-10-14 03:28:18 +00:00
65bf1ff368 Merge branch 'bugfix/use_nonblocking_coex_callback_v5.0' into 'release/v5.0'
bluetooth: use non-blocking coexistence callback functions so that Wi-Fi task is not blocked by Bluetooth(backport v5.0)

See merge request espressif/esp-idf!20414
2022-10-14 11:25:21 +08:00
ab848877a8 Merge branch 'bugfix/eap_hash_key_len_validation_v5.0' into 'release/v5.0'
esp_wifi:Adding hash key length validation(backport v5.0)

See merge request espressif/esp-idf!20484
2022-10-14 11:16:03 +08:00
59f0d31dd2 Merge branch 'bugfix/intr_alloc_missing_critical_section_exit_v5.0' into 'release/v5.0'
intr_alloc: Fixed missing portEXIT_CRITICAL_SAFE (GitHub PR) (v5.0)

See merge request espressif/esp-idf!20399
2022-10-14 11:15:21 +08:00
871ecb8163 Merge branch 'bugfix/tinyusb_corrected_typo_naming_of_acm_v5.0' into 'release/v5.0'
tinyusb: fix typo naming of ACM (backport v5.0)

See merge request espressif/esp-idf!20298
2022-10-14 11:14:52 +08:00
a9cc30e3e2 Merge branch 'bugfix/fix_spi_bus_lock_concurrency_issue_v5.0' into 'release/v5.0'
spi_bus_lock: fix a concurrency issue (v5.0)

See merge request espressif/esp-idf!20136
2022-10-14 11:13:51 +08:00
aa49bad73f Merge branch 'bugfix/reason_code_pmk_flush_v5.0' into 'release/v5.0'
Prevent pmk flush for unspecified reasoncode (v5.0)

See merge request espressif/esp-idf!20582
2022-10-14 11:08:53 +08:00
0a41b9bcd8 esp-tls: Fix memory leak in mbedtls ds peripheral when MBEDTLS_THREADING_C enabled 2022-10-13 19:35:04 +08:00
f11cc8ca9d Remove unnecessary code from disconnect handler 2022-10-13 12:14:09 +05:30
e2b8ebe804 wpa_supplicant: Prevent pmk flush for unspecified reasoncode 2022-10-13 12:14:09 +05:30
zwl
6b980e526a Fixed occasional crash during scanning 2022-10-13 14:05:45 +08:00
da9a78ebfc Merge branch 'docs/translate_protocols_in_migration_guides_backport_v5.0' into 'release/v5.0'
docs: provide translation for protocols in migration guides (backport v5.0)

See merge request espressif/esp-idf!20538
2022-10-13 13:43:24 +08:00
f9e3384f49 Merge branch 'bugfix/add_security_patches_v5.0' into 'release/v5.0'
Adding security patch for SAE side channel attacks (Backport v5.0)

See merge request espressif/esp-idf!20566
2022-10-13 11:09:39 +08:00
c76ecbe682 Merge branch 'bugfix/fix_esp_hid_auth_fail_crash_v5.0' into 'release/v5.0'
Fix esp hid crash when auth failed (backport v5.0)

See merge request espressif/esp-idf!20539
2022-10-13 10:50:10 +08:00
2978de0f75 Merge branch 'rebase/fix_ble_mem_leak_issue_rls' into 'release/v5.0'
fix ble mem leak when sleep is enabled

See merge request espressif/esp-idf!20528
2022-10-13 10:49:46 +08:00
2d4f6d5b62 bt: use non-blocking coexistence callback functions so that Wi-Fi task is not blocked by Bluetooth 2022-10-12 19:42:55 +08:00
e302d9a976 i2s: fix tx incomplete auto clear
Closes: https://github.com/espressif/esp-idf/issues/9882
2022-10-12 19:42:37 +08:00
71a0d61eae wpa_supplicant: Update security patches from upstream
1. Adding security patch for SAE side channel attacks
2. Adding confirm message validation in error cases
3. Adding y coordinate for PWE in SAE
2022-10-12 15:01:17 +05:30
bc992d7975 wpa_supplicant: Move SAE modules into dragonfly files 2022-10-12 14:52:08 +05:30
e2e97a5a33 mcpwm: allow compare equals to period 2022-10-12 08:41:58 +00:00
54813cc19b mcpwm: make set_compare_value iram safe
Closes https://github.com/espressif/esp-idf/issues/9793
2022-10-12 08:41:58 +00:00
c5f6453586 Merge branch 'bugfix/fix_c3_dig_dibas_limit_bug_to_v5.0' into 'release/v5.0'
C3: Fix system not stable bug when dbias storing in efuse is bigger than 27 (v5.0)

See merge request espressif/esp-idf!20499
2022-10-12 16:32:45 +08:00
a2de42c096 Merge branch 'test/test_adc_on_dedicated_runners_v5.0' into 'release/v5.0'
ci: use adc dedicated test runners (v5.0)

See merge request espressif/esp-idf!20357
2022-10-12 16:32:26 +08:00
47c0db2830 rtcio: Disable USB Serial JTAG pad when setting pins 19 and 20 as RTC function on ESP32S3
Similar to the fix in gpio lower layers, USB Serial JTAG pad should be disabled when the DM and DP pins want to be used as rtcio pins.

(cherry picked from commit de0401047c)
2022-10-12 11:50:51 +08:00
baca425ce8 fix ble mem leak when sleep is enabled 2022-10-12 11:29:55 +08:00
6508a4ee0a fix esp hid crash when auth failed 2022-10-11 20:09:16 +08:00
ee769abe19 Merge branch 'feature/fatfsgen-enable-512-bytes-sector_v5.0' into 'release/v5.0'
fatfsgen.py: enabled 512 sized sectors (v5.0)

See merge request espressif/esp-idf!20416
2022-10-11 19:35:16 +08:00
58f725a7fd Merge branch 'fix/export_without_constraint_download_v5.0' into 'release/v5.0'
Tools: The Python dependency checker should not update the constraint file (v5.0)

See merge request espressif/esp-idf!20516
2022-10-11 19:35:00 +08:00
a6adac2a8b Merge branch 'ci/fix_mqtt5_broker_not_available_v5.0' into 'release/v5.0'
ci: Fix mqtt broker is not available (backport v5.0)

See merge request espressif/esp-idf!20451
2022-10-11 19:33:40 +08:00
7df991f841 docs: provide translation for protocols in migration guides 2022-10-11 18:03:10 +08:00
d3ae5ed08f Merge branch 'backport/cjh_v5.0' into 'release/v5.0'
Fixed some BLE bugs on bluedroid (backport v5.0)

See merge request espressif/esp-idf!20510
2022-10-11 17:47:26 +08:00
09018a6af4 Merge branch 'bugfix/eanble_bluedroid_host_adv_ind_report_individually_v5.0' into 'release/v5.0'
allow bluedroid host to report adv_ind separately(backport v5.0)

See merge request espressif/esp-idf!20440
2022-10-11 17:46:45 +08:00
5ae4f34cb8 Merge branch 'bugfix/fix_ble_lld_per_adv_assert_on_esp32c3_s3_v5.0' into 'release/v5.0'
Fixed BLE lld_per_adv.c line 401 assert (backport v5.0)

See merge request espressif/esp-idf!20506
2022-10-11 17:46:10 +08:00
bb6e0e52b8 Merge branch 'bugfix/fix_esp32_ble_assert_32_v5.0' into 'release/v5.0'
Fixed ESP32 BLE assert(32 0) (backport v5.0)

See merge request espressif/esp-idf!20508
2022-10-11 17:45:55 +08:00
8d2fda5db6 Merge branch 'bugfix/fix_connect_fail_when_enable_SPIRAM_v5.0' into 'release/v5.0'
esp_wifi: fix connect fail when enable SPIRAM and ESPNOW send (backport v5.0)

See merge request espressif/esp-idf!20431
2022-10-11 16:27:54 +08:00
ddb7036aee esp_wifi: fix connect fail when enable SPIRAM 2022-10-10 16:11:06 +08:00
737cdcbaa6 Tools: The Python dependency checker should not update the constraint file
The Python dependency checker called from the export scripts and before
build remains offline, i.e. it will use the previously downloaded
constraint file but won't download a newer version.

Related to https://github.com/espressif/esp-idf/pull/9328
2022-10-10 09:46:39 +02:00
ee12de9450 Merge branch 'fix/fix_protocomm_security2_backward_compatibility_v5.0' into 'release/v5.0'
wifi_prov: Update behaviour for wifi_prov_mgr_start_provisioning to avoid... (v5.0)

See merge request espressif/esp-idf!20489
2022-10-10 15:44:12 +08:00
bb41b340b9 ci: Fix mqtt broker is not available 2022-10-10 02:38:28 +00:00
3eb3f9f744 Merge branch 'bugfix/rmt_iram_test_random_failure_v5.0' into 'release/v5.0'
test: fix rmt iram case random failure (v5.0)

See merge request espressif/esp-idf!20383
2022-10-09 17:59:34 +08:00
a207f218ea bluedroid: configurable max gattc cache characteristic count 2022-10-09 17:07:53 +08:00
3f3ca8bf60 fix ble adv tx power map 2022-10-09 17:07:53 +08:00
548cce624c bluedroid: fix ble rpa generate and update by host 2022-10-09 17:07:53 +08:00
84bcd1d1f0 soc: remove soc ble config from Kconfig 2022-10-09 17:07:53 +08:00
e9dd8a6bf5 Revert "component/bt: add local irk to controller"
This reverts commit 95c35288bc.
2022-10-09 17:07:53 +08:00
f96e38a70d Revert "Fixed ESP32 BLE can't resolve the peer address when enable white list"
This reverts commit 1cc0f6aac5.
2022-10-09 17:07:53 +08:00
03832cceeb Bluedroid: Configurable option to modify max gatt service attributes count 2022-10-09 17:07:53 +08:00
zwj
60ece59f04 Fixed ESP32 BLE assert(32 0) 2022-10-09 16:06:28 +08:00
zwj
1030bdd299 Fixed BLE lld_per_adv.c line 401 assert 2022-10-09 16:02:06 +08:00
zwj
2fe4ff7031 allow bluedroid host to report adv_ind separately 2022-10-08 14:53:53 +08:00
ccb8b9d42c wifi_provisioning/manager.c: Fix small bug introduced in recent MR. 2022-10-08 10:50:02 +05:30
d70e80b7bb pytest_wifi_prov_mgr.py: Update example test to enable sec1 and sec2
testing
2022-10-08 10:49:53 +05:30
c740192123 protocomm/esp_srp: Allocate memory for username only when the
verification is successful
2022-10-08 10:49:44 +05:30
b7ec10d461 protocommm/esp_srp: Fix small issues reported by coverity. 2022-10-08 10:49:26 +05:30
cje
d7dcb88fdc C3: Fix system not stable bug when dbias storing in efuse is bigger than 27 2022-10-08 11:59:32 +08:00
a98ecafaf2 wifi_prov_mgr: Make security2 as default for the example 2022-10-07 14:14:45 +05:30
92698b28d8 wifi_prov_mgr_example: Set "wifiprov" as test username and "abcd1234" as
test password.
2022-10-07 14:14:45 +05:30
38b81d52c5 wifi_prov_mgr: Fix comments 2022-10-07 14:14:44 +05:30
78b49a4ab6 protocomm: Enable security version 2 by default 2022-10-07 14:14:44 +05:30
4ba30e29ec wifi_prov_mgr: Add security version in the proto-ver endpoint. 2022-10-07 14:14:44 +05:30
6f69097815 wifi_prov: Update behaviour for wifi_prov_mgr_start_provisioning to avoid breaking the usage for sec1 2022-10-07 14:14:44 +05:30
fbaf50f1d9 esp_wifi:adding hash key length validation 2022-10-06 16:40:57 +05:30
d39da71671 Merge branch 'bugfix/wifi_prov_device_name_v5.0' into 'release/v5.0'
wifi_provisioning : Increased 1 byte of BLE advertising device name to store '\0' (v5.0)

See merge request espressif/esp-idf!20373
2022-10-06 13:15:41 +08:00
1ec71ecc37 Merge branch 'coredump_support_for_c2_v5.0' into 'release/v5.0'
espcoredump: Add support for esp32c2 (v5.0)

See merge request espressif/esp-idf!20473
2022-10-06 13:15:01 +08:00
6db611ceb6 ci: update coredump elf repository tag 2022-10-04 10:24:45 +05:30
5f0bf15ad5 docs: update coredump guide to make stack size config generic 2022-10-04 10:24:44 +05:30
ce469140b5 espcoredump: enable tests for esp32c2 target 2022-10-04 10:24:44 +05:30
75df40c617 espcoredump: add esp32c2 target in test_app 2022-10-04 10:24:43 +05:30
6fb40068be espcoredump: re-enable test_app build for esp32c2 2022-10-04 10:24:43 +05:30
548db6c139 espcoredump: Add support for esp32c2
This commit puts some code under SOC_RTC_MEM_SUPPORTED. This enables use of coredump in targets with no RTC memory support.
2022-10-04 10:24:42 +05:30
ca5bc94c27 fatfsgen.py: enabled 512 sized sectors 2022-10-03 09:33:15 +00:00
3f3c9be14c Merge branch 'bugfix/fix_socket_leak_v5.0' into 'release/v5.0'
esp-tls: socket will be set to -1 and will not be closed (backport v5.0)

See merge request espressif/esp-idf!20349
2022-10-03 13:14:07 +08:00
68027354ad Merge branch 'bugfix/esptool_secure_boot_signing_key_path_v5.0' into 'release/v5.0'
esptool: (re)populate the secure boot signing key path (v5.0)

See merge request espressif/esp-idf!20422
2022-10-03 13:13:50 +08:00
e94ea3a02e Merge branch 'bugfix/add_so_linger_to_httpd_config_v5.0' into 'release/v5.0'
esp_http_server: Add struct linger in httpd_config_t (v5.0)

See merge request espressif/esp-idf!20358
2022-10-03 13:13:26 +08:00
21077eda8e esptool: (re)populate the secure boot signing key path
For project with reduced component list, secure boot signing key
path was not getting correctly. This change sets the secure boot
signing key path explicitly based on the relevant config option.

Closes https://github.com/espressif/esp-idf/issues/9578
Close IDFGH-8075
2022-10-01 15:05:29 +00:00
1d09c78c17 sdio_slave: allow disabling highspeed mode 2022-10-01 01:53:28 +08:00
3d47d8ae38 Merge branch 'ci/fix_upload-submodules-cache_v5.0' into 'release/v5.0'
CI: fix upload submodule cache for runners using mirror server (v5.0)

See merge request espressif/esp-idf!20442
2022-09-30 21:52:23 +08:00
ec4dd8a3a2 Merge branch 'bugfix/ble_light_sleep_enter_issue' into 'release/v5.0'
Bugfix/ble light sleep enter issue

See merge request espressif/esp-idf!20336
2022-09-30 18:22:41 +08:00
zwl
719f05306f Fixed the issue that master sends retransmitted data incorrectly on ESP32C2 2022-09-30 12:02:58 +08:00
0010f4c3a8 update controller lib for bugfix on light-sleep 2022-09-30 12:02:57 +08:00
9d7a7001ac fix ble compilation error 2022-09-30 12:02:57 +08:00
2a20a3c33f Merge branch 'feat/essl_extra_component_v5.0' into 'release/v5.0'
essl: move from esp-idf component to extra component (v5.0)

See merge request espressif/esp-idf!20342
2022-09-30 10:43:34 +08:00
e3f1308505 CI: fix upload submodule cache for runners using mirror server 2022-09-29 23:22:11 +08:00
2ac7008a16 intr_alloc: Fixed missing portEXIT_CRITICAL_SAFE
Closes https://github.com/espressif/esp-idf/pull/9867

[darian@espressif.com: Updated commit message]
Signed-off-by: Darian Leung <darian@espressif.com>
2022-09-29 20:36:27 +08:00
cdc92f8c01 example: fixed spi_slave_hd and sdio hosts should pull essl package of compatible versions 2022-09-29 07:39:45 +00:00
1e0c16deaf sdio/example: fixed the essl return type issue 2022-09-29 07:39:45 +00:00
c15f5f352c essl: move from esp-idf component to extra component 2022-09-29 07:39:45 +00:00
bcb9328618 Merge branch 'feature/openthread_flash_optimization_5.0' into 'release/v5.0'
openthread: Add some flash optimization options for openthread component (backport v5.0)

See merge request espressif/esp-idf!20420
2022-09-29 15:36:50 +08:00
7a14dc767f Merge branch 'bugfix/fix_uart_fake_tx_done_v5.0' into 'release/v5.0'
uart: Fix unwanted processing of TX_DONE interrupt immediately after calling uart_wait_tx_done() (backport v5.0)

See merge request espressif/esp-idf!20313
2022-09-29 12:28:53 +08:00
14ef8d56ca openthread: Add some flash optimization options for openthread component
openthread: use a certain version of esp_openthread_cli_extension managed component
2022-09-29 09:40:05 +08:00
eb2f472069 test: fix rmt iram case random failure 2022-09-28 10:52:29 +08:00
ba8fc01327 wifi_provisioning : Increased 1 byte of BLE advertising device name to store '\0', at the end, to ensure we adhere to the max name length as per spec. 2022-09-27 16:09:00 +05:30
5d58c10c3e rgb_lcd: support yuv converter 2022-09-27 14:32:04 +08:00
ee0d9e03d0 esp_http_server: Add linger in httpd_config_t
Closes: https://github.com/espressif/esp-idf/issues/9514
2022-09-27 10:10:03 +05:30
9aca373bf0 ci: add adc test pattern 2022-09-27 12:20:37 +08:00
4f8bd12479 esp_adc: added comments to c3 test thresh, also sync to legacy tests 2022-09-27 12:19:36 +08:00
3ae1c587c0 ci: use adc dedicated test runners for adc tests 2022-09-27 12:19:25 +08:00
0077163813 i2s_example: fixed i2s_adc_dac output gap
Closes: https://github.com/espressif/esp-idf/issues/9389
2022-09-27 11:31:44 +08:00
769c6c2214 esp-tls: socket will be set to -1 and will not be closed 2022-09-26 19:20:15 +08:00
f61c51567f Nimble: Re-ordered the function sequence in stack deinit to be reverse of stack init process 2022-09-23 15:41:50 +05:30
9ffb65f52e uart: Fix unwanted processing of TX_DONE interrupt immediately after calling uart_wait_tx_done()
In previous transmission(s), the TX_DONE interrupt raw bit may be raised, but never been cleared.
TX_DONE interrrupt status bit should be cleared before enabling it to check the new transmission.

Introduced in 4e09d147b11ed8a094b5858642c9f60d658ef656
2022-09-23 15:44:37 +08:00
135927db06 tinyusb: fix typo naming of ACM 2022-09-22 20:31:55 +08:00
0f59ffb94f usb_serial_jtag: fixed the docs that we can use usj in sleep modes
Related to: https://github.com/espressif/esp-idf/issues/8507, https://github.com/espressif/esp-idf/issues/8884
2022-09-22 15:33:21 +08:00
c321739074 Merge branch 'ci/optimize_ats_ci_flow_v5.0' into 'release/v5.0'
CI: optimize ATS ci flow (v5.0)

See merge request espressif/esp-idf!20173
2022-09-21 23:12:40 +08:00
b9495f85cf Merge branch 'bugfix/fix_c2_xtal_unstable_when_wakeup_from_sleep_backport_v5.0' into 'release/v5.0'
esp_hw_support/esp32c2/rtc: fix c2 xtal unstable when wakeup from sleep(backport v5.0)

See merge request espressif/esp-idf!20273
2022-09-21 22:38:24 +08:00
a0bc7f57cc Merge branch 'bugfix/fix_xtal32k_error_detect_backport_v5.0' into 'release/v5.0'
esp_hw_support/clk_cali: fix xtal32k error detect(backport v5.0)

See merge request espressif/esp-idf!20266
2022-09-21 22:36:04 +08:00
478c735fc6 Merge branch 'bugfix/riscv_interrupt_function_naming_v5.0' into 'release/v5.0'
riscv: Fix interrupt function naming and redundancy (v5.0)

See merge request espressif/esp-idf!20220
2022-09-21 20:41:08 +08:00
096fdb8bb4 Merge branch 'bugfix/bluedroid_debug_esp32c2_rls' into 'release/v5.0'
Bugfix/bludroid debug esp32c2

See merge request espressif/esp-idf!20244
2022-09-21 20:37:17 +08:00
e6566deae4 ci: fix ci error(insufficient internal ram link error) 2022-09-21 16:23:10 +08:00
e012b2b454 esp_hw_support/clk_cali: remove redundant check for cali value 2022-09-21 16:21:23 +08:00
9fa4bb272e esp_hw_support/clk_cali: fix xtal32k error detect 2022-09-21 16:21:11 +08:00
d5349fcc53 update ble controller lib for bugfix on esp32c2 2022-09-21 14:16:52 +08:00
b8b7a0d8dd esp_hw_support/esp32c2/rtc: take a safer xtal buf wait 2022-09-21 14:16:34 +08:00
4bcf814855 Merge branch 'bugfix/ble_light_sleep_error_on_esp32c2' into 'release/v5.0'
Bugfix/ble light sleep error on esp32c2

See merge request espressif/esp-idf!20237
2022-09-21 10:53:29 +08:00
870dfdf53b Merge branch 'bugfix/fix_sta_scan_when_already_connected_v5.0' into 'release/v5.0'
esp_wifi : Adds Status_Connected when the Sta attempts to connect to the AP it is already connected to

See merge request espressif/esp-idf!20246
2022-09-21 10:39:07 +08:00
58afbf71ae Merge branch 'bugfix/lpn_not_recv_message_to_all_node_5.0' into 'release/v5.0'
ble_mesh: stack: Add option for lpn auto sub all-nodes(v5.0)

See merge request espressif/esp-idf!20260
2022-09-21 10:01:51 +08:00
27a9e68d2c Merge branch 'bugfix/fix_vhci_hack_for_external_bt_v5.0' into 'release/v5.0'
Nimble: Added check to not include VHCI buffer handling code if controller support is disabled (v5.0)

See merge request espressif/esp-idf!20185
2022-09-21 09:41:33 +08:00
25c2f710e1 Merge branch 'bugfix/wps_connect_to_open_ap_v5.0' into 'release/v5.0'
esp_wifi: bugfix wps connect to open AP (v5.0)

See merge request espressif/esp-idf!20252
2022-09-21 09:22:56 +08:00
42d3ecd3af Merge branch 'bugfix/acl_buf_ocf_and_conn_fail_v5.0' into 'release/v5.0'
bugfix/fixed the exhaustion of ACL buffer and duplicated connection requests (v5.0)

See merge request espressif/esp-idf!20234
2022-09-20 23:56:14 +08:00
74ceccaf62 ble_mesh: stack: Add option for lpn auto sub all-nodes. 2022-09-20 20:29:11 +08:00
b7ad8a150f fixed the exhaustion of ACL buffer
fixed the duplication of connection request from the same device
2022-09-20 11:19:02 +00:00
a5c543a7a9 fix err using rpa for confirmation calculation 2022-09-20 18:06:45 +08:00
3112c8b954 mbuf copy hci data error fix 2022-09-20 18:06:45 +08:00
143a572b55 fix on data len change cmd malfunction 2022-09-20 18:06:45 +08:00
b585bdd739 Merge branch 'bugfix/fix_extend_adv_tx_pwr_signed_type_err_v5.0' into 'release/v5.0'
Fixed extend adv tx power range error (backport v5.0)

See merge request espressif/esp-idf!20226
2022-09-20 16:07:26 +08:00
3c3a68513c Merge branch 'feature/add_mesh_support_macro_v5.0' into 'release/v5.0'
ble_mesh: docs: Remove BLE Mesh related reference for C2(v5.0)

See merge request espressif/esp-idf!20097
2022-09-20 16:04:27 +08:00
eb7d52e18a esp_wifi: bugfix wps connect to open AP
Set Mac address in correct field
2022-09-20 13:01:45 +05:30
zwl
549eb762d8 fixed wifi can't be connected after enable bt sleep mode 2022-09-20 14:26:28 +08:00
4b01f4080c Merge branch 'bugfix/fix_ble_disconnect_due_to_channel_map_instant_passed_v5.0' into 'release/v5.0'
Fixed BLE disconnection issue when channel map instant passed due to bad channels(backport v5.0)

See merge request espressif/esp-idf!20190
2022-09-20 14:24:32 +08:00
75e375b257 Nimble: Added check to not include VHCI buffer handling code if
controller support is disabled
2022-09-20 11:08:16 +05:30
e10025c849 esp_wifi : Adds Status_Connected when the Sta attempts to connect to the AP it is already connected to. 2022-09-20 10:41:23 +05:30
c85d364720 Merge branch 'feature/sink_support_mono_v5.0' into 'release/v5.0'
bt: Fixed sink not being able to output mono audio because it can only decode dual channel audio data(v5.0)

See merge request espressif/esp-idf!20075
2022-09-20 11:04:44 +08:00
08366a1bf0 Merge branch 'feature/le_phy_v5.0' into 'release/v5.0'
NimBLE: Add example framework for BLE PHY (v5.0)

See merge request espressif/esp-idf!20193
2022-09-20 10:48:22 +08:00
959dd90787 Merge branch 'bugfix/memory_leak_init_deinit_blufi_example_v5.0' into 'release/v5.0'
Fix: blufi example memory leak while init and deinit (v5.0)

See merge request espressif/esp-idf!20219
2022-09-20 10:46:28 +08:00
2ac2077496 Merge branch 'bugfix/so_linger_close_wait_forever_v5.0' into 'release/v5.0'
lwip: Fix close() might block forever if SO_LINGER=y (v5.0)

See merge request espressif/esp-idf!20217
2022-09-20 10:45:09 +08:00
e1a845f7f8 Merge branch 'bugfix/change_log_level_for_print_v5.0' into 'release/v5.0'
Nimble : updated debug level for a print to avoid unwanted console log. (v5.0)

See merge request espressif/esp-idf!20110
2022-09-20 10:41:05 +08:00
zwl
89a141eea2 fixed ble can't enter light sleep 2022-09-19 21:32:54 +08:00
ddc294c79f ble_mesh: docs: Remove BLE Mesh related reference for C2 2022-09-19 21:11:17 +08:00
5b4446b1d3 Merge branch 'bugfix/fix_send_eapol_key_request_frame_when_wpa_group_handshake_issue_v5.0' into 'release/v5.0'
wpa_supplicant: try install gtk before send 2 of 2(Backport v5.0)

See merge request espressif/esp-idf!20202
2022-09-19 20:02:55 +08:00
9f31b718c9 Merge branch 'bugfix/adjust_mblock_size_on_esp32c2_v5.0' into 'release/v5.0'
change block1 size and num for esp ble controller

See merge request espressif/esp-idf!20187
2022-09-19 17:22:32 +08:00
zwj
07c4eb8841 Fixed extend adv tx power range error 2022-09-19 16:21:22 +08:00
6360e7028d Merge branch 'docs/misc_broken_link_fixes_v5.0' into 'release/v5.0'
docs: fixed misc broken links (v5.0)

See merge request espressif/esp-idf!20211
2022-09-19 14:32:44 +08:00
9119178f38 Merge branch 'bugfix/fix_set_country_code_before_wifi_start_issue_v5.0' into 'release/v5.0'
esp_wifi: fix set country code before wifi start issue.(Backport v5.0)

See merge request espressif/esp-idf!20151
2022-09-19 14:31:55 +08:00
00beda2ef1 Fix: blufi example memory leak while init and deinit 2022-09-19 11:51:05 +05:30
ebc57e14f6 riscv: Fix esprv_intc_int_set_threshold() naming
This commit fixes the function declaration naming from esprv_intc_set_threshold()
to esprv_intc_int_set_threshold(), thus allowing the underlying ROM funciton to be
exposed via the header.
2022-09-19 14:19:41 +08:00
0c8ac295c5 riscv: Remove redundant riscv_interrupts.h header
This commit removes the riscv_interrupts.h header is it has become redundant. The previously
exposed API has been handled as follows:

- "riscv_interrupt_enable()" and "riscv_interrupt_disable()" have been removed. These functions
  were declarations only and never had any implementation.
- "riscv_global_interrupts_enable()" and "riscv_global_interrupts_disable()" renamed to
  "rv_utils_intr_global_enable()" and "rv_utils_intr_global_disable()" respectively and now
  placed in rv_utils.h
2022-09-19 14:19:11 +08:00
c7d1bcaf79 lwip: Fix close() might block forever if SO_LINGER=y
* Update submodule: git log --oneline ec115c720b8909364ec5898dc5cc430cc898192d..316cfc17ce24f2d5d65c9f28251ec43a59a74cb1

Detailed description of the changes:
  - tcp/close: Fix clean socket closure when lignering (espressif/esp-lwip@316cfc17)
  - tcp_in: Fix incomplete closure if linger active (espressif/esp-lwip@8b599aa1)
  - ci: Introduce lwip test apps (espressif/esp-lwip@0866f578)
2022-09-19 07:35:57 +02:00
c3d425d21f Merge branch 'ci/enable_s3_default_s3_v5.0' into 'release/v5.0'
ci: re-enable running S3 tests by default (v5.0)

See merge request espressif/esp-idf!19873
2022-09-19 11:15:05 +08:00
35bb72bbfc docs: fixed misc broken links 2022-09-19 11:10:23 +08:00
3f5dba5eb9 Merge branch 'feature/check_mcpwm_sync_direction_v5.0' into 'release/v5.0'
mcpwm: check sync direction is valid (v5.0)

See merge request espressif/esp-idf!20174
2022-09-19 11:08:12 +08:00
03b10661b4 Merge branch 'bugfix/adapt_new_btc_v5.0' into 'release/v5.0'
ble_mesh: stack: Corrected parameter size when the btc_transfer_context is used (v5.0)

See merge request espressif/esp-idf!20165
2022-09-19 11:07:07 +08:00
8d2c4e2f3f Merge branch 'bugfix/relay_friend_cred_message_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix friend relay lpn message when relay disable(v5.0)

See merge request espressif/esp-idf!20203
2022-09-19 11:06:09 +08:00
74e21fadbd Merge branch 'docs/update-esp-rom-elfs-link_v5.0' into 'release/v5.0'
docs: update link for ESP ROM ELF releases (v5.0)

See merge request espressif/esp-idf!20150
2022-09-19 11:05:39 +08:00
aad557d70b Merge branch 'feature/mem-corruption-check-when-comprehensif-poisoning_v5.0' into 'release/v5.0'
heap: provide the tlsf_check_hook() definition to implement a check of memory corruption (v5.0)

See merge request espressif/esp-idf!19779
2022-09-19 11:04:44 +08:00
75f3f81af9 Merge branch 'contrib/github_pr_9749_v5.0' into 'release/v5.0'
Fix export.sh failure if python 2.x is unavailable (GitHub PR) (v5.0)

See merge request espressif/esp-idf!20156
2022-09-19 11:04:27 +08:00
2772806cb6 Merge branch 'feature/ulp_binutils_multi_target_v5.0' into 'release/v5.0'
ulp: support the new multi-target ULP-FSM binutils (v5.0)

See merge request espressif/esp-idf!20132
2022-09-19 11:03:49 +08:00
cc61509fc5 Merge branch 'bugfix/adc2_calibration_issue_on_s2_v5.0' into 'release/v5.0'
esp_adc: esp32s2: fix unit to offset calculation (v5.0)

See merge request espressif/esp-idf!20135
2022-09-19 11:03:07 +08:00
c4aa24c54e rmt: disable rc_fast clock when it's used up 2022-09-18 15:52:25 +08:00
0dde7cf3f0 ble_mesh: stack: Fix friend relay lpn message when relay disable. 2022-09-18 14:37:57 +08:00
103a53c80a wpa_supplicant: try install gtk before send 2 of 2 2022-09-17 19:08:13 +08:00
zwj
a2575d6b4d update BLE lib for ESP32C3 and ESP32S3
Fixed BLE disconnection issue when channel map update failed due to bad channels
2022-09-16 21:23:40 +08:00
1bc252ec5c NimBLE: Added example framework for BLE PHY 2022-09-16 15:21:13 +05:30
zwl
a5b0009cf8 change block1 size and num for esp ble controller 2022-09-16 14:41:28 +08:00
09cc360b43 Fixed sink not being able to output mono audio because it can only decode dual channel audio data 2022-09-15 11:35:25 +00:00
70ee85d38b mcpwm: check sync direction is valid 2022-09-15 19:07:31 +08:00
5e175a4d01 CI: optimize ATS ci flow 2022-09-15 18:44:50 +08:00
05863cb267 Nimble : updated debug level for a print to avoid unwanted console log. 2022-09-15 15:27:13 +05:30
4611e8971b ble_mesh: stack: added the judgment that the parameter is NULL but the parameter len is not zero to avoid btc_transfer_context failed 2022-09-15 09:12:51 +00:00
43b610a429 Tools: Fix export.sh failure if python is unavailable
In the latest release of macOS (and probable some other recent *nixes as well?) `python` is no longer available by default, only `python3`. This causes `export.sh` to fail as it still had a reference to plain `python`. This now works as expected.

Merges https://github.com/espressif/esp-idf/pull/9749
2022-09-14 17:27:16 +02:00
2dc3784f49 docs: update wifi country code docs. 2022-09-14 17:08:32 +08:00
3056fe4964 esp_wifi: add small UT for country code 2022-09-14 17:08:32 +08:00
5311999ae9 1. esp_wifi: fix pairwise cipher tkip pmf compability issue.
2. esp_wifi: fix repeated scans causing bss overwrite in connect process.
3. esp_wifi: fix set country code before wifi start issue.
2022-09-14 17:07:12 +08:00
5ab5672544 docs: update link for ESP ROM ELF releases 2022-09-14 12:53:47 +04:00
140b7d792b Merge branch 'bugfix/remove_esp_adc_wno_flag_v5.0' into 'release/v5.0'
esp_adc: remove wno flag (v5.0)

See merge request espressif/esp-idf!19957
2022-09-14 13:59:13 +08:00
f8f3eb27c1 Merge branch 'bugfix/touch_sensor_v1_timer_expired_after_deleted_v5.0' into 'release/v5.0'
touch_senser: fixed ci issue timer expired after it is deleted (v5.0)

See merge request espressif/esp-idf!19985
2022-09-14 13:58:52 +08:00
581b228d04 Merge branch 'fix/python_dbus_linux_v5.0' into 'release/v5.0'
Tools: Install dbus-python on Linux only (v5.0)

See merge request espressif/esp-idf!20128
2022-09-14 13:58:08 +08:00
1313574c89 Merge branch 'bugfix/idf_tools_update_bundled_cert_v5.0' into 'release/v5.0'
tools: update bundled root certificate in idf_tools.py (v5.0)

See merge request espressif/esp-idf!20113
2022-09-14 13:57:51 +08:00
72b2de9dab Merge branch 'docs/c2_storage_update_v5.0' into 'release/v5.0'
docs: update storage and sleep docs for C2 (v5.0)

See merge request espressif/esp-idf!19738
2022-09-14 13:56:08 +08:00
42a5b33e19 Merge branch 'doc/nvs_max_num_namespaces_5.0' into 'release/v5.0'
doc (nvs): added note about maximum possible namespaces (backport 5.0)

See merge request espressif/esp-idf!19979
2022-09-14 13:54:06 +08:00
1944b4bdb3 Merge branch 'bugfix/build_color_output_windows_v5.0' into 'release/v5.0'
tools: idf.py: use actual sys.stdout instead of the memoized one (v5.0)

See merge request espressif/esp-idf!20112
2022-09-14 13:53:41 +08:00
89dc570faf Merge branch 'bugfix/efuse_base_mac_test_v5.0' into 'release/v5.0'
ci: fix base_mac_address test failure for S2 chips (v5.0)

See merge request espressif/esp-idf!19868
2022-09-14 13:52:51 +08:00
21a15ad172 Merge branch 'feature/usb_v5_qol_backport_v5.0' into 'release/v5.0'
usb: USB IDF v5 update (backport v5.0)

See merge request espressif/esp-idf!20045
2022-09-14 13:52:36 +08:00
154dffb14f Merge branch 'feature/build_color_output_v5.0' into 'release/v5.0'
build system, tools: enable compiler color diagnostics by default, update CMake to 3.24.0 (v5.0)

See merge request espressif/esp-idf!20121
2022-09-14 13:52:14 +08:00
3358969263 Merge branch 'docs/update_ulp_shift_ops_description_v5.0' into 'release/v5.0'
docs: Updated description of ULP FSM shift operations

See merge request espressif/esp-idf!20129
2022-09-14 13:51:05 +08:00
c111b94057 Merge branch 'contrib/github_pr_9517_v5.0' into 'release/v5.0'
fix malloc(0) and heap_caps_alloc_failed() (backport v5.0)

See merge request espressif/esp-idf!19795
2022-09-14 13:50:33 +08:00
fdb2550da0 Merge branch 'bugfix/spi_hd_quad_issue_5.0' into 'release/v5.0'
SPI : fix wrong dummy cycle on quad mode and put get-command function in spi_ll.h(backport v5.0)

See merge request espressif/esp-idf!19799
2022-09-14 13:49:42 +08:00
7221510205 Merge branch 'fix/DOC_3566_v5.0' into 'release/v5.0'
Updating doc for the issue doc_3566 (v5.0)

See merge request espressif/esp-idf!20059
2022-09-14 13:49:10 +08:00
77b8aadbb4 Merge branch 'bugfix/wrong_bpp_for_rgb666_v5.0' into 'release/v5.0'
lcd: fix wrong bpp size of rgb666 format (v5.0)

See merge request espressif/esp-idf!20031
2022-09-14 13:48:39 +08:00
3f9b12d62a Merge branch 'bugfix/clobbering_freertos_base_priority_v5.0' into 'release/v5.0'
spi_flash: fix issue linked with raising of task priority while priority is already raised (v5.0)

See merge request espressif/esp-idf!20011
2022-09-14 13:47:55 +08:00
bc9e2f198f Merge branch 'feature/vfs_driver_interface_v5.0' into 'release/v5.0'
esp/vfs: VFS semihosting interface support (v5.0)

See merge request espressif/esp-idf!19854
2022-09-14 13:47:14 +08:00
393bbbc851 Merge branch 'bugfix/uart_sclk_freq_v5.0' into 'release/v5.0'
uart: fixed sclk_freq not init warning when compiling with asserts disabled (v5.0)

See merge request espressif/esp-idf!19870
2022-09-14 13:46:35 +08:00
71c962e332 Merge branch 'bugfix/ctx_lock_wifi_prov_v5.0' into 'release/v5.0'
Fixed provisioning manager deinit (v5.0)

See merge request espressif/esp-idf!20030
2022-09-14 13:43:03 +08:00
99173d5629 Merge branch 'feature/nimble_rearrange_common_files_v5.0' into 'release/v5.0'
Nimble: Reorganized nimble examples structure (v5.0)

See merge request espressif/esp-idf!19974
2022-09-14 13:42:28 +08:00
d66d0f6b8d Merge branch 'bugfix/remove_bt_dft_init_semicolon_v5.0' into 'release/v5.0'
bt: Remove trailing semicolon from bt dft initializer(v5.0)

See merge request espressif/esp-idf!19903
2022-09-14 13:41:42 +08:00
2a66480347 Merge branch 'bugfix/fix_some_ble_bugs_on_esp32c3_and_esp32s3_v5.0' into 'release/v5.0'
Fixed some BLE controller bugs on ESP32-C3 and ESP32-S3 (backport v5.0)

See merge request espressif/esp-idf!19987
2022-09-14 13:40:05 +08:00
64d9852e1f SPI_BUS_LOCK: fix a concurrency issue
define: lock_bits = (lock->status & LOCK_MASK) >> LOCK_SHIFT;  This `lock_bits` is the Bit 29-20 of the lock->status

1. spi_hdl_1:
   acquire_end_core():
   uint32_t status = lock_status_clear(lock, dev_handle->mask & LOCK_MASK);
   Becuase this is the first `spi_hdl_1`, so after this , lock_bits == 0`b0. status == 0

2. spi_hdl_2:
   acquire_core:
   uint32_t status = lock_status_fetch_set(lock, dev_handle->mask & LOCK_MASK);
   Then here status is 0`b0, but lock_bits == 0`b10. Because this is the `spi_hdl_2`

3. spi_hdl_2:
   `acquire_core` return true, because status == 0. `spi_bus_lock_acquire_start(spi_hdl_2)` then won't block.

4. spi_hdl_2:
   spi_device_polling_end(spi_hdl_2).

5. spi_hdl_1:
   acquire_end_core:
   status is 0, so it cleas the lock->acquiring_dev

6. spi_hdl_2:
   spi_device_polling_end:
   assert(handle == get_acquiring_dev(host)); Fail

Closes https://github.com/espressif/esp-idf/issues/8179
2022-09-14 12:08:24 +08:00
643bea7aed adc: esp32s2: fix unit to offset calculation
adc2 eFuse offset is wrong on 4.4 to 5.0 transition

Closes https://github.com/espressif/esp-idf/issues/9705
Closes https://github.com/espressif/esp-idf/pull/9715
2022-09-14 12:03:45 +08:00
434966f7b1 touch_sensor: add esp_timer error check 2022-09-14 02:40:32 +00:00
b333c1a9f1 touch_sensor: fixed timer period 2022-09-14 02:40:32 +00:00
0401aedd0c touch_senser: fixed ci issue timer expired after it is deleted 2022-09-14 02:40:32 +00:00
b1387fb7cb tools: update esp32ulp-elf to v2.35_20220830
Closes https://github.com/espressif/esp-idf/issues/6432
Closes https://github.com/espressif/binutils-esp32ulp/issues/23
2022-09-13 23:42:18 +04:00
4a58b810dd docs: Updated description of ULP FSM shift operations
This commit updates the documentation for ULP FSM LSH and RSH
operations.

Closes https://github.com/espressif/esp-idf/issues/8831
2022-09-13 15:06:26 +02:00
116c5980c2 Tools: Install dbus-python on Linux only 2022-09-13 14:58:08 +02:00
2e897c2e74 TLSF: fix the patch for tlsf_check function in ROM
tlsf_check in the patch was not called because the the TLSF functions
table in ROM was still pointing to the ROM implementation.
2022-09-13 14:20:39 +02:00
860232bdaf heap: Add test to check that the corruption of free memory is detected
This commit extends the heap test set by adding a test to check corruption
detection in free memory block.

For each byte of the free block memory, the test changes the value of the byte,
call multi_heap_check(), make sure that the function returns 'corruption detected'
only when comprehensive poisoning is set, restore the good value of the byte, calls
multi_heap_check() again and make sure that it returns 'OK'.
2022-09-13 14:19:51 +02:00
b8f682a11b esp-rom: create a patch of tlsf_check() for target(s) supporting ROM implementation of TLSF
The tlsf implementation in the ROM does not provide a mechanism
to register a callback to be called in by tlsf_check().

This commit is creating a patch of the tlsf implementation to provide
a definition of the function allowing to register the callback called
in tlsf_check() and add the call of this callback in tlsf_check().

This patch is only compiled for target(s) with ESP_ROM_HAS_HEAP_TLSF
set and ESP_ROM_TLSF_CHECK_PATCH set. For all the other configurations
the environment remains unchanged by those modifications.
2022-09-13 14:19:51 +02:00
fc43fed8ea heap: Provide definition of the tlsf_check_hook() declared in the tlsf submodule
Add the definition of tlsf_check_hook() in multi_heap if MULTI_HEAP_POISONING
is set. This definition calls the multi_heap_internal_check_block_poisoning()
to check the memory of a free block for corruption. If the light poisoinng is
set this function returns true. If the comprehensive poisoning is set, this
function will check that all byte of memory in the memory chunk passed as parameter
are set to the right FILL pattern.
2022-09-13 14:19:51 +02:00
829340d654 Merge branch 'bugfix/usb_serial_jtag_console_crash_v5.0' into 'release/v5.0'
console: fix a crash when initializing usb_serial_jtag console (v5.0)

See merge request espressif/esp-idf!20119
2022-09-13 19:12:48 +08:00
c9130e4859 idf.py: ensure that build log is always sanitized from color sequences
The actual output from the build tool (CMake/Ninja) may or may not
contain color escape codes, depending on various factors. The output
written to the log file should never include color escape codes,
though. This is because color escape codes in files are usually not
rendered as "color" in editors, and complicate reading. Also escape
codes would break the regular expressions used to display hints for
compilation errors.
2022-09-13 11:35:04 +02:00
22093dda21 tools: idf.py: enable CLICOLOR_FORCE for interactive builds
If stdout is a TTY (meaning that the output is not redirected), tell
the build tool (GNU Make or Ninja) to enable colorized output.

GNU Make and Ninja also check if their stdout is redirected and
strip color escape sequences in that case. CLICOLOR_FORCE environment
variable overrides this behavior.

With this change, if the compiler was launched with the
-fcolor-diagnostics flag and idf.py output is not redirected, the
final output in the terminal will be colorized.

(-fcolor-diagnostics is handled at CMake level by the previous commit)
2022-09-13 11:34:59 +02:00
1ffbee27e7 cmake: enable CMAKE_COLOR_DIAGNOSTICS by default
Related to https://github.com/espressif/esp-idf/issues/4162

Setting this option informs CMake that it should pass
-fcolor-diagnostics flag to the compiler.

(Colorized build system output, like from GNU Make, is produced even
without this flag.)

Note that if the build is done using Ninja and the build output is
redirected (not a TTY), Ninja will still strip the escape codes from
the output. For the case of idf.py, this is handled in the next
commit.
2022-09-13 11:34:59 +02:00
e40b83c16f tools: cmake: upgrade from 3.23.1 to 3.24.0 2022-09-13 11:34:59 +02:00
70f90b7160 Merge branch 'docs/sync_up_i2c_wifi_blemesh_backport_v5.0' into 'release/v5.0'
docs: Sync up EN and CN lines of ble-mesh, wifi, and i2c (backport v5.0)

See merge request espressif/esp-idf!19862
2022-09-13 16:55:12 +08:00
ba224e0fd9 docs: Update CN version for MR19453 2022-09-13 16:54:47 +08:00
8acb8bbd76 docs: update storage and sleep docs for C2 2022-09-13 16:54:47 +08:00
72e2fb2da1 Merge branch 'docs/malloc_header_v5.0' into 'release/v5.0'
heap: remove misleading info about malloc being equivalent to heap_caps_malloc(p, MALLOC_CAP_8BIT) (v5.0)

See merge request espressif/esp-idf!19895
2022-09-13 16:52:26 +08:00
d5175dacd2 Merge branch 'bugfix/fix_calling_cb_func_before_perform_v5.0' into 'release/v5.0'
esp_https_ota: fix bug where `http_client_init_cb` is called after esp_http_client_perform() (v5.0)

See merge request espressif/esp-idf!19930
2022-09-13 16:51:58 +08:00
dc6c01920c Merge branch 'bugfix/freertos_org_inc_path_v5.0' into 'release/v5.0'
freertos: fixed ORIG_INCLUDE_PATH cmake property having the wrong path (v5.0)

See merge request espressif/esp-idf!19869
2022-09-13 16:48:28 +08:00
63a4298509 Merge branch 'docs/networking_and_storage_backport_v5.0' into 'release/v5.0'
docs: translate networking.rst and storage.rst (backport v5.0)

See merge request espressif/esp-idf!20058
2022-09-13 16:45:11 +08:00
1dc350dc64 docs: translate networking.rst and storage.rst (backport v5.0) 2022-09-13 16:45:10 +08:00
6f872f4088 Merge branch 'bugfix/miniz_header_doc_v5.0' into 'release/v5.0'
esp-rom: fixed error in miniz header documention for tdefl_init (v5.0)

See merge request espressif/esp-idf!19909
2022-09-13 16:45:08 +08:00
362f1a778e Merge branch 'bugfix/bootloader_assert_v5.0' into 'release/v5.0'
bootloader: dont print assert msg if CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is set (v5.0)

See merge request espressif/esp-idf!19942
2022-09-13 16:44:52 +08:00
1164a5a52f Merge branch 'docs/reorder_mem_alloc_content_v5.0' into 'release/v5.0'
docs: reorder content in mem_alloc section (v5.0)

See merge request espressif/esp-idf!19948
2022-09-13 16:44:43 +08:00
726a73c076 Merge branch 'docs/update_cn_trans_establish_serial_connect_5.0' into 'release/v5.0'
docs: update cn trans establish_serial_connect (v5.0)

See merge request espressif/esp-idf!19893
2022-09-13 16:43:16 +08:00
fabe42b090 Merge branch 'bugfix/powershell_install_export_spaces_v5.0' into 'release/v5.0'
tools: fix {install,export}.ps1 for IDF_PATH with spaces (v5.0)

See merge request espressif/esp-idf!20118
2022-09-13 16:41:02 +08:00
3412140480 Merge branch 'fix/test_app_ide_integration_v5.0' into 'release/v5.0'
Tools: Increase the delay before producing exception in the Monitor IDE test app (v5.0)

See merge request espressif/esp-idf!20012
2022-09-13 16:40:29 +08:00
99953d4069 Merge branch 'contrib/github_pr_9637_v5.0' into 'release/v5.0'
export.fish: set IDF_PATH without changing current working directory (GitHub PR) (v5.0)

See merge request espressif/esp-idf!19886
2022-09-13 16:40:07 +08:00
6f11f2ab13 Merge branch 'bugfix/fix_hints_templates_v5.0' into 'release/v5.0'
tools: fix hints templates (v5.0)

See merge request espressif/esp-idf!19846
2022-09-13 16:39:43 +08:00
45d1aa0145 Merge branch 'bugfix/fix_CN_letters_in_monitor_v5.0' into 'release/v5.0'
tools: fix multi-byte character appearance in idf.py monitor (v5.0)

See merge request espressif/esp-idf!19845
2022-09-13 16:39:26 +08:00
ff09089137 console: pass esp_console_repl_universal_t pointer to the repl task
For usb_serial_jtag REPL only, xTaskCreate was passing a pointer to
esp_console_repl_com_t, while esp_console_repl_task was expecting
a pointer to esp_console_repl_universal_t.

The way the two structures are defined, this makes no difference, and
the pointer values are the same. Still, this could potentially break
in the future.

(I am not sure what is the distinction between repl_com (common?) and
repl_universal; it seems that `int uart_channel` could just as well
be part of esp_console_repl_com_t; alternatively, as suggested in the
previous commit, this structure could contain a callback function
pointer, which would allow `esp_console_new_repl_*` functions to
specify how stdin/stdout should be initialized by the REPL task.)
2022-09-13 09:01:00 +02:00
e15818c71b console: fix a crash when initializing usb_serial_jtag console
The crash occurred when calling setvbuf(stdin,...) with stdin==NULL.
This happened because esp_console_repl_task started running before
its args->uart_channel was initialized; then esp_console_repl_task
went into the code path 'uart_channel != CONFIG_ESP_CONSOLE_UART_NUM',
and tried to 'fopen("/dev/uart/0");`
Since the UART VFS is not registered when ESP_CONSOLE_USB_SERIAL_JTAG
option is enabled, fopen failed and 'stdin' was NULL.
Fix by moving the initialization of repl task arguments before the
start of the task, same as it is done for the usb_cdcacm case.

The crash started happening after the commit 287ab7566b. I haven’t
verified this, but I guess the reason why it wasn’t happening before
was that xTaskCreate was not correctly yielding to the newly created
higher-priority 'repl' task, therefore the code which was setting
the repl task arguments after xTaskCreate had time to execute.

It should be noted that the 'uart_channel' argument is a bit hacky,
in the first place. The code should be refactored to pass a callback
function to the repl task, and let this callback initialize stdin and
stdout based on the chosen console channel. Then esp_console_repl_task
does not require assumptions about the specific interface used.

Closes https://github.com/espressif/esp-idf/issues/9662
2022-09-13 09:00:59 +02:00
2f7c293573 tools: fix {install,export}.ps1 for IDF_PATH with spaces
Usage of IDF_PATH has to be quoted in case it contains spaces.
2022-09-13 08:59:56 +02:00
1e841ae802 tools: update bundled root certificate in idf_tools.py
dl.espressif.com is now using the same root certificate as github.com.
This commit replaces the previously-used ISRG X1 root certificate
with the DigiCert Root CA certificate.
As a result, even if the certificates are not installed (as it happens
on macOS with python.org installers, if the user forgets to run
'Install Certificates.command'), the download is successful.

Related to https://github.com/espressif/esp-idf/issues/4081
2022-09-12 18:09:13 +02:00
7c3de76692 tools: idf.py: use actual sys.stdout instead of the memoized one
This fixes the issue with build output not being colorized on Windows,
while the hints messages are colorized.

The issue occurred because sys.stdout and sys.stderr get overridden
by colorama.init() at runtime, but the default argument
output_stream=sys.stdout holds the reference to the"original"
sys.stdout.

colorama.init() (which, by the way, gets called via a curious chain
of imports, via idf_component_tools.manifest and tqdm package)
overrides standard streams, on Windows only. The overridden streams
contain logic to convert ANSI color codes into Windows Console API
calls to colorize the text.

Since read_and_write_stream function used the default value of
output_stream evaluated at module loading time, it was using the
original sys.stdout, not the one overridden by colorama.

One extra note is that while this does fix the coloring issue, the
solution is a bit fragile, as it relies on one of the following
(on Windows):
- colorama.init() is called (this can change if idf-component-manager
  stops importing tqdm)
- Sufficiently new version of Windows 10 is used, and ANSI color codes
  support is enabled in the Registry.
2022-09-12 18:08:20 +02:00
3cc3455ca6 spi_master:fix error when use spi_bus_add_device more than 3 device
update gpio_sig at `spics_out` array in each spi_periph.c of chips later than s2
then `spi_bus_add_device` can correctly distribute gpio_signals for cs_signal

Closes https://github.com/espressif/esp-idf/issues/8876
2022-09-09 15:57:13 +08:00
eea8629fa1 Merge branch 'bugfix/fix_gpio_intr_lost_v5.0' into 'release/v5.0'
gpio: Fix interrupt lost issue (backport v5.0)

See merge request espressif/esp-idf!19935
2022-09-09 15:05:50 +08:00
622bfa3e28 updating doc for the issue doc_3566 2022-09-09 10:32:53 +05:30
9f4e1babf9 Merge branch 'bugfix/spi_ethernet_init_doc_v5.0' into 'release/v5.0'
docs: Added migration notes for SPI-Ethernet Modules Initialization (v5.0)

See merge request espressif/esp-idf!20050
2022-09-09 11:03:28 +08:00
9c2ae8305a Added migration notes for SPI-Ethernet Modules Initialization 2022-09-08 15:41:51 +02:00
zwj
73d00170d6 Update ESP32-C3 and ESP32-S3 BLE lib
- Fixed the performance issue of BLE sync scan in coexistence scenario when PLL track is enabled
    - Fixed connect failed due to error sync found signal
    - Fixed BLE disconnect failed due to terminate_ind have sent but no ACK is received
    - Added ADV mode error check in ADV rx isr handler function
    - Fixed BLE RAL_UNDERRUN and TX_CRYPT_ERR assert
    - Disable scan continue
    - Fixed scan forever if scan continue is disable
2022-09-08 13:30:23 +00:00
d75037cc57 usb_host: Fix incorrect memset() usage in HCD
This commit fixes incorrect usage of memset() in the HCD's various
_buffer_parse_...() functions. The memset was not clearing the qtd lists, and
were simply setting the first qtd to a non zero value (i.e., the length of
the QTD list).

However, no bug occurred as the subsequent _buffer_fill_...() functions would
overwrite the QTD list anyways.
2022-09-08 14:05:58 +02:00
ca445ed99f usb_host: Use MSC driver from component registry 2022-09-08 14:05:48 +02:00
8f674f5952 usb_host: Use CDC driver from component registry 2022-09-08 14:05:38 +02:00
e69f473198 usb_host: Remove custom test_app 2022-09-08 14:05:29 +02:00
c8585267ab usb: Remove -Wno-format compile option 2022-09-08 14:05:19 +02:00
f30eab33a1 usb: Bring USB Host API out of beta 2022-09-08 14:05:10 +02:00
cb508c7d6a Merge branch 'bugfix/deadlock_after_call_esp_bluedroid_disable_v5.0' into 'release/v5.0'
bt:Fixed deadlock due to wrong parameter when calling btc_transfer_context() after calling esp_bluedroid_disable()(v5.0)

See merge request espressif/esp-idf!19950
2022-09-08 17:25:24 +08:00
8f6cad1a93 Merge branch 'bugfix/esp32c2_rom_aes_128_cmac_decrypt_v5.0' into 'release/v5.0'
esp_wifi: Remove ieee80211_crypto_aes_128_cmac_decrypt from esp32c2 rom

See merge request espressif/esp-idf!20009
2022-09-08 17:24:56 +08:00
5f86aaafdb Merge branch 'feature/add_qa_test_funcs_v5.0' into 'release/v5.0'
Add QA test Functions for esp32 (backport v5.0)

See merge request espressif/esp-idf!19742
2022-09-08 17:19:07 +08:00
3be0bae9d8 Merge branch 'bugfix/fix_ble_get_cur_pkt_num_crash_sometimes_when_bluetooth_is_disconnecting_v5.0' into 'release/v5.0'
Fixed calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting(backport v5.0)

See merge request espressif/esp-idf!19995
2022-09-08 17:18:22 +08:00
50059115a5 Merge branch 'doc/update_esp32c2_ble_doc_v5.0' into 'release/v5.0'
update doc for esp32c2 (backport v5.0)

See merge request espressif/esp-idf!20019
2022-09-08 17:17:22 +08:00
08c16af86d Merge branch 'feature/use_nimble_host_by_default_for_esp32c2_backport_50' into 'release/v5.0'
use nimble host by default

See merge request espressif/esp-idf!19994
2022-09-08 17:15:57 +08:00
907c46ac0d Merge branch 'bugfix/fix_data_overwrite_v5.0' into 'release/v5.0'
Nimble: Add extra allocation for data pointer returned by controller for ESP IP (v5.0)

See merge request espressif/esp-idf!19973
2022-09-08 17:12:06 +08:00
43b1c0c875 Merge branch 'bugfix/fix_the_duplicated_type_name_in_i2s_v5.0' into 'release/v5.0'
i2s: fix the duplicated type name in i2s (v5.0)

See merge request espressif/esp-idf!19999
2022-09-08 15:11:52 +08:00
e122778d35 lcd: fix wrong bpp size of rgb666 format
Closes https://github.com/espressif/esp-idf/issues/9729
2022-09-08 13:20:16 +08:00
2564bcb8d2 Merge branch 'bugfix/propogate_isr_allocation_failure_v5.0' into 'release/v5.0'
Fix MCPWM multiplication overflow (5.0)

See merge request espressif/esp-idf!19890
2022-09-08 13:12:10 +08:00
15d4079e5b wifi_provisioning: Fixed prov_ctx_lock of deinit provisioning manager 2022-09-08 10:21:33 +05:30
658adc75de Merge branch 'docs/nvs_key_part_note_for_self_gen_keys_v5.0' into 'release/v5.0'
docs: nvs: prior flash erase note for device generated `nvs_keys` partition (v5.0)

See merge request espressif/esp-idf!19944
2022-09-08 12:26:49 +08:00
bcee30f78e Merge branch 'feature/wifi_prov_mgr_is_provisioned_api_change_v5.0' into 'release/v5.0'
wifi_provisioning: decouple `wifi_prov_mgr_is_provisioned` from manager state (v5.0)

See merge request espressif/esp-idf!19945
2022-09-08 12:26:36 +08:00
d89922249d Merge branch 'bugfix/httpd_ssl_config_default_v5.0' into 'release/v5.0'
esp_https_server: fix issue with default initialization through `HTTPD_SSL_CONFIG_DEFAULT` (v5.0)

See merge request espressif/esp-idf!19947
2022-09-08 12:25:59 +08:00
3017b65d4d gpio: Fix interrupt lost issue
In previous gpio default isr, interrupt status bits get cleared at the exit of the isr.
However, for edge-triggered interrupt type, the interrupt status bit should be cleared before entering the per-pin handlers to avoid any potential interrupt lost.

Closes https://github.com/espressif/esp-idf/pull/6853
2022-09-08 11:52:25 +08:00
7568139778 Merge branch 'feature/c2_efuse_with_26mhz_v5.0' into 'release/v5.0'
efuse(es32c2): Supports 26MHz XTAL (v5.0)

See merge request espressif/esp-idf!19820
2022-09-07 22:02:30 +08:00
0147bd6b0d freertos: Adds new APIs to set/get and restore base priority
Closes https://github.com/espressif/esp-idf/issues/7580
2022-09-07 21:16:00 +08:00
f46fba1904 update doc for esp32c2 2022-09-07 19:16:14 +08:00
1148e4e77f SPI: Fixed Quad SPI wrong dummy cycle issue on ESP32C2/ESP32C3/ESP32S3 and put get-command/dummy-bits functions in spi_ll.h 2022-09-07 18:48:05 +08:00
501c688941 Tools: Increase the delay before producing exception in the Monitor IDE test app 2022-09-07 12:04:17 +02:00
f954caecf0 Merge branch 'bugfix/c2_skip_validate_v5.0' into 'release/v5.0'
bootloader: allow skip image validation on C2 (v5.0)

See merge request espressif/esp-idf!19975
2022-09-07 18:03:37 +08:00
7d983baced Merge branch 'feature/use_esp_secure_cert_tool_for_ssl_ds_example_v5.0' into 'release/v5.0'
mqtt/ssl_ds example: Remove configure_ds.py script, use (v5.0)

See merge request espressif/esp-idf!19835
2022-09-07 18:02:58 +08:00
71f7796da7 Merge branch 'fix/wifi_prov_mgr_update_comment_ragading_sec_params_validity_v5.0' into 'release/v5.0'
wifi_provisioning: Update API documentation to highlight argument validity... (v5.0)

See merge request espressif/esp-idf!19954
2022-09-07 18:02:31 +08:00
213cb1e424 Merge branch 'bugfix/stringop_overflow_warning_v5.0' into 'release/v5.0'
bootloader_support: fix stringop-overflow warning with `PERF` compiler optimization (v5.0)

See merge request espressif/esp-idf!19958
2022-09-07 18:01:55 +08:00
b4daffd3ca Merge branch 'bugfix/netif_ips_printed_before_got_ipv4_v5.0' into 'release/v5.0'
example_common: fix netif ips may be printed before got ipv4 (v5.0)

See merge request espressif/esp-idf!19968
2022-09-07 18:01:28 +08:00
51f82123a1 esp_wifi: Remove ieee80211_crypto_aes_128_cmac_decrypt from esp32c2 rom 2022-09-07 14:58:16 +05:30
d836d8cf35 i2s: add notes for the read task of i2s basic examples 2022-09-07 11:03:26 +08:00
0f0baa5bb4 i2s: fixed the duplicated type name 2022-09-07 11:03:26 +08:00
4729f75b41 use nimble host by default 2022-09-06 22:06:21 +08:00
zwj
dc010b701b fix calling esp_ble_get_cur_sendable_packets_num() sometimes crashes when bluetooth is disconnecting 2022-09-06 21:28:06 +08:00
ebb04bbdfe Docs: Update CN trans for nvs_flash.rst 2022-09-06 10:08:56 +02:00
615bc28836 doc (nvs): added note about maximum possible namespaces 2022-09-06 10:00:23 +02:00
3056d6e53d bootloader: allow skip image validation on C2
BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not supported on C2 due to
no RTC memory, but BOOTLOADER_SKIP_VALIDATE_ALWAYS should still be
supported.
2022-09-06 14:21:47 +08:00
9f3e341ccd NimBLE: Reorganized nimble examples structure to avoid repetition of files. 2022-09-06 11:31:57 +05:30
4ffafc3aa6 Nimble: Add extra allocation for data pointer returned by controller for ESP IP 2022-09-06 11:21:47 +05:30
1b8f3e096a example_common: fix netif ips may be printed before got ipv4 2022-09-05 23:08:19 +08:00
d1c61d29d3 Tools: Handle IO error in idf.py output capturing
Closes https://github.com/espressif/esp-idf/issues/9649
2022-09-05 11:11:09 +02:00
40c1529b4b bootloader_support: fix stringop-overflow warning with PERF compiler optimization
This commit fixes build issue because of function `bootloader_common_reset_rtc_retain_mem`
getting inlined with compiler optimization level set to `PERF` (-O2).

Build failure log:
-----------------

In function 'bootloader_common_reset_rtc_retain_mem',
    inlined from 'bootloader_common_update_rtc_retain_mem' at /h/esp-idf/components/bootloader_support/src/bootloader_common_loader.c:183:13:
/h/esp-idf/components/bootloader_support/src/bootloader_common_loader.c:159:5: error: 'memset' writing 16 bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  159 |     memset(rtc_retain_mem, 0, sizeof(rtc_retain_mem_t));
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-09-05 13:40:22 +05:30
78a38c8940 esp_adc: remove wno flag 2022-09-05 15:46:54 +08:00
2f99d2e37f wifi_provisioning: Update API documentation to highlight argument validity while providing sec_params argument. 2022-09-05 12:00:55 +05:30
607400a048 Fixed deadlock due to wrong parameter when calling btc_transfer_context() after calling esp_bluedroid_disable()
Closes https://github.com/espressif/esp-idf/issues/9672
2022-09-05 14:19:21 +08:00
f26d10118c docs: reorder content in mem_alloc section
We should avoid hiding sections between long lists of API documentation.
2022-09-05 13:45:59 +08:00
f41931e5f6 esp_https_server: fix issue with default initialization through HTTPD_SSL_CONFIG_DEFAULT
Closes https://github.com/espressif/esp-idf/issues/9653
Closes IDFGH-8157
2022-09-05 11:06:42 +05:30
caabf04af5 docs: add migration guide entry about provisioning API change 2022-09-05 10:53:47 +05:30
3955a85a47 wifi_provisioning: decouple wifi_prov_mgr_is_provisioned from manager state
`wifi_prov_mgr_is_provisioned()` API uses the `esp_wifi_get_config()` API
to check if Wi-Fi credentials are configured. It does not really require
any other information from the wifi_prov component. Hence, this commit
removed dependency of this API on provisioning manager initialization state.

Closes IDF-5878
2022-09-05 10:53:47 +05:30
6f4e857ae8 docs: nvs: prior flash erase note for device generated nvs_keys partition 2022-09-05 10:53:29 +05:30
587aab3720 bootloader: dont print assert msg if CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is set
Closes https://github.com/espressif/esp-idf/pull/7518
2022-09-05 12:31:23 +08:00
30d81f76b4 esp_https_ota: fix bug where http_client_init_cb is called after esp_http_client_perform() instead of before.
Closes https://github.com/espressif/esp-idf/issues/9581
2022-09-02 16:15:38 +05:30
72de8349a6 efuse(es32c2): Supports 26MHz XTAL 2022-09-02 10:05:20 +00:00
a43850ca17 uart: fixed sclk_freq not init warning when compiling with asserts disabled
Closes https://github.com/espressif/esp-idf/issues/9642
2022-09-02 06:15:20 +00:00
acd5850cad ci: re-enable running S3 tests by default 2022-09-02 06:15:01 +00:00
b6ec98535d Add QA test Functions 2022-09-01 13:56:52 +00:00
9f40e41421 vfs: use recommended esp_cpu_dbgr_is_attached API
This fixes deprecation warning with earlier API
`cpu_hal_is_debugger_attached`.
2022-09-01 13:18:17 +02:00
67fb17c939 esp-rom: fixed error in miniz header documention for tdefl_init
Closes https://github.com/espressif/esp-idf/issues/8435
2022-09-01 18:13:53 +08:00
372ab1468b heap: add a unit test for malloc(0) and slightly optimize heap_caps_malloc_prefer 2022-09-01 08:43:18 +00:00
8b3f916d1a fix malloc(0) and heap_caps_alloc_failed()
Don't call heap_caps_alloc_failed() for malloc(0) and calloc(0), because it is not an error.
Improve handling of malloc(0) and calloc(0).

Merges https://github.com/espressif/esp-idf/pull/9517
2022-09-01 08:43:18 +00:00
7caafb2542 heap: remove misleading info about malloc being equivalent to heap_caps_malloc(p, MALLOC_CAP_8BIT)
The actual memory allocated for malloc() depends on a lot of factors, see heap_caps_malloc_default()

Closes https://github.com/espressif/esp-idf/issues/7659
2022-09-01 14:32:54 +08:00
3b783f4d2d docs: update cn trans establish_serial_connect 2022-09-01 13:33:07 +08:00
6ebd5381fb Remove trailing semicolon from bt dft initializer
Similar to espressif#6554
2022-09-01 12:01:24 +08:00
47bf0ef212 mcpwm: fix multiplication overflow in converting us to compare ticks
Closes https://github.com/espressif/esp-idf/issues/9648
2022-09-01 10:48:20 +08:00
9747c3a8d6 legacy_timer: propagate isr register failure
Closes https://github.com/espressif/esp-idf/issues/9651
2022-09-01 10:48:08 +08:00
4532e6e0b2 Merge branch 'bugfix/sdio_slave_gcc11_crash_v5.0' into 'release/v5.0'
sdio_slave: workaround the sdio_slave crash issue with release config + GCC11 (v5.0)

See merge request espressif/esp-idf!19790
2022-09-01 10:07:36 +08:00
02bedfac62 Merge branch 'bugfix/driver_rs485_fix_test_sync_issues_v50' into 'release/v5.0'
driver: uart rs485 fix test sync issues and fail threshold (backport v5.0)

See merge request espressif/esp-idf!19603
2022-09-01 10:07:11 +08:00
9bb565b85c driver: uart rs485 fix test sync issues and fail threshold (backport v5.0) 2022-09-01 10:07:11 +08:00
f8ed093684 Fix macOS compatibility
command "readlink -m" was not compatible with macOS.
2022-08-31 16:05:52 +02:00
91002fef86 export.fish: set IDF_PATH without changing current working directory 2022-08-31 16:05:52 +02:00
7f4fa696e1 freertos: fixed ORIG_INCLUDE_PATH cmake property having the wrong path
FreeRTOS include path was changed, but ORIG_INCLUDE_PATH wasn't updated to reflect this.
2022-08-31 10:26:50 +08:00
139ec8667c ci: fix base_mac_address test failure for S2 chips
Some esp32s2 chips was burned with one MAC address by mistake.
The MAC address code contains a special case for these chips,
update MR to handle this special case.
2022-08-31 10:25:10 +08:00
c88b27f285 mqtt/ssl_ds: Remove unwanted references to configure_ds.py, Also updated
the DS documentation
2022-08-30 21:39:01 +05:30
958fce8571 docs: Sync up EN and CN lines of ble-mesh, wifi, and i2c 2022-08-30 19:18:06 +08:00
c1fa7ad652 esp/vfs: VFS semihosting interface support 2022-08-30 09:45:15 +02:00
f2424e9b93 tools: fix hints templates 2022-08-29 22:16:57 +02:00
34230426a6 tools: fix multi-byte character appearance in idf.py monitor 2022-08-29 22:12:42 +02:00
39c47cb6d8 Merge branch 'feature/add_txpwr_api_v5.0' into 'release/v5.0'
add set/get txpwr api and fix issues such as disconnect and abnormal tx behavior for esp32c2

See merge request espressif/esp-idf!19823
2022-08-30 01:55:31 +08:00
9dcf03a17e Merge branch 'contrib/github_pr_9656_v5.0' into 'release/v5.0'
upgrade ccache installed version to 4.6.2 (GitHub PR) (v5.0)

See merge request espressif/esp-idf!19840
2022-08-30 00:23:40 +08:00
7eee999b59 Merge branch 'feature/update-gdb-to-11.2_20220823_v5.0' into 'release/v5.0'
tools: update gdb version to '11.2_20220823' (v5.0)

See merge request espressif/esp-idf!19837
2022-08-30 00:18:20 +08:00
1608dad219 Merge branch 'bugfix/remove_rc4_3des_tls_cipher_wpa_v5.0' into 'release/v5.0'
wpa_supplicant: remove RC4 and 3DES ciphers for TLS (v5.0)

See merge request espressif/esp-idf!19776
2022-08-30 00:12:25 +08:00
zwl
502d47fa44 add set/get txpwr api and fix issues such as disconnect and abnormal tx behavior for esp32c2 2022-08-29 15:39:01 +00:00
1d15a41e4a wpa_supplicant: remove RC4 and 3DES ciphers for TLS
MbedTLS-3.x has dropped support for 3DES and RC4 TLS cipher
suites. Removing them from supplicant as well

Closes https://github.com/espressif/esp-idf/issues/9607
2022-08-29 14:57:09 +00:00
db69ae2787 Merge branch 'bugfix/remove_remaining_rom_time_t_dependencies_v5.0' into 'release/v5.0'
Newlib: Add workaround for ROM Newlib stdio functions using 32-bit time_t callpath (v5.0)

See merge request espressif/esp-idf!19685
2022-08-29 22:52:33 +08:00
16e961a336 Merge branch 'bugfix/fix_memory_corruption_in_recon_code_v5.0' into 'release/v5.0'
Nimble: Fixed memory corruption introduced in reconnection attempt code (v5.0)

See merge request espressif/esp-idf!19747
2022-08-29 22:47:38 +08:00
0ddeb8c47c Merge branch 'bugfix/bt_spp_init_init_uart_crash_v5.0' into 'release/v5.0'
bt:Fixed the bt_spp_initiator example that did not set the uart source clock when initializing the uart, which caused a crash (v5.0)

See merge request espressif/esp-idf!19766
2022-08-29 22:46:44 +08:00
7098e639ca Merge branch 'refactor/migrate_adc_wifi_test_to_test_app' into 'release/v5.0'
esp_adc: change adc wifi test IO (v5.0)

See merge request espressif/esp-idf!19822
2022-08-29 22:45:26 +08:00
656c6a3e86 upgrade ccache installed version to 4.6.2
- primary reason: 4.6.2 fixes errors if the user's home directory contains a space
- alternative fix: the CCACHE_DIR env var can be set to something without a space in it, or set to TMP which properly escapes the home dir name
- there may be other issues with spaces in filenames on builds in other parts of ESP-IDF, see https://github.com/espressif/esp-idf/issues/8364 for more info

tested locally on windows only, use at your own risk

Closes https://github.com/espressif/esp-idf/pull/9656
2022-08-29 14:55:49 +02:00
e95afaee58 Merge branch 'bugfix/docker_remove_libpython2.7_v5.0' into 'release/v5.0'
tools: Docker: remove libpython2.7 (v5.0)

See merge request espressif/esp-idf!19785
2022-08-29 20:37:19 +08:00
5c72fff43b Merge branch 'bugfix/ble_disconnect_enable_light_sleep_and_bb_pd_v5.0' into 'release/v5.0'
bt: Fixed bluetooth disconnection issue when light sleep and baseband power down are enabled (v5.0)

See merge request espressif/esp-idf!19802
2022-08-29 19:56:16 +08:00
ca313c8d28 ci: fix test_idf_tools dependencies 2022-08-29 15:41:14 +04:00
81c0328817 tools: fix test_abort backtrace 2022-08-29 15:41:14 +04:00
06cdc0ee4f tools: update gdb version to '11.2_20220823'
Closes https://github.com/espressif/esp-idf/issues/6124
2022-08-29 15:41:14 +04:00
cbecb2e944 mqtt/ssl_ds: Add documentation on how to use esp-secure-cert-tool with
the example
2022-08-29 16:19:51 +05:30
69be3b6955 mqtt/ssl_ds example: Update the code to use esp_secure_cert component 2022-08-29 16:19:51 +05:30
5e1b0b97b5 mqtt/ssl_ds example: Remove configure_ds.py script, use
esp-secure-cert-tool instread
2022-08-29 16:19:51 +05:30
5fc7c5aaed Merge branch 'bugfix/improve_psram_adding_to_heap_way_v5.0' into 'release/v5.0'
esp_psram: correct the way adding to heap allocator (v5.0)

See merge request espressif/esp-idf!19808
2022-08-29 16:35:48 +08:00
8aa90e4fb1 Merge branch 'doc/lcd_list_v5.0' into 'release/v5.0'
docs: Added link to list of available LCD controller drivers. (backport v5.0)

See merge request espressif/esp-idf!19827
2022-08-29 16:29:36 +08:00
41e8d71349 docs: Added link to list of available LCD controller drivers.
(cherry picked from commit 32f59d365f)
2022-08-29 08:25:09 +02:00
469f66fc9d Merge branch 'fix/disable_idf_py_moinitor_hints_v5.0' into 'release/v5.0'
Tools: Disable idf.py hints for IDF Monitor (v5.0)

See merge request espressif/esp-idf!19784
2022-08-29 13:57:50 +08:00
0b58bbd29b esp_adc: migrate adc wifi test to test app 2022-08-29 12:33:16 +08:00
ea4ebc473b ci: remove unused check_build_warnings script 2022-08-29 12:33:16 +08:00
3229698d19 ci: ignore partition nearly full warning 2022-08-29 12:33:16 +08:00
331f2d5277 Merge branch 'bugfix/fix_rtc_gpio_hold_v5.0' into 'release/v5.0'
gpio: Fix missing set hold bit in rtc gpio register (v5.0)

See merge request espressif/esp-idf!19811
2022-08-29 11:38:01 +08:00
9993e7714b Merge branch 'bugfix/iperf_py_script_upt_v5.0' into 'release/v5.0'
ci iperf: fixed condition for waiting to iperf server is up in DUT (v5.0)

See merge request espressif/esp-idf!19814
2022-08-29 11:24:01 +08:00
29ae238845 mmu: driver framework, for vaddr maintenance
This commit gives basic mmu driver framework. Now it is able to maintain
mmu virtual address usage on esp32, esp32s2 and esp32s3. Usage to
external virtual address should rely on mmu functions to know which
address range is available, instead of hardcoded.

This commit also improves psram memory that is added to the heap
allocator. Now it's added to the heap, according to the memory
alignment.

Closes https://github.com/espressif/esp-idf/issues/8295
Closes https://github.com/espressif/esp-idf/issues/9193
2022-08-27 16:05:51 +08:00
64e0ee573d esp_psram: rename esp_private/mmu.h to mmu_psram_flash.h
Prior to this commit, esp_psram/include/esp_private/mmu.h contains some
APIs that is used for:
- copy flash content to psram
- necessary sync APIs used by flash_mmap.c, due to above feature

This commit rename it to mmu_psram_flash.h, therefore mmu.h can be used
for real mmu related APIs.

This commit also moves above mention funcitons in `mmu.c` and
`mmu_psram.c` to `mmu_psram_flash.c`, leaving `mmu.c` to be used for
real mmu driver.
2022-08-27 15:11:15 +08:00
acbf7af80a Merge branch 'feature/mbedtls-3.2.1_v5.0' into 'release/v5.0'
mbedtls: Update to v3.2.1 (v5.0)

See merge request espressif/esp-idf!19797
2022-08-27 14:25:12 +08:00
dca90987d7 Merge branch 'fix/s3_world_controller_headers_v5.0' into 'release/v5.0'
esp32s3: Update world controller headers (v5.0)

See merge request espressif/esp-idf!19793
2022-08-27 13:10:48 +08:00
cb34db63fd Merge branch 'bugfix/rename_configs_not_set_v5.0' into 'release/v5.0'
Confgen: KConfig options not set in sdkconfig.defaults files can now be renamed

See merge request espressif/esp-idf!19806
2022-08-27 01:44:36 +08:00
74091777e6 ci iperf: fixed condition for waiting to iperf server is up in DUT 2022-08-26 15:57:33 +02:00
078e179ed2 added missing call to set hold register bit
This commit fixes gpio_hold_en(pin) function for ESP32, where after wakeup from deep sleep, the pin gets reset to default state and stop holding the pin level.
2022-08-26 15:17:57 +02:00
d7580183a6 Merge branch 'bugfix/rtc_periph_ulp_touch_v5.0' into 'release/v5.0'
sleep_modes: allow using touch/ULP with RTC_PERIPH domain (including EXT0 wakeup source) (v5.0)

See merge request espressif/esp-idf!19767
2022-08-26 18:46:25 +08:00
889f2e47e2 Merge branch 'docs/update_jtag_select_efuse_desc_5.0' into 'release/v5.0'
Docs: update the JTAG select eFuse description in configure-other-jtag.rst (backport v5.0)

See merge request espressif/esp-idf!19800
2022-08-26 18:12:35 +08:00
5f7a98c13e Confgen: KConfig options not set in sdkconfig.defaults files can now be renamed 2022-08-26 16:34:21 +08:00
7dcf576659 Fix bluetooth disconnection issue when light sleep and baseband power down are enabled 2022-08-26 15:59:33 +08:00
d38036b978 docs: fix jtag select efuse bit 2022-08-26 14:55:25 +08:00
be19c10f53 wpa_supplicant: fix issue with WPA2 enterprise TLS session
Usage of `mbedtls_ssl_conf_sig_algs()` was incorrect, it must include signature
algorithm with hash. This change is as per requirement defined in mbedTLS-3.2.1
release.
2022-08-26 11:46:55 +05:30
44d626a596 mbedtls: Override ecp_mul_restartable_internal
ECDSA verification uses ecp_mul_restartable_internal instead
of the public API mbedtls_ecp_mul_restartable
2022-08-26 11:46:55 +05:30
0c60328953 mbedtls/port: Fix dynamic buffers feature for v3.2.1
Co-authored-by: Li Jingyi <lijingyi@espressif.com>
2022-08-26 11:46:55 +05:30
51cbbe486c esp_tls/wpa_supplicant: Updated deprecated mbedtls APIs 2022-08-26 11:46:54 +05:30
aecc46df64 mbedtls: Update to v3.2.1
- Changelog: https://github.com/Mbed-TLS/mbedtls/releases/tag/v3.2.1
- Closes https://github.com/espressif/esp-idf/issues/8787
2022-08-26 11:46:54 +05:30
ca19d23952 esp32s3: Update world controller headers 2022-08-26 09:35:43 +05:30
fd689630ff Merge branch 'bugfix/idf_tools_test_timeout_v5.0' into 'release/v5.0'
ci: increase timeout for python packages install test (v5.0)

See merge request espressif/esp-idf!19787
2022-08-26 10:38:54 +08:00
c011cdce1c Merge branch 'bugfix/gpio_wakeup_docs_v5.0' into 'release/v5.0'
docs: fix documentation wrongly stating ESP_SLEEP_WAKEUP_GPIO is light sleep only (v5.0)

See merge request espressif/esp-idf!19739
2022-08-26 10:31:21 +08:00
6197871ba0 Merge branch 'bk/add_backpoint_for_mdns_and_openthread' into 'release/v5.0'
openthread: update OpenThread submodule(backport V5.0)

See merge request espressif/esp-idf!19777
2022-08-26 05:39:41 +08:00
bfdf5ddcbd sdio_slave: workaround the sdio_slave crash issue with release config + GCC11 2022-08-26 00:43:33 +08:00
87c93cef31 ci: increase timeout for python packages install test
On the build runners, the installation frequently takes around 150
seconds, which is above the current timeout. This change increases
the timeout.

Closes IDFCI-1436
2022-08-25 15:35:58 +02:00
2dc9aa9983 tools: Docker: remove libpython2.7
libpython2.7 was added to the container to allow running GDB built
with Python 2.7 support and distributed as part of the cross-compiler
toolchain.

Now that we have a new release of GDB which works with Python 3.x,
the GDB shipped with the cross-compiler is no longer used. Removing
libpython2.7 should reduce the image size.

This reverts commit be0372b1db.
2022-08-25 15:28:10 +02:00
46df25cc8b Tools: Disable idf.py hints for IDF Monitor
The feature will be re-enabled later after a proper fix for the
following Github issue.

Closes https://github.com/espressif/esp-idf/issues/9610
2022-08-25 15:17:21 +02:00
319bf4e333 Merge branch 'contrib/github_pr_9563_v5.0' into 'release/v5.0'
Add git-lfs to docker container (GitHub PR) (v5.0)

See merge request espressif/esp-idf!19652
2022-08-25 20:40:53 +08:00
aa412b9359 Merge branch 'feature/add_templates_for_hints_v5.0' into 'release/v5.0'
tools: add support of templates for hints (v5.0)

See merge request espressif/esp-idf!19734
2022-08-25 18:57:07 +08:00
450510cdb8 Merge branch 'bugfix/exclude_component_dirs_pacman_v5.0' into 'release/v5.0'
build: fix excluded components being passed to component manager (v5.0)

See merge request espressif/esp-idf!19622
2022-08-25 18:51:16 +08:00
6d37f012e1 Merge branch 'feature/app_metadata_to_esp_system_v5.0' into 'release/v5.0'
app_update: Moved app metadata to new component `esp_app_format` (v5.0)

See merge request espressif/esp-idf!19754
2022-08-25 17:06:50 +08:00
1a5baac621 openthread: update OpenThread submodule
* support NAT64 ICMP
2022-08-25 17:02:45 +08:00
c9b1b8bf81 Add git-lfs to docker container 2022-08-25 08:34:47 +00:00
d6a74e4141 Merge branch 'bugfix/cleanup_rom_spiflash_v5.0' into 'release/v5.0'
esp-rom: remove undefined spi_flash functions from header (v5.0)

See merge request espressif/esp-idf!19524
2022-08-25 14:59:03 +08:00
73a4b80a87 Merge branch 'bugfix/wps_connection_issue_v5.0' into 'release/v5.0'
wpa_supplicant: Fix WPS connection issue after WPS done (v5.0)

See merge request espressif/esp-idf!19719
2022-08-25 13:48:38 +08:00
40ca58496b Merge branch 'bugfix/fix_ble_sch_arb_assert_v5.0' into 'release/v5.0'
Fixed BLE sch_arb assert on ESP32-C3 and ESP32-S3(backport v5.0)

See merge request espressif/esp-idf!19732
2022-08-25 13:44:29 +08:00
b316ff3661 Nimble: Fixed memory corruption introduced in reconnection attempt code 2022-08-25 10:49:43 +05:30
2ab4ce4bb1 Update components/esp_hw_support/include/esp_sleep.h 2022-08-25 12:28:00 +08:00
209545db6a sleep_modes: allow using touch/ULP with RTC_PERIPH domain (including EXT0 wakeup source) 2022-08-25 12:27:59 +08:00
d5785d1968 Fixed the bt_spp_initiator example that did not set the uart source clock when initializing the uart, which caused a crash 2022-08-25 11:41:10 +08:00
69be7c4cc2 Merge branch 'feat/support_esp32c2_uart_v5.0' into 'release/v5.0'
uart: update console docs about frequency for ESP32-C2, move frequency of clock sources out of HAL (v5.0)

See merge request espressif/esp-idf!19690
2022-08-25 02:03:26 +08:00
ec15b7798b Merge branch 'bugfix/espnow_clear_key_register_v5.0' into 'release/v5.0'
esp_wifi: Fix the bug that espnow clear key register fail (backport v5.0)

See merge request espressif/esp-idf!19717
2022-08-24 18:44:26 +08:00
5bd962cba7 ci: Fix host-test failures 2022-08-24 14:46:33 +05:30
1dd7c7a480 docs: Added migration guide for app_update
- Deprecated functions and alternatives
2022-08-24 14:46:33 +05:30
a816ccf888 esp_app_format: Added test-app 2022-08-24 14:46:32 +05:30
5545b3790f esp_app_format: Fixed build errors and resolved dependencies 2022-08-24 14:46:32 +05:30
972c531b6d app_update: Moved app metadata to new component esp_app_format 2022-08-24 14:44:32 +05:30
4b02b56f77 Merge branch 'bugfix/bt_invalid_workqueue_num_v5.0' into 'release/v5.0'
Bluetooth: fixed the invalid workqueue number for BTU thread in Bluedroid(backport v5.0)

See merge request espressif/esp-idf!19580
2022-08-24 16:49:26 +08:00
c9124823ef Merge branch 'contrib/github_pr_9529_mr_5.0' into 'release/v5.0'
bt:No need to use local copy of btc_msg_t in btc_transfer_context, create it on heap and pass to osi_thread_post()(v5.0)

See merge request espressif/esp-idf!19691
2022-08-24 14:42:46 +08:00
bf74c6e89a Merge branch 'bugfix/a2dp_sink_reconfig_i2s_clk_fail_v5.0' into 'release/v5.0'
bt: Fixed that i2s_channel_disable was not called before calling i2s_channel_reconfig_std_clock in the A2DP sink example, which caused reconfiguring the I2S clock to fail

See merge request espressif/esp-idf!19601
2022-08-24 14:41:23 +08:00
c05c1a2e11 Merge branch 'bugfix/increase_leading_space_for_alloc_v5.0' into 'release/v5.0'
Nimble: Add extra space for buffer allocation for ESP IP (v5.0)

See merge request espressif/esp-idf!19731
2022-08-24 14:00:06 +08:00
de9fd87a42 Merge branch 'feature/esp_jpeg_examples_v5.0' into 'release/v5.0'
examples/tjpgd: Use esp_jpeg component in tjpgd example. (backport v5.0)

See merge request espressif/esp-idf!19635
2022-08-24 11:07:20 +08:00
76207273fd docs: fix documentation wrongly stating ESP_SLEEP_WAKEUP_GPIO is light sleep only
ESP_SLEEP_WAKEUP_GPIO is also a valid deep sleep wakeup cause on targets
with SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP

Closes https://github.com/espressif/esp-idf/issues/9567
2022-08-24 10:50:49 +08:00
7dda317028 Merge branch 'document/support_header_defination_v5.0' into 'release/v5.0'
Support of Micro definition in header file (v5.0)

See merge request espressif/esp-idf!19716
2022-08-24 10:29:07 +08:00
d6822770cd Merge branch 'bugfix/ble_mesh_console_support_nimble_host_for_v5.0' into 'release/v5.0'
ble_mesh:ble mesh console support nimble(v5.0)

See merge request espressif/esp-idf!19602
2022-08-24 10:27:00 +08:00
270ed8d056 tools: add support of templates for hints 2022-08-23 15:16:58 +02:00
9cd98fbd4a Merge branch 'bugfix/add_signature_in_image_len_v5.0' into 'release/v5.0'
bootloader_support: consider signature sector in image length validation (v5.0)

See merge request espressif/esp-idf!19483
2022-08-23 20:19:24 +08:00
zwj
ccd9d0f8ce Update BLE lib for ESP32-C3 and ESP32-S3
- update ble tx power level mapping
- Fixed ble sch_arb assert
2022-08-23 19:42:28 +08:00
zwj
1c1a3845ba fix extend adv set remove failed 2022-08-23 19:42:16 +08:00
c6d3708558 Nimble: Add extra space for buffer allocation for ESP IP 2022-08-23 17:09:15 +05:30
877848460d Merge branch 'fix/fix_esp_rsa_sign_alt_modifying_input_params_v5.0' into 'release/v5.0'
esp_rsa_sign_alt: Fix esp_init_ds_data_ctx API to not modify user defined data... (v5.0)

See merge request espressif/esp-idf!19713
2022-08-23 18:23:37 +08:00
43876cb31b Merge branch 'bugfix/add_adc_oneshot_disable_ulp_enum_v5.0' into 'release/v5.0'
esp_adc: add adc ulp mode disable enum , and kconfig to enable dac output (v5.0)

See merge request espressif/esp-idf!19710
2022-08-23 16:07:30 +08:00
b32151f43a wpa_supplicant: Fix WPS connection issue after WPS done
esp_wifi_disconnect is needed to clear the wifi state and enable
station to connect to new SSID. Add changes to call it after
WPS is done.
2022-08-23 13:09:22 +05:30
81424d9659 esp_wifi: Fix the bug that espnow clear key register fail
Closes WIFI-4696
2022-08-23 14:50:43 +08:00
9b6d1b91c0 Support of Micro defination in header file 2022-08-23 12:05:30 +05:30
052ef42e0a Merge branch 'ci/ota_example_bluedroid_gatts_timeout_v5.0' into 'release/v5.0'
CI: modify timeout of advanced_https_ota_example_bluedroid_gatts (v5.0)

See merge request espressif/esp-idf!19689
2022-08-23 14:32:45 +08:00
0dd55387ea esp_rsa_sign_alt: Fix esp_init_ds_data_ctx API to not modify user defined data when it is given directory from flash 2022-08-23 11:50:47 +05:30
f8d94d6a4e tjpgd: Remove ROM patches and tests.
(cherry picked from commit a00e8771a7)
2022-08-23 07:57:10 +02:00
d899ef0c80 examples/tjpgd: Use esp_jpeg component in tjpgd example.
(cherry picked from commit 2153a583ee)
2022-08-23 07:56:39 +02:00
d609f5fb35 Merge branch 'feature/support_esp32c2_test_pm_v5.0' into 'release/v5.0'
gpio, ledc, pm: several MR updates backport to v5.0

See merge request espressif/esp-idf!19706
2022-08-23 13:48:33 +08:00
b28454dd43 Merge branch 'ci/simplify_python_to_idf_venv_only_v5.0' into 'release/v5.0'
CI: simplify python to idf venv only (v5.0)

See merge request espressif/esp-idf!19681
2022-08-23 13:16:47 +08:00
1fdf242750 esp_adc: add a kconfig to disable dac on certain adc IOs
Added a kconfig option. By default, when using ADC oneshot
driver, it will disable
DAC channels:
- ESP32:   IO25, IO26
- ESP32S2: IO17, IO18
if ADC2 is in use.

You can disable this option, to measure DAC output, via internal ADC.
This is for test usage.
2022-08-23 10:48:18 +08:00
81007ee4ed esp_adc: add adc ulp mode disable enum
Prior to this commit, adc ulp is disabled by setting
adc_oneshot_unit_init_cfg_t::ulp_mode to false.

After this commit, a new enum `ADC_ULP_MODE_DISABLE` is added. So
setting `ulp_mode` to `ADC_ULP_MODE_DISABLE`, instead of `false`, to
disable the ulp mode.
2022-08-23 10:48:15 +08:00
382fd801c7 ci: remove check_python_style since flake8 is included in pre-commit 2022-08-23 10:45:28 +08:00
b88c6f0951 ci: test_idf_tools use system python 2022-08-23 10:45:28 +08:00
da5a5b52c8 ci: simplify the python env to idf venv only 2022-08-23 10:45:28 +08:00
a57b0446b6 ci: improve requirements ci/ttfw files 2022-08-23 10:44:42 +08:00
4a68f9e064 Merge branch 'feature/support_7.2.9_soc/pvt_dig_v5.0' into 'release/v5.0'
ESP32C2:support auto adjust LDO voltage based on pvt-dig(backport 5.0)

See merge request espressif/esp-idf!19628
2022-08-23 09:30:06 +08:00
4a5fc3989d build: fix excluded components being passed to component manager
`__COMPONENT_TARGETS` is evaluated very early when components and
component directories are added to the build, which means that all
components (including the ones which are in EXCLUDE_COMPONENTS) have
a build system target defined. The component manager was given the
list of all known components (derived from the list of targets), not
the list of components after EXCLUDE_COMPONENTS were processed.
Because of that, EXCLUDE_COMPONENTS didn't effectively exclude the
component from the consideration of the component manager.
2022-08-22 19:20:44 +02:00
492e66b210 Merge branch 'feature/qemu_upgrade_20220802_v5.0' into 'release/v5.0'
ci: upgrade qemu to 20220802 release (v5.0)

See merge request espressif/esp-idf!19620
2022-08-23 01:19:51 +08:00
38ac62e704 Merge branch 'feature/modbus_update_migration_guides_v50' into 'release/v5.0'
modbus: update protocol migration guide (backport v5.0)

See merge request espressif/esp-idf!19687
2022-08-23 01:06:08 +08:00
cd61a77cd6 modbus: update protocol migration guide (backport v5.0) 2022-08-23 01:06:08 +08:00
343acd7f88 gpio: fix USB D+ pin cannot disable pullup
Internally, disable usb serial jtag DP pin's pullup when calling gpio_ll_pullup_dis and rtcio_ll_pullup_disable
At usb serial jtag setup/install, re-enable DP pin's pullup

Closes https://github.com/espressif/esp-idf/issues/9495
2022-08-22 22:03:25 +08:00
26a4803048 ledc: Fix the usage of ledc_ls_timer_update and ledc_timer_rst
ledc_ls_timer_update is required only when CLK_DIV and DUTY_RES bits are changed.
Calling ledc_timer_rst while re-configure PWM frequency through ledc_set_freq can cause glitch in the signal
2022-08-22 22:02:15 +08:00
280a241792 pm: update pm test cases to support esp32c2 2022-08-22 21:56:10 +08:00
b84f9dd5cc Merge branch 'bugfix/fix_c2_rtc_ldo_too_low_bug_v5.0' into 'release/v5.0'
ESP32C2: Fix system not stable bug when rtc voltage too low (backport v5.0)

See merge request espressif/esp-idf!19599
2022-08-22 19:48:36 +08:00
214ebb4adb Merge branch 'bugfix/rmt_iram_safe_test_5.0' into 'release/v5.0'
driver: multiple updates backport to (5.0)

See merge request espressif/esp-idf!19525
2022-08-22 19:02:08 +08:00
d194a449f4 Merge branch 'bugfix/lwip_ipv6_zone_violation_v5.0' into 'release/v5.0'
lw ip: Reference official 2.1.3-esp branch (v5.0)

See merge request espressif/esp-idf!19595
2022-08-22 16:58:36 +08:00
e970ec5bf5 Merge branch 'bugfix/esp32c2_issues_fix_5.0' into 'release/v5.0'
update ble controller lib for ble issues fixed on esp32c2(8dbbbf0269)

See merge request espressif/esp-idf!19596
2022-08-22 16:51:04 +08:00
b2469bcaaa Merge branch 'module_logging_tag_lower_case_5.0' into 'release/v5.0'
Replaced logging tags with lower case in tcp_transport component (v5.0)

See merge request espressif/esp-idf!19677
2022-08-22 16:48:08 +08:00
60253ed3f3 Merge branch 'bugfix/esp_netif_remove_slip_v5.0' into 'release/v5.0'
esp_netif: Migrate SLIP interface to user-space (v5.0)

See merge request espressif/esp-idf!19634
2022-08-22 15:49:22 +08:00
cd5e85aa19 update code to use osi_free() 2022-08-22 15:37:16 +08:00
40addb8faa local copy of btc_msg_t
No need to use local copy of btc_msg_t in btc_transfer_context, create it on heap and pass to osi_thread_post().
2022-08-22 15:37:08 +08:00
ddaf57892c docs: update console frequency for ESP32-C2 2022-08-22 14:28:12 +08:00
6ed15178b6 uart: move frequency of clock sources out of HAL 2022-08-22 14:28:12 +08:00
18e9879908 CI: modify timeout of advanced_https_ota_example_bluedroid_gatts 2022-08-22 13:55:40 +08:00
8bbaa77830 ble_mesh:ble mesh console support nimble 2022-08-22 04:56:18 +00:00
a202ec2caf newlib: Add workaround for printf functions using 32-bit time_t on first call
sizeof(time_t) was previously switched from 4 to 8, ROM functions that use
time_t or dependent types (such as "struct stat") are no longer called due as
they still treat sizeof(time_t) as 4 (see commit
24c20d18).

However, there is a ROM callpath that was left out. If putchar is the first
stdio print related call, the call path will result in cantwrite() ->
__swsetup_r() -> __smakebuf_r() -> __swhatbuf_r() using the ROM "struct stat"
(where sizeof(time_t)==4).

Instead of removing all printf related ROM newlib functions (which will result
in increased binary size), this commit adds a workaround to setup the stdio
files before any print related calls occur.

This results in cantwrite() always returning false, thus the callpath described
above never being reached.

Closes https://github.com/espressif/esp-idf/issues/9269
2022-08-22 11:28:55 +08:00
361634c96b Merge branch 'bugfix/backport_wifi_bugs_to_5.0_0819' into 'release/v5.0'
esp wifi:bugfix for backport wifi bugs to 5.0(backport 5.0)

See merge request espressif/esp-idf!19662
2022-08-22 11:11:57 +08:00
d7b33debc5 Merge branch 'bugfix/fix_esp32_psram_cs_hold_time_issue_when_under_80m_v5.0' into 'release/v5.0'
esp_psram: fix esp32 psram cs hold time issue when under 40m (v5.0)

See merge request espressif/esp-idf!19647
2022-08-21 15:10:25 +08:00
67cef89b23 Merge branch 'bugfix/copyright_and_removed_component_update_v5.0' into 'release/v5.0'
docs: update copyright page for removed (migrated) components (v5.0)

See merge request espressif/esp-idf!19675
2022-08-20 01:21:27 +08:00
e9269e5d17 Replaced logging tags with lower case in tcp_transport component to unite all tags under common structure. 2022-08-19 15:25:44 +02:00
3460f5bc8a Merge branch 'contrib/github_pr_9497_v5.0' into 'release/v5.0'
Move xSemaphoreGive out of configASSERT (GitHub PR) (v5.0)

See merge request espressif/esp-idf!19537
2022-08-19 21:03:45 +08:00
050818181f Merge branch 'bugfix/freertos_eventgroup_test_flakiness_v5.0' into 'release/v5.0'
freertos: Fix flakey event group unit tests (v5.0)

See merge request espressif/esp-idf!19529
2022-08-19 21:02:33 +08:00
b621017865 Merge branch 'bugfix/hfp_examples_not_work_with_default_sdkconfig_v5.0' into 'release/v5.0'
bugfix/set default number of sco connection to 1 (v5.0)

See merge request espressif/esp-idf!19594
2022-08-19 20:32:45 +08:00
2d2e1190fe docs: update copyright page for removed (migrated) components 2022-08-19 17:50:36 +05:30
676a1d6eb1 Merge branch 'feature/esp_cryptoauthlib_from_manager_v5.0' into 'release/v5.0'
Push out esp-cryptoauthlib to component manager (v5.0)

See merge request espressif/esp-idf!19654
2022-08-19 20:18:54 +08:00
6eb6bb071d esp_wifi:fix some wifi bugs
1 esp32c2: mv multiphy api out of ESP_MESH_SUPPORT macro

   2 clear bss info when wifi stop

   3 add clear ap list interface
2022-08-19 14:11:53 +08:00
8696dc15f1 esp_wifi:add clear ap list interface 2022-08-19 14:10:51 +08:00
26a897039e esp_wifi: done beacon monitor timer and eloop timer when deinit 2022-08-19 14:10:25 +08:00
5920ffc1a9 Merge branch 'backport/bluetooth_cap_define_for_doc' into 'release/v5.0'
[backport releasev5.0] Fix bluetooth cap define for doc

See merge request espressif/esp-idf!19640
2022-08-19 14:09:44 +08:00
a74b48c14a bt: Fixed that i2s_channel_disable was not called before calling i2s_channel_reconfig_std_clock in the A2DP sink example, which caused reconfiguring the I2S clock to fail 2022-08-19 03:52:14 +00:00
3c6fcb2b60 tools: add hint for using esp-cryptoauthlib from manager 2022-08-18 20:15:19 +05:30
047eac2f25 Add entry for cryptoauthlib component manager migration 2022-08-18 20:15:19 +05:30
481c295bc2 cleanup remaining references for esp-cryptoauthlib 2022-08-18 20:15:19 +05:30
6db74398fe examples/secure_element: add component manifest file for cryptoauthlib 2022-08-18 20:15:18 +05:30
d34a91cace esp-cryptoautlib: remove submodule and use from IDF component manager 2022-08-18 20:15:18 +05:30
70ab635dd0 esp_psram: fixed 40mhz cs signal glitch issue 2022-08-18 20:26:32 +08:00
3144c870a6 Update BLE documentation scope 2022-08-18 16:27:06 +08:00
238d48edbc Remove docs not update for classic_bt 2022-08-18 16:27:06 +08:00
07f860d7e1 Updated the nimble instructions for ESP32. 2022-08-18 16:27:06 +08:00
5524c772e6 Fix soc caps define for all chips 2022-08-18 16:27:06 +08:00
338b283fb9 Merge branch 'bugfix/idf_py_gdb_s3_c3_v5.0' into 'release/v5.0'
tools: use built-in USB_SERIAL_JTAG for "idf.py openocd" on C3 and S3 (v5.0)

See merge request espressif/esp-idf!19621
2022-08-18 15:55:18 +08:00
0dc965d211 Merge branch 'feature/adds_c2_tests_v5.0' into 'release/v5.0'
ci: Adds CI tests (secure_boot and flash encryption) for esp32c2 (v5.0)

See merge request espressif/esp-idf!19535
2022-08-18 14:07:24 +08:00
b910828a14 Merge branch 'bugfix/blufi_checksum_failure_err_v5.0' into 'release/v5.0'
examples: blufi: fix API usage for generating dhm secret (v5.0)

See merge request espressif/esp-idf!19608
2022-08-18 13:11:39 +08:00
7e3e0fbbac Examples: Remove SLIP protocol example 2022-08-18 07:07:44 +02:00
5a9cfbbb28 esp_netif: Add docs on creating custom network stack connection layer 2022-08-18 07:07:44 +02:00
df8390075b esp_netif: Migrate SLIP interface to user-space 2022-08-18 07:07:44 +02:00
50ff1b0efd mcpwm: don't use keyword operator
Closes https://github.com/espressif/esp-idf/issues/9510
2022-08-18 10:59:42 +08:00
c8b634ecfe rgb_lcd: deprecate esp_lcd_color_space_t 2022-08-18 10:59:16 +08:00
55458447fb bdc_motor: component moved to registry 2022-08-18 10:57:13 +08:00
d8c2f67d63 mcpwm: added enable/disable functions
Closes https://github.com/espressif/esp-idf/pull/9523
2022-08-18 10:57:13 +08:00
5020fbce1c driver: add doc on how to unregister event callbacks
Closes https://github.com/espressif/esp-idf/pull/9523
2022-08-18 10:57:13 +08:00
4701d95052 driver: specify the interrupt priority
Closes https://github.com/espressif/esp-idf/issues/9520
2022-08-18 10:57:13 +08:00
6820c9decc rmt: add iram safe test
Closes https://github.com/espressif/esp-idf/issues/9487
2022-08-18 10:57:13 +08:00
88ee33bf4c unity_utils: added helper function to disable cache and run user function 2022-08-18 10:57:12 +08:00
b2efd94109 led_strip: use component manager in the example 2022-08-18 10:57:12 +08:00
998451c60a driver: remove -Wno-format flag 2022-08-18 10:57:12 +08:00
c514009e6d Merge branch 'update_sysview_supported_targets_v5.0' into 'release/v5.0'
Update SysView supported targets (v5.0)

See merge request espressif/esp-idf!19629
2022-08-18 05:27:07 +08:00
7e36ba9a9d Merge branch 'feature/update-toolchain-to-esp-2022r1-11.2.0_v5.0' into 'release/v5.0'
tools: update toolchain version to 'esp-2022r1-11.2.0' (v5.0)

See merge request espressif/esp-idf!19624
2022-08-18 02:25:51 +08:00
3bffe43cdc Merge branch 's3_sysview_irq_names_v5.0' into 'release/v5.0'
Fix ESP32-S3 interrupt names used by SystemView (v5.0)

See merge request espressif/esp-idf!19626
2022-08-18 01:54:21 +08:00
d0dd61c59a examples/sysview: add missing supported targets to readme 2022-08-17 13:09:50 +02:00
fdc839494f esp32s3: fix interrupt names used by SystemView 2022-08-17 12:48:37 +02:00
bf622042b7 replace CAN with TWAI in the esp_isr_names table 2022-08-17 12:32:43 +02:00
691f9caa14 tools: update toolchain version to 'esp-2022r1-11.2.0'
Closes https://github.com/espressif/esp-idf/issues/6113
2022-08-17 11:54:45 +02:00
91c89a14f6 tools: use built-in USB_SERIAL_JTAG for "idf.py openocd" on C3 and S3
Since both chips have built-in JTAG functionality, and there are no
official boards with FT2232H for these chips, use the built-in JTAG
by default.

To use them with esp-prog, set:
  OPENOCD_COMMANDS="-f board/esp32c3-ftdi.cfg"
or pass this via the --openocd-commands argument to idf.py.
2022-08-17 11:51:02 +02:00
5a14a10aef ci: upgrade qemu to 20220802 release
Changes accumulated since 20210826 release:

- Fixed cache flush emulation
- Fixed loading of baremetal ELF files via -kernel arg
- Added emulation of AES peripheral
- Fixed division by zero in UART emulation
- Fixed APP CPU using same ROM code as PRO CPU
- Base QEMU version upgraded from 6.1.0 to 7.0.0
2022-08-17 11:47:43 +02:00
zlq
3dc89437cc support auto adjust LDO voltage based on pvt-dig 2022-08-17 17:25:59 +08:00
8d417c25cb Merge branch 'bugfix/duplicate_i2s_test_case_name_v5.0' into 'release/v5.0'
i2s: fixed duplicated test case name (v5.0)

See merge request espressif/esp-idf!19526
2022-08-17 16:17:44 +08:00
d562d9f841 examples: blufi: fix API usage for generating dhm secret
API usage for `mbedtls_dhm_calc_secret` was incorrect, fixed by
providing correct RNG function pointer. This behavior was changed in
mbedTLS-3.x update.

Tested BluFi provisioning with this fix.

Closes IDF-5796
Closes https://github.com/espressif/esp-idf/issues/9488
2022-08-17 12:19:43 +05:30
ed3841eb53 Merge branch 'bugfix/fix_clk_cali_logic_for_c2_backport_v5.0' into 'release/v5.0'
esp32c2/clk_cali: fix rtc slow clk cali logic(backport v5.0)

See merge request espressif/esp-idf!19600
2022-08-17 14:36:00 +08:00
d3d1d4e1df esp32c2/clk_cali: fix rtc slow clk cali logic 2022-08-17 11:17:36 +08:00
cje
7243032123 set fosc div to 1 to make chip run stablly for C2 2022-08-17 10:58:14 +08:00
d47d2a210d Fixed the failure of 'connect audio' operation in HFP examples with default SDK configuration
Due to the lack of synchronized connections, the hf_client can not create audio_connection to
hf_ag. Set default number of synchronized connection to 1.

Closes https://github.com/espressif/esp-idf/issues/9537
2022-08-17 10:13:32 +08:00
zwl
65d35b0b45 update ble controller lib for ble issues fixed on esp32c2(8dbbbf0269) 2022-08-16 22:04:30 +08:00
09a8f171f2 lwip: Reference official 2.1.3-esp branch
Actual changes against 2.1.3-esp-dev:
* Fix IPv6 zoning violations
* Melted on-demand timer's commits into one
2022-08-16 15:07:54 +02:00
6d1f1eccfb Merge branch 'bugfix/incorrect_base_addr_for_rtcio_on_esp32s3_v5.0' into 'release/v5.0'
rtci2c: Corrected the register base addr reference for RTC I2C on esp32s3 (v5.0)

See merge request espressif/esp-idf!19558
2022-08-16 20:43:48 +08:00
518ace6bb5 components/bt: fixed the invalid workqueue number for BTU thread in Bluedroid
There should be only one workqueue for BTU task. The queue length for the second workqueue of BTU can be uninitialized and caused memory overflow and corruption.

Closes https://github.com/espressif/esp-idf/issues/9507
2022-08-16 17:19:58 +08:00
4ba5515dc0 Merge branch 'backport/backport_master_to_release_v5.0' into 'release/v5.0'
backport master to release v5.0(Backport v5.0)

See merge request espressif/esp-idf!19560
2022-08-16 16:37:54 +08:00
3d64788a2d Merge branch 'feature/replace-heap-tlsf-with-submodule_v5.0' into 'release/v5.0'
heap: Remove TLSF related files and replace them with the TLSF submodule (v5.0)

See merge request espressif/esp-idf!19555
2022-08-16 14:09:38 +08:00
5e32649ae9 Merge branch 'docs/backport_api_guides_5.0' into 'release/v5.0'
Docs: Updated the Chinese translation for several docs in api-guides and migration-guides/system.rst (backport v5.0)

See merge request espressif/esp-idf!19573
2022-08-16 13:50:29 +08:00
927af9cfbc Merge branch 'docs/add_cn_trans_gcc_provisioning_5.0' into 'release/v5.0'
Docs: add CN translation for migration guides/gcc.rst and provisioning.rst (backport 5.0)

See merge request espressif/esp-idf!19572
2022-08-16 13:25:37 +08:00
0514906eba Docs: add CN translation for migration guides/gcc.rst and provisioning.rst (backport 5.0) 2022-08-16 13:25:36 +08:00
8e02b560a2 Merge branch 'ci/add_integration_test_env_v5.0' into 'release/v5.0'
CI: add integration test env (v5.0)

See merge request espressif/esp-idf!19426
2022-08-16 12:14:36 +08:00
9ac257fd4e docs: update cn trans for migration-guides/system.rst 2022-08-16 12:04:20 +08:00
e9fd79b284 docs: update cn trans for api-guides 2022-08-16 12:03:58 +08:00
5bb61dfe2f rename xHoldSemaphore to result 2022-08-16 10:50:37 +08:00
241c38b5c0 Move xSemaphoreGive out of configASSERT
xSemaphoreGive won't be executed in configASSERT and semaphore will stay locked if NDEBUG (idf v5) or CONFIG_FREERTOS_ASSERT_DISABLE (idf v3, v4) are defined.
2022-08-16 10:50:37 +08:00
9e44ecee4c Merge branch 'bugfix/test_ethernet_throughput_basic_v5.0' into 'release/v5.0'
Bugfix/test ethernet throughput basic (v5.0)

See merge request espressif/esp-idf!19562
2022-08-16 10:49:02 +08:00
698b11334f Merge branch 'fix/idf_hints_errors_in_name_v5.0' into 'release/v5.0'
Tools: Correct idf.py hints for possible syntax errors (v5.0)

See merge request espressif/esp-idf!19565
2022-08-16 01:41:38 +08:00
58642bd5dd Merge branch 'fix/idf_py_logging_v5.0' into 'release/v5.0'
Tools: Fix idf.py hints to be enabled all the time and being able to disable them (v5.0)

See merge request espressif/esp-idf!19564
2022-08-16 01:32:15 +08:00
d9c997af8c Merge branch 'feature/add_hints_for_freertos_breaking_changes_v5.0' into 'release/v5.0'
hints: added compilation hints for FreeRTOS breaking changes (v5.0)

See merge request espressif/esp-idf!19561
2022-08-15 23:16:55 +08:00
fe6e7d25f1 Tools: Correct idf.py hints for possible syntax errors 2022-08-15 16:43:37 +02:00
e9b037375a Tools: Fix idf.py hints to be enabled all the time and being able to disable them 2022-08-15 16:41:32 +02:00
6903d32a9d eth_iperf_test: improved regex to properly evaluate IP address 2022-08-15 16:07:06 +02:00
7491cd7a9d hints: added compilation hints for FreeRTOS breaking changes 2022-08-15 15:45:18 +02:00
bc09a70071 esp_wifi: fix fail to scan after recv disassoc/deauth for esp32s2 2022-08-15 21:16:53 +08:00
b9a667b9f8 1. Wi-Fi: update tsf tick interval when lpclk is modified
2. Move register_lpclk_callback to coexistence
2022-08-15 21:16:11 +08:00
b2a6403b40 Power Management: fix the issue of sleeping time error beacause external 32kHz xtal does not exist 2022-08-15 21:16:02 +08:00
555d72c90a make bluetooth and wifi use the same low power clock 2022-08-15 21:15:51 +08:00
ebca41b3ca ESP32S3:bluetooth support use main XTAL in light sleep mode 2022-08-15 21:15:42 +08:00
b8b7dcc159 ESP32C3:bluetooth support use main XTAL in light sleep mode 2022-08-15 21:15:13 +08:00
56c78fbbf7 rtci2c: Corrected the register base addr reference for RTC I2C on esp32s3
This commit corrects the register base address reference for RTC I2C on
esp32s3.
2022-08-15 14:50:04 +02:00
378c54e273 heap: Move the declaration of tlsf_poison_fill_pfunc_set() in esp_rom component
- The declaration is moved to esp_rom/include/esp32c2/rom/tlsf.h.
- multi_heap_poisoning.h now includes rom/tlsf.h instead of declaring
tlsf_poison_fill_pfunc_set().

Note: If more targets will support an implementation of the TLSF in ROM,
esp_rom will be extended with new headers in the respective target directories
but multi_heap_poisoning.h will remain unchanged.
2022-08-15 11:11:52 +02:00
8fb2a7a162 heap: Fix compilation error when CONFIG_SPIRAM is set on esp32s3 target
When CONFIG_SPIRAM is set, the TLSF_MAX_POOL_SIZE is set to SOC_EXTRAM_DATA_SIZE
which caused the TLSF_MAX_POOL_SIZE to be bigger than 16MB.

This commit fixes the issue by adding an extra else if case to cover this configuration.
2022-08-15 11:11:52 +02:00
86d1425346 heap: Fix compilation errors when CONFIG_HEAP_TLSF_USE_ROM_IMPL is set
- include headers from the tlsf submodule only when CONFIG_HEAP_TLSF_USE_ROM_IMPL is not set
- remove usage of the tlsf_t type in the multi_heap.c
- add missing declaration of tlsf_poison_fill_pfunc_set() in multi_heap_poisoning.c
- define headers from tlsf submodule as private
- update the linker file in the heap component to the new naming of the tlsf file
- update the copyright docuementation to reference the submodule in github (https://github.com/espressif/tlsf)
- remove deleted files from the check_copyright_ignore.txt
2022-08-15 11:11:52 +02:00
a2b60946ac heap: Remove TLSF related files and replace them with the tlsf submodule
As the tlsf implementation is a fork from https://github.com/mattconte/tlsf,
the sources are moved to a separate repository and used as a submodule in the esp-idf instead.

In this commit:
- Removing TLSF related files and using tlsf submodule instead.

- Adding components/heap/tlsf_platform.h header gathering all IDF specifics.

- The multi_heap_poisoning.c provides the declaration of the
function block_absorb_post_hook() definied weak in the TLSF repository.

- The tlsf_platform.h includes the tlsf_common.h file after the definition
of FL_INDEX_MAX_PLATFORM macro to make sure that this macro will be available
in tlsf_common.h without having to include tlaf_platform.h from IDF in the
tlsf_common.h header from the TLSF repository.

- Add missing include from tlsf_block_functions.h in the multi_heap.c file.
Change related to the changes made in TLSF repository (tlsf_block_functions.h
no longer included in tlsf.h)
2022-08-15 11:11:52 +02:00
6cc5e4aa3a Merge branch 'docs/update_FSM_of_I2S_v5.0' into 'release/v5.0'
docs: update the diagram of FSM of I2S (v5.0)

See merge request espressif/esp-idf!19533
2022-08-15 17:02:09 +08:00
ccdeb43cc7 Merge branch 'fix/flake8_v5_warnings_v5.0' into 'release/v5.0'
Tools: Fix flake8 version 5 warnings (v5.0)

See merge request espressif/esp-idf!19543
2022-08-14 02:51:36 +08:00
452139ebc7 Merge branch 'feat/tools_upgrade_pip_v5.0' into 'release/v5.0'
Tools: Upgrade pip and setuptools if venv is not able (v5.0)

See merge request espressif/esp-idf!19521
2022-08-12 21:51:09 +08:00
6dd6ac57e8 Merge branch 'fix/idf_py_missing_component_man_v5.0' into 'release/v5.0'
Tools: Detect missing component manager and print proper error message (v5.0)

See merge request espressif/esp-idf!19531
2022-08-12 21:50:58 +08:00
1ae3768321 Tools: Fix flake8 version 5 warnings 2022-08-12 15:36:11 +02:00
82f63485ad efuse example: Adds CI tests for ESP32-C2 2022-08-12 18:00:14 +08:00
ac63ec27d7 docs: update the diagram of FSM of I2S 2022-08-12 17:57:52 +08:00
4385a5c626 Merge branch 'feature/update-gdb-to-11.2_20220808_v5.0' into 'release/v5.0'
tools: update gdb version to '11.2_20220808' (v5.0)

See merge request espressif/esp-idf!19512
2022-08-12 17:25:50 +08:00
a0a969c971 Tools: Detect missing component manager and print proper error message 2022-08-12 11:00:34 +02:00
a02a84d8a5 freertos: Fix flakey event group unit tests
The event group unit tests would previously use a single call bit (the
"BIT_CALL" macro) to unblock all the test tasks. However, if one or more tasks
were delayed in calling xEventGroupWaitBits(), the other tasks would clear the
test bits, leading to the test deadlocking.

This commit updates the bits used so that each task gets their own CALL and
RESPONSE bits.
2022-08-12 16:48:18 +08:00
18356cd124 i2s: fixed duplicated test case name 2022-08-12 14:57:54 +08:00
73a1d3b1bf Merge branch 'feature/esp_adc_migration_hints_v5.0' into 'release/v5.0'
idf.py hints: added hints for esp_adc component change (v5.0)

See merge request espressif/esp-idf!19523
2022-08-12 14:56:28 +08:00
44bbfa4fb8 esp-rom: add missing spi-flash ROM API functions
Added symbols for the SPI flash API which we export from the ROM interface,
deleted functions which are not exported.

Closes https://github.com/espressif/esp-idf/issues/1212
2022-08-12 14:31:56 +08:00
6655d1dad8 Merge branch 'bugfix/light_sleep_deadlock_v5.0' into 'release/v5.0'
esp_hw_support: Fix light sleep deadlock (v5.0)

See merge request espressif/esp-idf!19515
2022-08-12 14:10:40 +08:00
5607d2c918 idf.py hints: add build error hints when legacy adc calibration driver is used 2022-08-12 11:03:31 +08:00
c5292cae2e Merge branch 'cherry-pick-68bd2bad' into 'release/v5.0'
Bluetooth/Bluedroid: fix member typo(backport v5.0)

See merge request espressif/esp-idf!19456
2022-08-12 10:42:53 +08:00
a200091546 Tools: Upgrade pip and setuptools if venv is not able
venv upgrades pip and setuptools by the --upgrade-deps option available
since Python 3.9. This commit adds manual upgrade for Pythons 3.7 and 3.8.
2022-08-11 16:15:16 +02:00
c4912c0add Merge branch 'bugfix/mesh_bqb_test_issues_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix mesh v1.0 BQB test issues(v5.0)

See merge request espressif/esp-idf!19501
2022-08-11 20:10:25 +08:00
aa25d83787 esp_hw_support: Fix esp_light_sleep_start() deadlock
esp_light_sleep_start() will stall the other CPU via esp_ipc_isr_stall_other_cpu(). After stalling the other CPU,
will call esp_clk_... API which themselves take locks. If the other stalled CPU is holding those locks, this will
result in a deadlock.

This commit adds a workaround calling esp_clk_private_lock() to take the lock before stalling the other CPU.
2022-08-11 18:38:51 +08:00
1fded0234c esp_hw_support: esp_clk should use spinlock instead of mutex
esp_clk used to be protected using _lock_t (i.e., a FreeRTOS Mutex). However, esp_clk API is current called from
from critical sections, thus mutex should not be used (as they can be blocking).

This commit updates esp_clk to use spinlocks for critical sections instead.
2022-08-11 18:38:45 +08:00
2ba26785d4 tools: update gdb version to '11.2_20220808'
Closes https://github.com/espressif/esp-idf/issues/9522
2022-08-11 13:40:36 +04:00
e15b3b8b9d ble_mesh: stack: Fix kr from non-primary subnet shouldn't ignore
For case MESH/NODE/KR/BV-02-C
2022-08-11 14:09:02 +08:00
b42b8b007a ble_mesh: stack: Add a check if the appkey is bound to the model.
For case MESH/NODE/CFG/MP/BI-03-C
2022-08-11 14:08:55 +08:00
52af572bd5 ble_mesh: stack: the count_log field should be set to 0 when HBS is sent.
For MESH/NODE/CFG/HBS/BV-02-C
2022-08-11 14:08:48 +08:00
e260a04f22 ble_mesh: stack: The Heartbeat Publication Period Log value can set to 0x11, range: [0, 0x11] 2022-08-11 14:08:39 +08:00
7a8ebdc409 ble_mesh: stack: The value of expect_ack_for will be rewrited after send_pub_key().
For case MESH/PVNR/PROV/BV-04-C
2022-08-11 14:08:31 +08:00
7a8023e54c ble_mesh: stack: Fix ignore connectable PB-ADV PDU containing a Link Open message.
For case MESH/NODE/PBADV/BI-04-C
2022-08-11 14:08:17 +08:00
0a33ec0d1c ble_mesh: stack: Fix PB-GATT not check invalid link flag
For case MESH/NODE/PROV/BI-03-C
2022-08-11 14:08:10 +08:00
b4650fcc16 ble_mesh: stack: Fix invalid provisioning pdu type check
For case MESH/NODE/PROV/BI-15-C
2022-08-11 14:08:03 +08:00
83b1dd1c11 Merge branch 'idf_py/hints_protocol_prov_v5.0' into 'release/v5.0'
protocols/provisioning: Added hints for breaking changes (v5.0)

See merge request espressif/esp-idf!19489
2022-08-11 12:44:16 +08:00
c577919284 Merge branch 'docs/update_migration_guide_for_esp_hw_support_v5.0' into 'release/v5.0'
docs: Corrected the migration guide for esp_hw_support (v5.0)

See merge request espressif/esp-idf!19409
2022-08-11 10:36:30 +08:00
41679c5c3d Merge branch 'bugfix/esp32h2beta2_erase-flash' into 'release/v5.0'
esp32h2: Fix esp32h2beta2 erase flash (backport v5.0)

See merge request espressif/esp-idf!19447
2022-08-10 21:27:15 +08:00
089312c46d protocols/provisioning: Added hints for breaking changes
- For migrating from ESP-IDF v4.4.x to v5.0
2022-08-10 15:29:23 +05:30
5090955250 Merge branch 'bugfix/fix_esp32s3_cache_data_memory_wrong_attr_backport_v5.0' into 'release/v5.0'
bugfix: esp32s3 DCache data memory is retention dma inaccessible (backport v5.0)

See merge request espressif/esp-idf!19473
2022-08-10 17:56:10 +08:00
7b5870d4b8 Merge branch 'bugfix/friend_and_lpn_issues_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix friend and lpn issues(v5.0)

See merge request espressif/esp-idf!19474
2022-08-10 14:54:11 +08:00
a3b987b44c Merge branch 'bugfix/restore_missing_ble_mesh_videos_v5.0' into 'release/v5.0'
ble_mesh: doc: Restore missing ble mesh videos(v5.0)

See merge request espressif/esp-idf!19480
2022-08-10 14:53:53 +08:00
09b2aa5d5a Merge branch 'feature/further_support_esp32c2_sleep_backport_v5.0' into 'release/v5.0'
esp32c2/sleep: further support sleep for esp32c2 with 26MHz XTAL(backport v5.0)

See merge request espressif/esp-idf!19429
2022-08-10 13:38:51 +08:00
036872789c Merge branch 'bugfix/fix_memory_leak_in_pre_encrypted_ota_example_v5.0' into 'release/v5.0'
example: fix memory leak in pre_encrypted_ota example. (v5.0)

See merge request espressif/esp-idf!19469
2022-08-10 13:33:03 +08:00
db7c4e4938 bootloader_support: consider signature sector in image length validation
For secure boot enabled cases, bootloader and firmware images have signature
appended and size is variable based on scheme being used. This appended data
must be considered while verifying image length against allocated partition
size to avoid any possibilities of going beyond reserved size.

Closes IDF-5617
2022-08-10 10:38:02 +05:30
922008a7e6 ble_mesh: doc: Restore missing ble mesh videos 2022-08-10 11:37:24 +08:00
5172b6a89c ble_mesh: stack: Fix add continuously secure update into friend queue.
For MESH/NODE/FRND/FN/BV-20-C
2022-08-09 21:47:17 +08:00
000e2bbdc6 ble_mesh: stack: Fix friend relay lpn message when relay feature is disable
For MESH/NODE/FRND/FN/BV-23-C
2022-08-09 21:47:03 +08:00
edb78e8196 bugfix: malloc retention buffer with MALLOC_CAP_RETENTION caps 2022-08-09 21:10:59 +08:00
2313663c2e bugfix: DCache data memory is dma accessible but not retention dma accessible 2022-08-09 21:10:55 +08:00
85664aa637 example: fix memory leak in pre_encrypted_ota example.
Closes: https://github.com/espressif/esp-idf/issues/9489
2022-08-09 16:23:50 +05:30
d3940a6fe0 Fixed union member access typo
Closes https://github.com/espressif/esp-idf/pull/9498
2022-08-09 14:38:32 +08:00
a29b415749 bt member typo
Terminate sec_event.cfm_req.bd_name string, not sec_event.pin_req.bd_name
2022-08-09 14:38:08 +08:00
d3a7d21d0c Merge branch 'maintenance/simplified_codeowners_v5.0' into 'release/v5.0'
gitlab: simplify approvals for backports (v5.0)

See merge request espressif/esp-idf!19448
2022-08-09 00:04:03 +08:00
8347f80287 CI: add integration test env 2022-08-08 22:55:11 +08:00
7a02c7ddd8 gitlab: simplify approvals for backports (v5.0) 2022-08-08 15:11:18 +02:00
b7b4fd44be esp32h2: disable no_stub option
It helps to enable erase flash feature for esp32h2beta2
2022-08-08 20:44:15 +08:00
19331b46ec docs: fix xtal kconfig related description 2022-08-08 13:54:36 +08:00
9c3a57eafa examples/wifi/power_save: fix project kconfig file 2022-08-08 13:53:43 +08:00
8cd7c30bc7 kconfig: refactor xtal freq kconfig to common configuration item 2022-08-08 13:53:02 +08:00
3652792f9d examples/system/light_sleep: fix uart garbled output 2022-08-08 13:50:54 +08:00
2be35e400a examples/system/light_sleep: fix baudrate for uart wakeup source 2022-08-08 13:50:34 +08:00
1182 changed files with 18998 additions and 24568 deletions

View File

@ -146,10 +146,8 @@ exclude =
components/json/cJSON,
components/mbedtls/mbedtls,
components/openthread/openthread,
components/tinyusb,
components/unity/unity,
components/spiffs/spiffs,
examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib,
# autogenerated scripts
components/protocomm/python/constants_pb2.py,
components/protocomm/python/sec0_pb2.py,

View File

@ -57,28 +57,27 @@ variables:
PYTHON_VER: 3.7.10
CLANG_TIDY_RUNNER_PROJ: 2107 # idf/clang-tidy-runner
IDF_BUILD_APPS_PROJ: 2818 # fuhanxi/idf-build-apps
IDF_BUILD_APPS_PROJ: 2818 # espressif/idf-build-apps
# Docker images
BOT_DOCKER_IMAGE_TAG: ":latest"
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:2-3"
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.0:2"
AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test-v5.0:2-1"
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.0:2-1"
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.0:2"
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.0:2-20210826"
ESP_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-env-v5.0:4"
AFL_FUZZER_TEST_IMAGE: "$CI_DOCKER_REGISTRY/afl-fuzzer-test-v5.0:4-2"
CLANG_STATIC_ANALYSIS_IMAGE: "${CI_DOCKER_REGISTRY}/clang-static-analysis-v5.0:4-2"
ESP_IDF_DOC_ENV_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-doc-env-v5.0:4-4"
QEMU_IMAGE: "${CI_DOCKER_REGISTRY}/qemu-v5.0:4-20220802"
TARGET_TEST_ENV_IMAGE: "$CI_DOCKER_REGISTRY/target-test-env-v5.0:3"
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:3"
LINUX_SHELL_IMAGE: "${CI_DOCKER_REGISTRY}/linux-shells-v5.0:2"
PRE_COMMIT_IMAGE: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
# target test config file, used by assign test job
CI_TARGET_TEST_CONFIG_FILE: "$CI_PROJECT_DIR/.gitlab/ci/target-test.yml"
# target test repo parameters
TEST_ENV_CONFIG_REPO: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/ci-test-runner-configs.git"
CI_AUTO_TEST_SCRIPT_REPO_URL: "https://gitlab-ci-token:${BOT_TOKEN}@${CI_SERVER_HOST}:${CI_SERVER_PORT}/qa/auto_test_script.git"
CI_AUTO_TEST_SCRIPT_REPO_BRANCH: "ci/v4.1"
# cache python dependencies
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
@ -112,140 +111,101 @@ cache:
- .cache/submodule_archives
policy: pull
.setup_tools_unless_target_test: &setup_tools_unless_target_test |
.common_before_scripts: &common-before_scripts |
source tools/ci/utils.sh
is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
export IDF_MIRROR_PREFIX_MAP=
fi
if [[ "$SETUP_TOOLS" == "1" || "$CI_JOB_STAGE" != "target_test" ]]; then
tools/idf_tools.py --non-interactive install ${SETUP_TOOLS_LIST:-} && eval "$(tools/idf_tools.py --non-interactive export)" || exit 1
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
wget $OOCD_DISTRO_URL
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
tar -x -f $ARCH_NAME
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
export PATH=$PWD/openocd-esp32/bin:$PATH
fi
export IDF_MIRROR_PREFIX_MAP=
fi
.download_test_python_contraint_file: &download_test_python_contraint_file |
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "^([^,\n\r]+,)*include_nightly_run(,[^,\n\r]+)*$"; then
export INCLUDE_NIGHTLY_RUN="1"
fi
# configure cmake related flags
source tools/ci/configure_ci_environment.sh
# add extra python packages
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
.setup_tools_and_idf_python_venv: &setup_tools_and_idf_python_venv |
# must use after setup_tools_except_target_test
# otherwise the export.sh won't work properly
# download constraint file for dev
if [[ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]]; then
wget -O /tmp/constraint.txt --header="Authorization:Bearer ${ESPCI_TOKEN}" ${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw?ref=${CI_PYTHON_CONSTRAINT_BRANCH}
mkdir -p ~/.espressif
mv /tmp/constraint.txt ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
fi
.download_test_python_tool: &download_test_python_tool |
# Mirror
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
export IDF_MIRROR_PREFIX_MAP=
fi
# install latest python packages
# target test jobs
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
# ttfw jobs
if ! echo "${CI_JOB_NAME}" | egrep ".+_pytest_.+"; then
run_cmd bash install.sh --enable-ci --enable-ttfw
else
run_cmd bash install.sh --enable-ci --enable-pytest
fi
elif [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
run_cmd bash install.sh --enable-ci --enable-docs
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
run_cmd bash install.sh --enable-ci --enable-pytest
else
run_cmd bash install.sh --enable-ci
fi
source ./export.sh
# Custom OpenOCD
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
wget $OOCD_DISTRO_URL
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
tar -x -f $ARCH_NAME
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
export PATH=$PWD/openocd-esp32/bin:$PATH
fi
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
git clone --quiet --depth=1 -b ${CI_PYTHON_TOOL_BRANCH} https://gitlab-ci-token:${ESPCI_TOKEN}@${GITLAB_HTTPS_HOST}/espressif/${CI_PYTHON_TOOL_REPO}.git
pip install ./${CI_PYTHON_TOOL_REPO}
rm -rf ${CI_PYTHON_TOOL_REPO}
fi
.set_include_nightly_run: &set_include_nightly_run |
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "^([^,\n\r]+,)*include_nightly_run(,[^,\n\r]+)*$"; then
export INCLUDE_NIGHTLY_RUN="1"
fi
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
- source tools/ci/setup_python.sh
- *common-before_scripts
- *setup_tools_and_idf_python_venv
- add_gitlab_ssh_keys
- source tools/ci/configure_ci_environment.sh
- *setup_tools_unless_target_test
- fetch_submodules
- *download_test_python_contraint_file
- $IDF_PATH/tools/idf_tools.py install-python-env
# install esptool globally, TODO: remove this, IDFCI-1207
- pip install esptool -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
- *download_test_python_tool
# used for check scripts which we want to run unconditionally
.before_script_no_sync_submodule:
before_script:
- echo "Not setting up GitLab key, not fetching submodules"
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
- source tools/ci/setup_python.sh
- source tools/ci/configure_ci_environment.sh
- *download_test_python_contraint_file
- $IDF_PATH/tools/idf_tools.py install-python-env
.before_script_minimal:
before_script:
- echo "Only load utils.sh"
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
.before_script_integration_test:
before_script:
# need to install esptool, needn't install idf python env
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
- source tools/ci/setup_python.sh
- add_gitlab_ssh_keys
- fetch_submodules
# download the constraint file manually
- mkdir -p ~/.espressif
- wget -O ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE} --header="Authorization:Bearer ${ESPCI_TOKEN}" ${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw
- *download_test_python_contraint_file
# TODO: remove this, IDFCI-1207
- pip install esptool -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
- *download_test_python_tool
- *common-before_scripts
.before_script_macos:
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
- *download_test_python_contraint_file
- $IDF_PATH/tools/idf_tools.py install-python-env
- *common-before_scripts
# On macOS, these tools need to be installed
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
- $IDF_PATH/tools/idf_tools.py --non-interactive install cmake ninja
# This adds tools (compilers) and the version-specific Python environment to PATH
- *setup_tools_unless_target_test
# Install packages required by CI scripts into IDF Python environment
- pip install -r $IDF_PATH/tools/requirements/requirements.ci.txt
- source tools/ci/configure_ci_environment.sh
# Part of tools/ci/setup_python.sh; we don't use pyenv on macOS, so can't run the rest of the script.
- export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
- *setup_tools_and_idf_python_venv
- fetch_submodules
.before_script_pytest:
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
- source tools/ci/setup_python.sh
- add_gitlab_ssh_keys
- source tools/ci/configure_ci_environment.sh
- *setup_tools_unless_target_test
- fetch_submodules
- *download_test_python_contraint_file
# only need ci and pytest related packages, ttfw requirements would be mocked if not installed
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest,ci
- eval "$($IDF_PATH/tools/idf_tools.py export)" # use idf venv instead
.before_script_build_jobs:
before_script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- *set_include_nightly_run
- source tools/ci/setup_python.sh
- *common-before_scripts
- *setup_tools_and_idf_python_venv
- add_gitlab_ssh_keys
- source tools/ci/configure_ci_environment.sh
- *setup_tools_unless_target_test
- fetch_submodules
- *download_test_python_contraint_file
# only need ci and pytest related packages, ttfw requirements would be mocked if not installed
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest,ci
- eval "$($IDF_PATH/tools/idf_tools.py export)" # use idf venv instead
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}

View File

@ -2,208 +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
/.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_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_netif/ @esp-idf-codeowners/network
/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
/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_serial_slave_link/ @esp-idf-codeowners/peripherals
/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/tinyusb/ @esp-idf-codeowners/peripherals/usb
/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
/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/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/idf_size_yaml/ @esp-idf-codeowners/peripherals
/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/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

@ -116,7 +116,7 @@ curl -X POST --header "PRIVATE-TOKEN: [YOUR PERSONAL ACCESS TOKEN]" [GITLAB_SERV
```yaml
check_docs_lang_sync:
extends:
- .pre_check_job_template
- .pre_check_template
- .rules:build:docs
script:
- cd docs

View File

@ -85,6 +85,8 @@ assign_integration_test:
extends:
- .assign_test_template
- .rules:test:integration_test
- .before_script_minimal
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
needs:
- build_ssc_esp32
- build_ssc_esp32c3
@ -98,12 +100,13 @@ assign_integration_test:
INTEGRATION_TEST_CASE_PATH: "${CI_PROJECT_DIR}/auto_test_script/TestCaseFiles"
ASSIGN_TEST_CASE_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIAssignTestCases.py"
PYTHONPATH: ${CI_PROJECT_DIR}/auto_test_script/packages
PYTHON_VER: 3.7.7
GIT_LFS_SKIP_SMUDGE: 1
script:
- add_gitlab_ssh_keys
# clone test script to assign tests
# can not retry if downing git lfs files failed, so using empty_branch first.
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# assign integration test cases
- python ${ASSIGN_TEST_CASE_SCRIPT} -t ${INTEGRATION_TEST_CASE_PATH} -c $CI_TARGET_TEST_CONFIG_FILE -b ${BUILD_DIR} -o $TEST_DIR/test_configs

View File

@ -77,45 +77,6 @@ build:integration_test:
included_in:
- build:target_test
# -------------
# Special Cases
# -------------
"build:{0}-esp32s3":
matrix:
- *target_test
labels:
- build
- "{0}"
- target_test
patterns:
- build_components
- build_system
- build_target_test
- "{0}"
- "build-{0}"
included_in:
- "build:{0}"
- build:target_test
"build:component_ut-esp32s3":
matrix:
- *target_test
labels:
- build
- component_ut
- unit_test
- target_test
patterns:
- build_components
- build_system
- build_target_test
- component_ut
- unit_test
- build-component_ut
- build-unit_test
included_in:
- "build:{0}"
- build:target_test
####################
# Target Test Jobs #
@ -167,6 +128,7 @@ build:integration_test:
- wifi # example_test_002, example_test*wifi*
- ethernet # example_test*ethernet*
- sdio # UT_044, UT_045
- adc # component_ut_pytest_esp32x_adc
patterns:
- "{0}-{1}-{2}"
- "{0}-{2}"
@ -214,27 +176,6 @@ build:integration_test:
- "build:component_ut-esp32c2"
- build:target_test
# due to the lack of runners, s3 tests will only be triggered by label
"test:{0}-esp32s3":
matrix:
- *target_test
labels:
- "{0}_esp32s3"
included_in:
- "build:{0}"
- "build:{0}-esp32s3"
- build:target_test
# overwrite the esp32s3 component ut again
"test:component_ut-esp32s3": # component_ut will trigger by unit_test as well, since now we have 2 kinds of UT
labels:
- "component_ut_esp32s3"
- "unit_test_esp32s3"
included_in:
- build:component_ut
- "build:component_ut-esp32s3"
- build:target_test
"test:integration_test":
labels:
- integration_test

View File

@ -1,5 +1,4 @@
.deploy_job_template:
extends: .before_script_no_sync_submodule
stage: deploy
image: $ESP_ENV_IMAGE
tags:

View File

@ -41,7 +41,7 @@
# stage: pre_check
check_readme_links:
extends:
- .pre_check_job_template
- .pre_check_template
tags: ["build", "amd64", "internet"]
allow_failure: true
script:
@ -49,7 +49,7 @@ check_readme_links:
check_docs_lang_sync:
extends:
- .pre_check_job_template
- .pre_check_template
- .doc-rules:build:docs
script:
- cd docs
@ -62,7 +62,6 @@ check_docs_lang_sync:
dependencies: []
script:
- cd docs
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
parallel:
matrix:
@ -72,11 +71,10 @@ check_docs_lang_sync:
check_docs_gh_links:
image: $ESP_IDF_DOC_ENV_IMAGE
extends:
- .pre_check_job_template
- .pre_check_template
- .doc-rules:build:docs
script:
- cd docs
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
- build-docs gh-linkcheck
# stage: build_doc
@ -148,8 +146,6 @@ build_docs_pdf:
DOC_BUILDERS: "latex"
.deploy_docs_template:
extends:
- .before_script_no_sync_submodule
image: $ESP_IDF_DOC_ENV_IMAGE
variables:
DOCS_BUILD_DIR: "${IDF_PATH}/docs/_build/"
@ -161,7 +157,6 @@ build_docs_pdf:
script:
- add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
- export GIT_VER=$(git describe --always ${PIPELINE_COMMIT_SHA} --)
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
- deploy-docs
# stage: test_deploy
@ -227,5 +222,4 @@ check_doc_links:
allow_failure: true
script:
- cd docs
- pip install -U -r $IDF_PATH/tools/requirements/requirements.docs.txt
- build-docs -t $DOCTGT -l $DOCLANG linkcheck

View File

@ -204,19 +204,26 @@ test_idf_py:
- cd ${IDF_PATH}/tools/test_idf_py
- ./test_idf_py.py
# Test for create virtualenv. It must be invoked from Python, not from virtualenv.
# Use docker image system python without any extra dependencies
test_idf_tools:
extends: .host_test_template
extends:
- .host_test_template
- .before_script_minimal
artifacts:
when: on_failure
paths:
- tools/tools.new.json
expire_in: 1 week
image:
name: $ESP_ENV_IMAGE
entrypoint: [""] # use system python3. no extra pip package installed
script:
# Remove Xtensa and ULP toolchains from the PATH, tests will expect a clean environment
- export PATH=$(p=$(echo $PATH | tr ":" "\n" | grep -v "/root/.espressif/tools\|/opt/espressif" | tr "\n" ":"); echo ${p%:})
# Tools must be downloaded for testing
- python3 ${IDF_PATH}/tools/idf_tools.py download
- cd ${IDF_PATH}/tools/test_idf_tools
- ./test_idf_tools.py
# Test for create virtualenv. It must be invoked from Python, not from virtualenv.
- python3 -m pip install jsonschema
- python3 ./test_idf_tools.py
- python3 ./test_idf_tools_python_env.py
.test_efuse_table_on_host_template:
@ -268,7 +275,7 @@ test_espcoredump:
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-20210915
IDF_COREDUMP_ELF_TAG: idf-20220928
# install CMake version specified in tools.json
SETUP_TOOLS_LIST: "all"
script:
@ -316,8 +323,8 @@ test_mkuf2:
- ./test_mkuf2.py
test_autocomplete:
extends: .host_test_template
image: $LINUX_SHELL_IMAGE
extends:
- .host_test_template
artifacts:
when: on_failure
paths:
@ -327,8 +334,8 @@ test_autocomplete:
- ${IDF_PATH}/tools/ci/test_autocomplete.py
test_detect_python:
extends: .host_test_template
image: $LINUX_SHELL_IMAGE
extends:
- .host_test_template
script:
- cd ${IDF_PATH}
- shellcheck -s sh tools/detect_python.sh
@ -430,6 +437,14 @@ test_linux_example:
- timeout 5 ./build/linux_host_app.elf >test.log || true
- grep "Restarting" test.log
test_partition_api_host:
extends: .host_test_template
script:
- cd ${IDF_PATH}/components/esp_partition/host_test/partition_api_test
- idf.py build
- timeout 5 ./build/partition_api_test.elf >test.log
- grep " 0 Failures" test.log
test_gen_soc_caps_kconfig:
extends: .host_test_template
script:

View File

@ -1,21 +1,15 @@
.pre_check_base_template:
.pre_check_template:
stage: pre_check
image: $ESP_ENV_IMAGE
tags:
- host_test
dependencies: []
.pre_check_job_template:
extends:
- .pre_check_base_template
- .before_script_no_sync_submodule
.check_pre_commit_template:
extends: .pre_check_job_template
image: "$CI_DOCKER_REGISTRY/esp-idf-pre-commit:1"
before_script:
- source tools/ci/utils.sh
- export PYTHONPATH="$CI_PROJECT_DIR/tools:$CI_PROJECT_DIR/tools/ci/python_packages:$PYTHONPATH"
extends:
- .pre_check_template
- .before_script_minimal
image: $PRE_COMMIT_IMAGE
check_pre_commit_master_release:
extends:
@ -35,32 +29,20 @@ check_version:
# Don't run this for feature/bugfix branches, so that it is possible to modify
# esp_idf_version.h in a branch before tagging the next version.
extends:
- .pre_check_job_template
- .pre_check_template
- .rules:protected
script:
- export IDF_PATH=$PWD
- tools/ci/check_idf_version.sh
check_rom_api_header:
extends: .pre_check_job_template
extends: .pre_check_template
script:
- tools/ci/check_examples_rom_header.sh
- tools/ci/check_api_violation.sh
check_python_style:
extends:
- .pre_check_base_template
- .rules:patterns:python-files
artifacts:
when: on_failure
paths:
- flake8_output.txt
expire_in: 1 week
script:
- python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH
test_check_kconfigs:
extends: .pre_check_job_template
extends: .pre_check_template
artifacts:
when: on_failure
paths:
@ -75,7 +57,7 @@ test_check_kconfigs:
- python ${IDF_PATH}/tools/ci/test_check_kconfigs.py
check_blobs:
extends: .pre_check_base_template
extends: .pre_check_template
tags:
- build
variables:
@ -90,7 +72,7 @@ check_blobs:
- bash $IDF_PATH/tools/ci/check_blobs.sh
check_fuzzer_compilation:
extends: .pre_check_base_template
extends: .pre_check_template
image: $AFL_FUZZER_TEST_IMAGE
script:
- cd ${IDF_PATH}/components/lwip/test_afl_host
@ -100,7 +82,7 @@ check_fuzzer_compilation:
check_public_headers:
extends:
- .pre_check_base_template
- .pre_check_template
- .rules:build
tags:
- build
@ -113,7 +95,7 @@ check_public_headers:
check_chip_support_components:
extends:
- .pre_check_base_template
- .pre_check_template
- .rules:build
tags:
- build
@ -130,7 +112,7 @@ check_chip_support_components:
check_esp_err_to_name:
extends:
- .pre_check_base_template
- .pre_check_template
- .rules:build
tags:
- build
@ -146,7 +128,7 @@ check_esp_err_to_name:
check_esp_system:
extends:
- .pre_check_base_template
- .pre_check_template
- .rules:build
tags:
- build
@ -157,19 +139,19 @@ check_esp_system:
# the version returned by 'git describe'
check_version_tag:
extends:
- .pre_check_job_template
- .pre_check_template
- .rules:tag:release
script:
- (git cat-file -t $CI_COMMIT_REF_NAME | grep tag) || (echo "ESP-IDF versions must be annotated tags." && exit 1)
check_artifacts_expire_time:
extends: .pre_check_job_template
extends: .pre_check_template
script:
# check if we have set expire time for all artifacts
- python tools/ci/check_artifacts_expire_time.py
check_commit_msg:
extends: .pre_check_job_template
extends: .pre_check_template
script:
- git status
- git log -n10 --oneline ${PIPELINE_COMMIT_SHA}
@ -178,7 +160,7 @@ check_commit_msg:
check_test_scripts_build_test_rules:
extends:
- .pre_check_job_template
- .pre_check_template
- .before_script_build_jobs
script:
- python tools/ci/check_build_test_rules.py check-test-scripts examples/ tools/test_apps components

View File

@ -170,9 +170,8 @@
- "components/openthread/openthread"
- "components/protobuf-c/protobuf-c"
- "components/spiffs/spiffs"
- "components/tinyusb/tinyusb"
- "components/unity/unity"
- "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib"
- "components/heap/tlsf"
- ".gitmodules"
# for jobs: example_test*flash_encryption_wifi_high_traffic
@ -220,6 +219,13 @@
- "components/driver/**/*"
- "components/sdmmc/**/*"
# for jobs: component_ut_pytest_esp32x_adc:
.patterns-component_ut-adc: &patterns-component_ut-adc
- "components/esp_adc/**/*"
- "components/driver/**/*"
- "components/hal/**/*"
- "components/esp_hw_support/**/*"
- "components/efuse/**/*"
##############
# if anchors #
@ -499,7 +505,7 @@
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-unit_test
changes: *patterns-component_ut-adc
.rules:build:component_ut-esp32:
rules:
@ -519,6 +525,8 @@
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:build:component_ut-esp32c2:
rules:
@ -534,6 +542,8 @@
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:build:component_ut-esp32c3:
rules:
@ -552,6 +562,8 @@
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:build:component_ut-esp32h2:
rules:
@ -570,6 +582,8 @@
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:build:component_ut-esp32s2:
rules:
@ -588,6 +602,8 @@
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:build:component_ut-esp32s3:
rules:
@ -607,7 +623,7 @@
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-unit_test
changes: *patterns-component_ut-adc
.rules:build:custom_test:
rules:
@ -984,6 +1000,8 @@
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-component_ut
- <<: *if-dev-push
changes: *patterns-component_ut-adc
- <<: *if-dev-push
changes: *patterns-custom_test
- <<: *if-dev-push
@ -1191,6 +1209,19 @@
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:test:component_ut-esp32-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:test:component_ut-esp32-bt:
rules:
- <<: *if-revert-branch
@ -1245,6 +1276,19 @@
- <<: *if-label-component_ut_esp32c2
- <<: *if-label-unit_test_esp32c2
.rules:test:component_ut-esp32c2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32c2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:test:component_ut-esp32c2-bt:
rules:
- <<: *if-revert-branch
@ -1304,6 +1348,19 @@
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:test:component_ut-esp32c3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32c3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:test:component_ut-esp32c3-bt:
rules:
- <<: *if-revert-branch
@ -1363,6 +1420,19 @@
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:test:component_ut-esp32h2-adc:
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-component_ut-adc
.rules:test:component_ut-esp32h2-bt:
rules:
- <<: *if-revert-branch
@ -1422,6 +1492,19 @@
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:test:component_ut-esp32s2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s2
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:test:component_ut-esp32s2-bt:
rules:
- <<: *if-revert-branch
@ -1473,8 +1556,26 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-component_ut
.rules:test:component_ut-esp32s3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-component_ut
- <<: *if-label-component_ut_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-component_ut-adc
.rules:test:component_ut-esp32s3-bt:
rules:
@ -1533,6 +1634,17 @@
- <<: *if-dev-push
changes: *patterns-custom_test
.rules:test:custom_test-esp32-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32
- <<: *if-label-target_test
.rules:test:custom_test-esp32-bt:
rules:
- <<: *if-revert-branch
@ -1586,6 +1698,17 @@
when: never
- <<: *if-label-custom_test_esp32c2
.rules:test:custom_test-esp32c2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32c2
- <<: *if-label-target_test
.rules:test:custom_test-esp32c2-bt:
rules:
- <<: *if-revert-branch
@ -1643,6 +1766,17 @@
- <<: *if-dev-push
changes: *patterns-custom_test
.rules:test:custom_test-esp32c3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32c3
- <<: *if-label-target_test
.rules:test:custom_test-esp32c3-bt:
rules:
- <<: *if-revert-branch
@ -1700,6 +1834,17 @@
- <<: *if-dev-push
changes: *patterns-custom_test
.rules:test:custom_test-esp32h2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32h2
- <<: *if-label-target_test
.rules:test:custom_test-esp32h2-bt:
rules:
- <<: *if-revert-branch
@ -1757,6 +1902,17 @@
- <<: *if-dev-push
changes: *patterns-custom_test
.rules:test:custom_test-esp32s2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s2
- <<: *if-label-target_test
.rules:test:custom_test-esp32s2-bt:
rules:
- <<: *if-revert-branch
@ -1808,7 +1964,22 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-custom_test
.rules:test:custom_test-esp32s3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-custom_test
- <<: *if-label-custom_test_esp32s3
- <<: *if-label-target_test
.rules:test:custom_test-esp32s3-bt:
rules:
@ -1869,6 +2040,17 @@
- <<: *if-dev-push
changes: *patterns-example_test
.rules:test:example_test-esp32-adc:
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
.rules:test:example_test-esp32-bt:
rules:
- <<: *if-revert-branch
@ -1937,6 +2119,17 @@
when: never
- <<: *if-label-example_test_esp32c2
.rules:test:example_test-esp32c2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32c2
- <<: *if-label-target_test
.rules:test:example_test-esp32c2-bt:
rules:
- <<: *if-revert-branch
@ -2002,6 +2195,17 @@
- <<: *if-dev-push
changes: *patterns-example_test
.rules:test:example_test-esp32c3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32c3
- <<: *if-label-target_test
.rules:test:example_test-esp32c3-bt:
rules:
- <<: *if-revert-branch
@ -2076,6 +2280,17 @@
- <<: *if-dev-push
changes: *patterns-example_test
.rules:test:example_test-esp32h2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32h2
- <<: *if-label-target_test
.rules:test:example_test-esp32h2-bt:
rules:
- <<: *if-revert-branch
@ -2141,6 +2356,17 @@
- <<: *if-dev-push
changes: *patterns-example_test
.rules:test:example_test-esp32s2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s2
- <<: *if-label-target_test
.rules:test:example_test-esp32s2-bt:
rules:
- <<: *if-revert-branch
@ -2198,7 +2424,24 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s3
- <<: *if-label-target_test
- <<: *if-dev-push
changes: *patterns-build-example_test
- <<: *if-dev-push
changes: *patterns-example_test
.rules:test:example_test-esp32s3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-example_test
- <<: *if-label-example_test_esp32s3
- <<: *if-label-target_test
.rules:test:example_test-esp32s3-bt:
rules:
@ -2297,6 +2540,17 @@
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32
.rules:test:unit_test-esp32-bt:
rules:
- <<: *if-revert-branch
@ -2352,6 +2606,17 @@
when: never
- <<: *if-label-unit_test_esp32c2
.rules:test:unit_test-esp32c2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32c2
.rules:test:unit_test-esp32c2-bt:
rules:
- <<: *if-revert-branch
@ -2411,6 +2676,17 @@
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32c3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32c3
.rules:test:unit_test-esp32c3-bt:
rules:
- <<: *if-revert-branch
@ -2470,6 +2746,17 @@
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32h2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32h2
.rules:test:unit_test-esp32h2-bt:
rules:
- <<: *if-revert-branch
@ -2529,6 +2816,17 @@
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32s2-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s2
.rules:test:unit_test-esp32s2-bt:
rules:
- <<: *if-revert-branch
@ -2582,6 +2880,21 @@
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
- <<: *if-dev-push
changes: *patterns-unit_test
.rules:test:unit_test-esp32s3-adc:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-label-build-only
when: never
- <<: *if-label-target_test
- <<: *if-label-unit_test
- <<: *if-label-unit_test_esp32s3
.rules:test:unit_test-esp32s3-bt:

View File

@ -1,7 +1,7 @@
# pre_check stage
clang_tidy_check:
extends:
- .pre_check_base_template
- .pre_check_template
- .rules:patterns:clang_tidy
image: ${CLANG_STATIC_ANALYSIS_IMAGE}
artifacts:
@ -14,7 +14,6 @@ clang_tidy_check:
RULES_FILE: ${CI_PROJECT_DIR}/tools/ci/static-analysis-rules.yml
OUTPUT_DIR: ${CI_PROJECT_DIR}/clang_tidy_reports
script:
- python -m pip install -U pip
- internal_pip_install $CLANG_TIDY_RUNNER_PROJ pyclang
- export PATH=$PATH:$(python -c "import sys; print(sys.executable.rsplit('/', 1)[0])")
- dirs=$(cat ${CLANG_TIDY_DIRS_TXT} | while read line; do echo ${CI_PROJECT_DIR}/${line}; done | xargs)
@ -26,7 +25,7 @@ clang_tidy_check:
check_pylint:
extends:
- .pre_check_base_template
- .pre_check_template
- .rules:patterns:python-files
- .before_script_minimal
image: $SONARQUBE_SCANNER_IMAGE

View File

@ -15,7 +15,6 @@
.pytest_template:
extends:
- .target_test_template
- .before_script_pytest
artifacts:
when: always
paths:
@ -221,6 +220,14 @@ component_ut_pytest_esp32_generic:
- build_pytest_components_esp32
tags: [ esp32, generic ]
component_ut_pytest_esp32_adc:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32-adc
needs:
- build_pytest_components_esp32
tags: [ esp32, adc ]
component_ut_pytest_esp32_ip101:
extends:
- .pytest_components_dir_template
@ -253,6 +260,14 @@ component_ut_pytest_esp32s2_generic:
- build_pytest_components_esp32s2
tags: [ esp32s2, generic ]
component_ut_pytest_esp32s2_adc:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32s2-adc
needs:
- build_pytest_components_esp32s2
tags: [ esp32s2, adc ]
component_ut_pytest_esp32s3_generic:
extends:
- .pytest_components_dir_template
@ -261,6 +276,14 @@ component_ut_pytest_esp32s3_generic:
- build_pytest_components_esp32s3
tags: [ esp32s3, generic ]
component_ut_pytest_esp32s3_adc:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32s3-adc
needs:
- build_pytest_components_esp32s3
tags: [ esp32s3, adc ]
component_ut_pytest_esp32s3_octal_psram:
extends:
- .pytest_components_dir_template
@ -293,6 +316,14 @@ component_ut_pytest_esp32c2_generic:
- build_pytest_components_esp32c2
tags: [ esp32c2, generic, xtal_40mhz ]
component_ut_pytest_esp32c2_adc:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32c2-adc
needs:
- build_pytest_components_esp32c2
tags: [ esp32c2, adc ]
component_ut_pytest_esp32c2_xtal_26mhz:
extends:
- .pytest_components_dir_template
@ -309,6 +340,14 @@ component_ut_pytest_esp32c3_generic:
- build_pytest_components_esp32c3
tags: [ esp32c3, generic ]
component_ut_pytest_esp32c3_adc:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32c3-adc
needs:
- build_pytest_components_esp32c3
tags: [ esp32c3, adc ]
component_ut_pytest_esp32c3_flash_encryption:
extends:
- .pytest_components_dir_template
@ -374,14 +413,6 @@ test_app_test_pytest_esp32c3_generic:
- build_pytest_test_apps_esp32c3
tags: [ esp32c3, generic ]
test_app_test_pytest_esp32s2_usb_host:
extends:
- .pytest_test_apps_dir_template
- .rules:test:custom_test-esp32s2
needs:
- build_pytest_test_apps_esp32s2
tags: [ esp32s2, usb_host ]
test_app_test_pytest_esp32s3_mspi_f8r8:
extends:
- .pytest_test_apps_dir_template
@ -613,6 +644,12 @@ example_test_C3_GENERIC:
- ESP32C3
- Example_GENERIC
example_test_C2_GENERIC:
extends: .example_test_esp32c2_template
tags:
- ESP32C2
- Example_GENERIC
example_test_ESP32_SDSPI:
extends: .example_test_esp32_template
tags:
@ -1026,8 +1063,9 @@ UT_S3_FLASH:
extends:
- .target_test_job_template
- .rules:test:integration_test
# needn't install idf python env
- .before_script_integration_test
- .before_script_minimal
image: ${CI_INTEGRATION_TEST_ENV_IMAGE}
cache: []
needs: # the assign already needs all the build jobs
- assign_integration_test
variables:
@ -1038,22 +1076,23 @@ UT_S3_FLASH:
KNOWN_ISSUE_FILE: "${CI_PROJECT_DIR}/tools/ci/integration_test/KnownIssues"
CI_RUNNER_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/bin/CIRunner.py"
PREPARE_TEST_BIN_SCRIPT: "${CI_PROJECT_DIR}/tools/ci/integration_test/prepare_test_bins.py"
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${PYTHONPATH}"
PYTHONPATH: "${CI_PROJECT_DIR}/auto_test_script/packages:${CI_PROJECT_DIR}/tools/ci/python_packages:${PYTHONPATH}"
INITIAL_CONDITION_RETRY_COUNT: "1"
# auto_test_script only supports python 3.7.x
PYTHON_VER: 3.7.7
GIT_LFS_SKIP_SMUDGE: 1
script:
- *define_config_file_name
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0
# clone local test env configs
- add_gitlab_ssh_keys
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# clone test bench
# can not retry if downing git lfs files failed, so using empty_branch first.
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# Merge known issues
- cat ${KNOWN_ISSUE_FILE} >> ${TEST_CASE_FILE_PATH}/KnownIssues
# run test
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE
@ -1080,20 +1119,16 @@ nvs_compatible_test:
- *define_config_file_name
# first test if config file exists, if not exist, exit 0
- test -e $CONFIG_FILE || exit 0
# prepare test utilities
- source tools/ci/setup_python.sh
- add_gitlab_ssh_keys
- fetch_submodules
# clone local test env configs
- add_gitlab_ssh_keys
- retry_failed git clone $TEST_ENV_CONFIG_REPO
- python $CHECKOUT_REF_SCRIPT ci-test-runner-configs ci-test-runner-configs
# clone test bench
# can not retry if downing git lfs files failed, so using empty_branch first.
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} -b empty_branch
- retry_failed git -C auto_test_script checkout -f ${CI_AUTO_TEST_SCRIPT_REPO_BRANCH}
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script --customized_only
# prepare nvs bins
- retry_failed git clone ${CI_AUTO_TEST_SCRIPT_REPO_URL} auto_test_script
- python $CHECKOUT_REF_SCRIPT auto_test_script auto_test_script
- cd auto_test_script
- ./tools/ci/setup_idfci.sh
# prepare nvs bins
- ./tools/prepare_nvs_bin.sh
# run test
- python ${PREPARE_TEST_BIN_SCRIPT} $CONFIG_FILE

View File

@ -9,6 +9,7 @@
upload-pip-cache:
extends:
- .upload_cache_template
- .before_script_minimal
- .rules:patterns:python-cache
tags:
- $GEO
@ -18,13 +19,9 @@ upload-pip-cache:
paths:
- .cache/pip
policy: push
before_script: []
script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- source tools/ci/setup_python.sh
- rm -rf .cache/pip # clear old packages
- $IDF_PATH/tools/idf_tools.py install-python-env --features pytest,ci
- bash install.sh --enable-ci --enable-pytest
parallel:
matrix:
- GEO: [ 'shiny', 'brew' ]
@ -32,6 +29,7 @@ upload-pip-cache:
upload-submodules-cache:
extends:
- .upload_cache_template
- .before_script_minimal
- .rules:patterns:submodule
tags:
- $GEO
@ -41,12 +39,11 @@ upload-submodules-cache:
paths:
- .cache/submodule_archives
policy: push
before_script: []
script:
- source tools/ci/utils.sh
- is_based_on_commits $REQUIRED_ANCESTOR_COMMITS
- source tools/ci/setup_python.sh
# use the default gitlab server
- unset LOCAL_GITLAB_HTTPS_HOST
- rm -rf .cache/submodule_archives # clear old submodule archives
- add_gitlab_ssh_keys
- fetch_submodules
parallel:
matrix:

12
.gitmodules vendored
View File

@ -47,14 +47,6 @@
path = components/esp_wifi/lib
url = ../../espressif/esp32-wifi-lib.git
[submodule "components/tinyusb/tinyusb"]
path = components/tinyusb/tinyusb
url = ../../espressif/tinyusb.git
[submodule "examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib"]
path = examples/peripherals/secure_element/atecc608_ecdsa/components/esp-cryptoauthlib
url = ../../espressif/esp-cryptoauthlib.git
[submodule "components/cmock/CMock"]
path = components/cmock/CMock
url = ../../ThrowTheSwitch/CMock.git
@ -86,3 +78,7 @@
[submodule "components/bt/controller/lib_esp32c2/esp32c2-bt-lib"]
path = components/bt/controller/lib_esp32c2/esp32c2-bt-lib
url = ../../espressif/esp32c2-bt-lib.git
[submodule "components/heap/tlsf"]
path = components/heap/tlsf
url = ../../espressif/tlsf.git

View File

@ -21,7 +21,8 @@ repos:
.+test_idf_monitor\/tests\/.+|
.*_pb2.py|
.*.pb-c.h|
.*.pb-c.c
.*.pb-c.c|
.*.yuv
)$
- id: end-of-file-fixer
exclude: *whitespace_excludes
@ -30,7 +31,7 @@ repos:
args: ['-f=lf']
- id: double-quote-string-fixer
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
rev: 5.0.4
hooks:
- id: flake8
args: ['--config=.flake8', '--tee', '--benchmark']

View File

@ -82,7 +82,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
config IDF_TARGET_ESP32H2_BETA_VERSION_2
bool
prompt "ESP32-H2 beta2"
select ESPTOOLPY_NO_STUB # TODO: IDF-4288
endchoice
config IDF_TARGET_ESP32C2

View File

@ -42,7 +42,7 @@ This can also contain files provided by the architecture vendor.
Example:
- `xt_set_exception_handler`
- `riscv_global_interrupts_enable`
- `rv_utils_intr_enable`
- `ERI_PERFMON_MAX`
#### `esp_common`

View File

@ -1,30 +1,7 @@
idf_component_register(SRCS "esp_ota_ops.c"
"esp_app_desc.c"
idf_component_register(SRCS "esp_ota_ops.c" "esp_ota_app_desc.c"
INCLUDE_DIRS "include"
REQUIRES spi_flash partition_table bootloader_support
PRIV_REQUIRES esptool_py efuse)
# esp_app_desc structure is added as an undefined symbol because otherwise the
# linker will ignore this structure as it has no other files depending on it.
target_link_libraries(${COMPONENT_LIB} INTERFACE "-u esp_app_desc")
if(CONFIG_APP_PROJECT_VER_FROM_CONFIG)
# Ignore current PROJECT_VER (which was set in __project_get_revision()).
# Gets the version from the CONFIG_APP_PROJECT_VER.
idf_build_set_property(PROJECT_VER "${CONFIG_APP_PROJECT_VER}")
endif()
# cut PROJECT_VER and PROJECT_NAME to required 32 characters.
idf_build_get_property(project_ver PROJECT_VER)
idf_build_get_property(project_name PROJECT_NAME)
string(SUBSTRING "${project_ver}" 0 31 PROJECT_VER_CUT)
string(SUBSTRING "${project_name}" 0 31 PROJECT_NAME_CUT)
message(STATUS "App \"${PROJECT_NAME_CUT}\" version: ${PROJECT_VER_CUT}")
set_source_files_properties(
SOURCE "esp_app_desc.c"
PROPERTIES COMPILE_DEFINITIONS
"PROJECT_VER=\"${PROJECT_VER_CUT}\"; PROJECT_NAME=\"${PROJECT_NAME_CUT}\"")
REQUIRES partition_table bootloader_support esp_app_format esp_partition
PRIV_REQUIRES esptool_py efuse spi_flash)
if(NOT BOOTLOADER_BUILD)
partition_table_get_partition_info(otadata_offset "--partition-type data --partition-subtype ota" "offset")

View File

@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <assert.h>
#include <sys/param.h>
#include "esp_ota_ops.h"
#include "esp_attr.h"
#include "sdkconfig.h"
const esp_app_desc_t *esp_ota_get_app_description(void)
{
return esp_app_get_description();
}
int IRAM_ATTR esp_ota_get_app_elf_sha256(char* dst, size_t size)
{
return esp_app_get_elf_sha256(dst, size);
}

View File

@ -14,7 +14,6 @@
#include "esp_err.h"
#include "esp_partition.h"
#include "spi_flash_mmap.h"
#include "esp_image_format.h"
#include "esp_secure_boot.h"
#include "esp_flash_encrypt.h"
@ -84,16 +83,16 @@ static const esp_partition_t *read_otadata(esp_ota_select_entry_t *two_otadata)
return NULL;
}
spi_flash_mmap_handle_t ota_data_map;
esp_partition_mmap_handle_t ota_data_map;
const void *result = NULL;
esp_err_t err = esp_partition_mmap(otadata_partition, 0, otadata_partition->size, SPI_FLASH_MMAP_DATA, &result, &ota_data_map);
esp_err_t err = esp_partition_mmap(otadata_partition, 0, otadata_partition->size, ESP_PARTITION_MMAP_DATA, &result, &ota_data_map);
if (err != ESP_OK) {
ESP_LOGE(TAG, "mmap otadata filed. Err=0x%8x", err);
return NULL;
} else {
memcpy(&two_otadata[0], result, sizeof(esp_ota_select_entry_t));
memcpy(&two_otadata[1], result + SPI_FLASH_SEC_SIZE, sizeof(esp_ota_select_entry_t));
spi_flash_munmap(ota_data_map);
esp_partition_munmap(ota_data_map);
}
return otadata_partition;
}
@ -651,8 +650,14 @@ esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, es
#ifdef CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
static esp_err_t esp_ota_set_anti_rollback(void) {
const esp_app_desc_t *app_desc = esp_ota_get_app_description();
return esp_efuse_update_secure_version(app_desc->secure_version);
const esp_partition_t* partition = esp_ota_get_running_partition();
esp_app_desc_t app_desc = {0};
esp_err_t err = esp_ota_get_partition_description(partition, &app_desc);
if (err == ESP_OK) {
return esp_efuse_update_secure_version(app_desc.secure_version);
}
return err;
}
#endif

View File

@ -12,7 +12,7 @@
#include <stddef.h>
#include "esp_err.h"
#include "esp_partition.h"
#include "esp_image_format.h"
#include "esp_app_desc.h"
#include "esp_flash_partitions.h"
#include "soc/soc_caps.h"
@ -44,20 +44,27 @@ typedef uint32_t esp_ota_handle_t;
/**
* @brief Return esp_app_desc structure. This structure includes app version.
*
* @note This API is present for backward compatibility reasons. Alternative function
* with the same functionality is `esp_app_get_description`
*
* Return description for running app.
* @return Pointer to esp_app_desc structure.
*/
const esp_app_desc_t *esp_ota_get_app_description(void);
const esp_app_desc_t *esp_ota_get_app_description(void) __attribute__((deprecated("Please use esp_app_get_description instead")));
/**
* @brief Fill the provided buffer with SHA256 of the ELF file, formatted as hexadecimal, null-terminated.
* If the buffer size is not sufficient to fit the entire SHA256 in hex plus a null terminator,
* the largest possible number of bytes will be written followed by a null.
*
* @note This API is present for backward compatibility reasons. Alternative function
* with the same functionality is `esp_app_get_elf_sha256`
*
* @param dst Destination buffer
* @param size Size of the buffer
* @return Number of bytes written to dst (including null terminator)
*/
int esp_ota_get_app_elf_sha256(char* dst, size_t size);
int esp_ota_get_app_elf_sha256(char* dst, size_t size) __attribute__((deprecated("Please use esp_app_get_elf_sha256 instead")));
/**
* @brief Commence an OTA update writing to the specified partition.

View File

@ -1,5 +1,5 @@
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash
)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -13,7 +13,6 @@
#include <unity.h>
#include <test_utils.h>
#include <esp_ota_ops.h>
#include "bootloader_common.h"
/* These OTA tests currently don't assume an OTA partition exists
on the device, so they're a bit limited
@ -91,6 +90,8 @@ TEST_CASE("esp_ota_get_next_update_partition logic", "[ota]")
TEST_CASE("esp_ota_get_partition_description", "[ota]")
{
extern esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc);
const esp_partition_t *running = esp_ota_get_running_partition();
TEST_ASSERT_NOT_NULL(running);
esp_app_desc_t app_desc1, app_desc2;

View File

@ -366,7 +366,7 @@ menu "Bootloader config"
# only available if both Secure Boot and Check Signature on Boot are disabled
depends on !SECURE_SIGNED_ON_BOOT
default n
select BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP
select BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP if SOC_RTC_FAST_MEM_SUPPORTED
select BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON
help
Selecting this option prevents the bootloader from ever validating the app image before

View File

@ -19,7 +19,7 @@ set(srcs
if(BOOTLOADER_BUILD)
set(include_dirs "include" "bootloader_flash/include"
"private_include")
set(priv_requires micro-ecc spi_flash efuse)
set(priv_requires micro-ecc spi_flash efuse esp_app_format)
list(APPEND srcs
"src/bootloader_init.c"
"src/bootloader_clock_loader.c"
@ -37,7 +37,7 @@ else()
set(include_dirs "include" "bootloader_flash/include")
set(priv_include_dirs "private_include")
# heap is required for `heap_memory_layout.h` header
set(priv_requires spi_flash mbedtls efuse app_update heap)
set(priv_requires spi_flash mbedtls efuse heap esp_app_format)
endif()
if(BOOTLOADER_BUILD)
@ -86,6 +86,15 @@ idf_component_register(SRCS "${srcs}"
REQUIRES "${requires}"
PRIV_REQUIRES "${priv_requires}")
if(NOT BOOTLOADER_BUILD)
if(CONFIG_SECURE_SIGNED_ON_UPDATE)
if(CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME OR CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME OR
CONFIG_SECURE_SIGNED_APPS_ECDSA_V2_SCHEME)
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::app_update)
endif()
endif()
endif()
if(CONFIG_SECURE_SIGNED_APPS AND (CONFIG_SECURE_BOOT_V1_ENABLED OR CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME))
if(BOOTLOADER_BUILD)
# Whether CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES or not, we need verification key to embed

View File

@ -7,7 +7,6 @@
#pragma once
#include "esp_flash_partitions.h"
#include "esp_image_format.h"
#include "esp_app_format.h"
#ifdef __cplusplus
extern "C" {
@ -151,20 +150,6 @@ int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata);
*/
int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata, bool *valid_two_otadata, bool max);
/**
* @brief Returns esp_app_desc structure for app partition. This structure includes app version.
*
* Returns a description for the requested app partition.
* @param[in] partition App partition description.
* @param[out] app_desc Structure of info about app.
* @return
* - ESP_OK: Successful.
* - ESP_ERR_INVALID_ARG: The arguments passed are not valid.
* - ESP_ERR_NOT_FOUND: app_desc structure is not found. Magic word is incorrect.
* - ESP_FAIL: mapping is fail.
*/
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc);
/**
* @brief Get chip package
*

View File

@ -106,25 +106,3 @@ typedef struct {
} esp_image_segment_header_t;
#define ESP_IMAGE_MAX_SEGMENTS 16 /*!< Max count of segments in the image. */
#define ESP_APP_DESC_MAGIC_WORD 0xABCD5432 /*!< The magic word for the esp_app_desc structure that is in DROM. */
/**
* @brief Description about application.
*/
typedef struct {
uint32_t magic_word; /*!< Magic word ESP_APP_DESC_MAGIC_WORD */
uint32_t secure_version; /*!< Secure version */
uint32_t reserv1[2]; /*!< reserv1 */
char version[32]; /*!< Application version */
char project_name[32]; /*!< Project name */
char time[16]; /*!< Compile time */
char date[16]; /*!< Compile date*/
char idf_ver[32]; /*!< Version IDF */
uint8_t app_elf_sha256[32]; /*!< sha256 of elf file */
uint32_t reserv2[20]; /*!< reserv2 */
} esp_app_desc_t;
/** @cond */
_Static_assert(sizeof(esp_app_desc_t) == 256, "esp_app_desc_t should be 256 bytes");
/** @endcond */

View File

@ -42,13 +42,6 @@ __attribute__((weak)) void bootloader_clock_configure(void)
if (esp_rom_get_reset_reason(0) != RESET_REASON_CPU0_SW || rtc_clk_apb_freq_get() < APB_CLK_FREQ) {
rtc_clk_config_t clk_cfg = RTC_CLK_CONFIG_DEFAULT();
#if CONFIG_IDF_TARGET_ESP32
clk_cfg.xtal_freq = CONFIG_ESP32_XTAL_FREQ;
#endif
#if CONFIG_IDF_TARGET_ESP32C2
clk_cfg.xtal_freq = CONFIG_ESP32C2_XTAL_FREQ;
#endif
/* For other chips, there is no XTAL_FREQ choice */
clk_cfg.cpu_freq_mhz = cpu_freq_mhz;
clk_cfg.slow_clk_src = rtc_clk_slow_src_get();
if (clk_cfg.slow_clk_src == SOC_RTC_SLOW_CLK_SRC_INVALID) {

View File

@ -112,30 +112,6 @@ int bootloader_common_select_otadata(const esp_ota_select_entry_t *two_otadata,
return active_otadata;
}
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc)
{
if (partition == NULL || app_desc == NULL || partition->offset == 0) {
return ESP_ERR_INVALID_ARG;
}
const uint32_t app_desc_offset = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t);
const uint32_t mmap_size = app_desc_offset + sizeof(esp_app_desc_t);
const uint8_t *image = bootloader_mmap(partition->offset, mmap_size);
if (image == NULL) {
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", partition->offset, mmap_size);
return ESP_FAIL;
}
memcpy(app_desc, image + app_desc_offset, sizeof(esp_app_desc_t));
bootloader_munmap(image);
if (app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
return ESP_ERR_NOT_FOUND;
}
return ESP_OK;
}
#if defined( CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP ) || defined( CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC )
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
@ -162,7 +138,7 @@ static void update_rtc_retain_mem_crc(void)
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc));
}
void bootloader_common_reset_rtc_retain_mem(void)
NOINLINE_ATTR void bootloader_common_reset_rtc_retain_mem(void)
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"

View File

@ -12,7 +12,11 @@
void __assert_func(const char *file, int line, const char *func, const char *expr)
{
#if !CONFIG_OPTIMIZATION_ASSERTIONS_SILENT
esp_rom_printf("Assert failed in %s, %s:%d (%s)\r\n", func, file, line, expr);
#endif
while (1) {
}
}

View File

@ -60,6 +60,7 @@
#include "esp_cpu.h"
#include "esp_image_format.h"
#include "esp_app_desc.h"
#include "esp_secure_boot.h"
#include "esp_flash_encrypt.h"
#include "esp_flash_partitions.h"
@ -119,6 +120,31 @@ static esp_err_t read_otadata(const esp_partition_pos_t *ota_info, esp_ota_selec
return ESP_OK;
}
esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc)
{
if (partition == NULL || app_desc == NULL || partition->offset == 0) {
return ESP_ERR_INVALID_ARG;
}
const uint32_t app_desc_offset = sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t);
const uint32_t mmap_size = app_desc_offset + sizeof(esp_app_desc_t);
const uint8_t *image = bootloader_mmap(partition->offset, mmap_size);
if (image == NULL) {
ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed", partition->offset, mmap_size);
return ESP_FAIL;
}
memcpy(app_desc, image + app_desc_offset, sizeof(esp_app_desc_t));
bootloader_munmap(image);
if (app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
return ESP_ERR_NOT_FOUND;
}
return ESP_OK;
}
bool bootloader_utility_load_partition_table(bootloader_state_t *bs)
{
const esp_partition_info_t *partitions;

View File

@ -36,6 +36,8 @@
#include "esp32c2/rom/secure_boot.h"
#endif
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
/* Checking signatures as part of verifying images is necessary:
- Always if secure boot is enabled
- Differently in bootloader and/or app, depending on kconfig
@ -107,7 +109,7 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
while(0)
static esp_err_t process_image_header(esp_image_metadata_t *data, uint32_t part_offset, bootloader_sha256_handle_t *sha_handle, bool do_verify, bool silent);
static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part_len, bool do_verify, bool silent);
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent);
static esp_err_t process_checksum(bootloader_sha256_handle_t sha_handle, uint32_t checksum_word, esp_image_metadata_t *data, bool silent, bool skip_check_checksum);
static esp_err_t __attribute__((unused)) verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data, uint8_t *image_digest, uint8_t *verified_digest);
@ -159,7 +161,7 @@ static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_
CHECK_ERR(process_segments(data, silent, do_load, sha_handle, checksum));
bool skip_check_checksum = !do_verify || esp_cpu_dbgr_is_attached();
CHECK_ERR(process_checksum(sha_handle, checksum_word, data, silent, skip_check_checksum));
CHECK_ERR(process_appended_hash(data, part->size, do_verify, silent));
CHECK_ERR(process_appended_hash_and_sig(data, part->offset, part->size, do_verify, silent));
if (verify_sha) {
#if (SECURE_BOOT_CHECK_SIGNATURE == 1)
// secure boot images have a signature appended
@ -299,7 +301,7 @@ esp_err_t esp_image_get_metadata(const esp_partition_pos_t *part, esp_image_meta
CHECK_ERR(process_segments(metadata, silent, do_load, NULL, NULL));
bool skip_check_checksum = true;
CHECK_ERR(process_checksum(NULL, 0, metadata, silent, skip_check_checksum));
CHECK_ERR(process_appended_hash(metadata, part->size, true, silent));
CHECK_ERR(process_appended_hash_and_sig(metadata, part->offset, part->size, true, silent));
return ESP_OK;
err:
return err;
@ -762,7 +764,7 @@ esp_err_t esp_image_verify_bootloader_data(esp_image_metadata_t *data)
data);
}
static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part_len, bool do_verify, bool silent)
static esp_err_t process_appended_hash_and_sig(esp_image_metadata_t *data, uint32_t part_offset, uint32_t part_len, bool do_verify, bool silent)
{
esp_err_t err = ESP_OK;
if (data->image.hash_appended) {
@ -773,8 +775,34 @@ static esp_err_t process_appended_hash(esp_image_metadata_t *data, uint32_t part
data->image_len += HASH_LEN;
}
if (data->image_len > part_len) {
FAIL_LOAD("Image length %d doesn't fit in partition length %d", data->image_len, part_len);
uint32_t sig_block_len = 0;
const uint32_t end = data->image_len;
#if CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
// Case I: Bootloader part
if (part_offset == ESP_BOOTLOADER_OFFSET) {
// For bootloader with secure boot v1, signature stays in an independant flash
// sector (offset 0x0) and does not get appended to the image.
#if CONFIG_SECURE_BOOT_V2_ENABLED
// Sanity check - secure boot v2 signature block starts on 4K boundary
sig_block_len = ALIGN_UP(end, FLASH_SECTOR_SIZE) - end;
sig_block_len += sizeof(ets_secure_boot_signature_t);
#endif
} else {
// Case II: Application part
#if CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
sig_block_len = sizeof(esp_secure_boot_sig_block_t);
#else
// Sanity check - secure boot v2 signature block starts on 4K boundary
sig_block_len = ALIGN_UP(end, FLASH_SECTOR_SIZE) - end;
sig_block_len += sizeof(ets_secure_boot_signature_t);
#endif
}
#endif // CONFIG_SECURE_BOOT || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
const uint32_t full_image_len = end + sig_block_len;
if (full_image_len > part_len) {
FAIL_LOAD("Image length %d doesn't fit in partition length %d", full_image_len, part_len);
}
return err;
err:
@ -835,7 +863,7 @@ static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_han
#if CONFIG_SECURE_BOOT_V2_ENABLED
// 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 = (end + FLASH_SECTOR_SIZE - 1) & ~(FLASH_SECTOR_SIZE-1);
uint32_t padded_end = ALIGN_UP(end, FLASH_SECTOR_SIZE);
if (padded_end > end) {
const void *padding = bootloader_mmap(end, padded_end - end);
bootloader_sha256_data(sha_handle, padding, padded_end - end);

View File

@ -218,16 +218,7 @@ static void btc_thread_handler(void *arg)
static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
{
btc_msg_t *lmsg;
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
if (lmsg == NULL) {
return BT_STATUS_NOMEM;
}
memcpy(lmsg, msg, sizeof(btc_msg_t));
if (osi_thread_post(btc_thread, btc_thread_handler, lmsg, 0, timeout) == false) {
if (osi_thread_post(btc_thread, btc_thread_handler, msg, 0, timeout) == false) {
return BT_STATUS_BUSY;
}
@ -245,30 +236,37 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
*/
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)
{
btc_msg_t lmsg;
btc_msg_t* lmsg;
if (msg == NULL) {
// arg XOR arg_len
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
return BT_STATUS_PARM_INVALID;
}
BTC_TRACE_DEBUG("%s msg %u %u %u %p\n", __func__, msg->sig, msg->pid, msg->act, arg);
memcpy(&lmsg, msg, sizeof(btc_msg_t));
if (arg) {
lmsg.arg = (void *)osi_malloc(arg_len);
if (lmsg.arg == NULL) {
return BT_STATUS_NOMEM;
}
memset(lmsg.arg, 0x00, arg_len); //important, avoid arg which have no length
memcpy(lmsg.arg, arg, arg_len);
if (copy_func) {
copy_func(&lmsg, lmsg.arg, arg);
}
} else {
lmsg.arg = NULL;
lmsg = (btc_msg_t *)osi_malloc(sizeof(btc_msg_t));
if (lmsg == NULL) {
return BT_STATUS_NOMEM;
}
return btc_task_post(&lmsg, OSI_THREAD_MAX_TIMEOUT);
memcpy(lmsg, msg, sizeof(btc_msg_t));
if (arg) {
lmsg->arg = (void *)osi_malloc(arg_len);
if (lmsg->arg == NULL) {
osi_free(lmsg);
return BT_STATUS_NOMEM;
}
memset(lmsg->arg, 0x00, arg_len); //important, avoid arg which have no length
memcpy(lmsg->arg, arg, arg_len);
if (copy_func) {
copy_func(lmsg, lmsg->arg, arg);
}
} else {
lmsg->arg = NULL;
}
return btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
}

View File

@ -61,6 +61,13 @@
#define EXT_FUNC_VERSION 0x20220125
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
#ifdef CONFIG_BT_BLUEDROID_ENABLED
/* ACL_DATA_MBUF_LEADINGSPCAE: The leadingspace in user info header for ACL data */
#define ACL_DATA_MBUF_LEADINGSPCAE 4
#endif
/* Types definition
************************************************************************
*/
@ -125,6 +132,8 @@ extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
/* Local Function Declaration
*********************************************************************
@ -163,6 +172,8 @@ static DRAM_ATTR bool s_btdm_allow_light_sleep;
// pm_lock to prevent light sleep when using main crystal as Bluetooth low power clock
static DRAM_ATTR esp_pm_lock_handle_t s_light_sleep_pm_lock;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#else
static bool s_bt_phy_enabled = false;
#endif /* #ifdef CONFIG_PM_ENABLE */
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
@ -175,6 +186,7 @@ static void btdm_slp_tmr_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_btdm_slp_tmr = NULL;
#endif
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
._magic = OSI_COEX_MAGIC_VALUE,
._version = OSI_COEX_VERSION,
@ -215,7 +227,7 @@ static void IRAM_ATTR esp_reset_rpa_moudle(void)
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2)
{
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
BT_ASSERT_PRINT("BLE assert: line %d in function %s, param: 0x%x, 0x%x", ln, fn, param1, param2);
assert(0);
}
@ -238,6 +250,7 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status)
#endif
}
#ifdef CONFIG_BT_BLUEDROID_ENABLED
bool esp_vhci_host_check_send_available(void)
{
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_ENABLED) {
@ -295,11 +308,9 @@ void esp_vhci_host_send_packet(uint8_t *data, uint16_t len)
}
if (*(data) == DATA_TYPE_ACL) {
struct os_mbuf *om = os_msys_get_pkthdr(0, 0);
struct os_mbuf *om = os_msys_get_pkthdr(len, ACL_DATA_MBUF_LEADINGSPCAE);
assert(om);
memcpy(om->om_data, &data[1], len - 1);
om->om_len = len - 1;
OS_MBUF_PKTHDR(om)->omp_len = len - 1;
os_mbuf_append(om, &data[1], len - 1);
ble_hci_trans_hs_acl_tx(om);
}
@ -421,7 +432,8 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
esp_pm_lock_release(s_pm_lock);
s_pm_lock_acquired = false;
}
#else
s_bt_phy_enabled = false;
#endif // CONFIG_PM_ENABLE
}
@ -435,6 +447,8 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
s_pm_lock_acquired = true;
esp_pm_lock_acquire(s_pm_lock);
}
#else
s_bt_phy_enabled = true;
#endif //CONFIG_PM_ENABLE
}
@ -458,6 +472,8 @@ void controller_sleep_init(void)
#ifdef CONFIG_PM_ENABLE
s_btdm_allow_light_sleep = false;
#else
s_bt_phy_enabled = true;
#endif // CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
@ -540,8 +556,21 @@ void controller_sleep_deinit(void)
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
#endif
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
/*lock should release first and then delete*/
if (s_pm_lock_acquired) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_release(s_light_sleep_pm_lock);
}
if (s_pm_lock != NULL) {
esp_pm_lock_release(s_pm_lock);
}
}
if (!s_btdm_allow_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
@ -559,7 +588,15 @@ void controller_sleep_deinit(void)
s_btdm_slp_tmr = NULL;
}
#endif
s_pm_lock_acquired = false;
if (s_pm_lock_acquired) {
esp_phy_disable();
s_pm_lock_acquired = false;
}
#else
if (s_bt_phy_enabled) {
esp_phy_disable();
s_bt_phy_enabled = false;
}
#endif
}
@ -576,13 +613,13 @@ void ble_rtc_clk_init(void)
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_8M_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_RTC_SLOW_S);
#ifdef CONFIG_ESP32C2_XTAL_FREQ_26
#ifdef CONFIG_XTAL_FREQ_26
// LP_TIMER_CLK_DIV_NUM -> 130
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 129, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
#else
// LP_TIMER_CLK_DIV_NUM -> 250
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 249, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
#endif // CONFIG_ESP32C2_XTAL_FREQ_26
#endif // CONFIG_XTAL_FREQ_26
// MODEM_CLKRST_ETM_CLK_ACTIVE -> 1
// MODEM_CLKRST_ETM_CLK_SEL -> 0
@ -708,7 +745,6 @@ esp_err_t esp_bt_controller_deinit(void)
npl_freertos_mempool_deinit();
esp_phy_disable();
esp_phy_pd_mem_deinit();
ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
@ -770,16 +806,120 @@ esp_bt_controller_status_t esp_bt_controller_get_status(void)
/* extra functions */
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level)
{
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
return ESP_OK;
esp_err_t stat = ESP_FAIL;
switch (power_type) {
case ESP_BLE_PWR_TYPE_DEFAULT:
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
case ESP_BLE_PWR_TYPE_CONN_HDL2:
case ESP_BLE_PWR_TYPE_CONN_HDL3:
case ESP_BLE_PWR_TYPE_CONN_HDL4:
case ESP_BLE_PWR_TYPE_CONN_HDL5:
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type, power_level) == 0) {
stat = ESP_OK;
}
break;
default:
stat = ESP_ERR_NOT_SUPPORTED;
break;
}
return stat;
}
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle, esp_power_level_t power_level)
{
esp_err_t stat = ESP_FAIL;
switch (power_type) {
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
if (ble_txpwr_set(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
stat = ESP_OK;
}
break;
default:
stat = ESP_ERR_NOT_SUPPORTED;
break;
}
return stat;
}
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
{
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
return ESP_PWR_LVL_N0;
int tx_level = 0;
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
case ESP_BLE_PWR_TYPE_DEFAULT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
case ESP_BLE_PWR_TYPE_CONN_HDL2:
case ESP_BLE_PWR_TYPE_CONN_HDL3:
case ESP_BLE_PWR_TYPE_CONN_HDL4:
case ESP_BLE_PWR_TYPE_CONN_HDL5:
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_CONN, power_type);
break;
default:
return ESP_PWR_LVL_INVALID;
}
if (tx_level < 0) {
return ESP_PWR_LVL_INVALID;
}
return (esp_power_level_t)tx_level;
}
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle)
{
int tx_level = 0;
switch (power_type) {
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
tx_level = ble_txpwr_get(ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT, 0);
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
tx_level = ble_txpwr_get(power_type, handle);
break;
default:
return ESP_PWR_LVL_INVALID;
}
if (tx_level < 0) {
return ESP_PWR_LVL_INVALID;
}
return (esp_power_level_t)tx_level;
}
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED == true)
#define BLE_SM_KEY_ERR 0x17

View File

@ -138,8 +138,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
help
Specify default Tx power level
config BT_CTRL_DFT_TX_POWER_LEVEL_N27
bool "-27dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N24
bool "-24dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N21
@ -170,26 +168,28 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
bool "+21dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
int
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 0
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
@ -351,9 +351,9 @@ menu "MODEM SLEEP Options"
bool "Main crystal"
help
Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
cannot work when light sleep is enabled. Main crystal has a relatively better performance than
other bluetooth low power clock sources.
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, and
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
than other bluetooth low power clock sources.
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
bool "External 32kHz crystal"
depends on RTC_CLK_SRC_EXT_CRYS
@ -368,9 +368,18 @@ menu "MODEM SLEEP Options"
help
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
endchoice
config BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
bool "power up main XTAL during light sleep"
depends on (BT_CTRL_LPCLK_SEL_MAIN_XTAL || BT_CTRL_LPCLK_SEL_EXT_32K_XTAL) && FREERTOS_USE_TICKLESS_IDLE
default n
help
If this option is selected, the main crystal will power up during light sleep when the low power clock
selects an external 32kHz crystal but the external 32kHz crystal does not exist or the low power clock
selects the main crystal.
endmenu
config BT_CTRL_SLEEP_MODE_EFF

View File

@ -72,7 +72,8 @@ typedef union {
uint32_t mac_bb_pd : 1; // whether hardware(MAC, BB) force-power-down is required during sleep
uint32_t wakeup_timer_required : 1; // whether system timer is needed
uint32_t no_light_sleep : 1; // do not allow system to enter light sleep after bluetooth is enabled
uint32_t reserved : 26; // reserved
uint32_t main_xtal_pu : 1; // power up main XTAL
uint32_t reserved : 25; // reserved
};
uint32_t val;
} btdm_lpcntl_t;
@ -1003,12 +1004,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// set default values for global states or resources
s_lp_stat.val = 0;
s_lp_cntl.val = 0;
s_lp_cntl.main_xtal_pu = 0;
s_wakeup_req_sem = NULL;
s_btdm_slp_tmr = NULL;
// configure and initialize resources
s_lp_cntl.enable = (cfg->sleep_mode == ESP_BT_SLEEP_MODE_1) ? 1 : 0;
s_lp_cntl.no_light_sleep = 1;
s_lp_cntl.no_light_sleep = 0;
if (s_lp_cntl.enable) {
#if CONFIG_MAC_BB_PD
@ -1051,33 +1053,41 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// check whether or not EXT_CRYS is working
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_XTAL32K; // External 32 kHz XTAL
s_lp_cntl.no_light_sleep = 0;
} else {
ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n"
"light sleep mode will not be able to apply when bluetooth is enabled");
ESP_LOGW(BTDM_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
}
#elif CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW
// check whether or not EXT_CRYS is working
#elif (CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL)
ESP_LOGI(BTDM_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW)
// check whether or not internal 150 kHz RC oscillator is working
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
} else {
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
assert(0);
}
#else
s_lp_cntl.no_light_sleep = 1;
#endif
bool select_src_ret __attribute__((unused));
bool set_div_ret __attribute__((unused));
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
s_lp_cntl.main_xtal_pu = 1;
#endif
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() * 2 / MHZ);
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() / MHZ);
assert(select_src_ret && set_div_ret);
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
} else if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL32K) {
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
set_div_ret = btdm_lpclk_set_div(0);
@ -1096,6 +1106,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_INVALID_ARG;
goto error;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
@ -1103,6 +1116,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_NO_MEM;
goto error;
}
ESP_LOGW(BTDM_LOG_TAG, "Light sleep mode will not be able to apply when bluetooth is enabled.");
}
if ((err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock)) != ESP_OK) {
err = ESP_ERR_NO_MEM;
@ -1173,6 +1187,22 @@ error:
s_wakeup_req_sem = NULL;
}
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1235,6 +1265,21 @@ esp_err_t esp_bt_controller_deinit(void)
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1257,7 +1302,6 @@ esp_err_t esp_bt_controller_deinit(void)
osi_funcs_p = NULL;
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
btdm_lpcycle_us = 0;
return ESP_OK;
}

View File

@ -153,8 +153,6 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
help
Specify default Tx power level
config BT_CTRL_DFT_TX_POWER_LEVEL_N27
bool "-27dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N24
bool "-24dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_N21
@ -185,27 +183,29 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+21dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
int
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N27
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 0 if BT_CTRL_DFT_TX_POWER_LEVEL_N24
default 1 if BT_CTRL_DFT_TX_POWER_LEVEL_N21
default 2 if BT_CTRL_DFT_TX_POWER_LEVEL_N18
default 3 if BT_CTRL_DFT_TX_POWER_LEVEL_N15
default 4 if BT_CTRL_DFT_TX_POWER_LEVEL_N12
default 5 if BT_CTRL_DFT_TX_POWER_LEVEL_N9
default 6 if BT_CTRL_DFT_TX_POWER_LEVEL_N6
default 7 if BT_CTRL_DFT_TX_POWER_LEVEL_N3
default 8 if BT_CTRL_DFT_TX_POWER_LEVEL_N0
default 9 if BT_CTRL_DFT_TX_POWER_LEVEL_P3
default 10 if BT_CTRL_DFT_TX_POWER_LEVEL_P6
default 11 if BT_CTRL_DFT_TX_POWER_LEVEL_P9
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 0
@ -368,9 +368,9 @@ menu "MODEM SLEEP Options"
bool "Main crystal"
help
Main crystal can be used as low power clock for bluetooth modem sleep. If this option is
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, but
cannot work when light sleep is enabled. Main crystal has a relatively better performance than
other bluetooth low power clock sources.
selected, bluetooth modem sleep can work under Dynamic Frequency Scaling(DFS) enabled, and
bluetooth can work under light sleep enabled. Main crystal has a relatively better performance
than other bluetooth low power clock sources.
config BT_CTRL_LPCLK_SEL_EXT_32K_XTAL
bool "External 32kHz crystal"
depends on RTC_CLK_SRC_EXT_CRYS
@ -385,9 +385,17 @@ menu "MODEM SLEEP Options"
help
Internal 150kHz RC oscillator. The accuracy of this clock is a lot larger than 500ppm which is required
in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.
endchoice
config BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
bool "power up main XTAL during light sleep"
depends on (BT_CTRL_LPCLK_SEL_MAIN_XTAL || BT_CTRL_LPCLK_SEL_EXT_32K_XTAL) && FREERTOS_USE_TICKLESS_IDLE
default n
help
If this option is selected, the main crystal will power up during light sleep when the low power clock
selects an external 32kHz crystal but the external 32kHz crystal does not exist or the low power clock
selects the main crystal.
endmenu
config BT_CTRL_SLEEP_MODE_EFF

View File

@ -72,7 +72,8 @@ typedef union {
uint32_t mac_bb_pd : 1; // whether hardware(MAC, BB) force-power-down is required during sleep
uint32_t wakeup_timer_required : 1; // whether system timer is needed
uint32_t no_light_sleep : 1; // do not allow system to enter light sleep after bluetooth is enabled
uint32_t reserved : 26; // reserved
uint32_t main_xtal_pu : 1; // power up main XTAL
uint32_t reserved : 25; // reserved
};
uint32_t val;
} btdm_lpcntl_t;
@ -1035,12 +1036,13 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// set default values for global states or resources
s_lp_stat.val = 0;
s_lp_cntl.val = 0;
s_lp_cntl.main_xtal_pu = 0;
s_wakeup_req_sem = NULL;
s_btdm_slp_tmr = NULL;
// configure and initialize resources
s_lp_cntl.enable = (cfg->sleep_mode == ESP_BT_SLEEP_MODE_1) ? 1 : 0;
s_lp_cntl.no_light_sleep = 1;
s_lp_cntl.no_light_sleep = 0;
if (s_lp_cntl.enable) {
#if CONFIG_MAC_BB_PD
@ -1083,33 +1085,41 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// check whether or not EXT_CRYS is working
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_XTAL32K; // External 32 kHz XTAL
s_lp_cntl.no_light_sleep = 0;
} else {
ESP_LOGW(BT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock\n"
"light sleep mode will not be able to apply when bluetooth is enabled");
ESP_LOGW(BT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
}
#elif CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW
// check whether or not EXT_CRYS is working
#elif (CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL)
ESP_LOGI(BT_LOG_TAG, "Bluetooth will use main XTAL as Bluetooth sleep clock.");
#if !CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
s_lp_cntl.no_light_sleep = 1;
#endif
#elif (CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW)
// check whether or not internal 150 kHz RC oscillator is working
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_RC_SLOW) {
s_lp_cntl.lpclk_sel = BTDM_LPCLK_SEL_RTC_SLOW; // Internal 150 kHz RC oscillator
ESP_LOGW(BTDM_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC osciallator. The accuracy of this clock is a lot larger than 500ppm which is "
"required in Bluetooth communication, so don't select this option in scenarios such as BLE connection state.");
} else {
ESP_LOGW(BT_LOG_TAG, "Internal 150kHz RC oscillator not detected.");
assert(0);
}
#else
s_lp_cntl.no_light_sleep = 1;
#endif
bool select_src_ret __attribute__((unused));
bool set_div_ret __attribute__((unused));
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON));
s_lp_cntl.main_xtal_pu = 1;
#endif
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL);
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() * 2 / MHZ);
set_div_ret = btdm_lpclk_set_div(esp_clk_xtal_freq() / MHZ);
assert(select_src_ret && set_div_ret);
btdm_lpcycle_us_frac = RTC_CLK_CAL_FRACT;
btdm_lpcycle_us = 2 << (btdm_lpcycle_us_frac);
btdm_lpcycle_us = 1 << (btdm_lpcycle_us_frac);
} else if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL32K) {
select_src_ret = btdm_lpclk_select_src(BTDM_LPCLK_SEL_XTAL32K);
set_div_ret = btdm_lpclk_set_div(0);
@ -1128,6 +1138,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_INVALID_ARG;
goto error;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
@ -1135,6 +1148,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
err = ESP_ERR_NO_MEM;
goto error;
}
ESP_LOGW(BT_LOG_TAG, "light sleep mode will not be able to apply when bluetooth is enabled.");
}
if ((err = esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock)) != ESP_OK) {
err = ESP_ERR_NO_MEM;
@ -1205,6 +1219,22 @@ error:
s_wakeup_req_sem = NULL;
}
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1267,6 +1297,22 @@ esp_err_t esp_bt_controller_deinit(void)
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
if (s_lp_cntl.lpclk_sel == BTDM_LPCLK_SEL_XTAL) {
#ifdef CONFIG_BT_CTRL_MAIN_XTAL_PU_DURING_LIGHT_SLEEP
if (s_lp_cntl.main_xtal_pu) {
ESP_ERROR_CHECK(esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_OFF));
s_lp_cntl.main_xtal_pu = 0;
}
#endif
btdm_lpclk_select_src(BTDM_LPCLK_SEL_RTC_SLOW);
btdm_lpclk_set_div(0);
#if CONFIG_SW_COEXIST_ENABLE
coex_update_lpclk_interval();
#endif
}
btdm_lpcycle_us = 0;
} while (0);
#if CONFIG_MAC_BB_PD
@ -1284,7 +1330,6 @@ esp_err_t esp_bt_controller_deinit(void)
osi_funcs_p = NULL;
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
btdm_lpcycle_us = 0;
return ESP_OK;
}

View File

@ -803,6 +803,13 @@ if BLE_MESH
help
Maximum number of groups to which the LPN can subscribe.
config BLE_MESH_LPN_SUB_ALL_NODES_ADDR
bool "Automatically subscribe all nodes address"
default n
help
Automatically subscribe all nodes address when friendship
established.
endif # BLE_MESH_LOW_POWER
config BLE_MESH_FRIEND

View File

@ -82,7 +82,7 @@ static void btc_ble_mesh_ble_callback(esp_ble_mesh_ble_cb_param_t *cb_params, ui
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_ble_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_ble_cb_param_t),
btc_ble_mesh_ble_copy_req_data);
}

View File

@ -298,7 +298,7 @@ static void btc_ble_mesh_config_client_callback(esp_ble_mesh_cfg_client_cb_param
msg.pid = BTC_PID_CONFIG_CLIENT;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_cfg_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_client_cb_param_t),
btc_ble_mesh_config_client_copy_req_data);
}
@ -702,7 +702,7 @@ static void btc_ble_mesh_config_server_callback(esp_ble_mesh_cfg_server_cb_param
msg.pid = BTC_PID_CONFIG_SERVER;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_cfg_server_cb_param_t), NULL);
}
void bt_mesh_config_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,

View File

@ -368,7 +368,7 @@ static void btc_ble_mesh_generic_client_callback(esp_ble_mesh_generic_client_cb_
msg.pid = BTC_PID_GENERIC_CLIENT;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_generic_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_client_cb_param_t),
btc_ble_mesh_generic_client_copy_req_data);
}
@ -685,7 +685,7 @@ static void btc_ble_mesh_generic_server_callback(esp_ble_mesh_generic_server_cb_
msg.pid = BTC_PID_GENERIC_SERVER;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_generic_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_generic_server_cb_param_t),
btc_ble_mesh_generic_server_copy_req_data);
}

View File

@ -231,7 +231,7 @@ static void btc_ble_mesh_health_client_callback(esp_ble_mesh_health_client_cb_pa
msg.pid = BTC_PID_HEALTH_CLIENT;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_health_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_client_cb_param_t),
btc_ble_mesh_health_client_copy_req_data);
}
@ -542,7 +542,7 @@ static void btc_ble_mesh_health_server_callback(esp_ble_mesh_health_server_cb_pa
msg.pid = BTC_PID_HEALTH_SERVER;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_health_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_health_server_cb_param_t),
btc_ble_mesh_health_server_copy_req_data);
}

View File

@ -212,7 +212,7 @@ static void btc_ble_mesh_lighting_client_callback(esp_ble_mesh_light_client_cb_p
msg.pid = BTC_PID_LIGHTING_CLIENT;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_light_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_light_client_cb_param_t),
btc_ble_mesh_lighting_client_copy_req_data);
}
@ -497,7 +497,7 @@ static void btc_ble_mesh_lighting_server_callback(esp_ble_mesh_lighting_server_c
msg.pid = BTC_PID_LIGHTING_SERVER;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_lighting_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_lighting_server_cb_param_t),
btc_ble_mesh_lighting_server_copy_req_data);
}

View File

@ -368,7 +368,7 @@ static bt_status_t btc_ble_mesh_model_callback(esp_ble_mesh_model_cb_param_t *pa
msg.pid = BTC_PID_MODEL;
msg.act = act;
ret = btc_transfer_context(&msg, param, sizeof(esp_ble_mesh_model_cb_param_t),
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_model_cb_param_t),
btc_ble_mesh_model_copy_req_data);
if (ret != BT_STATUS_SUCCESS) {
BT_ERR("btc_transfer_context failed");
@ -528,7 +528,7 @@ static bt_status_t btc_ble_mesh_prov_callback(esp_ble_mesh_prov_cb_param_t *para
msg.pid = BTC_PID_PROV;
msg.act = act;
ret = btc_transfer_context(&msg, param, sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
ret = btc_transfer_context(&msg, param, param == NULL ? 0 : sizeof(esp_ble_mesh_prov_cb_param_t), NULL);
if (ret != BT_STATUS_SUCCESS) {
BT_ERR("btc_transfer_context failed");
}

View File

@ -450,7 +450,7 @@ static void btc_ble_mesh_sensor_client_callback(esp_ble_mesh_sensor_client_cb_pa
msg.pid = BTC_PID_SENSOR_CLIENT;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_sensor_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_client_cb_param_t),
btc_ble_mesh_sensor_client_copy_req_data);
}
@ -817,7 +817,7 @@ static void btc_ble_mesh_sensor_server_callback(esp_ble_mesh_sensor_server_cb_pa
msg.pid = BTC_PID_SENSOR_SERVER;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_sensor_server_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_sensor_server_cb_param_t),
btc_ble_mesh_sensor_server_copy_req_data);
}

View File

@ -214,7 +214,7 @@ static void btc_ble_mesh_time_scene_client_callback(esp_ble_mesh_time_scene_clie
msg.pid = BTC_PID_TIME_SCENE_CLIENT;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_client_cb_param_t),
btc_ble_mesh_time_scene_client_copy_req_data);
}
@ -401,7 +401,7 @@ static void btc_ble_mesh_time_scene_server_callback(esp_ble_mesh_time_scene_serv
msg.pid = BTC_PID_TIME_SCENE_SERVER;
msg.act = act;
btc_transfer_context(&msg, cb_params, sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
btc_transfer_context(&msg, cb_params, cb_params == NULL ? 0 : sizeof(esp_ble_mesh_time_scene_server_cb_param_t), NULL);
}
void bt_mesh_time_scene_server_cb_evt_to_btc(uint8_t evt_type, struct bt_mesh_model *model,

View File

@ -374,9 +374,19 @@ static void secure_beacon_recv(struct net_buf_simple *buf)
cache_add(data, sub);
/* If we have NetKey0 accept initiation only from it */
/* Spec v1.0.1, Section 3.8.4:
* If a node on a primary subnet receives an update on
* the primary subnet, it shall propagate the IV update
* to all other subnets. If a node on a primary subnet
* receives an IV update on any other subnet, the update
* shall be ignored.
* If a node on a primary subnet receives an key update
* on any other subnet, the update shall not be ignored.
*/
if (bt_mesh_primary_subnet_exist() &&
sub->net_idx != BLE_MESH_KEY_PRIMARY) {
sub->net_idx != BLE_MESH_KEY_PRIMARY &&
BLE_MESH_IV_UPDATE(flags) &&
!BLE_MESH_KEY_REFRESH(flags)) {
BT_WARN("Ignoring secure beacon on non-primary subnet");
goto update_stats;
}
@ -390,7 +400,15 @@ static void secure_beacon_recv(struct net_buf_simple *buf)
bt_mesh_beacon_ivu_initiator(false);
}
iv_change = bt_mesh_net_iv_update(iv_index, BLE_MESH_IV_UPDATE(flags));
/* If a node on a primary subnet receives an IV update on any other subnet,
* the IV update shall be ignored. And if a node on a non-primary subnet
* receives an IV update on primary subnet, the IV update shall be ignored,
* because it doesn't have a primary network key.
*/
if ((bt_mesh_primary_subnet_exist() && sub->net_idx == BLE_MESH_KEY_PRIMARY) ||
(!bt_mesh_primary_subnet_exist() && sub->net_idx != BLE_MESH_KEY_PRIMARY)) {
iv_change = bt_mesh_net_iv_update(iv_index, BLE_MESH_IV_UPDATE(flags));
}
kr_change = bt_mesh_kr_update(sub, BLE_MESH_KEY_REFRESH(flags), new_key);
if (kr_change) {

View File

@ -197,6 +197,21 @@ static bool app_key_is_valid(uint16_t app_idx)
return false;
}
static bool mod_pub_app_key_bound(struct bt_mesh_model *model,
uint16_t app_idx)
{
int i;
for (i = 0; i < ARRAY_SIZE(model->keys); i++) {
if (model->keys[i] == app_idx) {
return true;
}
}
BT_ERR("Appkey(0x%02x) not bound to this model.", app_idx);
return false;
}
static uint8_t _mod_pub_set(struct bt_mesh_model *model, uint16_t pub_addr,
uint16_t app_idx, uint8_t cred_flag, uint8_t ttl, uint8_t period,
uint8_t retransmit, bool store)
@ -237,7 +252,11 @@ static uint8_t _mod_pub_set(struct bt_mesh_model *model, uint16_t pub_addr,
return STATUS_SUCCESS;
}
if (!bt_mesh_app_key_find(app_idx)) {
/* For case MESH/NODE/CFG/MP/BI-03-C, need to check if appkey
* is bound to model identified by the ModelIdentifier.
*/
if (!bt_mesh_app_key_find(app_idx) ||
!mod_pub_app_key_bound(model, app_idx)) {
return STATUS_INVALID_APPKEY;
}
@ -3049,7 +3068,7 @@ static void heartbeat_pub_set(struct bt_mesh_model *model,
goto failed;
}
if (param->period_log > 0x10) {
if (param->period_log > 0x11) {
status = STATUS_CANNOT_SET;
goto failed;
}
@ -3202,19 +3221,18 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
}
if (sub_src == BLE_MESH_ADDR_UNASSIGNED ||
sub_dst == BLE_MESH_ADDR_UNASSIGNED ||
sub_period == 0x00) {
sub_dst == BLE_MESH_ADDR_UNASSIGNED ||
sub_period == 0x00) {
/* Only an explicit address change to unassigned should
* trigger clearing of the values according to
* MESH/NODE/CFG/HBS/BV-02-C.
*/
if (sub_src == BLE_MESH_ADDR_UNASSIGNED ||
sub_dst == BLE_MESH_ADDR_UNASSIGNED) {
sub_dst == BLE_MESH_ADDR_UNASSIGNED) {
cfg->hb_sub.src = BLE_MESH_ADDR_UNASSIGNED;
cfg->hb_sub.dst = BLE_MESH_ADDR_UNASSIGNED;
cfg->hb_sub.min_hops = BLE_MESH_TTL_MAX;
cfg->hb_sub.max_hops = 0U;
cfg->hb_sub.count = 0U;
}
period_ms = 0;
@ -3240,6 +3258,11 @@ static void heartbeat_sub_set(struct bt_mesh_model *model,
hb_sub_send_status(model, ctx, STATUS_SUCCESS);
/* For case MESH/NODE/CFG/HBS/BV-02-C, set count_log to 0
* when Heartbeat Subscription Status message is sent.
*/
cfg->hb_sub.count = 0U;
/* MESH/NODE/CFG/HBS/BV-01-C expects the MinHops to be 0x7f after
* disabling subscription, but 0x00 for subsequent Get requests.
*/

View File

@ -64,6 +64,7 @@ enum {
};
static void (*friend_cb)(bool establish, uint16_t lpn_addr, uint8_t reason);
static void enqueue_update(struct bt_mesh_friend *frnd, uint8_t md);
static bool friend_init = false;
@ -233,7 +234,23 @@ void bt_mesh_friend_sec_update(uint16_t net_idx)
}
if (net_idx == BLE_MESH_KEY_ANY || frnd->net_idx == net_idx) {
frnd->sec_update = 1U;
/* For case MESH/NODE/FRND/FN/BV-20-C.
* A situation is:
* The friend node may receive more than one different secure updates
* consecutively. And using the previous approach will cause only the
* latest Friend Update message been enqueued.
* So we update the implementation here to enqueue the Friend Update
* message immediately once a different secure beacon is received.
*
* A disadvantage of the change is:
* A friend node may receive different secure beacons. Then the
* beacon_cache mechanism will not work. This will cause the friend
* message queue been full of these secure beacons. So before enqueuing
* the secure updates, we should check if the currently received one
* is already exists in the message queue. Or enhance the beacon cache
* filtering mechanism.
*/
enqueue_update(frnd, 1);
}
}
}
@ -699,7 +716,6 @@ static void enqueue_update(struct bt_mesh_friend *frnd, uint8_t md)
return;
}
frnd->sec_update = 0U;
enqueue_buf(frnd, buf);
}
@ -1116,10 +1132,6 @@ static void enqueue_friend_pdu(struct bt_mesh_friend *frnd,
BT_DBG("type %u", type);
if (type == BLE_MESH_FRIEND_PDU_SINGLE) {
if (frnd->sec_update) {
enqueue_update(frnd, 1);
}
enqueue_buf(frnd, buf);
return;
}
@ -1136,10 +1148,6 @@ static void enqueue_friend_pdu(struct bt_mesh_friend *frnd,
net_buf_slist_put(&seg->queue, buf);
if (type == BLE_MESH_FRIEND_PDU_COMPLETE) {
if (frnd->sec_update) {
enqueue_update(frnd, 1);
}
sys_slist_merge_slist(&frnd->queue, &seg->queue);
frnd->queue_size += seg->seg_count;

View File

@ -78,6 +78,11 @@ int bt_mesh_provision(const uint8_t net_key[16], uint16_t net_idx,
memcpy(bt_mesh.dev_key, dev_key, 16);
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER) &&
IS_ENABLED(CONFIG_BLE_MESH_LPN_SUB_ALL_NODES_ADDR)) {
bt_mesh_lpn_group_add(BLE_MESH_ADDR_ALL_NODES);
}
if (IS_ENABLED(CONFIG_BLE_MESH_SETTINGS)) {
BT_DBG("Storing network information persistently");
bt_mesh_store_net();
@ -110,6 +115,12 @@ void bt_mesh_node_reset(void)
bt_mesh_tx_reset();
if (IS_ENABLED(CONFIG_BLE_MESH_LOW_POWER)) {
if (IS_ENABLED(CONFIG_BLE_MESH_LPN_SUB_ALL_NODES_ADDR)) {
uint16_t group = BLE_MESH_ADDR_ALL_NODES;
bt_mesh_lpn_group_del(&group, 1);
}
bt_mesh_lpn_disable(true);
}

View File

@ -20,7 +20,7 @@ extern "C" {
#define BLE_MESH_KEY_ANY 0xffff
#define BLE_MESH_ADDR_IS_UNICAST(addr) ((addr) && (addr) < 0x8000)
#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) <= 0xff00)
#define BLE_MESH_ADDR_IS_GROUP(addr) ((addr) >= 0xc000 && (addr) < 0xff00)
#define BLE_MESH_ADDR_IS_VIRTUAL(addr) ((addr) >= 0x8000 && (addr) < 0xc000)
#define BLE_MESH_ADDR_IS_RFU(addr) ((addr) >= 0xff00 && (addr) <= 0xfffb)

View File

@ -1220,6 +1220,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
}
if (rx->net_if == BLE_MESH_NET_IF_ADV &&
!rx->friend_cred &&
bt_mesh_relay_get() != BLE_MESH_RELAY_ENABLED &&
bt_mesh_gatt_proxy_get() != BLE_MESH_GATT_PROXY_ENABLED) {
return;
@ -1232,7 +1233,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
* Anything else (like GATT to adv, or locally originated packets)
* use the Network Transmit state.
*/
if (rx->net_if == BLE_MESH_NET_IF_ADV) {
if (rx->net_if == BLE_MESH_NET_IF_ADV && !rx->friend_cred) {
transmit = bt_mesh_relay_retransmit_get();
} else {
transmit = bt_mesh_net_transmit_get();
@ -1302,6 +1303,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
*/
if (IS_ENABLED(CONFIG_BLE_MESH_GATT_PROXY_SERVER) &&
(bt_mesh_gatt_proxy_get() == BLE_MESH_GATT_PROXY_ENABLED ||
rx->friend_cred ||
rx->net_if == BLE_MESH_NET_IF_LOCAL)) {
if (bt_mesh_proxy_server_relay(&buf->b, rx->ctx.recv_dst) &&
BLE_MESH_ADDR_IS_UNICAST(rx->ctx.recv_dst)) {
@ -1309,7 +1311,7 @@ static void bt_mesh_net_relay(struct net_buf_simple *sbuf,
}
}
if (relay_to_adv(rx->net_if)) {
if (relay_to_adv(rx->net_if) || rx->friend_cred) {
#if !defined(CONFIG_BLE_MESH_RELAY_ADV_BUF)
bt_mesh_adv_send(buf, NULL, NULL);
#else
@ -1378,8 +1380,9 @@ int bt_mesh_net_decode(struct net_buf_simple *data, enum bt_mesh_net_if net_if,
return -EBADMSG;
}
/* For case MESH/NODE/RLY/BV-01-C, even the DST is RFU, it needs to be forwarded. */
if (BLE_MESH_ADDR_IS_RFU(rx->ctx.recv_dst)) {
BT_ERR("Destination address is RFU; dropping packet");
BT_ERR("Destination address is RFU; dropping packet 0x%02x", rx->ctx.recv_dst);
return -EBADMSG;
}

View File

@ -95,7 +95,6 @@ struct bt_mesh_friend {
uint8_t fsn:1,
send_last:1,
pending_req:1,
sec_update:1,
pending_buf:1,
valid:1,
established:1;

View File

@ -1450,18 +1450,22 @@ static void prov_msg_recv(void)
return;
}
if (type != PROV_FAILED && type != link.expect) {
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
return;
}
/* For case MESH/NODE/PROV/BI-15-C, when the node receive a Provisioning PDU
* with the Type field set to the lowest unsupported or RFU value, it sends a
* Provisioning Failed PDU with the Error Code field set to Invalid PDU(0x01).
*/
if (type >= ARRAY_SIZE(prov_handlers)) {
BT_ERR("Unknown provisioning PDU type 0x%02x", type);
prov_send_fail_msg(PROV_ERR_NVAL_PDU);
return;
}
if (type != PROV_FAILED && type != link.expect) {
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
return;
}
if (1 + prov_handlers[type].len != link.rx.buf->len) {
BT_ERR("Invalid length %u for type 0x%02x",
link.rx.buf->len, type);
@ -1666,15 +1670,30 @@ int bt_mesh_pb_gatt_recv(struct bt_mesh_conn *conn, struct net_buf_simple *buf)
return -EINVAL;
}
type = net_buf_simple_pull_u8(buf);
if (type != PROV_FAILED && type != link.expect) {
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
/* For case MESH/NODE/PROV/BI-03-C, if the link is closed, when the node receive
* a Provisioning PDU , it will send a Provisioning Failed PDU with the Error Code
* field set to Unexpected PDU(0x03).
*/
if (bt_mesh_atomic_test_bit(link.flags, LINK_INVALID)) {
BT_WARN("Unexpected msg 0x%02x on invalid link", type);
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
return -EINVAL;
}
/* For case MESH/NODE/PROV/BI-15-C, when the node receive a Provisioning PDU
* with the Type field set to the lowest unsupported or RFU value, it sends a
* Provisioning Failed PDU with the Error Code field set to Invalid PDU(0x01).
*/
type = net_buf_simple_pull_u8(buf);
if (type >= ARRAY_SIZE(prov_handlers)) {
BT_ERR("Unknown provisioning PDU type 0x%02x", type);
prov_send_fail_msg(PROV_ERR_NVAL_PDU);
return -EINVAL;
}
if (type != PROV_FAILED && type != link.expect) {
BT_WARN("Unexpected msg 0x%02x != 0x%02x", type, link.expect);
prov_send_fail_msg(PROV_ERR_UNEXP_PDU);
return -EINVAL;
}

View File

@ -2943,6 +2943,12 @@ static void gen_prov_ack(const uint8_t idx, struct prov_rx *rx, struct net_buf_s
case PROV_START:
pub_key_oob = link[idx].conf_inputs[13];
send_pub_key(idx, pub_key_oob);
/* For case MESH/PVNR/PROV/BV-04-C, if using OOB public key,
* the value of expect_ack_for shall be PROV_PUB_KEY.
*/
if (pub_key_oob) {
return;
}
break;
case PROV_PUB_KEY:
prov_gen_dh_key(idx);

View File

@ -233,14 +233,11 @@ static void bt_mesh_scan_cb(const bt_mesh_addr_t *addr,
buf->len = len - 1;
#if 0
/* TODO: Check with BLE Mesh BQB test cases */
if ((type == BLE_MESH_DATA_MESH_PROV || type == BLE_MESH_DATA_MESH_MESSAGE ||
type == BLE_MESH_DATA_MESH_BEACON) && (adv_type != BLE_MESH_ADV_NONCONN_IND)) {
BT_DBG("Ignore mesh packet (type 0x%02x) with adv_type 0x%02x", type, adv_type);
return;
}
#endif
switch (type) {
case BLE_MESH_DATA_MESH_MESSAGE:

View File

@ -173,6 +173,13 @@ config BT_GATT_MAX_SR_PROFILES
help
Maximum GATT Server Profiles Count
config BT_GATT_MAX_SR_ATTRIBUTES
int "Max GATT Service Attributes"
depends on BT_GATTS_ENABLE && BT_BLUEDROID_ENABLED
range 1 500
default 100
help
Maximum GATT Service Attributes Count
choice BT_GATTS_SEND_SERVICE_CHANGE_MODE
@ -208,6 +215,14 @@ config BT_GATTC_ENABLE
help
This option can be close when the app work only on gatt server mode
config BT_GATTC_MAX_CACHE_CHAR
int "Max gattc cache characteristic for discover"
depends on BT_GATTC_ENABLE
range 1 500
default 40
help
Maximum GATTC cache characteristic count
config BT_GATTC_CACHE_NVS_FLASH
bool "Save gattc cache data to nvs flash"
depends on BT_GATTC_ENABLE
@ -1030,7 +1045,7 @@ config BT_SMP_ENABLE
config BT_BLE_ACT_SCAN_REP_ADV_SCAN
bool "Report adv data and scan response individually when BLE active scan"
depends on BT_BLUEDROID_ENABLED && (BTDM_CTRL_MODE_BTDM || BTDM_CTRL_MODE_BLE_ONLY)
depends on BT_BLUEDROID_ENABLED && BT_BLE_ENABLED
default n
help
Originally, when doing BLE active scan, Bluedroid will not report adv to application layer

View File

@ -85,7 +85,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if,
esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db,
esp_gatt_if_t gatts_if,
uint8_t max_nb_attr,
uint16_t max_nb_attr,
uint8_t srvc_inst_id)
{
btc_msg_t msg = {0};
@ -93,6 +93,11 @@ esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
if (max_nb_attr > ESP_GATT_ATTR_HANDLE_MAX) {
LOG_ERROR("The number of attribute should not be greater than CONFIG_BT_GATT_MAX_SR_ATTRIBUTES\n");
return ESP_ERR_INVALID_ARG;
}
msg.sig = BTC_SIG_API_CALL;
msg.pid = BTC_PID_GATTS;
msg.act = BTC_GATTS_ACT_CREATE_ATTR_TAB;

View File

@ -17,8 +17,8 @@
extern "C" {
#endif
/**@{
* BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag
/**
* @brief BLE_ADV_DATA_FLAG data flag bit definition used for advertising data flag
*/
#define ESP_BLE_ADV_FLAG_LIMIT_DISC (0x01 << 0)
#define ESP_BLE_ADV_FLAG_GEN_DISC (0x01 << 1)
@ -26,104 +26,102 @@ extern "C" {
#define ESP_BLE_ADV_FLAG_DMT_CONTROLLER_SPT (0x01 << 3)
#define ESP_BLE_ADV_FLAG_DMT_HOST_SPT (0x01 << 4)
#define ESP_BLE_ADV_FLAG_NON_LIMIT_DISC (0x00 )
/**
* @}
*/
/* relate to BTM_LE_KEY_xxx in stack/btm_api.h */
#define ESP_LE_KEY_NONE 0 /* relate to BTM_LE_KEY_NONE in stack/btm_api.h */
#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */ /* relate to BTM_LE_KEY_PENC in stack/btm_api.h */
#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */ /* relate to BTM_LE_KEY_PID in stack/btm_api.h */
#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */ /* relate to BTM_LE_KEY_PCSRK in stack/btm_api.h */
#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/ /* relate to BTM_LE_KEY_PLK in stack/btm_api.h */
#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /* relate to BTM_LE_KEY_LLK in stack/btm_api.h */
#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */ /* relate to BTM_LE_KEY_LENC in stack/btm_api.h */
#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */ /* relate to BTM_LE_KEY_LID in stack/btm_api.h */
#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */ /* relate to BTM_LE_KEY_LCSRK in stack/btm_api.h */
/// relate to BTM_LE_KEY_xxx in stack/btm_api.h
#define ESP_LE_KEY_NONE 0 /*!< No encryption key */
#define ESP_LE_KEY_PENC (1 << 0) /*!< encryption key, encryption information of peer device */
#define ESP_LE_KEY_PID (1 << 1) /*!< identity key of the peer device */
#define ESP_LE_KEY_PCSRK (1 << 2) /*!< peer SRK */
#define ESP_LE_KEY_PLK (1 << 3) /*!< Link key*/
#define ESP_LE_KEY_LLK (ESP_LE_KEY_PLK << 4) /*!< peer link key*/
#define ESP_LE_KEY_LENC (ESP_LE_KEY_PENC << 4) /*!< master role security information:div */
#define ESP_LE_KEY_LID (ESP_LE_KEY_PID << 4) /*!< master device ID key */
#define ESP_LE_KEY_LCSRK (ESP_LE_KEY_PCSRK << 4) /*!< local CSRK has been deliver to peer */
typedef uint8_t esp_ble_key_type_t;
/* relate to BTM_LE_AUTH_xxx in stack/btm_api.h */
#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0*/ /* relate to BTM_LE_AUTH_NO_BOND in stack/btm_api.h */
#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 */ /* relate to BTM_LE_AUTH_BOND in stack/btm_api.h */
#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 */ /* relate to BTM_LE_AUTH_REQ_MITM in stack/btm_api.h */
#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM)/*!< 0101*/
#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 */ /* relate to BTM_LE_AUTH_REQ_SC_ONLY in stack/btm_api.h */
#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 */ /* relate to BTM_LE_AUTH_REQ_SC_BOND in stack/btm_api.h */
#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM in stack/btm_api.h */
#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 */ /* relate to BTM_LE_AUTH_REQ_SC_MITM_BOND in stack/btm_api.h */
/// relate to BTM_LE_AUTH_xxx in stack/btm_api.h
#define ESP_LE_AUTH_NO_BOND 0x00 /*!< 0 no bondingv*/
#define ESP_LE_AUTH_BOND 0x01 /*!< 1 << 0 device in the bonding with peer */
#define ESP_LE_AUTH_REQ_MITM (1 << 2) /*!< 1 << 2 man in the middle attack */
#define ESP_LE_AUTH_REQ_BOND_MITM (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_MITM) /*!< 0101 banding with man in the middle attack */
#define ESP_LE_AUTH_REQ_SC_ONLY (1 << 3) /*!< 1 << 3 secure connection */
#define ESP_LE_AUTH_REQ_SC_BOND (ESP_LE_AUTH_BOND | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1001 secure connection with band*/
#define ESP_LE_AUTH_REQ_SC_MITM (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY) /*!< 1100 secure conn with MITM */
#define ESP_LE_AUTH_REQ_SC_MITM_BOND (ESP_LE_AUTH_REQ_MITM | ESP_LE_AUTH_REQ_SC_ONLY | ESP_LE_AUTH_BOND) /*!< 1101 SC with MITM and Bonding*/
typedef uint8_t esp_ble_auth_req_t; /*!< combination of the above bit pattern */
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_DISABLE 0 /*!< authentication disable*/
#define ESP_BLE_ONLY_ACCEPT_SPECIFIED_AUTH_ENABLE 1 /*!< authentication enable*/
#define ESP_BLE_OOB_DISABLE 0
#define ESP_BLE_OOB_ENABLE 1
#define ESP_BLE_OOB_DISABLE 0 /*!< disbale the out of bond*/
#define ESP_BLE_OOB_ENABLE 1 /*!< enable the out of bond*/
/* relate to BTM_IO_CAP_xxx in stack/btm_api.h */
#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */ /* relate to BTM_IO_CAP_OUT in stack/btm_api.h */
#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */ /* relate to BTM_IO_CAP_IO in stack/btm_api.h */
#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */ /* relate to BTM_IO_CAP_IN in stack/btm_api.h */
#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */ /* relate to BTM_IO_CAP_NONE in stack/btm_api.h */
#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */ /* relate to BTM_IO_CAP_KBDISP in stack/btm_api.h */
/// relate to BTM_IO_CAP_xxx in stack/btm_api.h
#define ESP_IO_CAP_OUT 0 /*!< DisplayOnly */
#define ESP_IO_CAP_IO 1 /*!< DisplayYesNo */
#define ESP_IO_CAP_IN 2 /*!< KeyboardOnly */
#define ESP_IO_CAP_NONE 3 /*!< NoInputNoOutput */
#define ESP_IO_CAP_KBDISP 4 /*!< Keyboard display */
#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /* relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /* relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /* relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /* relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /* relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /* relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /* relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /* relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /* relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /* relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /* relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /* relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /* relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /* relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /* relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /* relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /* relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /* relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /* relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /* relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /* relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /* relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /* relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /* relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /* relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /* relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /* relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /* relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /* relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /* relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /* relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /* relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /* relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /* relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /* relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /* relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /* relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /* relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /* relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /* relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /* relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /* relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /* relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /* relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /* relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /* relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_UNKNOWN 0x0000 /*!< relate to BTM_BLE_APPEARANCE_UNKNOWN in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PHONE 0x0040 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PHONE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_COMPUTER 0x0080 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_COMPUTER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_WATCH 0x00C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WATCH in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_SPORTS_WATCH 0x00C1 /*!< relate to BTM_BLE_APPEARANCE_SPORTS_WATCH in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_CLOCK 0x0100 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CLOCK in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_DISPLAY 0x0140 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_DISPLAY in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_REMOTE 0x0180 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_REMOTE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_EYEGLASSES 0x01C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_EYEGLASSES in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_TAG 0x0200 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_TAG in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_KEYRING 0x0240 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_KEYRING in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER 0x0280 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDIA_PLAYER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER 0x02C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BARCODE_SCANNER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_THERMOMETER 0x0300 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_THERMOMETER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_THERMOMETER_EAR 0x0301 /*!< relate to BTM_BLE_APPEARANCE_THERMOMETER_EAR in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_HEART_RATE 0x0340 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HEART_RATE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HEART_RATE_BELT 0x0341 /*!< relate to BTM_BLE_APPEARANCE_HEART_RATE_BELT in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE 0x0380 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_BLOOD_PRESSURE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_ARM 0x0381 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_ARM in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST 0x0382 /*!< relate to BTM_BLE_APPEARANCE_BLOOD_PRESSURE_WRIST in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_HID 0x03C0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_HID in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_KEYBOARD 0x03C1 /*!< relate to BTM_BLE_APPEARANCE_HID_KEYBOARD in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_MOUSE 0x03C2 /*!< relate to BTM_BLE_APPEARANCE_HID_MOUSE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_JOYSTICK 0x03C3 /*!< relate to BTM_BLE_APPEARANCE_HID_JOYSTICK in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_GAMEPAD 0x03C4 /*!< relate to BTM_BLE_APPEARANCE_HID_GAMEPAD in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_DIGITIZER_TABLET 0x03C5 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITIZER_TABLET in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_CARD_READER 0x03C6 /*!< relate to BTM_BLE_APPEARANCE_HID_CARD_READER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_DIGITAL_PEN 0x03C7 /*!< relate to BTM_BLE_APPEARANCE_HID_DIGITAL_PEN in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_HID_BARCODE_SCANNER 0x03C8 /*!< relate to BTM_BLE_APPEARANCE_HID_BARCODE_SCANNER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_GLUCOSE 0x0400 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_GLUCOSE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_WALKING 0x0440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WALKING in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_WALKING_IN_SHOE 0x0441 /*!< relate to BTM_BLE_APPEARANCE_WALKING_IN_SHOE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_WALKING_ON_SHOE 0x0442 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_SHOE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_WALKING_ON_HIP 0x0443 /*!< relate to BTM_BLE_APPEARANCE_WALKING_ON_HIP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_CYCLING 0x0480 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CYCLING in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_COMPUTER 0x0481 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_COMPUTER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_SPEED 0x0482 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_CADENCE 0x0483 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_CADENCE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_POWER 0x0484 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_POWER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_CYCLING_SPEED_CADENCE 0x0485 /*!< relate to BTM_BLE_APPEARANCE_CYCLING_SPEED_CADENCE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER 0x0C40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PULSE_OXIMETER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP 0x0C41 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_FINGERTIP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_PULSE_OXIMETER_WRIST 0x0C42 /*!< relate to BTM_BLE_APPEARANCE_PULSE_OXIMETER_WRIST in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_WEIGHT 0x0C80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_WEIGHT in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE 0x0CC0 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_POWERED_WHEELCHAIR 0x0CC1 /*!< relate to BTM_BLE_APPEARANCE_POWERED_WHEELCHAIR in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_MOBILITY_SCOOTER 0x0CC2 /*!< relate to BTM_BLE_APPEARANCE_MOBILITY_SCOOTER in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR 0x0D00 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_INSULIN_PUMP 0x0D40 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_INSULIN_PUMP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP 0x0D41 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_DURABLE_PUMP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP 0x0D44 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PUMP_PATCH_PUMP in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_INSULIN_PEN 0x0D48 /*!< relate to BTM_BLE_APPEARANCE_INSULIN_PEN in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY 0x0D80 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_MEDICATION_DELIVERY in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS 0x1440 /*!< relate to BTM_BLE_APPEARANCE_GENERIC_OUTDOOR_SPORTS in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION 0x1441 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV 0x1442 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD 0x1443 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD in stack/btm_ble_api.h */
#define ESP_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV 0x1444 /*!< relate to BTM_BLE_APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV in stack/btm_ble_api.h */
typedef uint8_t esp_ble_io_cap_t; /*!< combination of the io capability */
@ -139,15 +137,15 @@ typedef enum {
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 */
#endif // #if (BLE_42_FEATURE_SUPPORT == TRUE)
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /* Authentication complete indication. */
ESP_GAP_BLE_KEY_EVT, /* BLE key event for peer device keys */
ESP_GAP_BLE_SEC_REQ_EVT, /* BLE security request */
ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /* passkey notification event */
ESP_GAP_BLE_PASSKEY_REQ_EVT, /* passkey request event */
ESP_GAP_BLE_OOB_REQ_EVT, /* OOB request event */
ESP_GAP_BLE_LOCAL_IR_EVT, /* BLE local IR event */
ESP_GAP_BLE_LOCAL_ER_EVT, /* BLE local ER event */
ESP_GAP_BLE_NC_REQ_EVT, /* Numeric Comparison request event */
ESP_GAP_BLE_AUTH_CMPL_EVT = 8, /*!< Authentication complete indication. */
ESP_GAP_BLE_KEY_EVT, /*!< BLE key event for peer device keys */
ESP_GAP_BLE_SEC_REQ_EVT, /*!< BLE security request */
ESP_GAP_BLE_PASSKEY_NOTIF_EVT, /*!< passkey notification event */
ESP_GAP_BLE_PASSKEY_REQ_EVT, /*!< passkey request event */
ESP_GAP_BLE_OOB_REQ_EVT, /*!< OOB request event */
ESP_GAP_BLE_LOCAL_IR_EVT, /*!< BLE local IR (identity Root 128-bit random static value used to generate Long Term Key) event */
ESP_GAP_BLE_LOCAL_ER_EVT, /*!< BLE local ER (Encryption Root vakue used to genrate identity resolving key) event */
ESP_GAP_BLE_NC_REQ_EVT, /*!< Numeric Comparison request event */
#if (BLE_42_FEATURE_SUPPORT == TRUE)
ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT, /*!< When stop adv complete, the event comes */
ESP_GAP_BLE_SCAN_STOP_COMPLETE_EVT, /*!< When stop scan complete, the event comes */
@ -166,45 +164,45 @@ typedef enum {
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
ESP_GAP_BLE_SET_CHANNELS_EVT = 29, /*!< When setting BLE channels complete, the event comes */
#if (BLE_50_FEATURE_SUPPORT == TRUE)
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT,
ESP_GAP_BLE_SET_PREFERRED_DEFAULT_PHY_COMPLETE_EVT,
ESP_GAP_BLE_SET_PREFERRED_PHY_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT,
ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT,
ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT,
ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT,
ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT,
ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT,
ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT,
ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT,
ESP_GAP_BLE_EXT_ADV_REPORT_EVT,
ESP_GAP_BLE_SCAN_TIMEOUT_EVT,
ESP_GAP_BLE_ADV_TERMINATED_EVT,
ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT,
ESP_GAP_BLE_CHANNEL_SELECT_ALGORITHM_EVT,
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT,
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT,
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT,
ESP_GAP_BLE_READ_PHY_COMPLETE_EVT, /*!< when reading phy complete, this event comes */
ESP_GAP_BLE_SET_PREFERRED_DEFAULT_PHY_COMPLETE_EVT, /*!< when preferred default phy complete, this event comes */
ESP_GAP_BLE_SET_PREFERRED_PHY_COMPLETE_EVT, /*!< when preferred phy complete , this event comes */
ESP_GAP_BLE_EXT_ADV_SET_RAND_ADDR_COMPLETE_EVT, /*!< when extended set random address complete, the event comes */
ESP_GAP_BLE_EXT_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when extended advertising parameter complete, the event comes */
ESP_GAP_BLE_EXT_ADV_DATA_SET_COMPLETE_EVT, /*!< when extended advertising data complete, the event comes */
ESP_GAP_BLE_EXT_SCAN_RSP_DATA_SET_COMPLETE_EVT, /*!< when extended scan response data complete, the event comes */
ESP_GAP_BLE_EXT_ADV_START_COMPLETE_EVT, /*!< when extended advertising start complete, the event comes */
ESP_GAP_BLE_EXT_ADV_STOP_COMPLETE_EVT, /*!< when extended advertising stop complete, the event comes */
ESP_GAP_BLE_EXT_ADV_SET_REMOVE_COMPLETE_EVT, /*!< when extended advertising set remove complete, the event comes */
ESP_GAP_BLE_EXT_ADV_SET_CLEAR_COMPLETE_EVT, /*!< when extended advertising set clear complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SET_PARAMS_COMPLETE_EVT, /*!< when periodic advertising parameter complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_DATA_SET_COMPLETE_EVT, /*!< when periodic advertising data complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_START_COMPLETE_EVT, /*!< when periodic advertising start complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_STOP_COMPLETE_EVT, /*!< when periodic advertising stop complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_CREATE_SYNC_COMPLETE_EVT, /*!< when periodic advertising create sync complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_CANCEL_COMPLETE_EVT, /*!< when extended advertising sync cancel complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_TERMINATE_COMPLETE_EVT, /*!< when extended advertising sync terminate complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_ADD_DEV_COMPLETE_EVT, /*!< when extended advertising add device complete , the event comes */
ESP_GAP_BLE_PERIODIC_ADV_REMOVE_DEV_COMPLETE_EVT, /*!< when extended advertising remove device complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_CLEAR_DEV_COMPLETE_EVT, /*!< when extended advertising clear device, the event comes */
ESP_GAP_BLE_SET_EXT_SCAN_PARAMS_COMPLETE_EVT, /*!< when extended scan parameter complete, the event comes */
ESP_GAP_BLE_EXT_SCAN_START_COMPLETE_EVT, /*!< when extended scan start complete, the event comes */
ESP_GAP_BLE_EXT_SCAN_STOP_COMPLETE_EVT, /*!< when extended scan stop complete, the event comes */
ESP_GAP_BLE_PREFER_EXT_CONN_PARAMS_SET_COMPLETE_EVT, /*!< when extended prefer connection parameter set complete, the event comes */
ESP_GAP_BLE_PHY_UPDATE_COMPLETE_EVT, /*!< when ble phy update complete, the event comes */
ESP_GAP_BLE_EXT_ADV_REPORT_EVT, /*!< when extended advertising report complete, the event comes */
ESP_GAP_BLE_SCAN_TIMEOUT_EVT, /*!< when scan timeout complete, the event comes */
ESP_GAP_BLE_ADV_TERMINATED_EVT, /*!< when advertising terminate data complete, the event comes */
ESP_GAP_BLE_SCAN_REQ_RECEIVED_EVT, /*!< when scan req received complete, the event comes */
ESP_GAP_BLE_CHANNEL_SELECT_ALGORITHM_EVT, /*!< when channel select algorithm complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_REPORT_EVT, /*!< when periodic report advertising complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_LOST_EVT, /*!< when periodic advertising sync lost complete, the event comes */
ESP_GAP_BLE_PERIODIC_ADV_SYNC_ESTAB_EVT, /*!< when periodic advertising sync establish complete, the event comes */
#endif // #if (BLE_50_FEATURE_SUPPORT == TRUE)
ESP_GAP_BLE_EVT_MAX,
ESP_GAP_BLE_EVT_MAX, /*!< when maximum advertising event complete, the event comes */
} esp_gap_ble_cb_event_t;
#define ESP_GAP_BLE_CHANNELS_LEN 5
#define ESP_GAP_BLE_CHANNELS_LEN 5 /*!< channel length*/
typedef uint8_t esp_gap_ble_channels[ESP_GAP_BLE_CHANNELS_LEN];
/// This is the old name, just for backwards compatibility
@ -288,46 +286,47 @@ typedef enum {
/* relate to BTA_DM_BLE_SEC_xxx in bta/bta_api.h */
typedef enum {
ESP_BLE_SEC_ENCRYPT = 1, /* relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already
bonded, the stack will used LTK to encrypt with the remote device directly.
ESP_BLE_SEC_ENCRYPT = 1, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT in bta/bta_api.h. If the device has already
bonded, the stack will used Long Term Key (LTK) to encrypt with the remote device directly.
Else if the device hasn't bonded, the stack will used the default authentication request
used the esp_ble_gap_set_security_param function set by the user. */
ESP_BLE_SEC_ENCRYPT_NO_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has already
bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK
to encrypt with the remote device directly, else Re-pair with the remote device.
Else if the device hasn't bonded, the stack will used NO MITM authentication request in the current link instead of
used the authreq in the esp_ble_gap_set_security_param function set by the user. */
ESP_BLE_SEC_ENCRYPT_MITM, /* relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has already
bonded, the stack will check the LTK Whether the authentication request has been met, if met, used the LTK
to encrypt with the remote device directly, else Re-pair with the remote device.
Else if the device hasn't bonded, the stack will used MITM authentication request in the current link instead of
used the authreq in the esp_ble_gap_set_security_param function set by the user. */
ESP_BLE_SEC_ENCRYPT_NO_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_NO_MITM in bta/bta_api.h. If the device has been already
bonded, the stack will check the LTK (Long Term Key) Whether the authentication request has been met, and if met, use the LTK
to encrypt with the remote device directly, else re-pair with the remote device.
Else if the device hasn't been bonded, the stack will use NO MITM authentication request in the current link instead of
using the authreq in the esp_ble_gap_set_security_param function set by the user. */
ESP_BLE_SEC_ENCRYPT_MITM, /*!< relate to BTA_DM_BLE_SEC_ENCRYPT_MITM in bta/bta_api.h. If the device has been already
bonded, the stack will check the LTK (Long Term Key) whether the authentication request has been met, and if met, use the LTK
to encrypt with the remote device directly, else re-pair with the remote device.
Else if the device hasn't been bonded, the stack will use MITM authentication request in the current link instead of
using the authreq in the esp_ble_gap_set_security_param function set by the user. */
}esp_ble_sec_act_t;
typedef enum {
ESP_BLE_SM_PASSKEY = 0,
/* Authentication requirements of local device */
/*!< Authentication requirements of local device */
ESP_BLE_SM_AUTHEN_REQ_MODE,
/* The IO capability of local device */
/*!< The IO capability of local device */
ESP_BLE_SM_IOCAP_MODE,
/* Initiator Key Distribution/Generation */
/*!< Initiator Key Distribution/Generation */
ESP_BLE_SM_SET_INIT_KEY,
/* Responder Key Distribution/Generation */
/*!< Responder Key Distribution/Generation */
ESP_BLE_SM_SET_RSP_KEY,
/* Maximum Encryption key size to support */
/*!< Maximum Encryption key size to support */
ESP_BLE_SM_MAX_KEY_SIZE,
/* Minimum Encryption key size requirement from Peer */
/*!< Minimum Encryption key size requirement from Peer */
ESP_BLE_SM_MIN_KEY_SIZE,
/* Set static Passkey */
/*!< Set static Passkey */
ESP_BLE_SM_SET_STATIC_PASSKEY,
/* Reset static Passkey */
/*!< Reset static Passkey */
ESP_BLE_SM_CLEAR_STATIC_PASSKEY,
/* Accept only specified SMP Authentication requirement */
/*!< Accept only specified SMP Authentication requirement */
ESP_BLE_SM_ONLY_ACCEPT_SPECIFIED_SEC_AUTH,
/* Enable/Disable OOB support */
/*!< Enable/Disable OOB support */
ESP_BLE_SM_OOB_SUPPORT,
/* Appl encryption key size */
/*!< Appl encryption key size */
ESP_BLE_APP_ENC_KEY_SIZE,
/*!< authentication max param */
ESP_BLE_SM_MAX_PARAM,
} esp_ble_sm_param_t;
@ -673,90 +672,97 @@ typedef uint8_t esp_duplicate_info_t[ESP_BD_ADDR_LEN];
#endif //#if (BLE_42_FEATURE_SUPPORT == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE)
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) // Non-Connectable and Non-Scannable Undirected advertising
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) // Connectable advertising
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) // Scannable advertising
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) // Directed advertising
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) // High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval)
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) // Use legacy advertising PDUs
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) // Omit advertiser's address from all PDUs ("anonymous advertising")
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) // Include TxPower in the extended header of the advertising PDU
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) // Reserved for future use
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_NONCONN_NONSCANNABLE_UNDIRECTED (0 << 0) /*!< Non-Connectable and Non-Scannable Undirected advertising */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE (1 << 0) /*!< Connectable advertising */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE (1 << 1) /*!< Scannable advertising */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED (1 << 2) /*!< Directed advertising */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED (1 << 3) /*!< High Duty Cycle Directed Connectable advertising (<= 3.75 ms Advertising Interval) */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY (1 << 4) /*!< Use legacy advertising PDUs */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_ANON_ADV (1 << 5) /*!< Omit advertiser's address from all PDUs ("anonymous advertising") */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_INCLUDE_TX_PWR (1 << 6) /*!< Include TxPower in the extended header of the advertising PDU */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_MASK (0x7F) /*!< Reserved for future use */
/* If extended advertising PDU types are being used (bit 4 = 0) then:
/*!< If extended advertising PDU types are being used (bit 4 = 0) then:
The advertisement shall not be both connectable and scannable.
High duty cycle directed connectable advertising (<= 3.75 ms advertising interval) shall not be used (bit 3 = 0)
*/
// ADV_IND
/*!< ADV_IND */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_IND (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE)
// ADV_DIRECT_IND (low duty cycle)
/*!< ADV_DIRECT_IND (low duty cycle) */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_LD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_DIRECTED)
// ADV_DIRECT_IND (high duty cycle)
/*!< ADV_DIRECT_IND (high duty cycle) */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_HD_DIR (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_CONNECTABLE |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_HD_DIRECTED)
// ADV_SCAN_IND
/*!< ADV_SCAN_IND */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_SCAN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY |\
ESP_BLE_GAP_SET_EXT_ADV_PROP_SCANNABLE)
// ADV_NONCONN_IND
/*!< ADV_NONCONN_IND */
#define ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY_NONCONN (ESP_BLE_GAP_SET_EXT_ADV_PROP_LEGACY)
typedef uint16_t esp_ble_ext_adv_type_mask_t;
#define ESP_BLE_GAP_PHY_1M 1
#define ESP_BLE_GAP_PHY_2M 2
#define ESP_BLE_GAP_PHY_CODED 3
#define ESP_BLE_GAP_PHY_1M 1 /*!< Secondery Advertisement PHY is LE1M */
#define ESP_BLE_GAP_PHY_2M 2 /*!< Secondery Advertisement PHY is LE2M */
#define ESP_BLE_GAP_PHY_CODED 3 /*!< Secondery Advertisement PHY is LE Coded */
typedef uint8_t esp_ble_gap_phy_t;
#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0)
#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1)
#define ESP_BLE_GAP_NO_PREFER_TRANSMIT_PHY (1<<0) /*!< No Prefer TX PHY supported by controller */
#define ESP_BLE_GAP_NO_PREFER_RECEIVE_PHY (1<<1) /*!< No Prefer RX PHY supported by controller */
typedef uint8_t esp_ble_gap_all_phys_t;
// Primary phy only support 1M and LE coded phy
#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M
#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED
/// Primary phy only support 1M and LE coded phy
#define ESP_BLE_GAP_PRI_PHY_1M ESP_BLE_GAP_PHY_1M /*!< Primary Phy is LE1M */
#define ESP_BLE_GAP_PRI_PHY_CODED ESP_BLE_GAP_PHY_CODED /*!< Primary Phy is LE CODED */
typedef uint8_t esp_ble_gap_pri_phy_t; // primary phy
#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0)
#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1)
#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2)
#define ESP_BLE_GAP_PHY_1M_PREF_MASK (1 << 0) /*!< The Host prefers use the LE1M transmitter or reciever PHY */
#define ESP_BLE_GAP_PHY_2M_PREF_MASK (1 << 1) /*!< The Host prefers use the LE2M transmitter or reciever PHY */
#define ESP_BLE_GAP_PHY_CODED_PREF_MASK (1 << 2) /*!< The Host prefers use the LE CODED transmitter or reciever PHY */
typedef uint8_t esp_ble_gap_phy_mask_t;
#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 // The Host has no preferred coding when transmitting on the LE Coded PHY
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 // The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 // The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY
#define ESP_BLE_GAP_PHY_OPTIONS_NO_PREF 0 /*!< The Host has no preferred coding when transmitting on the LE Coded PHY */
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S2_CODING 1 /*!< The Host prefers that S=2 coding be used when transmitting on the LE Coded PHY */
#define ESP_BLE_GAP_PHY_OPTIONS_PREF_S8_CODING 2 /*!< The Host prefers that S=8 coding be used when transmitting on the LE Coded PHY */
typedef uint16_t esp_ble_gap_prefer_phy_options_t;
#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01
#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02
#define ESP_BLE_GAP_EXT_SCAN_CFG_UNCODE_MASK 0x01 /*!< Scan Advertisements on the LE1M PHY */
#define ESP_BLE_GAP_EXT_SCAN_CFG_CODE_MASK 0x02 /*!< Scan advertisements on the LE coded PHY */
typedef uint8_t esp_ble_ext_scan_cfg_mask_t;
#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00
#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01
#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02
/// Advertising data
#define ESP_BLE_GAP_EXT_ADV_DATA_COMPLETE 0x00 /*!< extended advertising data compete */
#define ESP_BLE_GAP_EXT_ADV_DATA_INCOMPLETE 0x01 /*!< extended advertising data incomplete */
#define ESP_BLE_GAP_EXT_ADV_DATA_TRUNCATED 0x02 /*!< extended advertising data truncated mode */
typedef uint8_t esp_ble_gap_ext_adv_data_status_t;
#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0
#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1
/// Advertising SYNC policy
#define ESP_BLE_GAP_SYNC_POLICY_BY_ADV_INFO 0 /*!< sync policy by advertising info */
#define ESP_BLE_GAP_SYNC_POLICY_BY_PERIODIC_LIST 1 /*!< periodic advertising sync policy */
typedef uint8_t esp_ble_gap_sync_t;
/* Advertising report */
#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0)
#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1)
#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2)
#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3)
/* Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */
#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13)
#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15)
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12)
#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10)
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b)
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a)
/// Advertising report
#define ESP_BLE_ADV_REPORT_EXT_ADV_IND (1<<0) /*!< advertising report with extended advertising indication type */
#define ESP_BLE_ADV_REPORT_EXT_SCAN_IND (1<<1) /*!< advertising report with extended scan indication type */
#define ESP_BLE_ADV_REPORT_EXT_DIRECT_ADV (1<<2) /*!< advertising report with extended direct advertising indication type */
#define ESP_BLE_ADV_REPORT_EXT_SCAN_RSP (1<<3) /*!< advertising report with extended scan response indication type */
/*!< Bluetooth 5.0, Vol 2, Part E, 7.7.65.13 */
#define ESP_BLE_LEGACY_ADV_TYPE_IND (0x13) /*!< advertising report with legacy advertising indication type */
#define ESP_BLE_LEGACY_ADV_TYPE_DIRECT_IND (0x15) /*!< advertising report with legacy direct indication type */
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_IND (0x12) /*!< advertising report with legacy scan indication type */
#define ESP_BLE_LEGACY_ADV_TYPE_NONCON_IND (0x10) /*!< advertising report with legacy non connectable indication type */
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_IND (0x1b) /*!< advertising report with legacy scan response indication type */
#define ESP_BLE_LEGACY_ADV_TYPE_SCAN_RSP_TO_ADV_SCAN_IND (0x1a) /*!< advertising report with legacy advertising with scan response indication type */
typedef uint8_t esp_ble_gap_adv_type_t;
/// Extend advertising tx power, range: [-127, +126] dBm
#define EXT_ADV_TX_PWR_NO_PREFERENCE (127) /*!< host has no preference for tx power */
/**
* @brief ext adv parameters
*/
@ -1754,8 +1760,8 @@ esp_err_t esp_ble_get_bond_device_list(int *dev_num, esp_ble_bond_dev_t *dev_lis
* SMP in response to ESP_GAP_BLE_OOB_REQ_EVT
*
* @param[in] bd_addr: BD address of the peer device.
* @param[in] TK: TK value, the TK value shall be a 128-bit random number
* @param[in] len: length of tk, should always be 128-bit
* @param[in] TK: Temporary Key value, the TK value shall be a 128-bit random number
* @param[in] len: length of temporary key, should always be 128-bit
*
* @return - ESP_OK : success
* - other : failed

View File

@ -18,7 +18,7 @@ extern "C" {
/// GATT INVALID HANDLE
#define ESP_GATT_ILLEGAL_HANDLE 0
/// GATT attribute max handle
#define ESP_GATT_ATTR_HANDLE_MAX 100
#define ESP_GATT_ATTR_HANDLE_MAX UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
#define ESP_GATT_MAX_READ_MULTI_HANDLES 10 /* Max attributes to read in one request */

View File

@ -351,7 +351,7 @@ esp_err_t esp_ble_gatts_create_service(esp_gatt_if_t gatts_if,
*/
esp_err_t esp_ble_gatts_create_attr_tab(const esp_gatts_attr_db_t *gatts_attr_db,
esp_gatt_if_t gatts_if,
uint8_t max_nb_attr,
uint16_t max_nb_attr,
uint8_t srvc_inst_id);
/**
* @brief This function is called to add an included service. This function have to be called between

View File

@ -2908,12 +2908,12 @@ static UINT8 bta_dm_authorize_cback (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NA
if (p_result && p_result->status == BTM_SUCCESS) {
BCM_STRNCPY_S((char *)sec_event.cfm_req.bd_name, (char *)p_result->remote_bd_name, BD_NAME_LEN);
sec_event.pin_req.bd_name[BD_NAME_LEN] = '\0';
sec_event.cfm_req.bd_name[BD_NAME_LEN] = '\0';
} else { /* No name found */
sec_event.cfm_req.bd_name[0] = '\0';
}
sec_event.key_notif.passkey = bta_dm_cb.num_val; /* get PIN code numeric number */
sec_event.cfm_req.num_val = bta_dm_cb.num_val; /* get PIN code numeric number */
/* 1 additional event data fields for this event */
sec_event.cfm_req.just_works = bta_dm_cb.just_works;

View File

@ -2820,6 +2820,7 @@ void BTA_DmBleGapExtAdvSetRemove(UINT8 instance)
if ((p_msg = (tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE *) osi_malloc(sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE))) != NULL) {
memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_EXT_ADV_SET_REMOVE));
p_msg->hdr.event = BTA_DM_API_EXT_ADV_SET_REMOVE_EVT;
p_msg->instance = instance;
//start sent the msg to the bta system control moudle
bta_sys_sendmsg(p_msg);
} else {

View File

@ -541,7 +541,6 @@ void bta_gattc_start_disc_char_dscp(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb)
if (bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_CHAR_DSCPT) != 0) {
bta_gattc_char_dscpt_disc_cmpl(conn_id, p_srvc_cb);
}
}
void bta_gattc_update_include_service(const list_t *services) {
@ -693,7 +692,9 @@ static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_sr
{
tBTA_GATTC_ATTR_REC *p_rec = NULL;
if (--p_srvc_cb->total_char > 0) {
/* Recursive function will cause BTU stack overflow when there are a large number of characteristic
* without descriptor to discover. So replace it with while function */
while (--p_srvc_cb->total_char > 0) {
p_rec = p_srvc_cb->p_srvc_list + (++ p_srvc_cb->cur_char_idx);
/* add the next characteristic into cache */
bta_gattc_add_char_to_cache (p_srvc_cb,
@ -701,11 +702,14 @@ static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_sr
p_rec->s_handle,
&p_rec->uuid,
p_rec->property);
/* start to discover next characteristic for descriptor */
if (bta_gattc_discover_procedure(conn_id, p_srvc_cb, GATT_DISC_CHAR_DSCPT) == 0) {
/* send att req and wait for att rsp */
break;
}
}
/* start discoverying next characteristic for char descriptor */
bta_gattc_start_disc_char_dscp(conn_id, p_srvc_cb);
} else
/* all characteristic has been explored, start with next service if any */
if (p_srvc_cb->total_char == 0) /* all characteristic has been explored, start with next service if any */
{
#if (defined BTA_GATT_DEBUG && BTA_GATT_DEBUG == TRUE)
APPL_TRACE_ERROR("all char has been explored");
@ -772,7 +776,7 @@ static tBTA_GATT_STATUS bta_gattc_add_srvc_to_list(tBTA_GATTC_SERV *p_srvc_cb,
/* allocate bigger buffer ?? */
status = GATT_DB_FULL;
APPL_TRACE_ERROR("service not added, no resources or wrong state");
APPL_TRACE_ERROR("service not added, no resources or wrong state, see CONFIG_BT_GATTC_MAX_CACHE_CHAR");
}
return status;
}
@ -814,7 +818,7 @@ static tBTA_GATT_STATUS bta_gattc_add_char_to_list(tBTA_GATTC_SERV *p_srvc_cb,
}
p_srvc_cb->next_avail_idx ++;
} else {
APPL_TRACE_ERROR("char not added, no resources");
APPL_TRACE_ERROR("char not added, no resources, see CONFIG_BT_GATTC_MAX_CACHE_CHAR");
/* allocate bigger buffer ?? */
status = BTA_GATT_DB_FULL;
}

View File

@ -270,7 +270,6 @@ typedef struct {
} tBTA_GATTC_ATTR_REC;
#define BTA_GATTC_MAX_CACHE_CHAR 40
#define BTA_GATTC_ATTR_LIST_SIZE (BTA_GATTC_MAX_CACHE_CHAR * sizeof(tBTA_GATTC_ATTR_REC))
#ifndef BTA_GATTC_CACHE_SRVR_SIZE
@ -305,10 +304,10 @@ typedef struct {
tBTA_GATTC_ATTR_REC *p_srvc_list;
UINT8 cur_srvc_idx;
UINT8 cur_char_idx;
UINT8 next_avail_idx;
UINT16 cur_char_idx;
UINT16 next_avail_idx;
UINT8 total_srvc;
UINT8 total_char;
UINT16 total_char;
UINT16 total_attr;
UINT8 srvc_hdl_chg; /* service handle change indication pending */
UINT16 attr_index; /* cahce NV saving/loading attribute index */

View File

@ -1469,7 +1469,7 @@ typedef struct {
tBLE_ADDR_TYPE peer_addr_type;
BD_ADDR peer_addr;
tBTA_BLE_AFP filter_policy;
UINT8 tx_power;
INT8 tx_power;
tBTA_DM_BLE_GAP_PHY primary_phy;
UINT8 max_skip;
tBTA_DM_BLE_GAP_PHY secondary_phy;

View File

@ -104,7 +104,8 @@ void btc_dm_sec_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *data)
msg.pid = BTC_PID_DM_SEC;
msg.act = event;
btc_transfer_context(&msg, (btc_dm_sec_args_t *)data, sizeof(btc_dm_sec_args_t), btc_dm_sec_arg_deep_copy);
btc_transfer_context(&msg, (btc_dm_sec_args_t *)data,
data == NULL ? 0 : sizeof(btc_dm_sec_args_t), btc_dm_sec_arg_deep_copy);
}
static void btc_enable_bluetooth_evt(tBTA_STATUS status)

View File

@ -415,7 +415,8 @@ static void btc_a2dp_sink_handle_decoder_reset(tBTC_MEDIA_SINK_CFG_UPDATE *p_msg
a2dp_sink_local_param.btc_aa_snk_cb.rx_flush = FALSE;
APPL_TRACE_EVENT("Reset to sink role");
status = OI_CODEC_SBC_DecoderReset(&a2dp_sink_local_param.context, a2dp_sink_local_param.contextData,
sizeof(a2dp_sink_local_param.contextData), 2, 2, FALSE, FALSE);
sizeof(a2dp_sink_local_param.contextData), a2dp_sink_local_param.btc_aa_snk_cb.channel_count,
a2dp_sink_local_param.btc_aa_snk_cb.channel_count, FALSE, FALSE);
if (!OI_SUCCESS(status)) {
APPL_TRACE_ERROR("OI_CODEC_SBC_DecoderReset failed with error code %d\n", status);
}

View File

@ -127,7 +127,7 @@ void btc_gatts_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
break;
}
case BTC_GATTS_ACT_CREATE_ATTR_TAB: {
uint8_t num_attr = src->create_attr_tab.max_nb_attr;
uint16_t num_attr = src->create_attr_tab.max_nb_attr;
if (src->create_attr_tab.gatts_attr_db && (num_attr > 0)) {
dst->create_attr_tab.gatts_attr_db = (esp_gatts_attr_db_t *) osi_malloc(sizeof(esp_gatts_attr_db_t) * num_attr);
if (dst->create_attr_tab.gatts_attr_db) {
@ -217,7 +217,7 @@ void btc_gatts_arg_deep_free(btc_msg_t *msg)
static void btc_gatts_act_create_attr_tab(esp_gatts_attr_db_t *gatts_attr_db,
esp_gatt_if_t gatts_if,
uint8_t max_nb_attr,
uint16_t max_nb_attr,
uint8_t srvc_inst_id)
{
uint16_t uuid = 0;
@ -568,24 +568,24 @@ static void btc_gatts_inter_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
//save the service handle to the btc module after used
//the attribute table method to creat a service
bta_to_btc_uuid(&btc_creat_tab_env.svc_uuid, &p_data->create.uuid);
uint8_t index = btc_creat_tab_env.handle_idx;
uint16_t index = btc_creat_tab_env.handle_idx;
btc_creat_tab_env.svc_start_hdl = p_data->create.service_id;
btc_creat_tab_env.handles[index] = p_data->create.service_id;
break;
}
case BTA_GATTS_ADD_INCL_SRVC_EVT: {
uint8_t index = btc_creat_tab_env.handle_idx;
uint16_t index = btc_creat_tab_env.handle_idx;
btc_creat_tab_env.handles[index] = p_data->add_result.attr_id;
break;
}
case BTA_GATTS_ADD_CHAR_EVT: {
uint8_t index = btc_creat_tab_env.handle_idx;
uint16_t index = btc_creat_tab_env.handle_idx;
btc_creat_tab_env.handles[index] = p_data->add_result.attr_id - 1;
btc_creat_tab_env.handles[index+1] = p_data->add_result.attr_id;
break;
}
case BTA_GATTS_ADD_CHAR_DESCR_EVT: {
uint8_t index = btc_creat_tab_env.handle_idx;
uint16_t index = btc_creat_tab_env.handle_idx;
btc_creat_tab_env.handles[index] = p_data->add_result.attr_id;
break;
}

View File

@ -55,7 +55,7 @@ typedef union {
struct create_attr_tab_args{
esp_gatt_if_t gatts_if;
uint8_t srvc_inst_id;
uint8_t max_nb_attr;
uint16_t max_nb_attr;
esp_gatts_attr_db_t *gatts_attr_db;
}create_attr_tab;
@ -149,8 +149,8 @@ typedef struct {
esp_bt_uuid_t svc_uuid;
bool is_tab_creat_svc;
bool is_use_svc;
uint8_t num_handle;
uint8_t handle_idx;
uint16_t num_handle;
uint16_t handle_idx;
uint16_t handles[ESP_GATT_ATTR_HANDLE_MAX];
} esp_btc_creat_tab_t;

View File

@ -134,6 +134,12 @@
#endif
//GATTC CACHE
#ifdef CONFIG_BT_GATTC_MAX_CACHE_CHAR
#define UC_BT_GATTC_MAX_CACHE_CHAR CONFIG_BT_GATTC_MAX_CACHE_CHAR
#else
#define UC_BT_GATTC_MAX_CACHE_CHAR 40
#endif
#ifdef CONFIG_BT_GATTC_CACHE_NVS_FLASH
#define UC_BT_GATTC_CACHE_NVS_FLASH_ENABLED CONFIG_BT_GATTC_CACHE_NVS_FLASH
#else
@ -258,6 +264,11 @@
#define UC_CONFIG_BT_GATT_MAX_SR_PROFILES 8
#endif
#ifdef CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
#define UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES CONFIG_BT_GATT_MAX_SR_ATTRIBUTES
#else
#define UC_CONFIG_BT_GATT_MAX_SR_ATTRIBUTES 100
#endif
#ifdef CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE
#define UC_BT_GATTS_SEND_SERVICE_CHANGE_MODE CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE

View File

@ -21,7 +21,6 @@
#define BT_TARGET_H
#include <bt_common.h>
#include "soc/soc_caps.h"
#ifndef BUILDCFG
#define BUILDCFG
@ -278,11 +277,6 @@
#define BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT UC_BT_BLE_ESTAB_LINK_CONN_TOUT
#endif
#ifdef SOC_BLE_DONT_UPDATE_OWN_RPA
#define BLE_UPDATE_BLE_ADDR_TYPE_RPA FALSE
#else
#define BLE_UPDATE_BLE_ADDR_TYPE_RPA TRUE
#endif
//------------------Added from bdroid_buildcfg.h---------------------
#ifndef L2CAP_EXTFEA_SUPPORTED_MASK
#define L2CAP_EXTFEA_SUPPORTED_MASK (L2CAP_EXTFEA_ENH_RETRANS | L2CAP_EXTFEA_STREAM_MODE | L2CAP_EXTFEA_NO_CRC | L2CAP_EXTFEA_FIXED_CHNLS)
@ -1203,15 +1197,27 @@
#endif
#ifndef BTM_BLE_ADV_TX_POWER
#ifdef CONFIG_IDF_TARGET_ESP32
#define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
#else
#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
#endif
#endif
#ifndef BTM_TX_POWER
#ifdef CONFIG_IDF_TARGET_ESP32
#define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
#else
#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
#endif
#endif
#ifndef BTM_TX_POWER_LEVEL_MAX
#ifdef CONFIG_IDF_TARGET_ESP32
#define BTM_TX_POWER_LEVEL_MAX 7
#else
#define BTM_TX_POWER_LEVEL_MAX 15
#endif
#endif
@ -2241,6 +2247,10 @@ The maximum number of payload octets that the local device can receive in a sing
#define BTA_DM_AVOID_A2DP_ROLESWITCH_ON_INQUIRY FALSE
#endif
#ifndef BTA_GATTC_MAX_CACHE_CHAR
#define BTA_GATTC_MAX_CACHE_CHAR UC_BT_GATTC_MAX_CACHE_CHAR
#endif
/******************************************************************************
**
** Tracing: Include trace header file here.

View File

@ -598,7 +598,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
if(esp_bluedroid_get_status() == ESP_BLUEDROID_STATUS_UNINITIALIZED) {
return 0;
}
uint8_t len = hci_ev[1] + 3;
uint16_t len = hci_ev[1] + 3;
uint8_t *data = (uint8_t *)malloc(len);
data[0] = 0x04;
memcpy(&data[1], hci_ev, len - 1);
@ -608,22 +608,17 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
return 0;
}
static void *trans_om;
void hci_trans_free_mbuf(void)
{
os_mbuf_free_chain(trans_om);
}
int
ble_hs_rx_data(struct os_mbuf *om, void *arg)
{
uint8_t len = om->om_len + 1;
uint16_t len = om->om_len + 1;
uint8_t *data = (uint8_t *)malloc(len);
data[0] = 0x02;
memcpy(&data[1], om->om_data, len - 1);
os_mbuf_copydata(om, 0, len - 1, &data[1]);
host_recv_pkt_cb(data, len);
trans_om = om;
free(data);
hci_trans_free_mbuf();
os_mbuf_free_chain(om);
return 0;
}

View File

@ -1990,7 +1990,7 @@ void btm_ble_conn_complete(UINT8 *p, UINT16 evt_len, BOOLEAN enhanced)
}
#if (BLE_PRIVACY_SPT == TRUE )
peer_addr_type = bda_type;
match = btm_identity_addr_to_random_pseudo (bda, &bda_type, TRUE);
match = btm_identity_addr_to_random_pseudo (bda, &bda_type, FALSE);
/* possiblly receive connection complete with resolvable random on
slave role while the device has been paired */

View File

@ -56,8 +56,9 @@ static void btm_gen_resolve_paddr_cmpl(tSMP_ENC *p)
p_cb->private_addr[5] = p->param_buf[0];
p_cb->private_addr[4] = p->param_buf[1];
p_cb->private_addr[3] = p->param_buf[2];
/* set it to controller */
btsnd_hcic_ble_set_random_addr(p_cb->private_addr);
btm_ble_set_random_addr(p_cb->private_addr);
p_cb->exist_addr_bit |= BTM_BLE_GAP_ADDR_BIT_RESOLVABLE;
memcpy(p_cb->resolvale_addr, p_cb->private_addr, BD_ADDR_LEN);
@ -66,23 +67,6 @@ static void btm_gen_resolve_paddr_cmpl(tSMP_ENC *p)
p_cb->set_local_privacy_cback = NULL;
}
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE){
BTM_TRACE_DEBUG("Advertise with new resolvable private address, now.");
/**
* Restart advertising, using new resolvable private address
*/
btm_ble_stop_adv();
btm_ble_start_adv();
}
if (btm_cb.ble_ctr_cb.inq_var.state == BTM_BLE_SCANNING){
BTM_TRACE_DEBUG("Scan with new resolvable private address, now.");
/**
* Restart scaning, using new resolvable private address
*/
btm_ble_stop_scan();
btm_ble_start_scan();
}
/* start a periodical timer to refresh random addr */
btu_stop_timer_oneshot(&p_cb->raddr_timer_ent);
#if (BTM_BLE_CONFORMANCE_TESTING == TRUE)

View File

@ -1018,9 +1018,7 @@ uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *
}
} else if(*own_bda_type == BLE_ADDR_PUBLIC_ID || *own_bda_type == BLE_ADDR_RANDOM_ID) {
if((btm_cb.ble_ctr_cb.addr_mgnt_cb.exist_addr_bit & BTM_BLE_GAP_ADDR_BIT_RESOLVABLE) == BTM_BLE_GAP_ADDR_BIT_RESOLVABLE) {
#if (BLE_UPDATE_BLE_ADDR_TYPE_RPA)
*own_bda_type = BLE_ADDR_RANDOM;
#endif
btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = BLE_ADDR_RANDOM;
memcpy(btm_cb.ble_ctr_cb.addr_mgnt_cb.private_addr, btm_cb.ble_ctr_cb.addr_mgnt_cb.resolvale_addr, BD_ADDR_LEN);
btsnd_hcic_ble_set_random_addr(btm_cb.ble_ctr_cb.addr_mgnt_cb.resolvale_addr);
@ -3675,21 +3673,20 @@ static void btm_ble_process_adv_pkt_cont(BD_ADDR bda, UINT8 addr_type, UINT8 evt
0x04 Scan Response (SCAN_RSP)
0x05-0xFF Reserved for future use
*/
//if scan duplicate is enabled, the adv packet without scan response is allowed to report to higher layer
if(p_le_inq_cb->scan_duplicate_filter == BTM_BLE_SCAN_DUPLICATE_ENABLE) {
/*
Bluedroid will put the advertising packet and scan response into a packet and send it to the higher layer.
If two advertising packets are not with the same address, or can't be combined into a packet, then the first advertising
packet will be discarded. So we added the following judgment:
1. For different addresses, send the last advertising packet to higher layer
2. For same address and same advertising type (not scan response), send the last advertising packet to higher layer
3. For same address and scan response, do nothing
*/
int same_addr = memcmp(bda, p_le_inq_cb->adv_addr, BD_ADDR_LEN);
if (same_addr != 0 || (same_addr == 0 && evt_type != BTM_BLE_SCAN_RSP_EVT)) {
btm_ble_process_last_adv_pkt();
}
}
// The adv packet without scan response is allowed to report to higher layer
/*
Bluedroid will put the advertising packet and scan response into a packet and send it to the higher layer.
If two advertising packets are not with the same address, or can't be combined into a packet, then the first advertising
packet will be discarded. So we added the following judgment:
1. For different addresses, send the last advertising packet to higher layer
2. For same address and same advertising type (not scan response), send the last advertising packet to higher layer
3. For same address and scan response, do nothing
*/
int same_addr = memcmp(bda, p_le_inq_cb->adv_addr, BD_ADDR_LEN);
if (same_addr != 0 || (same_addr == 0 && evt_type != BTM_BLE_SCAN_RSP_EVT)) {
btm_ble_process_last_adv_pkt();
}
p_i = btm_inq_db_find (bda);
@ -4121,6 +4118,59 @@ tBTM_STATUS btm_ble_stop_adv(void)
return rt;
}
tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda)
{
tBTM_STATUS rt = BTM_SUCCESS;
osi_mutex_lock(&adv_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
osi_mutex_lock(&scan_enable_lock, OSI_MUTEX_MAX_TIMEOUT);
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_DISABLE)) {
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
rt = adv_enable_status;
} else {
rt = BTM_BAD_VALUE_RET;
}
}
if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) {
if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_DISABLE, BTM_BLE_SCAN_DUPLICATE_DISABLE)) {
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
rt = scan_enable_status;
} else {
rt = BTM_BAD_VALUE_RET;
}
}
if (rt == BTM_SUCCESS) {
btsnd_hcic_ble_set_random_addr(random_bda);
}
if (btm_cb.ble_ctr_cb.inq_var.adv_mode == BTM_BLE_ADV_ENABLE) {
if (btsnd_hcic_ble_set_adv_enable (BTM_BLE_ADV_ENABLE)) {
osi_sem_take(&adv_enable_sem, OSI_SEM_MAX_TIMEOUT);
rt = adv_enable_status;
} else {
rt = BTM_BAD_VALUE_RET;
}
}
if (BTM_BLE_IS_DISCO_ACTIVE(btm_cb.ble_ctr_cb.scan_activity)) {
if (btsnd_hcic_ble_set_scan_enable (BTM_BLE_SCAN_ENABLE, btm_cb.ble_ctr_cb.inq_var.scan_duplicate_filter)) {
osi_sem_take(&scan_enable_sem, OSI_SEM_MAX_TIMEOUT);
rt = scan_enable_status;
} else {
rt = BTM_BAD_VALUE_RET;
}
}
osi_mutex_unlock(&adv_enable_lock);
osi_mutex_unlock(&scan_enable_lock);
return rt;
}
/*******************************************************************************
**
@ -4250,10 +4300,11 @@ void btm_ble_read_remote_features_complete(UINT8 *p)
btsnd_hcic_rmt_ver_req (p_acl_cb->hci_handle);
}
else{
uint16_t data_length = controller_get_interface()->get_ble_default_data_packet_length();
uint16_t data_txtime = controller_get_interface()->get_ble_default_data_packet_txtime();
if (p_acl_cb->transport == BT_TRANSPORT_LE) {
if (HCI_LE_DATA_LEN_EXT_SUPPORTED(p_acl_cb->peer_le_features)) {
uint16_t data_length = controller_get_interface()->get_ble_default_data_packet_length();
uint16_t data_txtime = controller_get_interface()->get_ble_default_data_packet_txtime();
if (HCI_LE_DATA_LEN_EXT_SUPPORTED(p_acl_cb->peer_le_features) &&
(p_acl_cb->data_length_params.tx_len != data_length)) {
p_acl_cb->data_len_updating = true;
btsnd_hcic_ble_set_data_length(p_acl_cb->hci_handle, data_length, data_txtime);
}

View File

@ -240,12 +240,6 @@ BOOLEAN BTM_SecRegister(tBTM_APPL_INFO *p_cb_info)
if (memcmp(btm_cb.devcb.id_keys.ir, &temp_value, sizeof(BT_OCTET16)) == 0) {
btm_ble_reset_id();
}
#if (!BLE_UPDATE_BLE_ADDR_TYPE_RPA)
BD_ADDR peer_addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
BT_OCTET16 peer_irk = {0x0};
/* add local irk to controller */
btsnd_hcic_ble_add_device_resolving_list (0, peer_addr, peer_irk, btm_cb.devcb.id_keys.irk);
#endif
} else {
BTM_TRACE_WARNING("%s p_cb_info->p_le_callback == NULL\n", __func__);
}

View File

@ -419,6 +419,7 @@ tBTM_STATUS btm_ble_stop_adv(void);
tBTM_STATUS btm_ble_start_scan(void);
void btm_ble_create_ll_conn_complete (UINT8 status);
void btm_ble_create_conn_cancel_complete (UINT8 *p);
tBTM_STATUS btm_ble_set_random_addr(BD_ADDR random_bda);
/* LE security function from btm_sec.c */
#if SMP_INCLUDED == TRUE

View File

@ -48,7 +48,7 @@
#define BTU_TASK_STACK_SIZE (BT_BTU_TASK_STACK_SIZE + BT_TASK_EXTRA_STACK_SIZE)
#define BTU_TASK_PRIO (BT_TASK_MAX_PRIORITIES - 5)
#define BTU_TASK_NAME "BTU_TASK"
#define BTU_TASK_WORKQUEUE_NUM (2)
#define BTU_TASK_WORKQUEUE_NUM (1)
#define BTU_TASK_WORKQUEUE0_LEN (0)
hash_map_t *btu_general_alarm_hash_map;

View File

@ -1214,7 +1214,7 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
UINT8 peer_addr_type, BD_ADDR peer_addr,
UINT8 adv_filter_policy, UINT8 adv_tx_power,
UINT8 adv_filter_policy, INT8 adv_tx_power,
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
UINT8 secondary_adv_phy,
UINT8 adv_sid, UINT8 scan_req_ntf_enable)
@ -1244,7 +1244,7 @@ UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UIN
UINT8_TO_STREAM(pp, peer_addr_type);
BDADDR_TO_STREAM (pp, peer_addr);
UINT8_TO_STREAM(pp, adv_filter_policy);
UINT8_TO_STREAM(pp, adv_tx_power);
INT8_TO_STREAM(pp, adv_tx_power);
UINT8_TO_STREAM(pp, primary_adv_phy);
UINT8_TO_STREAM(pp, secondary_adv_max_skip);
UINT8_TO_STREAM(pp, secondary_adv_phy);

View File

@ -1176,7 +1176,7 @@ typedef void (tBTM_ESCO_CBACK) (tBTM_ESCO_EVT event, tBTM_ESCO_EVT_DATA *p_data)
#define BTM_LKEY_TYPE_UNAUTH_COMB_P_256 HCI_LKEY_TYPE_UNAUTH_COMB_P_256
#define BTM_LKEY_TYPE_AUTH_COMB_P_256 HCI_LKEY_TYPE_AUTH_COMB_P_256
#define BTM_LTK_DERIVED_LKEY_OFFSET 0x20 /* "easy" requirements for LK derived from LTK */
#define BTM_LTK_DERIVED_LKEY_OFFSET 0x20 /* "easy" requirements for Link Key (LK) derived from Long Term Key */
#define BTM_LKEY_TYPE_IGNORE 0xff /* used when event is response from
hci return link keys request */

View File

@ -385,7 +385,7 @@ typedef UINT8 tBTM_BLE_AD_TYPE;
/* adv tx power level */
#define BTM_BLE_ADV_TX_POWER_MIN 0 /* minimum tx power */
#define BTM_BLE_ADV_TX_POWER_MAX 7 /* maximum tx power */
#define BTM_BLE_ADV_TX_POWER_MAX BTM_TX_POWER_LEVEL_MAX /* maximum tx power */
typedef UINT8 tBTM_BLE_ADV_TX_POWER;
/* adv tx power in dBm */
@ -767,7 +767,7 @@ typedef struct {
tBLE_ADDR_TYPE peer_addr_type;
BD_ADDR peer_addr;
tBTM_BLE_AFP filter_policy;
UINT8 tx_power;
INT8 tx_power;
tBTM_BLE_GAP_PHY primary_phy;
UINT8 max_skip;
tBTM_BLE_GAP_PHY secondary_phy;

View File

@ -962,7 +962,7 @@ UINT8 btsnd_hcic_ble_set_extend_rand_address(UINT8 adv_handle, BD_ADDR rand_addr
UINT8 btsnd_hcic_ble_set_ext_adv_params(UINT8 adv_handle, UINT16 properties, UINT32 interval_min,
UINT32 interval_max, UINT8 channel_map, UINT8 own_addr_type,
UINT8 peer_addr_type, BD_ADDR peer_addr,
UINT8 adv_filter_policy, UINT8 adv_tx_power,
UINT8 adv_filter_policy, INT8 adv_tx_power,
UINT8 primary_adv_phy, UINT8 secondary_adv_max_skip,
UINT8 secondary_adv_phy,
UINT8 adv_sid, UINT8 scan_req_ntf_enable);

View File

@ -2342,7 +2342,15 @@ void l2ble_update_att_acl_pkt_num(UINT8 type, tl2c_buff_param_t *param)
xSemaphoreGive(buff_semaphore);
break;
}
fixed_queue_t * queue = p_lcb->p_fixed_ccbs[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL]->xmit_hold_q;
tL2C_CCB *p_ccb = p_lcb->p_fixed_ccbs[L2CAP_ATT_CID - L2CAP_FIRST_FIXED_CHNL];
if(p_ccb == NULL) {
L2CAP_TRACE_ERROR("%s not found p_ccb", __func__);
xSemaphoreGive(buff_semaphore);
break;
}
fixed_queue_t * queue = p_ccb->xmit_hold_q;
att_max_num = MIN(p_lcb->link_xmit_quota, L2CAP_CACHE_ATT_ACL_NUM);
if (queue == NULL){
L2CAP_TRACE_ERROR("%s not found queue", __func__);

View File

@ -240,7 +240,8 @@ config BT_NIMBLE_SVC_GAP_APPEARANCE
menu "Memory Settings"
config BT_NIMBLE_MSYS_1_BLOCK_COUNT
int "MSYS_1 Block Count"
default 12
default 24 if SOC_ESP_NIMBLE_CONTROLLER
default 12 if !SOC_ESP_NIMBLE_CONTROLLER
help
MSYS is a system level mbuf registry. For prepare write & prepare
responses MBUFs are allocated out of msys_1 pool. For NIMBLE_MESH
@ -249,7 +250,8 @@ menu "Memory Settings"
config BT_NIMBLE_MSYS_1_BLOCK_SIZE
int "MSYS_1 Block Size"
default 256
default 128 if SOC_ESP_NIMBLE_CONTROLLER
default 256 if !SOC_ESP_NIMBLE_CONTROLLER
help
Dynamic memory size of block 1

View File

@ -350,7 +350,8 @@ static int host_rcv_pkt(uint8_t *data, uint16_t len)
}
/* Allocate LE Advertising Report Event from lo pool only */
if ((data[1] == BLE_HCI_EVCODE_LE_META) && (data[3] == BLE_HCI_LE_SUBEV_ADV_RPT)) {
if ((data[1] == BLE_HCI_EVCODE_LE_META) &&
(data[3] == BLE_HCI_LE_SUBEV_ADV_RPT || data[3] == BLE_HCI_LE_SUBEV_EXT_ADV_RPT)) {
evbuf = ble_hci_trans_buf_alloc(BLE_HCI_TRANS_BUF_EVT_LO);
/* Skip advertising report if we're out of memory */
if (!evbuf) {

View File

@ -183,7 +183,7 @@ the adv packet will be discarded until the memory is restored. */
.pcm_polar = CONFIG_BTDM_CTRL_PCM_POLAR_EFF, \
.hli = BTDM_CTRL_HLI, \
.magic = ESP_BT_CONTROLLER_CONFIG_MAGIC_VAL, \
};
}
#else
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h");

View File

@ -76,25 +76,34 @@ typedef enum {
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
*/
typedef enum {
ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */
ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */
ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */
ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
} esp_power_level_t;
typedef enum {
ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT = 0,
ESP_BLE_ENHANCED_PWR_TYPE_ADV,
ESP_BLE_ENHANCED_PWR_TYPE_SCAN,
ESP_BLE_ENHANCED_PWR_TYPE_INIT,
ESP_BLE_ENHANCED_PWR_TYPE_CONN,
ESP_BLE_ENHANCED_PWR_TYPE_MAX,
} esp_ble_enhanced_power_type_t;
typedef struct {
uint8_t type;
uint8_t val[6];
@ -117,8 +126,26 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
*/
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type);
/**
* @brief ENHANCED API for Setting BLE TX power
* Connection Tx power should only be set after connection created.
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
* @param power_level: Power level(index) corresponding to absolute value(dbm)
* @return ESP_OK - success, other - failed
*/
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle, esp_power_level_t power_level);
#define CONFIG_VERSION 0x20220729
/**
* @brief ENHANCED API of Getting BLE TX power
* Connection Tx power should only be get after connection created.
* @param power_type : The enhanced type of which tx power, could set Advertising/Connection/Default and etc
* @param handle : The handle of Advertising or Connection and the value 0 for other enhanced power types.
* @return >= 0 - Power level, < 0 - Invalid
*/
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
#define CONFIG_VERSION 0x20220824
#define CONFIG_MAGIC 0x5A5AA5A5
/**
@ -172,7 +199,9 @@ typedef struct {
uint8_t sleep_en;
uint8_t coex_phy_coded_tx_rx_time_limit;
uint8_t dis_scan_backoff;
uint8_t esp_scan_filter_en;
uint8_t ble_scan_classify_filter_enable;
uint8_t cca_drop_mode;
int8_t cca_low_tx_pwr;
uint8_t main_xtal_freq;
uint32_t config_magic;
} esp_bt_controller_config_t;
@ -223,10 +252,10 @@ typedef struct {
.sleep_en = NIMBLE_SLEEP_ENABLE, \
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
.esp_scan_filter_en = 0, \
.main_xtal_freq = CONFIG_ESP32C2_XTAL_FREQ, \
.ble_scan_classify_filter_enable = 0, \
.main_xtal_freq = CONFIG_XTAL_FREQ, \
.config_magic = CONFIG_MAGIC, \
};
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg);

View File

@ -192,13 +192,13 @@ extern "C" {
#define BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N (3000)
#ifdef CONFIG_ESP32C2_XTAL_FREQ_26
#ifdef CONFIG_XTAL_FREQ_26
#define RTC_FREQ_N (40000) /* in Hz */
#else
#define RTC_FREQ_N (32000) /* in Hz */
#endif // CONFIG_ESP32C2_XTAL_FREQ_26
#endif // CONFIG_XTAL_FREQ_26
#define BLE_LL_TX_PWR_DBM_N (0)
#define BLE_LL_TX_PWR_DBM_N (9)
#define RUN_BQB_TEST (0)

View File

@ -181,7 +181,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
.slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \
.hw_recorrect_en = AGC_RECORRECT_EN, \
.cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \
};
}
#else
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h");
@ -290,22 +290,22 @@ typedef enum {
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
*/
typedef enum {
ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */
ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */
ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */
ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
} esp_power_level_t;

View File

@ -227,7 +227,7 @@ typedef struct {
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
.scan_classify_filter_enable = false, \
.config_magic = CONFIG_MAGIC, \
};
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg);

View File

@ -180,7 +180,7 @@ typedef void (* esp_bt_hci_tl_callback_t) (void *arg, uint8_t status);
.slave_ce_len_min = SLAVE_CE_LEN_MIN_DEFAULT, \
.hw_recorrect_en = AGC_RECORRECT_EN, \
.cca_thresh = CONFIG_BT_CTRL_HW_CCA_VAL, \
};
}
#else
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() {0}; _Static_assert(0, "please enable bluetooth in menuconfig to use bt.h");
@ -289,23 +289,23 @@ typedef enum {
* @brief Bluetooth TX power level(index), it's just a index corresponding to power(dbm).
*/
typedef enum {
ESP_PWR_LVL_N27 = 0, /*!< Corresponding to -27dbm */
ESP_PWR_LVL_N24 = 1, /*!< Corresponding to -24dbm */
ESP_PWR_LVL_N21 = 2, /*!< Corresponding to -21dbm */
ESP_PWR_LVL_N18 = 3, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 4, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 5, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 6, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 7, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 8, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 9, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 10, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 11, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 12, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 13, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 14, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 15, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
ESP_PWR_LVL_N24 = 0, /*!< Corresponding to -24dbm */
ESP_PWR_LVL_N21 = 1, /*!< Corresponding to -21dbm */
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
} esp_power_level_t;
/**

View File

@ -116,9 +116,10 @@ struct ble_mbuf_hdr_rxinfo
struct ble_mbuf_hdr_txinfo
{
uint8_t flags;
uint8_t offset;
uint8_t reserve0;
uint8_t pyld_len;
uint8_t hdr_byte;
uint16_t offset;
};
struct ble_mbuf_hdr

View File

@ -198,7 +198,7 @@ IRAM_ATTR npl_freertos_event_reset(struct ble_npl_event *ev)
}
void
IRAM_ATTR npl_freertos_eventq_init(struct ble_npl_eventq *evq)
npl_freertos_eventq_init(struct ble_npl_eventq *evq)
{
struct ble_npl_eventq_freertos *eventq = NULL;
#if OS_MEM_ALLOC
@ -225,7 +225,7 @@ IRAM_ATTR npl_freertos_eventq_init(struct ble_npl_eventq *evq)
}
void
IRAM_ATTR npl_freertos_eventq_deinit(struct ble_npl_eventq *evq)
npl_freertos_eventq_deinit(struct ble_npl_eventq *evq)
{
struct ble_npl_eventq_freertos *eventq = (struct ble_npl_eventq_freertos *)evq->eventq;
@ -380,7 +380,7 @@ IRAM_ATTR npl_freertos_eventq_remove(struct ble_npl_eventq *evq,
}
ble_npl_error_t
IRAM_ATTR npl_freertos_mutex_init(struct ble_npl_mutex *mu)
npl_freertos_mutex_init(struct ble_npl_mutex *mu)
{
struct ble_npl_mutex_freertos *mutex = NULL;
#if OS_MEM_ALLOC
@ -415,7 +415,7 @@ IRAM_ATTR npl_freertos_mutex_init(struct ble_npl_mutex *mu)
}
ble_npl_error_t
IRAM_ATTR npl_freertos_mutex_deinit(struct ble_npl_mutex *mu)
npl_freertos_mutex_deinit(struct ble_npl_mutex *mu)
{
struct ble_npl_mutex_freertos *mutex = (struct ble_npl_mutex_freertos *)mu->mutex;
@ -517,7 +517,7 @@ IRAM_ATTR npl_freertos_mutex_release(struct ble_npl_mutex *mu)
}
ble_npl_error_t
IRAM_ATTR npl_freertos_sem_init(struct ble_npl_sem *sem, uint16_t tokens)
npl_freertos_sem_init(struct ble_npl_sem *sem, uint16_t tokens)
{
struct ble_npl_sem_freertos *semaphor = NULL;
#if OS_MEM_ALLOC
@ -552,7 +552,7 @@ IRAM_ATTR npl_freertos_sem_init(struct ble_npl_sem *sem, uint16_t tokens)
}
ble_npl_error_t
IRAM_ATTR npl_freertos_sem_deinit(struct ble_npl_sem *sem)
npl_freertos_sem_deinit(struct ble_npl_sem *sem)
{
struct ble_npl_sem_freertos *semaphor = (struct ble_npl_sem_freertos *)sem->sem;
@ -677,7 +677,7 @@ IRAM_ATTR os_callout_timer_cb(TimerHandle_t timer)
#endif
void
IRAM_ATTR npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq,
npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_eventq *evq,
ble_npl_event_fn *ev_cb, void *ev_arg)
{
struct ble_npl_callout_freertos *callout = NULL;
@ -750,7 +750,7 @@ IRAM_ATTR npl_freertos_callout_init(struct ble_npl_callout *co, struct ble_npl_e
}
void
IRAM_ATTR npl_freertos_callout_deinit(struct ble_npl_callout *co)
npl_freertos_callout_deinit(struct ble_npl_callout *co)
{
struct ble_npl_callout_freertos *callout = (struct ble_npl_callout_freertos *)co->co;
@ -765,7 +765,7 @@ IRAM_ATTR npl_freertos_callout_deinit(struct ble_npl_callout *co)
esp_err_t err = esp_timer_stop(callout->handle);
if(err != ESP_OK) {
if (err != ESP_ERR_INVALID_STATE) { // ESP_ERR_INVALID_STATE is expected when timer is already stopped
ESP_LOGW(TAG, "Timer not stopped");
ESP_LOGD(TAG, "Timer not stopped");
}
}
err = esp_timer_delete(callout->handle);

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