Compare commits

...

1714 Commits

Author SHA1 Message Date
5181de8ac5 versions: Update version to 5.0.2 2023-05-10 09:59:18 +02:00
f00c78b020 Merge branch 'ci/fix_idf_build_apps_in_5.0' into 'release/v5.0'
ci: add missing sdkconfig files (v5.0)

See merge request espressif/esp-idf!23134
2023-04-28 15:54:06 +08:00
04f04d6ccf Merge branch 'bugfix/owe_assoc_resp_fail_v5.0' into 'release/v5.0'
Fix association response processing in OWE (Backport v5.0)

See merge request espressif/esp-idf!23098
2023-04-28 15:53:43 +08:00
307c454757 ci: add missing sdkconfig files 2023-04-11 10:53:06 +08:00
2fe39f79d1 wpa_supplicant : Fix association response processing in OWE 2023-04-07 11:44:23 +05:30
ef4b1b7704 Merge branch 'contrib/github_pr_10997_v5.0' into 'release/v5.0'
i2s: intrerrupt fix (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22953
2023-03-30 09:35:10 +08:00
5919c3fba5 Merge branch 'bugfix/usb_host_enumeration_delay_v5.0' into 'release/v5.0'
USB Host: SetAddress recovery interval + menuconfig configuration (backport v5.0)

See merge request espressif/esp-idf!22711
2023-03-30 09:34:32 +08:00
834ca549a2 Merge branch 'feature/remove-cxx-experimental-v5.0' into 'release/v5.0'
cxx: removed cxx experimental components (v5.0)

See merge request espressif/esp-idf!22531
2023-03-30 09:34:01 +08:00
bb43066205 Merge branch 'feature/phy_write_blob_v5.0' into 'release/v5.0'
NimBLE: Demo of using write blob in ble phy example (v5.0)

See merge request espressif/esp-idf!22973
2023-03-30 09:33:32 +08:00
7d5c6b9b0a Merge branch 'bugfix/fix_systimer_stall_issue_in_lightsleep-esp32c2_espnow_enter_modem_sleep_unexpectly_v5.0' into 'release/v5.0'
fix: systimer_stall_issue_in_lightsleep & esp32c2_espnow_enter_modem_sleep_unexpectly (v5.0)

See merge request espressif/esp-idf!22983
2023-03-30 04:14:51 +08:00
e3778fa2a9 Merge branch 'bugfix/add_unregister_wpa3_cb_v5.0' into 'release/v5.0'
wpa_supplicant : Fix issues encountered in WFA testing (v5.0)

See merge request espressif/esp-idf!22891
2023-03-30 00:56:59 +08:00
63994a2f52 Merge branch 'bugfix/sta_sa_query_process_v5.0' into 'release/v5.0'
esp_wifi: Improve station SA query procedure handling and other bugfixes (Backport v5.0)

See merge request espressif/esp-idf!22903
2023-03-30 00:12:42 +08:00
dfb4a3daa0 esp_wifi: fix espnow unexpectly enter modem sleep on esp32c2 2023-03-29 21:20:33 +08:00
6b5bc6304a rtc_sleep: workaround systimer stall issue during lightsleep on ESP32C3 2023-03-29 21:19:21 +08:00
f944418ca4 Merge branch 'bugfix/delay_report_memory_leak_v5.0' into 'release/v5.0'
bugfix: fixed memory leak in AVDT delay report (v5.0)

See merge request espressif/esp-idf!22885
2023-03-29 19:14:40 +08:00
c35de0c0c7 Merge branch 'feature/gatt_server_improvements_v5_0' into 'release/v5.0'
NimBLE: Added custom GATT server functionality and encryption (v5.0)

See merge request espressif/esp-idf!22740
2023-03-29 19:14:12 +08:00
273b1b3bc5 Merge branch 'feature/add_ext_adv_instance_check' into 'release/v5.0'
NimBLE: Added ble_gap_ext_adv_active() to check if extended advertising instance is active or not.

See merge request espressif/esp-idf!22837
2023-03-29 19:11:45 +08:00
c7fa23b7b4 NimBLE: Demo of using write blob in ble phy example 2023-03-29 14:23:13 +05:30
ee70990288 Merge branch 'docs/ledc_datasheet_v5.0' into 'release/v5.0'
docs: update readme links to ledstrip datasheet (v5.0)

See merge request espressif/esp-idf!22958
2023-03-29 16:05:09 +08:00
fa4dccbe68 Merge branch 'bugfix/remove_Wno_format_in_esp_phy_esp_wifi_and_wpa_supplicant_components_v5.0' into 'release/v5.0'
Remove -Wno-format in esp_phy, esp_wifi, part of wpa_supplicant components(Backport v5.0)

See merge request espressif/esp-idf!22829
2023-03-29 15:49:14 +08:00
fd19fc9343 esp_wifi: Improve station SA query procedure handling and other bugfixes
1. Disable SA query timers when station disconnect and other SA query related improvements
2. Send appropriate reason code in 4 way handshake failure
2023-03-29 11:15:50 +05:30
2048d1e0c0 Merge branch 'mesh/bugfix_fix_bugs_for_mesh_network_v5.0' into 'release/v5.0'
wifi_mesh: fix bugs for mesh network (backport v5.0)

See merge request espressif/esp-idf!22902
2023-03-29 10:45:49 +08:00
9eea794f8e docs: update readme links to ledstrip datasheet 2023-03-29 10:16:26 +08:00
30058e3b31 Merge branch 'bugfix/enable_security_example_for_c2_v5.0' into 'release/v5.0'
examples: enable security example for ESP32-C2 (v5.0)

See merge request espressif/esp-idf!22947
2023-03-29 10:06:26 +08:00
7bfc40b5fb i2s interrupt fix
Merges: https://github.com/espressif/esp-idf/pull/10997
2023-03-28 18:37:48 +08:00
c86f48ad80 Merge branch 'feature/ble_mesh_console_stack_update_v5.0' into 'release/v5.0'
ble_mesh: stack: Miscellaneous fixes and updates(v5.0)

See merge request espressif/esp-idf!22922
2023-03-28 15:19:22 +08:00
lly
f92ee6d70b ble_mesh: stack: Minor fix for provisioner provisioning timeout 2023-03-28 04:29:07 +00:00
353eade320 ble_mesh: add BQB LOG 2023-03-28 04:29:07 +00:00
d63bcc75a4 ble_mesh: stack: forward rfu dst for the case NODE/RLY/BV-01 2023-03-28 04:29:07 +00:00
d63200c0b4 ble_mesh: stack: add send transaction ack befor provisioner send prov failed msg 2023-03-28 04:29:07 +00:00
0f87363e3e ble_mesh: stack: for the case MESH/PVNR/PBADV/BV-01, add the close link reason before reset link 2023-03-28 04:29:07 +00:00
72a20d8c7f examples: enable security example for ESP32-C2
Tested that example could work with flash encryption enabled case

Closes IDF-6959
2023-03-28 09:52:08 +05:30
b6be20a95d Remove -Wno-format in esp_phy, esp_wifi and part of wpa_supplicat components 2023-03-27 17:33:32 +08:00
149a2cfc5e Merge branch 'docs/extra_component_dirs_v5.0' into 'release/v5.0'
docs: fixed EXTRA_COMPONENT_DIRS being mispelled as EXTRA_COMPONENTS_DIRS in build-system guide (v5.0)

See merge request espressif/esp-idf!22800
2023-03-27 17:03:57 +08:00
6eb0d366a4 Merge branch 'feature/ble_mesh_add_bqb_log_test_macro_v5.0' into 'release/v5.0'
ble_mesh: stack: Add macros for BQB test to enable some internal function or log (v5.0)

See merge request espressif/esp-idf!22921
2023-03-27 16:42:55 +08:00
9f36ad8ab6 ble_mesh: stack: bug fix in bqb 2023-03-24 16:21:40 +08:00
f02b18b392 ble_mesh: stack: add description of internal BQB Test 2023-03-24 16:20:06 +08:00
lly
71bc754b0a ble_mesh: stack: Minor updates for BQB test log 2023-03-24 16:05:08 +08:00
161e78150f ble_mesh: stack: Add a BQB macro for BQB test to enable some internal function or log 2023-03-24 16:05:01 +08:00
e715f0fefd Merge branch 'bugfix/increase_nmea_example_default_stack_v5.0' into 'release/v5.0'
uart: increase default stack size for nmea example (v5.0)

See merge request espressif/esp-idf!22915
2023-03-24 14:27:15 +08:00
b97d2ed15a uart: increase default stack size for nmea example
With the old value of 2048 bytes we are right on the stack border when running on S3.

Closes https://github.com/espressif/esp-idf/issues/11044
2023-03-24 12:21:22 +08:00
7398a9b273 Merge branch 'fix/esptool_py_wrapper_v5.0' into 'release/v5.0'
Tools: don't add the esptool directory with wrappers to the PATH (v5.0)

See merge request espressif/esp-idf!22878
2023-03-24 02:06:57 +08:00
9801647fa5 wifi_mesh: update mesh doc 2023-03-23 17:18:23 +08:00
348f8f9bac wifi_mesh: Fix several bugs on mesh network 2023-03-23 17:18:00 +08:00
d8d6d3da5b Merge branch 'bugfix/fix_deep_sleep_crash_when_psram_high_freq_5.0' into 'release/v5.0'
mspi: turn down freq to fix crash when sleep (v5.0)

See merge request espressif/esp-idf!22841
2023-03-23 17:08:56 +08:00
76c8f09856 Merge branch 'bugfix/usb_serial_driver_block_v5.0' into 'release/v5.0'
usb_serial_jtag: Fix bug of blocking TX xfer when using driver (backport v5.0)

See merge request espressif/esp-idf!22830
2023-03-23 16:58:36 +08:00
e8205de110 Merge branch 'bugfix/lwip_core_locking_v5.0' into 'release/v5.0'
esp_netif/lwip: Fix core-locking config (v5.0)

See merge request espressif/esp-idf!22443
2023-03-23 16:54:49 +08:00
8f202f0ea5 Merge branch 'bugfix/fix_uart_tx_done_hardware_concurrency_v5.0' into 'release/v5.0'
uart: Fix TX side concurrency issues (v5.0)

See merge request espressif/esp-idf!22595
2023-03-23 15:29:33 +08:00
4a0fbdccc7 wpa_supplicant : Add disable for tls key usage check.
Disable the key usage check this leads to false negative results
while using wfa certificates during testing.
2023-03-23 10:53:13 +05:30
4e1d466fc5 wpa_supplicant : Add validations for 192-bit Suite B test cases.
Add validation for group data cipher, pairwise cipher and AKM Suites to
ensure correct ciphers are supported by AP during 192-bit Enterprise
connections.
2023-03-23 10:53:13 +05:30
6279e58c42 wpa_supplicant : Add deinitialization of Enterprise config_methods.
Add deinitialization of config_methods as it prevents correct reinitialization of sta in eap_peer_config_init() during reassoc.
2023-03-23 10:53:13 +05:30
f283b589ed wpa_supplicant : Add support for unregistering wifi wpa3 callbacks.
Unregister wifi callbacks allows for disabling support for wpa3 functions when not required.
2023-03-23 10:53:13 +05:30
7cf3f99bfa Merge branch 'bugfix/nvs_save_for_new_config_v5.0' into 'release/v5.0'
esp_wifi: Add nvs code for new config params(backport v5.0)

See merge request espressif/esp-idf!22867
2023-03-23 12:22:07 +08:00
7d61e0bc52 Fixed memory leak in AVDT delay report 2023-03-23 11:23:43 +08:00
cf7a01cb6e Merge branch 'bugfix/hfp_ag_cannot_init_conn_v5.0' into 'release/v5.0'
bt: Fixed the index out of bounds of hfp_ag BTC control block (v5.0)

See merge request espressif/esp-idf!22872
2023-03-23 10:51:24 +08:00
c7a70b6d0e Tools: don't add the esptool directory with wrappers to the PATH
Esptool.py is available from the esptool package which is installed in
every ESP-IDF v5.0+ shells. Therefore, the path to the legacy wrapper
scripts is not needed to be in the PATH. In some cases like
https://github.com/espressif/esp-idf/issues/10926 it even cases problem
because the wrapper doesn't have a shebang line and is not executable.

Note that the wrapper is kept only for invoking esptool as "python
$IDF_PATH/..../esptool.py" which was previously used mostly in CMake
files. There should be no other use-case where the esptool wrappers are
still needed.
2023-03-22 11:36:47 +01:00
b0f6a4174a Fixed the index out of bounds of hfp_ag BTC control block 2023-03-22 15:48:32 +08:00
8a6bc4363e esp_wifi: Add nvs code for new config params 2023-03-22 12:40:55 +05:30
3050ea656f Merge branch 'bugfix/i2s_pdm_dac_wrong_clock_freq_v5.0' into 'release/v5.0'
i2s_pdm: fix tx frequency limitation (v5.0)

See merge request espressif/esp-idf!22832
2023-03-21 20:23:50 +08:00
3154ad8a23 Merge branch 'feature/modbus_remove_example_tests_v5' into 'release/v5.0'
modbus remove example tests (backport v5.0)

See merge request espressif/esp-idf!22843
2023-03-21 20:20:50 +08:00
da4c7eb7c4 Added custom gatt server functionality and encryption. 2023-03-21 17:40:41 +05:30
c575587ea4 Merge branch 'bugfix/flash_large_memory_size_v5.0' into 'release/v5.0'
spi_flash: Fix issue that cannot get accurate flash size when encounter large size memory(backport v5.0)

See merge request espressif/esp-idf!21533
2023-03-21 18:58:33 +08:00
a18d019fc9 lwip: Fix lwiopts macro expansion and dhcps-test
Minor issue in lwipopts.h in macro expansion in parameters (cosmetic
change: it expands correctly but doesn't pass the expected argument)
Fix lwip thread safety issue in tests: dhcp server should be started and
stopped only in lwip context/thread. Without this fix, the test would
fail if `CONFIG_LWIP_CHECK_THREAD_SAFETY=y`
Adds CONFIG_LWIP_TCPIP_CORE_LOCKING=y to some mqtt example tests (the
same configs as used in v5.1)
2023-03-21 11:21:07 +01:00
285362e8d6 lwip: Add missing esp_sntp_enabled() 2023-03-21 11:09:56 +01:00
42594bffe4 lwip/sntp: Fix esp_sntp_ API races (v5.0)
Some of the esp_sntp_...() APIs that wrap lwip's SNTP
module use tcpip_callback() to execute the lwip functionality
in the correct state (either with locked TCP/IP core,
or within the TCP/IP thread).
tcpip_callback() however doesn't wait for completion of the callback,
which doesn't prevent from using the stack variables after destroy
if used as a parameter.
Introduced in a71fa82.
Fixed by using of tcpip_api_call() instead of the tcpip_callback().

Closes https://github.com/espressif/esp-idf/issues/10611
2023-03-21 11:09:56 +01:00
25cbcd6a1c docs: CN translation for system_time.rst (v5.0) 2023-03-21 11:09:56 +01:00
5b75693522 esp_netif/lwip: Fix core-locking config (v5.0)
* Fix thread safety issues in non-core locking
* Add option to verify thread safety issues in lwip (core-lock assertion)
* Make esp_sntp.h thread safe API
* Fix sntp examples

Closes https://github.com/espressif/esp-idf/issues/9908
Closes https://github.com/espressif/esp-idf/issues/10502
Closes https://github.com/espressif/esp-idf/issues/10466
2023-03-21 11:09:56 +01:00
f9f4a23159 Merge branch 'bugfix/set_generic_len_for_rsnxe_v5.0' into 'release/v5.0'
esp_wifi: bugfix RSNXE related changes

See merge request espressif/esp-idf!22420
2023-03-21 12:35:11 +08:00
4c66d7e6df esp_flash: correct veriable 'size' description 2023-03-21 12:10:38 +08:00
77c675db25 esp_wifi: bugfix RSNXE related changes
1. Set AP rsnxe len generic
2. Set transition_disable value in wifi get config
2023-03-20 21:55:44 +05:30
be59a273c6 modbus remove example tests 2023-03-20 13:12:30 +01:00
20924e3a72 mspi: turn down freq to fix crash when sleep 2023-03-20 19:46:25 +08:00
ec55f7fe6e i2s_pdm: fix tx frequency limitation
Closes: https://github.com/espressif/esp-idf/issues/10420
2023-03-20 19:22:40 +08:00
d3546e3fa3 NimBLE: Added ble_gap_ext_adv_active() to check if extended advertising instance is active or not. 2023-03-20 16:36:20 +05:30
2ce6ddacfc Merge branch 'bufix/fix_check_kconfigs_mention_v5.0' into 'release/v5.0'
bugfix: Fix documentation reference to check_kconfigs.py (v5.0)

See merge request espressif/esp-idf!22816
2023-03-20 17:06:11 +08:00
dc172b63d3 Merge branch 'bugfix/close_rf_in_deep_sleep_backport_v5.0' into 'release/v5.0'
deep sleep: further optimize sleep current if RF is enabled (backport v5.0)

See merge request espressif/esp-idf!22738
2023-03-20 15:48:29 +08:00
b02d50e33b i2s: fix some typos 2023-03-20 14:51:07 +08:00
8e3b4f68dc usb_serial_jtag: Fix bug of blocking TX xfer when using driver,
Merges https://github.com/espressif/esp-idf/pull/10208
2023-03-20 14:07:55 +08:00
6f0746734f [USB Serial/JTAG Driver] use time-limited blocking for TX 2023-03-20 14:07:41 +08:00
763e369858 Merge branch 'feature/support_7.2.8_soc/pvt_dig_v5.0' into 'release/v5.0'
ESP32S3:support auto adjust LDO voltage based on pvt-dig(backport 5.0)

See merge request espressif/esp-idf!19774
2023-03-20 14:06:48 +08:00
e94d95103e spi_flash: Fix issue that cannot get accurate flash size when encounter large size memory,
Closes https://github.com/espressif/esp-idf/pull/9566
2023-03-20 13:07:35 +08:00
55e040b54b Merge branch 'bugfix/wakeup_io_hold_unhold_in_sleep_v5.0' into 'release/v5.0'
gpio: Fix deep sleep wakeup IOs unable to unhold after wakeup (v5.0)

See merge request espressif/esp-idf!22665
2023-03-20 12:49:56 +08:00
58f24af363 Merge branch 'contrib/github_pr_10935_v5.0' into 'release/v5.0'
export: avoid error on unbound variable (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22820
2023-03-18 15:38:32 +08:00
1ed1d1cf64 Merge branch 'feature/export_fish_exit_code_success_v5.0' into 'release/v5.0'
Tools: export.fish exit with success exit code (v5.0)

See merge request espressif/esp-idf!22818
2023-03-18 15:36:55 +08:00
1160e6e6b8 export: avoid error on unbound variable
I the shell has `set -u` (to abort on unbound variable), sourcing
export.sh currently fails when IDF_EXPORT_QUIET or IDF_PATH is not set:
> /path/to/esp-idf/export.sh:16: IDF_EXPORT_QUIET: unbound variable

This commit sets a default empty value to those variable, as done
in 16731833fb (which forgot IDF_PATH as it's usually set, the other
variable landed later in the file).
2023-03-17 18:13:58 +01:00
5a0cf6d175 Make export.fish exit with SUCCESS exit code
The export.fish script exits with an exit code of 4. Thus, any shell checks that make sure the source command exits successfully always failed. This was due to the last line trying to erase the __main function. In fish, you can't erase a function using the `set` command, you can only erase variables. By removing that line the script now exits with an exit code of 0 instead of 4.

Erase __main function at the end of export.fish

Closes https://github.com/espressif/esp-idf/pull/10828
2023-03-17 18:08:23 +01:00
561e7357ac doc: fix a small typo for check_kconfigs.py
The script was moved in bcc8f2628c ,
update the doc reference to match.
2023-03-17 15:22:52 +01:00
e9b2f6ddce Merge branch 'bugfix/minor_syntax_changes_v5.0' into 'release/v5.0'
wpa_supplicant : Fixing a collection of issues encountered during application testing.

See merge request espressif/esp-idf!22178
2023-03-17 19:39:49 +08:00
faad05cf56 Merge branch 'bugfix/default_wpa2_causing_pmk_recal_v5.0' into 'release/v5.0'
esp_wifi: Fix for default wpa2 authmode casing pmk recalculation.(v5.0)

See merge request espressif/esp-idf!22427
2023-03-17 19:39:40 +08:00
385ca5a041 Merge branch 'test/add_spi_slave_freq_test_v5.0' into 'release/v5.0'
spi_slave: fix io re-config issue (v5.0)

See merge request espressif/esp-idf!22592
2023-03-17 19:17:23 +08:00
zlq
135381943a 1.add ldo parameters in efuse table; 2.set ldo based on pvt-efuse; 3.ldo voltage is changed based on cpu freq 2023-03-17 11:14:01 +00:00
122dd1ed32 Merge branch 'bugfix/fix_potential_null_pointer_dereference_v5.0' into 'release/v5.0'
Fix potential null pointer dereference (backport v5.0)

See merge request espressif/esp-idf!22184
2023-03-17 17:29:17 +08:00
3da8120029 Merge branch 'bugfix/gpio_ut_usj_v5.0' into 'release/v5.0'
gpio: add a test case to test the ability of disabling USB D+ pin pull-up (v5.0)

See merge request espressif/esp-idf!22605
2023-03-17 16:34:17 +08:00
27f9ee66d5 gpio: Fix IO hold function related problems
1. Fix deep sleep wakeup IOs can not be unhold issue
2. Correct hold related APIs' description
3. Fix gpio_force_hold_all API

docs: Add GPIO wakeup source to sleep_modes doc for ESP32C3 and C2
2023-03-17 14:44:29 +08:00
b3b3947207 examples: system/deep_sleep
1. Fix EXT0 wakeup pin error on ESP32: GPIO3 is not a RTC IO, change to use GPIO25.
2. Add ESP_ERROR_CHECK to explicitly show the runtime error
3. Improve example README
2023-03-17 14:44:29 +08:00
a7222acf47 rtcio: Add a test case to test RTCIO's hold ability after deep sleep wakeup 2023-03-17 14:44:23 +08:00
fe743a057f Merge branch 'bugfix/avrcp_psth_cmd_rsp_v5.0' into 'release/v5.0'
bt:Added a parameter to tell the user the result of the pass through command implementation(v5.0)

See merge request espressif/esp-idf!22726
2023-03-17 14:22:22 +08:00
9718c91a38 Merge branch 'bugfix/bluedroid_le_coc_compile_error_v5.0' into 'release/v5.0'
bt: fix Bluedroid compile errors after enable CONFIG_ESP_SYSTEM_USE_EH_FRAME on RISC-V SoCs(backport v5.0)

See merge request espressif/esp-idf!22492
2023-03-17 13:56:36 +08:00
df0ec3f5e4 Merge branch 'bugfix/modify_configuration_for_ble_5_v5.0' into 'release/v5.0'
Nimble: Update example configuration to enable ext adv feature only for BLE5.0 supported chips (v5.0)

See merge request espressif/esp-idf!22780
2023-03-17 13:56:22 +08:00
b837e910a9 Merge branch 'bugfix/add_debug_check_v5.0' into 'release/v5.0'
Nimble: Added debug relate flag around debug code_v5.0

See merge request espressif/esp-idf!22782
2023-03-17 13:55:54 +08:00
4cbabc0542 docs: fixed EXTRA_COMPONENT_DIRS being mispelled as EXTRA_COMPONENTS_DIRS in build-system guide 2023-03-17 11:49:51 +08:00
b7ca4320bb Merge branch 'bugfix/atomic_gptimer_fsm_v5.0' into 'release/v5.0'
gptimer: fix race condition between start and stop (v5.0)

See merge request espressif/esp-idf!22712
2023-03-17 10:38:53 +08:00
0f798b31d8 Merge branch 'bugfix/mqtt_docs_migration_5.x_v5.0' into 'release/v5.0'
mqtt/docs: Mention removal of user_context in 5.x migration guide (v5.0)

See merge request espressif/esp-idf!22557
2023-03-17 10:35:38 +08:00
14723a07d1 Merge branch 'bugfix/flakey_task_snapshot_tests_v5.0' into 'release/v5.0'
FreeRTOS: Fix flakey task snapshot tests (v5.0)

See merge request espressif/esp-idf!22778
2023-03-17 10:25:25 +08:00
32a02459dc Nimble: Update example configuration to enable ext adv feature only for BLE5.0 supported chips 2023-03-16 12:08:58 +05:30
49c5a92181 esp_wifi: Fix for default wpa2 authmode casing pmk recalculation.
Closes https://github.com/espressif/esp-idf/issues/10214
2023-03-16 11:48:55 +05:30
6dc6b57180 Merge branch 'bufix/Backport_some_wifi_lwip_bugs_for_5.0_0314' into 'release/v5.0'
bufix/Backport_some_wifi_lwip_bugs_for_5.0_0314

See merge request espressif/esp-idf!22758
2023-03-16 10:49:26 +08:00
10010b1976 Merge branch 'bugfix/fix_fast_packets_handling_v5.0' into 'release/v5.0'
Nimble: Retry buffer allocation, if previous allocation fails (v5.0)

See merge request espressif/esp-idf!22730
2023-03-16 10:27:42 +08:00
ce7df40968 Nimble: Added debug relate flag around debug code 2023-03-15 16:30:29 +05:30
1d6ba06366 esp_wifi:bugfix for optimize abnormal beacon log 2023-03-15 16:21:02 +08:00
392533f0e2 Fixed bug for dhcp server support CIDR
Closes https://github.com/espressif/esp-idf/issues/10024

Closes https://github.com/espressif/esp-idf/issues/10559
2023-03-15 16:20:33 +08:00
e0b1ccf6ce freertos: Fix flakey task snapshot tests
The task snapshot tests use esp_cpu_stall() to stall the other CPU before
manually walking the task lists. However, it is possible that the other CPU
was also accessing the task lists when esp_cpu_stall() is called, leading to
flakey tests

This commit fixes the test by using a 2-way handshake instead of
esp_cpu_stall().
2023-03-15 16:12:24 +08:00
446b49cc15 dhcp server:bugfix softap excedes the range of subnet 2023-03-15 14:35:42 +08:00
62983624ae 1 dhcp: Fix dhcp_fine_tmr() not to use netif after free
2 tcp_in/ooseq: Fix incorrect segment trim when FIN moved

* Update submodule: git log --oneline 10197b212a95c49c733fb18ffed56cafb0d196d4..d5e56d06658ae11292be1baea56204f7120b6fa7

Detailed description of the changes:
  - dhcp: Fix dhcp_fine_tmr() not to use netif after free (esp-lwip@d5e56d06)
  - tcp_in/ooseq: Fix incorrect segment trim when FIN moved (esp-lwip@9e62afff)
  - netdb:fixed addrtype and length in gethostbyname (esp-lwip@aee6b3ed)
  - lwip/napt: Added api to enable/disable napt based on lwip netif (esp-lwip@280c3d61)
  - lwip/dhcp: Fixed ondemand fine timers bug, that allowed only one dhcp (esp-lwip@86df9f44)
2023-03-15 14:35:42 +08:00
3b46f2f698 lwip:optimization dhcp coarse timer 2023-03-15 14:35:42 +08:00
6f311db07e lwip: solve some routers do not forward multicast packet issue 2023-03-15 14:35:42 +08:00
84b9cebb04 Merge branch 'docs/broken_links_2_v5.0' into 'release/v5.0'
docs: fix broken links (v5.0)

See merge request espressif/esp-idf!22748
2023-03-15 14:16:15 +08:00
04758d2782 Merge branch 'contrib/github_pr_10970' into 'release/v5.0'
Bugfix: Fix compile error for ESP32 FSM ULP ADC Example (GitHub PR)

See merge request espressif/esp-idf!22746
2023-03-15 10:47:11 +08:00
63983fbdfa Merge branch 'bugfix/nimble_ext_adv_v5.0' into 'release/v5.0'
NimBLE: Fixed advertising instance check api in bleprph example (v5.0)

See merge request espressif/esp-idf!22752
2023-03-15 10:33:38 +08:00
e9e1702b23 Merge branch 'bugfix/IDFGH_9535_v5.0' into 'release/v5.0'
wifi_prov_mgr : Fixed return value of characteristic read operation in nimble (v5.0)

See merge request espressif/esp-idf!22672
2023-03-15 10:33:05 +08:00
5158af3fed NimBLE: Fixed advertising instance check api in bleprph example 2023-03-14 12:22:49 +05:30
ff004d9ab9 wifi_prov_mgr : Fixed return value of characteristic read operation 2023-03-14 06:50:20 +00:00
86447548f8 Merge branch 'bugfix/restart_ext_adv_after_discovery_v5.0' into 'release/v5.0'
Nimble: Updated bleprph example to re-enable ext adv after advertising is completed (v5.0)

See merge request espressif/esp-idf!22542
2023-03-14 13:59:53 +08:00
0c1e80fc5b Merge branch 'feature/add_pcl_example_blecent_v5.0' into 'release/v5.0'
Nimble:Added power control API usage demo in blecent app (v5.0)

See merge request espressif/esp-idf!22541
2023-03-14 13:59:30 +08:00
8ebb50906f Merge branch 'bugfix/set_component_relative_path_v5.0' into 'release/v5.0'
Nimble: component path relative to IDF (v5.0)

See merge request espressif/esp-idf!22545
2023-03-14 13:59:10 +08:00
64d5421d8b deep sleep: close rf to optimize sleep current 2023-03-14 13:57:42 +08:00
6db1f2f9a7 Merge branch 'bugfix/some_small_fix_for_sleep_backport_v5.0' into 'release/v5.0'
soc/soc_caps: update soc caps for chips that support power-down of modem hardware(backport v5.0)

See merge request espressif/esp-idf!22720
2023-03-14 13:55:39 +08:00
420e20f95b docs: fix broken links 2023-03-14 10:24:51 +08:00
e14c47ee44 Merge branch 'bugfix/ulp_docs_incorrect_jump_desc_v5.0' into 'release/v5.0'
docs: Updated incorrect description for ULP FSM JUMPR and JUMPS instructions (v5.0)

See merge request espressif/esp-idf!22731
2023-03-14 03:59:10 +08:00
568dd3d823 Revert "optimize deep sleep current in wifi softap mode"
This reverts commit 344ec80fad.
2023-03-13 20:49:36 +08:00
89bb920c86 Merge branch 'bugfix/ps_bufferable_mmpdu_v5.0' into 'release/v5.0'
Combine improvements in sa query and buffer mgmt frames on SoftAP, fix NULL ptr dereference (Backport v5.0)

See merge request espressif/esp-idf!22215
2023-03-13 19:39:03 +08:00
316a1de567 docs: Updated incorrect description for ULP FSM JUMPR and JUMPS instructions
This commit updates the incorrect description for the JUMPR and JUMPS
instructions for ULP FSM on esp32/s2/s3.

Closes https://github.com/espressif/esp-idf/issues/10923
2023-03-13 11:05:52 +01:00
ceeff063e8 Nimble: Added change to give time to allocate buffers, in case previous
allocation fails

Closes https://github.com/espressif/esp-idf/issues/10849
2023-03-13 15:23:04 +05:30
28aa12ed01 Nimble:Change component path to relative path for remaining examples 2023-03-13 14:24:08 +05:30
861517ecb0 component path relative to IDF
Change the component path to relative to the IDF as the build will fail if the example is moved from its folder.

(cherry picked from commit 4011f5ce595d114c69c46298088440a230eed937)
Signed-off-by: Rahul Tank <rahul.tank@espressif.com>
2023-03-13 14:22:54 +05:30
358ed1af5d Merge branch 'bugfix/add_return_type_nimble_port_init_v5.0' into 'release/v5.0'
Nimble: Added return value (success / failure ) to nimble_port_init  / nimble_port_deinit (v5.0)

See merge request espressif/esp-idf!22191
2023-03-13 15:19:06 +08:00
41e52fc5e9 Merge branch 'bugfix/fix_hidh_connection_bug_v5.0' into 'release/v5.0'
Bugfix/Fix HID Host bug when handling the two consecutive connection request[backport 5.0]

See merge request espressif/esp-idf!22721
2023-03-13 15:07:03 +08:00
46e7347177 bt:Added a parameter to tell the user the result of the pass through command implementation 2023-03-13 15:03:55 +08:00
15b160ae55 Merge branch 'bugfix/remove_Wno_format_in_bluedroid_bt_examples_v5.0' into 'release/v5.0'
bt: Remove `-Wno-format` compile option for bluedroid classic bluetooth examples(v5.0)

See merge request espressif/esp-idf!21870
2023-03-13 14:29:25 +08:00
3d3df29792 Merge branch 'bugfix/wifi_enterprise_example_typo_v5.0' into 'release/v5.0'
esp_wifi: fix typo in wifi_enterprise example README (Backport v5.0)

See merge request espressif/esp-idf!22650
2023-03-13 14:06:12 +08:00
833f201610 soc/soc_caps: update soc caps for chips that support power-down of modem hardware 2023-03-13 13:33:18 +08:00
109d42bb85 fix HID Host bug when handling the two consecutive connection request
Closes https://github.com/espressif/esp-idf/issues/10504
2023-03-13 10:16:51 +08:00
7905aa2c27 Bugfix: Fix compile error with out of order designated initializer when using C++20 in ESP32 ULP ADC example 2023-03-11 14:42:18 +01:00
c24222dcde gptimer: fix race condition between start and stop
Added state transition in gptimer_start/stop functions.
So that it's not possible to make a stopped timer continue to run
because of race condition.
2023-03-11 11:42:09 +08:00
bf082dcd1c Merge branch 'bugfix/spram_and_virt_efuse_can_work' into 'release/v5.0'
esp_psram: Use efuse_ll instead of efuse API

See merge request espressif/esp-idf!22641
2023-03-11 00:00:08 +08:00
35068ee7b9 usb_host: add recovering interval after SetAddress(). Possibility to change constant delay value via menuconfig.
Closes https://github.com/espressif/esp-idf/issues/10444
Closes https://github.com/espressif/esp-idf/issues/10718
2023-03-10 12:40:01 +01:00
cad044a3b6 wpa_supplicant:Fix potential null pointer dereference 2023-03-10 16:00:55 +05:30
7999489c6e Combine improvements in sa query and buffer deauth, disassoc, action frames for connected station in sleep mode 2023-03-10 16:00:55 +05:30
1ea59bd351 Merge branch 'bugfix/spp_server_doc_v5.0' into 'release/v5.0'
SPP server documentation fix (v5.0)

See merge request espressif/esp-idf!22678
2023-03-10 17:22:53 +08:00
57b26802a5 bt: fix Bluedroid compile errors after enable CONFIG_ESP_SYSTEM_USE_EH_FRAME on RISC-V SoCs
This root cause is incorrect source code separation by conditonal MACROs for BLE L2CAP COC related functions
2023-03-10 07:37:24 +00:00
89f4ed527e Nimble:Added power control API usage demo in blecent app 2023-03-10 12:59:11 +05:30
ac0237670b Merge branch 'bugfix/fixed_wrong_sdm_struct_sequence_v5.0' into 'release/v5.0'
sdm: fixed potential memory leak (v5.0)

See merge request espressif/esp-idf!22648
2023-03-10 15:19:22 +08:00
83e7710c2e Merge branch 'bugfix/fix_build_issue_esp_tls_server_session_tickets_v5.0' into 'release/v5.0'
esp-tls: Fix build issue when esp-tls server session tickets have been enabled. (v5.0)

See merge request espressif/esp-idf!22660
2023-03-10 13:49:40 +08:00
963a8b1c57 esp_psram: Use efuse_ll instead of efuse API
When the virt efuse mode is on and psram is on as well
then efuse buffer is not filled by efuses (it is filled by 0).
So the psram init func gets wrong pkg_ver = 0.

Closes https://github.com/espressif/esp-idf/issues/10925
Close IDFGH-9576
2023-03-10 05:14:50 +00:00
a6b190c083 sdm: fixed potential memory leak 2023-03-10 03:48:27 +00:00
6692a1346b esp-tls: Fix build issue when esp-tls server session tickets have been enabled.
Closes https://github.com/espressif/esp-idf/issues/10765
2023-03-10 03:46:19 +00:00
319208c3d1 Merge branch 'bugfix/clang_tidy_and_nvs_memory_issue' into 'release/v5.0'
clang tidy add C++ and nvs memory issue (backports 5.0)

See merge request espressif/esp-idf!22666
2023-03-10 11:42:02 +08:00
045ad4638e Merge branch 'feature/memprot_test_app_v5.0' into 'release/v5.0'
memprot: Fix incorrect faulting address reported for esp32c3 & esp32s3 (v5.0)

See merge request espressif/esp-idf!22582
2023-03-10 11:27:01 +08:00
f31e3c1046 Merge branch 'fix/esp32_hw_mpi_data_corruption_v5.0' into 'release/v5.0'
esp32/mpi: Added alternate workaround for MPI data corruption issue (v5.0)

See merge request espressif/esp-idf!22581
2023-03-10 11:17:31 +08:00
72d59d1ced ci: add .cpp and .hpp files, but ignore nvs_storage.cpp
* nvs_storage.cpp seems to produce a false positive
2023-03-09 17:38:53 +08:00
0a47d78680 Doc : SPP server documentation fix
Closes https://github.com/espressif/esp-idf/issues/10930
2023-03-09 11:58:14 +05:30
e9092c2d2d Merge branch 'feature/support_ble_write_and_notify_throughput_test_at_the_same_time_v5.0' into 'release/v5.0'
support ble write and notify throughput test at the same time (backport v5.0)

See merge request espressif/esp-idf!22143
2023-03-09 11:38:15 +08:00
2a804de4b7 Merge branch 'staging/rename_twdt_config_examples_v5.0' into 'release/v5.0'
TWDT: Use the new TWDT Kconfig options in the examples and tests (Backport v5.0)

See merge request espressif/esp-idf!22631
2023-03-08 16:09:58 +08:00
e111b46e7d esp_wifi: fix typo in wifi_enterprise example README
Closes https://github.com/espressif/esp-idf/issues/10042
2023-03-08 13:18:24 +05:30
0eddee63e8 bugfix(nvs_flash): fixed potential memory leak in nvs::Storage::init() 2023-03-08 14:13:11 +08:00
416ada0ce1 Merge branch 'refactor/nvs_allocatable_objects_v5.0' into 'release/v5.0'
refactor(nvs): custom allocator for all objects allocated in NVS (v5.0)

See merge request espressif/esp-idf!21792
2023-03-07 14:15:49 +08:00
a77d7d2343 Merge branch 'bugfix/timg0_disable_v5.0' into 'release/v5.0'
esp_system: Fix TIMG0 still enabled after Timer is freed (v5.0)

See merge request espressif/esp-idf!22630
2023-03-07 11:56:50 +08:00
83907aaa20 TWDT: Use the new TWDT Kconfig options in the examples and tests 2023-03-07 10:23:43 +08:00
2b6576ff08 Merge branch 'bugfix/some_small_fix_for_sleep_examples_backport_v5.0' into 'release/v5.0'
examples: some small fix for sleep examples(backport v5.0)

See merge request espressif/esp-idf!22618
2023-03-07 10:20:02 +08:00
4cd4762b1f Merge branch 'bugfix/return_error_when_fail_detect_oct_psram_v5.0' into 'release/v5.0'
esp_psram: return error when fail to detect oct psram (v5.0)

See merge request espressif/esp-idf!22612
2023-03-07 10:18:28 +08:00
aab0a5a4a8 esp_system: Fix TIMG0 still enabled after Timer is freed
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 10:02:06 +08:00
24484887a9 esp_system: Ensure TIMG0 clock is always enabled during normal operation
If the TimerGroup 0 clock is disabled and then reenabled, the watchdog
registers (Flashboot protection included) will be re-enabled, and some
seconds later, will trigger an unintended reset.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2023-03-07 10:02:06 +08:00
a2dd95434f memprot: Fix incorrect faulting address reported for esp32c3 & esp32s3
Co-authored-by: Mahavir Jain <mahavir@espressif.com>
2023-03-06 12:39:12 +00:00
6b397d5114 Merge branch 'contrib/github_pr_10640_v5.0' into 'release/v5.0'
hal/uart_ll.h: Fix compile with C++ (ESP32-S3/H2) (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22588
2023-03-06 15:35:24 +08:00
d53d4ec930 esp32/mpi: Added alternate workaround for MPI data corruption issue
- Use DPORT_WRITE_REG (volatile writes) wrappers to write to the
  MPI peripheral
- Updated the previous workaround added for the same issue as it
  was failing in some long runs and with `COMPILER_OPTIMIZATION_PERF`
  enabled.
- The test performance numbers had to be updated due to the
  performance penalty introduced by this fix.

Closes https://github.com/espressif/esp-idf/issues/10403
2023-03-06 06:43:17 +00:00
cb64ff74fc system/test: use TEST_ESP_OK instead of ESP_ERROR_CHECK 2023-03-06 11:56:56 +08:00
38c25ebceb konfig: make rtc fast mem related kconfig depend on SOC_RTC_FAST_MEM_SUPPORTED 2023-03-06 11:53:35 +08:00
5d6c050376 examples/wifi/power_save: use 1000Hz freertos tick to lower sleep time threshold 2023-03-06 11:51:55 +08:00
63db044e9c esp32c2/ci: reenable deep sleep example test 2023-03-06 11:51:41 +08:00
c6fbdb4acb examples/system/deep_sleep:
Use nvs instead of RTC_DATA_ATTR to record deep sleep enter time when
the target chip does not have rtc mem.
2023-03-06 11:46:56 +08:00
a7be8fddcb examples/system/light_sleep:
Add some hints in README to remind users that they can try to power down
the CPU and SPI Flash for lower power consumption.
2023-03-06 11:46:37 +08:00
639e49d157 gpio: add a test case to test the ability of disabling USB D+ pin pull-up 2023-03-06 11:14:05 +08:00
753ed2697f esp_psram: return error when fail to detect oct psram 2023-03-06 10:56:28 +08:00
2b14b7d061 Merge branch 'contrib/github_pr_10402_v5.0' into 'release/v5.0'
ledc: move callback to IRAM as it's called from an ISR (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22590
2023-03-06 10:14:58 +08:00
7ea24f38a7 Merge branch 'refactor/move_rom_test_to_fpga_only_v5.0' into 'release/v5.0'
esp_rom: miniz test only on FPGA (backport 5.0)

See merge request espressif/esp-idf!22601
2023-03-06 09:15:54 +08:00
6f74272d56 Merge branch 'contrib/github_pr_10856_v5.0' into 'release/v5.0'
Correct typo in referenced function name (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22587
2023-03-05 23:42:37 +08:00
2aed3d6056 Merge branch 'contrib/github_pr_10334_v5.0' into 'release/v5.0'
Set errno in adjtime (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22598
2023-03-05 21:37:45 +08:00
20db248fb2 cxx: removed cxx experimental components 2023-03-05 10:23:28 +01:00
f177b2c6c6 uart: Fix two TX concurrency issues
1. Concurrency might cause ESP_ERR_TIMEOUT when calling uart_wait_tx_done
2. Concurrency might cause RTS line being de-assreted during tx transmission for rs485 mode
2023-03-03 19:18:08 +08:00
aa496e6550 Set errno in adjtime if delta is too large
errno should be set to EINVAL in this case according to adjtime's man
page.
2023-03-03 18:15:27 +08:00
f2c8de6b1b Set errno in adjtime if newlib time funcs are not implemented
Other time functions (e.g. settimeofday) set errno to ENOSYS if
IMPL_NEWLIB_TIME_FUNCS is not set.
adjtime should probably do the same.
2023-03-03 18:15:26 +08:00
1581c494d3 refactor(esp_rom): miniz test only on FPGA now 2023-03-03 18:15:06 +08:00
62e1e2500c spi_slave: fix io re-config issue 2023-03-03 17:56:23 +08:00
bdffb4403d ledc: Add check for whether the registered callback is in iram in ledc_cb_register 2023-03-03 17:21:56 +08:00
c3db512280 ledc: move callback to IRAM, it's called from an ISR 2023-03-03 17:21:56 +08:00
9d34501ad1 hal/uart_ll.h: Fix compile issue with C++
Merges https://github.com/espressif/esp-idf/pull/10640
2023-03-03 16:50:26 +08:00
701780891c uart: Correct typo in referenced function name
The functions `uart_enable_pattern_det_intr` have been renamed to `uart_enable_pattern_det_baud_intr`, but a reference to these functions in the programming guide was not updated.

Merges https://github.com/espressif/esp-idf/pull/10856
2023-03-03 16:45:17 +08:00
11c59a2e69 Merge branch 'bugfix/fix_psram_kconfig_help_v5.0' into 'release/v5.0'
psram: removed deprecated statement about coredump and external BSS (backport v5.0)

See merge request espressif/esp-idf!22562
2023-03-03 13:35:30 +08:00
7d7196d2d2 Merge branch 'ci/add_generic_to_xtal_26mhz_runners_5.0' into 'release/v5.0'
Ci: add generic to xtal 26mhz runners 5.0

See merge request espressif/esp-idf!21756
2023-03-02 17:17:47 +08:00
0a5ed6ff9c Merge branch 'bugfix/fix_btld_app_overlap_c2_v5.0' into 'release/v5.0'
ld: fixed bootloader and app potential overlap issue (v5.0)

See merge request espressif/esp-idf!22569
2023-03-02 15:26:02 +08:00
2b5f1140dd Nimble: Added return value (success / failure ) to nimble_port_init 2023-03-02 09:47:03 +05:30
28c325b291 refactor(nvs): custom allocator for all objects allocated in NVS 2023-03-02 10:49:53 +08:00
fbe7d6fca9 ld: fixed bootloader and app potential overlap issue 2023-03-02 10:45:40 +08:00
3c58ca9285 CI: optimize test case test_examples_protocol_socket_tcpserver 2023-03-01 22:40:34 +08:00
a62e103109 CI: add example adc tests 2023-03-01 22:40:34 +08:00
c8e7ab7f17 CI: add generic to xtal_40mhz jobs 2023-03-01 22:40:32 +08:00
21b42ce760 Merge branch 'bugfix/fix_adc_pm_lock_release_issue_v5.0' into 'release/v5.0'
esp_adc: fix continuous mode pm lock release fail issue and add tests (v5.0)

See merge request espressif/esp-idf!22551
2023-03-01 22:35:22 +08:00
e4c94328b9 psram: removed deprecated statement about coredump and external BSS 2023-03-01 19:02:24 +08:00
850ac2c037 Merge branch 'docs/fix_errors_in_esp32-c3-devkitm-1_pin_list_v5.0' into 'release/v5.0'
Docs/Fix Errors in ESP32-C3-DevKitM-1 Pin List (v5.0)

See merge request espressif/esp-idf!22487
2023-03-01 18:41:22 +08:00
e24ae3bb21 mqtt/docs: Mention removal of user_context in 5.x migration guide
update CN for migration-guides/release-5.x/5.0/protocols.rst
Co-Authored-By: Wang Zi Yan <wangziyan@espressif.com>

Closes https://github.com/espressif/esp-idf/issues/10644
2023-03-01 08:22:56 +01:00
aa3cc6ac17 esp_adc: fix continuous mode pm lock release fail issue and add tests
Closes https://github.com/espressif/esp-idf/issues/10853
2023-03-01 10:51:19 +08:00
564b94fe5b Merge branch 'feature/esp32c2_optimize_npl_api_v5.0' into 'release/v5.0'
Optimized NPL Freertos API

See merge request espressif/esp-idf!21906
2023-02-28 20:51:49 +08:00
d759ee5aea Merge branch 'touch_sensor/update_touch_sensor_examples_v5.0' into 'release/v5.0'
touch: update examples and tests (v5.0)

See merge request espressif/esp-idf!19725
2023-02-28 19:55:27 +08:00
d56a6e1691 Merge branch 'fix/http_client_disable_auto_redirect_causes_loop_v5.0' into 'release/v5.0'
http_client: fixed looping caused when disable_auto_redirect enabled (v5.0)

See merge request espressif/esp-idf!22536
2023-02-28 19:54:31 +08:00
af1f67424c Nimble:Re-run ext adv after completion 2023-02-28 17:22:03 +05:30
008a4dc54e Merge branch 'bugfix/peer_dev_rec_add_and_clear_issue_v5.0' into 'release/v5.0'
NimBLE: Fix incomplete clearing of peer_dev_rec (v5.0)

See merge request espressif/esp-idf!21952
2023-02-28 14:20:48 +08:00
f39f6011f5 http_client: fixed looping caused when disable_auto_redirect enabled
Closes https://github.com/espressif/esp-idf/issues/10629
2023-02-28 10:29:24 +05:30
zwl
3eb8a9cf1e ble: Fixed flow control count error on ESP32-C2 2023-02-27 21:48:19 +08:00
61c3b96957 Fixed vulnerability attacks that could cause heap overflow in fragmented Blufi packet processing 2023-02-27 13:01:13 +00:00
1a9300af1f support ble notify and write throughput test at the same time 2023-02-27 13:01:13 +00:00
ca0623e311 Merge branch 'bugfix/freertos_stream_buffer_test_v5.0' into 'release/v5.0'
FreeRTOS: Fix stream buffer send-receive test (v5.0)

See merge request espressif/esp-idf!22507
2023-02-27 19:02:04 +08:00
fd707e1d03 Merge branch 'bugfix/twai_listen_only_errata_v5.0' into 'release/v5.0'
twai: Add errata workaround for listen only mode (v5.0)

See merge request espressif/esp-idf!22514
2023-02-27 18:13:11 +08:00
0fce029b92 [esp32c2] Fixed the occasional assertion when deinit the ble controller 2023-02-27 16:56:05 +08:00
zwl
7b28d40c0a ble:Fixed issues of adv error stop and abnormal reporting of connection update complete event on ESP32-C2 2023-02-27 16:56:05 +08:00
zwl
530c07a5be Optimized NPL Freertos API 2023-02-27 16:56:05 +08:00
ace6a3b4bb NimBLE: Fix incomplete clearing of peer_dev_rec 2023-02-27 14:21:57 +05:30
9a3c8a6567 Merge branch 'bugfix/change_position_of_vendor_model_and_gen_onoff_model_callback_forv5.0' into 'release/v5.0'
ble_mesh:example:change position of vendor model and generic onoff model callback(v5.0)

See merge request espressif/esp-idf!21798
2023-02-27 15:13:27 +08:00
a9af2080e4 Merge branch 'bugfix/fix_ext_adv_compilation_issue_v5.0' into 'release/v5.0'
Nimble: Fix compilation issue for examples for esp32c6 and esp32h4 (v5.0)

See merge request espressif/esp-idf!22066
2023-02-27 15:12:48 +08:00
4abb6efb36 Merge branch 'bugfix/fix_gpio_wakeup_related_issues_in_ssc_sleep_test_backport_v5.0' into 'release/v5.0'
sleep: fix gpio wakeup related issues(backport v5.0)

See merge request espressif/esp-idf!22332
2023-02-27 15:12:13 +08:00
b29c869698 Merge branch 'bugfix/fix_assert_pcl_bleprph_example_v5.0' into 'release/v5.0'
Nimble: Fix runtime assertion in bleprph due to two disconnect events (v5.0)

See merge request espressif/esp-idf!22212
2023-02-27 15:11:51 +08:00
5ca38da869 Merge branch 'bugfix/remove_global_min_max_def_v5.0' into 'release/v5.0'
Nimble: Removes global min/max definition causing problems with other libraries (v5.0)

See merge request espressif/esp-idf!21817
2023-02-27 15:11:28 +08:00
d4eebd5e80 Merge branch 'bugfix/update_ble_l2cap_coc_example_v5.0' into 'release/v5.0'
Nimble: Updated ble_l2cap_coc example (v5.0)

See merge request espressif/esp-idf!22064
2023-02-27 15:10:57 +08:00
1f73b5e4cd Merge branch 'bugfix/wps_start_state_issue_v5.0' into 'release/v5.0'
esp_wifi: Add check for wps start state (v5.0)

See merge request espressif/esp-idf!22025
2023-02-27 15:10:01 +08:00
809aeb77b7 Merge branch 'bugfix/update_esp_rom_rtc_header_v5.0' into 'release/v5.0'
update esp rom rtc header (backport to v5.0)

See merge request espressif/esp-idf!21915
2023-02-27 15:09:19 +08:00
2ab97d57f9 Merge branch 'bugfix/fixed_hci_uart_flow_ctrl_error_on_esp32c2_v5.0' into 'release/v5.0'
Bugfix/fixed hci uart flow ctrl error on esp32c2 v5.0

See merge request espressif/esp-idf!21887
2023-02-27 15:08:28 +08:00
5fca58742e Merge branch 'doc/update_wifi_amsdu_docs_v5.0' into 'release/v5.0'
doc: update wifi amsdu docs(Backport v5.0)

See merge request espressif/esp-idf!21751
2023-02-27 15:07:58 +08:00
7c20c3742d Merge branch 'bugfix/fix_the_bluedroid_hci_crash_on_esp32c2' into 'release/v5.0'
Fixed the bluedroid hci crash due to insufficient memory on ESP32C2

See merge request espressif/esp-idf!22056
2023-02-27 15:07:31 +08:00
3132e45747 Merge branch 'bugfix/remove_-Wno-formate_in_mesh_example_v5.0' into 'release/v5.0'
wifi_mesh: Remove-Wno-format compile option for mesh examples(Backport v5.0)

See merge request espressif/esp-idf!22254
2023-02-27 15:07:15 +08:00
224b3203e9 Merge branch 'bugfix/remove_-Wno-formate_in_wifi_example_v5.0' into 'release/v5.0'
esp_wifi: Remove -Wno-format compile option for FTM example, iperf example, roaming example(Backport v5.0)

See merge request espressif/esp-idf!21779
2023-02-27 15:07:05 +08:00
8a83241c49 Merge branch 'bugfix/spp_clear_conn_array_v5.0' into 'release/v5.0'
Bluetooth/NimBLE : Fixed clearing connection_handle[] after disconnect event (v5.0)

See merge request espressif/esp-idf!22272
2023-02-27 15:06:49 +08:00
335ad04cba Merge branch 'feature/support_feature_depend_on_rtc_fast_mem_for_esp32c2_backport_v5.0' into 'release/v5.0'
esp32c2: support feature(rtc time) depend on rtc fast mem(backport v5.0)

See merge request espressif/esp-idf!22224
2023-02-27 15:06:31 +08:00
f39c3b286c Merge branch 'bugfix/coex_enable_disable_not_in_pairs_v5.0' into 'release/v5.0'
bluetooth: fix that functions "coex_enable" and "coex_disable" are not used in pairs(backport v5.0)

See merge request espressif/esp-idf!22094
2023-02-27 15:05:49 +08:00
4cc03645e8 Merge branch 'bugfix/fix_some_ble_bug_v5.0' into 'release/v5.0'
Fixed some BLE bugs (backport v5.0)

See merge request espressif/esp-idf!22363
2023-02-27 15:05:38 +08:00
3bc9260dea Merge branch 'support/release_v5.0_fix_h2_phy_init_when_sw_restart' into 'release/v5.0'
esp_phy: fix phy init when SW restart(backport 5.0)

See merge request espressif/esp-idf!22309
2023-02-27 15:04:02 +08:00
de865b8973 Merge branch 'docs/ulp_docs_incorrect_notes_v5.0' into 'release/v5.0'
docs: Ulpdated ULP docs to have the correct notes directive (v5.0)

See merge request espressif/esp-idf!22509
2023-02-27 09:42:44 +08:00
491800f144 Merge branch 'refactor/resolve_mmu_soc_dependency_to_sdkconfig_h_v5.0' into 'release/v5.0'
g0: resolve MMU_PAGE_SIZE not defined in g0 build issue (v5.0)

See merge request espressif/esp-idf!22488
2023-02-25 17:30:47 +08:00
3318fac02f twai: Add errata workaround for listen only mode
This commit adds a workaround for the TWAI listen only mode errata which is
present on the ESP32, ESP32-S2, ESP32-S3, and ESP32-C3. twai_get_status_info()
has also been updated to account for the fact that TEC/REC are frozen in
listen only mode.

Errata Description:

When the TWAI controller is put into listen only mode, it should not influence
the TWAI bus in any way (i.e., should never send a dominant bit). However,
on the targets listed above, the TWAI controller will send dominant bits in an
error frame (i.e., active error frame), even if the controller is set to listen
only mode.

Workaround:

We can force the TWAI controller into the error passive state on startup (by
setting the REC to >= 128). Since the TEC/REC are frozen in listen only mode,
the TWAI controller will remain error passive and only send recessive bits
(i.e., passive error frames), thus will not influence the TWAI bus.

Closes https://github.com/espressif/esp-idf/issues/9157
2023-02-24 19:26:22 +08:00
da46d216df Merge branch 'bugfix/correct_ext_mem_defs_for_internal_ram_v5.0' into 'release/v5.0'
soc: update iram/dram addr range in ext_mem_defs.h (v5.0)

See merge request espressif/esp-idf!22489
2023-02-24 18:35:50 +08:00
4b75883ea4 docs: Ulpdated ULP docs to have the correct notes directive
This commit updates the ULP .rst files to have the correct notes
directive format. The notes directives were missing a colon.
2023-02-24 11:22:48 +01:00
3623dc0fce freertos: Fix stream buffer send-receive test
The stream buffer send-receive test preivously contained the following bugs:

- "sender" task would send 101 bytes instead of 100
- The main task would return before "sender" task sends its 101st item. Thus
  the sender task would cause memory corruption when accessing "tc" structure
  allocated on the main task's stack

This commit fixes and simplifies the stream buffer test.
2023-02-24 16:24:25 +08:00
53c66a6dae Merge branch 'fix/heap-get-allocated-size_v5.0' into 'release/v5.0'
heap: Fix erroneous value returned by heap_caps_get_allocated_size() when poisoning is enabled (backport v5.0)

See merge request espressif/esp-idf!22187
2023-02-24 11:05:41 +08:00
bbda601f62 Merge branch 'docs/support_for_pre_calculated_signatures_v5.0' into 'release/v5.0'
docs: Added documetation for using pre-calculated signatures (v5.0)

See merge request espressif/esp-idf!21855
2023-02-23 22:07:47 +08:00
22a45d2a09 Merge branch 'feature/add_ws_auth_5.0' into 'release/v5.0'
tcp_transport: Add authorization header for websocket client (v5.0)

See merge request espressif/esp-idf!22438
2023-02-23 16:51:07 +08:00
97c8f15e48 docs: Added documentation for using pre-calculated signatures
to generate secure boot enabled binaries.
2023-02-23 11:54:22 +05:30
866d727477 soc: remove unused macro in ext_mem_defs.h
ESP_CACHE_TEMP_ADDR is not used in IDF
2023-02-23 12:40:43 +08:00
86b331b40f soc: update iram/dram addr range in ext_mem_defs.h
IRAM0/DRAM0 addr range update, on s3, c3, c2, h4, c6:

IRAM0_ADDRESS_LOW ~ IRAM0_ADDRESS_HIGH
DRAM0_ADDRESS_LOW ~ DRAM0_ADDRESS_HIGH

now are for the real IRAM0 and DRAM0
2023-02-23 12:39:54 +08:00
ac86ef31c1 g0: resolve MMU_PAGE_SIZE not defined in g0 build issue 2023-02-23 12:35:52 +08:00
9ebe3fbfc1 docs/fix_errors_in_esp32-c3-devkitm-1_pin_list 2023-02-23 11:52:13 +08:00
c120f5777e tcp_transport: Add authorization header for websocket client 2023-02-22 16:19:41 +04:00
4c606d3381 Merge branch 'feature/websocket-client-errorhandlin_v5.0' into 'release/v5.0'
[ws_transport]-Added `esp_transport_ws_get_upgrade_request_status` API (v5.0)

See merge request espressif/esp-idf!22360
2023-02-22 19:46:47 +08:00
2ea046c091 heap: Fix erroneous value returned by heap_caps_get_allocated_size() when poisoning is enabled
When light (or comprehensive) poisoning is enabled, the size requested by the user for allocation
is extended by a few bytes to store the canary header and footer. heap_caps_get_allocated_size() should
return the original size asked by the user (without the additional canary bytes).

test_malloc.c extended with a new test assuring that  heap_caps_get_allocated_size() returns the proper size
regardless of the degree of poisoning.
2023-02-22 11:42:02 +01:00
498dc8d09d Merge branch 'bugfix/nvs_cxx_example_v5.0' into 'release/v5.0'
nvs_flash: fixed wrong error check after open_nvs_handle in example (v5.0)

See merge request espressif/esp-idf!22303
2023-02-22 16:39:13 +08:00
3a6e2021ff Remove compile option for bluedroid classic bluetooth examples 2023-02-22 11:23:12 +08:00
57d113bdd2 Merge branch 'example/opt_a2dp_gatts_coex_example_v5.0' into 'release/v5.0'
rebase a2dp_gatts_coex to latest a2dp_sink (v5.0)

See merge request espressif/esp-idf!22003
2023-02-22 11:03:02 +08:00
6b08f05282 Merge branch 'bugfix/rmt_buffer_allocation_v5.0' into 'release/v5.0'
legacy rmt driver: fix wrong buffer allocation (v5.0)

See merge request espressif/esp-idf!22429
2023-02-22 10:23:38 +08:00
38da5115cb Merge branch 'docs/refactor_secure_boot_v2_documentation_v5.0' into 'release/v5.0'
docs: refactored Secure Boot V2 documentation (v5.0)

See merge request espressif/esp-idf!22341
2023-02-21 22:08:44 +08:00
60087c0b22 rebase a2dp_gatts_coex to latest a2dp_sink 2023-02-21 10:58:51 +00:00
3d80d4b795 Merge branch 'bugfix/sdp_event_status_overwritten_by_handle_v5.0' into 'release/v5.0'
bt: Fixed SDP BTA_SDP_REMOVE_RECORD_USER_EVT event status overridden by handle

See merge request espressif/esp-idf!22213
2023-02-21 18:21:33 +08:00
8439e6184c Merge branch 'bugfix/build_err_with_ssr_enabled_v5.0' into 'release/v5.0'
bt: Fixed build errors when sniff subrating is enabled (v5.0)

See merge request espressif/esp-idf!22350
2023-02-21 18:20:06 +08:00
11c65947d8 Merge branch 'bugfix/access_nullptr_when_ble_disconn_v5.0' into 'release/v5.0'
Bugfix/Fixed crash caused by accessing nullptr in `btm_acl_disconnected` (v5.0)

See merge request espressif/esp-idf!21879
2023-02-21 18:18:48 +08:00
b94db7a64e Merge branch 'bugfix/blufi_notify_v5.0' into 'release/v5.0'
BluFi : Fixed hdr getting free twice (v5.0)

See merge request espressif/esp-idf!22448
2023-02-21 18:17:50 +08:00
84d6cce56e Merge branch 'docs/fix_typo_peripherals_gpio' into 'release/v5.0'
docs:fix a typo in api-reference/peripherals/gpio

See merge request espressif/esp-idf!22432
2023-02-21 16:04:00 +08:00
049cffcb2a BluFi : Fixed hdr getting free twice
Closes IDFGH-9378
2023-02-21 11:44:12 +05:30
481cca3490 [ws_transport] - Added esp_transport_ws_get_upgrade_request_status API 2023-02-20 14:12:48 +00:00
82458fd31d Merge branch 'bugfix/extram_stack_coredump_v5.0' into 'release/v5.0'
coredump: add support for stacks in external RAM (backport v5.0)

See merge request espressif/esp-idf!22410
2023-02-20 20:32:19 +08:00
86a75d1d73 Merge branch 'feature/gdbstub_esp32c2_v5.0' into 'release/v5.0'
gdb stub: re-enable for ESP32-C2 (v5.0)

See merge request espressif/esp-idf!21770
2023-02-20 17:13:37 +08:00
892f6fa695 docs:fix a typo in api-reference/peripherals/gpio 2023-02-20 16:12:25 +08:00
18bda1be31 Merge branch 'feature/re-enable-heap-test-c2_v5.0' into 'release/v5.0'
heap: re-enable temporarily disabled test on esp32c2 (backport v5.0)

See merge request espressif/esp-idf!21873
2023-02-20 15:34:16 +08:00
fc3f49d589 Merge branch 'docs/freertos_doc_organization_v5.0' into 'release/v5.0'
Docs: Update FreeRTOS documentation organization for IDF and Amazon SMP FreeRTOS (v5.0)

See merge request espressif/esp-idf!22395
2023-02-20 15:26:23 +08:00
5b718a81a0 Merge branch 'feat/verbose-alloc-failure-abort_v5.0' into 'release/v5.0'
heap: print size and caps when malloc fails before calling system abort (backport v5.0)

See merge request espressif/esp-idf!22343
2023-02-20 15:17:51 +08:00
47bc882caa Merge branch 'feature/re-enable-intr-alloc-test-c2_v5.0' into 'release/v5.0'
esp-hw-support: Re-enable intr_alloc tests on esp32c2 target (backport v5.0)

See merge request espressif/esp-idf!21874
2023-02-20 15:16:36 +08:00
bca7446a53 Merge branch 'bugfix/ulp_riscv_i2c_example_crashes_on_s2_v5.0' into 'release/v5.0'
ulp-riscv: ULP RISC-V I2C example gets stuck on esp32s2 (v5.0)

See merge request espressif/esp-idf!21860
2023-02-20 15:14:56 +08:00
b731bd6a60 rmt: fix rmt buffer allocation issue 2023-02-20 15:12:30 +08:00
d33d3d7884 Merge branch 'feature/re-enable-newlib-test-c2_v5.0' into 'release/v5.0'
newlib: Remove tests using RTC related features from the esp32c2 test set (backport v5.0)

See merge request espressif/esp-idf!21878
2023-02-20 15:11:16 +08:00
1a98df0c93 bugfix(nvs_flash): fixed wrong error check after open_nvs_handle
Closes https://github.com/espressif/esp-idf/issues/10240
2023-02-20 14:20:18 +08:00
f58f8116de Merge branch 'feature/adc_calibration_c2_v5.0' into 'release/v5.0'
esp_adc: support adc calibration on esp32c2 (v5.0)

See merge request espressif/esp-idf!22382
2023-02-20 14:13:23 +08:00
41bf6dab0d Merge branch 'bugfix/newlib_tz_env_mutex_v5.0' into 'release/v5.0'
newlib: Use correct recursive mutex for env and regular mutex for tz (v5.0)

See merge request espressif/esp-idf!22293
2023-02-20 13:04:17 +08:00
5400061f6a Merge branch 'docs/elm_chan_broken_link_v5.0' into 'release/v5.0'
docs: fix broken link in fatfs doc (v5.0)

See merge request espressif/esp-idf!22297
2023-02-20 12:21:28 +08:00
962d716456 Merge branch 'bugfix/secure_boot_v2_part_size_check_v5.0' into 'release/v5.0'
gen_esp32part: allow secure boot v2 based app partition size 4K aligned (v5.0)

See merge request espressif/esp-idf!22284
2023-02-20 12:19:38 +08:00
03a4f75f98 Merge branch 'docs/fix_broken_link_format_v5.0' into 'release/v5.0'
docs: fix rst external links with wrong format (v5.0)

See merge request espressif/esp-idf!22336
2023-02-20 11:20:42 +08:00
1990335623 Merge branch 'bugfix/fix_adc_channel_h_not_aligned_to_ng_driver_issue_v5.0' into 'release/v5.0'
adc: make adc_channel.h macros work with ng driver (v5.0)

See merge request espressif/esp-idf!22020
2023-02-20 11:08:42 +08:00
ef4280c3f5 Merge branch 'docs/make_s3_octal_flash_error_handling_clearer_v5.0' into 'release/v5.0'
docs: make s3 octal flash error handling clearer (v5.0)

See merge request espressif/esp-idf!22269
2023-02-20 11:07:13 +08:00
d101d9c100 esp_adc: update license 2023-02-20 10:34:34 +08:00
0f49c8677b include inttypes.h 2023-02-20 10:34:34 +08:00
f3ee3b68bf esp_adc: defined an example macro for attenuation 2023-02-20 10:34:34 +08:00
22431bc41b doc: make adc wifi hardware limitation visible on esp32 2023-02-20 10:34:34 +08:00
45776dc0cc esp_adc: add esp32c2 adc high/low test threshold and expected val 2023-02-20 10:34:34 +08:00
ed98062c66 esp_adc: refacotr tests for all supported attenuations 2023-02-20 10:34:34 +08:00
a03ca90d4a esp_adc: replace hardcoded calibration version to a macro
On esp32c3 and esp32s3, we support calibration version 1. This commit
replace it with ESP_EFUSE_ADC_CALIB_VER to avoid hardcode.
2023-02-20 10:34:34 +08:00
fe0643ca40 esp_adc: support adc calibration on esp32c2 2023-02-20 10:34:34 +08:00
70d62f5c85 efuse: added adc calibration efuse fields on esp32c2 2023-02-20 10:34:34 +08:00
d9992320c8 efuse: remove PVT_LOW field on esp32c2
PVT_LOW doesn't exist on ESP32C2
2023-02-20 10:34:33 +08:00
zlq
bd7bcbb03b 1.add ldo parameters in efuse table; 2.set ldo dbias based on pvt-efuse; 3.add pll cali stop function; 4. add efuse_ocode 2023-02-20 10:33:25 +08:00
dbb3830c44 Merge branch 'docs/ignore_isa_link_v5.0' into 'release/v5.0'
docs: ignore xtensa isa-summary during linkcheck (v5.0)

See merge request espressif/esp-idf!22145
2023-02-20 10:30:47 +08:00
b289b7a1f1 Merge branch 'feature/mbedtls-3.3.0_v5.0' into 'release/v5.0'
mbedtls: Update to v3.3.0 (v5.0)

See merge request espressif/esp-idf!22121
2023-02-19 14:41:06 +08:00
a823a4907f Merge branch 'bugfix/fix_return_value_in_httpd_socket_apis_v5.0' into 'release/v5.0'
esp_http_server: fix return values for `httpd_socket_send()` and `httpd_socket_recv()` APIs (v5.0)

See merge request espressif/esp-idf!22307
2023-02-19 12:10:36 +08:00
c71f9a3e1e Merge branch 'fix/stack-dram-memory-protection_v5.0' into 'release/v5.0'
heap: Modify the memory type of the memory used as startup stack when memory protection is enabled (backport v5.0)

See merge request espressif/esp-idf!22170
2023-02-19 11:57:54 +08:00
ca7045d904 protocomm: Fix test-app build for esp32c2 & esp32c6
- AES context has a breaking change, rather than storing
  round keys directly, it stores the offset at which the keys
  are present in the context buffer
2023-02-19 03:53:02 +00:00
db99f311fc mbedtls: Fix build with dynamic buffers feature 2023-02-19 03:53:02 +00:00
6384299167 wpa_supplicant: Update deprecated API (mbedtls_pkcs5_pbkdf2_hmac)
- The newer alternative does not require HMAC context for its
  operation
2023-02-19 03:53:02 +00:00
8b5ab6820f mbedtls: Update config options as per v3.3.0 release 2023-02-19 03:53:02 +00:00
88aa45ff17 mbedtls: Update to v3.3.0 2023-02-19 03:53:02 +00:00
e532de9aa5 partition_table: add tests for checking secure boot part size 2023-02-19 03:50:03 +00:00
33568182d4 gen_esp32part: allow secure boot v2 based app partition size 4K aligned
For Secure Boot v2 case, unsigned image is first padded to next 64K
aligned boundary and then a signature block of 4K gets appended. Thus
an app partition whose size is 4K aligned should be allowed here.

For Secure Boot v1 case, app partition size must be 64K aligned as the
signature block lies at the very end of 64K boundary.

Relevant:
57b601ab7f
2023-02-19 03:50:03 +00:00
dcae357500 Merge branch 'fix/hardware_ecc_port_v5.0' into 'release/v5.0'
mbedtls/ecp: Fix incorrect ECP parameter value

See merge request espressif/esp-idf!22112
2023-02-19 11:49:14 +08:00
395b682aa3 Merge branch 'fix/mbedtls_port_sanity_checks_and_return_values_v5.0' into 'release/v5.0'
mbedtls/port: refactor sanity checks and their return values (v5.0)

See merge request espressif/esp-idf!22127
2023-02-19 11:47:47 +08:00
4ec28232df Merge branch 'bugfix/i80_pll240_esp32s3_v5.0' into 'release/v5.0'
lcd: support PLL240M as i80 clock source on esp32s3 (v5.0)

See merge request espressif/esp-idf!22366
2023-02-18 20:45:13 +08:00
ce0316df99 lcd: support PLL240M as i80 clock source on esp32s3 2023-02-18 15:14:12 +08:00
f603aa7d76 Merge branch 'bugfix/i2s_update_regs_before_start_v5.0' into 'release/v5.0'
i2s: fixed rx update stuck bug (v5.0)

See merge request espressif/esp-idf!21776
2023-02-18 15:07:05 +08:00
db8b56c9ac Merge branch 'bugfix/fix_micro_error_SPI_HOST_MAX_v5.0' into 'release/v5.0'
spi: fix micro SPI_HOST_MAX error (v5.0)

See merge request espressif/esp-idf!22147
2023-02-18 15:06:35 +08:00
e892fa8cc5 Merge branch 'docs/adc_filter_migration_guide_v5.0' into 'release/v5.0'
adc: added adc filter migration guide (v5.0)

See merge request espressif/esp-idf!22349
2023-02-18 15:05:22 +08:00
3f68b61f3e Merge branch 'feature/mcpwm_non_varg_version_api_v5.0' into 'release/v5.0'
mcpwm: support non-vararg version of generator functions (v5.0)

See merge request espressif/esp-idf!21951
2023-02-18 15:04:17 +08:00
15471b450d Merge branch 'feature/mcpwm_cap_not_reset_io_at_exit_v5.0' into 'release/v5.0'
mcpwm: support not reset GPIO config at exit (v5.0)

See merge request espressif/esp-idf!22023
2023-02-18 15:03:13 +08:00
27ca6549d5 Merge branch 'bugfix/gdma_uhci_id_5.0' into 'release/v5.0'
gdma: correct the dma trigger of UHCI && fix async memcpy conflict with peripheral DMA (v5.0)

See merge request espressif/esp-idf!22006
2023-02-18 15:02:32 +08:00
10dd0cc4a1 Merge branch 'feature/rmt_no_light_sleep_lock_v5.0' into 'release/v5.0'
rmt: avoid auto light sleep when use xtal as the clock source (v5.0)

See merge request espressif/esp-idf!22053
2023-02-18 15:00:56 +08:00
92b1f4fa27 Merge branch 'bugfix/gptimer_pm_lock_xtal_5.0' into 'release/v5.0'
gptimer: acquire pm lock for xtal clock source (v5.0)

See merge request espressif/esp-idf!22281
2023-02-18 15:00:24 +08:00
9fb838c0b5 Merge branch 'bugfix/mcpwm_config_name_v5.0' into 'release/v5.0'
mcpwm: modify wrong config name (v5.0)

See merge request espressif/esp-idf!22385
2023-02-18 14:58:00 +08:00
8a6fb6df19 Merge branch 'feature/secure_features_are_enabled_correctly_v5.0' into 'release/v5.0'
security: Adds new APIs to check that all eFuse security features are enabled correctly (v5.0)

See merge request espressif/esp-idf!22116
2023-02-17 21:40:42 +08:00
08283c213b Merge branch 'feature/mac_crc_v5.0' into 'release/v5.0'
esp_hw_support(esp32): If the MAC_FACTORY CRC check fails, then INVALID_CRC instead of abort (v5.0)

See merge request espressif/esp-idf!22114
2023-02-17 21:36:59 +08:00
75b7202d71 Merge branch 'bugfix/usb_host_hub_enumeration_string_handling_v5.0' into 'release/v5.0'
USB Host: Fix string descriptor handling by the hub driver during enumeration (backport v5.0)

See merge request espressif/esp-idf!22324
2023-02-17 21:22:59 +08:00
d3b1ae10d8 Merge branch 'fix/lcd_spi_example_colors_v5.0' into 'release/v5.0'
examples/spi_lcd_touch: Fixed colors on ILI9341 (backport v5.0)

See merge request espressif/esp-idf!22049
2023-02-17 21:21:55 +08:00
6a86124ff5 Merge branch 'feature/usb_host_feature_and_refactor_backports_v5.0' into 'release/v5.0'
USB Host: Backport multiple feature and refactors to v5.0

See merge request espressif/esp-idf!21584
2023-02-17 20:49:46 +08:00
e68bc99347 Merge branch 'bugfix/esp_pm_and_sleep_build_errors_v5.0' into 'release/v5.0'
esp_system: Fix various PM and sleep build errors (v5.0)

See merge request espressif/esp-idf!21781
2023-02-17 20:49:22 +08:00
77480ea12b freertos: Update ESP-IDF FreeRTOS and FreeRTOS Additions documentation
This commit updates the ESP-IDF FreeRTOS and FreeRTOS Additions to account for
the fact that there are now two implementations of SMP FreeRTOS (i.e., IDF SMP
vs Amazon SMP).
2023-02-17 20:43:30 +08:00
b56f66d28d freertos: Update FreeRTOS overview document
This commit updates "freertos.rst" to act as an overview document of FreeRTOS
in ESP-IDF, outlining the different FreeRTOS implementations (IDF vs Amazon)
and various supplemental features. The details of each implementation will be
separated to their own documents.
2023-02-17 20:43:30 +08:00
fe11add262 freertos: Rename SMP changes document to ESP-IDF FreeRTOS
This commit renames "freertos-smp" docuemnt to "freertos_idf". This fits better
with the current dual FreeRTOS implementation (i.e., IDF FreeRTOS and Amazon
SMP FreeRTOS), both of which are SMP capable.
2023-02-17 20:43:30 +08:00
69dd34dfb6 Merge branch 'bugfix/rtc_8md256_deepsleep_time_esp32_v5.0' into 'release/v5.0'
pm: Fixed sleep time inaccurate bug when select 8MD256 as rtc slow clock on ESP32 (v5.0)

See merge request espressif/esp-idf!21821
2023-02-17 19:47:58 +08:00
d7cc519221 Merge branch 'fix/idf_tools_python_dir_change_v5.0' into 'release/v5.0'
Tools: Allow custom Python installation path with IDF_PYTHON_ENV_PATH (v5.0)

See merge request espressif/esp-idf!22392
2023-02-17 19:43:39 +08:00
6b1869b42c Merge branch 'bugfix/gdbinit_target_hoookpost_v5.0' into 'release/v5.0'
tools: fix idf.py gdb memory access before remote target is connected (v5.0)

See merge request espressif/esp-idf!22123
2023-02-17 19:43:08 +08:00
db7348e973 Merge branch 'bugfix/fix_windows_path_case_sensitivity_v5.0' into 'release/v5.0'
bugfix: Fix windows path case sensitivity (v5.0)

See merge request espressif/esp-idf!22075
2023-02-17 19:42:51 +08:00
b559e2ccb6 Merge branch 'fix/esp_local_ctrl_header_incl_v5.0' into 'release/v5.0'
esp_local_ctrl: Fix header inclusion (v5.0)

See merge request espressif/esp-idf!22134
2023-02-17 19:42:25 +08:00
e5f975c5cf Merge branch 'fix/revert-sdio-slave-gcc11-workaround_v5.0' into 'release/v5.0'
sdio_slave: fix strict aliasing violation for sdio_ringbuf_recv() (v5.0)

See merge request espressif/esp-idf!22404
2023-02-17 19:41:53 +08:00
ca16d12b22 Merge branch 'fix/tools_click_envvar_v5.0' into 'release/v5.0'
Tools: Improve idf.py error message when the argument value collides with the environment variable (v5.0)

See merge request espressif/esp-idf!21885
2023-02-17 19:41:39 +08:00
66f5a4a497 Merge branch 'fix/fix_incorrectly_defined_coredump_chip_ver' into 'release/v5.0'
espcoredump: fix incorrectly defined coredump chip version (v5.0)

See merge request espressif/esp-idf!21967
2023-02-17 19:41:07 +08:00
188f118c91 Merge branch 'bugfix/env_var_SDKCONFIG_DEFAULTS_fail_with_bootloader_subproject_v5.0' into 'release/v5.0'
build_system: stop looking for env var `SDKCONFIG_DEFAULTS` in bootloader subproject (v5.0)

See merge request espressif/esp-idf!21974
2023-02-17 19:39:16 +08:00
78638641a7 Merge branch 'contrib/github_pr_10378_v5.0' into 'release/v5.0'
Stop WiFi provisioning in the esp_event thread instead of creating new thread (GitHub PR) (v5.0)

See merge request espressif/esp-idf!22244
2023-02-17 19:36:06 +08:00
8ae1ed57d2 Merge branch 'feature/usb/update_tusb_backport_v5.0' into 'release/v5.0'
usb: Update TinyUSB version (backport v5.0)

See merge request espressif/esp-idf!22107
2023-02-17 19:35:23 +08:00
50336c9479 Merge branch 'doc_update_esp32c2_jtag_v5.0' into 'release/v5.0'
docs: JTAG debugging update for ESP32C2 (v5.0)

See merge request espressif/esp-idf!22133
2023-02-17 19:34:20 +08:00
0033b02ce5 Merge branch 'fix/efuse-function-declaration_v5.0' into 'release/v5.0'
efuse: fix esp_efuse_utility_write_reg() declaration (v5.0)

See merge request espressif/esp-idf!22086
2023-02-17 19:33:22 +08:00
d576146984 Merge branch 'bugfix/tools_json_riscv_gdb_targets_v5.0' into 'release/v5.0'
tools: fix RISC-V GDB not being installed for C2, H2 (v5.0)

See merge request espressif/esp-idf!21771
2023-02-17 19:32:24 +08:00
3e5ea5a941 Merge branch 'contrib/github_pr_10391_v5.0' into 'release/v5.0'
[Docs] specify Digital Signature byte order, and esp_ds_sign() clarification (GitHub PR) (v5.0)

See merge request espressif/esp-idf!21767
2023-02-17 19:30:58 +08:00
4fc89f445c Merge branch 'fix/protocomm_kconfig_flag_v5.0' into 'release/v5.0'
protocomm: Fix Kconfig flag dependency on wifi_provisioning component (v5.0)

See merge request espressif/esp-idf!22135
2023-02-17 19:26:12 +08:00
33ba447da4 Merge branch 'docs/fix_broken_link_in_mcpwm_API_reference_v5.0' into 'release/v5.0'
docs: fix a broken link in mcpwm of API reference (v5.0)

See merge request espressif/esp-idf!22374
2023-02-17 19:08:50 +08:00
38917a36b5 Merge branch 'feature/add_bootloader_sector_pad_option_v5.0' into 'release/v5.0'
esptool_py: Added a --pad-to-size flag to align the bootloader image (v5.0)

See merge request espressif/esp-idf!21916
2023-02-17 19:02:52 +08:00
18125ff7b7 coredump: add support for stacks in external RAM
Tasks having their stacks in SPIRAM can now be part of the coredump written to flash
2023-02-17 10:39:07 +08:00
886e98a2c1 Merge branch 'bugfix/support_coredump_stack_xtensa_v5.0' into 'release/v5.0'
coredump: custom core dump stack is now supported on Xtensa targets (backport v5.0)

See merge request espressif/esp-idf!21804
2023-02-17 10:35:35 +08:00
05086c446e Merge branch 'update/version_5_0_1' into 'release/v5.0'
Update version to 5.0.1

See merge request espressif/esp-idf!22394
2023-02-17 10:34:43 +08:00
7db42d3a40 sdio_slave: fix strict aliasing violation for sdio_ringbuf_recv()
This happened because of passing sdio_slave_hal_send_desc_t** to function
sdio_ringbuf_recv() which is declared to have char** as input parameter
2023-02-16 13:48:58 +07:00
4005886b8a Revert "sdio_slave: workaround the sdio_slave crash issue with release config + GCC11"
This reverts commit 19add3fb05.
2023-02-16 13:48:58 +07:00
99c6be712d ci: fix ci error 2023-02-16 10:55:50 +08:00
ac47b093f6 esp32c2/rtc: fix 8md256 as rtc slow clk not work properly during deep sleep 2023-02-16 10:55:50 +08:00
eb27e688fb UT/esp32c2: reenable pm and sleep related UT 2023-02-16 10:54:11 +08:00
2da8497358 UT/esp32c2: reenable rtc clk calibration compensation UT 2023-02-16 10:52:59 +08:00
e109c5f998 esp32c2: support rtc time feature depend on rtc memory, since c2 does not have rtc memory 2023-02-16 10:52:59 +08:00
a4afa44435 versions: Update version to 5.0.1 2023-02-15 12:30:03 +00:00
9b923dfd21 Merge branch 'ci/fix/isort_incompatible_with_py37_v5.0' into 'release/v5.0'
ci: fix isort py37 incompatible issue (v5.0)

See merge request espressif/esp-idf!22225
2023-02-15 20:25:28 +08:00
912c82fc5a freertos: Expand CONFIG_FREERTOS_SMP description
This commit adds more details to the CONFIG_FREERTOS_SMP option's description.
2023-02-15 20:16:55 +08:00
1feccdc414 Tools: Allow custom Python installation path with IDF_PYTHON_ENV_PATH
IDF_PYTHON_ENV_PATH is the path where the Python environment is created
and used. By default it is inside IDF_TOOLS_PATH. IDF_PYTHON_ENV_PATH
was exported by idf_tools.py but was not imported back. This fixes the
issue and ESP-IDF will honor the value of IDF_PYTHON_ENV_PATH.

Closes https://github.com/espressif/esp-idf/issues/10489
2023-02-15 12:15:46 +01:00
256dd53120 mcpwm: modify wrong config name 2023-02-15 17:55:55 +08:00
1b9df395b0 docs: fix a broken link in mcpwm of API reference 2023-02-15 11:04:01 +08:00
e6862798aa examples: fix ble address type of adv and scan params 2023-02-14 11:24:11 +08:00
58851cd5cd bluedroid: support ble privacy by controller 2023-02-14 11:24:02 +08:00
a13b89a043 bluedroid: add params in GATT connect event 2023-02-14 11:23:50 +08:00
78437f48ae update bt-lib for ESP32
fix ble disconnect due to channel map update instant passed
2023-02-14 11:23:01 +08:00
2b665ee327 usb_host: Hub driver skips fetching string descriptors if their index is 0
When a USB does not support a particular string dsecriptor (e.g.,
manufacturer, product, and serial number), the string descriptors corresponding
index will be set to 0 in the device descriptor (e.g., iManufacturer, iProduct,
iString).

Previously, the Hub driver would always attempt to fetch the all three string
descriptors, thus leading an error in CHECK_SHORT_SER_STR_DESC if the device
did not support the descriptor.

This commit fixes the Hub drvier by skipping the enumeration stages of a
particular descriptor if its index is 0 (i.e., not supported by the device).
2023-02-13 17:05:11 +05:30
6e9500ad13 usb_host: Fix error when fetching LANGID table
USB devices may support string descriptors in multiple languages. The supported
languages are stored in a LANGID table, which itself is a string descriptor at
index 0.

When fetching the LANGID table itself, the USB 2.0 specification does not
specify what LANGID to use, thus the Hub driver would use the default LANGID
"ENUM_LANGID". However, this would cause some devices to stall.

This commit fixes the issue by always requesting the LANGID table itself using
a LANGID of 0.
2023-02-13 17:04:46 +05:30
3f1cff699d usb_host: Fix interface descriptor parsing
Previously the USB host driver did not accept interface number greater or equal bNumInterfaces, even though these are valid interface numbers
2023-02-13 17:03:59 +05:30
dcaaadbbe1 adc: added adc filter migration guide
Closes https://github.com/espressif/esp-idf/issues/10663
2023-02-13 17:51:36 +08:00
2db423c62b Fixed build errors when sniff subrating is enabled. 2023-02-13 17:26:35 +08:00
6e35b1eba3 heap: Fix priority in shex() bit shift 2023-02-13 09:03:32 +01:00
6ed2371bd1 [Logs] print size and caps when malloc fails 2023-02-13 09:02:59 +01:00
d55b870ff2 docs: secure-boot-v2: add a section about secure padding 2023-02-13 13:16:08 +05:30
3beea950b7 docs: refactored Secure Boot V2 documentation
- Added "Signing using pre-calculate signatures" section
- Refactored "Signing using an external HSM" section
2023-02-13 13:15:57 +05:30
55c2ac7b96 docs: fix rst external links with wrong format 2023-02-13 12:05:21 +08:00
935661ba4a esp_http_server: fix return values for httpd_socket_send() and httpd_socket_recv() APIs
Closes https://github.com/espressif/esp-idf/issues/10658
2023-02-10 10:57:05 +05:30
7f15980de9 sleep: fix gpio wakeup not working properly in some cases
Before this fix, when we call esp_pm_configure after gpio_wakeup_enable,
the configuration of GPIO in sleep state in gpio_wakeup_enable will be
overwritten by esp_pm_configure.
2023-02-09 17:32:13 +08:00
50feb8f75b soc_caps: remove SOC_GPIO_SUPPORT_SLP_SWITCH
all esp chips support this feature
2023-02-09 17:29:40 +08:00
33afa9a14a docs: fix broken link in fatfs doc 2023-02-09 16:10:57 +08:00
60f678b736 Use correct recursive mutex for env and regular mutex for tz 2023-02-09 16:02:50 +08:00
bddbd66e13 esp_phy: fix phy init when SW restart 2023-02-09 15:11:44 +08:00
de8409fa88 gptimer: acquire pm lock for xtal clock source 2023-02-09 14:10:15 +08:00
f136f16f72 wpa_supplicant: Enable ECC test case 2023-02-08 21:35:49 +05:30
131faba944 mbedtls/ecp: Fix incorrect ECP parameter value
- Add sanity checks in mbedtls port
- Add ECP test cases covering shorter scalar values
2023-02-08 21:35:49 +05:30
5de3f74f5e touch_sensor: fix touch_sensor_v1 filter issue 2023-02-08 14:32:36 +08:00
42dad0c541 Bluetooth/NimBLE : Fixed clearing connection_handle[] after disconnect event 2023-02-08 10:56:16 +05:30
9892fb760b touch: move unit tests to test_app 2023-02-08 12:26:27 +08:00
e51845d04c touch: update touch-related code to compile without -Wno-format flag 2023-02-08 12:23:40 +08:00
173118d2b3 docs: make s3 octal flash error handling clearer 2023-02-08 12:16:10 +08:00
d1abf90854 wifi_mesh: Remove-Wno-format compile option for mesh examples 2023-02-07 11:50:51 +08:00
c9ce87a1a9 Clean up wifi provisioning in the esp_event thread
Signed-off-by: Laukik Hase <laukik.hase@espressif.com>
2023-02-06 18:31:11 +05:30
d764b863f6 ci: fix isort py37 incompatible issue 2023-02-06 10:31:24 +08:00
699dde8a38 Fixed the bluedroid hci crash due insufficient memory on ESP32C2 2023-02-03 20:41:23 +08:00
a16896af68 bt: fix SDP event status overwritten by handle 2023-02-02 20:13:52 +08:00
5b19866eb8 Nimble: Fix runtime assertion in bleprph due to two disconnect events 2023-02-02 17:38:39 +05:30
885e501d99 Merge branch 'feature/remove_80m_ddr_warning_v5.0' into 'release/v5.0'
mspi: remove mspi 80m ddr mode warning regarding to timing tuning (v5.0)

See merge request espressif/esp-idf!21904
2023-02-01 18:24:11 +08:00
f6e8a4ea90 wpa_supplicant : Prevent h2e config overwrite
Current esp_wifi_get_config doesn't return correct value of h2e config which will cause h2e config to be overwritten in Station connected handler.

Add one preventative condition to take care of this.
2023-02-01 12:51:12 +05:30
a36991d7a9 wpa_supplicant : fix invalid de-init of last_scan_res_used
During the wifi deinit last_scan_res_used is not set to 0 which will cause it be used directly after reinit.

Added changes which will set it to 0 during init and deinit.
2023-02-01 12:39:23 +05:30
0ec506961e wpa_supplicant : Correct scan results for GCMP RSN
Fixed a typo which was causing scan results for GCMP not showing correctly
2023-02-01 12:39:11 +05:30
5213664cea wpa_supplicant:Fix potential null pointer dereference 2023-02-01 12:06:42 +05:30
6b8d4dfe14 gdma: prevent mutli-channels connect to the same peripheral
1. add check in the gdma driver, to prevent multiple channels connecting
   to the same peripheral
2. memory copy DMA ID will occupy the peripheral's DMA ID on some ESP
   targets (e.g. esp32c3/s3). We should search for a free one when
install async memcpy driver.

Closes https://github.com/espressif/esp-idf/issues/10575
2023-02-01 11:06:48 +08:00
ac05d033b9 gdma: correct the dma trigger of uart
GDMA trigger actually is not assigned to UART controller, but for UHCI
controller
2023-02-01 11:02:24 +08:00
41fd87fd89 heap: Modify the memory type of the memory used as startup stack when memory protection is enabled
If memory protection is enabled on esp32c3 and esp32s3, we don't want to the heap component to see
the startup stack memory as D/IRAM but as DRAM only. Introduce a new type to make this possible in
the same fashion the regular D/IRAM regions are handled.
2023-01-31 07:40:20 +01:00
9fd62d547c spi_flash: fix flash function arg_check with spi host_id 2023-01-30 10:33:17 +08:00
d51f4583a4 spi: fix micro SPI_HOST_MAX error
Closes https://github.com/espressif/esp-idf/issues/10349
2023-01-29 16:24:59 +08:00
67f78a03ae docs: ignore xtensa isa-summary during linkcheck 2023-01-29 11:45:41 +08:00
e60d82463b protocomm: Fix Kconfig dependency on wifi_provisioning component config
- `protocomm` depends on a config option `CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION`
  from `wifi_provisioning`; however, a lower layer component (`protocomm`) should
  not have any `#ifdef` guard dependent on an upper layer component (`wifi_provisioning`).
- Added a new `ble_link_encryption` flag in `protocomm_ble_config_t` to manage the same

Closes https://github.com/espressif/esp-idf/issues/9443
2023-01-26 12:57:19 +05:30
09c0b58b97 esp_local_ctrl: Fix header inclusion
- Included `sdkconfig.h` and HTTP/S server based headers
  explicitly
2023-01-26 12:53:02 +05:30
c9af189b59 docs: JTAG debugging update for ESP32C2 2023-01-25 22:17:51 +01:00
3ca447956c mbedtls: fix null pointer dereference of variable iv_off
iv_off gets dereferenced before being check for NULL
2023-01-25 15:32:56 +05:30
79fb21952e mbedtls/port: refactor sanity checks and their return values
Refactored and returned correct error codes for sanity checks
present in port layer esp_aes.c and esp_aes_gcm.c
2023-01-25 15:30:20 +05:30
7e00b1f356 mbedtls/port: added stream_block parameter sanity check 2023-01-25 15:30:20 +05:30
e8fcb93d0f bootloader_support(esp32c2): Fix esp_secure_boot_cfg_verify_release_mode API
When FE and SB keys are set then:
- 128 low bits are read protected
- 128 hi bits are readable
2023-01-24 18:21:37 +08:00
c4fd8a9114 tools: fix idf.py gdb memory access before remote target is connected
Currently loading of esp32s3 ROM ELF symbols fails with
"Cannot access memory at address 0x3ff194ad". Let's perform
add-symbol-file after connection to the target.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2023-01-24 09:58:04 +01:00
905f9bf25f examples(efuse): Set CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
For efuse example test, we set CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE=y
by default because in the python test we expect secure boot is in RELEASE mode
2023-01-24 16:27:05 +08:00
1cb0472520 bootloader_support(esp32c2): Fix WR_DIS_RD_DIS burn for secure boot key
SB key is left readable, the corresponding bit in RD_DIS is unset.
We set write-protection for RD_DIS to ensure that the SB key is always readable.
2023-01-23 21:35:31 +08:00
07bf145e06 doc: Update hmac article 2023-01-23 21:03:00 +08:00
5d37e26d35 security: Adds new APIs to check that all eFuse security features are enabled correctly 2023-01-23 21:02:55 +08:00
7a23bf19be esp_hw_support(esp32): If the MAC_FACTORY CRC check fails, then esp_efuse_mac_get_default returns INVALID_CRC instead of abort
Closes https://github.com/espressif/esp-idf/issues/10401
2023-01-23 20:02:16 +08:00
80626f17c0 usb: Update TinyUSB version 2023-01-20 09:17:04 +01:00
ebb7650e63 bluetooth: fix that functions "coex_enable" and "coex_disable" are not used in pairs on ESP32-C3, ESP32-S3 and ESP32-C2 2023-01-20 10:47:58 +08:00
fa46e1b491 efuse: fix esp_efuse_utility_write_reg() declaration 2023-01-19 14:29:26 +07:00
69f500c680 bugfix: Fix windows path case sensitivity
This commit fixes an issue where paths on Windows are case insensitive, for instance when setting the build folder its name would be converted to lowercase.

The culprit is our realpath() function, that was calling os.path.normcase() internally, since we are removing that call it makes sense to just remove the function entirely and call os.path.realpath() wherever necessary.

Closes https://github.com/espressif/esp-idf/issues/10282
2023-01-18 11:25:25 +01:00
e7eccf7ed0 Nimble: Fix compilation issue for examples for esp32c6 and esp32h4 2023-01-17 10:25:32 +05:30
4da5d3e7a5 Nimble: Updated ble_l2cap_coc example
1. Corrected format
     2. Fixed double free of memory issue in case of disconnection
     3. Updated sdkconfig.default file to have correct value for
COC_MAX_NUM configuration setting
2023-01-17 10:19:18 +05:30
c41bb46d92 Merge branch 'bugfix/ledc_glb_clk_compiler_warning_v5.0' into 'release/v5.0'
ledc: Fix -Werror=maybe-uninitialized warning on glb_clk variable on ESP32 (v5.0)

See merge request espressif/esp-idf!21941
2023-01-17 10:30:11 +08:00
5aa55ffc34 mcpwm: support not reset GPIO config at exit
By default, the driver will reset the GPIO used by the MCPWM capture
channel at exit. But in some special use cases, the same gpio may also
be used by another device, which shares the same gpio configuration,
resetting the gpio is not expected.

Closes https://github.com/espressif/esp-idf/issues/10327
2023-01-16 11:22:58 +08:00
1884442a80 rmt: no auto light sleep if xtal is working as the clock source 2023-01-16 10:20:40 +08:00
e894e9d68f Merge branch 'bugfix/clear_pmk_cache_for_missing_reason_codes_v5.0' into 'release/v5.0'
Fix missing disconnected callback (Backport v5.0)

See merge request espressif/esp-idf!22042
2023-01-14 10:23:02 +08:00
4d9d8c5eca examples/spi_lcd_touch: Fixed colors on ILI9341.
(cherry picked from commit 0ea1317983)
2023-01-13 13:42:30 +01:00
e4f5fe72d0 esp_wifi: Fix missing disconnected callback 2023-01-13 13:27:32 +05:30
fbeedbc238 Merge branch 'bugfix/prevent_open_auth_sae' into 'release/v5.0'
Fix SAE open auth and PMK issues (Backport v5.0)

See merge request espressif/esp-idf!21852
2023-01-13 15:51:56 +08:00
86aa89c532 esp_wifi: Add check for wps start state 2023-01-12 17:01:58 +05:30
179a2717c0 Merge branch 'bugfix/esp_netif_ip_reconnect_v5.0' into 'release/v5.0'
esp_netif: Post IP event for PPP netifs unconditionally (v5.0)

See merge request espressif/esp-idf!21670
2023-01-12 16:21:26 +08:00
42bf734139 Merge branch 'bugfix/esp32s3_int_wdt_v5.0' into 'release/v5.0'
system: disable interrupts in esp_restart_noos_dig to fix infinite int_wdt on ESP32-S3 (v5.0)

See merge request espressif/esp-idf!21769
2023-01-12 16:19:27 +08:00
96db537020 Merge branch 'feature/apply_new_version_logic_v5.0' into 'release/v5.0'
all: Apply new version logic (major * 100 + minor) (v5.0)

See merge request espressif/esp-idf!20941
2023-01-12 16:18:23 +08:00
6988e82430 Merge branch 'feature/esp_http_server_esp_events_v5.0' into 'release/v5.0'
esp_http_server: Added support for esp_events (v5.0)

See merge request espressif/esp-idf!21844
2023-01-12 12:40:12 +08:00
00d5130b65 Merge branch 'fix/wifi_prov_scan_method_v5.0' into 'release/v5.0'
Changed wifi provisioning scan method (v5.0)

See merge request espressif/esp-idf!21854
2023-01-12 12:39:20 +08:00
ef5465b3d9 Merge branch 'feature/gcm_operation_using_ctr_based_calculation_v5.0' into 'release/v5.0'
GCM operation optimisation (v5.0)

See merge request espressif/esp-idf!21856
2023-01-12 12:38:42 +08:00
31f239c22f Merge branch 'bugfix/esp_tls_timeout_v5.0' into 'release/v5.0'
esp_tls: Fix issue when timeout is not explicitly given in esp_tls_cfg_t (v5.0)

See merge request espressif/esp-idf!21743
2023-01-12 12:37:58 +08:00
bc918310c2 Merge branch 'esp_local_ctrl/fix_https_server_dep_v5.0' into 'release/v5.0'
esp_local_ctrl: Add support for insecure HTTP server transport (v5.0)

See merge request espressif/esp-idf!21815
2023-01-12 12:37:26 +08:00
e0f215811e Merge branch 'bugfix/remove_s3_dis_boot_remap_efuse_bit_v5.0' into 'release/v5.0'
docs: remove mention of DIS_BOOT_REMAP for chips other than ESP32-S2 (v5.0)

See merge request espressif/esp-idf!21809
2023-01-12 12:36:47 +08:00
870f4efa0d adc: make adc_channel.h macros work with ng driver
Closes https://github.com/espressif/esp-idf/issues/10508
2023-01-12 11:15:57 +08:00
18e6fa945e wpa_supplicant: Set PMK from PMKSA incase of caching 2023-01-11 11:17:02 +05:30
677c813137 esp_wifi: Fix open auth issue after commit message exchange 2023-01-11 11:16:13 +05:30
13eb2e8dae Merge branch 'bugfix/remove_sha384_hash_for_bigger_certs_v5.0' into 'release/v5.0'
esp_wifi: remove sha384 hash for cert size > 2k (v5.0)

See merge request espressif/esp-idf!21963
2023-01-11 10:35:58 +08:00
72bae2b873 Merge branch 'doc/add_esp_now_change_to_migration_guides_v5.0' into 'release/v5.0'
doc: add esp now changes to migration guides

See merge request espressif/esp-idf!21787
2023-01-11 10:35:20 +08:00
1db1a5f17e Removed sha384 hash for certs > 2k 2023-01-10 13:14:21 +00:00
4d5e324844 Merge branch 'bugfix/avoid_ftm_initiator_mode_on_softap_v5.0' into 'release/v5.0'
Avoid ftm initiator mode on softap (Backport v5.0)

See merge request espressif/esp-idf!21772
2023-01-10 14:26:36 +08:00
9f01d9aa2c build_system: stop looking for sdkconfig file specified by env var SDKCONFIG_DEFAULTS in bootloader subproject 2023-01-10 09:48:59 +08:00
3c1ac62969 mbedtls: GCM implementation is replaced with CTR-based calculation
- GCM operation in mbedtls used ECB, which calculated only 16 bytes of data each time.
	- Therefore, when processing a large amount of data, it is necessary to frequently set hardware acceleration calculations,
	- which could not make good use of the AES DMA function to improve efficiency.
	- Hence, GCM implementation is replaced with CTR-based calculation which utilizes AES DMA to improve efficiency.
2023-01-09 18:37:07 +05:30
f111ed2d9a mbedtls: fix esp_aes_gcm_update_ad() API implementation
Closes IDFGH-10467
2023-01-09 18:35:25 +05:30
065e121451 espcoredump: fix incorrectly defined coredump chip version 2023-01-09 19:54:01 +08:00
cc159dfc5b usb: Fix incorrect bmRequestType direction flag in USB Host Library
usb_host_transfer_submit_control() uses the incorrect bmRequestType direction
flag. Therefore, when doing a transfer check, all transfers were mistakenly
treated as OUT transfers (only affects transfer check and not actual transfer).
2023-01-09 17:56:06 +08:00
ff4e4f4c80 hal: Fix USB DWC HAL host channel halt race condition
This commit fixes a race condtion bug with usb_dwc_hal_chan_request_halt()
where a channel the channel is halted if it has just completed a transfer
(i.e., finished processing a QTD with the "HOC" flag set) but the channel is
still pending interrupt handling. In this case...

- usb_dwc_hal_chan_request_halt() would simply read the channel's underlying
register, determine it is not active, not set the "halt_requested" flag, and
simply return true.
- The caller assumes of usb_dwc_hal_chan_request_halt() will assume that the
channel has halted, and may proceed to reconfigure the pipe/port
- When usb_dwc_hal_chan_decode_intr() comes to process the pending interrupt
it will simply return USB_DWC_HAL_CHAN_EVENT_CPLT not knowing a halt has been
requested.

This commit updates the implementation of usb_dwc_hal_chan_request_halt() so
that a halt is properly requested even if the underlying channel has already
physically halted.
2023-01-09 17:55:48 +08:00
05f30c1052 usb: Refactor USB Host tests
* USB tests migrated to pytest
* Error messages improved
* Configurable for different mock devices
2023-01-09 17:55:20 +08:00
b4f281f523 tinyusb: Add TinyUSB example tests 2023-01-09 17:55:02 +08:00
8d85a76a74 usb_host: Rename struct/ll/hal symbols to use "usb_dwc" prefix
Following the file renaming to use the "usb_dwc" prefix, this commit
updates the symbol names of those files to use the "usb_dwc" as well.

Some LL functions were also renamed so that the register name is
mentioned.
2023-01-09 17:48:09 +08:00
da91dbccfa usb_host: Rename struct/ll/hal files to use "usb_dwc" prefix
This commit updates the DWC_OTG based struct/ll/hal file names to
use the prefix "usb_dwc". This naming scheme reduces ambiguity if
another USB controller implementation is added.

As a result, "hcd.c" has been renamed to "hcd_dwc.c"
2023-01-09 17:47:42 +08:00
ae7c8de4a7 mcpwm: support non-varg version of generator functions
Closes https://github.com/espressif/esp-idf/issues/10449
2023-01-09 15:09:40 +08:00
e8386ed732 ledc: Fix -Werror=maybe-uninitialized warning on glb_clk variable on specific kconfig options selected
Closes https://github.com/espressif/esp-idf/pull/9025
Closes https://github.com/espressif/esp-idf/issues/10322
2023-01-07 17:29:45 +08:00
d2ddb4b5e1 test_apps(gdb): Updates the chip version format (vX.Y) 2023-01-06 02:00:52 +08:00
ac068eed34 esp32c2: fixed chip revision of ECO2 2023-01-06 02:00:52 +08:00
0c0049b5e4 tools: Update check_copyright_ignore.txt 2023-01-06 02:00:52 +08:00
9538f9c5ff ci: Fix environment variable IDF_CI_BUILD is not set 2023-01-06 02:00:52 +08:00
d130b5b6ba esp_hw_support: Removes esp32c2 eco2 support 2023-01-06 02:00:52 +08:00
df9e24a8ca bootloader_support: Fix iram_loader_seg overflow for ESP32-S2 when -O0 2023-01-06 02:00:52 +08:00
ada85449f1 docs: update CN translation for system.rst 2023-01-06 02:00:52 +08:00
bb0c26c233 esp32c2: put v2.0 back to development stage 2023-01-06 02:00:52 +08:00
823024c10c all: Apply new version logic (major * 100 + minor) 2023-01-06 02:00:52 +08:00
536825dda1 esptool_py: Added a sector-pad option for bootloader image
When SECURE BOOT V2 is enabled and CONFIG_SECURE_BOOT_SIGNED_BINARIES
is not set, sector-pad the bootloader image, which is required for an
external PKCS#11 interface to generate a signature.
2023-01-05 13:39:57 +05:30
d9efa662c8 esp_hw_support: support riscv call 2023-01-05 15:58:37 +08:00
8e6dfb8af4 soc: H2(beta) support SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY 2023-01-05 15:56:20 +08:00
7585e86a05 esp_rom: update H2 and C2 rom rtc.h 2023-01-05 15:52:49 +08:00
698be13236 mspi: remove mspi 80m ddr mode warning regarding to timing tuning 2023-01-05 11:50:57 +08:00
a032c6ea3b docs: update cn trans for flash-encryptions 2023-01-04 21:29:40 +05:30
7860662a93 docs: remove mention of DIS_BOOT_REMAP for chips other than ESP32-S2
Relevant: https://esp32.com/viewtopic.php?f=13&t=31188
2023-01-04 21:29:33 +05:30
a68fad98ed Fixed task watchdog trigger issue when closed hci uart 2023-01-04 15:30:32 +08:00
249fde21e5 esp_hw_support: allow writing in IRAM when CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT is not set for esp32C2
when CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT is not set, the PMP rule for esp32c2 shoud allow write access.
Fix esp_cpu_configure_region_protection() in cpu.c accordingly.
2023-01-04 07:51:46 +01:00
4c6aad37f6 Fixed crash caused by accessing nullptr in btm_acl_disconnected 2023-01-04 11:46:04 +08:00
6b0a64d722 Fixed hci uart flow ctrl error on ESP32-C2 and ESP32-H4 2023-01-04 09:59:32 +08:00
0883101f7f Tools: Improve idf.py error message when the argument value collides with the environment variable
Closes https://github.com/espressif/esp-idf/issues/10475
2023-01-03 19:00:48 +01:00
327bf0d608 heap: RE-enable ESP32C2 test in test_apps 2023-01-03 09:52:33 +01:00
4175dd7a56 newlib: Update the esp32c2 config default to avoid RTC related test to not run on esp32c2
Set CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT to enable to force CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER to disable
and hence prevent the following tests from being executed:

- Timestamp after abort is correct in case RTC & High-res timer have + big error
- Timestamp after restart is correct in case RTC & High-res timer have + big error
- Timestamp after restart is correct in case RTC & High-res timer have - big error
2023-01-03 08:37:28 +01:00
3711a032ff esp-hw-support: fix interrupt allocation tests on esp32c2
A part of the test 'Can allocate IRAM int only with an IRAM handler' was to
allocate an intr with the handler in RTC memory which is not supported by esp32c2.
A condition was added to prevent this part of the test to execute on esp32c2 targets.
2023-01-03 07:52:07 +01:00
f244a8b209 ulp-riscv: ULP RISC-V I2C example gets stuck on esp32s2
This commit fixes an issue where in the ULP RISC-V I2C example causes
a spurious wakeup of the main CPU because of a Trap signal when the ULP
core does not meet the wakeup threshold values. This was due to the fact
that the RTC_CNTL_COCPU_DONE signal was being set before the
RTC_CNTL_COCPU_SHUT_RESET_EN signal which was causing the the ULP RISC-V
core to not reset properly on each cycle.

Closes https://github.com/espressif/esp-idf/issues/10301
2023-01-02 14:21:24 +01:00
40f2caa950 mbedtls: fix esp_aes_crypt_ctr writing to null stream block 2023-01-02 12:02:47 +05:30
ea07ce9367 mbedtls: added SOC_AES_SUPPORT_AES_192 check in esp_aes_gcm_setkey() 2023-01-02 12:02:47 +05:30
d1d273bece test_aes_gcm: fix output_size paramter in mbedtls_get_update()
mbedtls_get_update() returned MBEDTLS_ERR_GCM_BUFFER_TOO_SMALL,
as 0 used to get passed in the output_size paramter.
2023-01-02 12:02:47 +05:30
1c0e11efc0 mbedtls: populate mbedtls_gcm_update() output_length paramater 2023-01-02 12:02:47 +05:30
9067214f33 Changed wifi provisioning scan method
Signed-off-by: sanket.wadekar <sanket.wadekar@espressif.com>
2022-12-31 18:09:45 +05:30
1a39a17777 esp_http_server: Added support for esp_events 2022-12-29 18:08:38 +05:30
cje
524f1195bf sleep: fix sleep time inaccurate bug when select 8MD256 as rtc slow clock on ESP32
Related to: https://github.com/espressif/esp-idf/issues/6687
2022-12-28 15:33:20 +08:00
7279244f8c esp_local_ctrl: Add support for insecure HTTP server transport 2022-12-28 11:17:10 +05:30
72e637750e Nimble: Removes global min/max definition causing problems with other libraries 2022-12-28 10:17:10 +05:30
eb66430793 coredump: custom core dump stack is now supported on Xtensa targets 2022-12-26 12:07:58 +01:00
824d869bb4 ble_mesh:example:change position of vendor model and generic onoff model callback 2022-12-26 17:26:15 +08:00
27f3a3195d doc: add esp now changes to migration guides 2022-12-23 19:11:06 +08:00
bedfc5063d esp_pm: Fix string formatting type errors
This commit fixes a string formatting error in esp_pm with CONFIG_PM_PROFILING
is enabled.

Closes https://github.com/espressif/esp-idf/issues/10347
2022-12-23 15:04:13 +08:00
4be58114dc esp_pm: Fix build error when CONFIG_PM_PROFILING is enabled 2022-12-23 15:04:08 +08:00
ebb8d0b3b2 esp_wifi: Remove -Wno-format compile option for FTM example, iperf example, roaming example 2022-12-23 11:14:12 +08:00
d93b7246b0 i2s: fixed rx update stuck bug 2022-12-23 10:45:51 +08:00
506f7d0d8e tools: fix RISC-V GDB not being installed for C2, H2 2022-12-22 11:42:29 +01:00
002e21bda4 esp_wifi:Update wifi libs
1. Avoid ftm initiator mode on softap
2. Fix home channel issue in ftm for apsta mode
3. Fix int overflow for T1-T4 counter variable
2022-12-22 16:10:28 +05:30
acb2397341 gdb stub: re-enable for ESP32-C2 2022-12-22 11:39:02 +01:00
35135d7b29 system: disable interrupts in esp_restart_noos_dig 2022-12-22 11:34:38 +01:00
af01082a56 doc: update wifi amsdu docs 2022-12-22 18:32:03 +08:00
caf794ad26 [Docs] specify Digital Signature byte order, and esp_ds_sign() clarification 2022-12-22 15:41:30 +05:30
490216a2ac Merge branch 'bugfix/fix_httpd_req_cleanup_v5.0' into 'release/v5.0'
esp_http_server: fix wrong context pointer in httpd_req_cleanup function (v5.0)

See merge request espressif/esp-idf!21731
2022-12-22 10:22:06 +08:00
d64e8f5caf Merge branch 'bugfix/fix_test_failure_in_test_phy_multi_init_data_bin_issue_v5.0' into 'release/v5.0'
esp_phy: add country code 01 to country code map type table(Backport v5.0)

See merge request espressif/esp-idf!21749
2022-12-22 09:35:25 +08:00
244e51fca7 Merge branch 'examples/remove_wno_format_compile_option_v5.0' into 'release/v5.0'
protocols/security: Remove `-Wno-format` compile option for examples (v5.0)

See merge request espressif/esp-idf!21742
2022-12-21 23:51:52 +08:00
9fa8329148 Merge branch 'feature/emac_buff_v5.0' into 'release/v5.0'
esp_eth: receive buffer allocation optimization (v5.0)

See merge request espressif/esp-idf!21547
2022-12-21 23:35:30 +08:00
e6b3038cbd Merge branch 'docs/update_esp_https_ota_docs_for_esp_events_v5.0' into 'release/v5.0'
docs: Update esp_https_ota docs to have information about OTA events (v5.0)

See merge request espressif/esp-idf!21733
2022-12-21 20:59:41 +08:00
94d2040ba7 esp_phy: add country code 01 to country code map type table 2022-12-21 20:00:36 +08:00
205ca920bf Merge branch 'contrib/github_pr_10199_v5.0' into 'release/v5.0'
Removed the 'configASSERT( xInheritanceOccurred == pdFALSE )' assertion from xQueueSemaphoreTake (GitHub PR)(v5.0)

See merge request espressif/esp-idf!21500
2022-12-21 19:56:13 +08:00
27bc387512 Merge branch 'bugfix/free_osmbuf_l2cap_v5.0' into 'release/v5.0'
Nimbe: L2CAP COC example - Fixed freeing up of same memory address twice. (v5.0)

See merge request espressif/esp-idf!21724
2022-12-21 19:25:08 +08:00
26fb8cb6ef Merge branch 'bugfix/nimble_remove_wno_format_v5.0' into 'release/v5.0'
Nimble: Remove `-Wno-format` compile option for nimble examples (v5.0)

See merge request espressif/esp-idf!21730
2022-12-21 19:13:42 +08:00
4a0708fe61 Merge branch 'fix/clear_cur_pmksa_v5.0' into 'release/v5.0'
Clear current pmksa before generating RSN IE (Backport v5.0)

See merge request espressif/esp-idf!21690
2022-12-21 19:06:07 +08:00
3bd8a8e890 Merge branch 'bugfix/remove_-Wno-formate_in_ble_mesh_examples_v5.0' into 'release/v5.0'
ble_mesh: example: Remove -Wno-format compile option for BLE Mesh examples(v5.0)

See merge request espressif/esp-idf!21675
2022-12-21 18:32:13 +08:00
c541b9082e Merge branch 'contrib/github_pr_10027_v5.0' into 'release/v5.0'
[Panic] also print to secondary USB Serial/JTAG Console (GitHub PR) (v5.0)

See merge request espressif/esp-idf!21021
2022-12-21 17:15:04 +08:00
081e2ac97e esp_tls: Fix issue when timeout is not explicitly given in esp_tls_cfg_t
- If internet connectivity weakened or disappeared suddenly while we were
  in the TLS handshake stage, the app got stuck at that point indefinitely.
- This was because when timeout was not explicitly specified in esp_tls_cfg_t,
  the default timeout was set at the wrong place. This causes the sockets to be
  setup with zero timeout, hence the indefinite wait.
2022-12-21 14:42:33 +05:30
73ea8543e3 protocols/security: Remove -Wno-format compile option for examples 2022-12-21 14:39:46 +05:30
5efbb7171d Merge branch 'bugfix/sdmmc_target_test_v5.0' into 'release/v5.0'
ci: add missing target-test jobs for sdcard and extflash examples (v5.0)

See merge request espressif/esp-idf!21700
2022-12-21 17:03:55 +08:00
20d4335d60 Merge branch 'fix/sdspi_no_cs_v5.0' into 'release/v5.0'
sdspi: Allow CS line to be set to GPIO_NUM_NC (-1) (v5.0)

See merge request espressif/esp-idf!20915
2022-12-21 16:37:25 +08:00
83896d877a docs: Update esp_https_ota docs to have information about OTA events 2022-12-21 10:39:35 +05:30
a5ee1504f8 esp_http_server: fix wrong context pointer in httpd_req_cleanup function
Added example which fails without the fix

Closes https://github.com/espressif/esp-idf/issues/10265
2022-12-21 10:32:34 +05:30
cbf8cf77c2 Nimble: Fixed compilation issues in nimble examples after removing "-Wno-format" option 2022-12-21 10:18:57 +05:30
823b6c8f56 wpa_supplicant: Clear current pmksa before generating RSN IE
Also update wifi libs with below changes -
  - Fix reason codes for Invalid PMKID
  - Fix handling of Assoc Resp status codes for Station
2022-12-21 11:51:48 +08:00
25eb1f0c6e Merge branch 'bugfix/some_wifi_fixes_v5.0' into 'release/v5.0'
esp_wifi: update wifi lib to latest master for v5.0

See merge request espressif/esp-idf!21680
2022-12-21 10:50:49 +08:00
594dd810f1 Merge branch 'bugfix/esp_lcd_modify_bounce_buffer_index_v5.0' into 'release/v5.0'
RGB LCD: support multi frame buffer in bounce buffer mode (v5.0)

See merge request espressif/esp-idf!21660
2022-12-21 10:48:18 +08:00
8300f0e52a Merge branch 'contrib/github_pr_10304_v5.0' into 'release/v5.0'
Fixed mismatch in printf types (GitHub PR) (v5.0)

See merge request espressif/esp-idf!21706
2022-12-20 21:22:51 +08:00
6972b61ea5 Merge branch 'staging/esp_static_assert_v5.0' into 'release/v5.0'
C/Cxx: unify static assertions with the macro ESP_STATIC_ASSERT (backport v5.0)

See merge request espressif/esp-idf!21695
2022-12-20 20:53:02 +08:00
5c50cbc18e L2CAP COC example : Fixed freeing up of same memory address twice. 2022-12-20 18:04:00 +05:30
fca1b1dd58 ble_mesh: example: Remove -Wno-format compile option for BLE Mesh examples 2022-12-20 10:57:39 +00:00
83e2cf1a68 Merge branch 'staging/riscv_wrapper_freertos_tasks_v5.0' into 'release/v5.0'
RISC-V: Create a wrapper around FreeRTOS Tasks to detect the ones returning (backport v5.0)

See merge request espressif/esp-idf!21202
2022-12-20 16:34:13 +08:00
39cadc7e46 Queue Send fix
Fixes rare deadlock on heavy loaded multicore-systems.
2022-12-20 08:30:53 +00:00
3b20f9fbc2 Merge branch 'doc/cpu_breakpoint_watchpoint_num_v5.0' into 'release/v5.0'
docs: fix the number of breakpoints and watchpoints for RISC-V chips (v5.0)

See merge request espressif/esp-idf!21703
2022-12-20 16:29:58 +08:00
74b340391a Merge branch 'doc/opt_esp32_eco3_v5.0' into 'release/v5.0'
docs: mention that increasing ESP32_REV_MIN can reduce IRAM size (v5.0)

See merge request espressif/esp-idf!21701
2022-12-20 16:27:33 +08:00
a0c6c1ff34 Merge branch 'bugfix/update_docs_for_secure_dl_mode_v5.0' into 'release/v5.0'
docs: Fix Secure DL mode documentation about flash read being unsupported (v5.0)

See merge request espressif/esp-idf!21653
2022-12-20 13:56:59 +08:00
c173845ff3 Merge branch 'feature/tlsf-dynamic-control-size_v5.0' into 'release/v5.0'
heap: Update to the new tlsf implementation of dynamic metadata size (backport v5.0)

See merge request espressif/esp-idf!20774
2022-12-20 13:51:07 +08:00
133184b59f Merge branch 'bugfix/flush_pmksa_entry_after_disconnect_v5.0' into 'release/v5.0'
Fix PMK caching related regression (Backport v5.0)

See merge request espressif/esp-idf!21698
2022-12-20 13:47:37 +08:00
fd844f092d Merge branch 'ci/fix_example_test_ip_issues_5.0' into 'release/v5.0'
Ci: fix example test ip related issues

See merge request espressif/esp-idf!21708
2022-12-20 13:46:56 +08:00
50ec3e0145 CI: fix ethernet throughput test 2022-12-20 11:26:43 +08:00
afc433114e CI: fix ipv6 test failed on some runners 2022-12-20 11:26:32 +08:00
7dae4181a8 Merge branch 'bugfix/fix_some_ble_bugs_by_cjh_v5.0' into 'release/v5.0'
Fixed some BLE bugs (backport v5.0)

See merge request espressif/esp-idf!21682
2022-12-20 11:14:48 +08:00
cf88b7a743 Merge branch 'bugfix/fix_ble_some_bugs_20221219' into 'release/v5.0'
backport some BLE bugs 20221219 (backport v5.0)

See merge request espressif/esp-idf!21697
2022-12-20 10:52:53 +08:00
368ede2eb4 Merge branch 'bugfix/spp_vfs_memory_leak_v5.0' into 'release/v5.0'
Component_bt/fix esp_spp_vfs_register memory leak(v5.0)

See merge request espressif/esp-idf!21678
2022-12-20 10:37:10 +08:00
66703dc788 Merge branch 'feature/spiflash_override_cmake_function_v5.0' into 'release/v5.0'
build system: Add spi_flash_add_link_dependency function for spi_flash custom driver (v5.0)

See merge request espressif/esp-idf!21705
2022-12-20 06:19:07 +08:00
ecd599872e Merge branch 'bugfix/fix_esp32s3_diram_calculation_v5.0' into 'release/v5.0'
Tools: Fix diram size calculation (v5.0)

See merge request espressif/esp-idf!21669
2022-12-20 00:35:18 +08:00
0ce97d88c2 Fixed mismatch in printf types
Removed duplicate `l` in format

Updated print types

Updated CMake
2022-12-19 15:42:13 +01:00
e760a54e37 docs: update CN translation for build-system.rst 2022-12-19 15:25:30 +01:00
8468ea3dcc build system: Add idf_component_add_link_dependency function, use for spi_flash overriding 2022-12-19 15:25:30 +01:00
ac2ac0c705 CI: check_public_headers script will detect the use of static asserts in headers
When a public header contains _Static_assert or static_assert, check_public_headers.py script will detect it and report it as an issue.
Indeed, public headers shall now use ESP_STATIC_ASSERT.
2022-12-19 15:06:20 +01:00
0714847552 C/Cxx: unify static assertions with the macro ESP_STATIC_ASSERT
Closes https://github.com/espressif/esp-idf/issues/9938
2022-12-19 15:06:15 +01:00
6203254900 wpa_supplicant: Fix PMK caching related regression
Fixed regression caused by commit e566e0b5
2022-12-19 19:10:11 +05:30
1d0c5aa6d8 docs: fix the number of breakpoints and watchpoints for RISC-V chips 2022-12-19 14:37:03 +01:00
1c35538b96 idf_size.py: Fix issue where diram size was halved in cases where iram was not fully filled with cache
This fixes an attempted fix for diram size calculation where it was counted twice, however the fix did not account for cases where iram was not fully filled with cache and therefore was of non 0 size.
Now the calculation should be correct regardless of the cache size.

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

Fix expected output
2022-12-19 14:33:10 +01:00
cfeb493694 docs: mention that increasing ESP32_REV_MIN can reduce IRAM size 2022-12-19 14:07:20 +01:00
2f0ed546f5 ci: add missing target-test jobs for sdcard and extflash examples 2022-12-19 14:06:11 +01:00
16f9add4f6 Remove -Wno-format compile option for bluedroid BLE examples 2022-12-19 20:27:06 +08:00
zwj
0733694f1f Update bt lib for ESP32
- Add config to set duplicate scan list refresh period
- overwrite the oldest device infor if the list is full
- Fixed duplicate scan period is not accurate
2022-12-19 20:26:17 +08:00
zwj
e7ee437bcf Update bt lib for ESP32-C3 and ESP32-S3
- Add config to set duplicate scan list refresh period
- overwrite the oldest device infor if the list is full
- Fixed duplicate scan period is not accurate
2022-12-19 20:24:26 +08:00
e95d7202ce update bt lib for ESP32-C3 and ESP32-S3
1 fixed privacy error for directed adv
2 fixed multi periodic adv sync failed in air
2022-12-19 20:23:34 +08:00
zwj
c656e7ec07 Fixed some memory was not released after bluetooth controller initialization failed on ESP32-C3 and ESP32-S3 2022-12-19 20:22:58 +08:00
0b8f0e5456 update bt-lib for ESP32
1 change default TX power to 9 dBm
2 fixed disconnect reason 0x1f (unspecified error)
3 fixed connection timeout due to terminate ind has not been acknowledged
2022-12-19 20:19:59 +08:00
zwj
5fff471b50 Fixed some memory was not released after bluetooth controller initialization failed on ESP32 2022-12-19 20:19:28 +08:00
938d912daa bluedroid: fix ble connection update with same params 2022-12-19 20:17:00 +08:00
e8fef195a2 examples: fix ble hid led output report 2022-12-19 20:17:00 +08:00
c97df72bb2 bluedroid: fix encrypt keysize of GATT characteristic permission 2022-12-19 20:17:00 +08:00
4b7702c0a4 bluedroid: correct the length of att read by type pdu 2022-12-19 20:17:00 +08:00
dfa9a81233 Merge branch 'feature/add_periodic_helper_macros_v5.0' into 'release/v5.0'
Nimble: Add helper macros to set interval min / max for periodic adv (v5.0)

See merge request espressif/esp-idf!21620
2022-12-19 19:33:27 +08:00
4ace4e6bec Merge branch 'bugfix/skip_sae_during_wps_v5.0' into 'release/v5.0'
esp_wifi: Add changes to skip SAE handshake during WPS connection

See merge request espressif/esp-idf!21677
2022-12-19 19:33:04 +08:00
bf8167ed42 fix typos in docs 2022-12-19 14:20:29 +08:00
c43c41967c fix typos error 2022-12-19 14:20:16 +08:00
270940dda0 esp_wifi: change max connection num on ESP32C3 and ESP32S3
Closes WIFI-5114
2022-12-19 14:20:05 +08:00
869d8c4fd8 esp_wifi: Update wifi libs
Update wifi libs with below changes -
1. reject AP when assoc comeback time given is greater than 5 seconds
2. handle when assoc req is received before SA query procedure is finished

Closes https://github.com/espressif/esp-idf/issues/9428
2022-12-19 14:19:14 +08:00
a01847c24f esp_wifi: fix multicast pkts drop issue for some AP when DTIM period > 1
Closes WIFI-5076
2022-12-19 14:18:27 +08:00
6818b3012d esp_wifi: upload more wifi pkt info in rx callback for espnow & csi 2022-12-19 14:16:48 +08:00
096aa4b84d esp_exmaples: Update ESP32C2 chip in Readme 2022-12-19 14:15:24 +08:00
2accc311a2 WiFi: Add WPS softAP registrar example and events 2022-12-19 14:09:05 +08:00
81f39c8d09 esp_wifi: fix softap beacon memory leak issue
1. fix softap beacon memory leak issue.
2. fix esp wifi sta get ap info does not return connected ssid issue.
3. update inactive timer when recv ps-poll or success send data.
4. decrease test memory leak threshold.
2022-12-19 14:07:22 +08:00
8281933297 Merge branch 'bugfix/bdsa_security_issues_v5.0' into 'release/v5.0'
esp_wifi:BDSA related patch updates

See merge request espressif/esp-idf!21676
2022-12-19 13:52:30 +08:00
32a50118a4 Assert when malloc user_data fail 2022-12-19 11:32:19 +08:00
474cf2cf64 Modified spp vfs example 2022-12-19 11:32:14 +08:00
29b718bdf5 Fixed memory leak when SPP initialization failed 2022-12-19 11:32:09 +08:00
3f5aaf11db Added esp_spp_vfs_unregister() to free memory allocated by esp_spp_vfs_register() 2022-12-19 11:32:01 +08:00
51dfbafce2 esp_wifi: Add changes to skip SAE handshake during WPS connection 2022-12-19 09:00:24 +05:30
c881f2dd6f Merge branch 'bugfix/flush_pmk_for_akm_change_v5.0' into 'release/v5.0'
esp_wifi: Flush PMK caching if bss akm has changed(backport v5.0)

See merge request espressif/esp-idf!21646
2022-12-19 10:47:29 +08:00
10bb4c8279 Merge branch 'bugfix/update_esp_rom_gpio_header_v5.0' into 'release/v5.0'
esp_rom: update rom gpio.h (backport v5.0)

See merge request espressif/esp-idf!21621
2022-12-19 10:47:24 +08:00
31a58dbb4e Merge branch 'bugfix/a2dp_error_code_v5.0' into 'release/v5.0'
bt: Update A2DP version to v1.4(v5.0)

See merge request espressif/esp-idf!21622
2022-12-19 10:46:58 +08:00
e566e0b597 esp_wifi:BDSA related patch updates 2022-12-19 02:14:26 +05:30
d2791b32fd esp_netif: Post IP event for PPP netifs unconditionally
IP update notification for "point to point" interfaces is performed
via the same callback function as for any other interfaces (dhcp_cb,
although it's not DHCP related). In P2P interfaces we have to assure
that we always get a notification, so we can set the interface up.
This was omitted when getting the same IP address for the second
time, causing the PPPoS interface (in esp-modem applications) failing
to reconnect if disconnected.

Closes https://github.com/espressif/esp-idf/issues/10308
Closes https://github.com/espressif/esp-protocols/issues/188
2022-12-16 18:32:55 +01:00
12f8e55d7c [Panic] also print to secondary USB Serial/JTAG Console 2022-12-16 14:40:00 +01:00
6d22959461 doc: recommend turn on psram xip feature for bounbe buffer mode 2022-12-16 17:48:28 +08:00
07d65333c3 rgb_lcd: support multi-fb with bounce buffer 2022-12-16 17:48:28 +08:00
e207c60805 Merge branch 'bugfix/no_more_public_adc2_dma_on_c3_s3_v5.0' into 'release/v5.0'
adc: no longer support adc2 continuous mode on esp32c3 and esp32s3 (v5.0)

See merge request espressif/esp-idf!21645
2022-12-16 17:46:31 +08:00
88c3e0b4d4 docs: Fix Secure DL mode documentation about flash read being unsupported
Simple flash read command is not supported if Secure DL mode is enabled on the target.
Remove reference of this from the relevant docs part.

Related: https://github.com/espressif/esptool/issues/810
Related: ESPTOOL-567
Closes IDF-6468
2022-12-16 11:51:52 +05:30
8866d09830 Merge branch 'bugfix/change_the_level_of_nimble_log_forv5.0' into 'release/v5.0'
ble_mesh:example:change the level of nimble host log(v5.0)

See merge request espressif/esp-idf!21628
2022-12-16 14:12:51 +08:00
ac5898c848 Merge branch 'bugfix/fix_mspi_timing_tuning_psram_timing_issue_v5.0' into 'release/v5.0'
mspi_tuning: fix psram timing tuning bug (v5.0)

See merge request espressif/esp-idf!21624
2022-12-16 14:05:59 +08:00
bb074904b4 adc: no longer support adc2 oneshot mode on esp32c3
Due to HW limitation, we don't support this anymore. On c3, ADC2 under oneshot mode is not stable.

However, you can enable CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 to force use
ADC2.

Refer to errata to know more details:
https://www.espressif.com/sites/default/files/documentation/esp32-s3_errata_en.pdf
https://www.espressif.com/sites/default/files/documentation/esp32-c3_errata_en.pdf
2022-12-16 12:07:38 +08:00
1c373cf293 adc: no longer support adc2 continuous mode on esp32c3 and esp32s3
Due to HW limitation, we don't support this anymore. On s3 and c3, ADC2 under continuous  mode is not stable.

However, you can enable CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 to force use
ADC2.

Refer to errata to know more details:
https://www.espressif.com/sites/default/files/documentation/esp32-s3_errata_en.pdf
https://www.espressif.com/sites/default/files/documentation/esp32-c3_errata_en.pdf
2022-12-16 12:07:38 +08:00
6fd80903de adc: added a soc macro indicating digital controller supported unit 2022-12-16 12:07:38 +08:00
39ed5dc39d esp_wifi: Flush PMK caching if bss akm has changed 2022-12-16 08:33:28 +05:30
eff97476eb ble_mesh:example:change the level of nimble host log 2022-12-15 17:57:12 +08:00
2369fa4d66 mspi_tuning: fix psram timing tuning bug
Prior to this commit, when calling:
- spi_timing_enter_mspi_low_speed_mode()
- spi_timing_enter_mspi_high_speed_mode()

psram timing is not tuned. This will lead to a stall during early
startup. This bug is on S3, for 80MHz DDR PSRAM

This commit will add psram timing tuning, in these two functions.
2022-12-15 17:04:23 +08:00
71bd180095 bt: Update HFP version to v1.8 2022-12-15 16:57:56 +08:00
e5794669de bt: Update A2DP version to v1.4 2022-12-15 16:57:51 +08:00
9bd1484386 bt:Fixed the use of invalid configuration when the peer device configures the stream, and returned an incorrect error code 2022-12-15 16:57:46 +08:00
5f7d8bfd6b esp_rom: update rom gpio.h 2022-12-15 16:27:57 +08:00
1623ad0a25 Nimble: Add helper macros to set interval min / max for periodic adv 2022-12-15 13:41:24 +05:30
5278cc7de0 Merge branch 'bugfix/fix_failure_of_wifi_channel_configuration_v5.0' into 'release/v5.0'
phy: only set phy_init_flag at power domain off, when all modems deinit

See merge request espressif/esp-idf!21610
2022-12-15 13:52:30 +08:00
8ba9f8a6cf ci: fix esp_phy_modem_deinit issue 2022-12-15 10:48:04 +08:00
7d16868e32 phy: only set phy_init_flag at power domain off, when all modems deinit 2022-12-15 10:45:09 +08:00
0fa3443cea cxx: fixed stack smash test case failing due to changed output
__stack_chk_fail no longer prints "abort() was called" message,
changed test case to reflect this.
2022-12-14 12:37:23 +01:00
87a738962e esp_system: fix placement of __stack_chk_fail from flash to RAM
When stack check is enabled, certain functions (sometimes placed in RAM)
are being decorated with stack guards and a call to __stask_chk_fail() in
case ofr stack corruption. For this reason, __stack_chk_fail() must be
placed in RAM too.

Add stack check config in heap tests on all targets to find eventual flash to RAM
calls due to stack checks when running callgraph_check.py
2022-12-14 12:37:23 +01:00
72e7cbee88 heap: Remove size check in multi_heap.c when registering a new heap
The tlsf now checks for size validity when creating a new heap.

The check previously done in multi_heap_register_impl() is no longer
valid since the tlsf_size() is not known at this time (as the metadata
size is linked ot the size of the memory region passed as parameter
when calling tlsf_create_with_pool())

The tlsf_create_with_pool() will return a null pointer if the size
of the memory is not big enough to hold the metadata overhead and
at least a small block.

Update the test according to the changes in TLSF API
2022-12-14 12:37:23 +01:00
47dc520538 heap: Update host tests after incorporation of the new TLSF implementation 2022-12-14 12:37:23 +01:00
6c926ab7b0 heap: Update the component to incorporate the new TLSF implementation
- remove tlsf_platform.h from esp-idf since the fl_index is now calculated
  based on the size of the requested heap
- update CMakeLists.txt accordingly
2022-12-14 12:37:23 +01:00
be74fd1e8c heap: fix linker issues and remove spi flash dependencies 2022-12-14 12:37:23 +01:00
35260d4325 feat: remove tlsf_fls and tlsf_ffs from linker as they are inlined. 2022-12-14 12:37:23 +01:00
c47ea5d2bb tools: update list of references to not include symbold used by __assert_func calls
On xtensa architecture, the call to __assert_func uses a reference to __func__ that can
sometimes be placed in flash. Since the __asert_func can be called from functions in IRAM
the check_callgraph script can report an error when checking for invalid calls from IRAM
to flash sections. However, the __asert_func prevents this scenario at runtime so the
check_callgraph script reports a 'flas positive' situation. For this reasson, all references
to __func__$x found prior to a call to __assert_func are droped in the parsing of the rtl files.
2022-12-14 12:37:23 +01:00
e92250e6a2 heap: add check for usage of flash content from iram
this commits:
- adds build-time test to check that no call to flash regions are done from IRAM functions

- resolves problems related to IRAM function using content in flash memory

- update heap_caps_alloc_failed to use a default function name in DRAM
  when necessary instead of creating a function name variable in DRAM for
  each call of heap_caps_alloc_failed. This allows to save some extra bytes
  in RAM.
2022-12-14 12:37:16 +01:00
9ae796b36b Merge branch 'fix/tools_gdbgui_requirement_v5.0' into 'release/v5.0'
Tools: gdbgui is not supported on Python 3.11 (v5.0)

See merge request espressif/esp-idf!21598
2022-12-14 19:28:53 +08:00
d8db7d7cc4 Merge branch 'feature/esp_https_ota_events_v5.0' into 'release/v5.0'
esp_https_ota: Added support for esp_events (v5.0)

See merge request espressif/esp-idf!21109
2022-12-14 17:11:50 +08:00
34a1a1b098 Tools: gdbgui is not supported on Python 3.11
This is a follow-up of a816dfbfc3 with
additional check.

Related to https://github.com/espressif/esp-idf/issues/10116
2022-12-14 09:50:11 +01:00
eb08eb6578 Merge branch 'feature/esp32c2_optimize_npl_element_count_v5.0' into 'release/v5.0'
Feature/esp32c2 optimize npl element count v5.0

See merge request espressif/esp-idf!21563
2022-12-14 15:13:42 +08:00
fe0d9a5cf4 Merge branch 'docs/provide_CN_translation_for_peripherals_migration_guides_v5.0' into 'release/v5.0'
docs: provide CN translation for peripherals in migration guides (v5.0)

See merge request espressif/esp-idf!20292
2022-12-14 12:44:43 +08:00
8881fd2f9c docs: provide CN translation for peripherals in migration guides (v5.0) 2022-12-14 12:44:43 +08:00
232a4aee15 Merge branch 'feature/report_acl_conn_cmp_stat_to_app_v5.0' into 'release/v5.0'
feature/report ACL link related events to application (v5.0)

See merge request espressif/esp-idf!21524
2022-12-14 10:45:15 +08:00
88a82c89c6 Merge branch 'feature/nimble_support_ble_max_conn_num_v5.0' into 'release/v5.0'
Nimble:  Support maximum number of connections to 9 on ESP32-C3 and ESP32-S3 (v5.0)

See merge request espressif/esp-idf!21550
2022-12-14 10:44:50 +08:00
625483193a Merge branch 'doc/update_nimble_mesh_example_information_v5.0' into 'release/v5.0'
Nimble: Update Mesh example documentation (v5.0)

See merge request espressif/esp-idf!21578
2022-12-14 10:44:11 +08:00
zwl
e8555efe5b Renamed BAH 2022-12-13 18:05:00 +08:00
zwl
756dbc3f94 Fixed some occasional ble issues on ESP32H2BETA2 2022-12-13 17:50:14 +08:00
zwl
5cab9686bb Optimized the number of npl on ESP32C2 2022-12-13 17:50:00 +08:00
a3b040e991 Merge branch 'feature/_spi_slave_reset_trans_queue_api_v5.0' into 'release/v5.0'
spi: limit esp32 dma workaround only on esp32(v5.0)

See merge request espressif/esp-idf!21381
2022-12-13 16:29:41 +08:00
71e1c0a564 Nimble: Update documentation to include distinction between upstream
mesh example and ESP-BLE-MESH
2022-12-13 12:56:06 +05:30
fe18c89961 Merge branch 'bugfix/system_examples_print_format_v5.0' into 'release/v5.0'
system: fix printf format errors in all system examples (v5.0)

See merge request espressif/esp-idf!21564
2022-12-13 13:40:56 +08:00
cc3dd0046d Merge branch 'bugfix/unstall_other_cpu_on_core_reset_v5.0' into 'release/v5.0'
bugfix: unstall other cpu on core reset (backport v5.0)

See merge request espressif/esp-idf!21497
2022-12-12 20:05:05 +08:00
12535d6d75 Merge branch 'contrib/github_pr_9529_v5.0' into 'release/v5.0'
component_bt: Fixed memory leak due to not freeing memory if posting a message to a thread fails(v5.0)

See merge request espressif/esp-idf!21556
2022-12-12 17:54:13 +08:00
f81cae4e1e system: fix printf format errors in all system and cxx examples 2022-12-12 16:56:20 +08:00
12a069d593 Merge branch 'feature/seperate_ble_wifi_test_environment_v5.0' into 'release/v5.0'
seperate ble wifi environment and support ci esp32c2 (backport v5.0)

See merge request espressif/esp-idf!20084
2022-12-12 16:36:20 +08:00
96ff16199a seperate ble wifi environment and support ci esp32c2 (backport v5.0) 2022-12-12 16:36:20 +08:00
3691ce2329 Merge branch 'feature/periodic_adv_example_v5.0' into 'release/v5.0'
Nimble: support for periodic adv / sync example (v5.0)

See merge request espressif/esp-idf!20341
2022-12-12 14:53:21 +08:00
640b86025b Merge branch 'bugfix/correct_the_default_SR_mode_v5.0' into 'release/v5.0'
bugfix/correct the SR_mode selection when konw nothing about Peripheral's SR_mode (v5.0)

See merge request espressif/esp-idf!21519
2022-12-12 14:51:57 +08:00
3fcbf617ec Merge branch 'rebase/remove_redundant_pm_lock_on_ble_v5.0' into 'release/v5.0'
Rebase/remove redundant pm lock on ble v5.0

See merge request espressif/esp-idf!21423
2022-12-12 14:49:37 +08:00
5a9281de5d Merge branch 'ci/change_cache_runner_label_v5.0' into 'release/v5.0'
Ci/change cache runner label (v5.0)

See merge request espressif/esp-idf!21549
2022-12-12 14:03:04 +08:00
7cb4504c55 Merge branch 'doc/esp_lcd_class_diagram_v5.0' into 'release/v5.0'
RGB LCD multi-framebuffer support (v5.0)

See merge request espressif/esp-idf!21476
2022-12-12 11:47:38 +08:00
6321e24bac Merge branch 'feature/enc28j60_not_new_design_v5.0' into 'release/v5.0'
Ethernet examples: added warning that ENC28J60 is not recommended for new designs (v5.0)

See merge request espressif/esp-idf!21546
2022-12-12 11:41:19 +08:00
987e6b4e29 Merge branch 'bugfix/fix_xip_from_psram_cache_disable_issue_v5.0' into 'release/v5.0'
system: don't disable cache if Flash .text and .rodata are moved to PSRAM (v5.0)

See merge request espressif/esp-idf!21540
2022-12-12 11:37:27 +08:00
6fdd8552da Fixed incorrect parameters in switching to BTC context 2022-12-12 11:26:39 +08:00
c0392d3dd9 bt:Modify the member variable *arg in struct btc_msg to arg[0] 2022-12-12 11:26:34 +08:00
f9732cb65f bt: Fixed memory leak due to not freeing memory if posting a message to a thread fails 2022-12-12 11:26:26 +08:00
818ba6affb Merge branch 'bugfix/spp_50005_crash_v5.0' into 'release/v5.0'
bt: Added esp_spp_enhanced_init() API to indicate whether to enable L2CAP ERTM(v5.0)

See merge request espressif/esp-idf!20822
2022-12-12 11:00:28 +08:00
7d68a35cbe Nimble: Support maximum number of connections to 9 on ESP32-C3 and ESP32-S3 2022-12-11 18:16:05 +05:30
85e1927add ci: use different tag for runners to run the cache jobs 2022-12-09 20:20:35 +08:00
49f673c52d Improved emac rx task code to suppress Coverity false positive memory leak indication 2022-12-09 11:57:25 +00:00
df76911671 esp_eth: receive buffer allocation optimization
Receive buffers are allocated with a size equal to actual received frame size
2022-12-09 11:43:19 +00:00
a811ea38b9 Ethernet examples: added warning that ENC28J60 is not recommended for new designs using ESP32 series of chips 2022-12-09 11:35:07 +00:00
06e1ff2881 system: don't disable cache if Flash .text and .rodata are moved to PSRAM 2022-12-09 18:02:57 +08:00
23dda413a5 Merge branch 'fix/add-region-allowed-checks_v5.0' into 'release/v5.0'
heap: Fix memory boundary condition checks when adding new region (backport v5.0)

See merge request espressif/esp-idf!20557
2022-12-09 17:27:39 +08:00
0b971cf314 Merge branch 'fix/fix_behaviour_of_api_to_set_fe_release_mode_v5.0' into 'release/v5.0'
esp_flash_encrypt: If it is supported then Enable secure download mode in... (v5.0)

See merge request espressif/esp-idf!21493
2022-12-09 17:18:34 +08:00
842349de6d ble: fix occasional assertion on ble rtc intr 2022-12-09 15:25:37 +08:00
zwl
de7e62fdfe Unify controller internal error code on ESP32-C2 2022-12-09 15:25:37 +08:00
5c481c5a08 ble: remove redundant pm lock on ble 2022-12-09 15:25:37 +08:00
0bb86b0eaa Merge branch 'fix/docs-SYSVIEW_FreeRTOS_txt-path_v5.0' into 'release/v5.0'
docs: fix path to SYSVIEW_FreeRTOS.txt (v5.0)

See merge request espressif/esp-idf!21507
2022-12-09 14:18:48 +08:00
254afaba28 Added ACL link related events handler in A2DP sink GAP callback 2022-12-09 11:08:10 +08:00
80da46eff3 Added reporting for ACL link related events to application 2022-12-09 11:07:50 +08:00
a1de1bfd3c correct the SR_mode selection when konw nothing about Peripheral 2022-12-09 10:24:24 +08:00
2693c89c05 Merge branch 'bugfix/notify_gattc_to_gatts_v5.0' into 'release/v5.0'
NimBLE : Change GATT notify/indicate from gattc to gatts (v5.0)

See merge request espressif/esp-idf!20892
2022-12-08 20:36:25 +08:00
fd10ca4293 docs: fix path to SYSVIEW_FreeRTOS.txt 2022-12-08 17:25:36 +07:00
d4ff9f13c7 Merge branch 'bugfix/fix_esp_https_server_initialize_v5.0' into 'release/v5.0'
esp_https_server: Fix initializers missing in esp_https_server (backport v5.0)

See merge request espressif/esp-idf!21481
2022-12-08 16:00:14 +08:00
c280d4b56e bugfix: unstall other cpu on core reset
- Closes https://github.com/espressif/esp-idf/issues/10320
2022-12-08 15:40:56 +08:00
04cdc55efc esp_flash_encrypt: If it is supported then Enable secure download mode in release mode instead of disabling it completely. 2022-12-08 10:28:30 +05:30
ed663e395f Merge branch 'feature/support_le_power_control_v5.0' into 'release/v5.0'
Nimble: Add LE Power CTRL changes (v5.0)

See merge request espressif/esp-idf!21188
2022-12-08 11:53:00 +08:00
9dd8e497fd Merge branch 'feature/esp_tls_add_cert_selection_callback_v5.0' into 'release/v5.0'
esp-tls: Add support for the CERTIFICATE SELECTION HOOK. The hook has access... (v5.0)

See merge request espressif/esp-idf!21220
2022-12-08 11:52:45 +08:00
67f1ff7fa1 Merge branch 'feature/gd_e_hpm_support_v5.0' into 'release/v5.0'
spi_flash: Add GD25QxxE and ZBit flash HPM(120M) support(backport v5.0)

See merge request espressif/esp-idf!20240
2022-12-08 11:52:21 +08:00
1c45872a00 doc: add api reference for controller lcd drivers 2022-12-07 17:55:19 +08:00
698fd7abb3 lcd: support multi framebuffers for RGB LCD driver 2022-12-07 17:55:19 +08:00
654e198464 bt: Remove SPP default send buffer size option and add parameters to configure send buffer size in esp_spp_enhance_init() 2022-12-07 09:38:24 +00:00
c2c9b090c7 bt: Added esp_spp_enhance_init() API to indicate whether to enable L2CAP ERTM 2022-12-07 09:38:24 +00:00
6d57e7878d bt: Keep the maximum number of credits unchanged 2022-12-07 09:38:24 +00:00
aa25c4391c bt: Replaced the tx queue in SPP VFS mode with ringbuffer 2022-12-07 09:38:24 +00:00
6d9987f4c8 bt: Split SPP application layer data packets according to the MTU of the peer 2022-12-07 09:38:24 +00:00
bce0e93b73 bt: Enter the congestion state when the queue length waiting for the peer to ack is greater than or equal to the L2CAP ERTM tx window size 2022-12-07 09:38:24 +00:00
b1d87a41d2 NimBLE : Change GATT notify/indicate from gattc to gatts 2022-12-07 14:41:51 +05:30
22b82efbe5 Merge branch 'bugfix/tool_removal_offer_macOS_v5.0' into 'release/v5.0'
Tools: bugfix Export script offers cmake & ninja for removal on macOS (v5.0)

See merge request espressif/esp-idf!21451
2022-12-07 17:06:19 +08:00
d48b085735 esp_https_server: Fix initializers missing in esp_https_server 2022-12-07 14:36:26 +08:00
9d3e15704c Nimble: Add example for periodic adv/sync 2022-12-07 11:56:10 +05:30
c3d3ee8767 Merge branch 'contrib/github_pr_10106_v5.0' into 'release/v5.0'
hal/uart_ll.h: Fix compile with C++ (GitHub PR) (v5.0)

See merge request espressif/esp-idf!21454
2022-12-07 13:24:12 +08:00
5397b7300a Merge branch 'feature/add_keep_alive_for_httpserver_v5.0' into 'release/v5.0'
esp_http_server: Add support to enable TCP keepalive config (backport v5.0)

See merge request espressif/esp-idf!21426
2022-12-07 12:11:39 +08:00
23f7989006 Merge branch 'bugfix/reduce_BTU_TASK_stack_consumption_v5.0' into 'release/v5.0'
Reduce the stack consumption of BTU_TASK (backport v5.0)

See merge request espressif/esp-idf!21434
2022-12-07 11:29:39 +08:00
4fb6f42120 Merge branch 'feature/support_rotating_lcd_ssd1306_v5.0' into 'release/v5.0'
Support rotation on SSD1306 (backport v5.0)

See merge request espressif/esp-idf!21468
2022-12-07 11:14:44 +08:00
27de5e8a1b Merge branch 'bugfix/fix_lwip_bugs_1206_v5.0' into 'release/v5.0'
lwip: fix some lwip bugs (backport v5.0)

See merge request espressif/esp-idf!21464
2022-12-07 11:13:23 +08:00
70e8f96d92 Merge branch 'docs/remote_signing_of_images_cmd_fix_v5.0' into 'release/v5.0'
docs: fix secure boot "Remote Signing of Images" section command (v5.0)

See merge request espressif/esp-idf!21470
2022-12-07 11:11:16 +08:00
313edcd8a5 Merge branch 'bugfix/freertos_fpu_isr_pins_task_v5.0' into 'release/v5.0'
FreeRTOS: Fix bug where FPU usage in ISR pins the interrupted task (v5.0)

See merge request espressif/esp-idf!20626
2022-12-07 05:02:01 +08:00
43cdd2bfe2 docs: fix secure boot "Remote Signing of Images" section command 2022-12-06 23:46:34 +05:30
5faeb1e97e Merge branch 'bugfix/freertos_port_miss_header_v5.0' into 'release/v5.0'
freertos: add missing header include for esp_chip_info.h to port.c (v5.0)

See merge request espressif/esp-idf!21458
2022-12-06 23:00:03 +08:00
5f6eac2283 lcd: Support rotation SSD1306 and fix mirror y. 2022-12-06 15:24:19 +01:00
795a70f8b3 Merge branch 'bugfix/Fix_exceptional_list_params_check_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix exceptional list parameters check issue(v5.0)

See merge request espressif/esp-idf!21441
2022-12-06 20:41:08 +08:00
e843281c8f Merge branch 'doc/explain_ledc_callback_return_value_v5.0' into 'release/v5.0'
ledc: explain the callback return value (v5.0)

See merge request espressif/esp-idf!20966
2022-12-06 18:08:32 +08:00
ffdec34c11 Merge branch 'bugfix/hints_require_v5.0' into 'release/v5.0'
hints: add a more complete description for component not found errors (v5.0)

See merge request espressif/esp-idf!21457
2022-12-06 17:33:18 +08:00
e8e79e8e16 Nimble: Add LE Power CTRL changes 2022-12-06 14:56:20 +05:30
0e04bff488 Merge branch 'feature/LE_Conn_Subrating_v5.0' into 'release/v5.0'
Nimble: Stack support for Connection subrating feature (v5.0)

See merge request espressif/esp-idf!20814
2022-12-06 17:21:57 +08:00
8e4bcb4875 Merge branch 'feature/add_comments_for_bt_connections' into 'release/v5.0'
Explain how much memory that will be used by each connection/advertiser.

See merge request espressif/esp-idf!21322
2022-12-06 17:21:12 +08:00
8290b18e5c Merge branch 'feat/NimBLE-Blufi-custom-use_v5.0' into 'release/v5.0'
Nimble: Add support to expose blufi handler for external BLE application (v5.0)

See merge request espressif/esp-idf!20890
2022-12-06 16:51:38 +08:00
651db95177 lwip:optimization dns ipv4 ipv6 timeir
* Update submodule: git log --oneline 33912690ea005e8ff05b2c579ebbf0a4189c3b00..705dd71d46779bf29653f1f1d7b1af5a09fb2aa7

Detailed description of the changes:
  - dhcp: init fine timer when dhcp start(esp-lwip@705dd71d)
  - ip6 timer: optimization lwip ip6 reassembly timer (esp-lwip@9813ea9a)
  - ip4 timer: optimization lwip ip4 reassembly timer (esp-lwip@ce1a7099)
  - dns timer: optimization lwip dns timer (esp-lwip@6b0bfc2e)
2022-12-06 16:06:57 +08:00
ebd1609073 lwip timer:optimization dhcp fine timer 2022-12-06 16:04:21 +08:00
4d46e8205a lwip: fix the bug that long time to get IP 2022-12-06 16:01:38 +08:00
4757c9e389 Merge branch 'bugfix/multiple_wifi_fixes_v5.0_wave2' into 'release/v5.0'
esp_wifi : update wifi lib

See merge request espressif/esp-idf!21427
2022-12-06 15:25:55 +08:00
7a72210157 Blufi: Add function for blufi management inside custom gap event handler 2022-12-06 10:53:09 +05:30
7aa2b03204 esp_wifi: fix the ESPNOW crash when modify the interface of the peer
Closes WIFI-5046
Closes WIFI-5047
2022-12-06 05:06:18 +00:00
ffadd88af4 esp_wifi: Update wifi libs
- Fixed regression caused in commit ef80cf0b65
- Fixed unprotected SA Query issue
2022-12-06 05:06:18 +00:00
38bb7c2a60 esp_wifi:Mandate stations to have minimum security wpa3 2022-12-06 05:06:18 +00:00
8136f98ddc esp_wifi: Update wifi libs
Add changes to prevent security overwritten in full scan

Co-authored-by: Nachiket Kukade <nachiket.kukade@espressif.com>
2022-12-06 05:06:18 +00:00
0db6920b8c esp_wifi: Update wifi libs
Fix unprotected SA Query issue and scan regression
2022-12-06 05:06:18 +00:00
91804983b7 esp_wifi: fix esp32c3 connect fail
Closes IDFCI-1524
2022-12-06 05:06:18 +00:00
8afd990e71 update wifi lib:
1. Modify wifi max connection num
2. Fix the ESPNOW senf fail after changing opmode

Closes IDFGH-7960
Closes WIFI-4176
Closes WIFI-5004
2022-12-06 05:06:18 +00:00
fe4efc0df6 update doc for espnow max encryped connection 2022-12-06 05:06:18 +00:00
175f0dec6c Modify maximum softap conn num and espnow encryption peer num 2022-12-06 05:06:18 +00:00
b2396cee86 Merge branch 'bugfix/multiple_wifi_fixes_v5.0' into 'release/v5.0'
esp_wifi: update wifi lib

See merge request espressif/esp-idf!21425
2022-12-06 13:05:08 +08:00
7add623e73 freertos: add missing header include for esp_chip_info.h to port.c
Closes https://github.com/espressif/esp-idf/issues/10310
2022-12-06 12:17:17 +08:00
c3f578d17c hints: add a more complete description for component not found errors 2022-12-06 12:16:24 +08:00
9aba2fe078 Merge branch 'bugfix/remove_get_modle_and_get_comp_api_forv5.0' into 'release/v5.0'
ble_mesh:example:change the method of get model(for v5.0)

See merge request espressif/esp-idf!20388
2022-12-06 10:52:05 +08:00
5ba75187b0 hal/uart_ll.h: Fix compile with C++
I'm including <hal/uart_ll.h> in my C++ application because I need to
bypass the uart driver. The inline functions in the header file fail to
compile as C++.

All of the enums need explicit casts for conversion to/from integers.

Merges https://github.com/espressif/esp-idf/pull/10106
2022-12-06 10:13:03 +08:00
e1f486a49f Merge branch 'feature/remove_psram_cs_clk_pin_settings_config_s2_s3_v5.0' into 'release/v5.0'
psram: remove CS/CLK pin settings in kconfig on ESP32S2/S3 (v5.0)

See merge request espressif/esp-idf!21042
2022-12-06 10:09:41 +08:00
ad9884463c freertos: Backport FPU tests from master to v5.0
This commit combines and backports the FPU unit tests updates of the following
commits:

423fb361e7
d69361779e
2022-12-06 00:03:50 +08:00
13b8a8f2af freertos: Fix FPU ISR core pinning bug
This commit fixes a bug where if an unpinned task is interrupted by a level 1
ISR that users the FPU, the FPU usage will cause the interrupted task to
become pinned to the current core.

Note: This bug was already fixed in SMP FreeRTOS in commit
d69361779e. This commit simply backports the
fix to IDF FreeRTOS.
2022-12-06 00:03:50 +08:00
39ee8117c3 Tools: bugfix Export script offers cmake & ninja for removal on macOS 2022-12-05 15:56:08 +01:00
a4782767d9 Merge branch 'feature/mqtt_cmakefile_cleanup_v5.0' into 'release/v5.0'
Mqtt:  Cmakelists.txt file simplification. (v5.0)

See merge request espressif/esp-idf!20493
2022-12-05 20:43:10 +08:00
9d79c71498 ble_mesh: stack: Fix exceptional list parameters check issue 2022-12-05 20:24:21 +08:00
6688ba7b8e Merge branch 'ci/upload_elf_map_to_minio_v5.0' into 'release/v5.0'
ci: upload elf map file to s3 server to reduce artifacts size (v5.0)

See merge request espressif/esp-idf!19902
2022-12-05 18:17:59 +08:00
zwj
7884457d1f Reduce the stack consumption of BTU_TASK 2022-12-05 17:12:27 +08:00
3867f7cf70 ble_mesh:example:change the method of get model 2022-12-05 16:47:41 +08:00
759f7ec13d Merge branch 'feature/add_int_task_wdt_esp32c2_v5.0' into 'release/v5.0'
WDT: implement interrupt wdt and task wdt for ESP32-C2 (backport v5.0)

See merge request espressif/esp-idf!20980
2022-12-05 16:38:35 +08:00
6536aee5cc Merge branch 'bugfix/xtensa_freertos_16B_aligned_v5.0' into 'release/v5.0'
FreeRTOS: Make the default stack alignment 16 for Xtensa (backport v5.0)

See merge request espressif/esp-idf!21078
2022-12-05 16:38:25 +08:00
9af06d112c Merge branch 'bugfix/rtc_retain_mem_always_erased_v5.0' into 'release/v5.0'
Bootloader: retained memory can now be kept after reboot when custom data enabled (backport v5.0)

See merge request espressif/esp-idf!21232
2022-12-05 16:38:08 +08:00
2d826ddf3a Merge branch 'bugfix/add_missing_ifdef_to_static_structs_v5.0' into 'release/v5.0'
freertos: Add missing ESP_PLATFORM preprocessor directive for FreeRTOS static data structs (v5.0)

See merge request espressif/esp-idf!20743
2022-12-05 15:28:24 +08:00
9f49fa2c1b Merge branch 'bugfix/s3_ulp_riscv_cocpu_trap_v5.0' into 'release/v5.0'
ulp-riscv: always force COCPU clock on S3 (v5.0)

See merge request espressif/esp-idf!20768
2022-12-05 14:50:48 +08:00
027d92da14 Merge branch 'bugfix/fix_https_x509_example_v5.0' into 'release/v5.0'
ci: fix https_x509 example (v5.0)

See merge request espressif/esp-idf!20937
2022-12-05 14:15:47 +08:00
77333d2d64 Merge branch 'bugfix/fix_current_leakage_when_hold_digital_io_during_deep_sleep_backport_v5.0' into 'release/v5.0'
esp_hw_support/sleep: fix current leakage when hold digital io during deep sleep(backport v5.0)

See merge request espressif/esp-idf!20806
2022-12-05 14:00:59 +08:00
76657faec3 Merge branch 'fix/secure_boot_v2_fix_warning_message_v5.0' into 'release/v5.0'
Fix/secure boot v2 fix warning message (v5.0)

See merge request espressif/esp-idf!21274
2022-12-05 12:21:31 +08:00
755ee147bd Merge branch 'feature/support_ble_max_conn_num_to_9_v5.0' into 'release/v5.0'
Support bluedroid host maximum number of connections to 9 (backport v5.0)

See merge request espressif/esp-idf!21400
2022-12-05 12:16:53 +08:00
ec7265dca4 spi: limit esp32 dma workaround only on esp32 2022-12-05 12:10:45 +08:00
c60ccebb77 Merge branch 'bugfix/share_intr_v5.0' into 'release/v5.0'
intr_alloc: fixed freed interrupt sources not being able to be allocated again with different flags (v5.0)

See merge request espressif/esp-idf!21285
2022-12-05 12:09:52 +08:00
3fd37357b6 Merge branch 'bugfix/c2_chip_info_gpio_range_v5.0' into 'release/v5.0'
hw-support: update C2 chip info to reflect that esp8684 has embedded flash (v5.0)

See merge request espressif/esp-idf!21066
2022-12-05 12:06:39 +08:00
586a4715ad Nimble: Stack support for Connection subrating feature 2022-12-05 09:26:11 +05:30
311b50498b esp_http_server: Add support to enable TCP keepalive config
Closes https://github.com/espressif/esp-idf/issues/9848
2022-12-05 11:43:06 +08:00
19fae974fa esp_mesh: fix the memeory leak issue when call esp_mesh_start/stop
Closes WIFI-5023
Closes FCS-1081
Closes IDFGH-4525
2022-12-05 11:39:34 +08:00
64d17fc9bc Merge branch 'feature/iram_overflow_hint_v5.0' into 'release/v5.0'
idf.py hints: add hint IRAM overflow (v5.0)

See merge request espressif/esp-idf!20736
2022-12-05 11:37:06 +08:00
e4161a1bc1 esp_wifi_mesh: update wifi mesh libs
1. fix invalid child issue
2. fix WIFI_EVENT_AP_STADISCONNECTED event error
2022-12-05 11:37:06 +08:00
5cd324413a esp_wifi: fix some connectionless related issue and add connectionless power save guide 2022-12-05 11:35:23 +08:00
675f9555df esp_wifi: fix some softap issues
1. add lldesc_config and clr PWR MGT flag
2. send null data instead of qos null data when receive ps-poll while power save queue is empty
3. update power save queue hw len
4. set more data bit
5. only send null data when psq hw len is 0 after recv ps-poll
2022-12-05 11:33:50 +08:00
a5d2158cd0 Apply suggestions to 2 files 2022-12-05 11:32:03 +08:00
054fdeb8c7 esp_wifi: Modify wifi scan return value.
1. Modify wifi scan return value same to docs.
2. Change some logs' log level wo avoid misunderstanding.
3. Fix connect fail return wrong error code issue
2022-12-05 11:31:52 +08:00
645e5657c6 update doc for set channel 2022-12-05 11:31:40 +08:00
acf7f03f67 update wifi reason code 2022-12-05 11:31:27 +08:00
f768845b16 esp_wifi: fix wapi gtk id compability issue and adapt tx frag pn sequently. 2022-12-05 11:30:51 +08:00
8819aa2f38 esp_https_server: fix coverity warning about null pointer dereference 2022-12-05 08:59:24 +05:30
16e18d9170 esp-tls/Kconfig: Fix dependency for ESP-TLS Server menuconfig option 2022-12-05 08:59:24 +05:30
079e10666a esp_tls: Update documentation for cert callback 2022-12-05 08:59:24 +05:30
6ef7d24fc9 esp-tls: Add changes to the Cert selection callback PR. 2022-12-05 08:59:24 +05:30
e6442657fd esp-tls: Add support for the CERTIFICATE SELECTION HOOK. The hook has access to required information so that the application can make a more informed decision on which certificate to serve (such as alpn value, server certificate type, etc.)
Closes https://github.com/espressif/esp-idf/pull/9833

Signed-off-by: Aditya Patwardhan <aditya.patwardhan@espressif.com>
2022-12-05 08:59:24 +05:30
39080a2d59 docs: update BluFi documentation 2022-12-05 11:23:41 +08:00
497b45186e blufi: update version to 1.3
record connecting status, got ip status, maximum retry, connection end info (reason code, rssi) and provide greater information to phone
2022-12-05 11:23:29 +08:00
9a914cc6d4 ci: fix https_x509 example 2022-12-05 03:17:08 +00:00
14efa6e214 Merge branch 'feature/upgrade_argtable_3_2_2_files_v5.0' into 'release/v5.0'
console: argtable3: upgrade to v3.2.2 (v5.0)

See merge request espressif/esp-idf!21013
2022-12-05 11:16:31 +08:00
3290fc1a6d Merge branch 'bugfix/multiple_bugfixes_v5.0' into 'release/v5.0'
Add multiple bugfixes (Backport v5.0)

See merge request espressif/esp-idf!20997
2022-12-05 11:16:27 +08:00
e15dfec417 Merge branch 'fix/esp_http_client_fix_behavior_disable_auto_redirect_enabled_v5.0' into 'release/v5.0'
fix: esp_http_client fix behaviour when disable_auto_redirect is enabled (v5.0)

See merge request espressif/esp-idf!21081
2022-12-05 11:14:57 +08:00
c13c884921 Merge branch 'bugfix/esp_timer_isr_dispatch_test_fail_v5.0' into 'release/v5.0'
esp_timer: fix ESP_TIMER_ISR dispatch method due to off by one error (v5.0)

See merge request espressif/esp-idf!21026
2022-12-05 11:12:27 +08:00
f8aeda2d45 Merge branch 'ci/optimize_test_wifi_get_started_v5.0' into 'release/v5.0'
CI: optimize wifi get started example test (v5.0)

See merge request espressif/esp-idf!20607
2022-12-05 10:45:52 +08:00
d14f5c5cf4 Merge branch 'ci/example_test_simple_sniffer_v5.0' into 'release/v5.0'
ci: change example simple sniffer test channel (v5.0)

See merge request espressif/esp-idf!20524
2022-12-05 10:44:24 +08:00
2643e4b320 idf.py hints: add hint IRAM overflow 2022-12-05 10:34:41 +08:00
864ca34199 Merge branch 'bugfix/i2c_func_iram_v5.0' into 'release/v5.0'
I2C: put some interrupt used functions into IRAM( v5.0)

See merge request espressif/esp-idf!21404
2022-12-05 10:31:33 +08:00
a918c13db5 examples: update max GPIO range for C2 examples to exclude UART0 pins
Closes https://github.com/espressif/esp-idf/issues/10174
2022-12-05 02:29:46 +00:00
7cd7056341 hw-support: update C2 chip info to reflect that esp8684 has embedded flash
Closes https://github.com/espressif/esp-idf/issues/10175
2022-12-05 02:29:46 +00:00
218a797ecc Merge branch 'ci/enable_c2_tests_default_v5.0' into 'release/v5.0'
ci: enable running C2 tests by default (v5.0)

See merge request espressif/esp-idf!21105
2022-12-05 10:29:15 +08:00
4756a44c97 Merge branch 'feature/rgb_lcd_restart_v5.0' into 'release/v5.0'
rgb_lcd: support restart dma transmission manually (v5.0)

See merge request espressif/esp-idf!21408
2022-12-05 10:24:53 +08:00
631ba1e88d Merge branch 'bugfix/fix_slave_gpio_cs_mixed_with_iomux_bus_v5.0' into 'release/v5.0'
spi_slave: fix slave can't use iomux bus mixed with gpio cs_pin (v5.0)

See merge request espressif/esp-idf!21374
2022-12-05 10:21:09 +08:00
2dd67ecd05 ledc: explain the callback return value
Closes https://github.com/espressif/esp-idf/issues/10093
2022-12-05 02:11:48 +00:00
31ebcad8d6 Merge branch 'contrib/github_pr_7144_v5.0' into 'release/v5.0'
Update i2c.c to consider two I2C buses for clear bus counter (GitHub PR) (backport v5.0)

See merge request espressif/esp-idf!20504
2022-12-05 10:11:18 +08:00
aff2157f10 Merge branch 'feature/esp_rom_alias_mz_crc32_to_crc32_le_v5.0' into 'release/v5.0'
move {target}/rom/miniz.h to a common miniz.h (backport to v5.0)

See merge request espressif/esp-idf!21104
2022-12-05 10:10:38 +08:00
a3275f2b9e Merge branch 'feature/usb_host_inflight_transfer_check_v5.0' into 'release/v5.0'
USB Host: Fix usbh_dev_open(), Fix usbh_ep_alloc(), Add USB Host Library check to prevent resubmitting inflight transfers, Don't access uninit pointer if usbh_install fails (backport v5.0)

See merge request espressif/esp-idf!20953
2022-12-05 10:08:32 +08:00
02cf6230e7 ci: build apps only on shiny server 2022-12-02 15:42:40 +00:00
283ba0f074 ci: fix check_test_scripts_build_test_rules not install pytest error 2022-12-02 15:42:40 +00:00
e118bf5c1f test: remove elf sha256 check from pytest_blink to qemu test
not upload elf file
2022-12-02 15:42:40 +00:00
bd386775b1 ci: adjust build jobs parallel count 2022-12-02 15:42:40 +00:00
e1d2635a83 adc: skip linking static functions when not COMPILER_OPTIMIZATION_DEFAULT 2022-12-02 15:42:40 +00:00
17bdab020f esp_pm: fix esp32c2 no sleep_enable_memory_retention error 2022-12-02 15:42:40 +00:00
3eb66d2ef0 ci: move LDGEN_CHECK_MAPPING to configure_ci_environment.sh 2022-12-02 15:42:40 +00:00
1d40386215 ci: upload elf map file to s3 server to reduce artifacts size
f
2022-12-02 15:42:40 +00:00
75c3a69feb Merge branch 'docs/fix-typo-touch-pad-esp32s2-esp32s3_v5.0' into 'release/v5.0'
docs:fix a typo in touch_sensor.h of esp32s2 and esp32s3 (v5.0)

See merge request espressif/esp-idf!21043
2022-12-02 22:47:33 +08:00
62cbfaee2d Merge branch 'test/improve_adc_continuous_iram_test_aim_v5.0' into 'release/v5.0'
esp_adc: improve adc continuous iram test aim (v5.0)

See merge request espressif/esp-idf!20549
2022-12-02 22:47:00 +08:00
302ecb0764 Merge branch 'doc/pcnt_overflow_compensate_v5.0' into 'release/v5.0'
pcnt: support accumulate the count value in the high/low limit event (v5.0)

See merge request espressif/esp-idf!21170
2022-12-02 22:42:50 +08:00
e17b4463c1 Merge branch 'bugfix/legacy_rmt_resource_leak_v5.0' into 'release/v5.0'
rmt: fix memory leak in the legacy driver (v5.0)

See merge request espressif/esp-idf!21166
2022-12-02 22:43:05 +08:00
9406e80d5f Merge branch 'bugfix/fix_c3_s3_ble_temperature_performance_v5.0' into 'release/v5.0'
Fixed bluetooth disconnection caused by HW temperature rise or fall(backport v5.0)

See merge request espressif/esp-idf!21370
2022-12-02 20:39:17 +08:00
316e0e2295 Merge branch 'bugfix/fix_hid_device_vup_without_connection_5.0' into 'release/v5.0'
Bugfix/Fix HID Device can not remove virtually cabled device without a connection[backport 5.0]

See merge request espressif/esp-idf!21365
2022-12-02 20:38:57 +08:00
e35e255651 Merge branch 'bugfix/sta_set_extra_ies_for_open_AP_v5.0' into 'release/v5.0'
esp_wifi: STA set extra IEs for open AP v5.0

See merge request espressif/esp-idf!21362
2022-12-02 20:38:15 +08:00
b74cb360f0 Merge branch 'bugfix/update_esp_rom_lldesc_header_v5.0' into 'release/v5.0'
esp_rom: remove lldesc_xxx definitions since no actual function bodies (backport v5.0)

See merge request espressif/esp-idf!21354
2022-12-02 20:38:00 +08:00
f83a531929 Merge branch 'bufix/a2dp_fail_connect_again_after_disconnect_v5.0' into 'release/v5.0'
component_bt: Fixed a2dp failing to connect again after disconnect(v5.0)

See merge request espressif/esp-idf!21342
2022-12-02 20:38:13 +08:00
378a267378 Merge branch 'bugfix/disable_prov_encryption_v5.0' into 'release/v5.0'
Wifi Prov: Disabled the default support for BLE Encrpytion on characteristics read /write (v5.0)

See merge request espressif/esp-idf!21263
2022-12-02 20:37:16 +08:00
6d1f2821f1 Merge branch 'feature/esp32c2_optimize_ble_init_v5.0' into 'release/v5.0'
Fixed memory leak when RAM free size is insufficient or setting ext scan...

See merge request espressif/esp-idf!21262
2022-12-02 20:37:16 +08:00
a0dda599d3 Merge branch 'remove_deprecated_rc4_v5.0' into 'release/v5.0'
Removed some occurences of the RC4 cipher suite(deprecated now)

See merge request espressif/esp-idf!21255
2022-12-02 20:37:06 +08:00
cd6e76588b Merge branch 'bugfix/optimize_hidh_disconnection_5.0' into 'release/v5.0'
Bugfix/Fix HID Host improper handle of freeing resource in esp_hid component[backport 5.0]

See merge request espressif/esp-idf!21248
2022-12-02 20:36:50 +08:00
d92765bf9c Merge branch 'bt/opt_audio_datapath_v5.0' into 'release/v5.0'
bt/optimized a2dp_sink audio datapath (v5.0)

See merge request espressif/esp-idf!21222
2022-12-02 20:36:14 +08:00
97233718b0 Merge branch 'bugfix/fixed_HIDH_connection_failure_v5.0' into 'release/v5.0'
bugfix/fixed connection failure and build errors of HID host (v5.0)

See merge request espressif/esp-idf!21211
2022-12-02 20:36:03 +08:00
7c395f3ca8 Merge branch 'feature/support_ble_memory_release_on_esp32c2_v5.0' into 'release/v5.0'
Support BLE memory release on ESP32C2 (v5.0)

See merge request espressif/esp-idf!21189
2022-12-02 20:35:18 +08:00
52b0a5a1d5 Merge branch 'bugfix/fix_hfp_clcc_parser_bug_5.0' into 'release/v5.0'
Bugfix/Fix HFP client parse CLCC command response bug[backport 5.0]

See merge request espressif/esp-idf!21155
2022-12-02 20:34:18 +08:00
9a7ad14b07 Merge branch 'bugfix/a2dp_source_memory_access_out_of_bounds_v5.0' into 'release/v5.0'
Fixed the issue memory access out of bounds in a2dp_source example (v5.0)

See merge request espressif/esp-idf!21144
2022-12-02 20:33:20 +08:00
b20c0b59d9 Merge branch 'bugfix/change_log_print_forv5.0' into 'release/v5.0'
ble_mesh:example:Add command to test the function of duplicate exceptional list(v5.0)

See merge request espressif/esp-idf!21125
2022-12-02 20:33:05 +08:00
c0d79f2ef1 Merge branch 'bugfix/ble_mesh_event_typo_fix_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix typo in directly erase settings event (v5.0)

See merge request espressif/esp-idf!21107
2022-12-02 20:33:17 +08:00
a56b2f778c ble_mesh:example:Add command to test the function of duplicate exceptional list(v5.0) 2022-12-02 20:33:05 +08:00
6442112bb9 Merge branch 'bugfix/change_default_tx_power_on_c3_and_s3_v5.0' into 'release/v5.0'
Change BLE default TX power on ESP32C3 and ESP32S3(backport v5.0)

See merge request espressif/esp-idf!21099
2022-12-02 20:32:53 +08:00
ee57fe20de Merge branch 'bugfix/wpa_enterprise_reauth_v5.0' into 'release/v5.0'
esp_wifi: Fix WiFi Enterprise Reauthentication issue (v5.0)

See merge request espressif/esp-idf!21071
2022-12-02 20:32:27 +08:00
af7322aed5 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!21063
2022-12-02 20:32:03 +08:00
8295bfc031 Merge branch 'bugfix/fixing_memory_leak_wps_scan_v5.0' into 'release/v5.0'
(wpa_supplicant) : Fixed a memory leak issue created when parsing scan results

See merge request espressif/esp-idf!20987
2022-12-02 20:30:23 +08:00
c0cf0b07b0 Merge branch 'bugfix/bt_bss_wrong_address_v5.0' into 'release/v5.0'
Bluetooth: fix BSS placement in the linker script generated by ldgen (backport v5.0)

See merge request espressif/esp-idf!20976
2022-12-02 20:29:52 +08:00
ef1f1a8adb Merge branch 'bugfix/fix_trans_optional_info_using_group_addr_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix can't trans optional info to group address(v5.0)

See merge request espressif/esp-idf!20958
2022-12-02 20:29:35 +08:00
fb1ee6b468 Merge branch 'bugfix/blufi_add_host_deinit_api_v5.0' into 'release/v5.0'
Blufi: Added an API to stop Bluetooth / Blufi profile (v5.0)

See merge request espressif/esp-idf!20863
2022-12-02 20:27:15 +08:00
a258f7993c Merge branch 'feature/put_rom_tlsf_patch_code_to_iram_v5.0' into 'release/v5.0'
esp_rom: put rom tlsf patch code in iram by default (backport to v5.0)

See merge request espressif/esp-idf!20817
2022-12-02 20:26:47 +08:00
b48971317f Merge branch 'bugfix/fix_part_of_modem_not_reset_when_power_on_backport_v5.0' into 'release/v5.0'
Coexistence: fix part of modem module not reset when power up(backport v5.0)

See merge request espressif/esp-idf!20807
2022-12-02 20:25:21 +08:00
c581b4340a esp_hw_support/sleep: remove redundant spinlock protection for deep sleep 2022-12-02 12:24:52 +00:00
99c8c0c645 hal/gpio_ll: fix digital gpio can not enable hold during deep sleep when force_unhold set(32/s2/s3) 2022-12-02 12:24:52 +00:00
4223427127 hal/gpio_ll: fix digital gpio can not disable hold during deep sleep 2022-12-02 12:24:52 +00:00
21c9ec5eee esp_hw_support/sleep: fix current leakage when hold digital io during deep sleep 2022-12-02 12:24:52 +00:00
df80bc864d Merge branch 'bugfix/fix_xtal_related_rtc_params_for_esp32_backport_v5.0' into 'release/v5.0'
esp32/rtc: fix xtal unstable in some cases when sleep(backport v5.0)

See merge request espressif/esp-idf!20799
2022-12-02 20:24:25 +08:00
052d01b551 Merge branch 'bugfix/handle_issue_of_malloc_fail_v5.0' into 'release/v5.0'
bugfix/avoid unexpected free when malloc failed (v5.0)

See merge request espressif/esp-idf!20728
2022-12-02 20:23:58 +08:00
e65d706ee3 Merge branch 'bugfix/crash_in_i2s_when_reconnect_to_a2dp_v5.0' into 'release/v5.0'
fixed crash in I2S when reconnect to a2dp sink (v5.0)

See merge request espressif/esp-idf!20718
2022-12-02 19:54:03 +08:00
90dfbdcfc9 Merge branch 'bugfix/update_ctrl_init_config_macro_v5.0' into 'release/v5.0'
Bugfix/update ctrl init config macro (v5.0)

See merge request espressif/esp-idf!20711
2022-12-02 19:53:18 +08:00
5e461357a0 Merge branch 'bugfix/esp_spp_write_len_0_v5.0' into 'release/v5.0'
bt: Fixed esp_spp_write() crash when len is 0(v5.0)

See merge request espressif/esp-idf!20704
2022-12-02 19:53:19 +08:00
81fd39545c Merge branch 'feature/nimble_port_init_deinit_v5.0' into 'release/v5.0'
NimBLE : Init deinit nimble stack in a loop (v5.0)

See merge request espressif/esp-idf!20696
2022-12-02 19:52:40 +08:00
ff88f19ddd Merge branch 'feature/add_rom_tlsf_function_prototype_v5.0' into 'release/v5.0'
esp_rom: add rom tlsf function prototype instead of void * (backport to v5.0)

See merge request espressif/esp-idf!20684
2022-12-02 19:52:51 +08:00
85f4192ca5 Merge branch 'feature/Add_IVI_recovery_option_v5.0' into 'release/v5.0'
ble_mesh: stack: Add IV index recovery option when device missed the whole IV update(v5.0)

See merge request espressif/esp-idf!20641
2022-12-02 19:52:34 +08:00
8a956957f6 Merge branch 'bugfix/fix_fast_interval_prov_adv_v5.0' into 'release/v5.0'
ble_mesh: stack: Fix send fast interval prov_adv failed (v5.0)

See merge request espressif/esp-idf!20635
2022-12-02 19:51:49 +08:00
fb519f3bb5 Merge branch 'bugfix/fix_esprv_intc_int_set_type_err_parameter_backport_v5.0' into 'release/v5.0'
bugfix: esprv_intc_int_set_type should not use bitmap parameter(backportv5.0)

See merge request espressif/esp-idf!20610
2022-12-02 19:51:34 +08:00
53746605d8 Merge branch 'bugfix/esprv_intc_int_set_type_error_v5.0' into 'release/v5.0'
Nimble: Fixed esprv_intc_int_set_type() usage (v5.0)

See merge request espressif/esp-idf!20616
2022-12-02 19:51:10 +08:00
8b7fee3296 Merge branch 'bugfix/ble_phy_readme_v5.0' into 'release/v5.0'
NimBLE: Fixed README file for BLE PHY prph example (v5.0)

See merge request espressif/esp-idf!20256
2022-12-02 19:50:11 +08:00
010416cf3e Merge branch 'bugfix/ble_mesh_console_memory_leak_test_forv5.0' into 'release/v5.0'
ble_mesh:example:fix memory leak(v5.0)

See merge request espressif/esp-idf!20037
2022-12-02 19:49:32 +08:00
af425e5a8e move {target}/rom/miniz.h to a common miniz.h
- Move {target}/rom/miniz.h to common miniz.h
- Add ESP_ROM_HAS_MZ_CRC32 for ESP32/S2/S3/C3/H2
- Alias mz_crc32 to crc32_le if chips not support ESP_ROM_HAS_MZ_CRC32
2022-12-02 19:39:44 +08:00
228ecfdce0 Merge branch 'bugfix/serial_reader_linux_writes_correctly_5.0' into 'release/v5.0'
bugfix(tools): idf.py monitor now reads correctly on Linux (backport 5.0)

See merge request espressif/esp-idf!21270
2022-12-02 19:35:24 +08:00
b25b76be9f Merge branch 'contrib/github_pr_9943_v5.0' into 'release/v5.0'
Update build-system.rst (GitHub PR) (v5.0)

See merge request espressif/esp-idf!20530
2022-12-02 19:33:23 +08:00
e1efc8299f Merge branch 'docs/update_index_v5.0' into 'release/v5.0'
docs: remove rarely used items from the home page (v5.0)

See merge request espressif/esp-idf!20496
2022-12-02 19:32:58 +08:00
de2d43255f Merge branch 'docs/remove_bt_video_link_v5.0' into 'release/v5.0'
docs: remove old and dead BT video example link (v5.0)

See merge request espressif/esp-idf!20331
2022-12-02 19:32:15 +08:00
539a8c221c Merge branch 'gdbstub/unused_handle_v5.0' into 'release/v5.0'
gdbstub: fixed build-error due to potentially uninitialized variable on -O2 (v5.0)

See merge request espressif/esp-idf!20137
2022-12-02 19:30:34 +08:00
85eff825a9 Merge branch 'bugfix/do_not_mix_esp_partition_and_spi_flash_apis_v5.0' into 'release/v5.0'
partition: use esp_partition_munmap instead of spi_flash_munmap (v5.0)

See merge request espressif/esp-idf!21024
2022-12-02 19:29:49 +08:00
bdf2153a88 Merge branch 'bugfix/esp32s3_rom_has_ets_printf_issue_v5.0' into 'release/v5.0'
esp_rom: fix esp32s3 rom ets_printf bug (backport to v5.0)

See merge request espressif/esp-idf!20798
2022-12-02 19:28:14 +08:00
c231d9e01e Merge branch 'bugfix/update_esp_rom_caps_v5.0' into 'release/v5.0'
esp_rom: update esp_rom_caps.h (backport v5.0)

See merge request espressif/esp-idf!20572
2022-12-02 19:27:29 +08:00
09242d8bcc Merge branch 'docs/i2c_spec_url_v5.0' into 'release/v5.0'
docs: remove link to i2c specs (v5.0)

See merge request espressif/esp-idf!20859
2022-12-02 19:25:15 +08:00
7a5643342a Merge branch 'bugfix/time_jump_after_reboot_v5.0' into 'release/v5.0'
esp_hw_support: Fix time jump after reboot (v5.0)

See merge request espressif/esp-idf!20906
2022-12-02 19:21:08 +08:00
5dc102bfac Merge branch 'feature/upgrade_components_version_v5.0' into 'release/v5.0'
Feature/upgrade components version (v5.0)

See merge request espressif/esp-idf!21069
2022-12-02 19:20:32 +08:00
e31463efbe Merge branch 'docs/add_hw_ref_c2_link_v5.0' into 'release/v5.0'
docs: add TRM links for C2 to hw ref chapter (v5.0)

See merge request espressif/esp-idf!21025
2022-12-02 19:19:34 +08:00
e3101bc138 Merge branch 'feature/esp_lcd_register_io_callback_v5.0' into 'release/v5.0'
esp_lcd: Add function for register on color done callback (backport v5.0)

See merge request espressif/esp-idf!21030
2022-12-02 19:19:39 +08:00
8731d281f1 FreeRTOS: Make the default stack alignment 16 for Xtensa 2022-12-02 11:17:38 +00:00
21629b7840 Merge branch 'bugfix/fix_iram_end_redefined_backportv5.0' into 'release/v5.0'
bugfix: fix redefined _iram_end (backport v5.0)

See merge request espressif/esp-idf!21161
2022-12-02 19:17:04 +08:00
5968ca76aa ci: enable running C2 tests by default 2022-12-02 11:15:58 +00:00
75edeabec9 Merge branch 'fix/gdbgui_v5.0' into 'release/v5.0'
Tools: gdbgui is not supported on Python 3.11 (v5.0)

See merge request espressif/esp-idf!21327
2022-12-02 19:14:50 +08:00
9d412d9a16 Merge branch 'docs/test_utils_no_butter_v5.0' into 'release/v5.0'
docs: heap records are not eatable! (v5.0)

See merge request espressif/esp-idf!21326
2022-12-02 19:14:13 +08:00
c14a29c99f Merge branch 'bugfix/fix_bootloader_sha256_flash_contents_mask_issue_v5.0' into 'release/v5.0'
bootloader: fix bootloader_sha256_flash_contents mmap issue (v5.0)

See merge request espressif/esp-idf!21392
2022-12-02 19:13:42 +08:00
f7a32dbb1d Merge branch 'tools/idf_tools_use_mirror_url_v5.0' into 'release/v5.0'
tools: espidf constraints also supports mirror url (v5.0)

See merge request espressif/esp-idf!21086
2022-12-02 19:12:17 +08:00
8faf09234c Merge branch 'feature/use_tools_json_to_check_toolchain_ver_v5.0' into 'release/v5.0'
Tools: use tools.json to double-check toolchain version when building (v5.0)

See merge request espressif/esp-idf!20662
2022-12-02 19:11:54 +08:00
5ae4abe717 Merge branch 'fix/idf_tools_venv_check_v5.0' into 'release/v5.0'
Tools: Check venv the same way how it will be used later (v5.0)

See merge request espressif/esp-idf!20544
2022-12-02 19:10:33 +08:00
e08150e534 Merge branch 'fix/tools-gdbinit-with-elf-symbols_v5.0' into 'release/v5.0'
tools: fixed elf symbols load if gdbinit specified (v5.0)

See merge request espressif/esp-idf!20467
2022-12-02 19:09:48 +08:00
e8fcd2ff23 Merge branch 'refactor/editorconfig_remove_freertos_tabs_5.0' into 'release/v5.0'
editorconfig: Removed FreeRTOS tab rule (backport 5.0)

See merge request espressif/esp-idf!20370
2022-12-02 19:09:02 +08:00
d1a32474b3 Merge branch 'fix/idf_tools_download_issues_v5.0' into 'release/v5.0'
Tools: Improve download error messages coming from idf_tools.py (v5.0)

See merge request espressif/esp-idf!20352
2022-12-02 19:08:33 +08:00
f1f7ac2f28 Merge branch 'bugfix/writable_idf_tools_path_v5.0' into 'release/v5.0'
Tools: Support ESP-IDF installed in system-wide shared directory for all users (v5.0)

See merge request espressif/esp-idf!20328
2022-12-02 19:07:50 +08:00
17ad259e8e Merge branch 'feature/freertos_smp_sysview_v5.0' into 'release/v5.0'
sysview: Adds FreeRTOS SMP port (v5.0)

See merge request espressif/esp-idf!20015
2022-12-02 19:07:14 +08:00
7d39d1223b rgb_lcd: support restart dma transmission manually
When doing Flash operations (e.g. OTA), LCD's DMA bandwidth will be not
sufficient, causing the desync between the LCD controller and DMA.

Added a restart function to help the user to make them sync again.
2022-12-02 16:29:21 +08:00
1bd4c6a8cf I2C: put some interrupt used functions into IRAM,
closes https://github.com/espressif/esp-idf/issues/10079
2022-12-02 15:13:51 +08:00
dcc310f468 Explain how mush memory that will be used by each connection/advertiser. 2022-12-02 14:22:53 +08:00
zwj
8b0ec09c71 update BLE lib for ESP32-C3 and ESP32-S3
- Fixed lld_con.c line 3048 assert
- Fixed crash sometimes when connected as a slave by 8th device
2022-12-02 12:18:52 +08:00
2a76e35ed1 bluedroid host supports the maximum number of connections to 9 2022-12-02 12:18:40 +08:00
c60257e862 bootloader: fix bootloader_sha256_flash_contents mmap issue 2022-12-01 21:46:24 +08:00
54046ee4bf soc: remove unused DR_REG_DPORT_END macro for c2/c3/s2/s3 2022-12-01 21:09:05 +08:00
18fef64089 wifi/bt: fix part of modem module not reset when power up 2022-12-01 21:08:57 +08:00
7f5ecbe533 Merge branch 'bugfix/wafer_version_minor_s3_v5.0' into 'release/v5.0'
esp32s3: fixed bug chip v0.0 detected as vX.8 (v5.0)

See merge request espressif/esp-idf!21351
2022-12-01 20:37:52 +08:00
5afd0f5a3d Merge branch 'fix/esp32s3_memprot_v5.0' into 'release/v5.0'
ESP32S3: Add memory protection for Icache region (v5.0)

See merge request espressif/esp-idf!21359
2022-12-01 20:36:42 +08:00
12f9170862 spi_slave: fix slave can't use iomux bus mixed with gpio cs_pin 2022-12-01 20:12:58 +08:00
3e9701205c esp_timer: add a function to restart timer
Timers, periodic or not, can now be restarted thanks to esp_timer_restart function.
This is done atomically, which can be used to feed a periodic timer, or simply change the period.
2022-12-01 10:45:35 +00:00
1169dfa1eb Flash: fix flash_suspend example to include worst case
flash_suspend example will now test the worst case in order to be able
to detect real regression:
- shorter response time is acceptable, as the tested function may be in the cache already
- response time longer than 120us will be considered a potential regression
2022-12-01 10:45:35 +00:00
6b4e1619d8 TWDT: the Kconfig option ESP_TASK_WDT_EN is now used to enable Task Watchdog 2022-12-01 10:45:35 +00:00
1840c48538 TWDT: refactor the TWDT to be driver agnostic
This refactoring brings a private API for the TWDT implementation, which
can now use a hardware timer (Timer Group) or a software timer (esp_timer)
2022-12-01 10:45:35 +00:00
b675bb2a4d WDT: implement interrupt wdt and task wdt for ESP32-C2
ESP32-C2 has a single group timer, thus it will use it for the interrupt watchdog,
which is more critical than the task watchdog. The latter is implement in
software thanks to the `esp_timer`component.
2022-12-01 10:45:35 +00:00
add561aed8 Fixed CI esp32s3.default_2_s3.Test failed 2022-12-01 18:44:44 +08:00
9cfffd2915 - update phy lib
- Enable BLE pll track to fix bluetooth disconnection caused by temperature rise or fall on ESP32C3 and ESP32S3
- call pll track in controller task
2022-12-01 18:44:31 +08:00
823c8d4e77 usb: Don't access uninit pointer if usbh_install fails 2022-12-01 08:33:22 +01:00
ad43b04898 fix HID device can not remove virtually cabled device without a connection
Closes https://github.com/espressif/esp-idf/issues/10107
2022-12-01 15:14:25 +08:00
046e28fa70 esp_wifi: STA set extra IEs for open AP 2022-12-01 12:13:33 +05:30
af773c047a esp32s3/memprot: Fix DRAM fault address calculation 2022-12-01 09:19:08 +05:30
c83eb9dfc4 esp32s3/memprot: Fix SRAM region high addresses 2022-12-01 09:19:08 +05:30
634c2c8bf1 esp32s3/memprot: Set permission for Icache region 2022-12-01 09:19:07 +05:30
93fffd51bb esp_rom: remove lldesc_xxx definitions since no actual function bodies 2022-12-01 09:34:11 +08:00
277e4d5471 esp32s3: fixed bug chip v0.0 detected as vX.Y
A typical value is 2.8.

Previous commit 32ef2b321a doesn't fix the issue cleanly. The MSB of wafer_minor also has this problem.
2022-12-01 01:56:53 +08:00
d47bf56850 Fixed a2dp failing to connect again after disconnect 2022-11-30 18:46:59 +08:00
2c1b0b3643 Tools: gdbgui is not supported on Python 3.11
Closes https://github.com/espressif/esp-idf/issues/10116
2022-11-29 14:32:41 +01:00
b1e174f8e2 docs(test_utils): heap records are not eatable!
Instead of becoming spread, heap records should go into a buffer.
Hungry commits shall be avoided.
2022-11-29 13:47:50 +01:00
b4470860f9 Merge branch 'bugfix/i2s_tdm_doubled_mclk_v5.0' into 'release/v5.0'
i2s: fixed double mclk in tdm mode (v5.0)

See merge request espressif/esp-idf!21191
2022-11-29 16:57:11 +08:00
zwl
06290d44c3 Fixed interrupt latency when cache is disable on ESP32-C2 2022-11-29 16:27:05 +08:00
zwl
90fa0e5c49 Fixed memory leak when RAM free size is insufficient or setting ext scan parameters failed on ESP32-C2 2022-11-29 16:27:05 +08:00
5e79c3166c Merge branch 'feature/multiple_spi_lcd_backport_v5.0' into 'release/v5.0'
spi_lcd: inherit more IO flags from SPI master driver (5.0)

See merge request espressif/esp-idf!21119
2022-11-29 10:41:59 +08:00
521a726316 intr_alloc: fixed freed interrupt sources not being able to be allocated again with different flags
Mark the vector descriptor source as freed.
2022-11-28 10:43:01 +08:00
5dbfe4d502 secure_boot_v2: Fix warning message 2022-11-25 18:34:10 +05:30
46c92405f2 bugfix(tools): idf.py monitor now reads correctly on Linux
A missing flush in the serial reader implementation for
Linux target was causing input to idf.py monitor to not
be forwarded to the application. This is fixed now.
2022-11-25 11:32:49 +01:00
6091627f2e Wifi Prov: Disabled the default support for BLE Encrpytion on characteristics read /write
By default, disabled the BLE Encrpyption requirement for provisioning characteristic.
With this flag enabled, when remote attempts to read and if the ACL link is not encrypted,
ESP device will return Insufficient Authentication. It is remote device responsibility to go
for link encryption which may result in pairing.

Some devices do not proceed for any pairing and just show failure pop-up. Also, user needs
to remove bonding on remote phone manually and then try again. This is causing bad user experience.

End user can enable it as per their use case.
2022-11-25 14:18:05 +05:30
5f25bd8437 Merge branch 'bugfix/tcp_transport_err_propagate_v5.0' into 'release/v5.0'
tcp_transport: Fix error propagation on tcp_read() (v5.0)

See merge request espressif/esp-idf!21203
2022-11-25 15:19:48 +08:00
2d0ef53e94 Removed some occurences of the RC4 cipher suite(deprecated now) 2022-11-25 10:07:56 +05:30
de55b5d33e optimize HID Host disconnection procedure 2022-11-25 08:54:04 +08:00
755dded0f5 heap: add documentation about the function placement in IRAM and its usage in ISR
This commits adds a internal.md file in the heap directory to clarify the idea behind
which functions is placed in IRAM or in flash.

A section in mem_alloc.rst documentation is added to specify which functions from the
heap component API can be used in interrupt handlers.
2022-11-24 12:40:00 +01:00
47cfd0a0d8 heap: add selective placement of function in IRAM
This commit aims to place in the IRAM section only the functions that
are relevent for performance instead of placing the entire content of
multi_heap.c, mullti_heap_poisoning.c and tlsf.c in the IRAM.
2022-11-24 12:39:46 +01:00
9e88f790ff Merge branch 'bugfix/parttool_commands_extra_partition_subtypes_v5.0' into 'release/v5.0'
parttool: fix parttool commands attribute parsing (v5.0)

See merge request espressif/esp-idf!21221

Closes https://github.com/espressif/esp-idf/issues/10238
2022-11-24 18:47:09 +08:00
971221f283 Merge branch 'fix/fix_esp_cryptoauthlib_dependency_for_esp_tls_v5.0' into 'release/v5.0'
esp-tls: Fix esp-cryptoauthlib built dependency when secure element (v5.0)

See merge request espressif/esp-idf!21219
2022-11-24 18:45:55 +08:00
62ad5c2258 Bootloader: retained memory can now be kept after reboot when custom data enabled
User's custom data are not taken into account during the CRC calculation anymore.
Which means taht the retained mem structure is not systematically erased
on each reboot anymore.
2022-11-24 17:35:55 +08:00
c0f99f5a28 [MQTT] Simplifies MQTT CMakeLists file
- Uses mocks from tools instead of creating them.
- Move host based definition to test code.
2022-11-24 08:48:00 +01:00
dd57ba77a3 parttool: added tests to check the external interface (parsing) of the parttool commands
The existing tests detect errors in the internal interface (eg. parttool read-write functions) and did not check for any possible breakages in the args parsing of the parttool commands.
2022-11-24 10:45:05 +05:30
9977dbe8e2 parttool: fix extra_partition_subtypes attribute parsing 2022-11-24 10:45:05 +05:30
ae32582cc7 esp-tls: Fix esp-cryptoauthlib built dependency when secure element
support is enabled
2022-11-24 09:32:30 +05:30
9ad1c7df96 Increase BtI2STask stack depth to avoid stack overflow 2022-11-24 11:21:57 +08:00
75b2e639e1 optimized a2dp_sink audio datapath
1. removed audio cache in BTC layer of Bluedroid
2. added flow control for audio data in application layer

Closes https://github.com/espressif/esp-idf/issues/9622
2022-11-24 11:21:57 +08:00
728e2c97b4 1. changed pin_type of Legacy Paring from FIXED to VARIABLE to avoid authentication failure
2. provide compatibilities with devices that do not support Secure Simple Paring

Closes https://github.com/espressif/esp-idf/issues/10069
Closes https://github.com/espressif/esp-idf/issues/10005
2022-11-23 20:51:12 +08:00
a69c5408a3 fixed build errors with Secure Simple Paring disabled 2022-11-23 20:50:59 +08:00
3caeaece6b tcp_transport: Fix error propagation on tcp_read() 2022-11-23 09:49:35 +01:00
a4b2aa8a57 RISC-V: fix PC not saved when using backtrace 2022-11-23 15:49:42 +08:00
96346c1eed RISC-V: Create a wrapper around FreeRTOS Tasks to detect the ones returning 2022-11-23 15:44:44 +08:00
3d1c15cd94 Merge branch 'fix/call_esptool_v5.0' into 'release/v5.0'
Tools: Fix esptool wrappers by avoiding importing the module (v5.0)

See merge request espressif/esp-idf!21182
2022-11-22 23:37:08 +08:00
1f614bdcff Merge branch 'feature/oocd_ver_upgrade_v5.0' into 'release/v5.0'
tools: Updates OpenOCD version to 'v0.11.0-esp32-20221026' (v5.0)

See merge request espressif/esp-idf!21004
2022-11-22 22:12:26 +08:00
592a51ae96 i2s: fixed typo 'philip'
Closes: https://github.com/espressif/esp-idf/issues/10197
2022-11-22 15:59:51 +08:00
85661a037f i2s: fixed tdm mclk doubled issue
Closes: https://github.com/espressif/esp-idf/issues/10196
2022-11-22 15:57:33 +08:00
6c4292f7b1 Support BLE memory release on ESP32C2 2022-11-22 10:38:40 +05:30
c93c6317f5 Tools: Fix esptool wrappers by avoiding importing the module
Importing esptool in wrappers could cause importing the wrapper itself.
Updating the PATH is not reliable. For example, os.path.realpath()
changes the Windows driver letter to uppercase therefore, misses the
right path for users with small device letters in their PATH. Removing
paths without considering cases could also lead to errors.

This fix invokes esptool scripts as modules without the need to
importing them.

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

Closes https://github.com/espressif/vscode-esp-idf-extension/issues/791
2022-11-21 15:20:14 +01:00
0dbbf7bac5 pcnt: support accumulate count value
Closes https://github.com/espressif/esp-idf/issues/10167
2022-11-21 15:17:55 +08:00
03f8d8a0e2 esp_https_ota: Send data to event handler 2022-11-21 03:31:06 +00:00
4934d01795 esp_https_ota: Added support for esp_events 2022-11-21 03:31:06 +00:00
zwj
1b4499046a support BLE memory release on ESP32C3 and ESP32S3 2022-11-21 10:33:55 +08:00
zwj
7e168de48d Update bt lib for ESP32C3 and ESP32S3
- Added config to disable scan backoff
- Fixed llm_scan.c assert at line 1485 during controller deinit if duplicate scan is not stopped
- Call pll track in controller task
2022-11-21 10:33:35 +08:00
zwj
f258183ec5 Fixed ble_compatibility_test example NVS init error 2022-11-21 10:33:35 +08:00
zwj
0af189b012 Fixed errors reported by CI clang_tidy_check 2022-11-21 10:33:35 +08:00
zwj
fdd75ea5e8 cleanup sdkconfig.defaults 2022-11-21 10:33:35 +08:00
zwj
2e0a5b3111 Fixed sometimes BTU task overflow when doing read and write performance test 2022-11-21 10:33:35 +08:00
zwj
99cd53490b change default tx power from 3dBm to 9dBm 2022-11-21 10:33:35 +08:00
6d11786776 Update_sdkdefaultconfig_BLE_only_flag ESP32C2 2022-11-21 10:33:35 +08:00
0bf7145181 rmt: fix memory leak in the legacy driver
Closes https://github.com/espressif/esp-idf/issues/10173
2022-11-21 09:59:58 +08:00
76817e6d76 bugfix: fix redefined _iram_end 2022-11-18 19:53:19 +08:00
2539529360 fix HFP client parse CLCC command response bug 2022-11-18 19:38:58 +08:00
aae167824e Fixed the issue memory access out of bounds in a2dp_source example 2022-11-18 16:39:04 +08:00
69b9b0b7a6 esp_lcd: add condition for spi to keep cs low 2022-11-18 03:36:37 +00:00
313700e285 esp_lcd: support sio mode for spi LCD 2022-11-18 03:36:37 +00:00
4c3c23562c spi_lcd: panel_io_spi_tx_color without cmd
Closes https://github.com/espressif/esp-idf/issues/9881
2022-11-18 03:36:37 +00:00
e518e3efd3 spi_lcd: allow dc gpio set to -1
Closes https://github.com/espressif/esp-idf/issues/9881
2022-11-18 03:36:37 +00:00
39d2a2e0bd spi_lcd: support CS active high
Closes https://github.com/espressif/esp-idf/issues/9881
2022-11-18 03:36:37 +00:00
lly
ad2cc1f102 doc: Update the bluetooth low energy part in migration-guides 2022-11-17 11:48:59 +00:00
lly
1529613561 ble_mesh: stack: Fix typo in directly erase settings event 2022-11-17 11:48:59 +00:00
919b3e621e Merge branch 'bugfix/flake8_precommit_v5.0' into 'release/v5.0'
precommit: update flake8 repo url to use github (v5.0)

See merge request espressif/esp-idf!21095
2022-11-17 15:52:21 +08:00
92964f0733 precommit: update flake8 repo url to use github
Gitlab mirror repo has been deprecated.
2022-11-15 16:13:20 +08:00
6f583ccb29 tools: idf extra wheels url can be set by environment variables 2022-11-14 19:53:34 +08:00
0dbf7f5d4c tools: support download espidf constraints files from mirror url 2022-11-14 19:53:34 +08:00
9463a66fc0 fix: esp_http_client fix behaviour when disable_auto_redirect is enabled 2022-11-14 15:56:17 +05:30
ecaa2e8040 esp_wifi: Bugfix WPA Enterprise Reauthentication issue 2022-11-14 11:09:01 +05:30
df988596b1 cbor: Update cbor component version in idf_component.yml file in example 2022-11-14 10:08:07 +05:30
650b665384 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-11-14 09:45:34 +08:00
7f4bcc3695 Merge branch 'bugfix/revision_format_v5.0' into 'release/v5.0'
soc: upgrade version printing to vX.Y (v5.0)

See merge request espressif/esp-idf!21011
2022-11-12 00:28:57 +08:00
561cce9446 (wpa_supplicant) : Fixed a memory leak issue created when parsing scan results 2022-11-11 17:17:28 +05:30
4a6d51e698 docs:fix a typo in touch_sensor.h of esp32s2 and esp32s3 2022-11-11 17:40:09 +08:00
a67409275e psram: remove CS/CLK pin settings in kconfig on ESP32S2/S3 2022-11-11 17:23:39 +08:00
eedc5bbdb7 esp_rom: add rom api esp_rom_uart_set_as_console for riscv chips 2022-11-11 10:09:56 +08:00
8b0d0cbf5d esp_rom: remove ESP_ROM_SUPPORT_MULTIPLE_UART 2022-11-11 10:07:14 +08:00
7472018f06 esp_rom: fix esp32s3 rom ets_printf bug 2022-11-11 10:04:00 +08:00
bc54778b6c esp_rom: update esp_rom_caps.h 2022-11-11 10:03:52 +08:00
a38828651b esp_lcd: Add function for register on color done callback.
(cherry picked from commit 747c5993a8)
2022-11-10 12:12:18 +01:00
61990fc8d4 esp_timer: fix ESP_TIMER_ISR dispatch method due to off by one error 2022-11-10 15:02:03 +08:00
7d2ba509e5 docs: add datasheets, hw guidelines and erratas for all chips 2022-11-10 15:00:41 +08:00
f53bd52bbb docs: add TRM links for C2 to hw ref chapter 2022-11-10 14:59:01 +08:00
f8d4bc8911 soc: upgrade version printing to vX.Y 2022-11-10 06:21:11 +00:00
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
d4725fb34d partition: use esp_partition_munmap instead of spi_flash_munmap 2022-11-10 11:26:51 +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
fc0f640736 console: argtable3: upgrade to v3.2.2
Closes https://github.com/espressif/esp-idf/issues/9907
Closes https://github.com/espressif/esp-idf/pull/10016
2022-11-09 10:59:39 +01:00
e10d97a5d2 tools: Updates OpenOCD version to 'v0.11.0-esp32-20221026' 2022-11-08 21:15:28 +03:00
676a3475ed esp_wifi: Support external coex for C2 & H2.(59313b6c) 2022-11-08 19:20:33 +05:30
9bbe6e7fa3 Support external coexist formal code for C2 & S3,
and optimize RX category in external coex.
2022-11-08 19:10:38 +05:30
4307be2906 esp_wifi: replace deprecated CONFIGS with their new versions 2022-11-08 19:08:30 +05:30
44366f57d8 esp_wifi: number of WiFi cache TX buffers should not equal 0 when enable SPIRAM 2022-11-08 19:02:51 +05:30
1362b58b58 esp_wifi: report rssi info in wifi event 2022-11-08 18:33:59 +05:30
78fe8e77e5 Adding check for ies in match security 2022-11-08 18:25:12 +05:30
f8e2c30b32 esp_wifi: Add config option for AP retry count 2022-11-08 18:20:54 +05:30
d4070f725c Bluetooth: fix BSS placement in the linker script generated by ldgen 2022-11-08 14:00:02 +08:00
f825fcdda0 ble_mesh: stack: Fix can't trans optional info to group address 2022-11-07 15:46:39 +08:00
2dc3664075 usb_host: Test host library inflight transfer resubmission check
This commit updates the USB Host Library unit tests to test that resubmitting
an inflight transfer will return an error.
2022-11-07 13:41:46 +08:00
9670402e1c usb_host: Add check to prevent submitting already inflight transfers
This commit adds a simple flag/check in the USB Host Library that prevents
users from submitting a transfer that is already inflight.

- A transfer is considered inflight as soon as it is submitted by calling
usb_host_transfer_submit() or usb_host_transfer_submit_control()
- An inflight transfer remains inflight up until right before its callback
is called by one of the USB Host Library handler functions.

Closes https://github.com/espressif/esp-idf/issues/8748
2022-11-07 13:41:41 +08:00
9e145c5d30 usb_host: Fixed incorrect opening devices from multiple clients
1. During USBH device open both queues (idle and pending) must be checked.
2. Don't overwrite already allocated endpoints
2022-11-07 13:41:35 +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
7ca457b519 sdspi: Allow CS line to be set to GPIO_NUM_NC (-1)
Closes https://github.com/espressif/esp-idf/issues/7852
2022-11-03 10:12:29 +08:00
4ef2ba26f9 I2C: Fix the reset counter 2022-11-03 02:09:44 +00:00
1ea5682617 Update i2c.c
Fix issue with single bus clear counter but two I2C buses (I2C0, I2C1). The previously implemented single (static) counter would impact the second bus either if one bus has counter expiry.
Merges https://github.com/espressif/esp-idf/pull/7144
2022-11-03 02:09:44 +00: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
61d05c0325 esp_hw_support: Fix time jump after reboot
Closes https://github.com/espressif/esp-idf/issues/9448
2022-11-02 18:18:38 +08: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
ab2dee9439 Nimble/blufi: Added an API to stop Bluetooth / Blufi 2022-10-31 09:49:13 +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
c7e8aca45f docs: remove link to i2c specs 2022-10-31 11:54:00 +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
fe70b5f987 esp_rom: put rom tlsf patch code in iram by default 2022-10-27 10:42:04 +08:00
cb647b5198 bt: Fixed SPP VFS mode not being able to send data 2022-10-26 16:41:09 +08:00
47232f54a8 bt: Fixed esp_spp_write() crash when len is 0
Closes https://github.com/espressif/esp-idf/issues/9977
2022-10-26 16:40:56 +08:00
f91cb280eb esp_hw_support/sleep: fix light sleep wakeup flag
light sleep wakeup flag is true to indicate the most recent successful wakeup from light sleep,
which means the most recent light sleep occurred successfully and then wakes up by wakeup source
2022-10-26 16:11:41 +08:00
e04c8505e1 esp32/rtc: fix xtal unstable in some cases when sleep
1. add xtal buf wait to fix high temperature restart issue
2. add min sleep value to fix xtal stop due to too short sleep time issue
2022-10-26 16:11:27 +08:00
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
cd634f76d4 ulp-riscv: always force COCPU clock on S3
The coprocessor cpu trap signal doesnt have a stable reset value,
force ULP-RISC-V clock on to stop RTC_COCPU_TRAP_TRIG_EN from waking the CPU
2022-10-25 13:50:55 +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
76f7c727d5 ble_mesh:example:fix memory leak 2022-10-25 03:44:44 +00: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
fae252244b freertos: Add missing ESP_PLATFORM preprocessor directive for FreeRTOS static data structs (v5.0)
This commit adds the missing ESP_PLATFORM preprocessor directive to
static data structures to wrap the extra variable added for SMP locks.

Closes https://github.com/espressif/esp-idf/issues/9785
2022-10-21 14:15:16 +02: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
11b6c25641 [bt] fix if allocation fails
If osi_malloc fails for work_queues or osi_work_queue_create fails, osi_work_queue_delete in _err may release unallocated memory.
2022-10-21 14:44:39 +08:00
4cfb2e9e7d fixed crash in I2S when reconnect to a2dp sink 2022-10-21 14:10:51 +08:00
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
ffcabde96d Update #define BT_CONTROLLER_INIT_CONFIG_DEFAULT().
Corrects header names in string from "bt.h" to "esp_bt.h".
2022-10-21 11:58:30 +08:00
46d3627e66 esp_adc: added esp32c2 adc runners 2022-10-21 11:20:41 +08:00
ff29f5c43a NimBLE : Init deinit nimble stack in a loop 2022-10-20 12:58:38 +05:30
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
bc3bf04af7 esp_rom: add rom tlsf function prototype instead of void * 2022-10-19 19:35:39 +08:00
3314fcfdf7 Revert "fixed the issue iOS devices cannot initiate connection"
This reverts commit da44fc9cbe.
2022-10-18 19:47:10 +08:00
97353355ab tools: cmake: check tool supported version with idf_tools.py 2022-10-18 12:27:55 +04:00
50b1a99a47 Nimble: Update the esprv_intc_int_set_type() usage 2022-10-18 06:06:44 +00: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
54f18a4fa3 ble_mesh: stack: Add IV index recovery option when device missed the whole IV update 2022-10-17 16:52:01 +08:00
3d695cec32 ble_mesh: stack: Fix send fast interval prov_adv failed when PB-ADV and PB-GATT enable simultaneously 2022-10-17 16:38:09 +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
0af1ed8813 bugfix: esprv_intc_int_set_type should not use bitmap parameter 2022-10-14 15:39:24 +08:00
a77617e673 CI: optimize wifi get started example test 2022-10-14 15:02:24 +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
f0863e0932 esp_rom: update esp_rom_caps.h 2022-10-12 20:07:40 +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
5ec5faf02f heap: Fix memory boundary condition checks when adding new region
Previously, condition_4 was making impossible the valid scenario
start > heap_start && end == heap_end.

Now, the end == heap_end and start == heap_start case is handled
separately allowing the case start > heap_start && ned == heap_end
to be considered a valid scenario
2022-10-12 08:17:50 +02: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
35b0be3eca esp_adc: improve adc continuous iram test aim
This commit increases adc continuous iram test period of cache disabling
time. Now time is: 1 second

- The aim of this test is to make sure the continuous mode driver ISR
callbacks can run in an IRAM-Safe context.
- Closing cache takes time. WHereas the code to close the cache is
updated. This time gets changed.
2022-10-12 11:32:04 +08:00
baca425ce8 fix ble mem leak when sleep is enabled 2022-10-12 11:29:55 +08:00
bbc5009e9f Tools: Check venv the same way how it will be used later
It is possible that import of venv passes but it still cannot be
started. This can happen with the embedded Python deployed by the
ESP-IDF installer.
2022-10-11 16:26:21 +02: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
055f18f27a docs: sync chinese translation of build-system.rst 2022-10-11 14:27:04 +08:00
83c0a7dc93 Update build-system.rst
Rearranged few lines of folder directory description
2022-10-11 14:26:55 +08:00
2a8f297840 CI: enable psram in sniffer example 2022-10-10 18:38:11 +08:00
1ab5fa22b7 ci: change example simple sniffer test channel 2022-10-10 18:38:11 +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
8cbaff1b1d docs: remove rarely used items from the home page 2022-10-08 10:38:37 +08:00
9d29738473 Makes COMPONENT_LIB available for mock components
- COMPONENT_LIB wasn't available for parent scope
2022-10-07 14:26:14 +02: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
2d61c9ca79 tools: move cmake executable check into function uses it
Before this change idf.py could exit with reason cmake does not exist in PATH
even cmake will not be executed by idf.py (e.g., 'idf.py gdb').
2022-10-03 18:48:16 +04:00
7561367808 tools: add test for ROM symbols in GDB 2022-10-03 18:48:16 +04:00
2e9f175ae5 tools: fixed elf symbols load if gdbinit specified
ROM and bootloader symbols add to use in GDB (via 'idf.py gdb')
2022-10-03 18:48:16 +04:00
3eec946f60 tools: add esp-rom-elfs version '20220823' 2022-10-03 18:48:16 +04:00
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
3ab9e57c41 refactor(editorconfig): Removed FreeRTOS tab rule
FreeRTOS used tabs before, but changed to spaces now.
This hasn't been reflected in the editorconfig file
and is fixed now.
2022-09-27 11:45:12 +02:00
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
dc9a41b562 Tools: Improve download error messages coming from idf_tools.py
Closes https://github.com/espressif/esp-idf/issues/9618
2022-09-26 14:46:23 +02:00
769c6c2214 esp-tls: socket will be set to -1 and will not be closed 2022-09-26 19:20:15 +08:00
73fba0e574 docs: remove old and dead BT video example link 2022-09-26 09:31:24 +08:00
1e6e0cf062 Tools: Support ESP-IDF installed in system-wide shared directory for all users
Closes: https://github.com/espressif/esp-idf/issues/9329
Closes: https://github.com/espressif/esp-idf/pull/9328
2022-09-23 15:54:57 +02: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
7e1c632d8b spi_flash: Add several flash chips HPM(120M) support 2022-09-21 11:47:52 +08:00
35a2844d6c gdbstub: fixed build-error due to potentially uninitialized variable on -O2
Closes https://github.com/espressif/esp-idf/issues/9706
2022-09-21 03:08:50 +00: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
5774ca1300 NimBLE: Fixed README file for BLE PHY prph example 2022-09-20 14:22:27 +05:30
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
9c09372132 bootloader_flash: Some bootloader flash functions are not put in IRAM 2022-09-20 11:39:05 +08:00
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
5b601cd67f sysview: Adds FreeRTOS SMP port 2022-09-07 13:47:26 +03:00
75a2c386c9 sysview: Fixes IDLE tasks detection via name comparison 2022-09-07 13:29:49 +03: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
2684 changed files with 76030 additions and 235813 deletions

View File

@ -19,14 +19,6 @@ trim_trailing_whitespace = false
indent_style = tab
indent_size = 2
[*/freertos/**]
indent_style = tab
indent_size = 4
[{*/freertos/**.S,**/FreeRTOSConfig.h}]
indent_style = space
indent_size = 4
[*.pem]
insert_final_newline = false

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"
@ -100,6 +99,8 @@ variables:
# This is used only if CI_PYTHON_TOOL_REPO is not empty.
CI_PYTHON_TOOL_BRANCH: ""
IDF_CI_BUILD: 1
cache:
# pull only for most of the use cases since it's cache dir.
# Only set "push" policy for "upload_cache" stage jobs
@ -112,140 +113,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

@ -56,7 +56,7 @@
- `example_test[_esp32/esp32s2/...]`
- `fuzzer_test`
- `host_test`
- `integration_test`
- `integration_test[_wifi/ble]`
- `iperf_stress_test`
- `macos`
- `macos_test`
@ -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,9 +85,12 @@ 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
- build_ssc_esp32c2
artifacts:
paths:
- $TEST_DIR/test_configs
@ -98,12 +101,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

@ -4,7 +4,6 @@
tags:
- build
variables:
SIZE_INFO_LOCATION: "$CI_PROJECT_DIR/size_info.txt"
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
IDF_CCACHE_ENABLE: "1"
after_script:
@ -12,35 +11,104 @@
- test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats || true
dependencies: []
.build_pytest_template:
.build_cmake_template:
extends:
- .build_template
- .before_script_build_jobs
dependencies: # set dependencies to null to avoid missing artifacts issue
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
tags:
- build
# build only on shiny servers since shiny storage server is at the same location
- shiny
artifacts:
paths:
- "**/build*/size.json"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
# upload to s3 server to save the artifacts size
# - "**/build*/*.map"
# ttfw tests require elf files
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
# ttfw tests require sdkconfig file
- "**/build*/sdkconfig"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
- list_job_*.json
- size_info.txt
# unit test specific
- components/idf_test/unit_test/*.yml
when: always
expire_in: 4 days
after_script:
# Show ccache statistics if enabled globally
- test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats || true
# upload the binary files to s3 server
- echo -e "\e[0Ksection_start:`date +%s`:upload_binaries_to_s3_server[collapsed=true]\r\e[0KUploading binaries to s3 Server"
- shopt -s globstar
# use || true to bypass the no-file error
- zip ${CI_JOB_ID}.zip **/build*/*.bin || true
- zip ${CI_JOB_ID}.zip **/build*/*.elf || true
- zip ${CI_JOB_ID}.zip **/build*/*.map || true
- zip ${CI_JOB_ID}.zip **/build*/flasher_args.json || true
- zip ${CI_JOB_ID}.zip **/build*/flash_project_args || true
- zip ${CI_JOB_ID}.zip **/build*/config/sdkconfig.json || true
- zip ${CI_JOB_ID}.zip **/build*/sdkconfig || true
- zip ${CI_JOB_ID}.zip **/build*/bootloader/*.bin || true
- zip ${CI_JOB_ID}.zip **/build*/partition_table/*.bin || true
- mc alias set shiny-s3 ${SHINY_S3_SERVER} ${SHINY_S3_ACCESS_KEY} ${SHINY_S3_SECRET_KEY}
- mc cp ${CI_JOB_ID}.zip shiny-s3/idf-artifacts/${CI_PIPELINE_ID}/${CI_JOB_ID}.zip
- echo -e "\e[0Ksection_end:`date +%s`:upload_binaries_to_s3_server\r\e[0K"
- echo "Please download the full binary files (including *.elf and *.map files) from the following share link"
# would be clean up after 4 days
- mc share download shiny-s3/idf-artifacts/${CI_PIPELINE_ID}/${CI_JOB_ID}.zip --expire=96h
script:
# CI specific options start from "--collect-size-info xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py $TEST_DIR -v
-t $IDF_TARGET
--copy-sdkconfig
--collect-size-info size_info.txt
--collect-app-info list_job_${CI_NODE_INDEX:-1}.json
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--extra-preserve-dirs
examples/bluetooth/esp_ble_mesh/ble_mesh_console
examples/bluetooth/hci/controller_hci_uart_esp32
examples/wifi/iperf
.build_pytest_template:
extends:
- .build_cmake_template
- .before_script_build_jobs
artifacts:
paths:
- "**/build*/size.json"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
# upload to s3 server to save the artifacts size
# - "**/build*/*.map"
# - "**/build*/*.elf"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/bootloader/*.bin"
- "**/build*/bootloader/*.elf"
- "**/build*/partition_table/*.bin"
- $SIZE_INFO_LOCATION
- list_job_*.json
- size_info.txt
when: always
expire_in: 3 days
expire_in: 4 days
script:
# CI specific options start from "--collect-size-info xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py $TEST_DIR -v
-t $IDF_TARGET
--pytest-apps
--collect-size-info $SIZE_INFO_LOCATION
--collect-size-info size_info.txt
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
@ -48,7 +116,7 @@ build_pytest_examples_esp32:
extends:
- .build_pytest_template
- .rules:build:example_test-esp32
parallel: 3
parallel: 4
variables:
IDF_TARGET: esp32
TEST_DIR: examples
@ -66,7 +134,7 @@ build_pytest_examples_esp32s3:
extends:
- .build_pytest_template
- .rules:build:example_test-esp32s3
parallel: 3
parallel: 4
variables:
IDF_TARGET: esp32s3
TEST_DIR: examples
@ -101,6 +169,7 @@ build_pytest_components_esp32s2:
extends:
- .build_pytest_template
- .rules:build:component_ut-esp32s2
parallel: 2
variables:
IDF_TARGET: esp32s2
TEST_DIR: components
@ -109,6 +178,7 @@ build_pytest_components_esp32s3:
extends:
- .build_pytest_template
- .rules:build:component_ut-esp32s3
parallel: 2
variables:
IDF_TARGET: esp32s3
TEST_DIR: components
@ -117,6 +187,7 @@ build_pytest_components_esp32c3:
extends:
- .build_pytest_template
- .rules:build:component_ut-esp32c3
parallel: 2
variables:
IDF_TARGET: esp32c3
TEST_DIR: components
@ -138,14 +209,35 @@ build_non_test_components_apps:
# CI specific options start from "--collect-size-info xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py $COMPONENT_UT_DIRS -v
-t all
--collect-size-info $SIZE_INFO_LOCATION
--collect-size-info size_info.txt
--collect-app-info list_job_${CI_NODE_INDEX:-1}.json
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
.build_pytest_test_apps_template:
extends: .build_pytest_template
artifacts:
paths:
- "**/build*/size.json"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
# upload to s3 server to save the artifacts size
# - "**/build*/*.map"
# pytest test apps requires elf files for coredump tests
- "**/build*/*.elf"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
- list_job_*.json
- size_info.txt
when: always
expire_in: 4 days
build_pytest_test_apps_esp32:
extends:
- .build_pytest_template
- .build_pytest_test_apps_template
- .rules:build:custom_test-esp32
variables:
IDF_TARGET: esp32
@ -153,7 +245,7 @@ build_pytest_test_apps_esp32:
build_pytest_test_apps_esp32s2:
extends:
- .build_pytest_template
- .build_pytest_test_apps_template
- .rules:build:custom_test-esp32s2
variables:
IDF_TARGET: esp32s2
@ -161,7 +253,7 @@ build_pytest_test_apps_esp32s2:
build_pytest_test_apps_esp32s3:
extends:
- .build_pytest_template
- .build_pytest_test_apps_template
- .rules:build:custom_test-esp32s3
variables:
IDF_TARGET: esp32s3
@ -169,7 +261,7 @@ build_pytest_test_apps_esp32s3:
build_pytest_test_apps_esp32c3:
extends:
- .build_pytest_template
- .build_pytest_test_apps_template
- .rules:build:custom_test-esp32c3
variables:
IDF_TARGET: esp32c3
@ -177,7 +269,7 @@ build_pytest_test_apps_esp32c3:
build_pytest_test_apps_esp32c2:
extends:
- .build_pytest_template
- .build_pytest_test_apps_template
- .rules:build:custom_test-esp32c2
variables:
IDF_TARGET: esp32c2
@ -268,19 +360,17 @@ build_ssc_esp32s3:
.build_esp_idf_tests_cmake_template:
extends:
- .build_template
- .build_cmake_template
- .before_script_build_jobs
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
artifacts:
paths:
- "**/build*/size.json"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
# upload to s3 server to save the artifacts size
# - "**/build*/*.map"
# ttfw tests require elf files
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
@ -288,12 +378,10 @@ build_ssc_esp32s3:
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
- list_job_*.json
- $SIZE_INFO_LOCATION
- size_info.txt
- components/idf_test/unit_test/*.yml
when: always
expire_in: 4 days
variables:
LDGEN_CHECK_MAPPING: 1
script:
# CI specific options start from "--collect-size-info xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py tools/unit-test-app -v
@ -301,7 +389,7 @@ build_ssc_esp32s3:
--config "configs/*="
--copy-sdkconfig
--preserve-all
--collect-size-info $SIZE_INFO_LOCATION
--collect-size-info size_info.txt
--collect-app-info list_job_${CI_NODE_INDEX:-1}.json
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
@ -344,52 +432,11 @@ build_esp_idf_tests_cmake_esp32c3:
variables:
IDF_TARGET: esp32c3
.build_cmake_template:
extends:
- .build_template
- .before_script_build_jobs
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
variables:
LDGEN_CHECK_MAPPING: 1
artifacts:
paths:
- "**/build*/size.json"
- "**/build*/build_log.txt"
- "**/build*/*.bin"
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/flash_project_args"
- "**/build*/config/sdkconfig.json"
- "**/build*/sdkconfig"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
- list_job_*.json
- $SIZE_INFO_LOCATION
when: always
expire_in: 4 days
script:
# CI specific options start from "--collect-size-info xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py $TEST_DIR -v
-t $IDF_TARGET
--copy-sdkconfig
--collect-size-info $SIZE_INFO_LOCATION
--collect-app-info list_job_${CI_NODE_INDEX:-1}.json
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--extra-preserve-dirs
examples/bluetooth/esp_ble_mesh/ble_mesh_console
examples/bluetooth/hci/controller_hci_uart_esp32
examples/wifi/iperf
build_examples_cmake_esp32:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32
parallel: 12
parallel: 9
variables:
IDF_TARGET: esp32
TEST_DIR: examples
@ -398,7 +445,7 @@ build_examples_cmake_esp32s2:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32s2
parallel: 8
parallel: 6
variables:
IDF_TARGET: esp32s2
TEST_DIR: examples
@ -407,7 +454,7 @@ build_examples_cmake_esp32s3:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32s3
parallel: 8
parallel: 7
variables:
IDF_TARGET: esp32s3
TEST_DIR: examples
@ -416,7 +463,7 @@ build_examples_cmake_esp32c2:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32c2
parallel: 8
parallel: 4
variables:
IDF_TARGET: esp32c2
TEST_DIR: examples
@ -425,7 +472,7 @@ build_examples_cmake_esp32c3:
extends:
- .build_cmake_template
- .rules:build:example_test-esp32c3
parallel: 8
parallel: 6
variables:
IDF_TARGET: esp32c3
TEST_DIR: examples

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,8 @@ build:integration_test:
- wifi # example_test_002, example_test*wifi*
- ethernet # example_test*ethernet*
- sdio # UT_044, UT_045
- usb # USB Device & Host tests
- adc # component_ut_pytest_esp32x_adc
patterns:
- "{0}-{1}-{2}"
- "{0}-{2}"
@ -193,55 +156,20 @@ build:integration_test:
- "build:example_test"
- build:target_test
# due to the lack of runners, c2 tests will only be triggered by label
"test:{0}-esp32c2":
"test:integration_test_{0}":
matrix:
- *target_test
labels:
- "{0}_esp32c2"
included_in:
- "build:{0}"
- "build:{0}-esp32c2"
- build:target_test
# overwrite the esp32c2 component ut again
"test:component_ut-esp32c2": # component_ut will trigger by unit_test as well, since now we have 2 kinds of UT
labels:
- "component_ut_esp32c2"
- "unit_test_esp32c2"
included_in:
- build:component_ut
- "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":
- - wifi
- ble
labels:
- integration_test_{0}
- integration_test
- target_test
patterns:
- integration_test
- integration_test-{0}
- target_test-{0}
# - maybe others
included_in:
- test:integration_test
- build:integration_test
- build:target_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
@ -373,13 +380,6 @@ test_esp_event:
- idf.py build
- build/test_esp_event_host.elf
test_esp_timer_cxx:
extends: .host_test_template
script:
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/esp_timer
- idf.py build
- build/test_esp_timer_cxx_host.elf
test_eh_frame_parser:
extends: .host_test_template
script:
@ -394,34 +394,6 @@ test_rom_on_linux_works:
- idf.py build
- build/test_rom_host.elf
test_cxx_gpio:
extends: .host_test_template
script:
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/gpio
- idf.py build
- build/test_gpio_cxx_host.elf
test_i2c_cxx:
extends: .host_test_template
script:
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/i2c
- idf.py build
- build/test_i2c_cxx_host.elf
test_spi_cxx:
extends: .host_test_template
script:
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/spi
- idf.py build
- build/test_spi_cxx_host.elf
test_system_cxx:
extends: .host_test_template
script:
- cd ${IDF_PATH}/examples/cxx/experimental/experimental_cpp_component/host_test/system
- idf.py build
- build/test_system_cxx_host.elf
test_linux_example:
extends: .host_test_template
script:
@ -430,6 +402,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,9 @@ check_commit_msg:
check_test_scripts_build_test_rules:
extends:
- .pre_check_job_template
- .pre_check_template
- .before_script_build_jobs
script:
# required pytest related packages
- run_cmd bash install.sh --enable-pytest
- python tools/ci/check_build_test_rules.py check-test-scripts examples/ tools/test_apps components

File diff suppressed because it is too large Load Diff

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:
@ -80,14 +79,6 @@ example_test_pytest_esp32c2_generic:
- build_pytest_examples_esp32c2
tags: [ esp32c2, generic, xtal_40mhz ]
example_test_pytest_esp32c2_26mhz:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32c2
needs:
- build_pytest_examples_esp32c2
tags: [ esp32c2, xtal_26mhz ]
example_test_pytest_esp32c3_generic:
extends:
- .pytest_examples_dir_template
@ -192,13 +183,13 @@ example_test_pytest_esp32_flash_encryption:
- build_pytest_examples_esp32
tags: [ esp32, flash_encryption ]
example_test_pytest_esp32_multi_dut_generic:
example_test_pytest_esp32_wifi_two_dut:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32
- .rules:test:example_test-esp32-wifi
needs:
- build_pytest_examples_esp32
tags: [ esp32, multi_dut_generic ]
tags: [ esp32, wifi_two_dut ]
example_test_pytest_esp32c3_flash_encryption:
extends:
@ -208,6 +199,86 @@ example_test_pytest_esp32c3_flash_encryption:
- build_pytest_examples_esp32c3
tags: [ esp32c3, flash_encryption ]
example_test_pytest_esp32_sdmmc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32
needs:
- build_pytest_examples_esp32
tags: [ esp32, sdcard_sdmode ]
example_test_pytest_esp32_sdspi:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32
needs:
- build_pytest_examples_esp32
tags: [ esp32, sdcard_spimode ]
example_test_pytest_esp32s2_sdspi:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32s2
needs:
- build_pytest_examples_esp32s2
tags: [ esp32s2, sdcard_spimode ]
example_test_pytest_esp32c3_sdspi:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32c3
needs:
- build_pytest_examples_esp32c3
tags: [ esp32c3, sdcard_spimode ]
example_test_pytest_esp32_extflash:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32
needs:
- build_pytest_examples_esp32
tags: [ esp32, external_flash ]
example_test_pytest_esp32_adc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32-adc
needs:
- build_pytest_examples_esp32
tags: [ esp32, adc ]
example_test_pytest_esp32s2_adc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32s2-adc
needs:
- build_pytest_examples_esp32s2
tags: [ esp32s2, adc ]
example_test_pytest_esp32s3_adc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32s3-adc
needs:
- build_pytest_examples_esp32s3
tags: [ esp32s3, adc ]
example_test_pytest_esp32c3_adc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32c3-adc
needs:
- build_pytest_examples_esp32c3
tags: [ esp32c3, adc ]
example_test_pytest_esp32c2_adc:
extends:
- .pytest_examples_dir_template
- .rules:test:example_test-esp32c2-adc
needs:
- build_pytest_examples_esp32c2
tags: [ esp32c2, adc, xtal_26mhz]
.pytest_components_dir_template:
extends: .pytest_template
variables:
@ -221,6 +292,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 +332,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 +348,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,13 +388,21 @@ 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, xtal_26mhz ]
component_ut_pytest_esp32c2_xtal_26mhz:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32c2
needs:
- build_pytest_components_esp32c2
tags: [ esp32c2, xtal_26mhz ]
tags: [ esp32c2, generic, xtal_26mhz ]
component_ut_pytest_esp32c3_generic:
extends:
@ -309,6 +412,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
@ -317,6 +428,14 @@ component_ut_pytest_esp32c3_flash_encryption:
- build_pytest_components_esp32c3
tags: [ esp32c3, flash_encryption ]
component_ut_pytest_esp32s3_usb_host:
extends:
- .pytest_components_dir_template
- .rules:test:component_ut-esp32s3-usb
needs:
- build_pytest_components_esp32s3
tags: [ esp32s3, usb_host_flash_disk ]
.pytest_test_apps_dir_template:
extends: .pytest_template
variables:
@ -358,14 +477,6 @@ test_app_test_pytest_esp32c2_generic:
- build_pytest_test_apps_esp32c2
tags: [ esp32c2, generic, xtal_40mhz ]
test_app_test_pytest_esp32c2_26mhz:
extends:
- .pytest_test_apps_dir_template
- .rules:test:custom_test-esp32c2
needs:
- build_pytest_test_apps_esp32c2
tags: [ esp32c2, xtal_26mhz ]
test_app_test_pytest_esp32c3_generic:
extends:
- .pytest_test_apps_dir_template
@ -374,14 +485,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
@ -576,30 +679,6 @@ example_test_009:
SETUP_TOOLS: "1"
PYTHON_VER: 3
example_test_010:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_ExtFlash
example_test_011:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_T2_RS485
example_test_013:
extends: .example_test_esp32_template
tags:
- ESP32
- UT_T1_SDMODE
example_test_016:
extends: .example_test_esp32_template
tags:
- ESP32
- Example_Modbus_TCP
example_test_017:
extends: .example_test_esp32s2_template
tags:
@ -613,23 +692,11 @@ example_test_C3_GENERIC:
- ESP32C3
- Example_GENERIC
example_test_ESP32_SDSPI:
extends: .example_test_esp32_template
example_test_C2_GENERIC:
extends: .example_test_esp32c2_template
tags:
- ESP32
- UT_T1_SPIMODE
example_test_ESP32S2_SDSPI:
extends: .example_test_esp32s2_template
tags:
- ESP32S2
- UT_T1_SPIMODE
example_test_ESP32C3_SDSPI:
extends: .example_test_esp32c3_template
tags:
- ESP32C3
- UT_T1_SPIMODE
- ESP32C2
- Example_GENERIC
.test_app_template:
extends: .target_test_job_template
@ -943,7 +1010,7 @@ UT_S2_SDSPI:
UT_C2:
extends: .unit_test_esp32c2_template
parallel: 21
parallel: 23
tags:
- ESP32C2_IDF
- UT_T1_1
@ -1026,8 +1093,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:
@ -1037,23 +1105,24 @@ UT_S3_FLASH:
CONFIG_FILE_PATH: "${CI_PROJECT_DIR}/tools/ci/integration_test/test_configs"
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}"
PREPARE_TEST_BIN_SCRIPT: "${CI_PROJECT_DIR}/auto_test_script/tools/ci/idf_prepare_test_bins.py"
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
@ -1065,8 +1134,16 @@ UT_S3_FLASH:
variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32C3_IDF"
.integration_test_esp32c2_template:
extends:
- .integration_test_template
variables:
LOCAL_ENV_CONFIG_PATH: "$CI_PROJECT_DIR/ci-test-runner-configs/$CI_RUNNER_DESCRIPTION/ESP32C2_IDF"
nvs_compatible_test:
extends: .integration_test_template
extends:
- .integration_test_template
- .rules:test:integration_test
artifacts:
when: always
paths:
@ -1080,141 +1157,232 @@ 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
- python ${CI_RUNNER_SCRIPT} -l "$LOG_PATH/$JOB_FULL_NAME" -c $CONFIG_FILE -e $LOCAL_ENV_CONFIG_PATH -t $TEST_CASE_FILE_PATH
IT_001:
extends: .integration_test_template
IT_T1_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 2
tags:
- ESP32_IDF
- SSC_T1_4
- SSC_T1_Simple
IT_002:
extends: .integration_test_template
IT_T1_WAP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_2
- SSC_T1_WAP
IT_003:
extends: .integration_test_template
IT_T2_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 9
tags:
- ESP32_IDF
- SSC_T2_5
- SSC_T2_Simple
IT_005:
extends: .integration_test_template
IT_T5_BT_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_ble
parallel: 3
tags:
- ESP32_IDF
- SSC_T1_5
- SSC_T5_BT_Simple
IT_006:
extends: .integration_test_template
IT_T2_BT_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_ble
parallel: 6
tags:
- ESP32_IDF
- SSC_T2_BT_Simple
IT_T1_BT_Dongle:
extends:
- .integration_test_template
- .rules:test:integration_test_ble
parallel: 2
tags:
- ESP32_IDF
- SSC_T1_BT_Dongle
IT_T1_AP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_AP
IT_T1_AP_E:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 5
tags:
- ESP32_IDF
- SSC_T1_6
- SSC_T1_AP_E
IT_007:
extends: .integration_test_template
IT_T1_WNIC_AP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_7
- SSC_T1_WNIC_AP
IT_008:
extends: .integration_test_template
IT_T1_WNIC_AP_E:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_8
- SSC_T1_WNIC_AP_E
IT_011:
extends: .integration_test_template
IT_T1_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_MESH1
IT_012:
extends: .integration_test_template
IT_T2_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
parallel: 2
tags:
- ESP32_IDF
- SSC_T2_MESH1
IT_013:
extends: .integration_test_template
IT_T3_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T3_MESH1
IT_014:
extends: .integration_test_template
IT_T6_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T6_MESH1
IT_015:
extends: .integration_test_template
IT_T12_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T12_MESH1
IT_016:
extends: .integration_test_template
IT_T50_MESH1:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
allow_failure: true
tags:
- ESP32_IDF
- SSC_T50_MESH1
IT_017:
extends: .integration_test_template
IT_T1_MESH2:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_MESH2
IT_018:
extends: .integration_test_template
IT_T2_WNIC:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T1_9
- SSC_T2_WNIC
IT_019:
extends: .integration_test_template
IT_T2_AP:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T2_2
- SSC_T2_AP
IT_020:
extends: .integration_test_template
IT_T3_Simple:
extends:
- .integration_test_template
- .rules:test:integration_test_wifi
tags:
- ESP32_IDF
- SSC_T2_3
- SSC_T3_Simple
IT_022:
extends: .integration_test_template
tags:
- ESP32_IDF
- SSC_T3_2
IT_C3_001:
extends: .integration_test_esp32c3_template
parallel: 6
IT_C3_T2_BT_Simple:
extends:
- .integration_test_esp32c3_template
- .rules:test:integration_test_ble
parallel: 11
tags:
- ESP32C3_IDF
- SSC_T2_5
- SSC_T2_BT_Simple
IT_C3_T5_BT_Simple:
extends:
- .integration_test_esp32c3_template
- .rules:test:integration_test_ble
parallel: 5
tags:
- ESP32C3_IDF
- SSC_T5_BT_Simple
IT_C3_T1_BT_Dongle:
extends:
- .integration_test_esp32c3_template
- .rules:test:integration_test_ble
image: gitlab.espressif.cn:5050/qa/dockerfiles/integration-test-env-dbg:1
parallel: 2
tags:
- ESP32C3_IDF
- SSC_T1_BT_Dongle
IT_C2_T2_BT_Simple:
extends:
- .integration_test_esp32c2_template
- .rules:test:integration_test_ble
parallel: 9
tags:
- ESP32C2_IDF
- SSC_T2_BT_Simple
IT_C2_T1_BT_Dongle:
extends:
- .integration_test_esp32c2_template
- .rules:test:integration_test_ble
image: gitlab.espressif.cn:5050/qa/dockerfiles/integration-test-env-dbg:1
parallel: 2
tags:
- ESP32C2_IDF
- SSC_T1_BT_Dongle

View File

@ -9,22 +9,19 @@
upload-pip-cache:
extends:
- .upload_cache_template
- .before_script_minimal
- .rules:patterns:python-cache
tags:
- $GEO
- build
- cache
cache:
key: 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,21 +29,21 @@ upload-pip-cache:
upload-submodules-cache:
extends:
- .upload_cache_template
- .before_script_minimal
- .rules:patterns:submodule
tags:
- $GEO
- build
- cache
cache:
key: submodule-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
@ -29,13 +30,13 @@ repos:
- id: mixed-line-ending
args: ['-f=lf']
- id: double-quote-string-fixer
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args: ['--config=.flake8', '--tee', '--benchmark']
- repo: https://github.com/pycqa/isort
rev: 5.9.3
rev: 5.11.5 # python 3.7 compatible
hooks:
- id: isort
name: isort (python)

View File

@ -15,6 +15,10 @@ mainmenu "Espressif IoT Development Framework Configuration"
bool
option env="IDF_ENV_FPGA"
config IDF_CI_BUILD
bool
default y if "$(IDF_CI_BUILD)" = "y" || "$(IDF_CI_BUILD)" = 1
config IDF_TARGET_ARCH_RISCV
bool
default "n"
@ -82,7 +86,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

@ -142,7 +142,11 @@ static U64 _cbGetTime(void) {
void SYSVIEW_AddTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
unsigned n;
if (memcmp(pcTaskName, "IDLE", 5) == 0) {
/* On multi-core we have several idle tasks with 'IDLEx' names
Not best solution, because we can filter out user tasks starting with 'IDLE'.
But we can not use 'xTaskGetIdleTaskHandle' because at the moment when this
function is called array of idle tasks handles are not initialized yet. */
if (memcmp(pcTaskName, "IDLE", 4) == 0) {
return;
}
@ -176,7 +180,11 @@ void SYSVIEW_AddTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPrio
void SYSVIEW_UpdateTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
unsigned n;
if (memcmp(pcTaskName, "IDLE", 5) == 0) {
/* On multi-core we have several idle tasks with 'IDLEx' names
Not best solution, because we can filter out user tasks starting with 'IDLE'.
But we can not use 'xTaskGetIdleTaskHandle' because at the moment when this
function is called array of idle tasks handles are not initialized yet. */
if (memcmp(pcTaskName, "IDLE", 4) == 0) {
return;
}

View File

@ -212,63 +212,27 @@ Notes:
#define apiID_UXEVENTGROUPGETNUMBER (73u)
#ifdef CONFIG_FREERTOS_SMP
/*
FreeRTOS SMP has diverged from ESP-IDF FreeRTOS source quite a bit, thus Sysview is out of sync. For now, we just
define away all of the tracing macros.
*/
#define traceTASK_NOTIFY_TAKE( uxIndexToWait )
#define traceTASK_DELAY()
#define traceTASK_DELAY_UNTIL( xTimeToWake )
#define traceTASK_DELETE( pxTCB )
#define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify )
#define traceTASK_PRIORITY_INHERIT( pxTCB, uxPriority )
#define traceTASK_RESUME( pxTCB )
#define traceINCREASE_TICK_COUNT( xTicksToJump )
#define traceTASK_SUSPEND( pxTCB )
#define traceTASK_PRIORITY_DISINHERIT( pxTCB, uxBasePriority )
#define traceTASK_RESUME_FROM_ISR( pxTCB )
#define traceTASK_NOTIFY( uxIndexToNotify )
#define traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify )
#define traceTASK_NOTIFY_WAIT( uxIndexToWait )
#define traceQUEUE_CREATE( pxNewQueue )
#define traceQUEUE_DELETE( pxQueue )
#define traceQUEUE_PEEK( pxQueue )
#define traceQUEUE_PEEK_FROM_ISR( pxQueue )
#define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue )
#define traceQUEUE_RECEIVE( pxQueue )
#define traceQUEUE_RECEIVE_FAILED( pxQueue )
#define traceQUEUE_SEMAPHORE_RECEIVE( pxQueue )
#define traceQUEUE_RECEIVE_FROM_ISR( pxQueue )
#define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue )
#define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName )
#define traceQUEUE_SEND( pxQueue )
#define traceQUEUE_SEND_FAILED( pxQueue )
#define traceQUEUE_SEND_FROM_ISR( pxQueue )
#define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue )
#define traceQUEUE_GIVE_FROM_ISR( pxQueue )
#define traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue )
#define traceTASK_CREATE(pxNewTCB)
#define traceTASK_PRIORITY_SET(pxTask, uxNewPriority)
#define traceTASK_SWITCHED_IN()
#define traceMOVED_TASK_TO_READY_STATE(pxTCB)
#define traceREADDED_TASK_TO_READY_STATE(pxTCB)
#define traceMOVED_TASK_TO_DELAYED_LIST()
#define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST()
#define traceMOVED_TASK_TO_SUSPENDED_LIST(pxTCB)
#define traceISR_EXIT_TO_SCHEDULER()
#define traceISR_EXIT()
#define traceISR_ENTER(_n_)
#define traceQUEUE_SEND( pxQueue ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), 0, 0, 0)
#else // CONFIG_FREERTOS_SMP
#if ( configUSE_QUEUE_SETS != 1 )
#define traceQUEUE_SEND( pxQueue ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)
#else
#define traceQUEUE_SEND( pxQueue ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), 0, 0, xCopyPosition)
#endif
#endif // CONFIG_FREERTOS_SMP
#define traceTASK_NOTIFY_TAKE( uxIndexToWait ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_ULTASKNOTIFYTAKE, xClearCountOnExit, xTicksToWait)
#define traceTASK_DELAY() SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKDELAY, xTicksToDelay)
#define traceTASK_DELAY_UNTIL() SEGGER_SYSVIEW_RecordVoid(apiFastID_OFFSET + apiID_VTASKDELAYUNTIL)
#define traceTASK_DELETE( pxTCB ) if (pxTCB != NULL) { \
SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKDELETE, \
SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)); \
SYSVIEW_DeleteTask((U32)pxTCB); \
}
#define traceTASK_DELAY_UNTIL( xTimeToWake ) SEGGER_SYSVIEW_RecordVoid(apiFastID_OFFSET + apiID_VTASKDELAYUNTIL)
#define traceTASK_DELETE( pxTCB ) do { \
SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKDELETE, \
SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)); \
SYSVIEW_DeleteTask((U32)pxTCB); \
} while(0)
#define traceTASK_NOTIFY_GIVE_FROM_ISR( uxIndexToNotify ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_VTASKNOTIFYGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), (U32)pxHigherPriorityTaskWoken)
#define traceTASK_PRIORITY_INHERIT( pxTCB, uxPriority ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKPRIORITYINHERIT, (U32)pxMutexHolder)
#define traceTASK_RESUME( pxTCB ) SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKRESUME, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
@ -291,11 +255,6 @@ define away all of the tracing macros.
#define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) SEGGER_SYSVIEW_RecordU32x3(apiFastID_OFFSET + apiID_XQUEUERECEIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer), (U32)pxHigherPriorityTaskWoken)
#define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x3(apiFastID_OFFSET + apiID_XQUEUERECEIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer), (U32)pxHigherPriorityTaskWoken)
#define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_VQUEUEADDTOREGISTRY, SEGGER_SYSVIEW_ShrinkId((U32)xQueue), (U32)pcQueueName)
#if ( configUSE_QUEUE_SETS != 1 )
#define traceQUEUE_SEND( pxQueue ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)
#else
#define traceQUEUE_SEND( pxQueue ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), 0, 0, xCopyPosition)
#endif
#define traceQUEUE_SEND_FAILED( pxQueue ) SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)
#define traceQUEUE_SEND_FROM_ISR( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSENDFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, (U32)pxHigherPriorityTaskWoken, xCopyPosition)
#define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSENDFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, (U32)pxHigherPriorityTaskWoken, xCopyPosition)
@ -338,35 +297,37 @@ define away all of the tracing macros.
//
// Define INCLUDE_xTaskGetIdleTaskHandle as 1 in FreeRTOSConfig.h to allow identification of Idle state.
//
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
// SMP FreeRTOS uses unpinned IDLE tasks, so sometimes IDEL0 runs on CPU1, IDLE1 runs on CPU0 and so on.
// So IDLE state detection based on 'xTaskGetIdleTaskHandle' does not work for SMP kernel.
// We could compare current task handle with every element of the array returned by 'xTaskGetIdleTaskHandle',
// but it deos not seem to be efficient enough to be worth of making code more complex and less readabl.
// So always use task name comparison mechanism for SMP kernel.
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 && !defined(CONFIG_FREERTOS_SMP))
#define traceTASK_SWITCHED_IN() if(prvGetTCBFromHandle(NULL) == xTaskGetIdleTaskHandle()) { \
SEGGER_SYSVIEW_OnIdle(); \
} else { \
SEGGER_SYSVIEW_OnTaskStartExec((U32)pxCurrentTCB[esp_cpu_get_core_id()]); \
SEGGER_SYSVIEW_OnTaskStartExec((U32)prvGetTCBFromHandle(NULL)); \
}
#else
#define traceTASK_SWITCHED_IN() { \
if (memcmp(pxCurrentTCB[esp_cpu_get_core_id()]->pcTaskName, "IDLE", 5) != 0) { \
SEGGER_SYSVIEW_OnTaskStartExec((U32)pxCurrentTCB[esp_cpu_get_core_id()]); \
if (memcmp(prvGetTCBFromHandle(NULL)->pcTaskName, "IDLE", 4) != 0) { \
SEGGER_SYSVIEW_OnTaskStartExec((U32)prvGetTCBFromHandle(NULL)); \
} else { \
SEGGER_SYSVIEW_OnIdle(); \
} \
}
#endif
#define traceMOVED_TASK_TO_READY_STATE(pxTCB) SEGGER_SYSVIEW_OnTaskStartReady((U32)pxTCB)
#define traceREADDED_TASK_TO_READY_STATE(pxTCB)
#define traceMOVED_TASK_TO_DELAYED_LIST() SEGGER_SYSVIEW_OnTaskStopReady((U32)pxCurrentTCB[esp_cpu_get_core_id()], (1u << 2))
#define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST() SEGGER_SYSVIEW_OnTaskStopReady((U32)pxCurrentTCB[esp_cpu_get_core_id()], (1u << 2))
#define traceMOVED_TASK_TO_DELAYED_LIST() SEGGER_SYSVIEW_OnTaskStopReady((U32)prvGetTCBFromHandle(NULL)], (1u << 2))
#define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST() SEGGER_SYSVIEW_OnTaskStopReady((U32)prvGetTCBFromHandle(NULL)], (1u << 2))
#define traceMOVED_TASK_TO_SUSPENDED_LIST(pxTCB) SEGGER_SYSVIEW_OnTaskStopReady((U32)pxTCB, ((3u << 3) | 3))
#define traceISR_EXIT_TO_SCHEDULER() SEGGER_SYSVIEW_RecordExitISRToScheduler()
#define traceISR_EXIT() SEGGER_SYSVIEW_RecordExitISR()
#define traceISR_ENTER(_n_) SEGGER_SYSVIEW_RecordEnterISR(_n_)
#endif // CONFIG_FREERTOS_SMP
/*********************************************************************
*
* API functions

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

@ -49,11 +49,11 @@ static const char *TAG = "ota_test";
static void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
spi_flash_mmap_handle_t data_map;
esp_partition_mmap_handle_t data_map;
ESP_LOGI(TAG, "start the copy process");
TEST_ESP_OK(esp_partition_mmap(curr_app, 0, curr_app->size, SPI_FLASH_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_partition_mmap(curr_app, 0, curr_app->size, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
spi_flash_munmap(data_map);
esp_partition_munmap(data_map);
ESP_LOGI(TAG, "finish the copy process");
}
@ -65,15 +65,15 @@ static void copy_app_partition(esp_ota_handle_t update_handle, const esp_partiti
static void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
spi_flash_mmap_handle_t data_map;
esp_partition_mmap_handle_t data_map;
ESP_LOGI(TAG, "start the copy process");
uint32_t offset = 0, bytes_to_write = curr_app->size;
uint32_t write_bytes;
while (bytes_to_write > 0) {
write_bytes = (bytes_to_write > (4 * 1024)) ? (4 * 1024) : bytes_to_write;
TEST_ESP_OK(esp_partition_mmap(curr_app, offset, write_bytes, SPI_FLASH_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_partition_mmap(curr_app, offset, write_bytes, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write_with_offset(update_handle, (const void *)partition_bin, write_bytes, offset));
spi_flash_munmap(data_map);
esp_partition_munmap(data_map);
bytes_to_write -= write_bytes;
offset += write_bytes;
}
@ -90,11 +90,11 @@ static void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const
static void copy_partition(const esp_partition_t *dst_partition, const esp_partition_t *src_partition)
{
const void *partition_bin = NULL;
spi_flash_mmap_handle_t data_map;
TEST_ESP_OK(esp_partition_mmap(src_partition, 0, src_partition->size, SPI_FLASH_MMAP_DATA, &partition_bin, &data_map));
esp_partition_mmap_handle_t data_map;
TEST_ESP_OK(esp_partition_mmap(src_partition, 0, src_partition->size, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_partition_erase_range(dst_partition, 0, dst_partition->size));
TEST_ESP_OK(esp_partition_write(dst_partition, 0, (const void *)partition_bin, dst_partition->size));
spi_flash_munmap(data_map);
esp_partition_munmap(data_map);
}
#endif

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
@ -403,7 +403,6 @@ menu "Bootloader config"
config BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE
hex "Size in bytes for custom purposes"
range 0 0x10
default 0
depends on BOOTLOADER_CUSTOM_RESERVE_RTC
help
@ -450,8 +449,8 @@ menu "Security features"
config SECURE_BOOT_V2_RSA_SUPPORTED
bool
default y
# RSA secure boot is supported in ESP32 revision >= ECO3
depends on (IDF_TARGET_ESP32 && ESP32_REV_MIN >= 3) || SOC_SECURE_BOOT_V2_RSA
# RSA secure boot is supported in ESP32 revision >= v3.0
depends on (IDF_TARGET_ESP32 && ESP32_REV_MIN_FULL >= 300) || SOC_SECURE_BOOT_V2_RSA
config SECURE_BOOT_V2_ECC_SUPPORTED
bool
@ -466,7 +465,7 @@ menu "Security features"
config SECURE_BOOT_V2_PREFERRED
bool
default y
depends on ESP32_REV_MIN >= 3
depends on ESP32_REV_MIN_FULL >= 300
config SECURE_BOOT_V2_ECDSA_ENABLED
bool
@ -587,8 +586,8 @@ menu "Security features"
config SECURE_BOOT
bool "Enable hardware Secure Boot in bootloader (READ DOCS FIRST)"
default n
# Secure boot is not supported for ESP32-C3 revision < ECO3
depends on SOC_SECURE_BOOT_SUPPORTED && !(IDF_TARGET_ESP32C3 && ESP32C3_REV_MIN < 3)
# Secure boot is not supported for ESP32-C3 revision < v0.3
depends on SOC_SECURE_BOOT_SUPPORTED && !(IDF_TARGET_ESP32C3 && ESP32C3_REV_MIN_FULL < 3)
select ESPTOOLPY_NO_STUB if !IDF_TARGET_ESP32 && !IDF_TARGET_ESP32S2
help
Build a bootloader which enables Secure Boot on first boot.
@ -972,7 +971,7 @@ menu "Security features"
default SECURE_ENABLE_SECURE_ROM_DL_MODE if SECURE_ROM_DL_MODE_ENABLED # NOERROR
default SECURE_INSECURE_ALLOW_DL_MODE
depends on SECURE_BOOT_V2_ENABLED || SECURE_FLASH_ENC_ENABLED
depends on !IDF_TARGET_ESP32 || ESP32_REV_MIN_3
depends on !(IDF_TARGET_ESP32 && ESP32_REV_MIN_FULL < 300)
config SECURE_DISABLE_ROM_DL_MODE
bool "UART ROM download mode (Permanently disabled (recommended))"
@ -998,9 +997,9 @@ menu "Security features"
Download Mode into a separate Secure Download mode. This option can only work if
Download Mode is not already disabled by eFuse.
Secure Download mode limits the use of Download Mode functions to simple flash read,
write and erase operations, plus a command to return a summary of currently enabled
security features.
Secure Download mode limits the use of Download Mode functions to update SPI config,
changing baud rate, basic flash write and a command to return a summary of currently
enabled security features (`get_security_info`).
Secure Download mode is not compatible with the esptool.py flasher stub feature,
espefuse.py, read/writing memory or registers, encrypted download, or any other

View File

@ -11,8 +11,9 @@ endif()
#
idf_build_get_property(build_dir BUILD_DIR)
set(BOOTLOADER_BUILD_DIR "${build_dir}/bootloader")
set(BOOTLOADER_ELF_FILE "${BOOTLOADER_BUILD_DIR}/bootloader.elf")
set(bootloader_binary_files
"${BOOTLOADER_BUILD_DIR}/bootloader.elf"
"${BOOTLOADER_ELF_FILE}"
"${BOOTLOADER_BUILD_DIR}/bootloader.bin"
"${BOOTLOADER_BUILD_DIR}/bootloader.map"
)

View File

@ -42,6 +42,14 @@ MEMORY
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
}
/* The app may use RAM for static allocations up to the start of iram_loader_seg.
* If you have changed something above and this assert fails:
* 1. Check what the new value of bootloader_iram_loader_seg start is.
* 2. Update the value in this assert.
* 3. Update (SRAM_DRAM_END + I_D_SRAM_OFFSET) in components/esp_system/ld/esp32c2/memory.ld.in to the same value.
*/
ASSERT(bootloader_iram_loader_seg_start == 0x403aeb70, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
/* Default entry point: */
ENTRY(call_start_cpu0);

View File

@ -42,6 +42,14 @@ MEMORY
dram_seg (RW) : org = bootloader_dram_seg_start, len = bootloader_dram_seg_len
}
/* The app may use RAM for static allocations up to the start of iram_loader_seg.
* If you have changed something above and this assert fails:
* 1. Check what the new value of bootloader_iram_loader_seg start is.
* 2. Update the value in this assert.
* 3. Update (SRAM_DRAM_END + I_D_SRAM_OFFSET) in components/esp_system/ld/esp32c3/memory.ld.in to the same value.
*/
ASSERT(bootloader_iram_loader_seg_start == 0x403ce710, "bootloader_iram_loader_seg_start inconsistent with SRAM_DRAM_END");
/* Default entry point: */
ENTRY(call_start_cpu0);

View File

@ -0,0 +1,7 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/bootloader_support/test_apps/rtc_custom_section:
disable:
- if: IDF_TARGET == "esp32c2"
temporary: false
reason: esp32c2 does not have RTC memory

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

@ -20,7 +20,7 @@ extern "C" {
#define FLASH_SECTOR_SIZE 0x1000
#define FLASH_BLOCK_SIZE 0x10000
#define MMAP_ALIGNED_MASK 0x0000FFFF
#define MMAP_ALIGNED_MASK (SPI_FLASH_MMU_PAGE_SIZE - 1)
#define MMU_FLASH_MASK (~(SPI_FLASH_MMU_PAGE_SIZE - 1))
/**

View File

@ -17,6 +17,7 @@
#include "soc/spi_reg.h"
#include "soc/soc_caps.h"
#include "soc/soc_pins.h"
#include "soc/chip_revision.h"
#include "hal/efuse_hal.h"
#include "hal/gpio_hal.h"
#include "flash_qio_mode.h"
@ -168,16 +169,13 @@ int bootloader_flash_get_wp_pin(void)
return CONFIG_SPIRAM_SPIWP_SD3_PIN; // can be set for app when DIO or DOUT config used for PSRAM only
#else
// no custom value, find it based on the package eFuse value
uint8_t chip_ver;
uint32_t pkg_ver = bootloader_common_get_chip_ver_pkg();
switch(pkg_ver) {
switch(bootloader_common_get_chip_ver_pkg()) {
case EFUSE_RD_CHIP_VER_PKG_ESP32U4WDH:
case EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5:
return ESP32_D2WD_WP_GPIO;
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4:
/* Same package IDs are used for ESP32-PICO-V3 and ESP32-PICO-D4, silicon version differentiates */
chip_ver = efuse_hal_get_major_chip_version();
return (chip_ver < 3) ? ESP32_D2WD_WP_GPIO : ESP32_PICO_V3_GPIO;
return !ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 300) ? ESP32_D2WD_WP_GPIO : ESP32_PICO_V3_GPIO;
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302:
return ESP32_PICO_V3_GPIO;
default:

View File

@ -11,6 +11,7 @@
#include "bootloader_flash_priv.h"
#include "esp_log.h"
#include "esp_err.h"
#include "esp_attr.h"
#include "esp_rom_spiflash.h"
#include "esp_rom_efuse.h"
#include "flash_qio_mode.h"
@ -159,47 +160,47 @@ static esp_err_t enable_qio_mode(bootloader_flash_read_status_fn_t read_status_f
return ESP_OK;
}
unsigned bootloader_read_status_8b_rdsr(void)
IRAM_ATTR unsigned bootloader_read_status_8b_rdsr(void)
{
return bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8);
}
unsigned bootloader_read_status_8b_rdsr2(void)
IRAM_ATTR unsigned bootloader_read_status_8b_rdsr2(void)
{
return bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8);
}
unsigned bootloader_read_status_8b_rdsr3(void)
IRAM_ATTR unsigned bootloader_read_status_8b_rdsr3(void)
{
return bootloader_execute_flash_command(CMD_RDSR3, 0, 0, 8);
}
unsigned bootloader_read_status_16b_rdsr_rdsr2(void)
IRAM_ATTR unsigned bootloader_read_status_16b_rdsr_rdsr2(void)
{
return bootloader_execute_flash_command(CMD_RDSR, 0, 0, 8) | (bootloader_execute_flash_command(CMD_RDSR2, 0, 0, 8) << 8);
}
void bootloader_write_status_8b_wrsr(unsigned new_status)
IRAM_ATTR void bootloader_write_status_8b_wrsr(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR, new_status, 8, 0);
}
void bootloader_write_status_8b_wrsr2(unsigned new_status)
IRAM_ATTR void bootloader_write_status_8b_wrsr2(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR2, new_status, 8, 0);
}
void bootloader_write_status_8b_wrsr3(unsigned new_status)
IRAM_ATTR void bootloader_write_status_8b_wrsr3(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR3, new_status, 8, 0);
}
void bootloader_write_status_16b_wrsr(unsigned new_status)
IRAM_ATTR void bootloader_write_status_16b_wrsr(unsigned new_status)
{
bootloader_execute_flash_command(CMD_WRSR, new_status, 16, 0);
}
unsigned bootloader_read_status_8b_xmc25qu64a(void)
IRAM_ATTR unsigned bootloader_read_status_8b_xmc25qu64a(void)
{
bootloader_execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);
@ -208,7 +209,7 @@ unsigned bootloader_read_status_8b_xmc25qu64a(void)
return read_status;
}
void bootloader_write_status_8b_xmc25qu64a(unsigned new_status)
IRAM_ATTR void bootloader_write_status_8b_xmc25qu64a(unsigned new_status)
{
bootloader_execute_flash_command(CMD_OTPEN, 0, 0, 0); /* Enter OTP mode */
esp_rom_spiflash_wait_idle(&g_rom_flashchip);

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

@ -6,6 +6,7 @@
#pragma once
#include <inttypes.h>
#include "esp_assert.h"
/**
* @brief ESP chip ID
@ -26,7 +27,7 @@ typedef enum {
} __attribute__((packed)) esp_chip_id_t;
/** @cond */
_Static_assert(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit");
ESP_STATIC_ASSERT(sizeof(esp_chip_id_t) == 2, "esp_chip_id_t should be 16 bit");
/** @endcond */
/**
@ -83,8 +84,15 @@ typedef struct {
* pin and sets this field to 0xEE=disabled) */
uint8_t spi_pin_drv[3]; /*!< Drive settings for the SPI flash pins (read by ROM bootloader) */
esp_chip_id_t chip_id; /*!< Chip identification number */
uint8_t min_chip_rev; /*!< Minimum chip revision supported by image */
uint8_t reserved[8]; /*!< Reserved bytes in additional header space, currently unused */
uint8_t min_chip_rev; /*!< Minimal chip revision supported by image
* After the Major and Minor revision eFuses were introduced into the chips, this field is no longer used.
* But for compatibility reasons, we keep this field and the data in it.
* Use min_chip_rev_full instead.
* The software interprets this as a Major version for most of the chips and as a Minor version for the ESP32-C3.
*/
uint16_t min_chip_rev_full; /*!< Minimal chip revision supported by image, in format: major * 100 + minor */
uint16_t max_chip_rev_full; /*!< Maximal chip revision supported by image, in format: major * 100 + minor */
uint8_t reserved[4]; /*!< Reserved bytes in additional header space, currently unused */
uint8_t hash_appended; /*!< If 1, a SHA256 digest "simple hash" (of the entire image) is appended after the checksum.
* Included in image length. This digest
* is separate to secure boot and only used for detecting corruption.
@ -93,7 +101,7 @@ typedef struct {
} __attribute__((packed)) esp_image_header_t;
/** @cond */
_Static_assert(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
ESP_STATIC_ASSERT(sizeof(esp_image_header_t) == 24, "binary image header should be 24 bytes");
/** @endcond */
@ -106,25 +114,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

@ -8,6 +8,7 @@
#include <stdbool.h>
#include "esp_attr.h"
#include "esp_err.h"
#include "soc/soc_caps.h"
#ifndef BOOTLOADER_BUILD
#include "spi_flash_mmap.h"
#endif
@ -184,6 +185,19 @@ void esp_flash_encryption_init_checks(void);
*/
esp_err_t esp_flash_encryption_enable_secure_features(void);
/** @brief Returns the verification status for all physical security features of flash encryption in release mode
*
* If the device has flash encryption feature configured in the release mode,
* then it is highly recommended to call this API in the application startup code.
* This API verifies the sanity of the eFuse configuration against
* the release (production) mode of the flash encryption feature.
*
* @return
* - True - all eFuses are configured correctly
* - False - not all eFuses are configured correctly.
*/
bool esp_flash_encryption_cfg_verify_release_mode(void);
/** @brief Switches Flash Encryption from "Development" to "Release"
*
* If already in "Release" mode, the function will do nothing.

View File

@ -9,6 +9,7 @@
#include <esp_err.h>
#include "esp_flash_partitions.h"
#include "esp_app_format.h"
#include "esp_assert.h"
#ifdef __cplusplus
extern "C" {
@ -53,12 +54,18 @@ typedef struct {
uint32_t crc; /*!< Check sum crc32 */
} rtc_retain_mem_t;
ESP_STATIC_ASSERT(offsetof(rtc_retain_mem_t, crc) == sizeof(rtc_retain_mem_t) - sizeof(uint32_t), "CRC field must be the last field of rtc_retain_mem_t structure");
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
_Static_assert(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
ESP_STATIC_ASSERT(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
/* The custom field must be the penultimate field */
ESP_STATIC_ASSERT(offsetof(rtc_retain_mem_t, custom) == sizeof(rtc_retain_mem_t) - sizeof(uint32_t) - CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE,
"custom field in rtc_retain_mem_t structure must be the field before the CRC one");
#endif
#if defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP) || defined(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC)
_Static_assert(CONFIG_BOOTLOADER_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
ESP_STATIC_ASSERT(CONFIG_BOOTLOADER_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_RESERVE_RTC_SIZE must be a multiple of 4 bytes");
#endif
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
@ -68,7 +75,7 @@ _Static_assert(CONFIG_BOOTLOADER_RESERVE_RTC_SIZE % 4 == 0, "CONFIG_BOOTLOADER_R
#endif
#if defined(CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP) || defined(CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC)
_Static_assert(sizeof(rtc_retain_mem_t) <= ESP_BOOTLOADER_RESERVE_RTC, "Reserved RTC area must exceed size of rtc_retain_mem_t");
ESP_STATIC_ASSERT(sizeof(rtc_retain_mem_t) <= ESP_BOOTLOADER_RESERVE_RTC, "Reserved RTC area must exceed size of rtc_retain_mem_t");
#endif
/**

View File

@ -191,7 +191,7 @@ typedef struct {
*/
esp_err_t esp_secure_boot_verify_ecdsa_signature_block(const esp_secure_boot_sig_block_t *sig_block, const uint8_t *image_digest, uint8_t *verified_digest);
#if !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_3
#if !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_FULL >= 300
/**
* @brief Structure to hold public key digests calculated from the signature blocks of a single image.
*
@ -202,7 +202,7 @@ typedef struct {
unsigned num_digests; /* Number of valid digests, starting at index 0 */
} esp_image_sig_public_key_digests_t;
#endif // !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_3
#endif // !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_FULL >= 300
/** @brief Legacy ECDSA verification function
*
@ -269,6 +269,19 @@ esp_err_t esp_secure_boot_get_signature_blocks_for_running_app(bool digest_publi
*/
esp_err_t esp_secure_boot_enable_secure_features(void);
/** @brief Returns the verification status for all physical security features of secure boot in release mode
*
* If the device has secure boot feature configured in the release mode,
* then it is highly recommended to call this API in the application startup code.
* This API verifies the sanity of the eFuse configuration against
* the release (production) mode of the secure boot feature.
*
* @return
* - True - all eFuses are configured correctly
* - False - not all eFuses are configured correctly.
*/
bool esp_secure_boot_cfg_verify_release_mode(void);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -23,7 +23,7 @@
#include "esp32c2/rom/secure_boot.h"
#endif
#if !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_3
#if !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_FULL >= 300
/** @brief Verify the secure boot signature block for Secure Boot V2.
*

View File

@ -6,6 +6,7 @@
#include "sdkconfig.h"
#include "soc/soc.h"
#include "soc/rtc.h"
#include "soc/chip_revision.h"
#include "hal/efuse_hal.h"
#include "soc/rtc_cntl_reg.h"
#if CONFIG_IDF_TARGET_ESP32
@ -32,7 +33,7 @@ __attribute__((weak)) void bootloader_clock_configure(void)
* document). For rev. 0, switch to 240 instead if it has been enabled
* previously.
*/
if (efuse_hal_get_major_chip_version() == 0 &&
if (!ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 100) &&
clk_ll_cpu_get_freq_mhz_from_pll() == CLK_LL_PLL_240M_FREQ_MHZ) {
cpu_freq_mhz = 240;
}
@ -42,13 +43,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

@ -17,7 +17,9 @@
#include "soc/gpio_periph.h"
#include "soc/rtc.h"
#include "soc/efuse_reg.h"
#include "soc/chip_revision.h"
#include "hal/efuse_hal.h"
#include "hal/efuse_ll.h"
#include "hal/gpio_ll.h"
#include "esp_image_format.h"
#include "bootloader_sha.h"
@ -25,6 +27,7 @@
#include "bootloader_flash_priv.h"
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
#define IS_MAX_REV_SET(max_chip_rev_full) (((max_chip_rev_full) != 65535) && ((max_chip_rev_full) != 0))
static const char* TAG = "boot_comm";
@ -54,34 +57,38 @@ int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata)
return bootloader_common_select_otadata(two_otadata, valid_two_otadata, true);
}
esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type)
esp_err_t __attribute__((optimize("-Os"))) bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type)
{
esp_err_t err = ESP_OK;
esp_chip_id_t chip_id = CONFIG_IDF_FIRMWARE_CHIP_ID;
if (chip_id != img_hdr->chip_id) {
ESP_LOGE(TAG, "mismatch chip ID, expected %d, found %d", chip_id, img_hdr->chip_id);
err = ESP_FAIL;
}
} else {
#ifndef CONFIG_IDF_ENV_FPGA
#if defined(CONFIG_IDF_TARGET_ESP32) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C2) || defined(CONFIG_IDF_TARGET_ESP32H2)
uint8_t revision = efuse_hal_get_major_chip_version();
// min_chip_rev keeps the MAJOR wafer version for these chips
#else
uint8_t revision = efuse_hal_get_minor_chip_version();
// min_chip_rev keeps the MINOR wafer version for these chips
#endif
if (revision < img_hdr->min_chip_rev) {
/* To fix this error, please update mininum supported chip revision from configuration,
* located in TARGET (e.g. ESP32) specific options under "Component config" menu */
ESP_LOGE(TAG, "This chip is revision %d but the application is configured for minimum revision %d. Can't run.", revision, img_hdr->min_chip_rev);
err = ESP_FAIL;
} else if (revision != img_hdr->min_chip_rev) {
#ifdef BOOTLOADER_BUILD
ESP_LOGI(TAG, "chip revision: %d, min. %s chip revision: %d", revision, type == ESP_IMAGE_BOOTLOADER ? "bootloader" : "application", img_hdr->min_chip_rev);
#endif
}
unsigned revision = efuse_hal_chip_revision();
unsigned int major_rev = revision / 100;
unsigned int minor_rev = revision % 100;
unsigned min_rev = img_hdr->min_chip_rev_full;
if (type == ESP_IMAGE_BOOTLOADER || type == ESP_IMAGE_APPLICATION) {
if (!ESP_CHIP_REV_ABOVE(revision, min_rev)) {
ESP_LOGE(TAG, "Image requires chip rev >= v%d.%d, but chip is v%d.%d",
min_rev / 100, min_rev % 100,
major_rev, minor_rev);
err = ESP_FAIL;
}
}
if (type == ESP_IMAGE_APPLICATION) {
unsigned max_rev = img_hdr->max_chip_rev_full;
if ((IS_MAX_REV_SET(max_rev) && (revision > max_rev) && !efuse_ll_get_disable_wafer_version_major())) {
ESP_LOGE(TAG, "Image requires chip rev <= v%d.%d, but chip is v%d.%d",
max_rev / 100, max_rev % 100,
major_rev, minor_rev);
err = ESP_FAIL;
}
}
#endif // CONFIG_IDF_ENV_FPGA
}
return err;
}
@ -112,34 +119,12 @@ 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))
_Static_assert(RTC_RETAIN_MEM_ADDR >= SOC_RTC_DRAM_LOW, "rtc_retain_mem_t structure size is bigger than the RTC memory size. Consider reducing RTC reserved memory size.");
rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
#ifndef BOOTLOADER_BUILD
@ -152,17 +137,28 @@ rtc_retain_mem_t *const rtc_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR
SOC_RESERVE_MEMORY_REGION(RTC_RETAIN_MEM_ADDR, RTC_RETAIN_MEM_ADDR + sizeof(rtc_retain_mem_t), rtc_retain_mem);
#endif
static uint32_t rtc_retain_mem_size(void) {
#ifdef CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC
/* A custom memory has been reserved by the user, do not consider this memory into CRC calculation as it may change without
* the have the user updating the CRC. Return the offset of the custom field, which is equivalent to size of the structure
* minus the size of everything after (including) `custom` */
return offsetof(rtc_retain_mem_t, custom);
#else
return sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc);
#endif
}
static bool check_rtc_retain_mem(void)
{
return esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc)) == rtc_retain_mem->crc && rtc_retain_mem->crc != UINT32_MAX;
return esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size()) == rtc_retain_mem->crc && rtc_retain_mem->crc != UINT32_MAX;
}
static void update_rtc_retain_mem_crc(void)
{
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, sizeof(rtc_retain_mem_t) - sizeof(rtc_retain_mem->crc));
rtc_retain_mem->crc = esp_rom_crc32_le(UINT32_MAX, (uint8_t*)rtc_retain_mem, rtc_retain_mem_size());
}
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

@ -47,12 +47,7 @@ void bootloader_console_init(void)
{
const int uart_num = CONFIG_ESP_CONSOLE_UART_NUM;
#if !ESP_ROM_SUPPORT_MULTIPLE_UART
/* esp_rom_install_channel_put is not available unless multiple UARTs are supported */
esp_rom_install_uart_printf();
#else
esp_rom_install_channel_putc(1, esp_rom_uart_putc);
#endif
// Wait for UART FIFO to be empty.
esp_rom_uart_tx_wait_idle(0);
@ -61,10 +56,10 @@ void bootloader_console_init(void)
// Some constants to make the following code less upper-case
const int uart_tx_gpio = CONFIG_ESP_CONSOLE_UART_TX_GPIO;
const int uart_rx_gpio = CONFIG_ESP_CONSOLE_UART_RX_GPIO;
// Switch to the new UART (this just changes UART number used for esp_rom_printf in ROM code).
#if ESP_ROM_SUPPORT_MULTIPLE_UART
esp_rom_uart_set_as_console(uart_num);
#endif
// If console is attached to UART1 or if non-default pins are used,
// need to reconfigure pins using GPIO matrix
if (uart_num != 0 ||

View File

@ -41,7 +41,10 @@ esp_err_t bootloader_read_bootloader_header(void)
esp_err_t bootloader_check_bootloader_validity(void)
{
ESP_LOGI(TAG, "chip revision: V%03d", efuse_hal_chip_revision());
unsigned int revision = efuse_hal_chip_revision();
unsigned int major = revision / 100;
unsigned int minor = revision % 100;
ESP_LOGI(TAG, "chip revision: v%d.%d", major, minor);
/* compare with the one set in bootloader image header */
if (bootloader_common_check_chip_validity(&bootloader_image_hdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
return ESP_FAIL;

View File

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

@ -45,5 +45,17 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
// Secure boot and Flash encryption share one eFuse key block so they can not be set separately.
// CONFIG_SECURE_BOOT_FLASH_ENC_KEYS_BURN_TOGETHER option is used to burn SB and FE at the same time.
// SB key is readable, the corresponding bit in RD_DIS is unset.
// We set write-protection for RD_DIS to ensure that the SB key is always readable.
// FE key is read-protected, the corresponding bit in RD_DIS is set.
ESP_LOGI(TAG, "Prevent read disabling of additional efuses...");
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
#else
ESP_LOGW(TAG, "Allowing read disabling of additional efuses - SECURITY COMPROMISED");
#endif
return ESP_OK;
}

View File

@ -25,6 +25,7 @@
#include "soc/extmem_reg.h"
#include "soc/io_mux_reg.h"
#include "soc/system_reg.h"
#include "soc/chip_revision.h"
#include "esp32c3/rom/efuse.h"
#include "esp32c3/rom/ets_sys.h"
#include "bootloader_common.h"
@ -252,7 +253,7 @@ static inline void bootloader_hardware_init(void)
{
// This check is always included in the bootloader so it can
// print the minimum revision error message later in the boot
if (efuse_hal_get_minor_chip_version() < 3) {
if (!ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 3)) {
REGI2C_WRITE_MASK(I2C_ULP, I2C_ULP_IR_FORCE_XPD_IPH, 1);
REGI2C_WRITE_MASK(I2C_BIAS, I2C_BIAS_DREG_1P1_PVT, 12);
}
@ -265,8 +266,7 @@ static inline void bootloader_ana_reset_config(void)
For ECO2: fix brownout reset bug, support swt & brownout reset;
For ECO3: fix clock glitch reset bug, support all reset, include: swt & brownout & clock glitch reset.
*/
uint8_t chip_version = efuse_hal_get_minor_chip_version();
switch (chip_version) {
switch (efuse_hal_chip_revision()) {
case 0:
case 1:
//Enable WDT reset. Disable BOR and GLITCH reset

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

@ -204,7 +204,12 @@ void esp_flash_encryption_set_release_mode(void)
ESP_LOGE(TAG, "Flash Encryption support not added, abort..");
abort();
#endif
#if CONFIG_SOC_SUPPORTS_SECURE_DL_MODE
esp_efuse_enable_rom_secure_download_mode();
#else
esp_efuse_disable_rom_download_mode();
#endif
esp_efuse_batch_write_commit();
if (esp_get_flash_encryption_mode() != ESP_FLASH_ENC_MODE_RELEASE) {
@ -213,3 +218,206 @@ void esp_flash_encryption_set_release_mode(void)
}
ESP_LOGI(TAG, "Flash encryption mode is RELEASE");
}
#ifdef CONFIG_IDF_TARGET_ESP32
bool esp_flash_encryption_cfg_verify_release_mode(void)
{
bool result = false;
bool secure;
secure = esp_flash_encryption_enabled();
result = secure;
if (!secure) {
ESP_LOGW(TAG, "Not enabled Flash Encryption (FLASH_CRYPT_CNT->1 or max)");
}
uint8_t crypt_config = 0;
esp_efuse_read_field_blob(ESP_EFUSE_ENCRYPT_CONFIG, &crypt_config, 4);
if (crypt_config != EFUSE_FLASH_CRYPT_CONFIG) {
result &= false;
ESP_LOGW(TAG, "ENCRYPT_CONFIG must be set 0xF (set ENCRYPT_CONFIG->0xF)");
}
uint8_t flash_crypt_cnt = 0;
esp_efuse_read_field_blob(ESP_EFUSE_FLASH_CRYPT_CNT, &flash_crypt_cnt, ESP_EFUSE_FLASH_CRYPT_CNT[0]->bit_count);
if (flash_crypt_cnt != (1 << (ESP_EFUSE_FLASH_CRYPT_CNT[0]->bit_count)) - 1) {
if (!esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_FLASH_CRYPT_CNT)) {
result &= false;
ESP_LOGW(TAG, "Not release mode of Flash Encryption (set FLASH_CRYPT_CNT->max or WR_DIS_FLASH_CRYPT_CNT->1)");
}
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DISABLE_DL_ENCRYPT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART bootloader encryption (set DISABLE_DL_ENCRYPT->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DISABLE_DL_DECRYPT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART bootloader decryption (set DISABLE_DL_DECRYPT->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DISABLE_DL_CACHE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART bootloader MMU cache (set DISABLE_DL_CACHE->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DISABLE_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled JTAG (set DISABLE_JTAG->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_CONSOLE_DEBUG_DISABLE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled ROM BASIC interpreter fallback (set CONSOLE_DEBUG_DISABLE->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_RD_DIS_BLK1);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not read-protected flash ecnryption key (set RD_DIS_BLK1->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_BLK1);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected flash ecnryption key (set WR_DIS_BLK1->1)");
}
return result;
}
#else // not CONFIG_IDF_TARGET_ESP32
bool esp_flash_encryption_cfg_verify_release_mode(void)
{
bool result = false;
bool secure;
secure = esp_flash_encryption_enabled();
result = secure;
if (!secure) {
ESP_LOGW(TAG, "Not enabled Flash Encryption (SPI_BOOT_CRYPT_CNT->1 or max)");
}
uint8_t flash_crypt_cnt = 0;
esp_efuse_read_field_blob(ESP_EFUSE_SPI_BOOT_CRYPT_CNT, &flash_crypt_cnt, ESP_EFUSE_SPI_BOOT_CRYPT_CNT[0]->bit_count);
if (flash_crypt_cnt != (1 << (ESP_EFUSE_SPI_BOOT_CRYPT_CNT[0]->bit_count)) - 1) {
if (!esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_SPI_BOOT_CRYPT_CNT)) {
result &= false;
ESP_LOGW(TAG, "Not release mode of Flash Encryption (set SPI_BOOT_CRYPT_CNT->max or WR_DIS_SPI_BOOT_CRYPT_CNT->1)");
}
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DOWNLOAD_MANUAL_ENCRYPT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART bootloader encryption (set DIS_DOWNLOAD_MANUAL_ENCRYPT->1)");
}
#if SOC_EFUSE_DIS_DOWNLOAD_DCACHE
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DOWNLOAD_DCACHE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART bootloader Dcache (set DIS_DOWNLOAD_DCACHE->1)");
}
#endif
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DOWNLOAD_ICACHE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART bootloader cache (set DIS_DOWNLOAD_ICACHE->1)");
}
#if SOC_EFUSE_DIS_PAD_JTAG
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled JTAG PADs (set DIS_PAD_JTAG->1)");
}
#endif
#if SOC_EFUSE_DIS_USB_JTAG
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_USB_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled USB JTAG (set DIS_USB_JTAG->1)");
}
#endif
#if SOC_EFUSE_DIS_DIRECT_BOOT
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled direct boot mode (set DIS_DIRECT_BOOT->1)");
}
#endif
#if SOC_EFUSE_HARD_DIS_JTAG
secure = esp_efuse_read_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled JTAG (set HARD_DIS_JTAG->1)");
}
#endif
#if SOC_EFUSE_DIS_BOOT_REMAP
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_BOOT_REMAP);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled boot from RAM (set DIS_BOOT_REMAP->1)");
}
#endif
#if SOC_EFUSE_DIS_LEGACY_SPI_BOOT
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled Legcy SPI boot (set DIS_LEGACY_SPI_BOOT->1)");
}
#endif
esp_efuse_purpose_t purposes[] = {
#if SOC_FLASH_ENCRYPTION_XTS_AES_256
ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_KEY_1,
ESP_EFUSE_KEY_PURPOSE_XTS_AES_256_KEY_2,
#endif
#if SOC_FLASH_ENCRYPTION_XTS_AES_128
ESP_EFUSE_KEY_PURPOSE_XTS_AES_128_KEY,
#endif
};
// S2 and S3 chips have both XTS_AES_128_KEY and XTS_AES_256_KEY_1/2.
// The check below does not take into account that XTS_AES_128_KEY and XTS_AES_256_KEY_1/2
// are mutually exclusive because this will make the chip not functional.
// Only one type key must be configured in eFuses.
secure = false;
for (unsigned i = 0; i < sizeof(purposes) / sizeof(esp_efuse_purpose_t); i++) {
esp_efuse_block_t block;
if (esp_efuse_find_purpose(purposes[i], &block)) {
secure = esp_efuse_get_key_dis_read(block);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not read-protected Flash encryption key in BLOCK%d (set RD_DIS_KEY%d->1)", block, block - EFUSE_BLK_KEY0);
}
secure = esp_efuse_get_key_dis_write(block);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected Flash encryption key in BLOCK%d (set WR_DIS_KEY%d->1)", block, block - EFUSE_BLK_KEY0);
}
#if SOC_EFUSE_KEY_PURPOSE_FIELD
secure = esp_efuse_get_keypurpose_dis_write(block);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected KEY_PURPOSE for BLOCK%d (set WR_DIS_KEY_PURPOSE%d->1)", block, block - EFUSE_BLK_KEY0);
}
#endif
}
}
result &= secure;
return result;
}
#endif // not CONFIG_IDF_TARGET_ESP32

View File

@ -10,6 +10,7 @@
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp_secure_boot.h"
#include "hal/efuse_hal.h"
#ifndef BOOTLOADER_BUILD
static __attribute__((unused)) const char *TAG = "secure_boot";
@ -188,4 +189,224 @@ void esp_secure_boot_init_checks(void)
#endif // CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME && CONFIG_SECURE_SIGNED_ON_UPDATE_NO_SECURE_BOOT
}
#ifdef CONFIG_IDF_TARGET_ESP32
bool esp_secure_boot_cfg_verify_release_mode(void)
{
bool result = false;
bool secure;
bool secure_boot_v1 = esp_efuse_read_field_bit(ESP_EFUSE_ABS_DONE_0);
bool chip_supports_sbv2 = efuse_hal_chip_revision() >= 300;
bool secure_boot_v2 = (chip_supports_sbv2) ? esp_efuse_read_field_bit(ESP_EFUSE_ABS_DONE_1) : false;
result = secure_boot_v1 || secure_boot_v2;
if (secure_boot_v1 && secure_boot_v2) {
ESP_LOGI(TAG, "ABS_DONE_0=1 (V1) and ABS_DONE_1=1 (V2)");
ESP_LOGI(TAG, "Secure boot V2 shall take the precedence");
} else if (!secure_boot_v1 && !secure_boot_v2) {
result = false;
ESP_LOGE(TAG, "Not enabled Secure Boot V1 (set ABS_DONE_0->1)");
if (chip_supports_sbv2) {
ESP_LOGE(TAG, "Not enabled Secure Boot V2 (set ABS_DONE_1->1)");
}
}
if (secure_boot_v1 && !secure_boot_v2) {
secure = esp_efuse_read_field_bit(ESP_EFUSE_RD_DIS_BLK2);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not read-protected secure boot key (set RD_DIS_BLK2->1)");
}
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_BLK2);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected secure boot key (set WR_DIS_BLK2->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DISABLE_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled JTAG (set DISABLE_JTAG->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_CONSOLE_DEBUG_DISABLE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled ROM BASIC interpreter fallback (set CONSOLE_DEBUG_DISABLE->1)");
}
if (secure_boot_v2) {
secure = esp_efuse_read_field_bit(ESP_EFUSE_UART_DOWNLOAD_DIS);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled UART ROM Download mode (set UART_DOWNLOAD_DIS->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_EFUSE_RD_DISABLE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled write-protection for read-protection (set WR_DIS_EFUSE_RD_DISABLE->1)");
}
}
return result;
}
#else // not CONFIG_IDF_TARGET_ESP32
bool esp_secure_boot_cfg_verify_release_mode(void)
{
bool result = false;
bool secure;
secure = esp_secure_boot_enabled();
result = secure;
if (!secure) {
ESP_LOGW(TAG, "Not enabled Secure Boot (SECURE_BOOT_EN->1)");
}
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DOWNLOAD_MODE);
bool en_secure_download = esp_efuse_read_field_bit(ESP_EFUSE_ENABLE_SECURITY_DOWNLOAD);
if (!secure && !en_secure_download) {
result &= false;
ESP_LOGW(TAG, "Download mode has not been changed, disable it or set security mode:");
ESP_LOGW(TAG, "Not disabled ROM Download mode (DIS_DOWNLOAD_MODE->1)");
ESP_LOGW(TAG, "Not enabled Security download mode (ENABLE_SECURITY_DOWNLOAD->1)");
}
#if SOC_EFUSE_DIS_BOOT_REMAP
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_BOOT_REMAP);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled boot from RAM (set DIS_BOOT_REMAP->1)");
}
#endif
#if SOC_EFUSE_DIS_LEGACY_SPI_BOOT
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_LEGACY_SPI_BOOT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled Legcy SPI boot (set DIS_LEGACY_SPI_BOOT->1)");
}
#endif
#if SOC_EFUSE_DIS_DIRECT_BOOT
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled direct boot mode (set DIS_DIRECT_BOOT->1)");
}
#endif
#if SOC_EFUSE_HARD_DIS_JTAG
secure = esp_efuse_read_field_bit(ESP_EFUSE_HARD_DIS_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled JTAG (set HARD_DIS_JTAG->1)");
}
#endif
#if SOC_EFUSE_SOFT_DIS_JTAG
size_t soft_dis_jtag_cnt_val = 0;
esp_efuse_read_field_cnt(ESP_EFUSE_SOFT_DIS_JTAG, &soft_dis_jtag_cnt_val);
if (soft_dis_jtag_cnt_val != ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count) {
result &= secure;
ESP_LOGW(TAG, "Not disabled JTAG in the soft way (set SOFT_DIS_JTAG->max)");
}
#endif
#if SOC_EFUSE_DIS_PAD_JTAG
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled JTAG PADs (set DIS_PAD_JTAG->1)");
}
#endif
#if SOC_EFUSE_DIS_USB_JTAG
secure = esp_efuse_read_field_bit(ESP_EFUSE_DIS_USB_JTAG);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled USB JTAG (set DIS_USB_JTAG->1)");
}
#endif
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
secure = esp_efuse_read_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not enabled AGGRESSIVE KEY REVOKE (set SECURE_BOOT_AGGRESSIVE_REVOKE->1)");
}
#endif
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not disabled write-protection for read-protection (set WR_DIS_RD_DIS->1)");
}
#if SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS == 1
unsigned purpose = ESP_EFUSE_KEY_PURPOSE_SECURE_BOOT_V2;
#else
unsigned purpose = ESP_EFUSE_KEY_PURPOSE_SECURE_BOOT_DIGEST0; // DIGEST0, DIGEST1 and DIGEST2
#endif
secure = false;
unsigned num_keys = 0;
for (unsigned i = 0; i < SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS; ++i) {
esp_efuse_block_t block;
if (esp_efuse_find_purpose(purpose + i, &block)) {
// if chip has a few secure boot slots then we check all
#if SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY
bool revoke = esp_efuse_get_digest_revoke(i);
if (revoke) {
continue;
}
#endif
++num_keys;
#if SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
secure = !esp_efuse_read_field_bit(ESP_EFUSE_RD_DIS_KEY0_HI);
#else
secure = !esp_efuse_get_key_dis_read(block);
#endif // !SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
result &= secure;
if (!secure) {
ESP_LOGE(TAG, "Secure boot key in BLOCK%d must NOT be read-protected (can not be used)", block);
#if SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY
ESP_LOGE(TAG, "Revoke this secure boot key (set SECURE_BOOT_KEY_REVOKE%d->1)", i);
#endif
}
secure = !esp_efuse_block_is_empty(block);
result &= secure;
if (!secure) {
ESP_LOGE(TAG, "Secure boot key in BLOCK%d must NOT be empty (can not be used)", block);
#if SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY
ESP_LOGE(TAG, "Revoke this secure boot key (set SECURE_BOOT_KEY_REVOKE%d->1)", i);
#endif
}
secure = esp_efuse_get_key_dis_write(block);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected secure boot key in BLOCK%d (set WR_DIS_KEY%d->1)", block, block - EFUSE_BLK_KEY0);
}
#if SOC_EFUSE_KEY_PURPOSE_FIELD
secure = esp_efuse_get_keypurpose_dis_write(block);
result &= secure;
if (!secure) {
ESP_LOGW(TAG, "Not write-protected KEY_PURPOSE for BLOCK%d (set WR_DIS_KEY_PURPOSE%d->1)", block, block - EFUSE_BLK_KEY0);
}
#endif
}
}
result &= secure;
secure = (num_keys != 0);
result &= secure;
if (!secure) {
ESP_LOGE(TAG, "No secure boot key found");
}
return result;
}
#endif // not CONFIG_IDF_TARGET_ESP32
#endif // not BOOTLOADER_BUILD

View File

@ -277,7 +277,7 @@ static esp_err_t check_and_generate_secure_boot_keys(const esp_image_metadata_t
ESP_LOGI(TAG, "%d signature block(s) found appended to the app.", app_key_digests.num_digests);
if (app_key_digests.num_digests > boot_key_digests.num_digests) {
ESP_LOGW(TAG, "App has %d signature blocks but bootloader only has %d. Some keys missing from bootloader?");
ESP_LOGW(TAG, "App has %d signature blocks but bootloader only has %d. Some keys missing from bootloader?", app_key_digests.num_digests, boot_key_digests.num_digests);
}
/* Confirm if at least one public key from the application matches a public key in the bootloader

View File

@ -1,6 +1,6 @@
# The following five lines of boilerplate have to be in your project's
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(tusb_sample_descriptor)
project(test_rtc_custom_section)

View File

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

View File

@ -0,0 +1,2 @@
idf_component_register(SRCS "test_main.c"
INCLUDE_DIRS ".")

View File

@ -0,0 +1,31 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "bootloader_common.h"
#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#define TEST_MAGIC_VALUE 0x42987561
extern rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void);
void app_main(void) {
rtc_retain_mem_t* mem = bootloader_common_get_rtc_retain_mem();
uint32_t* _rtc_vars = (uint32_t*) mem->custom;
if (_rtc_vars[0] != TEST_MAGIC_VALUE) {
/* On the first boot, set the data inside the array */
_rtc_vars[0] = TEST_MAGIC_VALUE;
} else {
/* Second boot, the data was saved saved, success */
printf("SUCCESS: data were saved across reboot\n");
vTaskDelay(10000 / portTICK_PERIOD_MS);
}
esp_restart();
}

View File

@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded import Dut
@pytest.mark.generic
@pytest.mark.esp32
@pytest.mark.esp32c3
@pytest.mark.esp32s2
@pytest.mark.esp32s3
def test_rtc_reserved_memory(dut: Dut) -> None:
dut.expect_exact('SUCCESS: data were saved across reboot', timeout=10)

View File

@ -0,0 +1,3 @@
CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0x10
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC=y
CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC_SIZE=0x200

View File

@ -38,7 +38,8 @@ esp_err_t esp_blufi_send_wifi_conn_report(wifi_mode_t opmode, esp_blufi_sta_conn
arg.wifi_conn_report.softap_conn_num = softap_conn_num;
arg.wifi_conn_report.extra_info = extra_info;
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy,
btc_blufi_call_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list)
@ -54,7 +55,8 @@ esp_err_t esp_blufi_send_wifi_list(uint16_t apCount, esp_blufi_ap_record_t *list
arg.wifi_list.apCount = apCount;
arg.wifi_list.list = list;
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy,
btc_blufi_call_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_blufi_profile_init(void)
@ -67,7 +69,7 @@ esp_err_t esp_blufi_profile_init(void)
msg.pid = BTC_PID_BLUFI;
msg.act = BTC_BLUFI_ACT_INIT;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_blufi_profile_deinit(void)
@ -80,7 +82,7 @@ esp_err_t esp_blufi_profile_deinit(void)
msg.pid = BTC_PID_BLUFI;
msg.act = BTC_BLUFI_ACT_DEINIT;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
uint16_t esp_blufi_get_version(void)
@ -100,7 +102,7 @@ esp_err_t esp_blufi_send_error_info(esp_blufi_error_state_t state)
msg.act = BTC_BLUFI_ACT_SEND_ERR_INFO;
arg.blufi_err_infor.state = state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_blufi_send_custom_data(uint8_t *data, uint32_t data_len)
@ -118,6 +120,7 @@ esp_err_t esp_blufi_send_custom_data(uint8_t *data, uint32_t data_len)
arg.custom_data.data = data;
arg.custom_data.data_len = data_len;
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_blufi_args_t), btc_blufi_call_deep_copy,
btc_blufi_call_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif ///BLUFI_INCLUDED == TRUE

View File

@ -49,6 +49,8 @@ typedef enum {
typedef enum {
ESP_BLUFI_STA_CONN_SUCCESS = 0x00,
ESP_BLUFI_STA_CONN_FAIL = 0x01,
ESP_BLUFI_STA_CONNECTING = 0x02,
ESP_BLUFI_STA_NO_IP = 0x03,
} esp_blufi_sta_conn_state_t;
/// BLUFI init status
@ -75,6 +77,8 @@ typedef enum {
ESP_BLUFI_MAKE_PUBLIC_ERROR,
ESP_BLUFI_DATA_FORMAT_ERROR,
ESP_BLUFI_CALC_MD5_ERROR,
ESP_BLUFI_WIFI_SCAN_FAIL,
ESP_BLUFI_MSG_STATE_ERROR,
} esp_blufi_error_state_t;
/**
@ -98,6 +102,12 @@ typedef struct {
bool softap_max_conn_num_set; /*!< is max connection number of softap interface set */
uint8_t softap_channel; /*!< channel of softap interface */
bool softap_channel_set; /*!< is channel of softap interface set */
uint8_t sta_max_conn_retry; /*!< max retry of sta establish connection */
bool sta_max_conn_retry_set; /*!< is max retry of sta establish connection set */
uint8_t sta_conn_end_reason; /*!< reason of sta connection end */
bool sta_conn_end_reason_set; /*!< is reason of sta connection end set */
int8_t sta_conn_rssi; /*!< rssi of sta connection */
bool sta_conn_rssi_set; /*!< is rssi of sta connection set */
} esp_blufi_extra_info_t;
/** @brief Description of an WiFi AP */

View File

@ -210,24 +210,12 @@ static void btc_thread_handler(void *arg)
break;
}
if (msg->arg) {
osi_free(msg->arg);
}
osi_free(msg);
}
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;
}
@ -240,52 +228,61 @@ static bt_status_t btc_task_post(btc_msg_t *msg, uint32_t timeout)
* @param arg paramter
* @param arg_len length of paramter
* @param copy_func deep copy function
* @param free_func deep free function
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func)
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func,
btc_arg_deep_free_t free_func)
{
btc_msg_t lmsg;
if (msg == NULL) {
btc_msg_t* lmsg;
bt_status_t ret;
// arg XOR arg_len
if ((msg == NULL) || ((arg == NULL) == !(arg_len == 0))) {
BTC_TRACE_WARNING("%s Invalid parameters\n", __func__);
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) + arg_len);
if (lmsg == NULL) {
BTC_TRACE_WARNING("%s No memory\n", __func__);
return BT_STATUS_NOMEM;
}
return btc_task_post(&lmsg, OSI_THREAD_MAX_TIMEOUT);
memcpy(lmsg, msg, sizeof(btc_msg_t));
if (arg) {
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);
}
}
ret = btc_task_post(lmsg, OSI_THREAD_MAX_TIMEOUT);
if (ret != BT_STATUS_SUCCESS) {
if (copy_func && free_func) {
free_func(lmsg);
}
osi_free(lmsg);
}
return ret;
}
/**
* transfer an message to another module in tha same task.
* @param msg message
* @param arg paramter
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_inter_profile_call(btc_msg_t *msg, void *arg)
bt_status_t btc_inter_profile_call(btc_msg_t *msg)
{
if (msg == NULL) {
return BT_STATUS_PARM_INVALID;
}
msg->arg = arg;
switch (msg->sig) {
case BTC_SIG_API_CALL:
profile_tab[msg->pid].btc_call(msg);

View File

@ -20,7 +20,7 @@ typedef struct btc_msg {
uint8_t aid; //application id
uint8_t pid; //profile id
uint8_t act; //profile action, defined in seprerate header files
void *arg; //param for btc function or function param
UINT8 arg[0]; //param for btc function or function param
} btc_msg_t;
typedef struct btc_adv_packet {
@ -94,6 +94,7 @@ typedef struct {
} btc_func_t;
typedef void (* btc_arg_deep_copy_t)(btc_msg_t *msg, void *dst, void *src);
typedef void (* btc_arg_deep_free_t)(btc_msg_t *msg);
#ifdef __cplusplus
extern "C" {
@ -105,19 +106,20 @@ extern "C" {
* @param arg paramter
* @param arg_len length of paramter
* @param copy_func deep copy function
* @param free_func deep free function
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func);
bt_status_t btc_transfer_context(btc_msg_t *msg, void *arg, int arg_len, btc_arg_deep_copy_t copy_func,
btc_arg_deep_free_t free_func);
/**
* transfer an message to another module in tha same task.
* @param msg message
* @param arg paramter
* @return BT_STATUS_SUCCESS: success
* others: fail
*/
bt_status_t btc_inter_profile_call(btc_msg_t *msg, void *arg);
bt_status_t btc_inter_profile_call(btc_msg_t *msg);
bt_status_t btc_init(void);
void btc_deinit(void);

View File

@ -144,7 +144,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
}
@ -283,7 +283,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
msg.act = ESP_BLUFI_EVENT_INIT_FINISH;
param.init_finish.state = ESP_BLUFI_INIT_OK;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
}
case BTA_GATTS_CONNECT_EVT: {
@ -307,7 +307,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
param.connect.conn_id = BTC_GATT_GET_CONN_ID(p_data->conn.conn_id);
conn_id = param.connect.conn_id;
server_if = p_data->conn.server_if;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
}
case BTA_GATTS_DISCONNECT_EVT: {
@ -335,7 +335,7 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda, p_data->conn.remote_bda, ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
}
case BTA_GATTS_OPEN_EVT:
@ -385,8 +385,6 @@ void esp_blufi_send_encap(void *arg)
retry:
if (blufi_env.is_connected == false) {
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
osi_free(hdr);
hdr = NULL;
return;
}
if (esp_ble_get_cur_sendable_packets_num(BTC_GATT_GET_CONN_ID(blufi_env.conn_id)) > 0) {
@ -410,7 +408,7 @@ esp_err_t esp_blufi_close(esp_gatt_if_t gatts_if, uint16_t conn_id)
msg.pid = BTC_PID_GATTS;
msg.act = BTC_GATTS_ACT_CLOSE;
arg.close.conn_id = BTC_GATT_CREATE_CONN_ID(gatts_if, conn_id);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_gatts_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -90,7 +90,7 @@ void btc_blufi_report_error(esp_blufi_error_state_t state)
msg.act = ESP_BLUFI_EVENT_REPORT_ERROR;
esp_blufi_cb_param_t param;
param.report_error.state = state;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
}
void btc_blufi_recv_handler(uint8_t *data, int len)
@ -136,6 +136,16 @@ void btc_blufi_recv_handler(uint8_t *data, int len)
if (BLUFI_FC_IS_FRAG(hdr->fc)) {
if (blufi_env.offset == 0) {
/*
blufi_env.aggr_buf should be NULL if blufi_env.offset is 0.
It is possible that the process of sending fragment packet
has not been completed
*/
if (blufi_env.aggr_buf) {
BTC_TRACE_ERROR("%s msg error, blufi_env.aggr_buf is not freed\n", __func__);
btc_blufi_report_error(ESP_BLUFI_MSG_STATE_ERROR);
return;
}
blufi_env.total_len = hdr->data[0] | (((uint16_t) hdr->data[1]) << 8);
blufi_env.aggr_buf = osi_malloc(blufi_env.total_len);
if (blufi_env.aggr_buf == NULL) {
@ -155,6 +165,18 @@ void btc_blufi_recv_handler(uint8_t *data, int len)
} else {
if (blufi_env.offset > 0) { /* if previous pkt is frag */
/* blufi_env.aggr_buf should not be NULL */
if (blufi_env.aggr_buf == NULL) {
BTC_TRACE_ERROR("%s buffer is NULL\n", __func__);
btc_blufi_report_error(ESP_BLUFI_DH_MALLOC_ERROR);
return;
}
/* payload length should be equal to total_len */
if ((blufi_env.offset + hdr->data_len) != blufi_env.total_len) {
BTC_TRACE_ERROR("%s payload is longer than packet length, len %d \n", __func__, blufi_env.total_len);
btc_blufi_report_error(ESP_BLUFI_DATA_FORMAT_ERROR);
return;
}
memcpy(blufi_env.aggr_buf + blufi_env.offset, hdr->data, hdr->data_len);
btc_blufi_protocol_handler(hdr->type, blufi_env.aggr_buf, blufi_env.total_len);
@ -313,6 +335,21 @@ static void btc_blufi_wifi_conn_report(uint8_t opmode, uint8_t sta_conn_state, u
*p++ = 1;
*p++ = info->softap_channel;
}
if (info->sta_max_conn_retry_set) {
*p++ = BLUFI_TYPE_DATA_SUBTYPE_STA_MAX_CONN_RETRY;
*p++ = 1;
*p++ = info->sta_max_conn_retry;
}
if (info->sta_conn_end_reason_set) {
*p++ = BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_END_REASON;
*p++ = 1;
*p++ = info->sta_conn_end_reason;
}
if (info->sta_conn_rssi_set) {
*p++ = BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_RSSI;
*p++ = 1;
*p++ = info->sta_conn_rssi;
}
}
if (p - data > data_len) {
BTC_TRACE_ERROR("%s len error %d %d\n", __func__, (int)(p - data), data_len);
@ -706,6 +743,21 @@ void btc_blufi_call_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
dst->wifi_conn_report.extra_info->softap_channel = src_info->softap_channel;
dst->wifi_conn_report.extra_info_len += (1 + 2);
}
if (src_info->sta_max_conn_retry_set) {
dst->wifi_conn_report.extra_info->sta_max_conn_retry_set = src_info->sta_max_conn_retry_set;
dst->wifi_conn_report.extra_info->sta_max_conn_retry = src_info->sta_max_conn_retry;
dst->wifi_conn_report.extra_info_len += (1 + 2);
}
if (src_info->sta_conn_end_reason_set) {
dst->wifi_conn_report.extra_info->sta_conn_end_reason_set = src_info->sta_conn_end_reason_set;
dst->wifi_conn_report.extra_info->sta_conn_end_reason = src_info->sta_conn_end_reason;
dst->wifi_conn_report.extra_info_len += (1 + 2);
}
if (src_info->sta_conn_rssi_set) {
dst->wifi_conn_report.extra_info->sta_conn_rssi_set = src_info->sta_conn_rssi_set;
dst->wifi_conn_report.extra_info->sta_conn_rssi = src_info->sta_conn_rssi;
dst->wifi_conn_report.extra_info_len += (1 + 2);
}
break;
}
case BTC_BLUFI_ACT_SEND_WIFI_LIST:{

View File

@ -42,35 +42,35 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.act = ESP_BLUFI_EVENT_SET_WIFI_OPMODE;
param.wifi_mode.op_mode = data[0];
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
case BLUFI_TYPE_CTRL_SUBTYPE_CONN_TO_AP:
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_REQ_CONNECT_TO_AP;
btc_transfer_context(&msg, NULL, 0, NULL);
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
break;
case BLUFI_TYPE_CTRL_SUBTYPE_DISCONN_FROM_AP:
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_REQ_DISCONNECT_FROM_AP;
btc_transfer_context(&msg, NULL, 0, NULL);
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
break;
case BLUFI_TYPE_CTRL_SUBTYPE_GET_WIFI_STATUS:
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_GET_WIFI_STATUS;
btc_transfer_context(&msg, NULL, 0, NULL);
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
break;
case BLUFI_TYPE_CTRL_SUBTYPE_DEAUTHENTICATE_STA:
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_DEAUTHENTICATE_STA;
btc_transfer_context(&msg, NULL, 0, NULL);
btc_transfer_context(&msg, NULL, 0, NULL,NULL);
break;
case BLUFI_TYPE_CTRL_SUBTYPE_GET_VERSION: {
uint8_t type = BLUFI_BUILD_TYPE(BLUFI_TYPE_DATA, BLUFI_TYPE_DATA_SUBTYPE_REPLY_VERSION);
@ -85,13 +85,13 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_RECV_SLAVE_DISCONNECT_BLE;
btc_transfer_context(&msg, NULL, 0, NULL);
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
break;
case BLUFI_TYPE_CTRL_SUBTYPE_GET_WIFI_LIST:
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_GET_WIFI_LIST;
btc_transfer_context(&msg, NULL, 0, NULL);
btc_transfer_context(&msg, NULL, 0, NULL, NULL);
break;
default:
BTC_TRACE_ERROR("%s Unkown Ctrl pkt %02x\n", __func__, type);
@ -116,7 +116,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.act = ESP_BLUFI_EVENT_RECV_STA_BSSID;
memcpy(param.sta_bssid.bssid, &data[0], 6);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
case BLUFI_TYPE_DATA_SUBTYPE_STA_SSID:
msg.sig = BTC_SIG_API_CB;
@ -125,7 +125,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.sta_ssid.ssid = &data[0];
param.sta_ssid.ssid_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_STA_PASSWD:
msg.sig = BTC_SIG_API_CB;
@ -134,7 +134,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.sta_passwd.passwd = &data[0];
param.sta_passwd.passwd_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_SSID:
msg.sig = BTC_SIG_API_CB;
@ -143,7 +143,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.softap_ssid.ssid = &data[0];
param.softap_ssid.ssid_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_PASSWD:
msg.sig = BTC_SIG_API_CB;
@ -152,7 +152,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.softap_passwd.passwd = &data[0];
param.softap_passwd.passwd_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_MAX_CONN_NUM:
msg.sig = BTC_SIG_API_CB;
@ -160,7 +160,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.act = ESP_BLUFI_EVENT_RECV_SOFTAP_MAX_CONN_NUM;
param.softap_max_conn_num.max_conn_num = data[0];
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_AUTH_MODE:
msg.sig = BTC_SIG_API_CB;
@ -168,7 +168,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.act = ESP_BLUFI_EVENT_RECV_SOFTAP_AUTH_MODE;
param.softap_auth_mode.auth_mode = data[0];
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SOFTAP_CHANNEL:
msg.sig = BTC_SIG_API_CB;
@ -176,7 +176,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.act = ESP_BLUFI_EVENT_RECV_SOFTAP_CHANNEL;
param.softap_channel.channel = data[0];
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
break;
case BLUFI_TYPE_DATA_SUBTYPE_USERNAME:
msg.sig = BTC_SIG_API_CB;
@ -185,7 +185,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.username.name = &data[0];
param.username.name_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_CA:
msg.sig = BTC_SIG_API_CB;
@ -194,7 +194,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.ca.cert = &data[0];
param.ca.cert_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_CLIENT_CERT:
msg.sig = BTC_SIG_API_CB;
@ -203,7 +203,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.client_cert.cert = &data[0];
param.client_cert.cert_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SERVER_CERT:
msg.sig = BTC_SIG_API_CB;
@ -212,7 +212,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.client_cert.cert = &data[0];
param.client_cert.cert_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_CLIENT_PRIV_KEY:
msg.sig = BTC_SIG_API_CB;
@ -221,7 +221,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.client_pkey.pkey = &data[0];
param.client_pkey.pkey_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_SERVER_PRIV_KEY:
msg.sig = BTC_SIG_API_CB;
@ -230,7 +230,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
param.client_pkey.pkey = &data[0];
param.client_pkey.pkey_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
case BLUFI_TYPE_DATA_SUBTYPE_CUSTOM_DATA:
msg.sig = BTC_SIG_API_CB;
@ -238,7 +238,7 @@ void btc_blufi_protocol_handler(uint8_t type, uint8_t *data, int len)
msg.act = ESP_BLUFI_EVENT_RECV_CUSTOM_DATA;
param.custom_data.data = &data[0];
param.custom_data.data_len = len;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), btc_blufi_cb_deep_copy, btc_blufi_cb_deep_free);
break;
default:
BTC_TRACE_ERROR("%s Unkown Ctrl pkt %02x\n", __func__, type);

View File

@ -12,7 +12,7 @@
#if (BLUFI_INCLUDED == TRUE)
#define BTC_BLUFI_GREAT_VER 0x01 //Version + Subversion
#define BTC_BLUFI_SUB_VER 0x02 //Version + Subversion
#define BTC_BLUFI_SUB_VER 0x03 //Version + Subversion
#define BTC_BLUFI_VERSION ((BTC_BLUFI_GREAT_VER<<8)|BTC_BLUFI_SUB_VER) //Version + Subversion
typedef UINT8 tGATT_IF;
@ -121,6 +121,9 @@ extern tBLUFI_ENV *blufi_env_ptr;
#define BLUFI_TYPE_DATA_SUBTYPE_WIFI_LIST 0x11
#define BLUFI_TYPE_DATA_SUBTYPE_ERROR_INFO 0x12
#define BLUFI_TYPE_DATA_SUBTYPE_CUSTOM_DATA 0x13
#define BLUFI_TYPE_DATA_SUBTYPE_STA_MAX_CONN_RETRY 0x14
#define BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_END_REASON 0x15
#define BLUFI_TYPE_DATA_SUBTYPE_STA_CONN_RSSI 0x16
#define BLUFI_TYPE_IS_CTRL(type) (BLUFI_GET_TYPE((type)) == BLUFI_TYPE_CTRL)
#define BLUFI_TYPE_IS_DATA(type) (BLUFI_GET_TYPE((type)) == BLUFI_TYPE_DATA)

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -12,6 +12,7 @@
#ifdef CONFIG_BT_NIMBLE_ENABLED
#include "nimble/ble.h"
#include "host/ble_gap.h"
#include "modlog/modlog.h"
#endif
@ -40,6 +41,7 @@ void esp_blufi_gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *a
/* Initialise gatt server */
int esp_blufi_gatt_svr_init(void);
void esp_blufi_btc_init(void);
void esp_blufi_btc_deinit(void);
#endif
#ifdef CONFIG_BT_BLUEDROID_ENABLED
@ -80,4 +82,18 @@ void esp_blufi_adv_start(void);
void esp_blufi_send_encap(void *arg);
#ifdef CONFIG_BT_NIMBLE_ENABLED
/**
* @brief Handle gap event for BluFi.
* This function can be called inside custom use gap event handler.
* It provide minimal event management for BluFi purpose.
*
* @param[in] event The type of event being signalled.
* @param[in] arg Application-specified argument. Currently unused
* @return int 0 in case of success.
* Other in case of failure.
*/
int esp_blufi_handle_gap_events(struct ble_gap_event *event, void *arg);
#endif
#endif/* _ESP_BLUFI_ */

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -266,7 +266,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
param.connect.conn_id = event->connect.conn_handle;
/* save connection handle */
conn_handle = event->connect.conn_handle;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
}
if (event->connect.status != 0) {
/* Connection failed; resume advertising. */
@ -293,7 +293,7 @@ esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda, event->disconnect.conn.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
return 0;
case BLE_GAP_EVENT_CONN_UPDATE:
@ -424,7 +424,7 @@ void esp_blufi_deinit(void)
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_DEINIT_FINISH;
param.deinit_finish.state = ESP_BLUFI_DEINIT_OK;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
}
void esp_blufi_send_notify(void *arg)
@ -432,9 +432,15 @@ void esp_blufi_send_notify(void *arg)
struct pkt_info *pkts = (struct pkt_info *) arg;
struct os_mbuf *om;
om = ble_hs_mbuf_from_flat(pkts->pkt, pkts->pkt_len);
if (om == NULL) {
ESP_LOGE(TAG, "Error in allocating memory");
return;
}
int rc = 0;
rc = ble_gattc_notify_custom(conn_handle, gatt_values[1].val_handle, om);
assert(rc == 0);
rc = ble_gatts_notify_custom(blufi_env.conn_id, gatt_values[1].val_handle, om);
if (rc != 0) {
ESP_LOGE(TAG, "Error in sending notification");
}
}
void esp_blufi_disconnect(void)
@ -449,8 +455,6 @@ void esp_blufi_send_encap(void *arg)
struct blufi_hdr *hdr = (struct blufi_hdr *)arg;
if (blufi_env.is_connected == false) {
BTC_TRACE_WARNING("%s ble connection is broken\n", __func__);
osi_free(hdr);
hdr = NULL;
return;
}
btc_blufi_send_notify((uint8_t *)hdr,
@ -466,4 +470,74 @@ void esp_blufi_btc_init(void)
assert(rc == 0);
}
void esp_blufi_btc_deinit(void)
{
btc_deinit();
}
int esp_blufi_handle_gap_events(struct ble_gap_event *event, void *arg)
{
struct ble_gap_conn_desc desc;
int rc;
if (event != NULL) {
switch (event->type) {
case BLE_GAP_EVENT_CONNECT:
if (event->connect.status == 0) {
btc_msg_t msg;
esp_blufi_cb_param_t param;
blufi_env.is_connected = true;
blufi_env.recv_seq = blufi_env.send_seq = 0;
blufi_env.conn_id = event->connect.conn_handle;
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_CONNECT;
rc = ble_gap_conn_find(event->connect.conn_handle, &desc);
assert(rc == 0);
memcpy(param.connect.remote_bda, desc.peer_id_addr.val, ESP_BLUFI_BD_ADDR_LEN);
param.connect.conn_id = event->connect.conn_handle;
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
}
return 0;
case BLE_GAP_EVENT_DISCONNECT: {
btc_msg_t msg;
esp_blufi_cb_param_t param;
blufi_env.is_connected = false;
blufi_env.recv_seq = blufi_env.send_seq = 0;
blufi_env.sec_mode = 0x0;
blufi_env.offset = 0;
memcpy(blufi_env.remote_bda,
event->disconnect.conn.peer_id_addr.val,
ESP_BLUFI_BD_ADDR_LEN);
if (blufi_env.aggr_buf != NULL) {
osi_free(blufi_env.aggr_buf);
blufi_env.aggr_buf = NULL;
}
msg.sig = BTC_SIG_API_CB;
msg.pid = BTC_PID_BLUFI;
msg.act = ESP_BLUFI_EVENT_BLE_DISCONNECT;
memcpy(param.disconnect.remote_bda,
event->disconnect.conn.peer_id_addr.val,
ESP_BLUFI_BD_ADDR_LEN);
btc_transfer_context(&msg, &param, sizeof(esp_blufi_cb_param_t), NULL, NULL);
return 0;
}
case BLE_GAP_EVENT_MTU:
blufi_env.frag_size = (event->mtu.value < BLUFI_MAX_DATA_LEN ? event->mtu.value :
BLUFI_MAX_DATA_LEN) - BLUFI_MTU_RESERVED_SIZE;
return 0;
}
}
return 0;
}
#endif

View File

@ -149,7 +149,7 @@ static void alarm_cb_handler(struct alarm_t *alarm)
msg.pid = BTC_PID_ALARM;
arg.cb = alarm->cb;
arg.cb_data = alarm->cb_data;
btc_transfer_context(&msg, &arg, sizeof(btc_alarm_args_t), NULL);
btc_transfer_context(&msg, &arg, sizeof(btc_alarm_args_t), NULL, NULL);
}
osi_alarm_t *osi_alarm_new(const char *alarm_name, osi_alarm_callback_t callback, void *data, period_ms_t timer_expire)

View File

@ -214,17 +214,17 @@ osi_thread_t *osi_thread_create(const char *name, size_t stack_size, int priorit
return NULL;
}
osi_thread_t *thread = (osi_thread_t *)osi_malloc(sizeof(osi_thread_t));
osi_thread_t *thread = (osi_thread_t *)osi_calloc(sizeof(osi_thread_t));
if (thread == NULL) {
goto _err;
}
thread->stop = false;
thread->work_queue_num = work_queue_num;
thread->work_queues = (struct work_queue **)osi_malloc(sizeof(struct work_queue *) * work_queue_num);
thread->work_queues = (struct work_queue **)osi_calloc(sizeof(struct work_queue *) * work_queue_num);
if (thread->work_queues == NULL) {
goto _err;
}
thread->work_queue_num = work_queue_num;
for (int i = 0; i < thread->work_queue_num; i++) {
size_t queue_len = work_queue_len[i] ? work_queue_len[i] : DEFAULT_WORK_QUEUE_CAPACITY;

View File

@ -353,6 +353,22 @@ config BTDM_SCAN_DUPL_CACHE_SIZE
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BTDM_SCAN_DUPL_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BTDM_BLE_SCAN_DUPL
range 0 1000
default 0
help
If the period value is non-zero, the controller will periodically clear the device information
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
Host in advertising report events.
There are two scenarios where the ADV packet will be repeatedly reported:
1. The duplicate scan cache is full, the controller will delete the oldest device information and
add new device information.
2. When the refresh period is up, the controller will clear all device information and start filtering
again.
config BTDM_BLE_MESH_SCAN_DUPL_EN
bool "Special duplicate scan mechanism for BLE Mesh scan"
depends on BTDM_BLE_SCAN_DUPL

View File

@ -325,6 +325,7 @@ static void *customer_queue_create_hlevel_wrapper(uint32_t queue_len, uint32_t i
#endif /* CONFIG_BTDM_CTRL_HLI */
static void interrupt_l3_disable(void);
static void interrupt_l3_restore(void);
static void bt_controller_deinit_internal(void);
/* Local variable definition
***************************************************************************
@ -1479,7 +1480,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto error;
}
esp_phy_pd_mem_init();
esp_phy_modem_init();
esp_bt_power_domain_on();
@ -1576,26 +1577,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
return ESP_OK;
error:
#ifdef CONFIG_PM_ENABLE
if (!s_btdm_allow_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
if (s_btdm_slp_tmr != NULL) {
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
}
#endif
if (s_wakeup_req_sem) {
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
bt_controller_deinit_internal();
return err;
}
@ -1607,6 +1591,13 @@ esp_err_t esp_bt_controller_deinit(void)
btdm_controller_deinit();
bt_controller_deinit_internal();
return ESP_OK;
}
static void bt_controller_deinit_internal(void)
{
periph_module_disable(PERIPH_BT_MODULE);
#ifdef CONFIG_PM_ENABLE
@ -1628,11 +1619,16 @@ esp_err_t esp_bt_controller_deinit(void)
s_pm_lock_acquired = false;
#endif
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
free(osi_funcs_p);
osi_funcs_p = NULL;
if (s_wakeup_req_sem) {
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
if (osi_funcs_p) {
free(osi_funcs_p);
osi_funcs_p = NULL;
}
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
@ -1641,9 +1637,7 @@ esp_err_t esp_bt_controller_deinit(void)
esp_bt_power_domain_off();
esp_phy_pd_mem_deinit();
return ESP_OK;
esp_phy_modem_deinit();
}
static void bt_controller_shutdown(void* arg)

View File

@ -128,6 +128,7 @@ if BT_LE_EXT_ADV
instances. Minimum there is always one instance of
advertising. Enter how many more advertising instances you
want.
Each extended advertising instance will take about 0.5k DRAM.
config BT_LE_EXT_ADV_MAX_SIZE
int "Maximum length of the advertising data."
@ -206,7 +207,7 @@ menu "Memory Settings"
config BT_LE_ACL_BUF_COUNT
int "ACL Buffer count"
default 24
default 10
help
The number of ACL data buffers.
@ -339,7 +340,7 @@ config BT_LE_MAX_CONNECTIONS
is expected to configure BTDM_CTRL_BLE_MAX_CONN from controller menu
along with this option. Similarly for ESP32-C3 or ESP32-S3, user is expected to
configure BT_CTRL_BLE_MAX_ACT from controller menu.
Each connection will take about 1k DRAM.
choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
@ -386,3 +387,10 @@ choice BT_LE_WAKEUP_SOURCE
help
Use BLE rtc timer to wakeup CPU
endchoice
config BT_LE_USE_ESP_TIMER
bool "Use Esp Timer for callout"
depends on !BT_NIMBLE_ENABLED
default y
help
Set this option to use Esp Timer which has higher priority timer instead of FreeRTOS timer

View File

@ -10,6 +10,8 @@
#include <string.h>
#include "esp_random.h"
#include "esp_heap_caps.h"
#include "esp_heap_caps_init.h"
#include <esp_mac.h>
#include "sdkconfig.h"
@ -50,6 +52,8 @@
#include "esp_private/periph_ctrl.h"
#include "esp_sleep.h"
#include "soc/syscon_reg.h"
#include "soc/dport_access.h"
/* Macro definition
************************************************************************
*/
@ -58,9 +62,16 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20220125
#define EXT_FUNC_VERSION 0x20221122
#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
************************************************************************
*/
@ -93,6 +104,7 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y, const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
void (* _esp_bt_track_pll_cap)(void);
uint32_t magic;
};
@ -125,6 +137,17 @@ extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _nimble_bss_start;
extern uint32_t _nimble_bss_end;
extern uint32_t _nimble_data_start;
extern uint32_t _nimble_data_end;
extern uint32_t _bt_data_start;
extern uint32_t _bt_data_end;
/* Local Function Declaration
*********************************************************************
@ -156,12 +179,10 @@ static void esp_reset_rpa_moudle(void);
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
/* This variable tells if BLE is running */
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
static bool s_pm_lock_acquired = true;
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)
#endif /* #ifdef CONFIG_PM_ENABLE */
@ -171,10 +192,11 @@ static DRAM_ATTR esp_pm_lock_handle_t s_light_sleep_pm_lock;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US (0)
static void btdm_slp_tmr_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_btdm_slp_tmr = NULL;
static void ble_sleep_timer_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_ble_sleep_timer = NULL;
#endif
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
._magic = OSI_COEX_MAGIC_VALUE,
._version = OSI_COEX_VERSION,
@ -210,12 +232,13 @@ struct ext_funcs_t ext_funcs_ro = {
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
periph_module_reset(PERIPH_MODEM_RPA_MODULE);
DPORT_SET_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, BLE_RPA_REST_BIT);
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, BLE_RPA_REST_BIT);
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2)
{
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 +261,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 +319,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);
}
@ -378,7 +400,7 @@ static int ble_hci_unregistered_hook(void*, void*)
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler, void *arg, void **ret_handle_in)
{
int rc = esp_intr_alloc(source, flags, handler, arg, (intr_handle_t *)ret_handle_in);
int rc = esp_intr_alloc(source, flags | ESP_INTR_FLAG_IRAM, handler, arg, (intr_handle_t *)ret_handle_in);
return rc;
}
@ -392,20 +414,28 @@ static int esp_intr_free_wrapper(void **ret_handle)
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
esp_phy_disable();
if (!s_ble_active) {
return;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
uint32_t delta_tick;
uint32_t us_to_sleep;
uint32_t sleep_tick;
uint32_t tick_invalid = *(uint32_t*)(arg);
assert(arg != NULL);
if(!tick_invalid) {
uint32_t sleep_tick = r_os_cputime_get32();
if(enable_tick <= sleep_tick) {
if (!tick_invalid) {
sleep_tick = r_os_cputime_get32();
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
delta_tick = enable_tick - sleep_tick;
if (delta_tick & 0x80000000) {
return;
}
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
uint32_t us_to_sleep = r_os_cputime_ticks_to_usecs(enable_tick - sleep_tick);
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
esp_err_t err = esp_timer_start_once(s_btdm_slp_tmr, us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
us_to_sleep = r_os_cputime_ticks_to_usecs(delta_tick);
if (us_to_sleep <= BTDM_MIN_TIMER_UNCERTAINTY_US) {
return;
}
esp_err_t err = esp_timer_start_once(s_ble_sleep_timer, us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
if (err != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ESP timer start failed\n");
return;
@ -416,56 +446,43 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
r_ble_rtc_wake_up_state_clr();
#endif
if (s_pm_lock_acquired) {
assert(s_pm_lock != NULL);
esp_pm_lock_release(s_pm_lock);
s_pm_lock_acquired = false;
}
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_disable();
s_ble_active = false;
}
IRAM_ATTR void controller_wakeup_cb(void *arg)
{
if (s_ble_active) {
return;
}
esp_phy_enable();
// need to check if need to call pm lock here
#ifdef CONFIG_PM_ENABLE
assert(s_pm_lock != NULL);
if (!s_pm_lock_acquired) {
s_pm_lock_acquired = true;
esp_pm_lock_acquire(s_pm_lock);
}
esp_pm_lock_acquire(s_pm_lock);
#endif //CONFIG_PM_ENABLE
s_ble_active = true;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
static void btdm_slp_tmr_callback(void * arg)
static void ble_sleep_timer_callback(void * arg)
{
(void)(arg);
if (!s_pm_lock_acquired) {
assert(s_pm_lock != NULL);
s_pm_lock_acquired = true;
esp_pm_lock_acquire(s_pm_lock);
}
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif // CONFIG_PM_ENABLE
void controller_sleep_init(void)
esp_err_t controller_sleep_init(void)
{
#ifdef CONFIG_PM_ENABLE
s_btdm_allow_light_sleep = false;
#endif // CONFIG_PM_ENABLE
esp_err_t rc = 0;
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled\n");
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0, 500 + BLE_RTC_DELAY_US);
#ifdef CONFIG_PM_ENABLE
s_btdm_allow_light_sleep = true;
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
#endif // CONFIG_PM_ENABLE
@ -473,21 +490,19 @@ void controller_sleep_init(void)
// enable light sleep
#ifdef CONFIG_PM_ENABLE
if (!s_btdm_allow_light_sleep) {
if (esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "btnosleep", &s_light_sleep_pm_lock) != ESP_OK) {
goto error;
}
}
if (esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock) != ESP_OK) {
rc = esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "bt", &s_pm_lock);
if (rc != ESP_OK) {
goto error;
}
esp_pm_lock_acquire(s_pm_lock);
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
esp_timer_create_args_t create_args = {
.callback = btdm_slp_tmr_callback,
.callback = ble_sleep_timer_callback,
.arg = NULL,
.name = "btSlp"
};
if (esp_timer_create(&create_args, &s_btdm_slp_tmr) != ESP_OK) {
rc = esp_timer_create(&create_args, &s_ble_sleep_timer);
if (rc != ESP_OK) {
goto error;
}
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is ESP timer");
@ -498,32 +513,20 @@ void controller_sleep_init(void)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
s_pm_lock_acquired = true;
if (!s_btdm_allow_light_sleep) {
esp_pm_lock_acquire(s_light_sleep_pm_lock);
}
if (s_pm_lock) {
esp_pm_lock_acquire(s_pm_lock);
}
return;
return rc;
error:
if (!s_btdm_allow_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_release(s_pm_lock);
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_btdm_slp_tmr != NULL) {
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
@ -532,7 +535,7 @@ error:
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif //CONFIG_PM_ENABLE
return rc;
}
void controller_sleep_deinit(void)
@ -540,28 +543,25 @@ 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();
#endif
esp_sleep_disable_bt_wakeup();
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
if (!s_btdm_allow_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if(s_btdm_slp_tmr != NULL) {
esp_timer_stop(s_btdm_slp_tmr);
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
}
#endif
s_pm_lock_acquired = false;
#endif
/*lock should release first and then delete*/
if (s_ble_active) {
esp_pm_lock_release(s_pm_lock);
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif //CONFIG_PM_ENABLE
}
void ble_rtc_clk_init(void)
@ -576,13 +576,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
@ -591,48 +591,56 @@ void ble_rtc_clk_init(void)
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
return ESP_ERR_INVALID_STATE;
}
if (cfg == NULL) {
if (!cfg) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "cfg is NULL");
return ESP_ERR_INVALID_ARG;
}
ble_rtc_clk_init();
if (esp_register_ext_funcs(&ext_funcs_ro) != 0) {
ret = esp_register_ext_funcs(&ext_funcs_ro);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "register extend functions failed");
return ESP_ERR_INVALID_ARG;
return ret;
}
/* Initialize the function pointers for OS porting */
npl_freertos_funcs_init();
struct npl_funcs_t *p_npl_funcs = npl_freertos_funcs_get();
if (!p_npl_funcs) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl functions get failed");
return ESP_ERR_INVALID_ARG;
}
if (esp_register_npl_funcs(p_npl_funcs) != 0) {
ret = esp_register_npl_funcs(p_npl_funcs);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl functions register failed");
return ESP_ERR_INVALID_ARG;
goto free_mem;
}
ble_get_npl_element_info(cfg, &npl_info);
npl_freertos_set_controller_npl_info(&npl_info);
if (npl_freertos_mempool_init() != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl mempool init failed");
return ESP_ERR_INVALID_ARG;
ret = ESP_ERR_INVALID_ARG;
goto free_mem;
}
/* Initialize the global memory pool */
if (os_msys_buf_alloc() != 0) {
ret = os_msys_buf_alloc();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "os msys alloc failed");
return ESP_ERR_INVALID_ARG;
goto free_mem;
}
os_msys_init();
@ -641,30 +649,36 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
/* Initialize default event queue */
ble_npl_eventq_init(nimble_port_get_dflt_eventq());
#endif
esp_phy_pd_mem_init();
esp_phy_modem_init();
periph_module_enable(PERIPH_BT_MODULE);
// init phy
esp_phy_enable();
s_ble_active = true;
// init bb
bt_bb_v2_init_cmplx(1);
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
return ESP_ERR_INVALID_ARG;
ret = ESP_ERR_INVALID_ARG;
goto free_controller;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_init();
#endif
int rc = ble_controller_init(cfg);
if (rc != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", rc);
return ESP_ERR_NO_MEM;
ret = ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto free_controller;
}
controller_sleep_init();
ret = controller_sleep_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
goto free_controller;
}
uint8_t mac[6];
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
@ -677,8 +691,22 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hci_unregistered_hook,NULL,
(ble_hci_trans_rx_acl_fn *)ble_hci_unregistered_hook,NULL);
return ESP_OK;
free_controller:
controller_sleep_deinit();
ble_controller_deinit();
esp_phy_disable();
esp_phy_modem_deinit();
#if CONFIG_BT_NIMBLE_ENABLED
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
free_mem:
os_msys_buf_free();
npl_freertos_mempool_deinit();
esp_unregister_npl_funcs();
npl_freertos_funcs_deinit();
esp_unregister_ext_funcs();
return ret;
}
esp_err_t esp_bt_controller_deinit(void)
@ -690,9 +718,13 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
if (ble_controller_deinit() != 0) {
return ESP_FAIL;
if (s_ble_active) {
esp_phy_disable();
s_ble_active = false;
}
ble_controller_deinit();
#if CONFIG_BT_NIMBLE_ENABLED
/* De-initialize default event queue */
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
@ -708,8 +740,7 @@ esp_err_t esp_bt_controller_deinit(void)
npl_freertos_mempool_deinit();
esp_phy_disable();
esp_phy_pd_mem_deinit();
esp_phy_modem_deinit();
ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
@ -718,6 +749,8 @@ esp_err_t esp_bt_controller_deinit(void)
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
{
esp_err_t ret = ESP_OK;
if (mode != ESP_BT_MODE_BLE) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller mode");
return ESP_FAIL;
@ -730,10 +763,18 @@ esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
coex_enable();
#endif
if (ble_controller_enable(mode) != 0) {
return ESP_FAIL;
ret = ESP_FAIL;
goto error;
}
ble_controller_status = ESP_BT_CONTROLLER_STATUS_ENABLED;
return ESP_OK;
error:
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
return ret;
}
esp_err_t esp_bt_controller_disable(void)
@ -745,19 +786,66 @@ esp_err_t esp_bt_controller_disable(void)
if (ble_controller_disable() != 0) {
return ESP_FAIL;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
ble_controller_status = ESP_BT_CONTROLLER_STATUS_INITED;
return ESP_OK;
}
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
return ESP_OK;
}
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end)
{
int ret = heap_caps_add_region(start, end);
/* heap_caps_add_region() returns ESP_ERR_INVALID_SIZE if the memory region is
* is too small to fit a heap. This cannot be termed as a fatal error and hence
* we replace it by ESP_OK
*/
if (ret == ESP_ERR_INVALID_SIZE) {
return ESP_OK;
}
return ret;
}
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
intptr_t mem_start, mem_end;
if (mode == ESP_BT_MODE_BLE) {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_bt_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_bt_data_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_bss_start;
mem_end = (intptr_t)&_nimble_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_data_start;
mem_end = (intptr_t)&_nimble_data_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
return ESP_OK;
}
@ -770,16 +858,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

@ -134,12 +134,10 @@ config BT_CTRL_RX_ANTENNA_INDEX_EFF
choice BT_CTRL_DFT_TX_POWER_LEVEL
prompt "BLE default Tx power level"
default BT_CTRL_DFT_TX_POWER_LEVEL_P3
default BT_CTRL_DFT_TX_POWER_LEVEL_P9
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
@ -280,6 +280,22 @@ config BT_CTRL_SCAN_DUPL_CACHE_SIZE
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BT_CTRL_BLE_SCAN_DUPL
range 0 1000
default 0
help
If the period value is non-zero, the controller will periodically clear the device information
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
Host in advertising report events.
There are two scenarios where the ADV packet will be repeatedly reported:
1. The duplicate scan cache is full, the controller will delete the oldest device information and
add new device information.
2. When the refresh period is up, the controller will clear all device information and start filtering
again.
config BT_CTRL_BLE_MESH_SCAN_DUPL_EN
bool "Special duplicate scan mechanism for BLE Mesh scan"
depends on BT_CTRL_BLE_SCAN_DUPL
@ -351,9 +367,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 +384,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
@ -404,3 +429,11 @@ config BT_CTRL_CODED_AGC_RECORRECT_EN
default n
help
Enable coded phy AGC recorrect
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
bool "Disable active scan backoff"
default n
help
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.

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;
@ -241,7 +242,6 @@ extern bool btdm_deep_sleep_mem_init(void);
extern void btdm_deep_sleep_mem_deinit(void);
extern void btdm_ble_power_down_dma_copy(bool copy);
extern uint8_t btdm_sleep_clock_sync(void);
extern void sdk_config_extend_set_pll_track(bool enable);
#if CONFIG_MAC_BB_PD
extern void esp_mac_bb_power_down(void);
@ -249,24 +249,19 @@ extern void esp_mac_bb_power_up(void);
extern void ets_backup_dma_copy(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
#endif
extern char _bss_start_btdm;
extern char _bss_end_btdm;
extern char _data_start_btdm;
extern char _data_end_btdm;
extern uint32_t _data_start_btdm_rom;
extern uint32_t _data_end_btdm_rom;
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _btdm_bss_start;
extern uint32_t _btdm_bss_end;
extern uint32_t _nimble_bss_start;
extern uint32_t _nimble_bss_end;
extern uint32_t _bt_data_start;
extern uint32_t _bt_data_end;
extern uint32_t _btdm_data_start;
extern uint32_t _btdm_data_end;
extern uint32_t _nimble_data_start;
extern uint32_t _nimble_data_end;
extern char _bt_tmp_bss_start;
extern char _bt_tmp_bss_end;
/* Local Function Declare
*********************************************************************
@ -316,6 +311,11 @@ static void btdm_hw_mac_power_down_wrapper(void);
static void btdm_backup_dma_copy_wrapper(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
static void btdm_slp_tmr_callback(void *arg);
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end);
static void bt_controller_deinit_internal(void);
/* Local variable definition
***************************************************************************
*/
@ -876,13 +876,142 @@ static void btdm_controller_mem_init(void)
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(BTDM_LOG_TAG, "%s not implemented, return OK", __func__);
intptr_t mem_start=(intptr_t) NULL, mem_end=(intptr_t) NULL;
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return ESP_ERR_INVALID_STATE;
}
if (mode & ESP_BT_MODE_BLE) {
/* if the addresses of rom btdm .data and .bss are consecutive,
they are registered in the system heap as a piece of memory
*/
if(ets_rom_layout_p->data_end_btdm == ets_rom_layout_p->bss_start_btdm) {
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release rom btdm [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)ets_rom_layout_p->bss_start_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release rom btdm BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
mem_end = (intptr_t)ets_rom_layout_p->data_end_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release rom btdm Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
/* if the addresses of rom interface btdm .data and .bss are consecutive,
they are registered in the system heap as a piece of memory
*/
if(ets_rom_layout_p->data_end_interface_btdm == ets_rom_layout_p->bss_start_interface_btdm) {
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release rom interface btdm [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
mem_end = (intptr_t)ets_rom_layout_p->data_end_interface_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release rom interface btdm Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)ets_rom_layout_p->bss_start_interface_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release rom interface btdm BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
}
return ESP_OK;
}
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(BTDM_LOG_TAG, "%s not implemented, return OK", __func__);
int ret;
intptr_t mem_start, mem_end;
ret = esp_bt_controller_mem_release(mode);
if (ret != ESP_OK) {
return ret;
}
if (mode & ESP_BT_MODE_BLE) {
/* if the addresses of btdm .bss and bt .bss are consecutive,
they are registered in the system heap as a piece of memory
*/
if(_bt_bss_end == _btdm_bss_start) {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_btdm_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_bt_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_btdm_bss_start;
mem_end = (intptr_t)&_btdm_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BTDM BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
/* if the addresses of btdm .data and bt .data are consecutive,
they are registered in the system heap as a piece of memory
*/
if(_bt_data_end == _btdm_data_start) {
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_btdm_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_bt_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_btdm_data_start;
mem_end = (intptr_t)&_btdm_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release BTDM Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
mem_start = (intptr_t)&_nimble_bss_start;
mem_end = (intptr_t)&_nimble_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_data_start;
mem_end = (intptr_t)&_nimble_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BTDM_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
return ESP_OK;
}
@ -964,12 +1093,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// overwrite some parameters
cfg->magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL;
sdk_config_extend_set_pll_track(false);
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_init();
#endif
esp_phy_pd_mem_init();
esp_phy_modem_init();
esp_bt_power_domain_on();
btdm_controller_mem_init();
@ -1003,12 +1130,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 +1179,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 +1232,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 +1242,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;
@ -1134,57 +1274,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
return ESP_OK;
error:
if (s_lp_stat.phy_enabled) {
esp_phy_disable();
s_lp_stat.phy_enabled = 0;
}
do {
// deinit low power control resources
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
s_lp_stat.pm_lock_released = 0;
}
bt_controller_deinit_internal();
#endif
if (s_lp_cntl.wakeup_timer_required && s_btdm_slp_tmr != NULL) {
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
}
#if CONFIG_MAC_BB_PD
if (s_lp_cntl.mac_bb_pd) {
btdm_deep_sleep_mem_deinit();
s_lp_cntl.mac_bb_pd = 0;
}
#endif
if (s_lp_cntl.enable) {
btdm_vnd_offload_task_deregister(BTDM_VND_OL_SIG_WAKEUP_TMR);
if (s_wakeup_req_sem != NULL) {
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
}
} while (0);
#if CONFIG_MAC_BB_PD
esp_unregister_mac_bb_pd_callback(btdm_mac_bb_power_down_cb);
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
if (osi_funcs_p != NULL) {
free(osi_funcs_p);
osi_funcs_p = NULL;
}
return err;
}
@ -1195,31 +1287,47 @@ esp_err_t esp_bt_controller_deinit(void)
}
btdm_controller_deinit();
bt_controller_deinit_internal();
return ESP_OK;
}
static void bt_controller_deinit_internal(void)
{
periph_module_disable(PERIPH_BT_MODULE);
if (s_lp_stat.phy_enabled) {
esp_phy_disable();
s_lp_stat.phy_enabled = 0;
} else {
assert(0);
}
// deinit low power control resources
do {
#if CONFIG_MAC_BB_PD
btdm_deep_sleep_mem_deinit();
if (s_lp_cntl.mac_bb_pd) {
btdm_deep_sleep_mem_deinit();
s_lp_cntl.mac_bb_pd = 0;
}
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
s_lp_stat.pm_lock_released = 0;
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
s_lp_stat.pm_lock_released = 0;
#endif
if (s_lp_cntl.wakeup_timer_required) {
if (s_lp_stat.wakeup_timer_started) {
esp_timer_stop(s_btdm_slp_tmr);
@ -1231,10 +1339,27 @@ esp_err_t esp_bt_controller_deinit(void)
if (s_lp_cntl.enable) {
btdm_vnd_offload_task_deregister(BTDM_VND_OL_SIG_WAKEUP_TMR);
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
if (s_wakeup_req_sem != NULL) {
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
@ -1242,28 +1367,23 @@ esp_err_t esp_bt_controller_deinit(void)
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
/* Fix the issue caused by the power off the bt power domain.
* This issue is only on ESP32C3.
*/
phy_init_flag();
esp_bt_power_domain_off();
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_deinit();
#endif
esp_phy_pd_mem_deinit();
esp_phy_modem_deinit();
free(osi_funcs_p);
osi_funcs_p = NULL;
if (osi_funcs_p != NULL) {
free(osi_funcs_p);
osi_funcs_p = NULL;
}
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
btdm_lpcycle_us = 0;
return ESP_OK;
}
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
{
int ret = ESP_OK;
esp_err_t ret = ESP_OK;
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_INITED) {
return ESP_ERR_INVALID_STATE;
@ -1318,6 +1438,9 @@ error:
#endif
} while (0);
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
return ret;
}

View File

@ -128,6 +128,7 @@ if BT_LE_EXT_ADV
instances. Minimum there is always one instance of
advertising. Enter how many more advertising instances you
want.
Each extended advertising instance will take about 0.5k DRAM.
config BT_LE_EXT_ADV_MAX_SIZE
int "Maximum length of the advertising data."
@ -206,7 +207,7 @@ menu "Memory Settings"
config BT_LE_ACL_BUF_COUNT
int "ACL Buffer count"
default 24
default 10
help
The number of ACL data buffers.
@ -339,7 +340,7 @@ config BT_LE_MAX_CONNECTIONS
is expected to configure BTDM_CTRL_BLE_MAX_CONN from controller menu
along with this option. Similarly for ESP32-C3 or ESP32-S3, user is expected to
configure BT_CTRL_BLE_MAX_ACT from controller menu.
Each connection will take about 1k DRAM.
choice BT_LE_COEX_PHY_CODED_TX_RX_TLIM
prompt "Coexistence: limit on MAX Tx/Rx time for coded-PHY connection"
@ -380,5 +381,11 @@ choice BT_LE_WAKEUP_SOURCE
bool "Use ESP timer to wakeup CPU"
help
Use esp timer to wakeup CPU
endchoice
config BT_LE_USE_ESP_TIMER
bool "Use Esp Timer for callout"
depends on !BT_NIMBLE_ENABLED
default y
help
Set this option to use Esp Timer which has higher priority timer instead of FreeRTOS timer

View File

@ -50,6 +50,9 @@
#include "esp_private/periph_ctrl.h"
#include "esp_sleep.h"
#include "soc/syscon_reg.h"
#include "soc/dport_access.h"
/* Macro definition
************************************************************************
*/
@ -58,9 +61,16 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20220125
#define EXT_FUNC_VERSION 0x20221122
#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
************************************************************************
*/
@ -90,9 +100,9 @@ struct ext_funcs_t {
void (* _task_delete)(void *task_handle);
void (*_osi_assert)(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
uint32_t (* _os_random)(void);
int (* _ecc_gen_key_pair)(uint8_t *pub, uint8_t *priv);
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y, const uint8_t *local_priv_key, uint8_t *dhkey);
int (* _esp_reset_rpa_moudle)(void);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic;
};
@ -114,14 +124,12 @@ extern int esp_ble_ll_set_public_addr(const uint8_t *addr);
extern int esp_register_npl_funcs (struct npl_funcs_t *p_npl_func);
extern void esp_unregister_npl_funcs (void);
extern void npl_freertos_mempool_deinit(void);
/* TX power */
int ble_txpwr_set(int power_type, int power_level);
int ble_txpwr_get(int power_type);
extern void bt_bb_v2_init_cmplx(uint8_t i);
extern int os_msys_buf_alloc(void);
extern uint32_t r_os_cputime_get32(void);
extern uint32_t r_os_cputime_ticks_to_usecs(uint32_t ticks);
extern void r_ble_ll_rfmgmt_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg, void *w_arg, uint32_t us_to_enabled);
extern void r_ble_lll_rfmgmt_set_sleep_cb(void *s_cb, void *w_cb, void *s_arg, void *w_arg, uint32_t us_to_enabled);
extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_buf_free(void);
extern void bt_bb_set_le_tx_on_delay(uint32_t delay_us);
@ -129,6 +137,17 @@ extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
extern int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv);
extern int ble_txpwr_set(esp_ble_enhanced_power_type_t power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(esp_ble_enhanced_power_type_t power_type, uint16_t handle);
extern int ble_get_npl_element_info(esp_bt_controller_config_t *cfg, ble_npl_count_info_t * npl_info);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _nimble_bss_start;
extern uint32_t _nimble_bss_end;
extern uint32_t _nimble_data_start;
extern uint32_t _nimble_data_end;
extern uint32_t _bt_data_start;
extern uint32_t _bt_data_end;
/* Local Function Declaration
*********************************************************************
@ -152,7 +171,7 @@ static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static int esp_reset_rpa_moudle(void);
static void esp_reset_rpa_moudle(void);
/* Local variable definition
@ -162,12 +181,11 @@ static int esp_reset_rpa_moudle(void);
/* Static variable declare */
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
/* This variable tells if BLE is running */
static bool s_ble_active = false;
#ifdef CONFIG_PM_ENABLE
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
static bool s_pm_lock_acquired = true;
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)
#endif /* #ifdef CONFIG_PM_ENABLE */
@ -177,10 +195,11 @@ static DRAM_ATTR esp_pm_lock_handle_t s_light_sleep_pm_lock;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#define BLE_RTC_DELAY_US (0)
static void btdm_slp_tmr_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_btdm_slp_tmr = NULL;
static void ble_sleep_timer_callback(void *arg);
static DRAM_ATTR esp_timer_handle_t s_ble_sleep_timer = NULL;
#endif
static const struct osi_coex_funcs_t s_osi_coex_funcs_ro = {
._magic = OSI_COEX_MAGIC_VALUE,
._version = OSI_COEX_VERSION,
@ -214,15 +233,16 @@ struct ext_funcs_t ext_funcs_ro = {
.magic = EXT_FUNC_MAGIC_VALUE,
};
static int IRAM_ATTR esp_reset_rpa_moudle(void)
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
periph_module_reset(PERIPH_MODEM_RPA_MODULE);
return 0;
DPORT_SET_PERI_REG_MASK(SYSTEM_MODEM_RST_EN_REG, SYSTEM_BLE_SEC_BAH_RST);
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_MODEM_RST_EN_REG, SYSTEM_BLE_SEC_BAH_RST);
}
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);
}
@ -245,6 +265,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) {
@ -302,11 +323,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);
}
@ -385,7 +404,7 @@ static int ble_hci_unregistered_hook(void*, void*)
static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler, void *arg, void **ret_handle_in)
{
int rc = esp_intr_alloc(source, flags, handler, arg, (intr_handle_t *)ret_handle_in);
int rc = esp_intr_alloc(source, flags | ESP_INTR_FLAG_IRAM, handler, arg, (intr_handle_t *)ret_handle_in);
return rc;
}
@ -399,20 +418,28 @@ static int esp_intr_free_wrapper(void **ret_handle)
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
esp_phy_disable();
if (!s_ble_active) {
return;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
uint32_t delta_tick;
uint32_t us_to_sleep;
uint32_t sleep_tick;
uint32_t tick_invalid = *(uint32_t*)(arg);
assert(arg != NULL);
if(!tick_invalid) {
uint32_t sleep_tick = r_os_cputime_get32();
if(enable_tick <= sleep_tick) {
if (!tick_invalid) {
sleep_tick = r_os_cputime_get32();
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
delta_tick = enable_tick - sleep_tick;
if (delta_tick & 0x80000000) {
return;
}
// start a timer to wake up and acquire the pm_lock before modem_sleep awakes
uint32_t us_to_sleep = r_os_cputime_ticks_to_usecs(enable_tick - sleep_tick);
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
esp_err_t err = esp_timer_start_once(s_btdm_slp_tmr, us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
us_to_sleep = r_os_cputime_ticks_to_usecs(delta_tick);
if (us_to_sleep <= BTDM_MIN_TIMER_UNCERTAINTY_US) {
return;
}
esp_err_t err = esp_timer_start_once(s_ble_sleep_timer, us_to_sleep - BTDM_MIN_TIMER_UNCERTAINTY_US);
if (err != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ESP timer start failed\n");
return;
@ -423,56 +450,43 @@ IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
r_ble_rtc_wake_up_state_clr();
#endif
if (s_pm_lock_acquired) {
assert(s_pm_lock != NULL);
esp_pm_lock_release(s_pm_lock);
s_pm_lock_acquired = false;
}
esp_pm_lock_release(s_pm_lock);
#endif // CONFIG_PM_ENABLE
esp_phy_disable();
s_ble_active = false;
}
IRAM_ATTR void controller_wakeup_cb(void *arg)
{
if (s_ble_active) {
return;
}
esp_phy_enable();
// need to check if need to call pm lock here
#ifdef CONFIG_PM_ENABLE
assert(s_pm_lock != NULL);
if (!s_pm_lock_acquired) {
s_pm_lock_acquired = true;
esp_pm_lock_acquire(s_pm_lock);
}
esp_pm_lock_acquire(s_pm_lock);
#endif //CONFIG_PM_ENABLE
s_ble_active = true;
}
#ifdef CONFIG_PM_ENABLE
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
static void btdm_slp_tmr_callback(void * arg)
static void ble_sleep_timer_callback(void * arg)
{
(void)(arg);
if (!s_pm_lock_acquired) {
assert(s_pm_lock != NULL);
s_pm_lock_acquired = true;
esp_pm_lock_acquire(s_pm_lock);
}
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif // CONFIG_PM_ENABLE
void controller_sleep_init(void)
esp_err_t controller_sleep_init(void)
{
#ifdef CONFIG_PM_ENABLE
s_btdm_allow_light_sleep = false;
#endif // CONFIG_PM_ENABLE
esp_err_t rc = 0;
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "BLE modem sleep is enabled\n");
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0, 500 + BLE_RTC_DELAY_US);
#ifdef CONFIG_PM_ENABLE
s_btdm_allow_light_sleep = true;
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
#endif // CONFIG_PM_ENABLE
@ -480,21 +494,19 @@ void controller_sleep_init(void)
// enable light sleep
#ifdef CONFIG_PM_ENABLE
if (!s_btdm_allow_light_sleep) {
if (esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "btnosleep", &s_light_sleep_pm_lock) != ESP_OK) {
goto error;
}
}
if (esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "bt", &s_pm_lock) != ESP_OK) {
rc = esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "bt", &s_pm_lock);
if (rc != ESP_OK) {
goto error;
}
esp_pm_lock_acquire(s_pm_lock);
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
esp_timer_create_args_t create_args = {
.callback = btdm_slp_tmr_callback,
.callback = ble_sleep_timer_callback,
.arg = NULL,
.name = "btSlp"
};
if (esp_timer_create(&create_args, &s_btdm_slp_tmr) != ESP_OK) {
rc = esp_timer_create(&create_args, &s_ble_sleep_timer);
if (rc != ESP_OK) {
goto error;
}
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is ESP timer");
@ -505,32 +517,20 @@ void controller_sleep_init(void)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "Enable light sleep, the wake up source is BLE timer");
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
s_pm_lock_acquired = true;
if (!s_btdm_allow_light_sleep) {
esp_pm_lock_acquire(s_light_sleep_pm_lock);
}
if (s_pm_lock) {
esp_pm_lock_acquire(s_pm_lock);
}
return;
return rc;
error:
if (!s_btdm_allow_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_release(s_pm_lock);
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_btdm_slp_tmr != NULL) {
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
@ -539,36 +539,37 @@ error:
#endif // CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
#endif //CONFIG_PM_ENABLE
return rc;
}
void controller_sleep_deinit(void)
{
#ifdef CONFIG_PM_ENABLE
if (!s_btdm_allow_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
}
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if(s_btdm_slp_tmr != NULL) {
esp_timer_stop(s_btdm_slp_tmr);
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
}
#endif
s_pm_lock_acquired = false;
#endif
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
r_ble_rtc_wake_up_state_clr();
esp_sleep_disable_bt_wakeup();
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_BLE_RTC_TIMER
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
/*lock should release first and then delete*/
if (s_ble_active) {
esp_pm_lock_release(s_pm_lock);
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
#ifdef CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
if (s_ble_sleep_timer != NULL) {
esp_timer_stop(s_ble_sleep_timer);
esp_timer_delete(s_ble_sleep_timer);
s_ble_sleep_timer = NULL;
}
#endif //CONFIG_BT_LE_WAKEUP_SOURCE_CPU_RTC_TIMER
#endif //CONFIG_PM_ENABLE
}
#if CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2
void periph_module_etm_active()
void periph_module_etm_active(void)
{
/*This part for esp32h2 beta2*/
REG_SET_BIT(SYSTEM_MODCLK_CONF_REG, SYSTEM_ETM_CLK_SEL | SYSTEM_ETM_CLK_ACTIVE ); //Active ETM clock
@ -577,44 +578,53 @@ void periph_module_etm_active()
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_FAIL;
return ESP_ERR_INVALID_STATE;
}
if (cfg == NULL) {
if (!cfg) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "cfg is NULL");
return ESP_ERR_INVALID_ARG;
}
if (esp_register_ext_funcs(&ext_funcs_ro) != 0) {
ret = esp_register_ext_funcs(&ext_funcs_ro);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "register extend functions failed");
return ESP_ERR_INVALID_ARG;
return ret;
}
/* Initialize the function pointers for OS porting */
npl_freertos_funcs_init();
struct npl_funcs_t *p_npl_funcs = npl_freertos_funcs_get();
if (!p_npl_funcs) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl functions get failed");
return ESP_ERR_INVALID_ARG;
}
if (esp_register_npl_funcs(p_npl_funcs) != 0) {
ret = esp_register_npl_funcs(p_npl_funcs);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl functions register failed");
return ESP_ERR_INVALID_ARG;
goto free_mem;
}
ble_get_npl_element_info(cfg, &npl_info);
npl_freertos_set_controller_npl_info(&npl_info);
if (npl_freertos_mempool_init() != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "npl mempool init failed");
return ESP_ERR_INVALID_ARG;
ret = ESP_ERR_INVALID_ARG;
goto free_mem;
}
/* Initialize the global memory pool */
if (os_msys_buf_alloc() != 0) {
ret = os_msys_buf_alloc();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "os msys alloc failed");
return ESP_ERR_INVALID_ARG;
goto free_mem;
}
os_msys_init();
@ -632,25 +642,30 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// init phy
esp_phy_enable();
s_ble_active = true;
// set bb delay
bt_bb_set_le_tx_on_delay(50);
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
return ESP_ERR_INVALID_ARG;
ret = ESP_ERR_INVALID_ARG;
goto free_controller;
}
#if CONFIG_SW_COEXIST_ENABLE
coex_init();
#endif
int rc = ble_controller_init(cfg);
if (rc != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", rc);
return ESP_ERR_NO_MEM;
ret = ble_controller_init(cfg);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_init failed %d", ret);
goto free_controller;
}
controller_sleep_init();
ret = controller_sleep_init();
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
goto free_controller;
}
uint8_t mac[6];
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
@ -663,8 +678,21 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ble_hci_trans_cfg_hs((ble_hci_trans_rx_cmd_fn *)ble_hci_unregistered_hook,NULL,
(ble_hci_trans_rx_acl_fn *)ble_hci_unregistered_hook,NULL);
return ESP_OK;
free_controller:
controller_sleep_deinit();
ble_controller_deinit();
esp_phy_disable();
#if CONFIG_BT_NIMBLE_ENABLED
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
#endif // CONFIG_BT_NIMBLE_ENABLED
free_mem:
os_msys_buf_free();
npl_freertos_mempool_deinit();
esp_unregister_npl_funcs();
npl_freertos_funcs_deinit();
esp_unregister_ext_funcs();
return ret;
}
esp_err_t esp_bt_controller_deinit(void)
@ -676,9 +704,13 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
if (ble_controller_deinit() != 0) {
return ESP_FAIL;
if (s_ble_active) {
esp_phy_disable();
s_ble_active = false;
}
ble_controller_deinit();
#if CONFIG_BT_NIMBLE_ENABLED
/* De-initialize default event queue */
ble_npl_eventq_deinit(nimble_port_get_dflt_eventq());
@ -736,13 +768,58 @@ esp_err_t esp_bt_controller_disable(void)
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
return ESP_OK;
}
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end)
{
/* TODO */
int ret = ESP_ERR_INVALID_SIZE;
/* heap_caps_add_region() returns ESP_ERR_INVALID_SIZE if the memory region is
* is too small to fit a heap. This cannot be termed as a fatal error and hence
* we replace it by ESP_OK
*/
if (ret == ESP_ERR_INVALID_SIZE) {
return ESP_OK;
}
return ret;
}
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "%s not implemented, return OK", __func__);
intptr_t mem_start, mem_end;
if (mode == ESP_BT_MODE_BLE) {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_bt_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_bt_data_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_bss_start;
mem_end = (intptr_t)&_nimble_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_data_start;
mem_end = (intptr_t)&_nimble_data_end;
if (mem_start != mem_end) {
ESP_LOGD(NIMBLE_PORT_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x]", mem_start, mem_end);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
return ESP_OK;
}
@ -755,16 +832,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

@ -149,12 +149,10 @@ config BT_CTRL_RX_ANTENNA_INDEX_EFF
choice BT_CTRL_DFT_TX_POWER_LEVEL
prompt "BLE default Tx power level"
default BT_CTRL_DFT_TX_POWER_LEVEL_P3
default BT_CTRL_DFT_TX_POWER_LEVEL_P9
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
@ -297,6 +297,22 @@ config BT_CTRL_SCAN_DUPL_CACHE_SIZE
Maximum number of devices which can be recorded in scan duplicate filter.
When the maximum amount of device in the filter is reached, the cache will be refreshed.
config BT_CTRL_DUPL_SCAN_CACHE_REFRESH_PERIOD
int "Duplicate scan list refresh period (seconds)"
depends on BT_CTRL_BLE_SCAN_DUPL
range 0 1000
default 0
help
If the period value is non-zero, the controller will periodically clear the device information
stored in the scan duuplicate filter. If it is 0, the scan duuplicate filter will not be cleared
until the scanning is disabled. Duplicate advertisements for this period should not be sent to the
Host in advertising report events.
There are two scenarios where the ADV packet will be repeatedly reported:
1. The duplicate scan cache is full, the controller will delete the oldest device information and
add new device information.
2. When the refresh period is up, the controller will clear all device information and start filtering
again.
config BT_CTRL_BLE_MESH_SCAN_DUPL_EN
bool "Special duplicate scan mechanism for BLE Mesh scan"
depends on BT_CTRL_BLE_SCAN_DUPL
@ -368,9 +384,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 +401,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
@ -421,3 +445,11 @@ config BT_CTRL_CODED_AGC_RECORRECT_EN
default n
help
Enable coded phy AGC recorrect
config BT_CTRL_SCAN_BACKOFF_UPPERLIMITMAX
bool "Disable active scan backoff"
default n
help
Disable active scan backoff. The bluetooth spec requires that scanners should run a backoff procedure to
minimize collision of scan request PDUs from nultiple scanners. If scan backoff is disabled, in active
scanning, scan request PDU will be sent every time when HW receives scannable ADV PDU.

View File

@ -39,6 +39,7 @@
#include "esp_timer.h"
#include "esp_sleep.h"
#include "esp_rom_sys.h"
#include "esp32s3/rom/rom_layout.h"
#if CONFIG_BT_ENABLED
@ -72,7 +73,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;
@ -245,7 +247,6 @@ extern bool btdm_deep_sleep_mem_init(void);
extern void btdm_deep_sleep_mem_deinit(void);
extern void btdm_ble_power_down_dma_copy(bool copy);
extern uint8_t btdm_sleep_clock_sync(void);
extern void sdk_config_extend_set_pll_track(bool enable);
#if CONFIG_MAC_BB_PD
extern void esp_mac_bb_power_down(void);
@ -253,24 +254,18 @@ extern void esp_mac_bb_power_up(void);
extern void ets_backup_dma_copy(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
#endif
extern char _bss_start_btdm;
extern char _bss_end_btdm;
extern char _data_start_btdm;
extern char _data_end_btdm;
extern uint32_t _data_start_btdm_rom;
extern uint32_t _data_end_btdm_rom;
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _btdm_bss_start;
extern uint32_t _btdm_bss_end;
extern uint32_t _nimble_bss_start;
extern uint32_t _nimble_bss_end;
extern uint32_t _bt_data_start;
extern uint32_t _bt_data_end;
extern uint32_t _btdm_data_start;
extern uint32_t _btdm_data_end;
extern char _bt_tmp_bss_start;
extern char _bt_tmp_bss_end;
extern uint32_t _nimble_data_start;
extern uint32_t _nimble_data_end;
/* Local Function Declare
*********************************************************************
@ -320,6 +315,11 @@ static void btdm_hw_mac_power_down_wrapper(void);
static void btdm_backup_dma_copy_wrapper(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
static void btdm_slp_tmr_callback(void *arg);
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end);
static void bt_controller_deinit_internal(void);
/* Local variable definition
***************************************************************************
*/
@ -928,16 +928,159 @@ static void btdm_controller_mem_init(void)
esp_err_t esp_bt_controller_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(BT_LOG_TAG, "%s not implemented, return OK", __func__);
intptr_t mem_start=(intptr_t) NULL, mem_end=(intptr_t) NULL;
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
return ESP_ERR_INVALID_STATE;
}
if (mode & ESP_BT_MODE_BLE) {
/* if the addresses of rom btdm .data and .bss are consecutive,
they are registered in the system heap as a piece of memory
*/
if(ets_rom_layout_p->data_end_btdm == ets_rom_layout_p->bss_start_btdm) {
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release rom btdm [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)ets_rom_layout_p->bss_start_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release rom btdm BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)ets_rom_layout_p->data_start_btdm;
mem_end = (intptr_t)ets_rom_layout_p->data_end_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release rom btdm Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
/* if the addresses of rom interface btdm .data and .bss are consecutive,
they are registered in the system heap as a piece of memory
*/
if(ets_rom_layout_p->data_end_interface_btdm == ets_rom_layout_p->bss_start_interface_btdm) {
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release rom interface btdm [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)ets_rom_layout_p->data_start_interface_btdm;
mem_end = (intptr_t)ets_rom_layout_p->data_end_interface_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release rom interface btdm Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)ets_rom_layout_p->bss_start_interface_btdm;
mem_end = (intptr_t)ets_rom_layout_p->bss_end_interface_btdm;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release rom interface btdm BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
}
return ESP_OK;
}
esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
{
ESP_LOGW(BT_LOG_TAG, "%s not implemented, return OK", __func__);
int ret;
intptr_t mem_start, mem_end;
ret = esp_bt_controller_mem_release(mode);
if (ret != ESP_OK) {
return ret;
}
if (mode & ESP_BT_MODE_BLE) {
/* if the addresses of btdm .bss and bt .bss are consecutive,
they are registered in the system heap as a piece of memory
*/
if(_bt_bss_end == _btdm_bss_start) {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_btdm_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)&_bt_bss_start;
mem_end = (intptr_t)&_bt_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release BT BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_btdm_bss_start;
mem_end = (intptr_t)&_btdm_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release BTDM BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
/* if the addresses of btdm .data and bt .data are consecutive,
they are registered in the system heap as a piece of memory
*/
if(_bt_data_end == _btdm_data_start) {
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_btdm_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
} else {
mem_start = (intptr_t)&_bt_data_start;
mem_end = (intptr_t)&_bt_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release BT Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_btdm_data_start;
mem_end = (intptr_t)&_btdm_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release BTDM Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
mem_start = (intptr_t)&_nimble_bss_start;
mem_end = (intptr_t)&_nimble_bss_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release NimBLE BSS [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
mem_start = (intptr_t)&_nimble_data_start;
mem_end = (intptr_t)&_nimble_data_end;
if (mem_start != mem_end) {
ESP_LOGD(BT_LOG_TAG, "Release NimBLE Data [0x%08x] - [0x%08x], len %d", mem_start, mem_end, mem_end - mem_start);
ESP_ERROR_CHECK(try_heap_caps_add_region(mem_start, mem_end));
}
}
return ESP_OK;
}
static esp_err_t try_heap_caps_add_region(intptr_t start, intptr_t end)
{
int ret = heap_caps_add_region(start, end);
/* heap_caps_add_region() returns ESP_ERR_INVALID_SIZE if the memory region is
* is too small to fit a heap. This cannot be termed as a fatal error and hence
* we replace it by ESP_OK
*/
if (ret == ESP_ERR_INVALID_SIZE) {
return ESP_OK;
}
return ret;
}
#if CONFIG_MAC_BB_PD
static void IRAM_ATTR btdm_mac_bb_power_down_cb(void)
{
@ -996,12 +1139,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
// overwrite some parameters
cfg->magic = ESP_BT_CTRL_CONFIG_MAGIC_VAL;
sdk_config_extend_set_pll_track(false);
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_init();
#endif
esp_phy_pd_mem_init();
esp_phy_modem_init();
esp_bt_power_domain_on();
btdm_controller_mem_init();
@ -1035,12 +1176,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 +1225,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 +1278,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 +1288,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;
@ -1166,57 +1320,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
return ESP_OK;
error:
if (s_lp_stat.phy_enabled) {
esp_phy_disable();
s_lp_stat.phy_enabled = 0;
}
do {
// deinit low power control resources
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
s_lp_stat.pm_lock_released = 0;
}
bt_controller_deinit_internal();
#endif
if (s_lp_cntl.wakeup_timer_required && s_btdm_slp_tmr != NULL) {
esp_timer_delete(s_btdm_slp_tmr);
s_btdm_slp_tmr = NULL;
}
#if CONFIG_MAC_BB_PD
if (s_lp_cntl.mac_bb_pd) {
btdm_deep_sleep_mem_deinit();
s_lp_cntl.mac_bb_pd = 0;
}
#endif
if (s_lp_cntl.enable) {
btdm_vnd_offload_task_deregister(BTDM_VND_OL_SIG_WAKEUP_TMR);
if (s_wakeup_req_sem != NULL) {
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
}
}
} while (0);
#if CONFIG_MAC_BB_PD
esp_unregister_mac_bb_pd_callback(btdm_mac_bb_power_down_cb);
esp_unregister_mac_bb_pu_callback(btdm_mac_bb_power_up_cb);
#endif
if (osi_funcs_p != NULL) {
free(osi_funcs_p);
osi_funcs_p = NULL;
}
return err;
}
@ -1227,31 +1333,47 @@ esp_err_t esp_bt_controller_deinit(void)
}
btdm_controller_deinit();
bt_controller_deinit_internal();
return ESP_OK;
}
static void bt_controller_deinit_internal(void)
{
periph_module_disable(PERIPH_BT_MODULE);
if (s_lp_stat.phy_enabled) {
esp_phy_disable();
s_lp_stat.phy_enabled = 0;
} else {
assert(0);
}
// deinit low power control resources
do {
#if CONFIG_MAC_BB_PD
btdm_deep_sleep_mem_deinit();
if (s_lp_cntl.mac_bb_pd) {
btdm_deep_sleep_mem_deinit();
s_lp_cntl.mac_bb_pd = 0;
}
#endif
#ifdef CONFIG_PM_ENABLE
if (s_lp_cntl.no_light_sleep) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
if (s_light_sleep_pm_lock != NULL) {
esp_pm_lock_delete(s_light_sleep_pm_lock);
s_light_sleep_pm_lock = NULL;
}
}
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
s_lp_stat.pm_lock_released = 0;
}
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
s_lp_stat.pm_lock_released = 0;
#endif
if (s_lp_cntl.wakeup_timer_required) {
if (s_lp_stat.wakeup_timer_started) {
esp_timer_stop(s_btdm_slp_tmr);
@ -1263,10 +1385,27 @@ esp_err_t esp_bt_controller_deinit(void)
if (s_lp_cntl.enable) {
btdm_vnd_offload_task_deregister(BTDM_VND_OL_SIG_WAKEUP_TMR);
semphr_delete_wrapper(s_wakeup_req_sem);
s_wakeup_req_sem = NULL;
if (s_wakeup_req_sem != NULL) {
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
@ -1278,19 +1417,19 @@ esp_err_t esp_bt_controller_deinit(void)
#if CONFIG_MAC_BB_PD
esp_mac_bb_pd_mem_deinit();
#endif
esp_phy_pd_mem_deinit();
esp_phy_modem_deinit();
free(osi_funcs_p);
osi_funcs_p = NULL;
if (osi_funcs_p != NULL) {
free(osi_funcs_p);
osi_funcs_p = NULL;
}
btdm_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
btdm_lpcycle_us = 0;
return ESP_OK;
}
esp_err_t esp_bt_controller_enable(esp_bt_mode_t mode)
{
int ret = ESP_OK;
esp_err_t ret = ESP_OK;
if (btdm_controller_status != ESP_BT_CONTROLLER_STATUS_INITED) {
return ESP_ERR_INVALID_STATE;
@ -1345,6 +1484,9 @@ error:
#endif
} while (0);
#if CONFIG_SW_COEXIST_ENABLE
coex_disable();
#endif
return ret;
}

View File

@ -585,6 +585,21 @@ if BLE_MESH
stored to flash. E.g. the default value of 4 means that the
state is saved every 24 hours (96 / 4).
config BLE_MESH_IVU_RECOVERY_IVI
bool "Recovery the IV index when the latest whole IV update procedure is missed"
default n
help
According to Section 3.10.5 of Mesh Specification v1.0.1.
If a node in Normal Operation receives a Secure Network beacon with an IV index
equal to the last known IV index+1 and the IV Update Flag set to 0, the node may
update its IV without going to the IV Update in Progress state, or it may initiate
an IV Index Recovery procedure (Section 3.10.6), or it may ignore the Secure
Network beacon. The node makes the choice depending on the time since last IV
update and the likelihood that the node has missed the Secure Network beacons
with the IV update Flag.
When the above situation is encountered, this option can be used to decide whether
to perform the IV index recovery procedure.
config BLE_MESH_TX_SEG_MSG_COUNT
int "Maximum number of simultaneous outgoing segmented messages"
default 1
@ -803,6 +818,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
@ -1110,6 +1132,19 @@ if BLE_MESH
This option adds extra self-tests which are run every time BLE Mesh
networking is initialized.
config BLE_MESH_BQB_TEST
bool "Enable BLE Mesh specific internal test"
default n
help
This option is used to enable some internal functions for auto-pts test.
config BLE_MESH_BQB_TEST_LOG
bool
depends on BLE_MESH_BQB_TEST
default y
help
This option is used to enable the log of auto-pts test.
if BLE_MESH_SELF_TEST
config BLE_MESH_TEST_AUTO_ENTER_NETWORK

View File

@ -43,7 +43,7 @@ esp_err_t esp_ble_mesh_start_ble_advertising(const esp_ble_mesh_ble_adv_param_t
memcpy(&arg.start_ble_adv.data, data, sizeof(esp_ble_mesh_ble_adv_data_t));
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -64,7 +64,7 @@ esp_err_t esp_ble_mesh_stop_ble_advertising(uint8_t index)
arg.stop_ble_adv.index = index;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_ADV */
@ -81,7 +81,7 @@ esp_err_t esp_ble_mesh_start_ble_scanning(esp_ble_mesh_ble_scan_param_t *param)
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = BTC_BLE_MESH_ACT_START_BLE_SCAN;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -96,7 +96,7 @@ esp_err_t esp_ble_mesh_stop_ble_scanning(void)
msg.pid = BTC_PID_BLE_MESH_BLE_COEX;
msg.act = BTC_BLE_MESH_ACT_STOP_BLE_SCAN;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_ble_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SUPPORT_BLE_SCAN */

View File

@ -47,7 +47,7 @@ esp_err_t esp_ble_mesh_init(esp_ble_mesh_prov_t *prov, esp_ble_mesh_comp_t *comp
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_MESH_INIT;
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL) != BT_STATUS_SUCCESS) {
if (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL) != BT_STATUS_SUCCESS) {
vSemaphoreDelete(semaphore);
BT_ERR("Failed to start mesh init");
return ESP_FAIL;
@ -79,7 +79,7 @@ esp_err_t esp_ble_mesh_deinit(esp_ble_mesh_deinit_param_t *param)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_DEINIT_MESH;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_DEINIT */

View File

@ -92,7 +92,7 @@ esp_err_t esp_ble_mesh_model_subscribe_group_addr(uint16_t element_addr, uint16_
arg.model_sub_group_addr.model_id = model_id;
arg.model_sub_group_addr.group_addr = group_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -118,7 +118,7 @@ esp_err_t esp_ble_mesh_model_unsubscribe_group_addr(uint16_t element_addr, uint1
arg.model_unsub_group_addr.model_id = model_id;
arg.model_unsub_group_addr.group_addr = group_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -152,7 +152,7 @@ esp_err_t esp_ble_mesh_node_add_local_net_key(const uint8_t net_key[16], uint16_
arg.node_add_local_net_key.net_idx = net_idx;
memcpy(arg.node_add_local_net_key.net_key, net_key, 16);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -175,7 +175,7 @@ esp_err_t esp_ble_mesh_node_add_local_app_key(const uint8_t app_key[16], uint16_
arg.node_add_local_app_key.app_idx = app_idx;
memcpy(arg.node_add_local_app_key.app_key, app_key, 16);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -200,7 +200,7 @@ esp_err_t esp_ble_mesh_node_bind_app_key_to_local_model(uint16_t element_addr, u
arg.node_local_mod_app_bind.company_id = company_id;
arg.node_local_mod_app_bind.app_idx = app_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -21,7 +21,7 @@ esp_err_t esp_ble_mesh_lpn_enable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_LPN_ENABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_lpn_disable(bool force)
@ -37,7 +37,7 @@ esp_err_t esp_ble_mesh_lpn_disable(bool force)
arg.lpn_disable.force = force;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -51,5 +51,5 @@ esp_err_t esp_ble_mesh_lpn_poll(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_LPN_POLL;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -101,8 +101,8 @@ static esp_err_t ble_mesh_model_send_msg(esp_ble_mesh_model_t *model,
arg.model_send.msg_timeout = msg_timeout;
}
status = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
status = (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy,
btc_ble_mesh_model_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
bt_mesh_free(msg_data);
@ -236,8 +236,8 @@ esp_err_t esp_ble_mesh_server_model_update_state(esp_ble_mesh_model_t *model,
msg.pid = BTC_PID_MODEL;
msg.act = BTC_BLE_MESH_ACT_SERVER_MODEL_UPDATE_STATE;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_model_args_t), btc_ble_mesh_model_arg_deep_copy,
btc_ble_mesh_model_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SERVER_MODEL */
@ -251,7 +251,7 @@ esp_err_t esp_ble_mesh_node_local_reset(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_NODE_RESET;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#if (CONFIG_BLE_MESH_PROVISIONER)
@ -275,7 +275,7 @@ esp_err_t esp_ble_mesh_provisioner_set_node_name(uint16_t index, const char *nam
memset(arg.set_node_name.name, 0, sizeof(arg.set_node_name.name));
strncpy(arg.set_node_name.name, name, ESP_BLE_MESH_NODE_NAME_MAX_LEN);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -312,8 +312,8 @@ esp_err_t esp_ble_mesh_provisioner_store_node_comp_data(uint16_t unicast_addr,
arg.store_node_comp_data.unicast_addr = unicast_addr;
arg.store_node_comp_data.length = length;
arg.store_node_comp_data.data = data;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_ble_mesh_node_t *esp_ble_mesh_provisioner_get_node_with_uuid(const uint8_t uuid[16])
@ -370,7 +370,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_uuid(const uint8_t uuid[16])
memcpy(arg.delete_node_with_uuid.uuid, uuid, 16);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -391,7 +391,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_node_with_addr(uint16_t unicast_addr)
arg.delete_node_with_addr.unicast_addr = unicast_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -414,7 +414,7 @@ esp_err_t esp_ble_mesh_provisioner_add_local_app_key(const uint8_t app_key[16],
} else {
bzero(arg.add_local_app_key.app_key, 16);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -437,7 +437,7 @@ esp_err_t esp_ble_mesh_provisioner_update_local_app_key(const uint8_t app_key[16
memcpy(arg.update_local_app_key.app_key, app_key, 16);
arg.update_local_app_key.net_idx = net_idx;
arg.update_local_app_key.app_idx = app_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -466,7 +466,7 @@ esp_err_t esp_ble_mesh_provisioner_bind_app_key_to_local_model(uint16_t element_
arg.local_mod_app_bind.app_idx = app_idx;
arg.local_mod_app_bind.model_id = model_id;
arg.local_mod_app_bind.cid = company_id;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -491,7 +491,7 @@ esp_err_t esp_ble_mesh_provisioner_add_local_net_key(const uint8_t net_key[16],
} else {
bzero(arg.add_local_net_key.net_key, 16);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -512,7 +512,7 @@ esp_err_t esp_ble_mesh_provisioner_update_local_net_key(const uint8_t net_key[16
memcpy(arg.update_local_net_key.net_key, net_key, 16);
arg.update_local_net_key.net_idx = net_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -535,7 +535,7 @@ esp_err_t esp_ble_mesh_provisioner_recv_heartbeat(bool enable)
arg.enable_heartbeat_recv.enable = enable;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -556,7 +556,7 @@ esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_type(uint8_t type)
arg.set_heartbeat_filter_type.type = type;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -585,7 +585,7 @@ esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_info(uint8_t op, esp_ble
arg.set_heartbeat_filter_info.hb_src = info->hb_src;
arg.set_heartbeat_filter_info.hb_dst = info->hb_dst;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_PROVISIONER_RECV_HB */
@ -602,7 +602,7 @@ esp_err_t esp_ble_mesh_provisioner_direct_erase_settings(void)
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_DIRECT_ERASE_SETTINGS;
return (btc_transfer_context(&msg, NULL, 0, NULL)
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_SETTINGS */
@ -625,7 +625,7 @@ esp_err_t esp_ble_mesh_provisioner_open_settings_with_index(uint8_t index)
arg.open_settings_with_index.index = index;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -646,7 +646,7 @@ esp_err_t esp_ble_mesh_provisioner_open_settings_with_uid(const char *uid)
strncpy(arg.open_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -668,7 +668,7 @@ esp_err_t esp_ble_mesh_provisioner_close_settings_with_index(uint8_t index, bool
arg.close_settings_with_index.index = index;
arg.close_settings_with_index.erase = erase;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -690,7 +690,7 @@ esp_err_t esp_ble_mesh_provisioner_close_settings_with_uid(const char *uid, bool
strncpy(arg.close_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
arg.close_settings_with_uid.erase = erase;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -711,7 +711,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_settings_with_index(uint8_t index)
arg.delete_settings_with_index.index = index;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -732,7 +732,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_settings_with_uid(const char *uid)
strncpy(arg.delete_settings_with_uid.uid, uid, ESP_BLE_MESH_SETTINGS_UID_SIZE);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -57,7 +57,7 @@ esp_err_t esp_ble_mesh_node_prov_enable(esp_ble_mesh_prov_bearer_t bearers)
msg.act = BTC_BLE_MESH_ACT_PROV_ENABLE;
arg.node_prov_enable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -77,7 +77,7 @@ esp_err_t esp_ble_mesh_node_prov_disable(esp_ble_mesh_prov_bearer_t bearers)
msg.act = BTC_BLE_MESH_ACT_PROV_DISABLE;
arg.node_prov_disable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -101,7 +101,7 @@ esp_err_t esp_ble_mesh_node_set_oob_pub_key(uint8_t pub_key_x[32], uint8_t pub_k
memcpy(arg.set_oob_pub_key.pub_key_y, pub_key_y, 32);
memcpy(arg.set_oob_pub_key.private_key, private_key, 32);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -121,7 +121,7 @@ esp_err_t esp_ble_mesh_node_input_number(uint32_t number)
msg.act = BTC_BLE_MESH_ACT_INPUT_NUMBER;
arg.input_number.number = number;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -143,7 +143,7 @@ esp_err_t esp_ble_mesh_node_input_string(const char *string)
strncpy(arg.input_string.string, string,
MIN(strlen(string), sizeof(arg.input_string.string)));
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -165,7 +165,7 @@ esp_err_t esp_ble_mesh_set_unprovisioned_device_name(const char *name)
memset(arg.set_device_name.name, 0, sizeof(arg.set_device_name.name));
strncpy(arg.set_device_name.name, name, ESP_BLE_MESH_DEVICE_NAME_MAX_LEN);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -190,7 +190,7 @@ esp_err_t esp_ble_mesh_provisioner_read_oob_pub_key(uint8_t link_idx, uint8_t pu
memcpy(arg.provisioner_read_oob_pub_key.pub_key_x, pub_key_x, 32);
memcpy(arg.provisioner_read_oob_pub_key.pub_key_y, pub_key_y, 32);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -215,7 +215,7 @@ esp_err_t esp_ble_mesh_provisioner_input_string(const char *string, uint8_t link
MIN(strlen(string), sizeof(arg.provisioner_input_str.string)));
arg.provisioner_input_str.link_idx = link_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -237,7 +237,7 @@ esp_err_t esp_ble_mesh_provisioner_input_number(uint32_t number, uint8_t link_id
arg.provisioner_input_num.number = number;
arg.provisioner_input_num.link_idx = link_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -258,7 +258,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_enable(esp_ble_mesh_prov_bearer_t bearer
arg.provisioner_enable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -279,7 +279,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_disable(esp_ble_mesh_prov_bearer_t beare
arg.provisioner_disable.bearers = bearers;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -305,7 +305,7 @@ esp_err_t esp_ble_mesh_provisioner_add_unprov_dev(esp_ble_mesh_unprov_dev_add_t
memcpy(arg.provisioner_dev_add.add_dev.addr, add_dev->addr, sizeof(esp_ble_mesh_bd_addr_t));
memcpy(arg.provisioner_dev_add.add_dev.uuid, add_dev->uuid, 16);
arg.provisioner_dev_add.flags = flags;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -339,7 +339,7 @@ esp_err_t esp_ble_mesh_provisioner_prov_device_with_addr(const uint8_t uuid[16],
arg.provisioner_prov_dev_with_addr.bearer = bearer;
arg.provisioner_prov_dev_with_addr.oob_info = oob_info;
arg.provisioner_prov_dev_with_addr.unicast_addr = unicast_addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -366,7 +366,7 @@ esp_err_t esp_ble_mesh_provisioner_delete_dev(esp_ble_mesh_device_delete_t *del_
} else if (del_dev->flag & DEL_DEV_UUID_FLAG) {
memcpy(arg.provisioner_dev_del.del_dev.uuid, del_dev->uuid, 16);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -392,7 +392,7 @@ esp_err_t esp_ble_mesh_provisioner_set_dev_uuid_match(const uint8_t *match_val,
arg.set_dev_uuid_match.match_len = match_len;
arg.set_dev_uuid_match.offset = offset;
arg.set_dev_uuid_match.prov_after_match = prov_after_match;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -420,7 +420,7 @@ esp_err_t esp_ble_mesh_provisioner_set_prov_data_info(esp_ble_mesh_prov_data_inf
} else if (prov_data_info->flag & PROV_DATA_IV_INDEX_FLAG) {
arg.set_prov_data_info.prov_data.iv_index = prov_data_info->iv_index;
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -441,7 +441,7 @@ esp_err_t esp_ble_mesh_provisioner_set_static_oob_value(const uint8_t *value, ui
arg.set_static_oob_val.length = length;
memcpy(arg.set_static_oob_val.value, value, length);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -461,7 +461,7 @@ esp_err_t esp_ble_mesh_provisioner_set_primary_elem_addr(uint16_t addr)
msg.act = BTC_BLE_MESH_ACT_PROVISIONER_SET_PRIMARY_ELEM_ADDR;
arg.set_primary_elem_addr.addr = addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -497,7 +497,7 @@ esp_err_t esp_ble_mesh_set_fast_prov_info(esp_ble_mesh_fast_prov_info_t *fast_pr
if (fast_prov_info->match_len && fast_prov_info->match_val) {
memcpy(arg.set_fast_prov_info.match_val, fast_prov_info->match_val, fast_prov_info->match_len);
}
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -517,7 +517,7 @@ esp_err_t esp_ble_mesh_set_fast_prov_action(esp_ble_mesh_fast_prov_action_t acti
msg.act = BTC_BLE_MESH_ACT_SET_FAST_PROV_ACTION;
arg.set_fast_prov_action.action = action;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -22,7 +22,7 @@ esp_err_t esp_ble_mesh_proxy_identity_enable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROXY_IDENTITY_ENABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_gatt_enable(void)
@ -35,7 +35,7 @@ esp_err_t esp_ble_mesh_proxy_gatt_enable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROXY_GATT_ENABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
@ -48,7 +48,7 @@ esp_err_t esp_ble_mesh_proxy_gatt_disable(void)
msg.pid = BTC_PID_PROV;
msg.act = BTC_BLE_MESH_ACT_PROXY_GATT_DISABLE;
return (btc_transfer_context(&msg, NULL, 0, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, NULL, 0, NULL, NULL) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
@ -72,7 +72,7 @@ esp_err_t esp_ble_mesh_proxy_client_connect(esp_ble_mesh_bd_addr_t addr,
arg.proxy_client_connect.addr_type = addr_type;
arg.proxy_client_connect.net_idx = net_idx;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -89,7 +89,7 @@ esp_err_t esp_ble_mesh_proxy_client_disconnect(uint8_t conn_handle)
arg.proxy_client_disconnect.conn_handle = conn_handle;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -113,7 +113,7 @@ esp_err_t esp_ble_mesh_proxy_client_set_filter_type(uint8_t conn_handle, uint16_
arg.proxy_client_set_filter_type.net_idx = net_idx;
arg.proxy_client_set_filter_type.filter_type = filter_type;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
@ -138,8 +138,8 @@ esp_err_t esp_ble_mesh_proxy_client_add_filter_addr(uint8_t conn_handle, uint16_
arg.proxy_client_add_filter_addr.addr_num = addr_num;
arg.proxy_client_add_filter_addr.addr = addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint16_t net_idx,
@ -163,6 +163,6 @@ esp_err_t esp_ble_mesh_proxy_client_remove_filter_addr(uint8_t conn_handle, uint
arg.proxy_client_remove_filter_addr.addr_num = addr_num;
arg.proxy_client_remove_filter_addr.addr = addr;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_prov_args_t), btc_ble_mesh_prov_arg_deep_copy,
btc_ble_mesh_prov_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}

View File

@ -851,7 +851,7 @@ typedef enum {
ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_TYPE_COMP_EVT, /*!< Provisioner set the heartbeat filter type completion event */
ESP_BLE_MESH_PROVISIONER_SET_HEARTBEAT_FILTER_INFO_COMP_EVT, /*!< Provisioner set the heartbeat filter information completion event */
ESP_BLE_MESH_PROVISIONER_RECV_HEARTBEAT_MESSAGE_EVT, /*!< Provisioner receive heartbeat message event */
ESP_BLE_MESH_PROVISIONER_DRIECT_ERASE_SETTINGS_COMP_EVT, /*!< Provisioner directly erase settings completion event */
ESP_BLE_MESH_PROVISIONER_DIRECT_ERASE_SETTINGS_COMP_EVT, /*!< Provisioner directly erase settings completion event */
ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_INDEX_COMP_EVT, /*!< Provisioner open settings with index completion event */
ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_UID_COMP_EVT, /*!< Provisioner open settings with user id completion event */
ESP_BLE_MESH_PROVISIONER_CLOSE_SETTINGS_WITH_INDEX_COMP_EVT, /*!< Provisioner close settings with index completion event */
@ -1261,11 +1261,11 @@ typedef union {
int8_t rssi; /*!< RSSI of the heartbeat message */
} provisioner_recv_heartbeat; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_RECV_HEARTBEAT_MESSAGE_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_DRIECT_ERASE_SETTINGS_COMP_EVT
* @brief ESP_BLE_MESH_PROVISIONER_DIRECT_ERASE_SETTINGS_COMP_EVT
*/
struct {
int err_code; /*!< Indicate the result of directly erasing settings by the Provisioner */
} provisioner_direct_erase_settings_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_DRIECT_ERASE_SETTINGS_COMP_EVT */
} provisioner_direct_erase_settings_comp; /*!< Event parameters of ESP_BLE_MESH_PROVISIONER_DIRECT_ERASE_SETTINGS_COMP_EVT */
/**
* @brief ESP_BLE_MESH_PROVISIONER_OPEN_SETTINGS_WITH_INDEX_COMP_EVT
*/

View File

@ -59,8 +59,8 @@ esp_err_t esp_ble_mesh_config_client_get_state(esp_ble_mesh_client_common_param_
arg.cfg_client_get_state.params = params;
arg.cfg_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy,
btc_ble_mesh_config_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_t *params,
@ -84,8 +84,8 @@ esp_err_t esp_ble_mesh_config_client_set_state(esp_ble_mesh_client_common_param_
arg.cfg_client_set_state.params = params;
arg.cfg_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_config_client_args_t), btc_ble_mesh_config_client_arg_deep_copy,
btc_ble_mesh_config_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_CFG_CLI */

View File

@ -54,8 +54,8 @@ esp_err_t esp_ble_mesh_generic_client_get_state(esp_ble_mesh_client_common_param
arg.generic_client_get_state.params = params;
arg.generic_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy,
btc_ble_mesh_generic_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param_t *params,
@ -79,8 +79,8 @@ esp_err_t esp_ble_mesh_generic_client_set_state(esp_ble_mesh_client_common_param
arg.generic_client_set_state.params = params;
arg.generic_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_generic_client_args_t), btc_ble_mesh_generic_client_arg_deep_copy,
btc_ble_mesh_generic_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_GENERIC_CLIENT */

View File

@ -41,8 +41,8 @@ esp_err_t esp_ble_mesh_health_client_get_state(esp_ble_mesh_client_common_param_
arg.health_client_get_state.params = params;
arg.health_client_get_state.get_state = get_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy,
btc_ble_mesh_health_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_t *params,
@ -66,8 +66,8 @@ esp_err_t esp_ble_mesh_health_client_set_state(esp_ble_mesh_client_common_param_
arg.health_client_set_state.params = params;
arg.health_client_set_state.set_state = set_state;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_client_args_t), btc_ble_mesh_health_client_arg_deep_copy,
btc_ble_mesh_health_client_arg_deep_free) == BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_HEALTH_CLI */
@ -95,7 +95,7 @@ esp_err_t esp_ble_mesh_health_server_fault_update(esp_ble_mesh_elem_t *element)
msg.act = BTC_BLE_MESH_ACT_HEALTH_SERVER_FAULT_UPDATE;
arg.health_fault_update.element = element;
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_server_args_t), NULL)
return (btc_transfer_context(&msg, &arg, sizeof(btc_ble_mesh_health_server_args_t), NULL, NULL)
== BT_STATUS_SUCCESS ? ESP_OK : ESP_FAIL);
}
#endif /* CONFIG_BLE_MESH_HEALTH_SRV */

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