Compare commits

...

786 Commits

Author SHA1 Message Date
6feb17bf08 add function to start spi transaction from isr 2025-06-24 13:36:31 +02:00
d819686a16 set_server_config() set ssl authmode to OPTIONAL 2025-06-24 13:36:31 +02:00
f875183201 Show websocket network errors 2025-06-24 13:36:31 +02:00
49b985f74b bootloader_support: burn security efuses if flash encryption is enabled
Previously security eFuses were only burnt if the flash was not encrypted
yet.
To enhance robustness of the security eFuse settings their correct setup
should be verified on each bootup. Else it would be possible for an
already encrypted ESP to be reflashed with firmware containing updated,
more restrictive eFuse settings without them ever being applied.
Additionally this change enables easy, secure use of ESPs with host sidee
flash preencryption. Flash preencryption by the host computer performing
the programming procedure can speed up the programming process by a great
deal since the flash no longer needs to be read, erased and written again
by the bootloader self-encryption routines. Additionally it avoids
bricking of ESPs through interruption of the self-ecnryption procedure.
Without this change the host would have to set up all fuses in the ESP
correctly by itself, duplicating the fuse configuration code already
present in the bootloader and creating additional maintenance burden for
the host software if anything about the fuse setup logic changes.
This commit changes the security eFuse configuration logic to always burn
any configured security eFuses on bootup, regardless of current flash
encryption status.
2025-06-24 13:36:31 +02:00
2ccd654be1 Show remote ip address when somebody requests and invalid path to ease debugging 2025-06-24 13:36:31 +02:00
ef78e303ab Return ESP_ERR_HTTP_EAGAIN in http client perform 2025-06-24 13:36:31 +02:00
2c2e841f82 Less tcp packet fragmentation 2025-06-24 13:36:30 +02:00
b41913dcf7 Add missing header include to netif ppp 2025-06-24 13:36:30 +02:00
ee7b605084 Return EAGAIN in http client perform 2025-06-24 13:36:30 +02:00
9eb9f5aa34 Add support for X-WWW-Authenticate header 2025-06-24 13:36:30 +02:00
6aa70c0ea3 Fix compilation under C++ again 2025-06-24 13:36:30 +02:00
15c005ea72 Fixed compilation errors with sntp 2025-06-24 13:36:30 +02:00
68b583f30c Merge branch 'docs/update_http_server_uri_fun_doc_regarding_thread_safe' into 'master'
Updated the http_server doc regarding thread safety

Closes IDFGH-15207

See merge request espressif/esp-idf!39587
2025-06-20 13:57:41 +05:30
7023f5bf3c Merge branch 'contrib/github_pr_16040' into 'master'
refactor(xtensa): Rename specreg.h register macros (GitHub PR)

Closes IDFGH-11606 and IDFGH-15386

See merge request espressif/esp-idf!39649
2025-06-20 08:51:33 +02:00
0afcc02c47 Merge branch 'fix/cmake_uninitialized_vars' into 'master'
fix(build): do not rely on uninitialized  variables and variables set in parent scope

See merge request espressif/esp-idf!39615
2025-06-20 08:30:30 +02:00
c4bfb8adba Merge branch 'bugfix/auth_collision' into 'master'
fix(bt/controller): Fixed bugs on LMP legacy and secure authentication collision

See merge request espressif/esp-idf!39990
2025-06-20 14:25:17 +08:00
7ee9e7e785 Merge branch 'docs/idf_size_flash_total_size' into 'master'
fix(docs/idf-size): add explicit note about total flash size

Closes IDF-13066

See merge request espressif/esp-idf!38891
2025-06-20 08:15:43 +02:00
4e8ad76602 Merge branch 'bugfix/fix_bt_avrcp_build_issue' into 'master'
fix(bt/bluedroid): Fix AVRCP build issue when disable Cover Art

Closes IDFGH-15516

See merge request espressif/esp-idf!39982
2025-06-20 14:02:10 +08:00
c5a17106b6 Merge branch 'doc/fix_ext1_wakeup_cause' into 'master'
docs(sleep_mode): updated ext1 wakeup status

Closes IDF-9459 and IDF-9454

See merge request espressif/esp-idf!39968
2025-06-20 11:00:14 +08:00
8f570513ea Merge branch 'fix/idf_tools_install_tool_version' into 'master'
fix(tools): fixed command `idf_tools.py install tool@version`

Closes IDF-12845

See merge request espressif/esp-idf!39588
2025-06-19 15:46:16 +02:00
f638d5e075 Merge branch 'contrib/github_pr_16130' into 'master'
esp_adc: Release the peripheral after calibration (GitHub PR)

Closes IDFGH-15489

See merge request espressif/esp-idf!39895
2025-06-19 20:49:22 +08:00
b5d1c978b3 fix(bt/controller): Fixed bugs on LMP legacy and secure authentication collision 2025-06-19 20:30:35 +08:00
d6a4c374c1 Merge branch 'test/add_parlio_bs_different_input_output_sizes_test' into 'master'
test(parlio_tx): add parlio_tx_bs different input output sizes test

Closes IDFGH-15481

See merge request espressif/esp-idf!39923
2025-06-19 20:27:40 +08:00
4116e4f697 ci(bt/bluedroid): Add CI build test for A2DP Sink example with Caver Art disabled 2025-06-19 19:44:51 +08:00
9b14f91478 change: remove the updated doc's list for c5 2025-06-19 16:57:43 +08:00
1571758b3d Merge branch 'feat/support_fallback_to_default_pattern_when_psram_id_not_match' into 'master'
psram: support fallback to use default driver pattern when id isn't match

Closes IDF-13387

See merge request espressif/esp-idf!39859
2025-06-19 08:32:43 +00:00
fd9b2fab3a Merge branch 'fix/tcm-mem-not-considered-in-esp_ptr_eexecutable' into 'master'
fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible

Closes IDFGH-15339 and IDFGH-15337

See merge request espressif/esp-idf!39388
2025-06-19 10:09:40 +02:00
2aeec90f6c Merge branch 'feat/bump_littlefs_to_1.20.0' into 'master'
feat(storage): Bump LittleFS to 1.20.0 and fix storage readmes mentioning esptool

Closes IDF-13395

See merge request espressif/esp-idf!39905
2025-06-19 15:25:08 +08:00
79a0958671 docs(sleep_mode): updated ext1 wakeup status 2025-06-19 15:00:55 +08:00
ffaf0819d5 fix(bt/bluedroid): Fix AVRCP build issue when disable Cover Art
Closes https://github.com/espressif/esp-idf/issues/16155
2025-06-19 14:48:12 +08:00
afadb17ed8 fix(adc): fix P4 ADC2 oneshot error and refactor apb claim macor 2025-06-19 14:20:20 +08:00
8026e7acc7 docs(http_server): Updated the http_server doc regarding thread safety
Updated the http_server documentation mentioning that, APIs used in
http_server aren't thread safe

Closes https://github.com/espressif/esp-idf/issues/15877
2025-06-19 11:49:18 +05:30
d93967009e test(parlio_tx): add parlio_tx_bs different input output sizes test
Closes https://github.com/espressif/esp-idf/issues/16122
2025-06-19 14:07:37 +08:00
62723f532f Merge branch 'bugfix/fix_ds_rsa_sign_null_pointer_handling' into 'master'
fix(mbedtls): Handle NULL ctx in ds rsa sign

See merge request espressif/esp-idf!39954
2025-06-19 08:32:42 +05:30
807cbbf24b Merge branch 'refactor/remove_legacy_adc_driver' into 'master'
adc: removed the legacy adc driver and legacy adc calibration driver since v6.0

Closes IDF-13177

See merge request espressif/esp-idf!39478
2025-06-19 02:48:05 +00:00
35f2cca5f2 Merge branch 'refactor/update_locks' into 'master'
refactor(hw_support): Use esp_os_enter_critical instead of portENTER_CRITICAL_SAFE

Closes IDF-13397

See merge request espressif/esp-idf!39922
2025-06-19 10:45:51 +08:00
954e88c92d feat(psram): support fallback to use default driver pattern when id isn't match 2025-06-19 09:31:48 +08:00
dcd29e50c4 Merge branch 'ci/add-kconfig-pre-commit' into 'master'
docs:fix spelling/"casing" of the word "Kconfig"

Closes IDF-11284

See merge request espressif/esp-idf!39470
2025-06-18 19:20:50 +02:00
cca744cd70 Merge branch 'bugfix/ag_data_callback_cleared_after_deinit' into 'master'
fix(bt): Fixed HFP AG data callback cleared after profile is re-initialized

Closes COEXQABR25-79

See merge request espressif/esp-idf!39786
2025-06-19 01:20:20 +08:00
5106b95910 fix(storage): Fix storage examples readmes mentioning espotool 2025-06-18 15:58:07 +02:00
e326d533de feat(storage): Bump LittleFS to 1.20.0 2025-06-18 15:56:47 +02:00
9ddef27ed4 Merge branch 'test/bugfix/offchan_action_tx_failure_scan_rebase_master' into 'master'
feat(coex): support backgorund scan for coex, fix some issues of scan when connected

Closes WIFI-6729, WIFI-6730, WIFIBUG-740, and WIFIBUG-387

See merge request espressif/esp-idf!38413
2025-06-18 19:35:43 +08:00
bd0873f9ec fix(tools): idf_tools.py uninstall decide based on preferred tool version
idf_tools.py uninstall now doesn't take only recommended version, but
makes the decision based on preferred installed versions.
2025-06-18 19:33:54 +08:00
335ba6b3c2 test(tools): Added test for installing supported tool version
Added test_export_supported_version_cmake in `test_idf_tools.py`,
that installs and exports supported version of tool - cmake.
2025-06-18 19:33:54 +08:00
79ebe0b306 fix(tools): idf_tools.py install tool@version 2025-06-18 19:33:54 +08:00
304b561f8a Merge branch 'fix/gatt_cache_peer_init_incl_svc' into 'master'
fix(nimble): Added parameter in peer_init for included service allocation

See merge request espressif/esp-idf!39822
2025-06-18 16:24:49 +05:30
8b2a1b4e37 Merge branch 'feat/ot_sleep_lock_type' into 'master'
feat(openthread): use apb_freq_max mode for esp_openthread_sleep pm lock

See merge request espressif/esp-idf!39800
2025-06-18 18:42:14 +08:00
78af627857 fix(mbedtls): handle NULL ctx in ds rsa sign 2025-06-18 17:03:37 +08:00
570f9d3c82 Merge branch 'bugfix/cpu_clock_switch_after_sleep_c5' into 'master'
fix(sleep): Fix CPU clk src when restoring CPU frequency after wakeup for c5

See merge request espressif/esp-idf!39937
2025-06-18 16:27:44 +08:00
d8c054c8c1 fix(memory-utils): Use esp_ptr_in_tcm to check TCM range 2025-06-18 10:09:40 +02:00
b9f42e7bae fix(memory-utils): Check TCM in esp_ptr_internal and esp_ptr_byte_accessible
Modifies `esp_ptr_internal` and `esp_ptr_byte_accessible` to also check TCM
when `SOC_MEM_TCM_SUPPORTED`.
2025-06-18 10:09:40 +02:00
4a189516c7 Merge branch 'feat/chip_esp32c5_eco2_update_libphy' into 'master'
feat(phy): update phylib for esp32c5

See merge request espressif/esp-idf!39830
2025-06-18 14:56:22 +08:00
55f48c9c14 feat(openthread): use apb_freq_max mode for esp_openthread_sleep pm lock 2025-06-18 14:49:07 +08:00
6abac38b9c refactor(adc): removed the legacy adc driver and legacy adc calibration calibration driver 2025-06-18 14:35:41 +08:00
3041f332c2 feat(ci): ast-grep rules to forbid use freertos specific critical section APIs 2025-06-18 11:58:04 +08:00
f76d50c279 refactor(system): Make it usable in tee build 2025-06-18 11:56:08 +08:00
4860379677 refactor(hw_support): Use esp_os_enter_critical instead of portENTER_CRITICAL_SAFE in esp_hw_support 2025-06-18 11:23:34 +08:00
d0d3c1f84a feat(phy): update phylib for esp32c5 2025-06-18 11:18:58 +08:00
7191595d2a feat(coex): support backgorund scan for coex, fix some issues of scan when connected 2025-06-18 10:58:12 +08:00
22ae972229 Merge branch 'feat/resupport_esp32c61eco3_ble' into 'master'
change(ble): resupport ble for ESP32C61ECO3

Closes BLERP-1948, IDF-10360, IDF-10361, IDF-10363, IDF-10365, and IDF-10362

See merge request espressif/esp-idf!39601
2025-06-18 10:26:07 +08:00
ede834d775 Merge branch 'feat/ci-protected-environment' into 'master'
ci: Production as protected environment

Closes IDFCI-2939

See merge request espressif/esp-idf!39427
2025-06-17 13:53:35 -03:00
8ab969db1c Merge branch 'bugfix/esp32c6_src_clk_label' into 'master'
clk: esp32c6: rename modem clock source selection

See merge request espressif/esp-idf!39756
2025-06-17 22:01:33 +08:00
5f1ad2c18d Merge branch 'bugfix/onewire_internal_pullup' into 'master'
fix(rmt): enable internal pull-up resistor for onewire bus

See merge request espressif/esp-idf!39928
2025-06-17 21:50:39 +08:00
d0ceef20f4 refactor(xtensa): Rename specreg.h register macros
This commit renames all registers in xtensa/specreg.h to by adding the
prefix XT_REG_. This is done to avoid naming collisions with similar
variable names. A new register file, viz., xt_specreg.h is created. The
previous names are still available to use but have been deprecated.

Closes https://github.com/espressif/esp-idf/issues/12723
Merges https://github.com/espressif/esp-idf/pull/16040
2025-06-17 15:37:33 +02:00
23f49324b2 fix(pm): reserve txqblocks when mac init at offchannels 2025-06-17 21:10:03 +08:00
7ab87012db fix(pm): fix ps none status check 2025-06-17 21:09:51 +08:00
2f4c5d278e Merge branch 'feat/remove-unecessray-condition-in-usj-read' into 'master'
fix(driver): remove unecessary if conditions in the read function

Closes IDF-13166

See merge request espressif/esp-idf!39523
2025-06-17 14:19:38 +02:00
15d998cf3b ci: Production as protected environment 2025-06-17 11:24:47 +02:00
d6c483a073 fix(sleep): Fix CPU clk src when restoring CPU frequency after wakeup for c5 2025-06-17 16:56:03 +08:00
bc34abb201 Merge branch 'fix/esp_netif_reassign_static_ip' into 'master'
fix(esp_netif): Fix reasigning static IP after netif down -> up

Closes IDF-13024 and WIFIBUG-1228

See merge request espressif/esp-idf!39725
2025-06-17 16:45:08 +08:00
ce6e136e70 Merge branch 'fix/esp_netif_ip_events' into 'master'
fix(esp_netif): Rename IP_EVENT_AP_STAIPASSIGNED to generic name

Closes IDFGH-14957

See merge request espressif/esp-idf!39425
2025-06-17 16:28:45 +08:00
b6ea70c57b Merge branch 'feat/lwip_no_iram_config' into 'master'
feat(iperf): Add minimum IRAM test config

See merge request espressif/esp-idf!37704
2025-06-17 16:26:51 +08:00
ceb7f1d827 fix(rmt): enable internal pull-up resistor for onewire bus 2025-06-17 15:15:05 +08:00
957a232259 Merge branch 'feat/call_start_in_flash' into 'master'
esp_system: move call_start_cpu* into flash to save IRAM

See merge request espressif/esp-idf!39094
2025-06-17 14:57:27 +08:00
40314930a6 docs: Fix spelling of the word "Kconfig" 2025-06-17 08:52:37 +02:00
a82bdb87d3 fix(nimble): Added parameter in peer_init for included service allocation 2025-06-17 11:56:20 +05:30
069950761c Merge branch 'feat/auto_security_initiate' into 'master'
feat(nimble): Automatically initiate security if a GATT service request fails

See merge request espressif/esp-idf!39724
2025-06-17 11:38:54 +05:30
02be119399 Merge branch 'fix/fix_c3_c2_cache_freeze_soc_caps_issue' into 'master'
cache: fixed SOC_CACHE_FREEZE_SUPPORTED not defined on C3 / C2 issue

See merge request espressif/esp-idf!39881
2025-06-17 03:15:07 +00:00
7f0d091f6e Merge branch 'feat/smaller_release_size' into 'master'
ci: Use new release-zips-action with shallow history

Closes IDFCI-2827

See merge request espressif/esp-idf!39877
2025-06-16 16:30:08 -03:00
32bee685d6 Merge branch 'docs/p4_eco1_usb_pins' into 'master'
docs(usb): Update ESP32-P4 USB pins to MP version

Closes IDFGH-15495

See merge request espressif/esp-idf!39901
2025-06-16 16:27:03 +02:00
e6e629e475 Merge branch 'feature/esp32h21_clock_support' into 'master'
feat(clk): Add basic clock support for esp32h21

Closes IDF-11521, IDF-11906, and IDF-12114

See merge request espressif/esp-idf!39066
2025-06-16 21:48:36 +08:00
d4f3bceb69 Merge branch 'fix/update_dfs_compensate_table' into 'master'
fix(esp_hw_support): update esp32 dfs table to make the timing drift always negative

Closes PM-437, WIFIBUG-1248, and PM-405

See merge request espressif/esp-idf!39838
2025-06-16 19:55:14 +08:00
72cc5dee10 Merge branch 'bugfix/http_client_test_failure' into 'master'
fix: update root certificate for postman-echo endpoint

Closes IDFCI-2968 and IDFGH-15491

See merge request espressif/esp-idf!39828
2025-06-16 17:16:53 +05:30
025aec91c5 docs(usb): Update ESP32-P4 USB pins to MP version
Closes https://github.com/espressif/esp-idf/issues/16136
2025-06-16 13:32:51 +02:00
e928897801 feat(nimble): Added two GATT features:
1. Automatically initiate security if a GATT service request fails
2. Encryption, Authentication, and Authorization requirement on CCCD
2025-06-16 16:58:57 +05:30
6fe38c7efd fix(mbedtls): re-include Comodo AAA Services root 2025-06-16 15:55:39 +05:30
03433aad49 fix(mbedtls): re-include Starfield Class 2 CA
Some of the endpoints (e.g., httpbin.org) is still relying on the
Starfield Class 2 CA in the chain. Added this root certificate as
a temporary exception and shall be removed in future.
2025-06-16 15:55:36 +05:30
068847e2af fix: update root certificate for postman-echo endpoint
The certificate chain for postman-echo endpoint has switched to
Let's Encrypt root CA

Closes https://github.com/espressif/esp-idf/issues/16132
2025-06-16 15:55:13 +05:30
5beacd1ad2 Merge branch 'fix/nimble_pr_issues' into 'master'
fix(nimble): Add fixes for compilation issues in nimble

See merge request espressif/esp-idf!39631
2025-06-16 15:33:20 +05:30
0190ba0390 fix(bt): Fixed HFP AG data callback cleared after profile is re-initialized 2025-06-16 16:55:09 +08:00
f4a45a30b5 Merge branch 'refactor/remove_tsens_legacy' into 'master'
refactor(temperature_sensor): Remove legacy temperature sensor driver

Closes IDF-12570 and IDF-13366

See merge request espressif/esp-idf!39840
2025-06-16 16:09:40 +08:00
7549d083a4 feat(hw_support): move call_start_cpu0 into flash to save IRAM 2025-06-16 15:07:34 +08:00
6d293c8582 feat(clk): Add basic clock support for esp32h21 2025-06-16 15:05:32 +08:00
1c5cadea13 fix(cache): fixed SOC_CACHE_FREEZE_SUPPORTED not defined on c3/c2 issue 2025-06-16 13:13:22 +08:00
2fb938c7c3 Merge branch 'feature/utilize_rom_gpio_function' into 'master'
feat(gpio): esp_rom_gpio_connect_in/out_signal now has their hal implementation

Closes IDFGH-15397

See merge request espressif/esp-idf!39383
2025-06-16 12:17:40 +08:00
c81dc5a9c4 Merge branch 'fix/fix_adc_tsens_test_wrong_channel_c61' into 'master'
fix(adc): fix wrong adc channel on c61 adc/tsens test

See merge request espressif/esp-idf!39808
2025-06-16 11:46:03 +08:00
0da7604680 Merge branch 'feat/support_weight_arbitration_on_c61' into 'master'
feat(gdma): support gdma weighted arbitration on c61 v1.0

Closes IDF-12882, IDF-9310, and IDF-12090

See merge request espressif/esp-idf!39710
2025-06-16 11:12:22 +08:00
974f571251 Merge branch 'docs/translate_migration_guides' into 'master'
docs: Provide CN translation for two migration-guides docs

Closes DOC-11341

See merge request espressif/esp-idf!39858
2025-06-16 11:09:50 +08:00
bdf4dafe56 fix(soc): Fix wrong efuse register on esp32c61 2025-06-16 10:58:53 +08:00
caf1a18188 refactor(temperature_sensor): Move calibration function from efuse to hal 2025-06-16 10:58:11 +08:00
d839ecbcf0 refactor(temperature_sensor): Remove legacy temperature sensor driver 2025-06-16 10:58:09 +08:00
211238d6cd Merge branch 'ci/reenable_c5_adc_test' into 'master'
ci(adc): reenable c5 adc test and fix test val

Closes IDF-13061

See merge request espressif/esp-idf!39836
2025-06-16 10:40:04 +08:00
0fc082d87e Merge branch 'bugfix/fixed_touch_freq_unit_issue' into 'master'
fix(touch): fixed touch interval freq unit convert issue

See merge request espressif/esp-idf!39860
2025-06-16 09:47:56 +08:00
a319aa902c Merge branch 'feature/change-orphan-handling-behavior-to-error' into 'master'
feat(build): change orphan-handling behavior to error

Closes IDF-9792 and DOC-11408

See merge request espressif/esp-idf!39566
2025-06-15 17:41:10 +04:00
be87c12a74 docs(migration-guides): add CN translation for build-system.rst 2025-06-15 11:54:05 +07:00
2435ffd1c6 fix(esp_adc): Release the peripheral after calibration 2025-06-14 18:36:40 +03:00
561f017ef7 ci: Use new release-zips-action with shallow history 2025-06-14 14:58:51 +02:00
a4037e2416 Merge branch 'fix/limit-idf-component-manager-version' into 'master'
fix: limit idf-component-manager version

See merge request espressif/esp-idf!39869
2025-06-13 15:06:44 +02:00
2d2aac017a change(bt): increase BTDM_MODEM_WAKE_UP_DELAY 2025-06-13 20:38:47 +08:00
12d2347e24 change(esp_timer): make esp_timer timming drift always be negative 2025-06-13 20:38:46 +08:00
f861b7dd65 fix(esp_hw_support): config lact in critical 2025-06-13 20:38:46 +08:00
520ee76e03 fix: limit idf-component-manager version 2025-06-13 13:56:22 +02:00
d445536897 Merge branch 'refactor/remove_legacy_dac_driver' into 'master'
remove(legacy_dac): remove legacy dac driver in IDF v6.0

Closes IDF-13344

See merge request espressif/esp-idf!39682
2025-06-13 19:42:27 +08:00
71072cc1af docs: Provide CN translation for two migration-guides docs 2025-06-13 19:14:18 +08:00
beb6d79fc9 Merge branch 'bugfix/pawr_sync' into 'master'
fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports

Closes BLERP-1936

See merge request espressif/esp-idf!39514
2025-06-13 15:24:30 +05:30
d7aba9b677 ci(adc): reenable c5 adc test and fix test val 2025-06-13 17:28:39 +08:00
e603f4ec6b Merge branch 'feature/bootloader_ota' into 'master'
feat(bootloader): Supports recovery bootloader

Closes IDF-7780 and IDF-7779

See merge request espressif/esp-idf!31893
2025-06-13 17:05:39 +08:00
7eb710862c Merge branch 'feature/master_test_macos_virtualization' into 'master'
master(6.0): Migrate macOS to VM parallels

See merge request espressif/esp-idf!39373
2025-06-13 16:50:58 +08:00
b35982d521 fix(touch): fixed touch interval freq unit convert issue 2025-06-13 16:34:38 +08:00
81ee3bbe2c Merge branch 'fix/apptrace_crc_calculation' into 'master'
fix(apptrace): calculate crc16 of the current block before swap

See merge request espressif/esp-idf!39815
2025-06-13 10:27:47 +02:00
d099224758 Merge branch 'feature/p4_add_3bit_for_wafer_major' into 'master'
feat(efuse): Adds 3-bit field for wafer major version in ESP32-P4

See merge request espressif/esp-idf!39562
2025-06-13 15:06:20 +08:00
d38621e95a Merge branch 'fix/fix_adc_cali_error_c5' into 'master'
fix(adc): fix adc calibration error on c5

Closes IDF-8701, IDF-8702, and IDF-8703

See merge request espressif/esp-idf!39820
2025-06-13 14:25:10 +08:00
1548e1dd67 Merge branch 'contrib/github_pr_16118' into 'master'
docs(esp_transport_ws): fix parameter name documentat (GitHub PR)

See merge request espressif/esp-idf!39827
2025-06-13 14:01:42 +08:00
740762c997 feat(usb_serial_jtag): Update vfs read to be POSIX compliant
The function now returns with available data in blocking mode
instead of waiting for the requested size to be available before
returning.
2025-06-13 07:58:22 +02:00
56130d0366 Resupport C61 documentation build 2025-06-13 11:52:07 +08:00
a8b6017ca5 docs(esp_transport_ws): fix parameter name documentation 2025-06-12 10:44:06 -05:00
8fb69d6ef8 Merge branch 'bugfix/fix_kconfig_names' into 'master'
fix(nimble): Modified Kconfig information to make it more user friendly

See merge request espressif/esp-idf!39617
2025-06-12 20:25:29 +05:30
52a6290cf5 Merge branch 'feat/ram_optimization' into 'master'
fix(nimble): Add support to minimize ram consumption

Closes BLERP-1947

See merge request espressif/esp-idf!38983
2025-06-12 20:23:25 +05:30
bb5fc032e0 fix(nimble): Add support to minimize ram consumption 2025-06-12 19:31:07 +05:30
8192dfc530 fix(nimble): Add fixes for compilation issues in nimble
1. Fix compile failures when CSFCS is 0
2. Wrap BLE service API with extern "C"
2025-06-12 19:27:38 +05:30
68f9f0381a Merge branch 'feat/add_ble_dtm_on_cert_test' into 'master'
feat(ble): add dtm test code to cert test example on ESP32-C6

Closes BLERP-1985

See merge request espressif/esp-idf!39785
2025-06-12 21:51:43 +08:00
81b93828cf Merge branch 'change/update-esp-event-register-doxygen' into 'master'
change(esp-event): Update the doxygen comment of esp_event_handler_register

Closes IDF-13368

See merge request espressif/esp-idf!39819
2025-06-12 15:01:41 +02:00
3a7c1a2e74 feat(bootloader): Bootloader OTA update with recovery bootloader feat 2025-06-12 18:47:33 +08:00
49df6a8b77 fix(adc): fix adc calibration error on c5 2025-06-12 16:56:12 +08:00
a4cb2dc98b remove(i2s): remove deprecated configuration in IDF v6.0 2025-06-12 16:53:50 +08:00
bf3a050f4d remove(legacy_dac): remove legacy dac driver in IDF v6.0 2025-06-12 16:53:47 +08:00
1b7cb43842 Merge branch 'fix/create_project_read_only' into 'master'
fix(tools): idf.py create-project works in read-only ESP-IDF

Closes IDFGH-15364 and IDFGH-15305

See merge request espressif/esp-idf!39751
2025-06-12 10:50:29 +02:00
zwl
71bc00568d feat(ble): add dtm test code to cert test example on ESP32-C6 2025-06-12 16:34:19 +08:00
f3f6bc95df feat(gdma): support gdma weighted arbitration on c61 v1.0 2025-06-12 16:17:30 +08:00
3e09d4f251 Merge branch 'refactor/remove_gdma_deprecated_functions' into 'master'
refactor(dma)!: remove deprecated functions

Closes IDF-10942

See merge request espressif/esp-idf!39372
2025-06-12 15:51:15 +08:00
d9457b807c Merge branch 'fix/lwip_dhcp_option_len_assert' into 'master'
fix(lwip): Fix appending DHCP option with HW-ID

Closes IDF-13354

See merge request espressif/esp-idf!39749
2025-06-12 15:01:10 +08:00
2a17297d66 change(esp-event): Update the doxygen comment of esp_event_handler_register
Add a comment to specify what happens when registering a handler several times
to the same event.
2025-06-12 08:23:20 +02:00
fb4b590941 refactor(dma)!: remove deprecated functions 2025-06-12 12:24:58 +08:00
a8bf745f23 Merge branch 'feat/adding_different_strategy_to_perform_tls_using_dynamic_feature' into 'master'
Add configuration to control dynamic buffer strategy in mbedtls

Closes IDF-12591

See merge request espressif/esp-idf!39469
2025-06-12 09:52:35 +05:30
dd893957f3 Merge branch 'docs/update_reprovisioning_docs_in_wifi_prov_mgr_example' into 'master'
Updated reprovisioning docs in wifi prov mgr example

Closes IDF-12699

See merge request espressif/esp-idf!39058
2025-06-12 09:48:08 +05:30
81bb6a0557 Merge branch 'refactor/remove_legacy_pcnt_driver' into 'master'
remove(legacy_pcnt)!: remove legacy pcnt driver in IDF v6.0

Closes IDF-13172 and IDF-13036

See merge request espressif/esp-idf!39754
2025-06-12 11:49:55 +08:00
3785a2421d Merge branch 'feat/add_h264_encoder_decoder_demo' into 'master'
feat(esp_h264): Add esp_h264 enocder and decoder example

Closes AUD-6406

See merge request espressif/esp-idf!39676
2025-06-12 11:03:22 +08:00
fa54de736e feat(esp_h264): Added esp_h264 encoder and decoder 2025-06-12 10:43:18 +08:00
f05d47c7d3 Merge branch 'feat/parlio_tx_use_dma_eof' into 'master'
feat(parlio_tx): Supported to transmit infinitely long buffer on ESP32-C5

Closes IDF-12732 and IDF-10974

See merge request espressif/esp-idf!38919
2025-06-12 10:38:15 +08:00
1615270205 fix(apptrace): calculate crc16 of the current block before swap 2025-06-11 22:41:05 +02:00
3e2945b595 fix(gpio): remove GPIO_OUTPUT_SET macro for ESP32P4
Use GPIO_OUTPUT_SET led to compilation error

Closes https://github.com/espressif/esp-idf/issues/16050
2025-06-11 20:56:12 +08:00
60bef64f5c feat(gpio): esp_rom_gpio_connect_in/out_signal now has their hal implementation 2025-06-11 20:41:37 +08:00
e8cefb33c8 fix(adc): fix wrong adc channel on c61 adc/tsens test 2025-06-11 17:37:56 +08:00
619caaa79f docs(wifi_prov_mgr): Updated the README.md for reprovisioning usage
Updated the README.md for the reprovisoning usage in wifi_prov_mgr example
and udpated the commnet for wifi_prov_mgr_reset_sm_state_for_reprovision api.
2025-06-11 15:04:05 +05:30
42682b1e36 Merge branch 'feat/axi_bus_priority' into 'master'
feat(axi): add low level function for adjusting the arbitration priority when DMA and cache both are accessing the external memory

Closes IDF-12654 and IDF-12875

See merge request espressif/esp-idf!39713
2025-06-11 17:11:09 +08:00
2fb4c6771a test(pcnt): with malloc comes from PSRAM by default 2025-06-11 16:54:41 +08:00
d345ac1a50 remove(legacy_pcnt): remove legacy pcnt driver in IDF v6.0 2025-06-11 16:54:41 +08:00
00b1d66c6e feat(parlio_tx): support to use dma eof on esp32c5 2025-06-11 16:37:55 +08:00
f10dcd6140 feat(parlio_tx): add cache safe test 2025-06-11 16:37:55 +08:00
86d33f4460 fix(parlio_tx): update gpio state in delete function 2025-06-11 16:37:55 +08:00
3b0f4e4083 feat(efuse): Adds 3-bit field for wafer major version in ESP32-P4 2025-06-11 16:35:03 +08:00
ae3f20fa9f Merge branch 'refactor/change_mmap_cache_lock_type' into 'master'
mmu: use cache freeze for mmap APIs

See merge request espressif/esp-idf!39199
2025-06-11 06:45:16 +00:00
10d4e71323 feat(mmu): use cache freeze for mmap apis 2025-06-11 10:27:55 +08:00
c205f50f93 feat(ci): Migrate macOS runners to Parallels VM 2025-06-10 18:08:05 +02:00
b3f24a9533 fix(tools): idf.py create-project works in read-only ESP-IDF
As the native copy function shutil.copyfile preserves directories metadata
such as file permissions, we need to ensure the copied destination
is writable for owner.

Closes https://github.com/espressif/esp-idf/issues/15964
Closes https://github.com/espressif/esp-idf/pull/16021
2025-06-10 14:48:08 +02:00
5ec67f5e2c feat(tools): adjusted create_ext.py by ruff formatter 2025-06-10 14:48:08 +02:00
a2257490d2 Merge branch 'feat/enable_wakeup_tests_for_more_chips' into 'master'
feat(esp_hw_support): enable wakeup tests for more chips

Closes PM-337

See merge request espressif/esp-idf!39675
2025-06-10 20:09:39 +08:00
044de64f5b fix(esp_system): rename modem clock source selection
Make sure to use proper label for modem source selection.
This does not fix any issue.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-06-10 20:03:06 +08:00
916f70192f Merge branch 'bugfix/fix_mesh_sta_send_data_error_on_c5' into 'master'
fix(wifi/mesh): fixed the mesh STA sends data error on c5

Closes WIFIBUG-1222 and WIFI-6852

See merge request espressif/esp-idf!39752
2025-06-10 18:56:09 +08:00
e71e7552ef Merge branch 'refactor/remove_legacy_i2s_driver' into 'master'
remove(legacy_i2s): remove legacy i2s driver in IDF v6.0

Closes IDF-13170

See merge request espressif/esp-idf!39681
2025-06-10 18:49:55 +08:00
443e8718b8 Merge branch 'bugfix/fix_touch_sens_failure' into 'master'
fix(touch): fixed channel offset issue in touch v2

Closes IDFCI-2964

See merge request espressif/esp-idf!39766
2025-06-10 18:34:53 +08:00
85d74cdde8 Merge branch 'feat/support_ble_vendor_evt_report_with_param' into 'master'
feat(bt/bluedroid): Support BLE vendor event reporting with params

Closes BLERP-1624

See merge request espressif/esp-idf!37539
2025-06-10 18:22:51 +08:00
a4fcd06785 Merge branch 'feat/support_anonymous_addr_type_for_white_list' into 'master'
feat(ble/bluedroid): Support anonymous address type for white list

Closes BLERP-1844

See merge request espressif/esp-idf!38950
2025-06-10 18:22:40 +08:00
a172dac0ef Merge branch 'bugfix/fix_blecibr25_119' into 'master'
fix(ble/bluedroid): Fixed extended adv restart failure during reconnection

Closes BLERP-1969, BLERP-1970, BLERP-1971, and BLERP-1979

See merge request espressif/esp-idf!39709
2025-06-10 18:22:36 +08:00
0fa5b07c7e Merge branch 'feature/esp32c61_eco3_gpio_update' into 'master'
change(gpio): add GPIO25~29 for ESP32C61 ECO3

Closes IDF-12874 and IDF-9316

See merge request espressif/esp-idf!39714
2025-06-10 16:17:05 +08:00
f4e8813d45 Merge branch 'contrib/github_pr_15972' into 'master'
feat(esp_http_client): Event to signal last header downloaded (GitHub PR)

See merge request espressif/esp-idf!39309
2025-06-10 13:08:10 +05:30
446e2fce11 Merge branch 'bugfix/jpeg_dec_black_line' into 'master'
bugfix(jpeg): eliminate random black line on jpeg decoder

Closes IDF-13158

See merge request espressif/esp-idf!39742
2025-06-10 15:32:16 +08:00
3550140131 Merge branch 'bugfix/ana_cmpr_cache_safe_test' into 'master'
fix(ana_cmpr): regression in the cache safe test

Closes IDFCI-2951 and IDFCI-2952

See merge request espressif/esp-idf!39764
2025-06-10 15:31:03 +08:00
b25f3fa966 fix(touch): fixed channel offset issue in touch v2 2025-06-10 15:06:23 +08:00
6392180813 fix(ble/bluedroid): Fixed extended adv restart failure during reconnection 2025-06-10 15:06:03 +08:00
555c511d28 feat(build): change orphan-handling behavior to error 2025-06-10 14:44:01 +08:00
7847a82b28 change(ble): resupport ble for ESP32C61ECO3 2025-06-10 14:34:49 +08:00
baa888e09b fix(ana_cmpr): regression in the cache safe test 2025-06-10 13:52:58 +08:00
6eb5bfe587 remove(legacy_i2s): remove legacy i2s driver in IDF v6.0 2025-06-10 12:23:23 +08:00
71e15a1085 feat(ble/bluedroid): Add config for BLE vendor hci command and event 2025-06-10 10:54:18 +08:00
2fbb86deb7 feat(axi): add low level function for adjusting the arbitration priority 2025-06-10 10:32:01 +08:00
96c6c0db67 feat(esp_hw_support): enable wakeup tests for more chips 2025-06-10 10:21:19 +08:00
c10d3ac9ff Merge branch 'update/wifi_remote' into 'master'
change(examples): Re-enable examples which need esp_wifi_remote

See merge request espressif/esp-idf!39067
2025-06-10 00:42:09 +08:00
1c95cdf649 fix(hal): fix pmu_ll_ext1_clear_wakeup_status API 2025-06-09 20:32:48 +08:00
0fe1586a55 feat(ble/bluedroid): Support BLE vendor event reporting with params 2025-06-09 20:26:18 +08:00
913645d239 feat(ble/bluedroid): Support anonymous address type for white list 2025-06-09 19:41:54 +08:00
da4ac0c56a feat(gpio): update GPIO capabilities IO0-29 for ESP32-C61 ECO3 2025-06-09 19:09:49 +08:00
3c403e97e1 fix(wifi/mesh): fixed the mesh STA sends data error on c5 2025-06-09 17:51:00 +08:00
48b37dd56e Merge branch 'contrib/github_pr_16016' into 'master'
Enable Timestamping for Non-PTP Ethernet frames (GitHub PR)

Closes IDFGH-15359

See merge request espressif/esp-idf!39581
2025-06-09 16:58:07 +08:00
23d71fecd6 Merge branch 'feat/add_cte_iq_report_example' into 'master'
Add Bluetooth LE CTE connless example.

See merge request espressif/esp-idf!39327
2025-06-09 16:41:21 +08:00
a39d38994f fix(lwip): Fix appending DHCP option with HW-ID 2025-06-09 10:29:24 +02:00
d49f4d31d0 fix(examples): Update wifi-remote dependency to include IDF-v6
Use esp_wifi_remote version < v2.0
Planned release v1.0 to support remote and native coexistence, which
should be still compatible with IDFv5.x and IDFv6.x
2025-06-09 10:25:52 +02:00
8fede49368 change(examples): Re-enable examples which need esp_wifi_remote
This reverts commit 7023b489a7.
2025-06-09 10:25:48 +02:00
4233552ce4 Merge branch 'ci/kconfig_change_should_build_full_doc' into 'master'
ci(doc): kconfig change should trigger a full doc build

See merge request espressif/esp-idf!39623
2025-06-09 15:01:36 +08:00
39a44b4a94 Merge branch 'fix/add_check_for_wifi_set_config' into 'master'
fix(wifi): add check for esp_wifi_set_config

See merge request espressif/esp-idf!39683
2025-06-09 14:44:00 +08:00
f1dd6da8a3 Merge branch 'bugfix/fix_ble_init_exception' into 'master'
Fixed double free exception during BLE init under low memory

Closes BLERP-1954

See merge request espressif/esp-idf!39680
2025-06-09 14:38:32 +08:00
c85075dc12 Merge branch 'update/update_cmn_crt_authorities_csv' into 'master'
Update common cert authorities csv

See merge request espressif/esp-idf!39564
2025-06-09 12:08:03 +05:30
724ce1fc97 Merge branch 'feature/suspend_support_c5_c61' into 'master'
feat(spi_flash): Add spi flash suspend support on esp32c5, esp32c61

Closes IDF-12879 and IDF-12635

See merge request espressif/esp-idf!39652
2025-06-09 14:30:02 +08:00
c490702340 bugfix(jpeg): eliminate random black line on jpeg decoder 2025-06-09 14:14:20 +08:00
8d0527d7bf Merge branch 'feat/support_sha512_for_esp32c5' into 'master'
Support SHA 512 for ESP32-C5

See merge request espressif/esp-idf!39421
2025-06-09 09:42:37 +05:30
ce3611db26 fix(wifi): add check for esp_wifi_set_config 2025-06-09 11:52:01 +08:00
5b7922b028 Merge branch 'refactor/apm_tee_ll_hal' into 'master'
refactor(hal): Refactor the APM LL/HAL APIs

Closes IDF-10423 and IDF-12830

See merge request espressif/esp-idf!38522
2025-06-09 09:13:26 +05:30
71da548124 Merge branch 'change/ble_update_lib_20250606' into 'master'
change(ble): [AUTO_MR] 20250606 - Update ESP BLE Controller Lib

Closes BLERP-1921, BLERP-1919, BLERP-1955, BLERP-1951, BLERP-1950, BLERP-1933, BLERP-1932, BLERP-1929, BLERP-1927, BLERP-1893, BLERP-1885, and BLERP-1900

See merge request espressif/esp-idf!39712
2025-06-09 10:57:03 +08:00
3b504812df Merge branch 'refactor/remove_legacy_timer_driver' into 'master'
!Remove legacy timer group driver

Closes IDF-13169

See merge request espressif/esp-idf!39346
2025-06-09 10:56:06 +08:00
c1666c8033 Merge branch 'refactor/p4_touch_channel_increase_1' into 'master'
refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14

Closes IDF-12744

See merge request espressif/esp-idf!39331
2025-06-09 10:37:17 +08:00
ec689969c2 Merge branch 'docs/add_doc_link_for_esp32p4' into 'master'
docs: Update hw-reference/index.rst for esp32p4

Closes DOC-8754

See merge request espressif/esp-idf!39707
2025-06-09 10:35:10 +08:00
18e884532b Merge branch 'camera/add_dvp_example' into 'master'
P4 DVP example and bugfix

See merge request espressif/esp-idf!39308
2025-06-09 09:57:14 +08:00
6d2bfc70c1 fix(touch): fixed incorrect interval clock source 2025-06-08 22:08:00 +08:00
0f2c1ab859 refactor(touch): adjust touch channel number on P4 from 0-13 to 1-14 2025-06-08 22:08:00 +08:00
da1842ea0f change(mbedtls/crt_bundle): Update esp_cmn_crt_bundle certificates 2025-06-08 13:35:51 +05:30
adcbdd7da4 Merge branch 'bugfix/add_missing_deinit_call' into 'master'
fix(nimble): Add invocation for mempool_deinit

Closes BT-4026

See merge request espressif/esp-idf!39664
2025-06-07 18:34:54 +05:30
c57254c4b1 fix(esp_netif): Fix reasigning static IP after netif down -> up
Fixes regression from 307f45d5 (ip_info should be cleaned, but only if we're running DHCP client on that netif)
2025-06-06 15:43:53 +02:00
0d8a1f5427 refactor(hal): Refactor the APM LL/HAL APIs 2025-06-06 18:28:47 +05:30
b03186d71f fix(nimble): memset the sync structs to prevent uncertainty for ext_adv reports 2025-06-06 16:58:48 +05:30
d835854c8f Merge branch 'bugfix/fix_tls1_3_dynamic_buffer_build' into 'master'
fix(mbedtls): Fix failing build with TLS1.3 only and dynamic buffer enabled

Closes IDF-13140

See merge request espressif/esp-idf!39319
2025-06-06 16:09:25 +05:30
a3cf6468b1 Merge branch 'bugfix/fix_cant_enter_modem_sleep_after_probe_disassoc' into 'master'
fix(wifi): fix cant sleep if connection breaks during sending probe

Closes AUD-6394

See merge request espressif/esp-idf!39702
2025-06-06 18:08:54 +08:00
6bbd68b1f8 ci(doc): kconfig change should trigger a full doc build 2025-06-06 18:00:16 +08:00
a10696d7e1 fix(ble): change the default ble cca thresh on ESP32-C2 2025-06-06 17:57:35 +08:00
a2fab0ad60 fix(ble): change the default ble cca thresh on ESP32-H2 2025-06-06 17:57:04 +08:00
581521526b fix(ble): change the default ble cca thresh on ESP32-C6 2025-06-06 17:56:55 +08:00
c802176535 fix(ble): change the default ble cca thresh on ESP32-C5 2025-06-06 17:56:44 +08:00
zwl
6c5bff1bd8 fix(ble): change ld file on ESP32-C2 2025-06-06 17:56:32 +08:00
zwl
44d7fc43f6 fix(ble): fixed an occasional abnormal scanning stop issue on ESP32-C5 2025-06-06 17:56:23 +08:00
zwl
3c8ba488e0 fix(ble): fixed an occasional assertion issue during sync on ESP32-C6 2025-06-06 17:56:11 +08:00
zwl
4be18a2469 change(ble): [AUTO_MR] Update lib_esp32c2 to 7f72c031 2025-06-06 17:55:08 +08:00
zwl
57c8d23800 change(ble): [AUTO_MR] Update lib_esp32c6 to 35fe65f4 2025-06-06 17:55:08 +08:00
zwl
dacaae746e change(ble): [AUTO_MR] Update lib_esp32c5 to 35fe65f4 2025-06-06 17:55:08 +08:00
zwl
dbf7835a6b change(ble): [AUTO_MR] Update lib_esp32h2 to 35fe65f4 2025-06-06 17:55:07 +08:00
aa4489a879 feat(esp32c5): Enable Bluetooth LE CTE feature 2025-06-06 17:52:41 +08:00
d8631ed3db feat(ble): Add Bluetooth LE CTE connectionless AoA/AoD examples 2025-06-06 17:52:41 +08:00
139df47cf3 feat(usb_cdc): Update vfs read() to comply with POSIX standards 2025-06-06 11:41:26 +02:00
eae1f3c302 feat(esp_eth): Enable rx/tx timestamp for non-PTP frames via ioctl 2025-06-06 11:35:10 +02:00
85ec4df4db change(mbedlts/port): Remove deprecated header files 2025-06-06 14:52:03 +05:30
fe78370ec9 feat(mbedtls/sha): New API for setting SHA mode 2025-06-06 14:51:44 +05:30
afdf1a31c8 feat(soc): Update ESP32-C5 ECO2 to support SHA512 2025-06-06 14:51:44 +05:30
d0aabd36b4 Merge branch 'fix/fix_xip_psram_ptr_check' into 'master'
psram: fixed psram ptr check issue under xip_psram condition for ESP32P4

Closes IDFGH-15338, IDFGH-15340, and IDF-12458

See merge request espressif/esp-idf!39405
2025-06-06 08:54:34 +00:00
b173783d92 docs(camera): add lcd_cam dvp driver docs for camera 2025-06-06 16:53:51 +08:00
bc93cee52e Merge branch 'bugfix/set_default_ap_mgmt_cipher' into 'master'
fix(esp_wifi): Set default ap mgmt cipher

See merge request espressif/esp-idf!39691
2025-06-06 14:00:04 +05:30
5799f556b4 Merge branch 'break/drop_gdbgui' into 'master'
Tools: Drop official support for gdbgui

Closes IDF-4627

See merge request espressif/esp-idf!39326
2025-06-06 10:23:44 +02:00
8b30f85f2f docs: Update hw-reference/index.rst for esp32p4 2025-06-06 16:23:43 +08:00
af69042685 Merge branch 'fix/fix_c5_eco2_psram_wrong_tuning_point' into 'master'
psram: fixed wrong psram tuning point on c5 eco2

See merge request espressif/esp-idf!39642
2025-06-06 07:57:57 +00:00
24c15284db Merge branch 'bugfix/c5_newlib_tests' into 'master'
test(newlib): fixed failing C5 ECO2 newlib tests

Closes IDFCI-2879

See merge request espressif/esp-idf!39639
2025-06-06 15:50:35 +08:00
a04df4631e refactor(gptimer)!: removed the legacy driver
also provide idy.py hints instructions
2025-06-06 15:11:26 +08:00
b194636859 feat(spi_flash): Add spi flash suspend support on esp32c5, esp32c61 2025-06-06 15:03:41 +08:00
4a80901841 Merge branch 'fix/rx_abort_next_op' into 'master'
fix(openthread): disable rx_abort events in next operation

See merge request espressif/esp-idf!39708
2025-06-06 06:55:04 +00:00
27f232a929 test(newlib): fixed failing C5 ECO2 newlib tests 2025-06-06 08:38:24 +02:00
3efb46e480 remove(tools): Drop official support for gdbgui 2025-06-06 14:32:05 +08:00
532ea1ad6d change(tools): fix the style of debug_ext.py 2025-06-06 14:32:05 +08:00
ea4787e6e6 Merge branch 'bugfix/idfci-2959' into 'master'
fix ci build doc field on power management and sleep rst text

Closes IDFCI-2959 and IDFCI-2960

See merge request espressif/esp-idf!39643
2025-06-06 14:29:26 +08:00
ce970143bb fix(openthread): disable rx_abort events in next operation 2025-06-06 12:26:44 +08:00
1533cab12b fix(cam): fix dvp do not generate clock 2025-06-06 11:50:18 +08:00
3b2c6aee2e fix(psram): fixed wrong psram tuning point on c5 eco2 2025-06-06 02:49:59 +00:00
7a6cd632c5 fix(psram): fixed psram ptr check under xip_psram condition
Closes https://github.com/espressif/esp-idf/pull/15999
Closes https://github.com/espressif/esp-idf/issues/15997
2025-06-06 10:11:32 +08:00
0e680775f9 fix(memory-utils): Add _instruction_reserved_start/end to esp_psram_check_ptr_addr
Adds missing range check that can be used when SPIRAM_XIP_FROM_PSRAM is enabled.
2025-06-06 10:11:32 +08:00
6287650225 fix(freertos): Use ESP_EARLY_LOGE in vPortTLSPointersDelCb for RISCV
Using ESP_LOG* in this function causes a crash
2025-06-06 10:11:32 +08:00
4323627865 fix(wifi): fix cant sleep if connection breaks during sending probe 2025-06-05 20:48:46 +08:00
dc814f241a Merge branch 'bugfix/dpp_sync_issue' into 'master'
fix(esp_wifi): Fixed DPP concurrency issue

Closes WIFIBUG-1229

See merge request espressif/esp-idf!38832
2025-06-05 19:49:44 +08:00
24048d8267 feat(usb_serial_tag_vfs): Add test for read exit conditions
Add a test to make sure the VFS read does not return on reception
of the \n character
2025-06-05 12:14:50 +02:00
514853d2e3 fix(esp_wifi): Set default ap mgmt cipher 2025-06-05 15:35:20 +05:30
de3b6ff3d6 Merge branch 'feat/add_config_for_openthread' into 'master'
feat(openthread): add some configurations in Kconfig

Closes TZ-1823

See merge request espressif/esp-idf!39609
2025-06-05 09:17:25 +00:00
3c84fd7b4d fix(esp_wifi): Make sure old DPP listen is cancelled 2025-06-05 16:55:21 +08:00
ab9304d3b7 fix(esp_wifi): Modify check for dpp event handlers 2025-06-05 16:55:21 +08:00
a929aae33f change(esp_wifi): Update dpp enrollee example to use updated events 2025-06-05 16:55:21 +08:00
15c336bf49 fix(esp_wifi): Update dpp code to send events in freeRTOS context 2025-06-05 16:55:21 +08:00
76723c063a fix(esp_wifi): Fixed DPP concurrency issue 2025-06-05 16:55:21 +08:00
5928a87aa7 feat(mbedtls): Add configuration to control dynamic buffer strategy in mbedtls
Problem:
1. In low-memory scenarios, the dynamic buffer feature can fail due to memory fragmentation.
2. It requires a contiguous 16KB heap chunk, but continuous allocation and deallocation of
the RX buffer can lead to fragmentation.
3. If another component allocates memory between these operations, it can break up the
available 16KB block, causing allocation failure.

Solution:
1. Introduce configurable strategy for using dynamic buffers in TLS connections.
2. For example, convert RX buffers to static after the TLS handshake.
3. Allow users to select the strategy via a new field in the esp_http_client_cfg_t structure.
4. The strategy can be controlled independently for each TLS session.
2025-06-05 12:43:47 +05:30
2a13a36589 feat(cam): add esp32p4 dvp example 2025-06-05 14:58:58 +08:00
c6c2948a99 change(unit-test): filter top domain power down check for some sleep test cases 2025-06-05 14:28:15 +08:00
49a4325b15 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(4713a69)
- Fixed double free exception during BLE init under low memory
2025-06-05 11:10:25 +08:00
92883fbbdf Merge branch 'feat/ble_mesh_micellaneous_fix' into 'master'
Feat/ble mesh micellaneous fix

Closes BLERP-1939, BLERP-1938, BLERP-1937, and BLERP-1940

See merge request espressif/esp-idf!39519
2025-06-05 10:34:35 +08:00
2209a6c0b5 Merge branch 'feat/nimble_ancs_final' into 'master'
fix(nimble): Added support for ANCS in nimble

See merge request espressif/esp-idf!39565
2025-06-04 19:13:29 +05:30
7912f9fafe change(esp_hw_support): force top domain power up during sleep 2025-06-04 21:03:02 +08:00
63b7ae9ad1 fix(esp_common/cmake): do not rely on the target variable being set
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-04 19:50:27 +08:00
b84e9b69ba fix(newlib/cmake): avoid using uninitialized ldfragments variable
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-04 19:50:27 +08:00
26e49e1e82 fix(vfs/cmake): avoid using uninitialized sources variable
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-04 19:50:27 +08:00
56ac76d4d2 fix(esp_coex/cmake): avoid using uninitialized srcs variable
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-04 19:50:27 +08:00
f50ae95ab5 fix(lwip/cmake): avoid using uninitialized srcs variable
Currently, lwip's CMakeLists.txt might use an uninitialized srcs value
if CONFIG_LWIP_ENABLE is disabled. This means it could use a srcs value
set by another component, involving sources that are entirely
unrelated to the lwip component during registration. Perhaps we
should simply exit when CONFIG_LWIP_ENABLE is not enabled and avoid
registering the component altogether.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-04 19:50:27 +08:00
c62b4c7994 fix(nimble): Add invocation for mempool_deinit 2025-06-04 16:35:59 +05:30
fc4b2fbc28 Merge branch 'ci/disable-plugin-idf_ci' into 'master'
ci: disable idf-ci plugin

See merge request espressif/esp-idf!39600
2025-06-04 12:12:18 +02:00
7d25722980 Merge branch 'bugfix/fix_ble_smp_fail_0x82' into 'master'
Bugfix/fix ble smp fail 0x82

Closes BLERP-1949

See merge request espressif/esp-idf!39494
2025-06-04 17:08:31 +08:00
f8832b583c Revert "fix(esp_pm): esp32c5 eco2 disable top pd to avoid mem being changed during sleep"
This reverts commit 8c2ea986b4.
2025-06-04 14:15:16 +08:00
a045046a7a fix(nimble): Added support for ANCS in nimble 2025-06-04 08:08:22 +05:30
4ce1da7569 Merge branch 'fix/bcast_mgmt_api' into 'master'
Add BIP support for AP mode.

Closes WIFIBUG-1155

See merge request espressif/esp-idf!38249
2025-06-03 21:46:01 +05:30
9abd30adc0 fix(wifi): Made changes in api for sending bcast deauth frames 2025-06-03 20:33:56 +05:30
6aeba18713 Merge branch 'feature/misc_core_iram' into 'master'
feat(core): added option for placing more core functions in flash

See merge request espressif/esp-idf!39489
2025-06-03 21:44:04 +08:00
44ba32bef7 fix(nimble): Modified Kconfig information to make it more user friendly 2025-06-03 16:00:54 +05:30
a2b7ce698b Merge branch 'feat/ksh_compatible_shells' into 'master'
fix(tools): add support for shells compatible with ksh

Closes IDFGH-15389

See merge request espressif/esp-idf!39602
2025-06-03 12:11:23 +02:00
473f316906 Merge branch 'bugfix/fix_coex_ble_disc' into 'master'
fix(coex): Fix ble disconnect when coexisting wifi on esp32c2

Closes BT-4021

See merge request espressif/esp-idf!39522
2025-06-03 18:08:38 +08:00
1294da2754 Merge branch 'fix/fix_esp32c2_auth_thre_issue' into 'master'
fix(wifi): fix eps32c2 auth threshold issue

Closes WIFIBUG-1231, WIFIBUG-1235, WIFIBUG-1236, and WIFIBUG-1237

See merge request espressif/esp-idf!39496
2025-06-03 18:05:13 +08:00
a3270694f0 fix(driver): remove unecessary if conditions in the read function
This changes affect usb_serial_jtag_vfs and cdcacm_vfs read functions.
This commit removes the exit condition on reception of \n character.
2025-06-03 12:04:14 +02:00
469a39bb22 Merge branch 'fix/netif_ppp_dhcp' into 'master'
fix(esp_netif): Fix incorrect DHCP call for PPP interfaces

Closes IDFGH-15097

See merge request espressif/esp-idf!38403
2025-06-03 17:59:13 +08:00
efb4d5766a Merge branch 'feature/storage_nvs_perf_blob' into 'master'
Improvement of NVS Blob performance

See merge request espressif/esp-idf!39084
2025-06-03 11:41:29 +02:00
efcb8a5a49 Merge branch 'feat/support_kconfig_in_pacman' into 'master'
feat: support kconfig in component manager

Closes PACMAN-963 and PACMAN-686

See merge request espressif/esp-idf!35526
2025-06-03 11:38:47 +02:00
4a8e0d85e4 Merge branch 'fix/gptimer_sleep_retention_case' into 'master'
test(gptimer): power domain is not power down on esp32c5

Closes IDFCI-2923 and IDFCI-2922

See merge request espressif/esp-idf!39591
2025-06-03 17:24:31 +08:00
3c01fd8301 feat(openthread): add some configurations in Kconfig 2025-06-03 16:29:46 +08:00
7f95986a0e feat(ble_mesh): update lib to f15b27e2d2 2025-06-03 15:34:32 +08:00
224b7e158d fix(ble_mesh): fixed issue with recv ntf before ccc done 2025-06-03 15:34:32 +08:00
7738bca124 fix(ble_mesh): fixed proxy server might send segment message with incorrect format 2025-06-03 15:34:32 +08:00
d4cd6e5741 feat(ble_mesh): support ble 50 for esp32c6 series chip 2025-06-03 15:34:32 +08:00
28e3112cde fix(tools): ruff-format changes for shell_types.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-03 09:26:50 +02:00
1f8ced8e6f fix(tools): add support for shells compatible with ksh
Currently, the export tools are detecting only ksh, but there are also
compatible variants like pdksh and others. This update adds support for
such ksh-compatible shells to improve export tool compatibility with ksh
variants.

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

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-03 09:22:53 +02:00
9f4b9d815a feat: support kconfig in component manager 2025-06-03 08:43:09 +02:00
87a5aedb85 ci: disable idf-ci plugin
this plugin will be re-enabled with compatible code in !38755
2025-06-03 08:37:56 +02:00
11ad7e0581 Merge branch 'fix/retry_cnt_issue_for_non_pmf_sta' into 'master'
fix(failure_retry_cnt): Prevent NON-PMF STA retries if esp_wifi_disconnect() before handshake

Closes WIFIBUG-1226

See merge request espressif/esp-idf!39497
2025-06-03 14:05:56 +08:00
1f45f98573 Merge branch 'feature/optimize-zcl-utility-path' into 'master'
feat(zigbee): optimize the path of zcl_utility

See merge request espressif/esp-idf!39506
2025-06-03 04:30:03 +00:00
5036509679 Merge branch 'bugfix/enable_ipv6_if_nan' into 'master'
bugfix(wifi): Enable IPv6 support via LWIP_IPV6 when WiFi Aware(NAN) is enabled

Closes WIFIBUG-1215

See merge request espressif/esp-idf!39385
2025-06-03 12:07:42 +08:00
50ef5946cb Merge branch 'test/spi_common_gpio_refa' into 'master'
feat(driver_spi): gpio reserve support for spi master/slave/slave_hd driver

Closes IDF-9107 and IDF-11126

See merge request espressif/esp-idf!31301
2025-06-03 11:21:43 +08:00
15414f99c3 Merge branch 'fix/ble_log_spi_out_timer_delete' into 'master'
fix(ble): set timer handle to null after deletion

Closes BLERP-1941 and BLERP-1942

See merge request espressif/esp-idf!39548
2025-06-03 11:16:49 +08:00
bf950e7dc5 test(gptimer): power domain is not power down on esp32c5 2025-06-03 11:15:24 +08:00
f51c769d99 Merge branch 'bugfix/fix_ble_crash_when_check_send_pkts' into 'master'
fix(ble/bluedroid): Fixed null pointer assert in l2c_link_check_send_pkts

Closes BLERP-1944

See merge request espressif/esp-idf!39463
2025-06-03 10:41:41 +08:00
0e6c063a13 Merge branch 'bugfix/clic_mapping_mask' into 'master'
fix(hal): make CLIC interrupt routing function to only write related bits

Closes IDF-8654 and IDF-9262

See merge request espressif/esp-idf!39320
2025-06-03 10:15:50 +08:00
441b801bc8 Merge branch 'fix/latest_tag_v6' into 'master'
fix(ci): Fix the latest tag to master's v6.0-dev

See merge request espressif/esp-idf!39413
2025-06-02 17:01:57 +02:00
c23c21f3c0 refactor(nvs_flash): Improved Blob performance
The findItem method was improved to use a hash list in RAM when searching for BLOB data chunks

The findItem method was extended with a parameter that returns the position of an item on the page,
if it is found

The algorithm for matching existing variable-length data (such as strings and BLOBs) with
new values was enhanced by comparing the CRC32 of the data chunks before reading the data from flash
2025-06-02 16:01:40 +02:00
ad164f5d57 bugfix(wifi): Define ETH_ALEN for IPV6 Communication Type 2025-06-02 15:44:39 +05:30
5dcd1a578b bugfix(wifi): Enable IPv6 support via LWIP_IPV6 when WiFi Aware(NAN) is enabled 2025-06-02 15:44:39 +05:30
2ef09a7952 fix(esp_tls): fix failing build with TLS1.3 only and dynamic buffer 2025-06-02 09:14:03 +08:00
63acb01dc1 fix(esp_netif): Rename IP_EVENT_AP_STAIPASSIGNED to generic name
Since it's the DHCP server that assigned and IP to a client,
(the DHPCS doesn't have to be an AP, and DHCPC doesn't have to
be a station or an Eth netif)

Closes https://github.com/espressif/esp-idf/issues/15663
2025-05-30 16:42:38 +02:00
4d27e1a399 change(freertos): vApplicationStackOverflowHook is now flashed in flash if option enabled
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH will now also place vApplicationStackOverflowHook in
flash
2025-05-30 14:22:54 +02:00
db3946ab9f change(heap): moved tlsf patch functions to flash 2025-05-30 14:07:13 +02:00
47d20da4cd Merge branch 'change/support_lowercase_kconfig_filename' into 'master'
Support misspelled Kconfig[.projbuild] files

Closes IDFGH-15241

See merge request espressif/esp-idf!39183
2025-05-30 11:53:10 +02:00
8150573012 fix(ble/bluedroid): Fixed null pointer assert in l2c_link_check_send_pkts 2025-05-30 17:37:21 +08:00
d4129533e6 Merge branch 'bugfix/esp32c5_eco2_cpulockup_top_pu' into 'master'
esp32c5 eco2 disable digitall peripherals power down to avoid mem being changed during sleep

Closes PM-410, PM-406, and PM-436

See merge request espressif/esp-idf!39530
2025-05-30 17:15:23 +08:00
d86a84edfd Merge branch 'change/sync_trm_csv_update_5_27' into 'master'
change(csv_update): sync the csv update to idf

See merge request espressif/esp-idf!39459
2025-05-30 16:00:04 +08:00
1614e71eb6 fix(ble): set timer handle to null after deletion 2025-05-30 15:23:05 +08:00
a9cdd337ce Merge branch 'contrib/github_pr_15944' into 'master'
Update CLion documentation page (GitHub PR)

Closes IDFGH-15285

See merge request espressif/esp-idf!39258
2025-05-30 15:04:25 +08:00
1bb75b2fb9 Merge branch 'feat/and_function_to_exit_ot_mainloop' into 'master'
feat(openthread): add a function to exit openthread mainloop safely

Closes TZ-1796

See merge request espressif/esp-idf!39389
2025-05-30 06:58:26 +00:00
6cd14c143b Merge branch 'feat/twai_driver_add_programming_guide' into 'master'
feat(driver_twai): new driver add programming guide

Closes IDF-9466

See merge request espressif/esp-idf!39013
2025-05-30 14:27:33 +08:00
94190ff7a9 docs: Add CN translation to CLion doc 2025-05-30 14:07:49 +08:00
5521ddff22 fix(wifi): fix esp32c2 auth threshold issue 2025-05-30 13:51:00 +08:00
36a5a71d5c Merge branch 'feat/i2c_support_c61' into 'master'
refactor(i2c): Remove slave_v2 source file

See merge request espressif/esp-idf!39516
2025-05-30 11:34:45 +08:00
8f224d6a63 Merge branch 'change/opt_hid_device_connect_description' into 'master'
docs(bt/bluedroid): Updated HID Device connect API description

Closes IDFGH-15363

See merge request espressif/esp-idf!39434
2025-05-30 07:12:06 +08:00
bebfd14ae5 fix(wif): Prevent NON-PMF STA retries if esp_wifi_disconnect() before handshake
Ensure that NON-PMF station does not attemp connection retries when
'esp_wifi_disconnect()' is called before the 4-way-handshake completes,
even if 'failure_retry_cnt' allows retries.
2025-05-29 21:46:49 +05:30
fed2fb0a23 Merge branch 'bugfix/add_more_checks_when_receiving_espnow' into 'master'
fix(wifi): Added more check when receiving espnow data

Closes WIFI-6846

See merge request espressif/esp-idf!38593
2025-05-29 21:24:28 +08:00
77277b59fc feat(driver_twai): new driver add programming guide 2025-05-29 21:00:50 +08:00
c6a0d9118e change: Support misspelled Kconfig[.projbuild] file names
If the name is misspelled, CMake prints out a warning.
Original issue: https://github.com/espressif/esp-idf-kconfig/issues/14
2025-05-29 14:18:20 +02:00
8c2ea986b4 fix(esp_pm): esp32c5 eco2 disable top pd to avoid mem being changed during sleep 2025-05-29 20:14:13 +08:00
44895c0b3a Merge branch 'fix/ble_mesh_solic_tx_pdu_fix' into 'master'
fix(ble_mesh): fixed issues with proxy solic pdu adv

Closes BLERP-1931

See merge request espressif/esp-idf!39480
2025-05-29 20:07:13 +08:00
713a63fb9f Merge branch 'feat/gdma_weight_based_arbitration' into 'master'
feat(gdma): support gdma weighted arbitration on C5 ECO2

Closes IDF-8007

See merge request espressif/esp-idf!32826
2025-05-29 19:59:44 +08:00
3dc6313c21 fix(coex): Fix ble disconnect when coexisting wifi on esp32c2 2025-05-29 19:20:10 +08:00
99aa39f8e8 refactor(i2c): Remove slave_v2 source file 2025-05-29 18:52:58 +08:00
adf1c5bc97 Merge branch 'bugfix/add_ci_files' into 'master'
fix(nimble): Add CI files for base configurations

Closes BLERP-1896

See merge request espressif/esp-idf!37954
2025-05-29 14:06:13 +05:30
fb32407754 change(pmu): update pmu sig soc headers of c5 2025-05-29 14:55:14 +08:00
7f2d5939b5 change(pms): update pms soc headers of p4 2025-05-29 14:55:14 +08:00
f5748246ea change(ecdsa): update ecdsa soc headers of h21 2025-05-29 14:55:14 +08:00
31c8dac885 docs(bt/bluedroid): Updated HID Device connect API description
Closes https://github.com/espressif/esp-idf/issues/16020
2025-05-29 14:52:21 +08:00
6177115241 Merge branch 'fear/add_avrcp_init_state_event' into 'master'
feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP

Closes CBI-1400 and BTQABR2023-507

See merge request espressif/esp-idf!39278
2025-05-29 14:47:02 +08:00
ca30088aa8 fix(ble_mesh): fixed issues with proxy solic pdu adv 2025-05-29 14:40:49 +08:00
edc227c5ea fix(wifi): Added more check when receiving espnow data 2025-05-29 14:31:54 +08:00
4ffb3fb32d Merge branch 'feat/add_support_for_cert_bundle_for_advanced_ota_example' into 'master'
fix(advanced_ota): Added support for cert bundle in advanced OTA

See merge request espressif/esp-idf!39219
2025-05-29 13:57:00 +08:00
e05390f338 Merge branch 'update/update_certs_bundle' into 'master'
Update esp_crt_bundle certificates

See merge request espressif/esp-idf!39302
2025-05-29 11:12:38 +05:30
a7388ddc6c fix(hal): make CLIC interrupt routing function to only write related bits 2025-05-29 12:29:40 +08:00
16d25b4a52 feat(gdma): support gdma weighted arbitration on ESP32C5 2025-05-29 11:41:02 +08:00
99121258d4 fix(ble/bluedroid): Fixed BLE SMP state machine inconsistency on disconnection 2025-05-29 10:50:50 +08:00
8806db34a3 feat(zigbee): optimize the path of zcl_utility 2025-05-29 10:36:45 +08:00
de9a367f13 feat(ble/bluedroid): Include SMP state in BLE status reporting 2025-05-29 10:36:26 +08:00
bb41e4163b Merge branch 'fix/ble_mesh_micellaneous_update' into 'master'
feat(ble_mesh): Fix/ble mesh micellaneous update

Closes BLERP-1894

See merge request espressif/esp-idf!39466
2025-05-29 10:35:46 +08:00
ccda40d8f2 Merge branch 'feat/ble_mesh_unify_tinycrypto' into 'master'
feat(ble_mesh): unify tinycrypto component

Closes BLERP-1934

See merge request espressif/esp-idf!39491
2025-05-29 10:35:41 +08:00
1b5758a25e Merge branch 'bugfix/fix_esp32c5_ble_tx_error_after_deep_sleep' into 'master'
fix(phy): update phy lib on ESP32-C5

See merge request espressif/esp-idf!39170
2025-05-29 10:29:16 +08:00
fb6693c7a0 Merge branch 'fix/incorrect_setting_of_sco_packet_type_mask' into 'master'
fix(bt): fixed incorrect mask was used to exclude sco packets

Closes CBI-1403

See merge request espressif/esp-idf!39396
2025-05-29 08:01:20 +08:00
79d69bc7e1 Merge branch 'fix/usb_host_test_with_multiple_hubs' into 'master'
fix(ext_hub): Added processing waiting_release flag while dev changed to IDLE

See merge request espressif/esp-idf!39322
2025-05-29 05:05:21 +08:00
65642866bc change(mbedtls/esp_crt_bundle): Remove deprecated certs for the major release version (v6.0) 2025-05-28 23:16:47 +05:30
e6d92ab49c change(mbedtls/crt_bundle): Update esp_crt_bundle certificates 2025-05-28 23:16:47 +05:30
17338659b9 fix(nimble): Added CI files for various configurations 2025-05-28 21:51:23 +05:30
30758d9beb feat(esp_http_client): Event to signal last header download
When parsing ND-JSON streams, this is needed to indicate the
point when the ND-JSON stream is considered open, which
occurs just after the last HTTP_EVENT_ON_HEADER.

ND-JSON stream clients cannot rely on the first HTTP_EVENT_ON_DATA,
since that is only triggered by an event, which are optional and
may never be sent, or only sent well after the last HTTP_EVENT_ON_HEADER.

Closes #15952
2025-05-28 08:50:28 -05:00
4c11e81fd9 feat(driver_spi): support gpio reserved check 2025-05-28 19:29:46 +08:00
a8ed0133ca feat(bt/bluedroid): Add events to indicate the initialization states of AVRCP 2025-05-28 11:24:32 +00:00
5f743900e7 feat(ble_mesh): unify tinycrypto component 2025-05-28 17:35:37 +08:00
449abbab76 fix(cam): fix dvp can not get cam_buffer 2025-05-28 17:29:38 +08:00
80a5ec8e78 feat(iperf): Add minimum IRAM test config 2025-05-28 10:39:36 +02:00
40844075c3 Merge branch 'revert/enable_sysview_tests' into 'master'
Revert "ci: enable sysview example tests for all chips"

See merge request espressif/esp-idf!39487
2025-05-28 16:17:29 +08:00
619996f74a Merge branch 'bugfix/fix_tls1_3_server_failing_handshake' into 'master'
fix(mbedtls): Fix failing handshake when running HTTPS Server with TLS1.3

Closes IDFGH-15325 and IDF-13113

See merge request espressif/esp-idf!39318
2025-05-28 13:16:49 +05:30
5f582fdc28 fix(cam): decrease i2c sccb frequency for camera 2025-05-28 15:17:30 +08:00
951bc53a03 fix(sysview): fixed spelling mistake in comment 2025-05-28 08:46:26 +02:00
eb76e6341d Merge branch 'feature/h4_core_support' into 'master'
feat(core): bringup dual-core for H4

Closes IDF-12317, IDF-12319, IDF-12484, IDF-12311, and IDF-12293

See merge request espressif/esp-idf!39279
2025-05-28 14:42:58 +08:00
f764953df3 Revert "ci: enable sysview examples for all chips"
This reverts commit c9cf11cd1c.
2025-05-28 08:38:08 +02:00
24d2720793 Revert "ci: OpenOCD class as fixture"
This reverts commit 0eb74ffcc3.
2025-05-28 08:38:08 +02:00
4c3b989ce5 Revert "ci: use shared OpenOCD class for GDB test app"
This reverts commit 60e64d2464.
2025-05-28 08:38:06 +02:00
09f077969c Revert "feat(tools): add esp32c3 rev1.1 rom version string"
This reverts commit fb2565815e.
2025-05-28 08:38:03 +02:00
d8f4388926 Merge branch 'feat/enable_hardware_deterministic_mode_for_esp32h21' into 'master'
feat(hal): enabled hardware deterministic loop feature in ESP32H21

See merge request espressif/esp-idf!39464
2025-05-28 14:23:39 +08:00
94143f2f18 Merge branch 'contrib/github_pr_16025' into 'master'
Update COMPATIBILITY.md - Updated links to documents. (GitHub PR)

Closes IDFGH-15368

See merge request espressif/esp-idf!39479
2025-05-28 14:08:30 +08:00
2a861eadfb Merge branch 'feat/support_c5_esp_perip_clk_init' into 'master'
feat: optimize esp32c5 active power consumption

Closes IDF-8844

See merge request espressif/esp-idf!36414
2025-05-28 13:17:25 +08:00
00038bd6f3 Merge branch 'fix/temp_disable_win_cli_installer' into 'master'
fix(test): Temporarily disable test_cli_installer_win

See merge request espressif/esp-idf!39458
2025-05-28 11:53:02 +07:00
bb9fbc040e Merge branch 'feat/c61_eco3_soc_update' into 'master'
feat(soc): c61 eco3 rom and soc header update

See merge request espressif/esp-idf!39166
2025-05-28 12:19:26 +08:00
e0c43e6e7c Merge branch 'ci/enable_sysview_tests' into 'master'
ci: enable sysview example tests for all chips

Closes IDFCI-807, IDFCI-808, and IDF-13000

See merge request espressif/esp-idf!39153
2025-05-28 03:19:41 +08:00
ef58299d06 Merge branch 'doc/improve_part_table_doc' into 'master'
feat(partition_table): Improves documentation for partition table

See merge request espressif/esp-idf!39368
2025-05-27 22:27:39 +08:00
65b7e70564 feat(driver): support acquire/release clock source dependency for all drivers 2025-05-27 21:21:38 +08:00
b90c12c30f fix(esp_netif): Fix incorrect DHCP call for PPP interfaces
Closes https://github.com/espressif/esp-protocols/issues/800
2025-05-27 20:07:34 +08:00
ffdd4d6c7b feat(ble_mesh): update lib to bbb57d10f9 2025-05-27 20:04:48 +08:00
113f40a3e0 feat(esp_hw_support): support gate PLL div clock source by reference count 2025-05-27 19:55:23 +08:00
34f249a28b feat(esp_hw_support): support esp_perip_clk_init for esp32c5 2025-05-27 19:55:22 +08:00
904d9526d3 Merge branch 'feat/change_mcpwm_prescale' into 'master'
change(mcpwm): change default mcpwm group prescale

Closes IDFGH-13989 and IDF-12790

See merge request espressif/esp-idf!34897
2025-05-27 19:27:43 +08:00
643e6ffdf1 feat(ble_mesh): Change the type of rpl size from uint8 to uint16 2025-05-27 17:31:42 +08:00
c17baef38d feat(test): Lower the scope when win tests are automatically executed
Introduced new rule "atterns-build_system_win", that coveres scope
for windows test. It currently contains only "tools/test_build_system/**/*".
2025-05-27 11:24:58 +02:00
7926ffd13f feat(hal): enabled hardware deterministic mode in ESP32H21 2025-05-27 14:54:13 +05:30
94994f7ad3 fix(test): Temporarily disable test_cli_installer_win 2025-05-27 11:13:04 +02:00
456ae964a1 Merge branch 'refactor/remove_i2c_slave_v1' into 'master'
refactor(i2c): Remove i2c slave v1 driver

See merge request espressif/esp-idf!39329
2025-05-27 15:28:43 +08:00
b3560860dd Merge branch 'bugfix/supplicant_analyzer_fixes' into 'master'
Bugfix/supplicant analyzer fixes

Closes WIFIBUG-1218 and IDF-13129

See merge request espressif/esp-idf!39300
2025-05-27 15:07:30 +08:00
77e18528cd feat(mcpwm): change default mcpwm group prescale to 1
Closes https://github.com/espressif/esp-idf/issues/14815
2025-05-27 14:48:14 +08:00
e89dc281e9 test(mcpwm): add multi input banding to the same pin test
Closes https://github.com/espressif/esp-idf/issues/14958
2025-05-27 14:48:14 +08:00
45a9a31a7e Merge branch 'fix/wss_server_larger_partition' into 'master'
wss_server: use large partition table config

See merge request espressif/esp-idf!39430
2025-05-27 14:47:25 +08:00
c91a897697 Merge branch 'bugfix/fix_send_delete_link_key_cmd_1' into 'master'
Bugfix/fix send delete link key cmd 1

Closes BLERP-1735

See merge request espressif/esp-idf!39424
2025-05-27 14:41:59 +08:00
b4846b8f26 Merge branch 'fix/printf_va_list_cross_function_pass' into 'master'
fix(ble): fixed spi ble log bugs

Closes BLERP-1920, BLERP-1923, BLERP-1926, and BLERP-1928

See merge request espressif/esp-idf!39384
2025-05-27 14:21:01 +08:00
2c5530528c fix(advanced_ota): Added support for cert bundle in advanced OTA
1. Added support for cert bundle in advanced OTA
2. This allows to easily test example with different public servers
2025-05-27 10:53:19 +05:30
7e554894ce Merge branch 'change/sync_trm_csv_update_5_23' into 'master'
change(csv_update): sync the csv update to idf

See merge request espressif/esp-idf!39386
2025-05-27 12:45:14 +08:00
1d9e0ceab7 wss_server: use large partition table config 2025-05-27 12:01:57 +08:00
1f37a8da9a refactor(i2c): Remove i2c slave v1 driver 2025-05-27 11:22:20 +08:00
2b81deaca8 Merge branch 'change/psram_2t_check_only_on_ap' into 'master'
psram: limited 2t check only for ap

See merge request espressif/esp-idf!39411
2025-05-27 03:10:24 +00:00
463135fded docs: Update CN translation for partition-tables.rst 2025-05-27 11:02:18 +08:00
0a93309a89 change(cache): update cache soc headers of c61 2025-05-27 10:31:30 +08:00
78a2e2cb2f change(apm): update apm soc headers of c5 2025-05-27 10:31:30 +08:00
10aef84983 change(etm): update etm soc headers of h21 2025-05-27 10:31:30 +08:00
fb2565815e feat(tools): add esp32c3 rev1.1 rom version string 2025-05-27 04:48:18 +08:00
60e64d2464 ci: use shared OpenOCD class for GDB test app 2025-05-27 04:48:18 +08:00
0eb74ffcc3 ci: OpenOCD class as fixture 2025-05-27 04:48:18 +08:00
c9cf11cd1c ci: enable sysview examples for all chips 2025-05-27 04:48:18 +08:00
aebdb81aa6 Merge branch 'change/exclude_cve-2023-53154' into 'master'
change: adds CVE-2023-53154 to cJSON sbom exclude list

See merge request espressif/esp-idf!39395
2025-05-26 22:03:50 +05:30
e527554144 feat(core): bringup dual-core for H4 2025-05-26 17:11:12 +02:00
b9d7771a14 fix(docs/idf-size): update idf.py size summary output
The total flash size is no longer reported by esp-idf-size. Update the
output example in the documentation to reflect this change. Also,
include the note about total memory sizes as now printed by
esp-idf-size.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-05-26 23:04:10 +08:00
21391a45fd fix(ble/bluedroid): Fixed clear BLE device recored 2025-05-26 20:21:35 +08:00
03e6dda224 Merge branch 'bugfix/fix_some_wifi_bugs_ralated_max_bss_idle' into 'master'
fix(bss_max_idle): fix some wifi bugs related to bss max idle

Closes WIFIBUG-1193, WIFIBUG-1194, and PM-411

See merge request espressif/esp-idf!39288
2025-05-26 19:48:24 +08:00
6d502b710c Merge branch 'bugfix/fix_lcd_ll_macro_safety' into 'master'
fix(hal): Wrap LL macros with atomic env in do-while for control safety

Closes IDF-11981

See merge request espressif/esp-idf!39202
2025-05-26 19:06:11 +08:00
4d59537d5f Merge branch 'update/update_cmn_crt_authorities_csv' into 'master'
Update common cert authorities csv

See merge request espressif/esp-idf!39223
2025-05-26 14:55:42 +05:30
c275b5e55b fix(ci): Fix the latest tag to master's v6.0-dev
This is used only for caching (pip packages and submodules), so not very
important.
Probably forgotten when merging !38889 (f89d6ee5a0)
2025-05-26 11:22:53 +02:00
dbb846c348 fix(mbedtls): Fixes failing TLS 1.3 server handshake
Closes https://github.com/espressif/esp-idf/issues/15984
2025-05-26 17:16:21 +08:00
412b79ed1c change(psram): limited 2t check only for ap 2025-05-26 17:06:03 +08:00
a74725a31b Merge branch 'feat/lwip/ipv6_dup_detect_tries' into 'master'
feat(lwip/config): add menuconfig option for setting LWIP_IPV6_DUP_DETECT_ATTEMPTS

Closes IDFGH-9320

See merge request espressif/esp-idf!39080
2025-05-26 17:00:47 +08:00
f7fedf3fb8 fix(bt): fixed incorrect mask was used to exclude sco packets 2025-05-26 16:49:06 +08:00
f2ac9185aa Merge branch 'ci/update-commitlinter' into 'master'
Update conventional precommit linter to v1.10.0

Closes RDT-1312

See merge request espressif/esp-idf!39222
2025-05-26 10:32:37 +02:00
6fde8cf8d2 ci(esp32c61): disable soc_caps, docs, test for eco3 update 2025-05-26 16:04:23 +08:00
783ea76212 feat(soc): c61 eco3 soc header update 2025-05-26 16:04:18 +08:00
e08ed84287 change(mbedtls/crt_bundle): Update esp_cmn_crt_bundle certificates 2025-05-26 13:19:57 +05:30
fe40cc8f8b Merge branch 'fix/suppress_cert_bundle_serial_number_warning' into 'master'
fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning

Closes IDFCI-2945

See merge request espressif/esp-idf!39381
2025-05-26 13:19:00 +05:30
3ce7470434 change(ble): make falling edge when disabling ts sync 2025-05-26 15:33:47 +08:00
bd87b7cf57 feat(openthread): add a function to exit openthread main loop safely 2025-05-26 15:21:31 +08:00
79c0c7a3db Merge branch 'feature/enable_stub_for_c5_eco2' into 'master'
feat(esp32c5): enable stub for esp32c5 eco2

See merge request espressif/esp-idf!39207
2025-05-26 15:10:09 +08:00
9466411cd6 Merge branch 'ci/test_i2s_with_psram_config' into 'master'
ci: test ana_cmpr, dac, i2s, touch with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0

Closes IDF-13027, IDF-13028, IDF-13032, and IDF-13044

See merge request espressif/esp-idf!39005
2025-05-26 14:47:29 +08:00
18a468b0d5 fix(bss_max_idle): fix some wifi bugs related to bss max idle 2025-05-26 14:26:19 +08:00
d8d8e91a80 Merge branch 'fix/all_crypto_periphs_reset_cause_sec_reset' into 'master'
fix(system_internal): Avoid the sec clock reset caused due to resetting all crypto peripherals

Closes IDF-13064, IDFCI-2878, and IDFCI-2877

See merge request espressif/esp-idf!39357
2025-05-26 11:40:06 +05:30
1fa420ef2f Merge branch 'refactor/remove_io_loop_back' into 'master'
refactor(drivers)!: remove unnecessary io_loop_back config option

Closes IDF-11274

See merge request espressif/esp-idf!39062
2025-05-26 14:09:28 +08:00
a2cf361c5a ci: test i2s, touch, ana_cmpr with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 2025-05-26 13:09:45 +08:00
7d086d6a8d fix(ana_cmpr): fixed FUNC_IN_IRAM option involves flash data 2025-05-26 13:09:45 +08:00
16cc8f974d ci: test i2s, touch, ana_cmpr with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 2025-05-26 13:09:45 +08:00
0359404330 feat(esp32c5): enable stub for esp32c5 eco2 2025-05-26 13:08:46 +08:00
c6bc55f91e Merge branch 'docs/update_getting_started_page_c5' into 'master'
docs: update get-started documents for ESP32-C5

See merge request espressif/esp-idf!38992
2025-05-26 13:06:22 +08:00
a93d61b756 docs: update get-started documents for ESP32-C5 2025-05-26 13:06:21 +08:00
c36f55c451 feat(esp_rom): update rom files for eco3 2025-05-26 11:39:26 +08:00
b8c1c2b616 fix(ble): fixed spi log init failure return value for ESP32 2025-05-26 10:46:19 +08:00
87feca0350 change: adds CVE-2023-53154 to cJSON sbom exclude list 2025-05-26 10:27:54 +08:00
bf24bcd836 Update COMPATIBILITY.md
Updated links to documents.
2025-05-25 09:02:23 +01:00
a952037d82 Merge branch 'ci/fix-custom-oocd-setting' into 'master'
ci: select OpenOCD binary based on runner

See merge request espressif/esp-idf!39375
2025-05-23 22:47:50 +08:00
f582bd9ed0 fix(ble): fixed ts sync sleep support trigger 2025-05-23 19:11:50 +08:00
49c373e2e8 Merge branch 'feature/update_wifi_cmd_version' into 'master'
update: update wifi-cmd of iperf example

See merge request espressif/esp-idf!38923
2025-05-23 19:06:32 +08:00
bf8a3c3e51 Merge branch 'fix/temp_allow_fail_cli_installer_win' into 'master'
fix(test): Temporarily allow test_cli_installer_win to fail

See merge request espressif/esp-idf!39112
2025-05-23 12:41:31 +02:00
f6b8ad87fa feat(docs): initial migration guide for idf 6.x 2025-05-23 18:10:01 +08:00
c63f51dcb3 refactor(drivers)!: remove unnecessary io_loop_back and pull up/down config option 2025-05-23 18:09:53 +08:00
8afb0fb9e6 Merge branch 'fix/drop_pm_code_if_not_need' into 'master'
fix(drivers): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled

Closes IDFGH-15263

See merge request espressif/esp-idf!39045
2025-05-23 16:15:29 +08:00
9d0d1d2614 Merge branch 'contrib/github_pr_15930' into 'master'
docs(esp32): Add note about including esp_check.h for error-handling.rst docs page in English (GitHub PR)

Closes IDFGH-15271 and DOC-11245

See merge request espressif/esp-idf!39012
2025-05-23 16:13:48 +08:00
fa7c9b63b1 Merge branch 'feature/enable_support_for_deterministic_mode_and_ecdsa_192' into 'master'
enable support for deterministic mode and ecdsa 192 in ESP32H2

Closes IDF-12011, IDF-13065, and DOC-11194

See merge request espressif/esp-idf!39103
2025-05-23 15:19:08 +08:00
8184004a4e fix(ble): fixed printf va list cross function pass failure 2025-05-23 12:32:26 +08:00
561c7c4884 Merge branch 'fix/flash_log_clearer' into 'master'
fix(spi_flash): Make GD chip to be linked as default, also optimization the log information

See merge request espressif/esp-idf!39165
2025-05-23 12:16:54 +08:00
5ae42e6f0b fix(mbedtls/esp_crt_bundle): Suppress non-negative serial number warning
Co-authored-by: Mahavir Jain <mahavir.jain@espressif.com>
2025-05-23 09:28:42 +05:30
e9d7adf697 Merge branch 'test/re_enable_c5_80m_psram_tests' into 'master'
psram: re-enable 80M psram tests on C5 ECO2

See merge request espressif/esp-idf!39347
2025-05-23 02:58:45 +00:00
e80293fdbe ci: select OpenOCD binary based on runner 2025-05-22 20:43:39 +02:00
8925459572 Merge branch 'docs/filesystem_considerations_readonly_nvs' into 'master'
docs: Added a mention of read-only NVS in filesystem considerations document

Closes IDF-12520

See merge request espressif/esp-idf!38887
2025-05-22 20:31:52 +02:00
e0be50d9b5 docs: Added a mention of read-only NVS in filesystem considerations document 2025-05-22 19:18:01 +02:00
909fd09ffa feat(partition_table): Improves documentation for partition table 2025-05-22 16:09:08 +03:00
6897f90612 Merge branch 'feat/reduce_bin_size_and_iram_for_ble_rom_code' into 'master'
feat(ble/controller): Reduce bin size and IRAM for BLE rom code on ESP32-C3 and ESP32-S3

Closes BLERP-1855

See merge request espressif/esp-idf!38987
2025-05-22 20:20:22 +08:00
d55709fdae Merge branch 'bugfix/coverity_fix' into 'master'
fix(nimble): Add changes for coverity reported issue

See merge request espressif/esp-idf!39292
2025-05-22 16:27:21 +05:30
e08189f37b fix(system_internal): Avoid the sec clock reset caused due to resetting all crypto peripherals 2025-05-22 16:01:02 +05:30
ff408c31c7 docs: Update CN translation for error-handling.rst 2025-05-22 17:39:27 +08:00
91f92b0e57 fix(glithc_filter): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
90050df641 fix(jpeg): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
8555b6c837 fix(adc): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
6674470e89 fix(ana_cmpr): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
fe1091c2ff fix(lcd): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
5599fd4b1f fix(sdm): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
70e5042ea9 fix(parlio): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:38:58 +08:00
a1c6d2a458 fix(esp_tee): Fix failing SPI1 flash protection test-cases 2025-05-22 17:35:09 +08:00
0f1dbcc6a5 fix(spi_flash): Make GD chip to be linked as default, also optimization the log information 2025-05-22 17:35:09 +08:00
a21f7c78f9 fix(sdmmc): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
4bfd180a94 fix(i2c): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
6397820d0b fix(rmt): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
c8371ca405 fix(mcpwm): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
91d1812315 fix(uhci): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
9837138659 fix(gptimer): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
9e5ed3bdd2 fix(twai): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled 2025-05-22 17:27:18 +08:00
57420057b6 fix(pcnt): only call esp_pm APIs when CONFIG_PM_ENABLE is enabled
Closes https://github.com/espressif/esp-idf/issues/15923
2025-05-22 17:27:18 +08:00
522e9a1bb9 docs: Update CN translation for ecdsa.rst 2025-05-22 14:55:15 +05:30
148d31b659 feat: enable support for deterministic mode for esp32h2 2025-05-22 14:55:15 +05:30
0fb8c2a9b8 feat: enabled ECDSA-P192 support for ESP32H2 2025-05-22 14:55:03 +05:30
d86c2bde3e Merge branch 'ci/c61_disable_test_for_eco3' into 'master'
fix(ci): disable target test for c61 eco3 update

See merge request espressif/esp-idf!39349
2025-05-22 17:05:45 +08:00
5783a22d84 Merge branch 'update_mqtt_pre_refactor' into 'master'
Update esp-mqtt submodule to 6af4446a

Closes IDFGH-11179, IDFGH-14022, IDFGH-14489, and IDFGH-14616

See merge request espressif/esp-idf!38893
2025-05-22 16:59:13 +08:00
13904408af Merge branch 'feature/c61_ldo_dbias_read_from_efuse' into 'master'
feat(C61): support ldo dbias and ocode read from efuse for chip762

See merge request espressif/esp-idf!39215
2025-05-22 16:55:01 +08:00
a42929a75f Merge branch 'fix/fix_esp_timer_accuracy_when_do_dfs' into 'master'
fix(esp_hw_support): improve esp timer accuracy on DFS for esp32 & esp32s2

Closes PM-405, WIFI-4986, and WIFI-5942

See merge request espressif/esp-idf!39217
2025-05-22 16:38:10 +08:00
d877949357 Merge branch 'feat/ble_log_spi_out_dev_phase_3' into 'master'
Feat/ble log spi out dev phase 3

See merge request espressif/esp-idf!39291
2025-05-22 16:26:39 +08:00
994f2c2b68 fix(ci): disable target test for c61 eco3 update 2025-05-22 15:17:32 +08:00
9b77416b60 Merge branch 'fix/jpeg_encode_msync' into 'master'
fix(jpeg): Fix wrong parameter in jpeg encoder msync

See merge request espressif/esp-idf!39321
2025-05-22 15:15:42 +08:00
2f8cd616cc test(psram): re-enable 80M psram tests on C5 ECO2 2025-05-22 14:52:40 +08:00
1d12eb4124 Merge branch 'feat/add-ws-get-response-headers' into 'master'
feat(tcp_transport): Add ws get HTTP response headers

Closes IDFGH-14252

See merge request espressif/esp-idf!38212
2025-05-22 14:49:49 +08:00
18091976ec fix(hal): Wrap LL macros with atomic env in do-while for control safety
- Standardize all LL macros using atomic env variables with `do { ... } while (0)`
- Prevent potential macro misuse in control flow constructs (e.g., if/else)
- Affected targets: esp32, esp32c2, esp32c5, esp32s3, esp32p4, etc.
- Affected modules include: LCD, I2S, TIMER, and others
2025-05-22 14:42:11 +08:00
dadcc7b9f3 Merge branch 'feat/c5_eco2_psram_timing_tuning' into 'master'
mspi: psram 80M timing tuning on C5 ECO2

Closes IDF-13003

See merge request espressif/esp-idf!39232
2025-05-22 06:41:56 +00:00
5133b89183 Merge branch 'test/reenable_sdspi_c5_test' into 'master'
sdspi: re-enable sdspi test on c5 eco2

See merge request espressif/esp-idf!39330
2025-05-22 06:27:28 +00:00
9a3018e201 test(sdspi): re-enable sdspi test on c5 eco2 2025-05-22 14:01:51 +08:00
481f42ac9d test(esp_timer): add UT case for esp_timer period alarm with DFS 2025-05-22 13:58:54 +08:00
11f32b88ac feat(esp_hw_support): compensate the error introduced to LACT during APB frequency switching 2025-05-22 13:58:54 +08:00
022614b1d3 fix(esp_hw_support): update systimer step immediately when XTAL changes on esp32s2 2025-05-22 13:58:54 +08:00
2931aa23b6 fix(esp_hw_support): update LACT clock prescale immediately when APB changes on esp32 2025-05-22 13:58:50 +08:00
7b54ca004f Merge branch 'ci/dynamic-pipeline-report-adjustments' into 'master'
ci: dynamic pypiline report adjustments

Closes IDFCI-1939 and IDFCI-2436

See merge request espressif/esp-idf!38460
2025-05-22 13:43:17 +08:00
c25f87920a ci: improve the dynamic pipeline report 2025-05-22 13:25:39 +08:00
7d5f89fa90 fix(ci): fixed psram tests not running on c5 issue 2025-05-22 10:27:19 +08:00
00e3f4885a feat(mspi): supported psram 80MHz timing tuning 2025-05-22 10:27:19 +08:00
1d71a9e811 feat(tcp_transport): Add ws get HTTP response headers 2025-05-21 16:34:10 +02:00
412e7c48ee change(mqtt): Adds retry on publish connect test case
This test case fails mostly for network related issues, with retrys we
might avoid the failure of the whole job.
2025-05-21 22:32:32 +08:00
eb9614d37f change(mqtt): Update submodule to 6af4446a
git log --oneline cac1552e..6af4446a

Detailed description of the changes:
* Multiple event data
  - See merge request espressif/esp-mqtt!240
  - fix: Multiple event data (espressif/esp-mqtt@9c76b70)
* Updated the idf version check for ECDSA support
  - See merge request espressif/esp-mqtt!239
  - fix(mqtt): Updated the idf version check for ECDSA support (espressif/esp-mqtt@7d9a384)
* Added the support for the ECDSA signing
  - See merge request espressif/esp-mqtt!238
  - feat(mqtt): Add support for ECDSA signing (espressif/esp-mqtt@b35a691)
* fix: pubrel message resending when pubcomp not received
  - See merge request espressif/esp-mqtt!236
  - See commit https://github.com/espressif/esp-mqtt/commit/f38a5fc
* Change error message to fix warning.
  - fix: Change error message to fix warning. (espressif/esp-mqtt@c395c2f)
* Small cleanu
  - See merge request espressif/esp-mqtt!231
  - fix: Adds all IDF versions under support (espressif/esp-mqtt@bb85b20)
  - fix: Update badges url to reflect current status (espressif/esp-mqtt@263c167)
* feat(mqtt5): Add parsing of DISCONNECT packet to mqtt5 client
  - mqtt_client: Manage disconnect packet (espressif/esp-mqtt@470cb93)
* feat(mqtt5): Reduce log verbosity for MQTT ACK
  - Reduce log verbosity for MQTT v5 ACKs (espressif/esp-mqtt@6b7b9c3)
* PR: workflows: fix update actions to v4
  - workflows: fix update actions to v4 (espressif/esp-mqtt@06b8923)
* When MQTT_REPORT_DELETED_MESSAGES, delete QOS messages with id 0
  - doc: Clarify deleted message event to cover QoS=0 case (espressif/esp-mqtt@ea036a5)
  - See commit https://github.com/espressif/esp-mqtt/commit/b82c8f6
* fix: Race condition when using destroy
  - See merge request espressif/esp-mqtt!223
  - See commit https://github.com/espressif/esp-mqtt/commit/44292cc
* feat: Add TCP keepalive configuration
  - See commit https://github.com/espressif/esp-mqtt/commit/7c3227a
* feat: Include message topic in all chunks
  - feat: Include message topic in all data events for big messages. (espressif/esp-mqtt@82017e9)
* fix: set TCP transport every time when setting the config
  - See merge request espressif/esp-mqtt!218
  - See commit https://github.com/espressif/esp-mqtt/commit/c3c4cb9
* feat: Allow users to get the transport in use
  - See merge request espressif/esp-mqtt!216
  - See commit https://github.com/espressif/esp-mqtt/commit/97dc85a
* clean: Remove expired deletion from publish
  - See merge request espressif/esp-mqtt!217
  - See commit https://github.com/espressif/esp-mqtt/commit/2285726
2025-05-21 22:32:32 +08:00
574f037b1e Merge branch 'fix/usb-log-priu32-fifo-config' into 'master'
fix(usb/hcd): Use PRIu32 in FIFO config log for portability

See merge request espressif/esp-idf!39299
2025-05-21 20:00:27 +08:00
11382a2aae fix(ext_hub): Added processing waiting_release flag while dev changed to IDLE 2025-05-21 12:13:47 +02:00
5981ae8a11 feat(pmu): support ldo dbias and ocode read from efuse for chip762 2025-05-21 18:05:05 +08:00
bfc69338c8 fix(jpeg): Fix wrong parameter in jpeg encoder msync 2025-05-21 17:54:44 +08:00
602941ef61 Merge branch 'refactor/usb_host_ext_hub_port_gone' into 'master'
refactor(ext_hub): Device release (allows to run usb_host test with ext hub)

Closes IDF-12173, IDF-10490, and IDF-13132

See merge request espressif/esp-idf!38176
2025-05-21 17:34:48 +08:00
884e54a8dd Merge branch 'feature/efuse_esp32c61_eco3_update' into 'master'
feat(efuse): Adds efuses for ESP32-C61 ECO3

See merge request espressif/esp-idf!39146
2025-05-21 17:11:33 +08:00
b1b99b30ef Merge branch 'fix/i2c_gpio_rsv' into 'master'
fix(i2c): Add gpio reserve check on i2c driver

Closes IDF-9098

See merge request espressif/esp-idf!39310
2025-05-21 16:49:04 +08:00
a3318d6280 fix(test): Temporarily allow test_cli_installer_win to fail 2025-05-21 16:12:35 +08:00
f229a84578 Merge branch 'contrib/github_pr_15968' into 'master'
docs(esp_http_client): update return codes for open & perform (GitHub PR)

See merge request espressif/esp-idf!39239
2025-05-21 13:23:05 +05:30
4b6b9c0ec8 Merge branch 'fix/config_param_gtk_rekeying' into 'master'
Add config param for gtk rekeying on softAP side

Closes WIFI-4897

See merge request espressif/esp-idf!38383
2025-05-21 15:52:44 +08:00
fc69f691ba Merge branch 'fix/enable_remove_requirements_file' into 'master'
fix(tools): handle missing `requirements.*.txt` files for enabled features

Closes IDF-12849

See merge request espressif/esp-idf!39218
2025-05-21 09:38:04 +02:00
8ab564a711 Merge branch 'feat/add_xmc_32bit_support' into 'master'
feat(spi_flash): Add XMC chip 32-bits address support

See merge request espressif/esp-idf!39161
2025-05-21 15:10:26 +08:00
be89fa36aa Merge branch 'feature/add_api_for_cleanup_otadata' into 'master'
feat(esp_ota_ops): Revised logic to always update non-running otadata at the time of setting ota boot partition

Closes IDFGH-13839

See merge request espressif/esp-idf!37928
2025-05-21 11:33:03 +05:30
996a9ca25f fix(app_update): Do not change ota_seq when partition is the same
Revised logic to always update non-running otadata at the time of setting ota boot partition

Closes https://github.com/espressif/esp-idf/issues/14688
2025-05-21 11:33:03 +05:30
88f66ae3aa Merge branch 'feature/esp_tee_h2' into 'master'
feat(esp_tee): Support for ESP32-H2

See merge request espressif/esp-idf!37708
2025-05-21 09:59:26 +05:30
ebd4caf360 Merge branch 'bugfix/handle_flow_control_flag' into 'master'
fix(nimble): Add chip dependancy flag for Flow control feature

See merge request espressif/esp-idf!39181
2025-05-21 09:53:03 +05:30
b8650708aa fix(nimble): Add changes for coverity reported issue 2025-05-21 09:50:23 +05:30
b164919f4b fix(i2c): Add gpio reserve check on i2c driver,
Closes https://github.com/espressif/esp-idf/issues/15995
2025-05-21 12:15:47 +08:00
17cd200c67 fix(esp_wifi): Fixed static analyzer issues 2025-05-21 09:26:40 +05:30
2ce481ffbd fix(esp_wifi): Disble IP renew skip by default 2025-05-21 09:00:09 +05:30
0631340e2c Merge branch 'feature/esp32h21_regi2c_support' into 'master'
feat(regi2c): add regi2c support for esp32h21

Closes IDF-11550 and IDF-11858

See merge request espressif/esp-idf!37369
2025-05-21 11:22:07 +08:00
1e6bc70837 fix(ble): fixed upper layer trans append failure bug 2025-05-21 11:06:12 +08:00
6ead06c6d5 feat(spi_flash): Add XMC chip 32-bits address support 2025-05-21 10:50:04 +08:00
1d739291ca feat(ble/controller): Reduce bin size and IRAM for BLE rom code 2025-05-21 10:22:37 +08:00
27d68f57e6 Merge branch 'fix/driver_issue_by_coverity' into 'master'
Fix some false issue report by coverity

Closes IDF-13116, IDF-13120, IDF-13104, IDF-13106, IDF-13107, IDF-13109, IDF-13112, IDF-13124, and IDF-13126

See merge request espressif/esp-idf!39287
2025-05-21 10:05:28 +08:00
6a57d5fa61 Merge branch 'feat/min_size_builds' into 'master'
fix(nimble): Add support for minimilistic builds

Closes BLERP-1848 and BCI-431

See merge request espressif/esp-idf!38515
2025-05-20 21:03:49 +05:30
dcdeeeff45 fix(usb/hcd): Use PRIu32 in FIFO config log for portability
The ESP_LOGD message that prints FIFO line sizes used %u for uint32_t,
which may cause incorrect output on some architectures (e.g., ESP32-P4
where uint32_t maps to unsigned long). To ensure portable and correct
logging across all supported platforms, this patch replaces %u with
%" PRIu32 ", defined in <inttypes.h>.

No functional behavior is affected — this is a formatting correction
for debug output only.
2025-05-20 16:27:27 +02:00
925b563278 Merge branch 'feat/gattc_gatts_coex' into 'master'
feat(nimble): Add new gattc + gatts coex example for nimble

Closes IDFGH-11642

See merge request espressif/esp-idf!37139
2025-05-20 19:49:02 +05:30
e10460ce14 feat(ble): support ts sync for sleep app 2025-05-20 20:52:44 +08:00
b8e48fbfc0 ci(esp_tee): Enable the tee_test_fw test app for ESP32-H2 2025-05-20 16:31:23 +05:30
12e2df2d74 feat(esp_tee): Support for ESP32-H2 - the rest of the components 2025-05-20 16:31:23 +05:30
958f4b8900 feat(esp_tee): Support for ESP32-H2 - the esp_tee component 2025-05-20 16:31:22 +05:30
004abebdbd fix)wifi): Add GTK rekeying interval field in softap example 2025-05-20 15:33:54 +05:30
6d7593c1be fix(wifi) : Add config param for gtk rekeying on softAP side 2025-05-20 15:33:05 +05:30
f238d75ba3 refactor(ext_port): Remove the error verification, as error will be handled in ext hub driver 2025-05-20 11:34:53 +02:00
19ce9ed634 refactor(test_usb_host_async): Added host_lib_task finish notification 2025-05-20 11:34:53 +02:00
3003362bcb refactor(usb_host): Cancel hub porpagation to the user, rename non-critical func 2025-05-20 11:34:53 +02:00
3fd17b8be8 refactor(hub): Applied new ext_hub api, refactor func names 2025-05-20 11:34:53 +02:00
fc61875a56 refactor(ext_hub): Pospone the device release, if device is not IDLE 2025-05-20 11:34:53 +02:00
754d357f18 refactor(ext_hub): Fixed device release, optimized the order of closing usbh device 2025-05-20 11:34:53 +02:00
0dbce7210d Merge branch 'bugfix/nvs_idfgh_issue' into 'master'
feat(esp_wifi): Add example to write wifi config in nvs

Closes IDFGH-13678

See merge request espressif/esp-idf!36693
2025-05-20 17:16:44 +08:00
061c05c88c Merge branch 'contrib/github_pr_15967' into 'master'
fix(tcp_transport): Silence recoverable read failures (GitHub PR)

Closes IDFGH-15309

See merge request espressif/esp-idf!39259
2025-05-20 17:02:17 +08:00
30f98140bb Merge branch 'fix/slot0_requires_all_pins_in_1bit_mode_issue' into 'master'
sd: fixed all pins need to be set when using slot0 on esp32p4 issue

Closes IDF-12816

See merge request espressif/esp-idf!39197
2025-05-20 09:00:51 +00:00
ed09e97c66 feat(ble): support controller raw log print out 2025-05-20 16:54:49 +08:00
7af3bddbca fix(drivers): some false reports from coverity 2025-05-20 16:52:32 +08:00
d46019bf43 refactor(bitscrambler): don't use Reset Clock Control lock of RC version 2025-05-20 16:52:32 +08:00
9800d715a5 feat(ble): refactored loss report module and represent frame using struct 2025-05-20 16:22:52 +08:00
9c8c40369a update: update wifi-cmd of iperf example 2025-05-20 16:13:28 +08:00
43e2abac14 feat(docs): Improve error handling documentation
Merges https://github.com/espressif/esp-idf/pull/15930
2025-05-20 11:11:07 +03:00
cd3aa6527c feat(ble): support le audio log buffer separation 2025-05-20 16:09:25 +08:00
22f63191e6 Merge branch 'feat/support_different_pwr_glitch_dref_to_fit_eco_esp32c61' into 'master'
feat(power_glich): power glitch initial for esp32c5/esp32c61, only detect vddpst pwr_glitch, not support esp32c5_eco0 & eco32c61_eco0/1 no longer

See merge request espressif/esp-idf!35206
2025-05-20 16:06:57 +08:00
086555e0ed feat(efuse): Adds efuses for ESP32-C61 ECO3 2025-05-20 15:57:10 +08:00
0e85a78aa9 Merge branch 'feat/move_ocode_config_to_pmuinit_c6_c5_c61' into 'master'
refactor: move_ocode_to_pmu_init_c6_c5_c61

See merge request espressif/esp-idf!38957
2025-05-20 15:51:32 +08:00
8931a8a764 Merge branch 'fix/fix_esp32p4_stuck_in_pd_ana' into 'master'
fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep

Closes PM-389 and PM-391

See merge request espressif/esp-idf!38780
2025-05-20 15:50:45 +08:00
e4be25ba63 feat(ble): optimized printf functions code size and speed 2025-05-20 15:50:13 +08:00
70792443c7 feat(ble): refactored flush module and provided public flush api 2025-05-20 15:39:30 +08:00
bba90309e7 feat(ble): refactored ll isr buffer append and buffer flush using event handler 2025-05-20 15:16:37 +08:00
3568f19fef feat(ble): provided dynamic spi enable/disable api 2025-05-20 14:22:42 +08:00
16a3b2c71b feat(ble): support hci log buffer separation 2025-05-20 14:11:18 +08:00
1db79146e9 fix(pmu): fix deepsleep current too big bug for esp32c61 2025-05-20 14:06:15 +08:00
74c34669f0 feat(power_glich): support power_glitch of esp32c5_eco1 and above, eco32c61 eco2 and above 2025-05-20 14:06:15 +08:00
3f65227d39 feat(nimble): Add demo example for gattc and gatts coex for nimble 2025-05-20 11:27:02 +05:30
f8699785e9 feat(ble): optimized macros readability 2025-05-20 12:54:41 +08:00
24c46f1b89 refactor: move_ocode_to_pmu_init_c6_c5_c61 2025-05-20 11:08:35 +08:00
7bca1fe76f Merge branch 'fix/twai_psram' into 'master'
test(twai): with malloc comes from PSRAM by default

Closes IDF-13045

See merge request espressif/esp-idf!39246
2025-05-20 10:30:53 +08:00
abd5be52f1 Merge branch 'bugfix/fix_rx_bcn_failed_when_sta_off_channel' into 'master'
fix(wifi): rx bcn failed when sta off channel under modem state

Closes WIFIBUG-1179

See merge request espressif/esp-idf!39097
2025-05-20 10:23:27 +08:00
baab409af9 Merge branch 'fix/fix_iram_safe_code_inlined_to_flash_' into 'master'
fix(esp_hw_support): fix sleep iram safe code inlined to flash

Closes PM-412 and PM-413

See merge request espressif/esp-idf!39185
2025-05-20 09:58:44 +08:00
f931739352 Merge branch 'bugfix/roam_event_scan_failure' into 'master'
bugfix(wifi): Reset scan_ongoing flag in scan done event to allow scan trigger post roam

Closes WIFIBUG-1203

See merge request espressif/esp-idf!39163
2025-05-20 01:51:23 +08:00
39cbbab859 fix(tools): Enabled removing requirements.* files 2025-05-19 15:51:49 +02:00
8262915e28 refactor(regi2c): remove regi2c_defs.h from some targets 2025-05-19 21:46:40 +08:00
9ef152c220 feat(regi2c): add regi2c support for esp32h21 2025-05-19 21:46:40 +08:00
79d503f267 Merge branch 'fix/c5_iperf_size' into 'master'
iperf: increased app partition size in  example

See merge request espressif/esp-idf!39240
2025-05-19 21:29:47 +08:00
077ce905ed fix(esp_hw_support): fix sleep iram safe code inlined to flash 2025-05-19 21:02:24 +08:00
f7bc58e4ec Merge branch 'ci/fix_secure_tests_for_efuse_example' into 'master'
fix(examples): Fix CI tests for secure boot cases

Closes IDF-13077

See merge request espressif/esp-idf!39111
2025-05-19 20:59:00 +08:00
10ac8e622e fix(wifi): rx bcn failed when sta off channel under modem state 2025-05-19 20:08:58 +08:00
928b07b859 bugfix(wifi): Reset scan_ongoing flag in scan done event to allow scan trigger post roam 2025-05-19 15:59:55 +05:30
fbfa32c372 Merge branch 'feature/ftm_support_5ghz_esp32c5' into 'master'
feat(esp_wifi): Add FTM support for ESP32C5

Closes WIFI-6426, IDF-10612, and IDFGH-15244

See merge request espressif/esp-idf!33587
2025-05-19 17:34:19 +08:00
3d842bcee7 test(twai): with malloc comes from PSRAM by default 2025-05-19 17:12:39 +08:00
016e83671d Merge branch 'docs/sntp_example_thread' into 'master'
docs(sntp_example): Add Thread network setup instruction for sntp example

Closes IDFGH-14888

See merge request espressif/esp-idf!39121
2025-05-19 08:52:04 +00:00
f3147df360 Merge branch 'refactor/remove_i2c_slave_v1_s1' into 'master'
refactor(i2c): Replace i2c test from version one to version two

See merge request espressif/esp-idf!39085
2025-05-19 16:49:10 +08:00
a7e61220a1 Merge branch 'fix/lp_periph_use_int_raw' into 'master'
change(lp-core): Update LP I2C and LP UART drivers to use raw interrupt status

See merge request espressif/esp-idf!39008
2025-05-19 10:31:03 +02:00
747e3e0f31 feat(esp_wifi): Add unit test for writing wifi config in nvs
This commit adds a unit test for using wifi station and softap by flashing wifi config
directly into nvs using NVS Partition generator Utility (using csv file).
2025-05-19 13:53:45 +05:30
465d809845 docs: Update CLion documentation
Update CLion documentation page

docs: Update CLion documentation
2025-05-19 10:15:15 +03:00
a58ce394c4 fix(nimble): Add support for minimilistic builds 2025-05-19 12:44:34 +05:30
644e38fb7a Merge branch 'fix/gattc_proc_comparison' into 'master'
fix(nimble): Fix proc rx entry comparison

See merge request espressif/esp-idf!39113
2025-05-19 12:31:49 +05:30
bd5b0917fc Merge branch 'fix/ble_mesh_set_proxy_adv_param_failed' into 'master'
fix(ble_mesh): fixed the issue of incorrect proxy adv flag setting

Closes BLERP-1803

See merge request espressif/esp-idf!38654
2025-05-19 14:59:16 +08:00
660244e6ee refactor(i2c): Replace i2c test from version one to version two 2025-05-19 14:13:10 +08:00
98a0702ffc iperf: increased app partition size in example 2025-05-19 14:11:25 +08:00
1e516f0f84 Merge branch 'fix/bootloader_reserved_area_alignment' into 'master'
fix(esp_system): fix RTC reserved area alignment in the linker script

Closes IDFGH-12017

See merge request espressif/esp-idf!28821
2025-05-19 14:09:22 +08:00
f23bbb6cc7 Merge branch 'fix/c5_http_server_size' into 'master'
fix: increase the bin size of http example in the partition table

See merge request espressif/esp-idf!39204
2025-05-19 14:06:54 +08:00
9b1a80695c feat(esp_wifi): Add FTM support for ESP32C5 (ECO2)
Closes https://github.com/espressif/esp-idf/issues/15909
2025-05-19 10:31:16 +05:30
54e071a88c Merge branch 'feat/httpd_register_uri_handler_strdup_failure_case_check' into 'master'
Handling httdp_register_uri_handler() strdup function failure case check

Closes IDFGH-15208

See merge request espressif/esp-idf!38933
2025-05-19 10:23:25 +05:30
e178a09d19 Merge branch 'bugfix/fix_ble_scan_no_adv_report_when_connected' into 'master'
Fixed missing ADV reports after bonding and connection on ESP32-C3 and ESP32-S3

Closes BLERP-1874 and IDFGH-15110

See merge request espressif/esp-idf!38609
2025-05-19 11:55:28 +08:00
3cbe162bf0 refactor(mspi): change mspi timing tuning dirrectory structure 2025-05-19 11:50:43 +08:00
b452748eb5 Merge branch 'change/ble_update_lib_20250516' into 'master'
change(ble): [AUTO_MR] 20250516 - Update ESP BLE Controller Lib

Closes BLERP-1833, BLERP-1838, BLERP-1753, BLERP-1708, BLERP-1849, BLERP-1821, BLERP-1840, BLERP-1778, BLERP-1865, BLERP-1879, BLERP-1880, BLERP-1881, BLERP-1866, BLERP-1882, BLERP-1883, BLERP-1887, BLERP-1889, BLERP-1890, and BLERP-1892

See merge request espressif/esp-idf!39200
2025-05-19 11:50:40 +08:00
ad98c1d9a1 fix(sd): fixed menuconfig multi pin definitions issue 2025-05-19 11:16:18 +08:00
de2962dd77 https_server: use larger partition table in the example 2025-05-19 11:00:56 +08:00
f64b4d00b6 docs(sntp_example): Add Thread network setup instruction for sntp example
Closes https://github.com/espressif/esp-idf/issues/15605
2025-05-19 10:52:28 +08:00
892ba4cbf7 ci(pre-commit-hooks): update conventional precommit linter to v1.10.0
Closes https://github.com/espressif/esp-idf/issues/15969
Closes https://github.com/espressif/conventional-precommit-linter/issues/31
2025-05-17 17:15:45 +02:00
2cc28d90fb feat(docs): Add note about including esp_check.h for error-handling.rst docs page 2025-05-16 17:03:24 +03:00
a0f085d012 docs(esp_http_client): update return codes for open & perform
Extend the return code section to include async return values.
2025-05-16 08:55:08 -05:00
7f982fa09d fix(tcp_transport): Silence recoverable read failures
In some applications, ESP_TLS_ERR_SSL_WANT_READ and
ESP_TLS_ERR_SSL_TIMEOUT are common results which
need handled at the next layer. Downgrade these
to debug.
2025-05-16 08:37:19 -05:00
1637e27ae3 Merge branch 'docs/uhci_programming_guide' into 'master'
docs(uhci): Added implementation for uart-dma (uhci) programming guide

See merge request espressif/esp-idf!38663
2025-05-16 17:26:26 +08:00
093db55bf4 docs(uhci): implementation for uart-dma (uhci) docs 2025-05-16 15:14:51 +08:00
d12e072b35 fix(ble): added missed printf for ll log interface 2025-05-16 15:10:44 +08:00
zwl
9d687daf36 feat(ble): support creating connections during scanning process on ESP32-C5 2025-05-16 15:09:16 +08:00
eb81a853fb Merge branch 'fix/bin_log_config' into 'master'
fix(log): Fix bin log config available only for log version 2

See merge request espressif/esp-idf!39186
2025-05-16 15:03:06 +08:00
zwl
207d85a5f7 feat(ble): support creating connections during scanning process on ESP32-H2 2025-05-16 14:31:44 +08:00
zwl
cd6038b6cf fix(ble): fixed occasional assert issue in scan and connection scenarios on ESP32-C6 2025-05-16 14:22:25 +08:00
zwl
3cfd4d0166 change(ble): [AUTO_MR] Update lib_esp32c2 to 664e4255 2025-05-16 13:56:14 +08:00
zwl
69158d5064 change(ble): [AUTO_MR] Update lib_esp32c6 to 1304a9d0 2025-05-16 13:56:14 +08:00
zwl
27220c1b4c change(ble): [AUTO_MR] Update lib_esp32c5 to 1304a9d0 2025-05-16 13:56:14 +08:00
zwl
29f89efea6 change(ble): [AUTO_MR] Update lib_esp32h2 to 1304a9d0 2025-05-16 13:56:13 +08:00
244d4f8fa7 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(4713205)
- Fix: Missing ADV reports after bonding and connection
2025-05-16 11:55:52 +08:00
616dd97398 fix(sd): fixed slot0 requires all pins to be set when using 1bit iomux mode on p4 2025-05-16 11:10:58 +08:00
9c8ead5e03 Merge branch 'bugfix/periphint_typo' into 'master'
Fix typo in periph_inttrput_t type name

Closes IDF-12096

See merge request espressif/esp-idf!39179
2025-05-16 10:38:23 +08:00
b1999b5cb2 Merge branch 'feat/sd_host_ng' into 'master'
sd: driver NG for host layer, supported SDR104 (200 MHz) speed mode

Closes IDF-10545 and IDF-10547

See merge request espressif/esp-idf!37378
2025-05-16 10:05:27 +08:00
89adafa6af Merge branch 'feat/apptrace-crc16' into 'master'
Store CRC16 checksum value in the PERFMON1 reg

See merge request espressif/esp-idf!39020
2025-05-16 02:40:09 +08:00
184b993d41 Merge branch 'contrib/github_pr_15942' into 'master'
fix(esp_hw_support): Fix compile error on esp_cpu_int_has_handler on ESP32-P4 (GitHub PR)

Closes IDFGH-15283

See merge request espressif/esp-idf!39116
2025-05-15 22:54:19 +08:00
e9aa543a43 Merge branch 'contrib/github_pr_15917' into 'master'
feat(docs): Small additions to ulp-risc-v regarding the ULP I2C hardware limitation (GitHub PR)

Closes IDFGH-15254

See merge request espressif/esp-idf!39004
2025-05-15 22:30:17 +08:00
81cca78ca1 Merge branch 'feature/add_uart_io_deinit_process' into 'master'
fix(uart): eliminate garbled data on TX/RX line in sleep

Closes IDF-4897, IDF-13030, and IDF-13037

See merge request espressif/esp-idf!38673
2025-05-15 21:53:04 +08:00
5945ad1a63 Merge branch 'refactor/add_dfs_init_auto_test' into 'master'
fix(mcpwm): the wrong pm lock type on esp32 and esp32s3

See merge request espressif/esp-idf!38934
2025-05-15 21:51:59 +08:00
ec096b3823 fix(log): Fix bin log config available only for log version 2 2025-05-15 16:46:45 +03:00
9f69fe5033 fix(nimble): Add chip dependancy flag for Flow control feature 2025-05-15 16:30:22 +05:30
a5313b998c Merge branch 'feat/add-ws-redir' into 'master'
feat(tcp_transport): Add websocket HTTP redirect

Closes IDF-9073

See merge request espressif/esp-idf!37175
2025-05-15 18:56:56 +08:00
9a109ca17c fix(peripherals): Correct typo in periph_inttrput_t
Corrected the typo in the type name from 'periph_inttrput_t' to 'periph_interrupt_t'.
2025-05-15 18:40:57 +08:00
c3239ce836 fix(vfs): Fixed include for target linux failing on MacOs 2025-05-15 12:28:11 +02:00
9f6136d650 Merge branch 'feature/parttable_tool_use_only_ascii_for_names' into 'master'
fix(partition_table): Ignore UTF-8 BOM bytes in csv file

See merge request espressif/esp-idf!38954
2025-05-15 18:19:05 +08:00
cead328c1c feat(apptrace): Store CRC16 checksum value of exposed block in the perfmon reg 2025-05-15 12:17:58 +02:00
3dc92d64b9 fix(nimble): Fix proc rx entry comparison 2025-05-15 15:37:55 +05:30
c707faa41d Merge branch 'bugfix/incorrect_sae_pk_flag' into 'master'
Disable SAE-PK indication in Assoc Request when not configured

Closes WIFIBUG-1044

See merge request espressif/esp-idf!38320
2025-05-15 17:55:45 +08:00
4983ba1a59 Merge branch 'bugfix/wpa_eap_v1_connect_issue' into 'master'
fix(softAP): Adjusted authentication mode for wpa-eap version 1

Closes WIFIBUG-954

See merge request espressif/esp-idf!35321
2025-05-15 17:51:49 +08:00
94d71a8cd0 Merge branch 'feature/usb_dual_host_2' into 'master'
feat(usb/host): Add option to choose peripherals for USB host library

Closes IDF-11705, IDF-9052, and DOC-10991

See merge request espressif/esp-idf!35401
2025-05-15 16:18:05 +08:00
6918a45ee6 fix(esp_system): fix RTC reserved area alignment in the linker script
Make sure the size of the RTC reserved area complies with the alignment requirement.

Closes https://github.com/espressif/esp-idf/issues/13082
2025-05-15 16:11:19 +08:00
d5441e65e5 Merge branch 'fix/fix_usb_hs_phy_leakage_on_deepsleep' into 'master'
fix(esp_hw_support): Fix deepsleep leakage after USB HS phy is initialized

Closes PM-417

See merge request espressif/esp-idf!39144
2025-05-15 16:02:17 +08:00
4a18a67898 fix(phy): update phy lib to fix phy errors on ESP32-C5 2025-05-15 15:55:46 +08:00
1b9fe2142d bugfix(wifi): Fix incorrect SAE-PK advertisement in assoc request 2025-05-15 12:47:11 +05:30
8f6a2370d2 refactor(sd): updated sd host api to make 0 value as no change to configurations
use value 0 for `sd_host_slot_cfg_t` members, means no change to previous configurations,
instead of using `override/valid` flag
2025-05-15 15:16:38 +08:00
6297edade5 fix(ble_mesh): fixed the issue of incorrect proxy adv flag setting 2025-05-15 15:04:57 +08:00
31a089c751 Merge branch 'ci/enable_gcov_test' into 'master'
ci: enable gcov example for all chips

See merge request espressif/esp-idf!39114
2025-05-15 15:00:48 +08:00
8e4da0b71c Add CN 2025-05-15 14:57:40 +08:00
c776b440ec fix(softAP): Adjusted authentication mode for wpa-eap version 1 2025-05-15 13:51:31 +08:00
a8128adc92 Merge branch 'bugfix/fix_bitscrambler_rx_mode_init_error' into 'master'
fix(bitscrambler): fix bitscrambler RX mode initialization error

Closes IDF-13082

See merge request espressif/esp-idf!39154
2025-05-15 13:42:03 +08:00
4911efca3a Merge branch 'feat/h4_basic_gpio_support' into 'master'
feat(driver_gpio): add esp32h4 basic gpio support

Closes IDF-12390

See merge request espressif/esp-idf!38604
2025-05-15 13:37:01 +08:00
c19ed90553 Merge branch 'docs/fix_p4_usb_jtag_pins' into 'master'
docs(jtag): fix esp32p4 usb jtag pins

See merge request espressif/esp-idf!38629
2025-05-15 13:14:04 +08:00
c742f0a677 Merge branch 'bugfix/wpa2_suiteb_192bit_reason_code' into 'master'
fix(wifi): Add enterprise check for Suite-B 192-bit certification

Closes WIFIBUG-1070

See merge request espressif/esp-idf!37498
2025-05-15 11:53:31 +08:00
afa79e0473 fix(bitscrambler): fix bitscrambler RX mode initialization error 2025-05-15 11:43:39 +08:00
733c0586bc Merge branch 'refactor/rng_ll_p4' into 'master'
refactor(rng): refactor to use hal/ll apis for P4

Closes IDF-12476

See merge request espressif/esp-idf!38119
2025-05-15 11:30:54 +08:00
abc9c1fd55 test(gpio,gpio_ext,ppa): test with malloc from psram by default 2025-05-15 11:21:06 +08:00
fa00aa43e7 refactor(uart): minor refactor to uart wakeup code 2025-05-15 11:20:59 +08:00
f1446571e7 fix(uart): eliminate garbled data on UART TX/RX line in sleep 2025-05-15 11:07:26 +08:00
007a497483 feat(uart): add pin release process to uart driver 2025-05-15 11:07:26 +08:00
4fae51e3c1 fix(wifi): Sending disconnect event in connect fail and add enterprise check in Suite-B 192-bit certification 2025-05-15 11:02:32 +08:00
c2b8ea07d0 feat(sd): supported UHS-I SDR104 200MHz speed 2025-05-15 10:57:45 +08:00
0944a2a68a test(sd): added SD NG driver allocation tests 2025-05-15 10:57:45 +08:00
0c8b297610 fix(sd): fixed sd with offset performance test wrong log issue 2025-05-15 10:57:45 +08:00
77ae2808b0 refactor(sd): port legacy sd driver with NG driver 2025-05-15 10:57:45 +08:00
402bf0ce58 feat(sd): sd host driver layer driver NG 2025-05-15 10:57:33 +08:00
0ed5a94ab0 feat(driver_gpio): add esp32h4 basic gpio support 2025-05-15 10:35:49 +08:00
7107177e2d fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy 2025-05-15 10:12:59 +08:00
179eb5a5aa refactor(partition_table): Refactoring of code style 2025-05-14 18:45:49 +03:00
fc72712b10 fix(partition_table): Ignore UTF-8 BOM bytes in csv file 2025-05-14 18:45:49 +03:00
f9765d0316 Merge branch 'feat/update_ccache_to_4.11.2' into 'master'
feat(tools): Update ccache 4.10.2 -> 4.11.2

Closes IDFGH-14606

See merge request espressif/esp-idf!38382
2025-05-14 22:24:15 +08:00
f1da7a55b1 Merge branch 'bugfix/fix_some_wifi_bugs_250512' into 'master'
bugfix/fix_some_wifi_bugs_250512

See merge request espressif/esp-idf!39047
2025-05-14 21:31:38 +08:00
e70f2705f3 Merge branch 'fix/enable_ecdsa_verify_sw_fallback_when_p192_disabled' into 'master'
Enable signature verification s/w fallback when ECDSA-P192 is disabled

See merge request espressif/esp-idf!39039
2025-05-14 21:06:03 +08:00
01520e84fb Merge branch 'bugfix/fix_nimble_issue_0513' into 'master'
fix(nimble): fix nimble issues 10052025

Closes BLERP-1843, BLERP-1845, BLERP-1861, BLERP-1864, and BLERP-1776

See merge request espressif/esp-idf!39095
2025-05-14 20:27:25 +08:00
e7d7412222 Merge branch 'feat/impl_bt_coex_timer_event' into 'master'
feat(coex): implement BT coex timer event

See merge request espressif/esp-idf!39048
2025-05-14 20:25:55 +08:00
acc74fd930 Merge branch 'bugfix/force_calibrate_ocode_no_inline_c5eco2' into 'master'
fix(esp_hw_support): Force function calibrate_ocode not inlined to flash

See merge request espressif/esp-idf!39007
2025-05-14 18:44:00 +08:00
582e5690b2 Merge branch 'fix/rrm_config_set' into 'master'
Set rrm config condition in case RRM monitoring is enable

Closes WIFIBUG-1161

See merge request espressif/esp-idf!38841
2025-05-14 17:41:29 +08:00
b5303b5d95 Merge branch 'freertos_sysview_deadlock_fix' into 'master'
fix(app_trace): prevent deadlock on sysview start

See merge request espressif/esp-idf!38844
2025-05-14 17:10:42 +08:00
c559e045fc docs(jtag): fix esp32p4 usb jtag pins 2025-05-14 17:02:22 +08:00
f201fd08da docs: Update CN for usb_host.rst 2025-05-14 10:34:18 +02:00
cf18fe5568 refactor(usb/host): Remove deprecated usb_otg_periph.h 2025-05-14 10:34:17 +02:00
b961f42e8b feat(usb/host): Add option to choose peripheral for USB host library
Starting with ESP32-P4 we can have targets that have more than 1 USB-OTG peripheral.
This commit adds an option to choose which peripherals will be used by USB Host lib.

Internally, we will still have only 1 Root HUB but with multiple Root ports.
2025-05-14 10:34:11 +02:00
accfa14bcd fix(esp_hw_support): Force function calibrate_ocode not inlined to flash 2025-05-14 16:24:03 +08:00
36588e9a92 fix(wifi) : Set rrm config condition in case RRM monitoring is enabled 2025-05-14 16:21:51 +08:00
66e5cc8801 Merge branch 'ci/child-pipeline-default-value' into 'master'
Ci/child pipeline default value

See merge request espressif/esp-idf!39130
2025-05-14 16:21:41 +08:00
9f68214ab7 ci: child pipeline default value to avoid circular dependency issue 2025-05-14 10:16:36 +02:00
0a771792a9 Merge branch 'feat/cache_support_h21' into 'master'
cache: supported cache driver and cache panic drivers on esp32h21

Closes IDF-11524 and IDF-11525

See merge request espressif/esp-idf!39122
2025-05-14 15:48:27 +08:00
0c1e5a13e2 Merge branch 'ci/fix-deploy-jobs-rules' into 'master'
ci: improve deploy rules

Closes IDFCI-2938

See merge request espressif/esp-idf!39068
2025-05-14 15:11:10 +08:00
0154c7cfe3 fix(mbedtls): Enable signature verification s/w fallback when ECDSA curve is disabled 2025-05-14 12:31:56 +05:30
cd10016953 Merge branch 'refactor/public_some_gpio_private_api' into 'master'
refactor(gpio): public some private GPIO functions

See merge request espressif/esp-idf!39120
2025-05-14 14:38:05 +08:00
4acf13dc7b Merge branch 'docs/autocolor_multiline' into 'master'
docs(tools/idf-monitor): Add note about autocoloring limitation on multiline logs

Closes IDFGH-15114

See merge request espressif/esp-idf!38829
2025-05-14 14:31:24 +08:00
e1b6493304 feat(adc): add always inline for adc ll functions called by bootloader 2025-05-14 13:45:55 +08:00
9750c21933 Merge branch 'feat/cjson_update_to_upstream' into 'master'
feat(cjson): update to latest upstream

See merge request espressif/esp-idf!39053
2025-05-14 13:43:07 +08:00
a6c26c3e21 Merge branch 'feat/add_cam_pm_lock' into 'master'
feat(cam): esp_cam add pm lock function

Closes IDF-12596 and IDF-10093

See merge request espressif/esp-idf!38120
2025-05-14 13:28:23 +08:00
ef08ccaddf Merge branch 'bugfix/secure_ota_no_secure_boot' into 'master'
fix: secure OTA without secure boot issue for MMU page size configurable SoCs

Closes IDFGH-15277

See merge request espressif/esp-idf!39022
2025-05-14 13:11:00 +08:00
0a8064c1e5 fix(nimble): Fixed async race condition with HCI outstanding packets counter 2025-05-14 10:26:28 +05:30
58542cfdc9 fix(nimble): Extend support for allow connect during scan for more chips 2025-05-14 10:25:13 +05:30
b9546506d4 fix(nimble): Add support for anonymous address type for whitelist 2025-05-14 10:24:39 +05:30
342e0024f1 fix(nimble): Add configurable option to select ext adv v2 command 2025-05-14 10:24:10 +05:30
1e0577ebd0 feat(cjson): update to latest upstream 2025-05-14 12:45:35 +08:00
90b978c9cf Merge branch 'feat/mmu_support_h21' into 'master'
mmu: supported esp_mmu_map and flash_mmap drivers on esp32h21

Closes IDF-11540

See merge request espressif/esp-idf!39038
2025-05-14 11:40:59 +08:00
0c6aeecde4 feat(cache): supported cache panic driver on h21 2025-05-14 11:37:30 +08:00
acda9a7a7e feat(cache): supported cache driver on h21 2025-05-14 11:37:30 +08:00
e7449782d0 ci(cam): test csi/dvp/isp_dvp and test iram_safe 2025-05-14 11:11:59 +08:00
6599ba3c00 feat(cam): esp_cam add pm lock function and test 2025-05-14 11:11:58 +08:00
2189c52776 Merge branch 'docs/add_p4_hdg_and_user_guide' into 'master'
docs: Add links to ESP32-P4 HDG and user guides

See merge request espressif/esp-idf!39029
2025-05-14 10:21:46 +08:00
2b4aae2e3a refactor(gpio): public some private GPIO functions
like enable/disable open drain, enable/disable output capability
2025-05-14 10:14:07 +08:00
c9bab9e0d3 Merge branch 'fix/gatt_cache_inc_services_uuid_type_error' into 'master'
fix(nimble): Fixed UUID type error in gatt caching included service search

See merge request espressif/esp-idf!39086
2025-05-14 09:26:19 +08:00
bee2ed2502 ci: fix app_trace_basic rules and test 2025-05-13 21:31:43 +02:00
4b664441ac ci: enable gcov example for all chips 2025-05-13 21:26:14 +02:00
79c66cc16c Merge branch 'refactor/usb_dwc_buff_delay_on_p4' into 'master'
refactor(hcd_dwc): Apply ls_via_fs_hub delay for all targets

See merge request espressif/esp-idf!38946
2025-05-14 01:08:55 +08:00
27099e1c55 Merge branch 'fix/usbjtag_after_tinyusb' into 'master'
fix(usb/phy): Fix ability to switch back to USB/JTAG after uninstalling TinyUSB

Closes IDFGH-15273 and IDFGH-15248

See merge request espressif/esp-idf!39061
2025-05-14 01:06:05 +08:00
11321b585e fix(examples): Fix CI tests for secure boot cases 2025-05-13 19:20:22 +03:00
f24025f798 fix(esp_hw_support): Fix compile error on esp_cpu_int_has_handler on ESP32-P4
Merges https://github.com/espressif/esp-idf/pull/15942
Closes https://github.com/espressif/esp-idf/issues/15941
2025-05-13 18:13:15 +03:00
c06fa310cf Merge branch 'feat/usb-explicit-fifo-config' into 'master'
feat(usb/hal): Add HAL API to configure custom FIFO layout

Closes IDF-9042

See merge request espressif/esp-idf!38404
2025-05-13 22:28:41 +08:00
0f45b6c6c3 change(lp-core): Update LP I2C and LP UART drivers to use raw interrupt status
This commit updates the LP I2C and LP UART drivers to use the raw
interrupt status without enabling the interrupts.
2025-05-13 15:43:39 +02:00
8a4f94faf4 Merge branch 'ci/shiny_pip_install' into 'master'
ci: optimize ci runner pip install

Closes RDT-1299

See merge request espressif/esp-idf!38953
2025-05-13 21:29:11 +08:00
17599e60c7 test: add secure image verification case for C6/H2 2025-05-13 18:09:11 +05:30
eb5d761c9d fix: secure OTA without secure boot issue for MMU page size configurable SoCs
For secure app verification during OTA update case, the image was
getting memory mapped twice and hence the failure in verification.

Modified from memory mapped flash read to SPI flash read approach
for the MMU page size from image header.

Regression from 07318a4987

Closes https://github.com/espressif/esp-idf/issues/15936
2025-05-13 18:09:03 +05:30
b901559207 fix(nimble): Fixed UUID type error in gatt caching included service search 2025-05-13 17:32:01 +05:30
dc05b46ab5 ci: inherit more variables
this is somehow a temporary workaround, the long-term solution shall be
related to `inherit:variables`
2025-05-13 13:27:42 +02:00
9a9438b79a ci: improve rules for deploy jobs 2025-05-13 13:27:42 +02:00
c9c8560169 fix(usb/phy): Fix ability to switch back to USB/JTAG after uninstalling TinyUSB
Fixes #15912. This is a revert of a change made in 005ae0554 that breaks the
ability to re-initalize the USB/JTAG device after uninstalling TinyUSB.

Closes https://github.com/espressif/esp-idf/issues/15912
2025-05-13 13:21:41 +02:00
6d2f4b3656 Merge branch 'feat/usb_host_move_dma_cap_mem_to_psram_p4' into 'master'
feat(usb_host): Move DMA capable memory to external ram on P4

Closes IDF-11115

See merge request espressif/esp-idf!37949
2025-05-13 19:08:11 +08:00
3baaa8c829 Merge branch 'fix/rename_the_rmt_extra_flags_structure' into 'master'
docs(rmt): rename the rmt extra flags structure

Closes IDFGH-15274 and IDFGH-15270

See merge request espressif/esp-idf!39041
2025-05-13 18:37:05 +08:00
334cbe0dab Merge branch 'docs/build_h4_docs' into 'master'
feat(docs): add support for building H4 docs

See merge request espressif/esp-idf!38637
2025-05-13 16:16:01 +08:00
617d215f93 Merge branch 'bugfix/fix_some_ble_bugs_0422' into 'master'
Bugfix/fix some ble bugs 0422

Closes BLERP-1863

See merge request espressif/esp-idf!39042
2025-05-13 15:38:38 +08:00
cd5b3877bf feat(usb_host): Move DMA capable memory to external ram on P4
- DWC-OTG internal DMA can access psram on esp32p4
    - Move DMA memory buffs to psram, to save internal ram
    - HCD tests and MSC example runs in CI with psram enabled
2025-05-13 15:37:30 +08:00
b370ebdef4 feat(coex): implement BT coex timer event 2025-05-13 15:13:12 +08:00
478eea8992 feat(tools): Update ccache 4.10.2 -> 4.11.2
Closes https://github.com/espressif/idf-installer/issues/305
2025-05-13 15:07:51 +08:00
45db752f2f feat(mmu): supported esp_mmu_map and flash_mmap drivers on esp32h21 2025-05-13 14:58:19 +08:00
38e84d554a Merge branch 'fix/i2c_ci_esp32c5' into 'master'
test(i2c): Re-enable i2c test on esp32c5

Closes IDFCI-2895

See merge request espressif/esp-idf!39040
2025-05-13 14:56:02 +08:00
4e20dc58b3 fix(wifi): fix build issue by modifying parttion table of file_server example 2025-05-13 14:39:30 +08:00
e53c25d3ae docs(rmt): improve the documentation
Closes https://github.com/espressif/esp-idf/issues/15933
Closes https://github.com/espressif/esp-idf/issues/15929
2025-05-13 14:14:45 +08:00
542d07d34a feat(http_server): httpd register handler strdup failure case check
In httpd_register_uri_handler api, for the strdup function failure case was not
checked and not returned any error by freeing previously allocated memory, if the memory
allocation for strdup function did not gets successful.

Closes https://github.com/espressif/esp-idf/issues/15878
2025-05-13 11:27:02 +05:30
764d722bec Merge branch 'feat/gatt_cache_info' into 'master'
fix(nimble): Added api's to fetch gatt cache info

Closes BLERP-1702

See merge request espressif/esp-idf!38048
2025-05-13 13:54:19 +08:00
aa714f5ae6 Merge branch 'doc/summarize_bs_support_status' into 'master'
docs(bitscrambler): update documentation with integration details

See merge request espressif/esp-idf!39044
2025-05-13 13:37:52 +08:00
810eadd917 Merge branch 'fix/gen_soc_caps' into 'master'
change: config options of the same name must have the same type

Closes IDF-12805

See merge request espressif/esp-idf!38322
2025-05-13 12:48:03 +08:00
28afc7067f Merge branch 'fix/esp32c5_eco2_efuse_test' into 'master'
fix(efuse): Fix ESP32-C5 eFuse test for ECO2

Closes IDFCI-2920

See merge request espressif/esp-idf!39046
2025-05-13 12:13:46 +08:00
5bed100761 feat(wifi): add tx error 0xa0 count 2025-05-13 11:54:59 +08:00
9c84243073 Merge branch 'bugfix/wps_pbc_overlap_uuid' into 'master'
fix(wpa_supplicant): Ensure pbc_overlap event is posted correctly

Closes WIFIBUG-1115 and WIFIBUG-1055

See merge request espressif/esp-idf!38206
2025-05-13 11:11:43 +08:00
f3d1717408 docs(esp32h4): support building esp32h4 docs 2025-05-13 11:09:15 +08:00
27ec17a623 Merge branch 'fix/fix_usj_pad_leakage' into 'master'
fix(esp_hw_support): fix usj pad leakage in lightsleep

Closes PM-407

See merge request espressif/esp-idf!38949
2025-05-13 10:41:51 +08:00
c4aaceb430 Merge branch 'bugfix/scan_stop_when_conenct' into 'master'
fix(esp_wifi): Fix locking in inccorrect state when stop_scan is called after connect

See merge request espressif/esp-idf!38779
2025-05-13 10:36:12 +08:00
7c16bce827 fix(ble/bluedroid): Fixed issue with deleting link key when classic Bluetooth is not used 2025-05-13 10:25:24 +08:00
b691eaba6d refactor(rng): refactor to use hal/ll apis for P4 2025-05-13 09:09:06 +08:00
7f6e7f4506 Merge branch 'version/v6.0.0' into 'master'
change(version): Update version to v6.0-dev

See merge request espressif/esp-idf!38889
2025-05-12 23:56:30 +02:00
e65f7359e6 fix(sysview): do not use freertos ticks to prevent deadlock 2025-05-12 16:12:26 +02:00
f5a28000fa docs: Update CN for idf-monitor.rst 2025-05-12 22:07:50 +08:00
9859f5e690 docs(tools/idf-monitor): Add note about autocoloring limitation on multiline logs
Closes https://github.com/espressif/esp-idf/issues/15793
2025-05-12 22:07:50 +08:00
0103155f6f fix(esp_wifi): Fix locking in incorrect state when stop_scan is called after connect 2025-05-12 18:03:43 +05:30
3ee449bc5d fix(wpa_supplicant): Disconnect from previous AP while initiating WPS 2025-05-12 20:23:11 +08:00
91da4ea792 fix(wpa_supplicant): Detect PBC overlap even when UUID is null 2025-05-12 20:23:11 +08:00
c99c80c1d0 fix(wpa_supplicant): Ensure pbc_overlap event is posted correctly
Preserves the pbc_overlap flag to allow proper event posting.
This ensures that pbc overlap detection functions as expected.
2025-05-12 20:23:11 +08:00
f9b81e80ba fix(efuse): Fix ESP32-C5 eFuse test for ECO2 2025-05-12 14:33:41 +03:00
71b992ac5d docs: Add links to ESP32-P4 HDG and user guides 2025-05-12 17:13:39 +08:00
0586d10317 fix(ble/bluedroid): Reduce Bluedroid host log output over SPI 2025-05-12 17:12:44 +08:00
94830549ae docs(bitscrambler): update documentation with integration details 2025-05-12 17:09:00 +08:00
bfa0fff2e5 fix(ble/bluedroid): Added value len check in esp_ble_gatts_send_indicate() 2025-05-12 16:29:03 +08:00
df8c1f7a96 fix(ble/bluedroid): Change maximum length of attribute value to 517 2025-05-12 16:29:03 +08:00
ebb76933d0 docs(ble): clarify meaning of 0 value for esp_ble_gap_start_ext_scan() parameters 2025-05-12 16:29:03 +08:00
6552854cb5 fix(ble/bluedroid): Fixed BLE GAP appearance configuration check 2025-05-12 16:29:03 +08:00
c758af714a test(i2c): Re-enable i2c test on esp32c5 2025-05-12 15:48:52 +08:00
993bd86ee1 fix(nimble): Added api's for fetching gatt cache data and for discovering included service 2025-05-12 11:54:27 +05:30
cb4d90186f feat(usb/hal): Add support for explicit FIFO configuration
Introduce a new HAL API `usb_dwc_hal_set_fifo_config()` that allows advanced users
to manually configure RX, Non-Periodic TX, and Periodic TX FIFO sizes. This offers
fine-grained control beyond the previous bias-based sizing approach.

The HAL function no longer returns `esp_err_t`, and internal validations are enforced
via `HAL_ASSERT()`. Responsibility for input validation has been moved to the HCD layer.

FIFO configuration must be applied before any USB pipes are created or activated.
This feature is intended for use during `usb_host_install()`.

If no custom FIFO configuration is provided (i.e., all values are zero),
the driver falls back to a bias-based default layout based on Kconfig settings
(`CONFIG_USB_HOST_HW_BUFFER_BIAS_*`). Bias resolution is done inside `hcd_port_init()`.

The `port_obj_t` structure has been extended with a `fifo_config` field, which stores
the configuration to allow re-application after a USB port reset.

Obsolete FIFO bias enums (`usb_hal_fifo_bias_t`, `hcd_port_fifo_bias_t`) and related
APIs (`hcd_port_set_fifo_bias()`) have been removed in favor of the new structure-based mechanism.

The HCD initialization and port reset flow has been updated to use the explicit
FIFO configuration.

USB Host maintainer documentation (`maintainers.md`) has been updated accordingly.
Test cases were updated to remove the usage of removed bias API and now rely on default
or custom FIFO configuration.
2025-05-09 15:03:52 +02:00
1fa908a7a5 feat(docs): Small additions to ulp-risc-v.rst regarding the ULP I2C peripheral
This clarifies that the limited set of possible
transactions using the ULP I2C peripheral is a
hardware limitation and not a limitation of the
ESP-IDF and exactly what and how it's limited.

Merge https://github.com/espressif/esp-idf/pull/15917
2025-05-09 12:08:22 +03:00
a62464501f ci: optimize ci runner pip install 2025-05-09 16:01:32 +08:00
9f4eb5c94b feat(esp_wifi): Add example to write wifi config in nvs
This commit adds example for using wifi station and softap by flashing wifi config
directly into nvs using NVS Partition generator Utility (using csv file).

Closes https://github.com/espressif/esp-idf/issues/14554
2025-05-09 11:34:47 +05:30
5cc6cbd4c7 fix(mcpwm): the wrong pm lock type on esp32 and esp32s3 2025-05-08 21:25:47 +08:00
ba86dbb9f6 change(gen_soc_caps_kconfig): check if config options have the same type
Also introduce ignore pragma to prevent some #defines from .h files to
be translated to Kconfig files.
2025-05-07 13:37:05 +02:00
cd54be77db fix(esp_hw_support): always disable USJ pad in sleep to supress leakage 2025-05-07 17:33:25 +08:00
898f881226 refactor(hcd_dwc): Apply delay for all targets 2025-05-07 11:14:30 +02:00
2205a22dc1 feat(tcp_transport): Add websocket HTTP redirect
- Add and expose URI parser from HTTP when received a 301 status
2025-05-06 08:20:42 -03:00
201df702da feat(lwip/config): add menuconfig option for setting LWIP_IPV6_DUP_DETECT_ATTEMPTS
In my network, ipv6 address allocation to esp32 was unreliable.
I'd to disable LWIP_IPV6_DUP_DETECT_ATTEMPTS to 0 to actually make
esp32 ipv6 address assignment work reliably.

Signed-off-by: Amitesh Singh <singh.amitesh@gmail.com>
2025-05-06 10:17:59 +05:30
fc58a6c116 fix(esp_hw_support): fix esp32p4 may get stuck when entering deepsleep 2025-04-27 19:27:24 +08:00
2061 changed files with 89836 additions and 75686 deletions

View File

@ -11,7 +11,8 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Create a recursive clone source zip
uses: espressif/github-actions/release_zips@master
env:
RELEASE_PROJECT_NAME: ESP-IDF
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: espressif/release-zips-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
release_project_name: ESP-IDF
git_extra_args: --shallow-since="1 year ago"

1
.gitignore vendored
View File

@ -37,6 +37,7 @@ components/**/build/
components/**/build_*_*/
components/**/sdkconfig
components/**/sdkconfig.old
components/**/test_apps/wifi_nvs_config/nvs_data_suffix.csv
# Example project files
examples/**/build/

View File

@ -231,13 +231,18 @@ pytest_build_system_macos:
- .after_script:build:macos:upload-failed-job-logs:ccache-show-stats
- .rules:build:macos
tags:
- macos_shell
- macos
parallel: 3
variables:
PYENV_VERSION: "3.9"
# CCACHE_DIR: "/cache/idf_ccache". On macOS, you cannot write to this folder due to insufficient permissions.
CCACHE_DIR: "" # ccache will use "$HOME/Library/Caches/ccache".
CCACHE_MAXSIZE: "5G" # To preserve the limited Macbook storage. CCACHE automatically prunes old caches to fit the set limit.
# Workaround for a bug in Parallels executor where CI_PROJECT_DIR is not an absolute path,
# but a relative path to the build directory (builds/espressif/esp-idf instead of ~/builds/espressif/esp-idf.
# GitLab sets the project dir to this template `<builds_dir>/<namespace>/<project_name>`
IDF_PATH: "/Users/espressif/builds/espressif/esp-idf"
build_docker:
extends:
- .before_script:minimal

View File

@ -40,7 +40,7 @@ variables:
GIT_FETCH_EXTRA_FLAGS: "--no-recurse-submodules --prune --prune-tags"
# we're using .cache folder for caches
GIT_CLEAN_FLAGS: -ffdx -e .cache/
LATEST_GIT_TAG: v5.5-dev
LATEST_GIT_TAG: v6.0-dev
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
# by default we will fetch all submodules
@ -140,6 +140,13 @@ variables:
if [[ -n "$IDF_DONT_USE_MIRRORS" ]]; then
export IDF_MIRROR_PREFIX_MAP=
fi
# Optimize pip install
if echo "${CI_RUNNER_TAGS}" | grep "shiny"; then
export PIP_INDEX_URL="${PIP_INDEX_URL_SHINY}"
fi
if [[ "$(uname -m)" == "x86_64" ]] || [[ "$(uname -m)" == "aarch64" ]]; then
export IDF_PIP_WHEELS_URL=""
fi
if [[ "${CI_JOB_STAGE}" != "target_test" ]]; then
section_start "running_install_sh" "Running install.sh"
@ -191,13 +198,21 @@ variables:
fi
# Custom OpenOCD
if [[ ! -z "$OOCD_DISTRO_URL" && "$CI_JOB_STAGE" == "target_test" ]]; then
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
wget $OOCD_DISTRO_URL
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
tar -x -f $ARCH_NAME
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
export PATH=$PWD/openocd-esp32/bin:$PATH
if [[ "$CI_JOB_STAGE" == "target_test" ]]; then
machine="$(uname -m)"
if [[ "$machine" == "armv7l" ]] ; then
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARMHF"
elif [[ "$machine" == "aarch64" ]] ; then
OOCD_DISTRO_URL="$OOCD_DISTRO_URL_ARM64"
fi
if [[ ! -z "$OOCD_DISTRO_URL" ]]; then
echo "Using custom OpenOCD from ${OOCD_DISTRO_URL}"
wget $OOCD_DISTRO_URL
ARCH_NAME=$(basename $OOCD_DISTRO_URL)
tar -x -f $ARCH_NAME
export OPENOCD_SCRIPTS=$PWD/openocd-esp32/share/openocd/scripts
export PATH=$PWD/openocd-esp32/bin:$PATH
fi
fi
if [[ -n "$CI_PYTHON_TOOL_REPO" ]]; then
@ -228,8 +243,6 @@ variables:
# Ensure pyenv and PYENV_VERSION installed
- eval "$(pyenv init -)"
- *common-before_scripts
# On macOS, these tools need to be installed
- export IDF_TOOLS_PATH="${HOME}/.espressif_runner_${CI_RUNNER_ID}_${CI_CONCURRENT_ID}"
# remove idf-env.json, since it may contains enabled "features"
- rm -f $IDF_TOOLS_PATH/idf-env.json
# This adds tools (compilers) and the version-specific Python environment to PATH

View File

@ -16,6 +16,7 @@ bypass_check_test_targets:
- esp32h21
- esp32h4
- esp32c5
- esp32c61
#
# These lines would

View File

@ -91,4 +91,4 @@
specific_rules:
- if-schedule-test-build-system-windows
patterns:
- build_system
- build_system_win

View File

@ -3,7 +3,6 @@
image: $ESP_ENV_IMAGE
tags: [ deploy ]
# Check this before push_to_github
check_submodule_sync:
extends:
- .deploy_job_template
@ -31,8 +30,9 @@ push_to_github:
extends:
- .deploy_job_template
- .before_script:minimal
- .rules:push_to_github
- .rules:protected:deploy
needs:
# submodule must be synced before pushing to github
- check_submodule_sync
tags: [ brew, github_sync ]
variables:
@ -45,12 +45,16 @@ push_to_github:
- git remote remove github &>/dev/null || true
- git remote add github git@github.com:espressif/esp-idf.git
- tools/ci/push_to_github.sh
environment:
name: push_to_github_production
deployment_tier: production
url: "https://github.com/espressif/esp-idf"
deploy_update_SHA_in_esp-dockerfiles:
extends:
- .deploy_job_template
- .before_script:minimal
- .rules:protected-no_label-always
- .rules:protected:deploy
dependencies: []
variables:
GIT_DEPTH: 2
@ -59,3 +63,6 @@ deploy_update_SHA_in_esp-dockerfiles:
- 'curl --header "PRIVATE-TOKEN: ${ESPCI_SCRIPTS_TOKEN}" -o create_MR_in_esp_dockerfile.sh $GITLAB_HTTP_SERVER/api/v4/projects/1260/repository/files/create_MR_in_esp_dockerfile%2Fcreate_MR_in_esp_dockerfile.sh/raw\?ref\=master'
- chmod +x create_MR_in_esp_dockerfile.sh
- ./create_MR_in_esp_dockerfile.sh
environment:
name: eploy_update_SHA_in_esp-dockerfiles_production
deployment_tier: production

View File

@ -4,10 +4,10 @@
- "**/*.rst"
- "CONTRIBUTING.rst"
- "**/soc_caps.h"
- "**/Kconfig*"
.patterns-docs-partial: &patterns-docs-partial
- "components/**/*.h"
- "components/**/Kconfig*"
- "components/**/CMakeList.txt"
- "components/**/sdkconfig*"
- "tools/tools.json"
@ -19,12 +19,9 @@
.patterns-docs-preview: &patterns-docs-preview
- "docs/**/*"
.if-protected: &if-protected
.if-protected-check: &if-protected-check
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/)'
.if-protected-no_label: &if-protected-no_label
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
.if-qa-test-tag: &if-qa-test-tag
if: '$CI_COMMIT_TAG =~ /^qa-test/'
@ -41,7 +38,7 @@
rules:
- <<: *if-qa-test-tag
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build_docs
- <<: *if-label-docs_full
- <<: *if-dev-push
@ -64,7 +61,7 @@ check_readme_links:
tags: ["build", "amd64", "internet"]
allow_failure: true
rules:
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-dev-push
changes: *patterns-example-readme
script:
@ -96,7 +93,7 @@ check_docs_lang_sync:
parallel:
matrix:
- DOCLANG: ["en", "zh_CN"]
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5","esp32h2", "esp32h21", "esp32p4"]
DOCTGT: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c2", "esp32c6", "esp32c61", "esp32c5", "esp32h2", "esp32h4", "esp32h21", "esp32p4"]
check_docs_gh_links:
image: $ESP_IDF_DOC_ENV_IMAGE
@ -182,14 +179,17 @@ deploy_docs_preview:
DOCS_DEPLOY_SERVER_USER: "$DOCS_SERVER_USER"
DOCS_DEPLOY_PATH: "$DOCS_PATH"
DOCS_DEPLOY_URL_BASE: "https://$DOCS_PREVIEW_SERVER_URL/docs/esp-idf"
environment:
name: deploy_docs_preview
deployment_tier: staging
url: "https://$DOCS_PREVIEW_SERVER_URL/docs/esp-idf"
# stage: post_deploy
deploy_docs_production:
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
extends:
- .deploy_docs_template
rules:
- <<: *if-protected-no_label
- .rules:protected:deploy
stage: post_deploy
dependencies: # set dependencies to null to avoid missing artifacts issue
needs: # ensure runs after push_to_github succeeded
@ -204,12 +204,15 @@ deploy_docs_production:
DOCS_DEPLOY_PATH: "$DOCS_PROD_PATH"
DOCS_DEPLOY_URL_BASE: "https://docs.espressif.com/projects/esp-idf"
DEPLOY_STABLE: 1
environment:
name: deploy_docs_production
deployment_tier: production
url: "https://docs.espressif.com/projects/esp-idf"
check_doc_links:
extends:
- .build_docs_template
rules:
- <<: *if-protected-no_label
- .rules:protected:deploy
stage: post_deploy
needs:
- job: deploy_docs_production

View File

@ -113,7 +113,8 @@ test_cli_installer:
script:
# Tools must be downloaded for testing
# We could use "idf_tools.py download all", but we don't want to install clang because of its huge size
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
# cmake@version that is supported
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
- cd ${IDF_PATH}/tools/test_idf_tools
- python3 -m pip install jsonschema
- python3 ./test_idf_tools.py -v
@ -348,7 +349,7 @@ test_pytest_macos:
- .host_test_template
- .before_script:build:macos
tags:
- macos_shell
- macos
artifacts:
paths:
- XUNIT_RESULT.xml
@ -359,18 +360,22 @@ test_pytest_macos:
variables:
PYENV_VERSION: "3.9"
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
# Workaround for a bug in Parallels executor where CI_PROJECT_DIR is not an absolute path,
# but a relative path to the build directory (builds/espressif/esp-idf instead of ~/builds/espressif/esp-idf.
# GitLab sets the project dir to this template `<builds_dir>/<namespace>/<project_name>`
IDF_PATH: "/Users/espressif/builds/espressif/esp-idf"
script:
- run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -v
--target linux
--pytest-apps
-m \"host_test and macos_shell\"
-m \"host_test and macos\"
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MR_MODIFIED_COMPONENTS}
--modified-files ${MR_MODIFIED_FILES}
- python tools/ci/get_known_failure_cases_file.py
- run_cmd pytest
--target linux
-m \"host_test and macos_shell\"
-m \"host_test and macos\"
--junitxml=XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"

View File

@ -1,11 +1,15 @@
generate_failed_jobs_report:
.post_deploy_template:
stage: post_deploy
tags: [build, shiny]
image: $ESP_ENV_IMAGE
generate_failed_jobs_report:
extends:
- .post_deploy_template
tags: [build, shiny]
when: always
dependencies: [] # Do not download artifacts from the previous stages
artifacts:
expire_in: 1 week
expire_in: 2 week
when: always
paths:
- job_report.html
@ -13,12 +17,16 @@ generate_failed_jobs_report:
- python tools/ci/dynamic_pipelines/scripts/generate_report.py --report-type job
sync_support_status:
stage: post_deploy
extends:
- .rules:sync_support_status
- .post_deploy_template
- .rules:master:push
tags: [ brew, github_sync ]
needs:
- push_to_github
image: $ESP_ENV_IMAGE
tags: [ brew, github_sync ]
cache: []
before_script: []
script:
- curl --fail --request POST --form token="$IDF_STATUS_TRIG_TOKEN" --form ref="$IDF_STATUS_BRANCH" --form "variables[UPLOAD_TO_S3]=true" "$IDF_STATUS_TRIG_URL"
environment:
name: sync_support_status_production
deployment_tier: production

View File

@ -10,7 +10,7 @@ check_version:
# esp_idf_version.h in a branch before tagging the next version.
extends:
- .pre_check_template
- .rules:protected
- .rules:protected:check
tags: [ brew, github_sync ]
variables:
# need a full clone to get the latest tag
@ -165,6 +165,8 @@ pipeline_variables:
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
fi
- echo "OOCD_DISTRO_URL_ARMHF=$OOCD_DISTRO_URL_ARMHF" >> pipeline.env
- echo "OOCD_DISTRO_URL_ARM64=$OOCD_DISTRO_URL_ARM64" >> pipeline.env
- python tools/ci/ci_process_description.py
- cat pipeline.env
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report

View File

@ -56,6 +56,9 @@
- "tools/ci/ci_build_apps.py"
- "tools/test_build_system/**/*"
.patterns-build_system_win: &patterns-build_system_win
- "tools/test_build_system/**/*"
.patterns-build_macos: &patterns-build_macos
- "tools/ci/test_configure_ci_environment.sh"
@ -167,22 +170,19 @@
##############
# if anchors #
##############
.if-ref-master: &if-ref-master
if: '$CI_COMMIT_REF_NAME == "master"'
.if-master-push: &if-master-push
if: '$CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "push"'
.if-ref-master-no_label: &if-ref-master-no_label
if: '$CI_COMMIT_REF_NAME == "master" && $BOT_TRIGGER_WITH_LABEL == null'
.if-tag-release: &if-tag-release
.if-release-tag: &if-release-tag
if: '$CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/'
.if-protected: &if-protected
.if-protected-check: &if-protected-check
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) || $CI_COMMIT_TAG =~ /^qa-test/'
.if-protected-no_label: &if-protected-no_label
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && $BOT_TRIGGER_WITH_LABEL == null'
.if-protected-deploy: &if-protected-deploy
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/ || $CI_COMMIT_TAG =~ /^v\d+\.\d+(\.\d+)?($|-)/) && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "api")'
.if-protected-ref-push: &if-protected-ref-push
.if-protected-branch-push: &if-protected-branch-push
# rules:changes always evaluates to true for new branch pipelines or when there is no Git push event
if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/) && $CI_PIPELINE_SOURCE == "push"'
@ -192,9 +192,6 @@
.if-dev-push: &if-dev-push
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
.if-schedule: &if-schedule
if: '$CI_PIPELINE_SOURCE == "schedule"'
.if-schedule-nightly: &if-schedule-nightly
if: '$CI_PIPELINE_SOURCE == "schedule" && $INCLUDE_NIGHTLY_RUN == "1"'
@ -214,51 +211,41 @@
# Rules #
#########
### Branches ###
.rules:protected:
.rules:protected:check:
rules:
- <<: *if-protected
- <<: *if-protected-check
.rules:push_to_github:
.rules:protected:deploy:
rules:
- <<: *if-qa-test-tag
when: never
- <<: *if-protected-no_label
- <<: *if-protected-deploy
# Not uploading on release branches
.rules:sync_support_status:
.rules:master:push:
rules:
- <<: *if-ref-master-no_label
.rules:protected-no_label-always:
rules:
- <<: *if-qa-test-tag
when: never
- <<: *if-protected-no_label
when: always
- <<: *if-master-push
.rules:tag:release:
rules:
- <<: *if-tag-release
- <<: *if-release-tag
.rules:dev-push:
rules:
- <<: *if-dev-push
# Do not upload caches on dev branches by default
.rules:upload-python-cache:
rules:
- <<: *if-tag-release
- <<: *if-release-tag
- <<: *if-schedule-nightly
- <<: *if-protected-ref-push
- <<: *if-protected-branch-push
changes: *patterns-python-cache
- <<: *if-label-upload_cache
when: manual
.rules:upload-submodule-cache:
rules:
# Needn't upload submodule cache in schedule pipeline
- <<: *if-tag-release
- <<: *if-protected-ref-push
- <<: *if-release-tag
- <<: *if-protected-branch-push
changes: *patterns-submodule
- <<: *if-label-upload_cache
when: manual
@ -266,11 +253,10 @@
### Patterns ###
.rules:patterns:clang_tidy:
rules:
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-dev-push
changes: *patterns-c-files
#.rules:patterns:static-code-analysis-preview:
# rules:
# - <<: *if-dev-push
@ -282,7 +268,7 @@
.rules:patterns:idf-pytest-plugin:
rules:
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-dev-push
changes: *patterns-idf-pytest-plugin
@ -326,7 +312,7 @@
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-dev-push
changes: *patterns-build_components
@ -339,7 +325,7 @@
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-dev-push
changes: *patterns-build_check
@ -354,7 +340,7 @@
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-label-docker
- <<: *if-dev-push
@ -370,7 +356,7 @@
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-label-macos
- <<: *if-label-macos_test
@ -385,7 +371,7 @@
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-dev-push
changes: *patterns-build_components
@ -409,13 +395,13 @@
- <<: *if-schedule-test-build-system-windows
- <<: *if-label-windows
- <<: *if-dev-push
changes: *patterns-build_system
changes: *patterns-build_system_win
.rules:test:host_test:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build-only
when: never
- <<: *if-label-host_test
@ -426,7 +412,7 @@
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected
- <<: *if-protected-check
- <<: *if-label-build-only
when: never
- <<: *if-label-submodule

View File

@ -85,7 +85,7 @@ clang_tidy_check:
#code_quality_report:
# extends:
# - .sonar_scan_template
# - .rules:protected
# - .rules:protected:check
# allow_failure: true # it's using exit code to indicate the code analysis result,
# # we don't want to block ci when critical issues founded
# script:

View File

@ -18,9 +18,12 @@
after_script: []
test_cli_installer_win:
rules:
- when: never
extends:
- .host_test_win_template
- .rules:labels:windows_pytest_build_system
allow_failure: true
artifacts:
when: on_failure
paths:
@ -32,7 +35,8 @@ test_cli_installer_win:
timeout: 3h
script:
# Tools must be downloaded for testing
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake
# cmake@version that is supported
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
- cd ${IDF_PATH}\tools\test_idf_tools
- python -m pip install jsonschema
- python .\test_idf_tools.py

4
.gitmodules vendored
View File

@ -54,8 +54,10 @@
sbom-supplier = Person: Dave Gamble
sbom-url = https://github.com/DaveGamble/cJSON
sbom-description = Ultralightweight JSON parser in ANSI C
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
sbom-hash = 8f2beb57ddad1f94bed899790b00f46df893ccac
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
sbom-cve-exclude-list = CVE-2023-26819 Resolved in commit a328d65ad490b64da8c87523cbbfe16050ba5bf6
sbom-cve-exclude-list = CVE-2023-53154 Resolved in v1.7.18
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls

View File

@ -212,7 +212,7 @@ repos:
- id: check-copyright
args: ['--ignore', 'tools/ci/check_copyright_ignore.txt', '--config', 'tools/ci/check_copyright_config.yaml']
- repo: https://github.com/espressif/conventional-precommit-linter
rev: v1.7.0
rev: v1.10.0
hooks:
- id: conventional-precommit-linter
stages: [commit-msg]

View File

@ -8,9 +8,9 @@ This document describes the compatibility between ESP-IDF releases and Espressif
NOTE: This document on release branches may be out-of-date. Check the [Compatibility file on master](https://github.com/espressif/esp-idf/blob/master/COMPATIBILITY.md) for the most accurate information.
See [Compatibility Advisory for Chip Revision Numbering Scheme](https://www.espressif.com.cn/sites/default/files/advisory_downloads/AR2022-005%20Compatibility%20Advisory%20for%20Chip%20Revision%20Numbering%20%20Scheme.pdf) on the versioning of Espressif SoC revisions.
See [Compatibility Advisory for Chip Revision Numbering Scheme](https://www.espressif.com/sites/default/files/advisory_downloads/AR2022-005%20Compatibility%20Advisory%20for%20Chip%20Revision%20Numbering%20%20Scheme.pdf) on the versioning of Espressif SoC revisions.
You can run `esptool chip_id` to detect the series and revision of an SoC. See [SoC Errata](https://www.espressif.com.cn/en/support/documents/technical-documents?keys=errata) for more on how to distinguish between chip revisions, and the improvements provided by chip revisions. And run `idf.py --version` to know the version of current ESP-IDF.
You can run `esptool chip_id` to detect the series and revision of an SoC. See [SoC Errata](https://www.espressif.com/en/support/documents/technical-documents?keys=errata) for more on how to distinguish between chip revisions, and the improvements provided by chip revisions. And run `idf.py --version` to know the version of current ESP-IDF.
## ESP-IDF Support for Different Chip Revisions

12
Kconfig
View File

@ -118,8 +118,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
default "y" if IDF_TARGET="esp32c5"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
# TODO: [ESPTOOL-1044] remove when stub supported
select IDF_ENV_BRINGUP
config IDF_TARGET_ESP32P4
bool
@ -143,13 +141,11 @@ mainmenu "Espressif IoT Development Framework Configuration"
default "y" if IDF_TARGET="esp32h21"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
select IDF_ENV_FPGA
select IDF_ENV_BRINGUP
config IDF_TARGET_ESP32H4
bool
default "y" if IDF_TARGET="esp32h4"
select FREERTOS_UNICORE # TODO: [ESP32H4] IDF-12319, need remove
select IDF_TARGET_ARCH_RISCV
select IDF_ENV_FPGA
select IDF_ENV_BRINGUP
@ -650,7 +646,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
choice COMPILER_ORPHAN_SECTIONS
prompt "Orphan sections handling"
default COMPILER_ORPHAN_SECTIONS_WARNING
default COMPILER_ORPHAN_SECTIONS_ERROR
depends on !IDF_TARGET_LINUX
help
If the linker finds orphan sections, it attempts to place orphan sections after sections of the same
@ -658,6 +654,11 @@ mainmenu "Espressif IoT Development Framework Configuration"
That means that orphan sections could placed between sections defined in IDF linker scripts.
This could lead to corruption of the binary image. Configure the linker action here.
config COMPILER_ORPHAN_SECTIONS_ERROR
bool "Fail if orphan sections found"
help
Fails the link step with an error if orphan sections are detected.
config COMPILER_ORPHAN_SECTIONS_WARNING
bool "Place with warning"
help
@ -707,3 +708,4 @@ mainmenu "Espressif IoT Development Framework Configuration"
- CONFIG_ESP_WIFI_ENABLE_ROAMING_APP
- CONFIG_USB_HOST_EXT_PORT_RESET_ATTEMPTS
- CONFIG_LIBC_PICOLIBC
- CONFIG_GDMA_ENABLE_WEIGHTED_ARBITRATION

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@ -92,7 +92,7 @@ static esp_err_t esp_apptrace_membufs_swap(esp_apptrace_membufs_proto_data_t *pr
// switch to new block
proto->state.in_block++;
proto->hw->swap(new_block_num);
proto->hw->swap(new_block_num, proto->state.markers[prev_block_num]);
// handle data from host
esp_hostdata_hdr_t *hdr = (esp_hostdata_hdr_t *)proto->blocks[new_block_num].start;
@ -148,6 +148,18 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
if (res != ESP_OK) {
break;
}
#if CONFIG_IDF_TARGET_ESP32S3
/*
* ESP32S3 has a serious data corruption issue with the transferred data to host.
* This delay helps reduce the failure rate by temporarily reducing heavy memory writes
* from RTOS-level tracing and giving OpenOCD more time to read trace memory before
* the current thread continues execution. While this doesn't completely prevent
* memory access from other threads/cores/ISRs, it has shown to significantly improve
* reliability when combined with CRC checks in OpenOCD. In practice, this reduces the
* number of retries needed to read an entire block without corruption.
*/
esp_rom_delay_us(100);
#endif
}
return res;
}
@ -339,7 +351,7 @@ uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *p
esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_membufs_pkt_end(ptr);
// TODO: mark block as busy in order not to re-use it for other tracing calls until it is completely written
// TODO: mark block as busy in order not to reuse it for other tracing calls until it is completely written
// TODO: avoid potential situation when all memory is consumed by low prio tasks which can not complete writing due to
// higher prio tasks and the latter can not allocate buffers at all
// this is abnormal situation can be detected on host which will receive only uncompleted buffers

View File

@ -50,7 +50,7 @@ static uint8_t *esp_apptrace_riscv_down_buffer_get(esp_apptrace_riscv_data_t *hw
static esp_err_t esp_apptrace_riscv_down_buffer_put(esp_apptrace_riscv_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static bool esp_apptrace_riscv_host_is_connected(esp_apptrace_riscv_data_t *hw_data);
static esp_err_t esp_apptrace_riscv_buffer_swap_start(uint32_t curr_block_id);
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id);
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len);
static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len);
static bool esp_apptrace_riscv_host_data_pending(void);
@ -353,7 +353,7 @@ static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint3
return ESP_OK;
}
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id)
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
{
/* do nothing */
return ESP_OK;

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
@ -12,7 +12,7 @@
// ======================
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
// Exectution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
// Execution flow data are written to configurable Trace RAM block. Besides accessing Trace RAM itself TRAX module also allows to read/write
// trace memory via its registers by means of JTAG, APB or ERI transactions.
// ESP32 has two Xtensa cores with separate TRAX modules on them and provides two special memory regions to be used as trace memory.
// Chip allows muxing access to those trace memory blocks in such a way that while one block is accessed by CPUs another one can be accessed by host
@ -47,7 +47,7 @@
// 2. TRAX Registers layout
// ========================
// This module uses two TRAX HW registers to communicate with host SW (OpenOCD).
// This module uses two TRAX HW registers and one Performance Monitor register to communicate with host SW (OpenOCD).
// - Control register uses TRAX_DELAYCNT as storage. Only lower 24 bits of TRAX_DELAYCNT are writable. Control register has the following bitfields:
// | 31..XXXXXX..24 | 23 .(host_connect). 23| 22..(block_id)..15 | 14..(block_len)..0 |
// 14..0 bits - actual length of user data in trace memory block. Target updates it every time it fills memory block and exposes it to host.
@ -55,9 +55,15 @@
// 21..15 bits - trace memory block transfer ID. Block counter. It can overflow. Updated by target, host should not modify it. Actually can be 2 bits;
// 22 bit - 'host data present' flag. If set to one there is data from host, otherwise - no host data;
// 23 bit - 'host connected' flag. If zero then host is not connected and tracing module works in post-mortem mode, otherwise in streaming mode;
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
// See 'Targets Connection' setion for details.
// - Status register uses TRAX_TRIGGERPC as storage. If this register is not zero then current CPU is changing TRAX registers and
// this register holds address of the instruction which application will execute when it finishes with those registers modifications.
// See 'Targets Connection' section for details.
// - CRC16 register uses ERI_PERFMON_PM1 as storage. This register is used to store CRC16 checksum of the exposed trace memory block.
// The register has the following format:
// | 31..16 (CRC indicator) | 15..0 (CRC16 value) |
// CRC indicator (0xA55A) is used to distinguish valid CRC values from other data that might be in the register.
// CRC16 is calculated over the entire exposed block and is updated every time a block is exposed to the host.
// This allows the host to verify data integrity of the received trace data.
// 3. Modes of operation
// =====================
@ -127,7 +133,7 @@
// Access to internal module's data is synchronized with custom mutex. Mutex is a wrapper for portMUX_TYPE and uses almost the same sync mechanism as in
// vPortCPUAcquireMutex/vPortCPUReleaseMutex. The mechanism uses S32C1I Xtensa instruction to implement exclusive access to module's data from tasks and
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlaying mutex in cycle until
// ISRs running on both cores. Also custom mutex allows specifying timeout for locking operation. Locking routine checks underlying mutex in cycle until
// it gets its ownership or timeout expires. The differences of application tracing module's mutex implementation from vPortCPUAcquireMutex/vPortCPUReleaseMutex are:
// - Support for timeouts.
// - Local IRQs for CPU which owns the mutex are disabled till the call to unlocking routine. This is made to avoid possible task's prio inversion.
@ -142,9 +148,9 @@
// Timeout mechanism is based on xthal_get_ccount() routine and supports timeout values in microseconds.
// There are two situations when task/ISR can be delayed by tracing API call. Timeout mechanism takes into account both conditions:
// - Trace data are locked by another task/ISR. When wating on trace data lock.
// - Trace data are locked by another task/ISR. When waiting on trace data lock.
// - Current TRAX memory input block is full when working in streaming mode (host is connected). When waiting for host to complete previous block reading.
// When wating for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
// When waiting for any of above conditions xthal_get_ccount() is called periodically to calculate time elapsed from trace API routine entry. When elapsed
// time exceeds specified timeout value operation is canceled and ESP_ERR_TIMEOUT code is returned.
#include "sdkconfig.h"
#include "soc/soc.h"
@ -159,11 +165,15 @@
#include "esp_log.h"
#include "esp_app_trace_membufs_proto.h"
#include "esp_app_trace_port.h"
#include "esp_rom_crc.h"
// TRAX is disabled, so we use its registers for our own purposes
// | 31..XXXXXX..24 | 23 .(host_connect). 23 | 22 .(host_data). 22| 21..(block_id)..15 | 14..(block_len)..0 |
#define ESP_APPTRACE_TRAX_CTRL_REG ERI_TRAX_DELAYCNT
#define ESP_APPTRACE_TRAX_STAT_REG ERI_TRAX_TRIGGERPC
#define ESP_APPTRACE_TRAX_CRC16_REG ERI_PERFMON_PM1
#define ESP_APPTRACE_CRC_INDICATOR (0xA55AU << 16)
#define ESP_APPTRACE_TRAX_BLOCK_LEN_MSK 0x7FFFUL
#define ESP_APPTRACE_TRAX_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
@ -198,7 +208,7 @@ static uint8_t *esp_apptrace_trax_down_buffer_get(esp_apptrace_trax_data_t *hw_d
static esp_err_t esp_apptrace_trax_down_buffer_put(esp_apptrace_trax_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static bool esp_apptrace_trax_host_is_connected(esp_apptrace_trax_data_t *hw_data);
static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id);
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id);
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len);
static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len);
static bool esp_apptrace_trax_host_data_pending(void);
@ -498,7 +508,8 @@ static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
uint32_t acked_block = ESP_APPTRACE_TRAX_BLOCK_ID_GET(ctrl_reg);
uint32_t host_to_read = ESP_APPTRACE_TRAX_BLOCK_LEN_GET(ctrl_reg);
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)) {
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32, esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
ESP_APPTRACE_LOGD("HC[%d]: Can not switch %" PRIx32 " %" PRIu32 " %" PRIx32 " %" PRIx32 "/%" PRIx32,
esp_cpu_get_core_id(), ctrl_reg, host_to_read, acked_block,
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
res = ESP_ERR_NO_MEM;
goto _on_err;
@ -514,14 +525,22 @@ static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32
{
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(new_block_id) |
host_connected | ESP_APPTRACE_TRAX_BLOCK_LEN(prev_block_len));
esp_apptrace_trax_buffer_swap_unlock();
return ESP_OK;
}
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id)
static esp_err_t esp_apptrace_trax_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
{
/* Before switching to the new block, calculate CRC16 of the current block */
if (prev_block_len > 0) {
const uint8_t *prev_block_start = s_trax_blocks[!((new_block_id % 2))];
uint16_t crc16 = esp_rom_crc16_le(0, prev_block_start, prev_block_len);
eri_write(ESP_APPTRACE_TRAX_CRC16_REG, crc16 | ESP_APPTRACE_CRC_INDICATOR);
ESP_APPTRACE_LOGD("CRC16:%x %d @%x", crc16, prev_block_len, prev_block_start);
}
esp_apptrace_trax_select_memory_block(new_block_id);
return ESP_OK;
}

View File

@ -29,7 +29,7 @@ typedef struct {
typedef struct {
esp_err_t (*swap_start)(uint32_t curr_block_id);
esp_err_t (*swap)(uint32_t new_block_id);
esp_err_t (*swap)(uint32_t new_block_id, uint32_t prev_block_len);
esp_err_t (*swap_end)(uint32_t new_block_id, uint32_t prev_block_len);
bool (*host_data_pending)(void);
} esp_apptrace_membufs_proto_hw_t;

View File

@ -108,7 +108,7 @@ static void _cbSendTaskList(void) {
* Called from SystemView when asked by the host, returns the
* current system time in micro seconds.
*/
static U64 _cbGetTime(void) {
__attribute__((unused)) static U64 _cbGetTime(void) {
U64 Time;
Time = xTaskGetTickCountFromISR();
@ -260,7 +260,10 @@ void SYSVIEW_SendTaskInfo(U32 TaskID, const char* sName, unsigned Prio, U32 Stac
*/
// Callbacks provided to SYSTEMVIEW by FreeRTOS
const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
_cbGetTime,
/* Callback _cbGetTime locks xKernelLock inside xTaskGetTickCountFromISR, this can cause deadlock on multi-core.
To prevent deadlock, always lock xKernelLock before s_sys_view_lock. Omitting the callback here results in sending
SYSVIEW_EVTID_SYSTIME_CYCLES events instead of SYSVIEW_EVTID_SYSTIME_US */
NULL,
_cbSendTaskList,
};

View File

@ -33,7 +33,7 @@
#include "esp_flash.h"
#include "esp_flash_internal.h"
#define SUB_TYPE_ID(i) (i & 0x0F)
#define OTA_SLOT(i) (i & 0x0F)
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
/* Partial_data is word aligned so no reallocation is necessary for encrypted flash write */
@ -539,6 +539,69 @@ static esp_err_t rewrite_ota_seq(esp_ota_select_entry_t *two_otadata, uint32_t s
}
}
/**
* @brief Calculate the next OTA sequence number that will boot the given OTA slot.
*
* Based on the ESP-IDF OTA boot scheme, the system selects the OTA slot to boot by:
* boot_slot = (seq - 1) % ota_app_count
*
* This function determines the required seq value that would cause the given ota_slot_idx
* to be selected on next boot.
*
* @param current_seq Current active OTA sequence number
* @param ota_slot_idx Target OTA slot index (0-based)
* @param ota_app_count Total number of OTA slots
*
* @return New sequence number that will result in booting ota_slot_idx
*/
static uint32_t compute_ota_seq_for_target_slot(uint32_t current_seq, uint32_t ota_slot_idx, uint8_t ota_app_count)
{
if (ota_app_count == 0) {
return 0;
}
/* ESP-IDF stores OTA boot information in the OTA data partition, which consists of two sectors.
* Each sector holds an esp_ota_select_entry_t structure: otadata[0] and otadata[1].
* These structures record the OTA sequence number (ota_seq) used to determine the current boot partition.
*
* Boot selection logic:
* - If both otadata[0].ota_seq and otadata[1].ota_seq are 0xFFFFFFFF (invalid), it is the initial state:
* → Boot the factory app, if it exists.
* → Otherwise, fall back to booting ota[0].
*
* - If both otadata entries have valid sequence numbers and CRCs:
* → Choose the higher sequence number (max_seq).
* → Determine the OTA partition for boot (or running partition) using:
* running_ota_slot = (max_seq - 1) % ota_app_count
* where ota_app_count is the total number of OTA app partitions.
*
* Example:
* otadata[0].ota_seq = 4
* otadata[1].ota_seq = 5
* ota_app_count = 8 (available OTA slots: ota_0 to ota_7)
* → max_seq = 5
* → running slot = (5 - 1) % 8 = 4
* → So ota_4 is currently running
*
* If you want to switch to boot a different OTA slot (e.g., ota_7):
* → You need to compute a new sequence number such that:
* (new_seq - 1) % ota_app_count == 7
* while ensuring new_seq > current_seq.
*
* General formula:
* x = current OTA slot ID
* ota_slot_idx = desired OTA slot ID
* seq = current ota_seq
*
* To find the next ota_seq that will boot ota_y, use:
* new_seq = ((ota_slot_idx + 1) % ota_app_count) + ota_app_count * i;
* // where i is the smallest non-negative integer such that new_seq > seq
*/
uint32_t i = 0;
uint32_t base = (ota_slot_idx + 1) % ota_app_count;
while (current_seq > (base + i * ota_app_count)) { i++; };
return base + i * ota_app_count;
}
uint8_t esp_ota_get_app_partition_count(void)
{
uint16_t ota_app_count = 0;
@ -549,6 +612,30 @@ uint8_t esp_ota_get_app_partition_count(void)
return ota_app_count;
}
/**
* @brief Update the OTA data partition to set the given OTA app subtype as the next boot target.
*
* ESP-IDF uses the OTA data partition to track which OTA app should boot.
* This partition contains two entries (otadata[0] and otadata[1]), each storing an esp_ota_select_entry_t struct,
* which includes the OTA sequence number (ota_seq).
*
* On boot, the chip determines the current running OTA slot using:
* current_slot = (max(ota_seq) - 1) % ota_app_count
*
* This function updates the OTA data to switch the next boot to the partition with the given subtype.
*
* Behavior:
* - If the currently selected OTA slot already matches the requested subtype,
* only the state field is updated (e.g., to mark the app as newly downloaded).
* - Otherwise, it calculates the next valid ota_seq that will cause the bootloader to select
* the requested OTA slot on reboot, and writes it to the inactive OTA data sector.
*
* @param subtype The OTA partition subtype (e.g., ESP_PARTITION_SUBTYPE_APP_OTA_0, ..._OTA_1, ...)
* @return
* - ESP_OK if update was successful
* - ESP_ERR_NOT_FOUND if OTA data partition not found
* - ESP_ERR_INVALID_ARG if subtype is out of range
*/
static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
{
esp_ota_select_entry_t otadata[2];
@ -558,42 +645,31 @@ static esp_err_t esp_rewrite_ota_data(esp_partition_subtype_t subtype)
}
uint8_t ota_app_count = esp_ota_get_app_partition_count();
if (SUB_TYPE_ID(subtype) >= ota_app_count) {
if (OTA_SLOT(subtype) >= ota_app_count) {
return ESP_ERR_INVALID_ARG;
}
//esp32_idf use two sector for store information about which partition is running
//it defined the two sector as ota data partition,two structure esp_ota_select_entry_t is saved in the two sector
//named data in first sector as otadata[0], second sector data as otadata[1]
//e.g.
//if otadata[0].ota_seq == otadata[1].ota_seq == 0xFFFFFFFF,means ota info partition is in init status
//so it will boot factory application(if there is),if there's no factory application,it will boot ota[0] application
//if otadata[0].ota_seq != 0 and otadata[1].ota_seq != 0,it will choose a max seq ,and get value of max_seq%max_ota_app_number
//and boot a subtype (mask 0x0F) value is (max_seq - 1)%max_ota_app_number,so if want switch to run ota[x],can use next formulas.
//for example, if otadata[0].ota_seq = 4, otadata[1].ota_seq = 5, and there are 8 ota application,
//current running is (5-1)%8 = 4,running ota[4],so if we want to switch to run ota[7],
//we should add otadata[0].ota_seq (is 4) to 4 ,(8-1)%8=7,then it will boot ota[7]
//if A=(B - C)%D
//then B=(A + C)%D + D*n ,n= (0,1,2...)
//so current ota app sub type id is x , dest bin subtype is y,total ota app count is n
//seq will add (x + n*1 + 1 - seq)%n
int active_otadata = bootloader_common_get_active_otadata(otadata);
int next_otadata;
uint32_t new_seq;
if (active_otadata != -1) {
uint32_t seq = otadata[active_otadata].ota_seq;
uint32_t i = 0;
while (seq > (SUB_TYPE_ID(subtype) + 1) % ota_app_count + i * ota_app_count) {
i++;
uint32_t ota_slot = (otadata[active_otadata].ota_seq - 1) % ota_app_count;
if (ota_slot == OTA_SLOT(subtype)) {
// ota_data is already valid and points to the correct OTA slot.
// So after reboot the requested partition will be selected for boot.
// Only update the ota_state of the requested partition.
next_otadata = active_otadata;
new_seq = otadata[active_otadata].ota_seq;
} else {
next_otadata = (~active_otadata) & 1; // if 0 -> will be next 1. and if 1 -> will be next 0.
new_seq = compute_ota_seq_for_target_slot(otadata[active_otadata].ota_seq, OTA_SLOT(subtype), ota_app_count);
}
int next_otadata = (~active_otadata)&1; // if 0 -> will be next 1. and if 1 -> will be next 0.
otadata[next_otadata].ota_state = set_new_state_otadata();
return rewrite_ota_seq(otadata, (SUB_TYPE_ID(subtype) + 1) % ota_app_count + i * ota_app_count, next_otadata, otadata_partition);
} else {
/* Both OTA slots are invalid, probably because unformatted... */
int next_otadata = 0;
otadata[next_otadata].ota_state = set_new_state_otadata();
return rewrite_ota_seq(otadata, SUB_TYPE_ID(subtype) + 1, next_otadata, otadata_partition);
next_otadata = 0;
new_seq = OTA_SLOT(subtype) + 1;
}
otadata[next_otadata].ota_state = set_new_state_otadata();
return rewrite_ota_seq(otadata, new_seq, next_otadata, otadata_partition);
}
esp_err_t esp_ota_set_boot_partition(const esp_partition_t *partition)

View File

@ -7,6 +7,7 @@ components/app_update/test_apps:
- if: CONFIG_NAME == "xip_psram" and SOC_SPIRAM_XIP_SUPPORTED == 1
# S2 doesn't have ROM for flash
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and (SOC_SPIRAM_XIP_SUPPORTED == 1 and IDF_TARGET != "esp32s2")
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1
disable:
- if: IDF_TARGET in ["esp32h21", "esp32h4"]
temporary: true
@ -14,3 +15,7 @@ components/app_update/test_apps:
- if: IDF_TARGET == "esp32c61" and CONFIG_NAME == "xip_psram_with_rom_impl"
temporary: true
reason: not supported yet # TODO: [ESP32C61] IDF-12784
disable_test:
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1 and IDF_TARGET == "esp32c61"
temporary: true
reason: lack of runners # TODO: [ESP32C61] IDF-13165

View File

@ -1,4 +1,15 @@
idf_component_register(SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES cmock test_utils app_update bootloader_support nvs_flash driver spi_flash esp_psram
WHOLE_ARCHIVE)
idf_component_register(
SRC_DIRS "."
PRIV_INCLUDE_DIRS "."
PRIV_REQUIRES
cmock
test_utils
app_update
bootloader_support
nvs_flash
driver
spi_flash
esp_psram
efuse
WHOLE_ARCHIVE
)

View File

@ -0,0 +1,87 @@
/*
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Tests bootloader update.
*/
#include "unity.h"
#include "esp_log.h"
#include "esp_efuse.h"
#include "esp_flash_internal.h"
#include "esp_rom_sys.h"
#include "utils_update.h"
#include "sdkconfig.h"
#define BOOT_COUNT_NAMESPACE "boot_count"
static __attribute__((unused)) const char *TAG = "btldr_update";
#if CONFIG_BOOTLOADER_RECOVERY_ENABLE
/* @brief Checks and prepares the partition so that the factory app is launched after that.
*/
static void start_test(void)
{
ESP_LOGI(TAG, "boot count 1 - reset");
set_boot_count_in_nvs(1);
erase_ota_data();
ESP_LOGI(TAG, "ota_data erased");
ESP_LOGI(TAG, "Bootloader offset: 0x%x", esp_rom_get_bootloader_offset());
reboot_as_deep_sleep();
}
static void test_flow1(void)
{
uint8_t boot_count = get_boot_count_from_nvs();
boot_count++;
set_boot_count_in_nvs(boot_count);
ESP_LOGI(TAG, "boot count %d", boot_count);
ESP_LOGI(TAG, "Bootloader offset: 0x%x", esp_rom_get_bootloader_offset());
const esp_partition_t *primary_bootloader;
TEST_ESP_OK(esp_partition_register_external(NULL, ESP_PRIMARY_BOOTLOADER_OFFSET, ESP_BOOTLOADER_SIZE, "PrimaryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_PRIMARY, &primary_bootloader));
const esp_partition_t *recovery_bootloader;
TEST_ESP_OK(esp_partition_register_external(NULL, CONFIG_BOOTLOADER_RECOVERY_OFFSET, ESP_BOOTLOADER_SIZE, "RecoveryBTLDR", ESP_PARTITION_TYPE_BOOTLOADER, ESP_PARTITION_SUBTYPE_BOOTLOADER_RECOVERY, &recovery_bootloader));
ESP_LOGI(TAG, "Bootloaders are registered");
// Remove write protection for the bootloader
esp_flash_set_dangerous_write_protection(esp_flash_default_chip, false);
switch (boot_count) {
case 2:
TEST_ASSERT_EQUAL_HEX32(ESP_PRIMARY_BOOTLOADER_OFFSET, esp_rom_get_bootloader_offset());
TEST_ESP_OK(esp_partition_erase_range(recovery_bootloader, 0, recovery_bootloader->size));
ESP_LOGI(TAG, "Erase recovery bootloader");
TEST_ESP_OK(esp_efuse_set_recovery_bootloader_offset(CONFIG_BOOTLOADER_RECOVERY_OFFSET));
ESP_LOGI(TAG, "Backup, copy <%s> -> <%s>", primary_bootloader->label, recovery_bootloader->label);
TEST_ESP_OK(esp_partition_copy(recovery_bootloader, 0, primary_bootloader, 0, primary_bootloader->size));
TEST_ESP_OK(esp_partition_erase_range(primary_bootloader, 0, primary_bootloader->size));
ESP_LOGI(TAG, "Erase primary bootloader");
reboot_as_deep_sleep();
break;
case 3:
TEST_ASSERT_EQUAL_HEX32(CONFIG_BOOTLOADER_RECOVERY_OFFSET, esp_rom_get_bootloader_offset());
ESP_LOGI(TAG, "Return to primary bootloader...");
ESP_LOGI(TAG, "Copy <%s> -> <%s>", recovery_bootloader->label, primary_bootloader->label);
TEST_ESP_OK(esp_partition_copy(primary_bootloader, 0, recovery_bootloader, 0, primary_bootloader->size));
TEST_ESP_OK(esp_partition_erase_range(recovery_bootloader, 0, recovery_bootloader->size));
ESP_LOGI(TAG, "Erase recovery bootloader");
break;
default:
TEST_FAIL_MESSAGE("Unexpected stage");
break;
}
}
TEST_CASE_MULTIPLE_STAGES("Recovery bootloader feature", "[recovery_bootloader][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET]", start_test, test_flow1, test_flow1);
#endif // CONFIG_BOOTLOADER_RECOVERY_ENABLE

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -7,314 +7,16 @@
* Tests for switching between partitions: factory, OTAx, test.
*/
#include <esp_types.h>
#include <stdio.h>
#include "string.h"
#include <inttypes.h>
#include "sdkconfig.h"
#include "esp_rom_spiflash.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/queue.h"
#include "unity.h"
#include "esp_system.h"
#include "bootloader_common.h"
#include "../bootloader_flash/include/bootloader_flash_priv.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_ota_ops.h"
#include "esp_partition.h"
#include "esp_flash_partitions.h"
#include "esp_image_format.h"
#include "nvs_flash.h"
#include "driver/gpio.h"
#include "esp_sleep.h"
#include "test_utils.h"
#define BOOT_COUNT_NAMESPACE "boot_count"
#include "unity.h"
#include "utils_update.h"
#include "sdkconfig.h"
static const char *TAG = "ota_test";
static void set_boot_count_in_nvs(uint8_t boot_count)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle);
if (err != ESP_OK) {
TEST_ESP_OK(nvs_flash_erase());
TEST_ESP_OK(nvs_flash_init());
TEST_ESP_OK(nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle));
}
TEST_ESP_OK(nvs_set_u8(boot_count_handle, "boot_count", boot_count));
TEST_ESP_OK(nvs_commit(boot_count_handle));
nvs_close(boot_count_handle);
}
static uint8_t get_boot_count_from_nvs(void)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READONLY, &boot_count_handle);
if (err == ESP_ERR_NVS_NOT_FOUND) {
set_boot_count_in_nvs(0);
}
uint8_t boot_count;
TEST_ESP_OK(nvs_get_u8(boot_count_handle, "boot_count", &boot_count));
nvs_close(boot_count_handle);
return boot_count;
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
static void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
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, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
esp_partition_munmap(data_map);
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
static void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
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, 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));
esp_partition_munmap(data_map);
bytes_to_write -= write_bytes;
offset += write_bytes;
}
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Get the next partition of OTA for the update.
*
* @return The next partition of OTA(OTA0-15).
*/
static const esp_partition_t * get_next_update_partition(void)
{
const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, update_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address);
return update_partition;
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
static void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
static void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition_with_offset(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Erase otadata partition
*/
static void erase_ota_data(void)
{
const esp_partition_t *data_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, data_partition);
TEST_ESP_OK(esp_partition_erase_range(data_partition, 0, 2 * data_partition->erase_size));
}
/* @brief Reboots ESP using mode deep sleep. This mode guaranty that RTC_DATA_ATTR variables is not reset.
*/
static void reboot_as_deep_sleep(void)
{
ESP_LOGI(TAG, "reboot as deep sleep");
esp_deep_sleep(20000);
TEST_FAIL_MESSAGE("Should never be reachable except when sleep is rejected, abort");
}
/* @brief Copies a current app to next partition (OTA0-15), after that ESP is rebooting and run this (the next) OTAx.
*/
static void copy_current_app_to_next_part_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Copies a current app to next partition (OTA0-15) using esp_ota_write_with_offest(), after that ESP is rebooting and run this (the next) OTAx.
*/
static void copy_current_app_to_next_part_with_offset_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part_with_offset(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Get running app.
*
* @return The next partition of OTA(OTA0-15).
*/
static const esp_partition_t* get_running_firmware(void)
{
const esp_partition_t *configured = esp_ota_get_boot_partition();
const esp_partition_t *running = esp_ota_get_running_partition();
ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")",
running->type, running->subtype, running->address);
ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")",
configured->type, configured->subtype, configured->address);
TEST_ASSERT_NOT_EQUAL(NULL, configured);
TEST_ASSERT_NOT_EQUAL(NULL, running);
if (running->subtype != ESP_PARTITION_SUBTYPE_APP_TEST) {
TEST_ASSERT_EQUAL_PTR(running, configured);
}
return running;
}
// type of a corrupt ota_data
typedef enum {
CORR_CRC_1_SECTOR_OTA_DATA = (1 << 0), /*!< Corrupt CRC only 1 sector of ota_data */
CORR_CRC_2_SECTOR_OTA_DATA = (1 << 1), /*!< Corrupt CRC only 2 sector of ota_data */
} corrupt_ota_data_t;
/* @brief Get two copies ota_data from otadata partition.
*
* @param[in] otadata_partition - otadata partition.
* @param[out] ota_data_0 - First copy from otadata_partition.
* @param[out] ota_data_1 - Second copy from otadata_partition.
*/
static void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1)
{
uint32_t offset = otadata_partition->address;
uint32_t size = otadata_partition->size;
if (offset != 0) {
const esp_ota_select_entry_t *ota_select_map;
ota_select_map = bootloader_mmap(offset, size);
TEST_ASSERT_NOT_EQUAL(NULL, ota_select_map);
memcpy(ota_data_0, ota_select_map, sizeof(esp_ota_select_entry_t));
memcpy(ota_data_1, (uint8_t *)ota_select_map + otadata_partition->erase_size, sizeof(esp_ota_select_entry_t));
bootloader_munmap(ota_select_map);
}
}
/* @brief Writes a ota_data into required sector of otadata_partition.
*
* @param[in] otadata_partition - Partition information otadata.
* @param[in] ota_data - otadata structure.
* @param[in] sec_id - Sector number 0 or 1.
*/
static void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id)
{
esp_partition_write(otadata_partition, otadata_partition->erase_size * sec_id, &ota_data[sec_id], sizeof(esp_ota_select_entry_t));
}
/* @brief Makes a corrupt of ota_data.
* @param[in] err - type error
*/
static void corrupt_ota_data(corrupt_ota_data_t err)
{
esp_ota_select_entry_t ota_data[2];
const esp_partition_t *otadata_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, otadata_partition);
get_ota_data(otadata_partition, &ota_data[0], &ota_data[1]);
if (err & CORR_CRC_1_SECTOR_OTA_DATA) {
ota_data[0].crc = 0;
}
if (err & CORR_CRC_2_SECTOR_OTA_DATA) {
ota_data[1].crc = 0;
}
TEST_ESP_OK(esp_partition_erase_range(otadata_partition, 0, otadata_partition->size));
write_ota_data(otadata_partition, &ota_data[0], 0);
write_ota_data(otadata_partition, &ota_data[1], 1);
}
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
/* @brief Sets the pin number to output and sets output level as low. After reboot (deep sleep) this pin keep the same level.
*
* The output level of the pad will be force locked and can not be changed.
* Power down or call gpio_hold_dis will disable this function.
*
* @param[in] num_pin - Pin number
*/
static void set_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
gpio_config_t io_conf;
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << num_pin);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
TEST_ESP_OK(gpio_config(&io_conf));
TEST_ESP_OK(gpio_set_level(num_pin, 0));
TEST_ESP_OK(gpio_hold_en(num_pin));
}
/* @brief Unset the pin number hold function.
*/
static void reset_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
TEST_ESP_OK(gpio_reset_pin(num_pin));
}
#endif
static void mark_app_valid(void)
{
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
#endif
}
/* @brief Checks and prepares the partition so that the factory app is launched after that.
*/
@ -546,20 +248,6 @@ static void test_flow5(void)
TEST_CASE_MULTIPLE_STAGES("Switching between factory, test, factory", "[app_update][timeout=90][reset=SW_CPU_RESET, SW_CPU_RESET, DEEPSLEEP_RESET]", start_test, test_flow5, test_flow5, test_flow5);
#endif
static const esp_partition_t* app_update(void)
{
const esp_partition_t *cur_app = get_running_firmware();
const esp_partition_t* update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_NULL(update_partition);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(update_partition));
return update_partition;
}
static void test_rollback1(void)
{
uint8_t boot_count = get_boot_count_from_nvs();
@ -930,3 +618,51 @@ static void test_rollback3_1(void)
}
TEST_CASE_MULTIPLE_STAGES("Test rollback. Updated partition invalidated after esp_ota_begin", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET, DEEPSLEEP_RESET, SW_CPU_RESET]", start_test, test_rollback3, test_rollback3, test_rollback3, test_rollback3_1);
static void test_rollback4(void)
{
uint8_t boot_count = get_boot_count_from_nvs();
boot_count++;
set_boot_count_in_nvs(boot_count);
ESP_LOGI(TAG, "boot count %d", boot_count);
const esp_partition_t *cur_app = get_running_firmware();
switch (boot_count) {
case 2:
ESP_LOGI(TAG, "Factory");
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_FACTORY, cur_app->subtype);
app_update();
reboot_as_deep_sleep();
break;
case 3:
ESP_LOGI(TAG, "OTA0");
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_0, cur_app->subtype);
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
app_update();
// Do not reboot and call app_update again.
// This will not change the running partition since we haven't rebooted.
// The esp_rewrite_otadata() will update the otadata for the non-running partition only.
app_update();
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
// The last call to esp_rewrite_otadata should have updated the otadata for the non-running partition only.
// Therefore, calling esp_ota_get_state_partition on the running partition should succeed and not return ESP_ERR_NOT_FOUND
const esp_partition_t* running_partition;
running_partition = esp_ota_get_running_partition();
esp_ota_img_states_t ota_state;
TEST_ESP_OK(esp_ota_get_state_partition(running_partition, &ota_state));
#endif
reboot_as_deep_sleep();
break;
case 4:
ESP_LOGI(TAG, "OTA1");
TEST_ASSERT_EQUAL(ESP_PARTITION_SUBTYPE_APP_OTA_1, cur_app->subtype);
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
break;
default:
erase_ota_data();
TEST_FAIL_MESSAGE("Unexpected stage");
break;
}
}
TEST_CASE_MULTIPLE_STAGES("Test esp_rewrite_otadata. Updated sequence number for non-running partition always", "[app_update][timeout=90][reset=DEEPSLEEP_RESET, DEEPSLEEP_RESET, DEEPSLEEP_RESET, SW_CPU_RESET]", start_test, test_rollback4, test_rollback4, test_rollback4);

View File

@ -0,0 +1,307 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "esp_rom_spiflash.h"
#include "driver/gpio.h"
#include "nvs_flash.h"
#include "esp_partition.h"
#include "esp_flash_partitions.h"
#include "esp_image_format.h"
#include "../bootloader_flash/include/bootloader_flash_priv.h"
#include "esp_sleep.h"
#include "esp_ota_ops.h"
#include "esp_err.h"
#include "esp_log.h"
#include "test_utils.h"
#include "utils_update.h"
#include "unity.h"
#include "sdkconfig.h"
#define BOOT_COUNT_NAMESPACE "boot_count"
static const char *TAG = "ota_test";
void set_boot_count_in_nvs(uint8_t boot_count)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle);
if (err != ESP_OK) {
TEST_ESP_OK(nvs_flash_erase());
TEST_ESP_OK(nvs_flash_init());
TEST_ESP_OK(nvs_open(BOOT_COUNT_NAMESPACE, NVS_READWRITE, &boot_count_handle));
}
TEST_ESP_OK(nvs_set_u8(boot_count_handle, "boot_count", boot_count));
TEST_ESP_OK(nvs_commit(boot_count_handle));
nvs_close(boot_count_handle);
}
uint8_t get_boot_count_from_nvs(void)
{
nvs_handle_t boot_count_handle;
esp_err_t err = nvs_open(BOOT_COUNT_NAMESPACE, NVS_READONLY, &boot_count_handle);
if (err == ESP_ERR_NVS_NOT_FOUND) {
set_boot_count_in_nvs(0);
}
uint8_t boot_count;
TEST_ESP_OK(nvs_get_u8(boot_count_handle, "boot_count", &boot_count));
nvs_close(boot_count_handle);
return boot_count;
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
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, ESP_PARTITION_MMAP_DATA, &partition_bin, &data_map));
TEST_ESP_OK(esp_ota_write(update_handle, (const void *)partition_bin, curr_app->size));
esp_partition_munmap(data_map);
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Copies a current app to next partition using handle.
*
* @param[in] update_handle - Handle of API ota.
* @param[in] cur_app - Current app.
*/
void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app)
{
const void *partition_bin = NULL;
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, 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));
esp_partition_munmap(data_map);
bytes_to_write -= write_bytes;
offset += write_bytes;
}
ESP_LOGI(TAG, "finish the copy process");
}
/* @brief Get the next partition of OTA for the update.
*
* @return The next partition of OTA(OTA0-15).
*/
const esp_partition_t * get_next_update_partition(void)
{
const esp_partition_t *update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, update_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, update_partition->subtype, update_partition->address);
return update_partition;
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Copies a current app to next partition (OTA0-15) and then configure OTA data for a new boot partition.
*
* @param[in] cur_app_partition - Current app.
* @param[in] next_app_partition - Next app for boot.
*/
void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition)
{
esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_EQUAL(NULL, next_app_partition);
ESP_LOGI(TAG, "Writing to partition subtype %d at offset 0x%"PRIx32, next_app_partition->subtype, next_app_partition->address);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(next_app_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition_with_offset(update_handle, cur_app_partition);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(next_app_partition));
}
/* @brief Erase otadata partition
*/
void erase_ota_data(void)
{
const esp_partition_t *data_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, data_partition);
TEST_ESP_OK(esp_partition_erase_range(data_partition, 0, 2 * data_partition->erase_size));
}
/* @brief Reboots ESP using mode deep sleep. This mode guaranty that RTC_DATA_ATTR variables is not reset.
*/
void reboot_as_deep_sleep(void)
{
ESP_LOGI(TAG, "reboot as deep sleep");
esp_deep_sleep(20000);
TEST_FAIL_MESSAGE("Should never be reachable except when sleep is rejected, abort");
}
/* @brief Copies a current app to next partition (OTA0-15), after that ESP is rebooting and run this (the next) OTAx.
*/
void copy_current_app_to_next_part_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Copies a current app to next partition (OTA0-15) using esp_ota_write_with_offest(), after that ESP is rebooting and run this (the next) OTAx.
*/
void copy_current_app_to_next_part_with_offset_and_reboot(void)
{
const esp_partition_t *cur_app = esp_ota_get_running_partition();
ESP_LOGI(TAG, "copy current app to next part");
copy_current_app_to_next_part_with_offset(cur_app, get_next_update_partition());
reboot_as_deep_sleep();
}
/* @brief Get running app.
*
* @return The next partition of OTA(OTA0-15).
*/
const esp_partition_t* get_running_firmware(void)
{
const esp_partition_t *configured = esp_ota_get_boot_partition();
const esp_partition_t *running = esp_ota_get_running_partition();
// If a reboot hasn't occurred after app_update(), the configured and running partitions may differ
ESP_LOGI(TAG, "Running partition type %d subtype %d (offset 0x%08"PRIx32")",
running->type, running->subtype, running->address);
ESP_LOGI(TAG, "Configured partition type %d subtype %d (offset 0x%08"PRIx32")",
configured->type, configured->subtype, configured->address);
TEST_ASSERT_NOT_EQUAL(NULL, configured);
TEST_ASSERT_NOT_EQUAL(NULL, running);
return running;
}
/* @brief Get two copies ota_data from otadata partition.
*
* @param[in] otadata_partition - otadata partition.
* @param[out] ota_data_0 - First copy from otadata_partition.
* @param[out] ota_data_1 - Second copy from otadata_partition.
*/
void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1)
{
uint32_t offset = otadata_partition->address;
uint32_t size = otadata_partition->size;
if (offset != 0) {
const esp_ota_select_entry_t *ota_select_map;
ota_select_map = bootloader_mmap(offset, size);
TEST_ASSERT_NOT_EQUAL(NULL, ota_select_map);
memcpy(ota_data_0, ota_select_map, sizeof(esp_ota_select_entry_t));
memcpy(ota_data_1, (uint8_t *)ota_select_map + otadata_partition->erase_size, sizeof(esp_ota_select_entry_t));
bootloader_munmap(ota_select_map);
}
}
/* @brief Writes a ota_data into required sector of otadata_partition.
*
* @param[in] otadata_partition - Partition information otadata.
* @param[in] ota_data - otadata structure.
* @param[in] sec_id - Sector number 0 or 1.
*/
void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id)
{
esp_partition_write(otadata_partition, otadata_partition->erase_size * sec_id, &ota_data[sec_id], sizeof(esp_ota_select_entry_t));
}
/* @brief Makes a corrupt of ota_data.
* @param[in] err - type error
*/
void corrupt_ota_data(corrupt_ota_data_t err)
{
esp_ota_select_entry_t ota_data[2];
const esp_partition_t *otadata_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_DATA_OTA, NULL);
TEST_ASSERT_NOT_EQUAL(NULL, otadata_partition);
get_ota_data(otadata_partition, &ota_data[0], &ota_data[1]);
if (err & CORR_CRC_1_SECTOR_OTA_DATA) {
ota_data[0].crc = 0;
}
if (err & CORR_CRC_2_SECTOR_OTA_DATA) {
ota_data[1].crc = 0;
}
TEST_ESP_OK(esp_partition_erase_range(otadata_partition, 0, otadata_partition->size));
write_ota_data(otadata_partition, &ota_data[0], 0);
write_ota_data(otadata_partition, &ota_data[1], 1);
}
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
/* @brief Sets the pin number to output and sets output level as low. After reboot (deep sleep) this pin keep the same level.
*
* The output level of the pad will be force locked and can not be changed.
* Power down or call gpio_hold_dis will disable this function.
*
* @param[in] num_pin - Pin number
*/
void set_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
gpio_config_t io_conf;
io_conf.intr_type = GPIO_INTR_DISABLE;
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = (1ULL << num_pin);
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
TEST_ESP_OK(gpio_config(&io_conf));
TEST_ESP_OK(gpio_set_level(num_pin, 0));
TEST_ESP_OK(gpio_hold_en(num_pin));
}
/* @brief Unset the pin number hold function.
*/
void reset_output_pin(uint32_t num_pin)
{
TEST_ESP_OK(gpio_hold_dis(num_pin));
TEST_ESP_OK(gpio_reset_pin(num_pin));
}
#endif
void mark_app_valid(void)
{
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
TEST_ESP_OK(esp_ota_mark_app_valid_cancel_rollback());
#endif
}
const esp_partition_t* app_update(void)
{
const esp_partition_t *cur_app = get_running_firmware();
const esp_partition_t* update_partition = esp_ota_get_next_update_partition(NULL);
TEST_ASSERT_NOT_NULL(update_partition);
esp_ota_handle_t update_handle = 0;
TEST_ESP_OK(esp_ota_begin(update_partition, OTA_SIZE_UNKNOWN, &update_handle));
copy_app_partition(update_handle, cur_app);
TEST_ESP_OK(esp_ota_end(update_handle));
TEST_ESP_OK(esp_ota_set_boot_partition(update_partition));
return update_partition;
}

View File

@ -0,0 +1,148 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include "esp_ota_ops.h"
#include "esp_partition.h"
#ifdef __cplusplus
extern "C"
{
#endif
/**
* @brief Enumeration for specifying which OTA data sectors' CRCs to corrupt.
*/
typedef enum {
CORR_CRC_1_SECTOR_OTA_DATA = (1 << 0), /*!< Corrupt CRC only 1 sector of ota_data */
CORR_CRC_2_SECTOR_OTA_DATA = (1 << 1), /*!< Corrupt CRC only 2 sector of ota_data */
} corrupt_ota_data_t;
/**
* @brief Set boot count value in NVS.
* @param boot_count Value to set.
*/
void set_boot_count_in_nvs(uint8_t boot_count);
/**
* @brief Get boot count value from NVS.
* @return Boot count value.
*/
uint8_t get_boot_count_from_nvs(void);
/**
* @brief Copy current app to next partition using OTA handle.
* @param update_handle OTA update handle.
* @param curr_app Current app partition.
*/
void copy_app_partition(esp_ota_handle_t update_handle, const esp_partition_t *curr_app);
/**
* @brief Copy current app to next partition using OTA handle with offset.
* @param update_handle OTA update handle.
* @param curr_app Current app partition.
*/
void copy_app_partition_with_offset(esp_ota_handle_t update_handle, const esp_partition_t *curr_app);
/**
* @brief Get the next OTA update partition.
* @return Pointer to next OTA partition.
*/
const esp_partition_t * get_next_update_partition(void);
/**
* @brief Copy current app to next partition and set boot partition.
* @param cur_app_partition Current app partition.
* @param next_app_partition Next app partition.
*/
void copy_current_app_to_next_part(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition);
/**
* @brief Copy current app to next partition with offset and set boot partition.
* @param cur_app_partition Current app partition.
* @param next_app_partition Next app partition.
*/
void copy_current_app_to_next_part_with_offset(const esp_partition_t *cur_app_partition, const esp_partition_t *next_app_partition);
/**
* @brief Erase OTA data partition.
*/
void erase_ota_data(void);
/**
* @brief Reboot ESP using deep sleep mode.
*/
void reboot_as_deep_sleep(void);
/**
* @brief Copy current app to next partition and reboot.
*/
void copy_current_app_to_next_part_and_reboot(void);
/**
* @brief Copy current app to next partition with offset and reboot.
*/
void copy_current_app_to_next_part_with_offset_and_reboot(void);
/**
* @brief Get running firmware partition.
* @return Pointer to running firmware partition.
*/
const esp_partition_t* get_running_firmware(void);
/**
* @brief Get two OTA data copies from OTA data partition.
* @param otadata_partition OTA data partition.
* @param ota_data_0 First OTA data copy.
* @param ota_data_1 Second OTA data copy.
*/
void get_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data_0, esp_ota_select_entry_t *ota_data_1);
/**
* @brief Write OTA data into required sector of OTA data partition.
* @param otadata_partition OTA data partition.
* @param ota_data OTA data structure.
* @param sec_id Sector number (0 or 1).
*/
void write_ota_data(const esp_partition_t *otadata_partition, esp_ota_select_entry_t *ota_data, int sec_id);
/**
* @brief Corrupt OTA data for testing.
* @param err Type of corruption.
*/
void corrupt_ota_data(corrupt_ota_data_t err);
#if defined(CONFIG_BOOTLOADER_FACTORY_RESET) || defined(CONFIG_BOOTLOADER_APP_TEST)
/**
* @brief Set output pin to low and hold state.
* @param num_pin Pin number.
*/
void set_output_pin(uint32_t num_pin);
/**
* @brief Reset output pin hold function.
* @param num_pin Pin number.
*/
void reset_output_pin(uint32_t num_pin);
#endif
/**
* @brief Mark app as valid and cancel rollback.
*/
void mark_app_valid(void);
/**
* @brief Perform app update and set new boot partition.
* @return Pointer to updated partition.
*/
const esp_partition_t* app_update(void);
#ifdef __cplusplus
}
#endif

View File

@ -20,7 +20,7 @@ TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
)
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
def test_app_update(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
dut.run_all_single_board_cases(timeout=180)
@pytest.mark.generic
@ -33,7 +33,7 @@ def test_app_update(dut: Dut) -> None:
)
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
def test_app_update_xip_psram(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
dut.run_all_single_board_cases(timeout=180)
@pytest.mark.generic
@ -46,7 +46,7 @@ def test_app_update_xip_psram(dut: Dut) -> None:
)
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
def test_app_update_xip_psram_rom_impl(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
dut.run_all_single_board_cases(timeout=180)
@pytest.mark.generic
@ -59,4 +59,19 @@ def test_app_update_xip_psram_rom_impl(dut: Dut) -> None:
)
@idf_parametrize('target', ['esp32', 'esp32c3', 'esp32s3', 'esp32p4'], indirect=['target'])
def test_app_update_with_rollback(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
dut.run_all_single_board_cases(timeout=180)
@pytest.mark.recovery_bootloader
@pytest.mark.parametrize(
'config',
['recovery_bootloader'],
indirect=True,
)
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
def test_recovery_bootloader_update(dut: Dut) -> None:
try:
dut.run_all_single_board_cases(group='recovery_bootloader', timeout=90)
finally:
# Erase recovery bootloader after test because it may interfere with other tests using this runner
dut.serial.erase_flash()

View File

@ -0,0 +1,3 @@
CONFIG_BOOTLOADER_RECOVERY_ENABLE=y
CONFIG_BOOTLOADER_RECOVERY_OFFSET=0x3F0000
CONFIG_PARTITION_TABLE_OFFSET=0x9000

View File

@ -0,0 +1,2 @@
# ESP32C5 supports the Recovery bootloader feature in ROM starting from v1.0 (ECO2)
CONFIG_IDF_TARGET="esp32c5"

View File

@ -0,0 +1,2 @@
# ESP32C61 supports the Recovery bootloader feature in ROM starting from v1.0 (ECO3)
CONFIG_IDF_TARGET="esp32c61"

View File

@ -1,8 +1,37 @@
menu "Bootloader Rollback"
menu "Recovery Bootloader and Rollback"
config BOOTLOADER_RECOVERY_ENABLE
bool "Enable Recovery Bootloader"
depends on SOC_RECOVERY_BOOTLOADER_SUPPORTED
default n
help
The recovery bootloader feature is implemented in the ROM bootloader. It is required for safe OTA
updates of the bootloader. The feature is activated when the eFuse field
(ESP_EFUSE_RECOVERY_BOOTLOADER_FLASH_SECTOR) is set, which defines the flash address of the
recovery bootloader. If activated and the primary bootloader fails to load, the ROM bootloader
will attempt to load the recovery bootloader from the address specified in eFuse.
config BOOTLOADER_RECOVERY_OFFSET
hex "Recovery Bootloader Flash Offset"
depends on BOOTLOADER_RECOVERY_ENABLE
default 0x3F0000
range 0x0 0xFFE000
help
Flash address where the recovery bootloader is stored.
This value must be written to the eFuse field (ESP_EFUSE_RECOVERY_BOOTLOADER_FLASH_SECTOR)
to activate the recovery bootloader in the ROM bootloader. The eFuse can be programmed
using espefuse.py or in the user application with the API esp_efuse_set_recovery_bootloader_offset().
Setting this value in the config allows parttool.py to verify that it does not overlap with existing
partitions in the partition table.
The address must be a multiple of the flash sector size (0x1000 bytes).
The eFuse field stores the offset in sectors.
If the feature is no longer needed or unused, you can burn the 0xFFF value to disable this feature in
the ROM bootloader.
config BOOTLOADER_ANTI_ROLLBACK_ENABLE
bool "Enable bootloader rollback support"
depends on SOC_RECOVERY_BOOTLOADER_SUPPORTED
depends on BOOTLOADER_RECOVERY_ENABLE
default n
help
This option prevents rollback to previous bootloader image with lower security version.

View File

@ -21,6 +21,7 @@ menu "Settings"
config BOOTLOADER_LOG_MODE_BINARY
bool "Binary Log Mode"
select BOOTLOADER_LOG_MODE_BINARY_EN
depends on BOOTLOADER_LOG_VERSION_2
help
Enables binary logging with host-side format string expansion. In this mode, the
format argument of ESP_LOGx, ESP_EARLY_LOG, and ESP_DRAM_LOG macros is stored in a

View File

@ -136,7 +136,7 @@ esp_err_t bootloader_flash_erase_range(uint32_t start_addr, uint32_t size)
#if ESP_TEE_BUILD
#include "esp_fault.h"
#include "esp_flash_partitions.h"
#include "esp32c6/rom/spi_flash.h"
#include "rom/spi_flash.h"
extern bool esp_tee_flash_check_paddr_in_active_tee_part(size_t paddr);
#endif

View File

@ -55,7 +55,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
// SPLL clock on C5 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)

View File

@ -52,7 +52,8 @@ void IRAM_ATTR bootloader_init_mspi_clock(void)
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_DEFAULT);
mspi_ll_fast_set_hs_divider(6);
// MSPI0 and MSPI1 share this core clock register, but only setting to MSPI0 register is valid
mspi_timing_ll_set_core_clock(MSPI_TIMING_LL_MSPI_ID_0, MSPI_TIMING_LL_CORE_CLOCK_MHZ_DEFAULT);
}
void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -18,6 +18,7 @@
#include "hal/cache_hal.h"
#include "hal/cache_ll.h"
#include "hal/mspi_ll.h"
#include "hal/clk_tree_ll.h"
#include "soc/pcr_reg.h"
static const char *TAG = "boot.esp32h21";
@ -80,7 +81,9 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
static void IRAM_ATTR bootloader_flash_clock_init(void)
{
// At this moment, BBPLL should be enabled, safe to switch MSPI clock source to PLL_F64M (default clock src) to raise speed
// To raise the MSPI clock to 64MHz, needs to enable the 64MHz clock source, which is XTAL_X2_CLK
// (FPGA image fixed MSPI0/1 clock to 64MHz)
clk_ll_xtal_x2_enable();
_mspi_timing_ll_set_flash_clk_src(0, FLASH_CLK_SRC_PLL_F64M);
}

View File

@ -25,12 +25,11 @@ void bootloader_ana_super_wdt_reset_config(bool enable);
void bootloader_ana_clock_glitch_reset_config(bool enable);
/**
* @brief Configure analog power glitch reset & glitch reset dref
* @brief Configure analog power glitch reset
*
* @param enable Boolean to enable or disable power glitch reset
* @param dref voltage threshold
*/
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref);
void bootloader_power_glitch_reset_config(bool enable);
#ifdef __cplusplus
}

View File

@ -18,7 +18,7 @@
#include "soc/pmu_reg.h"
#endif
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32
#include "hal/clk_tree_ll.h"
#endif
#include "esp_rom_sys.h"

View File

@ -28,6 +28,7 @@
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
static const char* TAG = "boot_comm";
@ -264,7 +265,10 @@ rtc_retain_mem_t* bootloader_common_get_rtc_retain_mem(void)
#if ESP_ROM_HAS_LP_ROM
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_LOW)
#else
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - sizeof(rtc_retain_mem_t))
/* Since the structure containing the retain_mem_t is aligned on 8 by the linker, make sure we align this
* structure size here too */
#define RETAIN_MEM_SIZE ALIGN_UP(sizeof(rtc_retain_mem_t), 8)
#define RTC_RETAIN_MEM_ADDR (SOC_RTC_DRAM_HIGH - RETAIN_MEM_SIZE)
#endif //ESP_ROM_HAS_LP_ROM
static rtc_retain_mem_t *const s_bootloader_retain_mem = (rtc_retain_mem_t *)RTC_RETAIN_MEM_ADDR;
return s_bootloader_retain_mem;

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -19,6 +19,7 @@
#include "hal/wdt_hal.h"
#include "hal/efuse_hal.h"
#include "esp_bootloader_desc.h"
#include "esp_rom_sys.h"
static const char *TAG = "boot";
@ -34,7 +35,12 @@ void bootloader_clear_bss_section(void)
esp_err_t bootloader_read_bootloader_header(void)
{
/* load bootloader image header */
if (bootloader_flash_read(ESP_BOOTLOADER_OFFSET, &bootloader_image_hdr, sizeof(esp_image_header_t), true) != ESP_OK) {
#if SOC_RECOVERY_BOOTLOADER_SUPPORTED
const uint32_t bootloader_flash_offset = esp_rom_get_bootloader_offset();
#else
const uint32_t bootloader_flash_offset = ESP_PRIMARY_BOOTLOADER_OFFSET;
#endif
if (bootloader_flash_read(bootloader_flash_offset, &bootloader_image_hdr, sizeof(esp_image_header_t), true) != ESP_OK) {
ESP_EARLY_LOGE(TAG, "failed to load bootloader image header!");
return ESP_FAIL;
}

View File

@ -25,20 +25,19 @@ void bootloader_init_mem(void)
* So, at boot disabling these filters. They will enable as per the
* use case by TEE initialization code.
*/
#ifdef SOC_APM_CTRL_FILTER_SUPPORTED
apm_hal_apm_ctrl_filter_enable_all(false);
/* [APM] On power-up, only the HP CPU starts in TEE mode; others default to REE2.
* APM blocks REE0REE2 access by default. C5 ECO2 adds per-peripheral control
* (default REEx blocking), but config support is pending. As a workaround,
* all masters are set to TEE mode.
#if SOC_APM_CTRL_FILTER_SUPPORTED
apm_hal_enable_ctrl_filter_all(false);
/* [APM] On power-up, only the HP CPU starts in TEE mode; others
* default to REE2. APM blocks REE0REE2 access by default.
* Thus, all masters are set to TEE mode.
*/
#if SOC_APM_SUPPORT_TEE_PERI_ACCESS_CTRL
apm_tee_hal_set_master_secure_mode_all(APM_LL_SECURE_MODE_TEE);
apm_hal_set_master_sec_mode_all(APM_SEC_MODE_TEE);
#endif // SOC_APM_SUPPORT_TEE_PERI_ACCESS_CTRL
#endif // SOC_APM_CTRL_FILTER_SUPPORTED
#endif
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
#if CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();
#endif

View File

@ -10,6 +10,8 @@
#include "hal/adc_types.h"
#include "esp_private/regi2c_ctrl.h"
#define I2C_SAR_ADC_INIT_CODE_VAL 2150
void bootloader_random_enable(void)
{
adc_ll_reset_register();
@ -29,8 +31,8 @@ void bootloader_random_enable(void)
ANALOG_CLOCK_ENABLE();
adc_ll_regi2c_init();
adc_ll_set_calibration_param(ADC_UNIT_1, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_2, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_1, I2C_SAR_ADC_INIT_CODE_VAL);
adc_ll_set_calibration_param(ADC_UNIT_2, I2C_SAR_ADC_INIT_CODE_VAL);
adc_digi_pattern_config_t pattern_config = {};
pattern_config.unit = ADC_UNIT_1;

View File

@ -10,6 +10,8 @@
#include "hal/adc_types.h"
#include "esp_private/regi2c_ctrl.h"
#define I2C_SAR_ADC_INIT_CODE_VAL 2150
void bootloader_random_enable(void)
{
adc_ll_reset_register();
@ -29,8 +31,8 @@ void bootloader_random_enable(void)
ANALOG_CLOCK_ENABLE();
adc_ll_regi2c_init();
adc_ll_set_calibration_param(ADC_UNIT_1, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_2, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_1, I2C_SAR_ADC_INIT_CODE_VAL);
adc_ll_set_calibration_param(ADC_UNIT_2, I2C_SAR_ADC_INIT_CODE_VAL);
adc_digi_pattern_config_t pattern_config = {};
pattern_config.unit = ADC_UNIT_2;

View File

@ -10,6 +10,8 @@
#include "hal/adc_types.h"
#include "esp_private/regi2c_ctrl.h"
#define I2C_SAR_ADC_INIT_CODE_VAL 2150
void bootloader_random_enable(void)
{
adc_ll_reset_register();
@ -29,8 +31,8 @@ void bootloader_random_enable(void)
ANALOG_CLOCK_ENABLE();
adc_ll_regi2c_init();
adc_ll_set_calibration_param(ADC_UNIT_1, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_2, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_1, I2C_SAR_ADC_INIT_CODE_VAL);
adc_ll_set_calibration_param(ADC_UNIT_2, I2C_SAR_ADC_INIT_CODE_VAL);
adc_digi_pattern_config_t pattern_config = {};
pattern_config.unit = ADC_UNIT_1;

View File

@ -10,6 +10,8 @@
#include "hal/adc_types.h"
#include "esp_private/regi2c_ctrl.h"
#define I2C_SAR_ADC_INIT_CODE_VAL 2150
void bootloader_random_enable(void)
{
adc_ll_reset_register();
@ -29,8 +31,8 @@ void bootloader_random_enable(void)
ANALOG_CLOCK_ENABLE();
adc_ll_regi2c_init();
adc_ll_set_calibration_param(ADC_UNIT_1, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_2, 0x866);
adc_ll_set_calibration_param(ADC_UNIT_1, I2C_SAR_ADC_INIT_CODE_VAL);
adc_ll_set_calibration_param(ADC_UNIT_2, I2C_SAR_ADC_INIT_CODE_VAL);
adc_digi_pattern_config_t pattern_config = {};
pattern_config.atten = ADC_ATTEN_DB_2_5;

View File

@ -1,108 +1,72 @@
/*
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/soc.h"
#include "soc/adc_reg.h"
#include "soc/pmu_reg.h"
#include "soc/regi2c_saradc.h"
#include "soc/hp_sys_clkrst_reg.h"
#include "soc/lp_adc_reg.h"
#include "esp_private/regi2c_ctrl.h"
#include "esp_rom_regi2c.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/adc_ll.h"
#include "hal/adc_types.h"
// TODO IDF-6497: once ADC API is supported, use the API instead of defining functions and constants here
#include "esp_private/periph_ctrl.h"
#include "esp_private/adc_share_hw_ctrl.h"
#define I2C_SAR_ADC_INIT_CODE_VAL 2166
typedef struct {
int atten;
int channel;
} pattern_item;
typedef struct {
pattern_item item[4];
} pattern_table;
static void adc1_fix_initcode_set(uint32_t initcode_value)
{
uint32_t msb = initcode_value >> 8;
uint32_t lsb = initcode_value & 0xff;
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, msb);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, lsb);
}
//total 4 tables
static void hpadc_sar1_pattern_table_cfg(unsigned int table_idx, pattern_table table)
{
uint32_t wdata = 0;
wdata = (table.item[0].channel << 20 | table.item[0].atten << 18 |
table.item[1].channel << 14|table.item[1].atten << 12 |
table.item[2].channel << 8 |table.item[2].atten << 6 |
table.item[3].channel << 2 |table.item[3].atten);
WRITE_PERI_REG(ADC_SAR1_PATT_TAB1_REG + table_idx * 4, wdata);
}
void bootloader_random_enable(void)
{
pattern_table sar1_table[4] = {};
uint32_t pattern_len = 0;
_adc_ll_reset_register();
_adc_ll_enable_bus_clock(true);
SET_PERI_REG_MASK(HP_SYS_CLKRST_SOC_CLK_CTRL2_REG, HP_SYS_CLKRST_REG_ADC_APB_CLK_EN);
SET_PERI_REG_MASK(HP_SYS_CLKRST_PERI_CLK_CTRL23_REG, HP_SYS_CLKRST_REG_ADC_CLK_EN);
adc_ll_digi_clk_sel(ADC_DIGI_CLK_SRC_XTAL);
adc_ll_digi_controller_clk_div(0, 0, 0);
SET_PERI_REG_MASK(RTCADC_MEAS1_MUX_REG, RTCADC_SAR1_DIG_FORCE);
SET_PERI_REG_MASK(PMU_RF_PWC_REG,PMU_XPD_PERIF_I2C);
uint32_t sar1_clk_div_num = GET_PERI_REG_BITS2((HP_SYS_CLKRST_PERI_CLK_CTRL24_REG),
(HP_SYS_CLKRST_REG_ADC_SAR1_CLK_DIV_NUM_M),
(HP_SYS_CLKRST_REG_ADC_SAR1_CLK_DIV_NUM_S));
SET_PERI_REG_MASK(ADC_CTRL_REG_REG, ADC_START_FORCE); //start force 1
// some ADC sensor registers are in power group PERIF_I2C and need to be enabled via PMU
#ifndef BOOTLOADER_BUILD
regi2c_saradc_enable();
#else
regi2c_ctrl_ll_i2c_sar_periph_enable();
#endif
// enable analog i2c master clock for RNG runtime
ANALOG_CLOCK_ENABLE();
adc1_fix_initcode_set(I2C_SAR_ADC_INIT_CODE_VAL);
adc_ll_regi2c_init();
adc_ll_set_calibration_param(ADC_UNIT_1, I2C_SAR_ADC_INIT_CODE_VAL);
// cfg pattern table
sar1_table[0].item[0].channel = 10; //rand() % 6;
sar1_table[0].item[0].atten = 3;
sar1_table[0].item[1].channel = 10;
sar1_table[0].item[1].atten = 3;
sar1_table[0].item[2].channel = 10;
sar1_table[0].item[2].atten = 3;
sar1_table[0].item[3].channel = 10;
sar1_table[0].item[3].atten = 3;
adc_digi_pattern_config_t pattern_config = {};
pattern_config.unit = ADC_UNIT_1;
pattern_config.atten = ADC_ATTEN_DB_12;
pattern_config.channel = ADC_CHANNEL_10;
adc_ll_digi_set_pattern_table(ADC_UNIT_1, 0, pattern_config);
adc_ll_digi_set_pattern_table(ADC_UNIT_1, 1, pattern_config);
adc_ll_digi_set_pattern_table(ADC_UNIT_1, 2, pattern_config);
adc_ll_digi_set_pattern_table(ADC_UNIT_1, 3, pattern_config);
adc_ll_digi_set_pattern_table_len(ADC_UNIT_1, 1);
hpadc_sar1_pattern_table_cfg(0, sar1_table[0]);
SET_PERI_REG_BITS(ADC_CTRL_REG_REG, ADC_SAR1_PATT_LEN, pattern_len, ADC_SAR1_PATT_LEN_S);
adc_ll_set_controller(ADC_UNIT_1, ADC_LL_CTRL_DIG);
adc_ll_digi_set_power_manage(ADC_UNIT_1, ADC_LL_POWER_SW_ON);
SET_PERI_REG_BITS(ADC_CTRL_REG_REG, ADC_XPD_SAR1_FORCE, 3, ADC_XPD_SAR1_FORCE_S);
SET_PERI_REG_BITS(ADC_CTRL_REG_REG, ADC_XPD_SAR2_FORCE, 3, ADC_XPD_SAR2_FORCE_S);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_ENT_VDD_GRP1, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_DTEST_VDD_GRP1, 0);
CLEAR_PERI_REG_MASK(ADC_CTRL_REG_REG, ADC_START_FORCE);
SET_PERI_REG_MASK(ADC_CTRL2_REG, ADC_TIMER_EN);
SET_PERI_REG_BITS(ADC_CTRL2_REG, ADC_TIMER_TARGET, sar1_clk_div_num * 25, ADC_TIMER_TARGET_S);
while (GET_PERI_REG_MASK(ADC_INT_RAW_REG, ADC_SAR1_DONE_INT_RAW) == 0) { }
SET_PERI_REG_MASK(ADC_INT_CLR_REG, ADC_APB_SARADC1_DONE_INT_CLR);
adc_ll_digi_set_clk_div(15);
adc_ll_digi_set_trigger_interval(100);
adc_ll_digi_trigger_enable();
}
void bootloader_random_disable(void)
{
adc_ll_digi_trigger_disable();
adc_ll_digi_reset_pattern_table();
adc_ll_set_calibration_param(ADC_UNIT_1, 0x0);
adc_ll_set_calibration_param(ADC_UNIT_2, 0x0);
adc_ll_regi2c_adc_deinit();
#ifndef BOOTLOADER_BUILD
regi2c_saradc_disable();
#endif
// disable analog i2c master clock
ANALOG_CLOCK_DISABLE();
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_ENT_VDD_GRP1, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_DTEST_VDD_GRP1, 0);
adc_ll_digi_controller_clk_div(4, 0, 0);
adc_ll_digi_clk_sel(ADC_DIGI_CLK_SRC_XTAL);
}

View File

@ -717,7 +717,25 @@ static void load_image(const esp_image_metadata_t *image_data)
*/
ESP_LOGI(TAG, "Checking flash encryption...");
bool flash_encryption_enabled = esp_flash_encrypt_state();
if (!flash_encryption_enabled) {
if (flash_encryption_enabled) {
#if BOOTLOADER_BUILD
/* Ensure security eFuses are burnt */
esp_efuse_batch_write_begin();
esp_err_t err = esp_flash_encryption_enable_secure_features();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Error setting security eFuses (err=0x%x).", err);
esp_efuse_batch_write_cancel();
return;
}
err = esp_efuse_batch_write_commit();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Error programming security eFuses (err=0x%x).", err);
return;
}
ESP_LOGI(TAG, "Security eFuses are burnt");
#endif // BOOTLOADER_BUILD
} else {
#ifdef CONFIG_SECURE_FLASH_REQUIRE_ALREADY_ENABLED
ESP_LOGE(TAG, "flash encryption is not enabled, and SECURE_FLASH_REQUIRE_ALREADY_ENABLED is set, refusing to boot.");
return;

View File

@ -167,7 +167,7 @@ esp_err_t bootloader_init(void)
#if XCHAL_ERRATUM_572
uint32_t memctl = XCHAL_CACHE_MEMCTL_DEFAULT;
WSR(MEMCTL, memctl);
WSR(XT_REG_MEMCTL, memctl);
#endif // XCHAL_ERRATUM_572
// In RAM_APP, memory will be initialized in `call_start_cpu0`

View File

@ -86,7 +86,6 @@ static void bootloader_super_wdt_auto_feed(void)
static inline void bootloader_hardware_init(void)
{
_regi2c_ctrl_ll_master_enable_clock(true); // keep ana i2c mst clock always enabled in bootloader
regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-8667 Remove this?
regi2c_ctrl_ll_master_configure_clock();
}
@ -94,11 +93,7 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
if (efuse_hal_chip_revision() == 0) {
// decrease power glitch reset voltage to avoid start the glitch reset
uint8_t power_glitch_dref = 0;
bootloader_power_glitch_reset_config(true, power_glitch_dref);
}
bootloader_power_glitch_reset_config(true);
}
esp_err_t bootloader_init(void)

View File

@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
(void)enable;
}
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
void bootloader_power_glitch_reset_config(bool enable)
{
assert(dref < 8);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
//only detect VDDPST POWER GLITCH
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_XTAL, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO1
if (enable) {
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_XTAL, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO1
} else {
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_PWR_GLITCH_RESET_ENA, 0);
}

View File

@ -87,7 +87,6 @@ static void bootloader_super_wdt_auto_feed(void)
static inline void bootloader_hardware_init(void)
{
_regi2c_ctrl_ll_master_enable_clock(true); // keep ana i2c mst clock always enabled in bootloader
regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-9274 Remove this?
regi2c_ctrl_ll_master_configure_clock();
}
@ -95,8 +94,7 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
uint8_t power_glitch_dref = 0;
bootloader_power_glitch_reset_config(true, power_glitch_dref);
bootloader_power_glitch_reset_config(true);
}
esp_err_t bootloader_init(void)

View File

@ -17,18 +17,18 @@ void bootloader_ana_clock_glitch_reset_config(bool enable)
(void)enable;
}
void bootloader_power_glitch_reset_config(bool enable, uint8_t dref)
void bootloader_power_glitch_reset_config(bool enable)
{
assert(dref < 8);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);
//only detect VDDPST POWER GLITCH
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PERIF, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLLBB, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_XPD_VDET_PLL, 0);
REG_SET_FIELD(LP_ANA_FIB_ENABLE_REG, LP_ANA_ANA_FIB_PWR_GLITCH_ENA, 0);//default val for chip from ECO2
if (enable) {
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PERIF, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_VDDPST, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLLBB, dref);
REGI2C_WRITE_MASK(I2C_SAR_ADC, POWER_GLITCH_DREF_VDET_PLL, dref);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0xf);//default val for chip from ECO2
} else {
REG_SET_FIELD(LP_ANA_POWER_GLITCH_CNTL_REG, LP_ANA_POWER_GLITCH_RESET_ENA, 0);
}

View File

@ -1,10 +1,11 @@
/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <strings.h>
#include "hal/ecdsa_ll.h"
#include "esp_flash_encrypt.h"
#include "esp_secure_boot.h"
#include "esp_efuse.h"
@ -36,6 +37,12 @@ esp_err_t esp_secure_boot_enable_secure_features(void)
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
if (ecdsa_ll_is_configurable_curve_supported()) {
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
}
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);

View File

@ -89,8 +89,7 @@ static inline void bootloader_hardware_init(void)
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_RFPLL);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_FORCE_RFPLL);
//TODO: [ESP32H21] IDF-11550, regi2c atomic clock
regi2c_ctrl_ll_master_enable_clock(true); // keep ana i2c mst clock always enabled in bootloader
_regi2c_ctrl_ll_master_enable_clock(true); // keep ana i2c mst clock always enabled in bootloader
regi2c_ctrl_ll_master_configure_clock();
}

View File

@ -144,7 +144,7 @@ esp_err_t bootloader_init(void)
#if XCHAL_ERRATUM_572
uint32_t memctl = XCHAL_CACHE_MEMCTL_DEFAULT;
WSR(MEMCTL, memctl);
WSR(XT_REG_MEMCTL, memctl);
#endif // XCHAL_ERRATUM_572
bootloader_ana_reset_config();

View File

@ -23,6 +23,7 @@
#include "soc/soc_caps.h"
#include "hal/cache_ll.h"
#include "spi_flash_mmap.h"
#include "hal/efuse_hal.h"
#define ALIGN_UP(num, align) (((num) + ((align) - 1)) & ~((align) - 1))
@ -119,11 +120,26 @@ void esp_image_bootloader_offset_set(const uint32_t offset)
{
s_bootloader_partition_offset = offset;
ESP_LOGI(TAG, "Bootloader offsets for PRIMARY: 0x%x, Secondary: 0x%" PRIx32, ESP_PRIMARY_BOOTLOADER_OFFSET, s_bootloader_partition_offset);
#if SOC_RECOVERY_BOOTLOADER_SUPPORTED
uint32_t recovery_offset = efuse_hal_get_recovery_bootloader_address();
if (efuse_hal_recovery_bootloader_enabled()) {
ESP_LOGI(TAG, "Bootloader offset for RECOVERY: 0x%" PRIx32, recovery_offset);
} else if (recovery_offset == 0) {
ESP_LOGI(TAG, "Bootloader offset for RECOVERY: has not been set yet");
} else {
ESP_LOGI(TAG, "Bootloader offset for RECOVERY: is disabled");
}
#endif
}
static bool is_bootloader(uint32_t offset)
{
return ((offset == ESP_PRIMARY_BOOTLOADER_OFFSET) || (offset == s_bootloader_partition_offset));
return ((offset == ESP_PRIMARY_BOOTLOADER_OFFSET)
|| (offset == s_bootloader_partition_offset)
#if SOC_RECOVERY_BOOTLOADER_SUPPORTED
|| (efuse_hal_recovery_bootloader_enabled() ? offset == efuse_hal_get_recovery_bootloader_address() : false)
#endif
);
}
static esp_err_t image_load(esp_image_load_mode_t mode, const esp_partition_pos_t *part, esp_image_metadata_t *data)
@ -796,20 +812,27 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
bool map_segment = should_map(load_addr);
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
esp_err_t err = ESP_FAIL;
/* ESP APP descriptor is present in the DROM segment #0 */
if (index == 0 && !is_bootloader(metadata->start_addr)) {
const esp_app_desc_t *app_desc = (const esp_app_desc_t *)bootloader_mmap(segment_data_offs, sizeof(esp_app_desc_t));
if (!app_desc || app_desc->magic_word != ESP_APP_DESC_MAGIC_WORD) {
uint32_t mmu_page_size = 0, magic_word = 0;
const uint32_t mmu_page_size_offset = segment_data_offs + offsetof(esp_app_desc_t, mmu_page_size);
CHECK_ERR(bootloader_flash_read(segment_data_offs, &magic_word, sizeof(uint32_t), true));
CHECK_ERR(bootloader_flash_read(mmu_page_size_offset, &mmu_page_size, sizeof(uint32_t), true));
// Extract only the lowest byte from mmu_page_size (as per image format)
mmu_page_size &= 0xFF;
if (magic_word != ESP_APP_DESC_MAGIC_WORD) {
ESP_LOGE(TAG, "Failed to fetch app description header!");
return ESP_FAIL;
}
// Convert from log base 2 number to actual size while handling legacy image case (value 0)
metadata->mmu_page_size = (app_desc->mmu_page_size > 0) ? (1UL << app_desc->mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
metadata->mmu_page_size = (mmu_page_size > 0) ? (1UL << mmu_page_size) : SPI_FLASH_MMU_PAGE_SIZE;
if (metadata->mmu_page_size != SPI_FLASH_MMU_PAGE_SIZE) {
ESP_LOGI(TAG, "MMU page size mismatch, configured: 0x%x, found: 0x%"PRIx32, SPI_FLASH_MMU_PAGE_SIZE, metadata->mmu_page_size);
}
bootloader_munmap(app_desc);
} else if (index == 0 && is_bootloader(metadata->start_addr)) {
// Bootloader always uses the default MMU page size
metadata->mmu_page_size = SPI_FLASH_MMU_PAGE_SIZE;
@ -836,6 +859,10 @@ static esp_err_t verify_segment_header(int index, const esp_image_segment_header
}
return ESP_OK;
#if SOC_MMU_PAGE_SIZE_CONFIGURABLE
err:
return err;
#endif
}
static bool should_map(uint32_t load_addr)

View File

@ -12,6 +12,10 @@
#include "esp_secure_boot.h"
#include "hal/efuse_hal.h"
#ifdef SOC_ECDSA_SUPPORTED
#include "hal/ecdsa_ll.h"
#endif
#ifndef BOOTLOADER_BUILD
static __attribute__((unused)) const char *TAG = "secure_boot";
@ -341,15 +345,17 @@ bool esp_secure_boot_cfg_verify_release_mode(void)
}
#ifdef SOC_ECDSA_P192_CURVE_DEFAULT_DISABLED
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
if (!secure) {
uint8_t current_curve;
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, &current_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
if (err == ESP_OK) {
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
// If not P256 mode
result &= secure;
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
if (ecdsa_ll_is_configurable_curve_supported()) {
secure = esp_efuse_read_field_bit(ESP_EFUSE_WR_DIS_ECDSA_CURVE_MODE);
if (!secure) {
uint8_t current_curve;
esp_err_t err = esp_efuse_read_field_blob(ESP_EFUSE_ECDSA_CURVE_MODE, &current_curve, ESP_EFUSE_ECDSA_CURVE_MODE[0]->bit_count);
if (err == ESP_OK) {
if (current_curve != ESP_EFUSE_ECDSA_CURVE_MODE_ALLOW_ONLY_P256_BIT_LOCKED) {
// If not P256 mode
result &= secure;
ESP_LOGW(TAG, "Not write disabled ECDSA curve mode (set WR_DIS_ECDSA_CURVE_MODE->1)");
}
}
}
}

View File

@ -29,7 +29,6 @@ set(common_include_dirs
set(ble_mesh_include_dirs
"esp_ble_mesh/common/include"
"esp_ble_mesh/common/tinycrypt/include"
"esp_ble_mesh/core"
"esp_ble_mesh/core/include"
"esp_ble_mesh/core/storage"
@ -42,6 +41,10 @@ set(ble_mesh_include_dirs
"esp_ble_mesh/api"
)
set(ble_mesh_tinycrypt_dirs
"esp_ble_mesh/common/tinycrypt/include"
)
set(ble_mesh_v11_include_dirs
"esp_ble_mesh/lib/include"
"esp_ble_mesh/v1.1/api/core/include"
@ -500,21 +503,6 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/btc/btc_ble_mesh_prov.c"
"esp_ble_mesh/btc/btc_ble_mesh_sensor_model.c"
"esp_ble_mesh/btc/btc_ble_mesh_time_scene_model.c"
"esp_ble_mesh/common/tinycrypt/src/aes_decrypt.c"
"esp_ble_mesh/common/tinycrypt/src/aes_encrypt.c"
"esp_ble_mesh/common/tinycrypt/src/cbc_mode.c"
"esp_ble_mesh/common/tinycrypt/src/ccm_mode.c"
"esp_ble_mesh/common/tinycrypt/src/cmac_mode.c"
"esp_ble_mesh/common/tinycrypt/src/ctr_mode.c"
"esp_ble_mesh/common/tinycrypt/src/ctr_prng.c"
"esp_ble_mesh/common/tinycrypt/src/ecc_dh.c"
"esp_ble_mesh/common/tinycrypt/src/ecc_dsa.c"
"esp_ble_mesh/common/tinycrypt/src/ecc_platform_specific.c"
"esp_ble_mesh/common/tinycrypt/src/ecc.c"
"esp_ble_mesh/common/tinycrypt/src/hmac_prng.c"
"esp_ble_mesh/common/tinycrypt/src/hmac.c"
"esp_ble_mesh/common/tinycrypt/src/sha256.c"
"esp_ble_mesh/common/tinycrypt/src/utils.c"
"esp_ble_mesh/common/atomic.c"
"esp_ble_mesh/common/buf.c"
"esp_ble_mesh/common/common.c"
@ -565,6 +553,26 @@ if(CONFIG_BT_ENABLED)
"esp_ble_mesh/models/server/state_binding.c"
"esp_ble_mesh/models/server/state_transition.c"
"esp_ble_mesh/models/server/time_scene_server.c")
if(NOT CONFIG_BLE_MESH_USE_UNIFIED_CRYPTO)
list(APPEND include_dirs ${ble_mesh_tinycrypt_dirs})
list(APPEND srcs
"esp_ble_mesh/common/tinycrypt/src/aes_decrypt.c"
"esp_ble_mesh/common/tinycrypt/src/aes_encrypt.c"
"esp_ble_mesh/common/tinycrypt/src/cbc_mode.c"
"esp_ble_mesh/common/tinycrypt/src/ccm_mode.c"
"esp_ble_mesh/common/tinycrypt/src/cmac_mode.c"
"esp_ble_mesh/common/tinycrypt/src/ctr_mode.c"
"esp_ble_mesh/common/tinycrypt/src/ctr_prng.c"
"esp_ble_mesh/common/tinycrypt/src/ecc_dh.c"
"esp_ble_mesh/common/tinycrypt/src/ecc_dsa.c"
"esp_ble_mesh/common/tinycrypt/src/ecc_platform_specific.c"
"esp_ble_mesh/common/tinycrypt/src/ecc.c"
"esp_ble_mesh/common/tinycrypt/src/hmac_prng.c"
"esp_ble_mesh/common/tinycrypt/src/hmac.c"
"esp_ble_mesh/common/tinycrypt/src/sha256.c"
"esp_ble_mesh/common/tinycrypt/src/utils.c")
endif()
if(CONFIG_BLE_MESH_V11_SUPPORT)
list(APPEND include_dirs ${ble_mesh_v11_include_dirs})

View File

@ -48,7 +48,7 @@ config BT_BLE_LOG_SPI_OUT_LL_TASK_BUF_SIZE
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 1024
help
SPI transaction buffer size for upper layer task logs.
SPI transaction buffer size for lower layer task logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
@ -56,9 +56,17 @@ config BT_BLE_LOG_SPI_OUT_LL_ISR_BUF_SIZE
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 512
help
SPI transaction buffer size for upper layer ISR logs.
SPI transaction buffer size for lower layer ISR logs.
There will be 2 SPI DMA buffers with the same size.
config BT_BLE_LOG_SPI_OUT_LL_HCI_BUF_SIZE
int "SPI transaction buffer size for lower layer HCI logs"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default 512
help
SPI transaction buffer size for upper layer HCI logs.
There will be 2 SPI DMA buffers with the same size
config BT_BLE_LOG_SPI_OUT_MOSI_IO_NUM
int "GPIO number of SPI MOSI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
@ -94,6 +102,13 @@ config BT_BLE_LOG_SPI_OUT_SYNC_IO_NUM
help
GPIO number of SYNC IO
config BT_BLE_LOG_SPI_OUT_TS_SYNC_SLEEP_SUPPORT
bool "Enable ble log & logic analyzer log time sync sleep support"
depends on BT_BLE_LOG_SPI_OUT_LL_ENABLED
default n
help
Enable ble log & logic analyzer log time sync sleep support
config BT_BLE_LOG_SPI_OUT_FLUSH_TIMER_ENABLED
bool "Enable periodic buffer flush out"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
@ -108,3 +123,18 @@ config BT_BLE_LOG_SPI_OUT_FLUSH_TIMEOUT
default 1000
help
Buffer flush out period in unit of ms
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
bool "Enable LE Audio log output to SPI"
depends on BT_BLE_LOG_SPI_OUT_ENABLED
default n
help
Enable LE Audio log output to SPI
config BT_BLE_LOG_SPI_OUT_LE_AUDIO_BUF_SIZE
int "SPI transaction buffer size for LE Audio logs"
depends on BT_BLE_LOG_SPI_OUT_LE_AUDIO_ENABLED
default 1024
help
SPI transaction buffer size for LE Audio logs.
There will be 2 SPI DMA buffers with the same size.

File diff suppressed because it is too large Load Diff

View File

@ -14,27 +14,33 @@
#include "esp_log.h"
#include "freertos/semphr.h"
// Public typedefs
#define BLE_LOG_SPI_OUT_SOURCE_ESP 0
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY 1
#define BLE_LOG_SPI_OUT_SOURCE_BLUEDROID 2
#define BLE_LOG_SPI_OUT_SOURCE_NIMBLE 3
#define BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM 4
#define BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM 5
#define BLE_LOG_SPI_OUT_SOURCE_ESP_ISR 6
#define BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR 7
#define BLE_LOG_SPI_OUT_SOURCE_USER 0x10
#define BLE_LOG_SPI_OUT_SOURCE_SYNC 0xFE
#define BLE_LOG_SPI_OUT_SOURCE_LOSS 0xFF
// Public enums
enum {
BLE_LOG_SPI_OUT_SOURCE_ESP = 0,
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY,
BLE_LOG_SPI_OUT_SOURCE_BLUEDROID,
BLE_LOG_SPI_OUT_SOURCE_NIMBLE,
BLE_LOG_SPI_OUT_SOURCE_HCI_UPSTREAM,
BLE_LOG_SPI_OUT_SOURCE_HCI_DOWNSTREAM,
BLE_LOG_SPI_OUT_SOURCE_ESP_ISR,
BLE_LOG_SPI_OUT_SOURCE_ESP_LEGACY_ISR,
BLE_LOG_SPI_OUT_SOURCE_LL_HCI,
BLE_LOG_SPI_OUT_SOURCE_LE_AUDIO,
BLE_LOG_SPI_OUT_SOURCE_USER = 0x10,
BLE_LOG_SPI_OUT_SOURCE_SSC = 0xFD,
BLE_LOG_SPI_OUT_SOURCE_SYNC,
BLE_LOG_SPI_OUT_SOURCE_LOSS,
};
// SPI Log Level Definitions
#define BLE_LOG_SPI_OUT_LEVEL_NONE 0 /*!< No log output */
#define BLE_LOG_SPI_OUT_LEVEL_ERROR 1 /*!< Critical errors that SPI driver cannot recover from */
#define BLE_LOG_SPI_OUT_LEVEL_WARN 2 /*!< Recoverable error conditions in SPI communication */
#define BLE_LOG_SPI_OUT_LEVEL_INFO 3 /*!< Informational messages about SPI transactions */
#define BLE_LOG_SPI_OUT_LEVEL_DEBUG 4 /*!< Detailed debug information, such as SPI register values */
#define BLE_LOG_SPI_OUT_LEVEL_VERBOSE 5 /*!< Very detailed debugging logs, potentially flooding output */
#define BLE_LOG_SPI_OUT_LEVEL_MAX 6 /*!< Number of SPI log levels supported */
enum {
BLE_LOG_SPI_OUT_LEVEL_NONE = 0,
BLE_LOG_SPI_OUT_LEVEL_ERROR,
BLE_LOG_SPI_OUT_LEVEL_WARN,
BLE_LOG_SPI_OUT_LEVEL_INFO,
BLE_LOG_SPI_OUT_LEVEL_DEBUG,
BLE_LOG_SPI_OUT_LEVEL_VERBOSE,
BLE_LOG_SPI_OUT_LEVEL_MAX,
};
// Public functions
int ble_log_spi_out_init(void);
@ -50,5 +56,8 @@ int ble_log_spi_out_printf(uint8_t source, const char *format, ...);
int ble_log_spi_out_printf_enh(uint8_t source, uint8_t level, const char *tag, const char *format, ...);
int ble_log_spi_out_write_with_ts(uint8_t source, const uint8_t *addr, uint16_t len);
void ble_log_spi_out_dump_all(void);
void ble_log_spi_out_enable(bool enable);
void ble_log_spi_out_flush(void);
void ble_log_spi_out_le_audio_write(const uint8_t *addr, uint16_t len);
#endif // __BT_SPI_OUT_H__

View File

@ -490,10 +490,10 @@ static bt_status_t btc_init_mem(void) {
#endif
#if BTC_HF_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE
if ((hf_local_param_ptr = (hf_local_param_t *)osi_malloc(BTC_HF_NUM_CB * sizeof(hf_local_param_t))) == NULL) {
if ((hf_local_param_ptr = (hf_local_param_t *)osi_malloc(sizeof(hf_local_param_t))) == NULL) {
goto error_exit;
}
memset((void *)hf_local_param_ptr, 0, BTC_HF_NUM_CB * sizeof(hf_local_param_t));
memset((void *)hf_local_param_ptr, 0, sizeof(hf_local_param_t));
#endif
#if BTC_HF_CLIENT_INCLUDED == TRUE && HFP_DYNAMIC_MEMORY == TRUE

View File

@ -965,7 +965,7 @@ static void btdm_sleep_enter_phase1_wrapper(uint32_t lpcycles)
assert(us_to_sleep > BTDM_MIN_TIMER_UNCERTAINTY_US);
// allow a maximum time uncertainty to be about 488ppm(1/2048) at least as clock drift
// and set the timer in advance
uint32_t uncertainty = (us_to_sleep >> 11);
uint32_t uncertainty = (us_to_sleep / 1000);
if (uncertainty < BTDM_MIN_TIMER_UNCERTAINTY_US) {
uncertainty = BTDM_MIN_TIMER_UNCERTAINTY_US;
}
@ -1701,6 +1701,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
if (ble_log_spi_out_init() != 0) {
ESP_LOGE(BTDM_LOG_TAG, "BLE Log SPI output init failed");
err = ESP_ERR_NO_MEM;
goto error;
}
#endif // CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED

View File

@ -57,17 +57,17 @@ xt_highint4:
wsr a0, CCOMPARE2
/* Enable Timer 2 interrupt */
rsr a0, INTENABLE
rsr a0, XT_REG_INTENABLE
extui a0, a0, 16, 1
bnez a0, 1f
movi a0, 0
xsr a0, INTENABLE /* disable all interrupts */
xsr a0, XT_REG_INTENABLE /* disable all interrupts */
/* And a0 with (1 << 16) for Timer 2 interrupt mask */
addmi a0, a0, (1<<14)
addmi a0, a0, (1<<14)
addmi a0, a0, (1<<14)
addmi a0, a0, (1<<14)
wsr a0, INTENABLE /* Enable Timer 2 */
wsr a0, XT_REG_INTENABLE /* Enable Timer 2 */
1:
#endif
@ -76,37 +76,37 @@ xt_highint4:
s32i a1, a0, 4
s32i a2, a0, 8
s32i a3, a0, 12
rsr a2, EXCSAVE_4 /* holds the value of a0 */
rsr a2, XT_REG_EXCSAVE_4 /* holds the value of a0 */
s32i a2, a0, 0
/* Save special registers */
addi a0, a0, SPECREG_OFFSET
rsr a2, WINDOWBASE
rsr a2, XT_REG_WINDOWBASE
s32i a2, a0, 0
rsr a2, WINDOWSTART
rsr a2, XT_REG_WINDOWSTART
s32i a2, a0, 4
rsr a2, SAR
rsr a2, XT_REG_SAR
s32i a2, a0, 8
rsr a2, LBEG
rsr a2, XT_REG_LBEG
s32i a2, a0, 12
rsr a2, LEND
rsr a2, XT_REG_LEND
s32i a2, a0, 16
rsr a2, LCOUNT
rsr a2, XT_REG_LCOUNT
s32i a2, a0, 20
rsr a2, EPC1
s32i a2, a0, 24
#if CONFIG_ESP32_ECO3_CACHE_LOCK_FIX
movi a0, 0
xsr a0, INTENABLE /* disable all interrupts */
xsr a0, XT_REG_INTENABLE /* disable all interrupts */
movi a2, ~(1<<16)
and a0, a2, a0
wsr a0, INTENABLE
wsr a0, XT_REG_INTENABLE
#endif
/* disable exception mode, window overflow */
movi a0, PS_INTLEVEL(5) | PS_EXCM
wsr a0, PS
wsr a0, XT_REG_PS
rsync
/* Save the remaining physical registers.
@ -153,12 +153,12 @@ xt_highint4:
/* a0 still points to _l4_save_ctx */
/* Can clear WINDOWSTART now, all registers are saved */
rsr a2, WINDOWBASE
rsr a2, XT_REG_WINDOWBASE
/* WINDOWSTART = (1 << WINDOWBASE) */
movi a3, 1
ssl a2
sll a3, a3
wsr a3, WINDOWSTART
wsr a3, XT_REG_WINDOWSTART
_highint4_stack_switch:
movi a0, 0
@ -169,7 +169,7 @@ _highint4_stack_switch:
/* Set up PS for C, disable all interrupts except NMI and debug, and clear EXCM. */
movi a6, PS_INTLEVEL(4) | PS_UM | PS_WOE
wsr a6, PS
wsr a6, XT_REG_PS
rsync
/* Call C handler */
@ -180,7 +180,7 @@ _highint4_stack_switch:
/* Done with C handler; re-enable exception mode, disabling window overflow */
movi a2, PS_INTLEVEL(5) | PS_EXCM /* TOCHECK */
wsr a2, PS
wsr a2, XT_REG_PS
rsync
/* Restore the special registers.
@ -188,13 +188,13 @@ _highint4_stack_switch:
*/
movi a0, _l4_save_ctx + SPECREG_OFFSET
l32i a2, a0, 8
wsr a2, SAR
wsr a2, XT_REG_SAR
l32i a2, a0, 12
wsr a2, LBEG
wsr a2, XT_REG_LBEG
l32i a2, a0, 16
wsr a2, LEND
wsr a2, XT_REG_LEND
l32i a2, a0, 20
wsr a2, LCOUNT
wsr a2, XT_REG_LCOUNT
l32i a2, a0, 24
wsr a2, EPC1
@ -247,12 +247,12 @@ _highint4_stack_switch:
movi a0, _l4_save_ctx
l32i a2, a0, SPECREG_OFFSET + 4
wsr a2, WINDOWSTART
wsr a2, XT_REG_WINDOWSTART
l32i a1, a0, 4
l32i a2, a0, 8
l32i a3, a0, 12
rsr a0, EXCSAVE_4 /* holds the value of a0 before the interrupt handler */
rsr a0, XT_REG_EXCSAVE_4 /* holds the value of a0 before the interrupt handler */
/* Return from the interrupt, restoring PS from EPS_4 */
rfi 4

View File

@ -584,7 +584,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.

View File

@ -119,6 +119,11 @@ struct ext_funcs_t {
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
@ -411,20 +416,22 @@ void esp_bt_read_ctrl_log_from_flash(bool output)
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
bool end = flag ? true : false;
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}

View File

@ -231,7 +231,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP
bool "BLE adv report flow control supported"
depends on (!BT_CTRL_RUN_IN_FLASH_ONLY) || (BT_CTRL_RUN_IN_FLASH_ONLY && BT_CTRL_BLE_SCAN)
depends on BT_CTRL_BLE_SCAN
default y
help
The function is mainly used to enable flow control for advertising reports. When it is enabled,
@ -530,30 +530,31 @@ config BT_CTRL_RUN_IN_FLASH_ONLY
impact on Bluetooth performance.
config BT_CTRL_DTM_ENABLE
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable direct test mode feature"
default n
config BT_CTRL_BLE_MASTER
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE master role feature"
default y
config BT_CTRL_BLE_MASTER
bool "Enable BLE connection feature"
default y
help
If this option is disabled, it is not recommended to use connectable ADV.
config BT_CTRL_BLE_TEST
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE QA test feature"
bool "Enable BLE QA test feature (Not Used)"
default n
config BT_CTRL_BLE_SCAN
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE scan feature"
default y
config BT_CTRL_BLE_SECURITY_ENABLE
depends on BT_CTRL_RUN_IN_FLASH_ONLY
bool "Enable BLE security feature"
default y
config BT_CTRL_BLE_ADV
bool "Enable BLE ADV feature"
default y
config BT_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
bool "Enable enhanced Access Address check in CONNECT_IND"
default n

View File

@ -312,6 +312,17 @@ extern void advFilter_stack_enableDupExcListVsCmd(bool en);
extern void chanSel_stack_enableSetCsaVsCmd(bool en);
#endif // (CONFIG_BT_BLUEDROID_ENABLED || CONFIG_BT_NIMBLE_ENABLED)
extern void ble_dtm_funcs_reset(void);
extern void ble_scan_funcs_reset(void);
extern void ble_42_adv_funcs_reset(void);
extern void ble_init_funcs_reset(void);
extern void ble_con_funcs_reset(void);
extern void ble_cca_funcs_reset(void);
extern void ble_ext_adv_funcs_reset(void);
extern void ble_ext_scan_funcs_reset(void);
extern void ble_base_funcs_reset(void);
extern void ble_enc_funcs_reset(void);
extern uint32_t _bt_bss_start;
extern uint32_t _bt_bss_end;
extern uint32_t _bt_controller_bss_start;
@ -1265,6 +1276,46 @@ static void btdm_funcs_table_ready_wrapper(void)
#if BLE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS_ENABLED
btdm_aa_check_enhance_enable();
#endif
#if CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
// do nothing
#else
ESP_LOGI(BT_LOG_TAG, "Feature Config, ADV:%d, BLE_50:%d, DTM:%d, SCAN:%d, CCA:%d, SMP:%d, CONNECT:%d",
BT_CTRL_BLE_ADV, BT_CTRL_50_FEATURE_SUPPORT, BT_CTRL_DTM_ENABLE, BT_CTRL_BLE_SCAN,
BT_BLE_CCA_MODE, BLE_SECURITY_ENABLE, BT_CTRL_BLE_MASTER);
ble_base_funcs_reset();
#if CONFIG_BT_CTRL_BLE_ADV
ble_42_adv_funcs_reset();
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
ble_ext_adv_funcs_reset();
#endif //
#endif // CONFIG_BT_CTRL_BLE_ADV
#if CONFIG_BT_CTRL_DTM_ENABLE
ble_dtm_funcs_reset();
#endif // CONFIG_BT_CTRL_DTM_ENABLE
#if CONFIG_BT_CTRL_BLE_SCAN
ble_scan_funcs_reset();
#if (BT_CTRL_50_FEATURE_SUPPORT == 1)
ble_ext_scan_funcs_reset();
#endif // (BT_CTRL_50_FEATURE_SUPPORT == 1)
#endif // CONFIG_BT_CTRL_BLE_SCAN
#if (BT_BLE_CCA_MODE != 0)
ble_cca_funcs_reset();
#endif // (BT_BLE_CCA_MODE != 0)
#if CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
ble_enc_funcs_reset();
#endif // CONFIG_BT_CTRL_BLE_SECURITY_ENABLE
#if CONFIG_BT_CTRL_BLE_MASTER
ble_init_funcs_reset();
ble_con_funcs_reset();
#endif // CONFIG_BT_CTRL_BLE_MASTER
#endif // CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY
}
bool bt_async_wakeup_request(void)

View File

@ -681,7 +681,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.
@ -805,3 +805,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature"
default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.

View File

@ -67,7 +67,7 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
@ -98,14 +98,17 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
@ -182,7 +185,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
@ -459,15 +461,9 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE,
};
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
@ -1419,20 +1415,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
bool end = flag ? true : false;
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
@ -1675,7 +1673,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
int IRAM_ATTR
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
{
int i;

View File

@ -192,6 +192,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else

View File

@ -721,7 +721,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.
@ -839,3 +839,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature"
default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.

View File

@ -58,6 +58,7 @@
#include "hal/efuse_hal.h"
#include "soc/rtc.h"
#include "modem/modem_syscon_struct.h"
#if CONFIG_BT_BLE_LOG_SPI_OUT_ENABLED
#include "ble_log/ble_log_spi_out.h"
@ -70,7 +71,7 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
@ -101,17 +102,29 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
#if CONFIG_IDF_TARGET_ESP32C6
void (* _esp_reset_modem)(uint8_t mdl_opts, uint8_t start);
#endif // CONFIG_IDF_TARGET_ESP32C6
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
*/
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
extern void coex_hw_timer_set(uint8_t idx,uint8_t src, uint8_t pti,uint32_t latency, uint32_t perioidc);
extern void coex_hw_timer_enable(uint8_t idx);
extern void coex_hw_timer_disable(uint8_t idx);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
extern int ble_osi_coex_funcs_register(struct osi_coex_funcs_t *coex_funcs);
extern int r_ble_controller_init(esp_bt_controller_config_t *cfg);
extern void esp_ble_controller_info_capture(uint32_t cycle_times);
@ -185,7 +198,9 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
#if CONFIG_IDF_TARGET_ESP32C6
static void esp_reset_modem(uint8_t mdl_opts,uint8_t start);
#endif // CONFIG_IDF_TARGET_ESP32C6
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
@ -463,15 +478,34 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
#if CONFIG_IDF_TARGET_ESP32C6
._esp_reset_modem = esp_reset_modem,
#endif // CONFIG_IDF_TARGET_ESP32C6
.magic = EXT_FUNC_MAGIC_VALUE,
};
static void IRAM_ATTR esp_reset_rpa_moudle(void)
#if CONFIG_IDF_TARGET_ESP32C6
static void IRAM_ATTR esp_reset_modem(uint8_t mdl_opts,uint8_t start)
{
if (mdl_opts == 0x05) {
if (start) {
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_hw_timer_set(0x04, 0x02, 15, 0, 5000);
coex_hw_timer_enable(0x04);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
MODEM_SYSCON.modem_rst_conf.val |= (BIT(16) | BIT(18));
MODEM_SYSCON.modem_rst_conf.val &= ~(BIT(16) | BIT(18));
} else {
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
coex_hw_timer_disable(0x04);
#endif // CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
}
}
}
#endif // CONFIG_IDF_TARGET_ESP32C6
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
@ -1452,20 +1486,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
bool end = flag ? true : false;
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
@ -1708,7 +1744,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
int IRAM_ATTR
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
{
int i;

View File

@ -195,6 +195,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else

View File

@ -716,7 +716,7 @@ config BT_LE_CCA_RSSI_THRESH
int "CCA RSSI threshold value"
depends on BT_LE_TX_CCA_ENABLED
range 20 100
default 20
default 65
help
Power threshold of CCA in unit of -1 dBm.
@ -843,3 +843,10 @@ config BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX
config BT_LE_RXBUF_OPT_ENABLED
bool "Enable rxbuf optimization feature"
default y
config BT_LE_CTRL_FAST_CONN_DATA_TX_EN
bool "Enable fast sending of connection data"
default y
help
If this option is enabled, The Controller will continue to
Send an empty PDU after sending valid connection data within an interval.

View File

@ -66,7 +66,7 @@
#define OSI_COEX_VERSION 0x00010006
#define OSI_COEX_MAGIC_VALUE 0xFADEBEAD
#define EXT_FUNC_VERSION 0x20240422
#define EXT_FUNC_VERSION 0x20250415
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
@ -97,12 +97,16 @@ struct ext_funcs_t {
int (* _ecc_gen_key_pair)(uint8_t *public, uint8_t *priv);
int (* _ecc_gen_dh_key)(const uint8_t *remote_pub_key_x, const uint8_t *remote_pub_key_y,
const uint8_t *local_priv_key, uint8_t *dhkey);
void (* _esp_reset_rpa_moudle)(void);
uint32_t magic;
};
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
typedef void (*interface_func_t) (uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag);
enum {
BLE_LOG_INTERFACE_FLAG_CONTINUE = 0,
BLE_LOG_INTERFACE_FLAG_END,
};
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* External functions or variables
************************************************************************
@ -183,7 +187,6 @@ static int esp_intr_alloc_wrapper(int source, int flags, intr_handler_t handler,
static int esp_intr_free_wrapper(void **ret_handle);
static void osi_assert_wrapper(const uint32_t ln, const char *fn, uint32_t param1, uint32_t param2);
static uint32_t osi_random_wrapper(void);
static void esp_reset_rpa_moudle(void);
static int esp_ecc_gen_key_pair(uint8_t *pub, uint8_t *priv);
static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
const uint8_t *our_priv_key, uint8_t *out_dhkey);
@ -460,15 +463,9 @@ struct ext_funcs_t ext_funcs_ro = {
._os_random = osi_random_wrapper,
._ecc_gen_key_pair = esp_ecc_gen_key_pair,
._ecc_gen_dh_key = esp_ecc_gen_dh_key,
._esp_reset_rpa_moudle = esp_reset_rpa_moudle,
.magic = EXT_FUNC_MAGIC_VALUE,
};
static void IRAM_ATTR esp_reset_rpa_moudle(void)
{
}
static void IRAM_ATTR osi_assert_wrapper(const uint32_t ln, const char *fn,
uint32_t param1, uint32_t param2)
{
@ -1412,20 +1409,22 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if !CONFIG_BT_LE_CONTROLLER_LOG_SPI_OUT_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, uint32_t len_append, const uint8_t *addr_append, uint32_t flag)
{
bool end = flag ? true : false;
bool end = (flag & BIT(BLE_LOG_INTERFACE_FLAG_END));
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#else // !CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_feed_wdts();
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (len && addr) {
for (int i = 0; i < len; i++) { esp_rom_printf("%02x ", addr[i]); }
}
if (len_append && addr_append) {
for (int i = 0; i < len_append; i++) { esp_rom_printf("%02x ", addr_append[i]); }
}
if (end) { esp_rom_printf("\n"); }
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
@ -1667,7 +1666,7 @@ int ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
#endif // CONFIG_BT_LE_DEBUG_REMAIN_SCENE_ENABLED
int IRAM_ATTR
ble_capture_info_user_handler(uint8_t type, uint32_t reason)
ble_capture_info_user_handler(uint8_t type, uint32_t reason, uint32_t param1, uint32_t param2)
{
int i;

View File

@ -192,6 +192,12 @@ extern "C" {
#define DEFAULT_BT_LE_CTRL_ADV_DATA_LENGTH_ZERO_AUX (0)
#endif
#if defined(CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (CONFIG_BT_LE_CTRL_FAST_CONN_DATA_TX_EN)
#else
#define DEFAULT_BT_LE_CTRL_FAST_CONN_DATA_TX_EN (0)
#endif
#ifdef CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#define HCI_UART_EN CONFIG_BT_LE_HCI_INTERFACE_USE_UART
#else

View File

@ -22,10 +22,17 @@ if BLE_MESH
for mesh packets. And this could help avoid collision of
advertising packets.
config BLE_MESH_USE_UNIFIED_CRYPTO
bool "Use the unified BLE tinycrypt implementation"
depends on !BT_LE_CRYPTO_STACK_MBEDTLS && !BT_NIMBLE_CRYPTO_STACK_MBEDTLS
default n
help
Enable this option to use the unified BLE tinycrypt solution
instead of the default one in BLE Mesh stack.
menuconfig BLE_MESH_USE_BLE_50
bool "Support using BLE 5.0 APIs for BLE Mesh"
depends on BLE_MESH_EXPERIMENTAL
depends on IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3
select BT_NIMBLE_50_FEATURE_SUPPORT if BT_NIMBLE_ENABLED
select BT_NIMBLE_EXT_ADV if BT_NIMBLE_ENABLED
select BT_BLE_50_FEATURES_SUPPORTED if BT_BLUEDROID_ENABLED
@ -477,7 +484,7 @@ if BLE_MESH
int "Maximum capacity of solicitation replay protection list"
depends on BLE_MESH_PROXY_SOLIC_PDU_RX
default 2
range 1 255
range 1 65536
help
This option specifies the maximum capacity of the solicitation replay
protection list. The solicitation replay protection list is used to

View File

@ -94,17 +94,16 @@ static inline int adv_send(struct net_buf *buf)
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
struct bt_mesh_adv_data solic_ad[3] = {
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_FLAGS, (BLE_MESH_AD_GENERAL | BLE_MESH_AD_NO_BREDR)),
struct bt_mesh_adv_data solic_ad[2] = {
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
};
#if CONFIG_BLE_MESH_USE_BLE_50
param.primary_phy = BLE_MESH_ADV_PHY_1M;
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, &ad, 3, NULL, 0);
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
#else /* CONFIG_BLE_MESH_USE_BLE_50 */
err = bt_le_adv_start(&param, &ad, 3, NULL, 0);
err = bt_le_adv_start(&param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
#endif /* CONFIG_BLE_MESH_USE_BLE_50 */
} else
#endif

View File

@ -625,6 +625,9 @@ void bt_mesh_adv_common_init(void)
bt_mesh_adv_type_init(BLE_MESH_ADV_DATA, &adv_queue, &adv_buf_pool, adv_alloc);
bt_mesh_adv_type_init(BLE_MESH_ADV_BEACON, &adv_queue, &adv_buf_pool, adv_alloc);
bt_mesh_adv_type_init(BLE_MESH_ADV_URI, &adv_queue, &adv_buf_pool, adv_alloc);
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
bt_mesh_adv_type_init(BLE_MESH_ADV_PROXY_SOLIC, &adv_queue, &adv_buf_pool, adv_alloc);
#endif
#if CONFIG_BLE_MESH_USE_BLE_50
bt_mesh_adv_inst_init(BLE_MESH_ADV_INS, CONFIG_BLE_MESH_ADV_INST_ID);

View File

@ -140,6 +140,9 @@ enum bt_mesh_adv_type {
#endif
BLE_MESH_ADV_BEACON,
BLE_MESH_ADV_URI,
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
BLE_MESH_ADV_PROXY_SOLIC,
#endif
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
BLE_MESH_ADV_BLE,
#endif

View File

@ -667,7 +667,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
interval >>= 1;
interval += (bt_mesh_get_rand() % (interval + 1));
BT_INFO("%u->%u", param->interval_min, interval);
BT_DBG("%u->%u", param->interval_min, interval);
}
#endif
@ -2153,8 +2153,10 @@ static void bt_mesh_bta_gattc_cb(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
for (i = 0; i < ARRAY_SIZE(bt_mesh_gattc_info); i++) {
if (bt_mesh_gattc_info[i].conn.handle == handle) {
if (bt_mesh_gattc_info[i].wr_desc_done == false) {
BT_DBG("Receive notification before finishing to write ccc");
BT_WARN("Receive notification before finishing to write ccc");
#if !CONFIG_BLE_MESH_BQB_TEST
return;
#endif
}
conn = &bt_mesh_gattc_info[i].conn;

View File

@ -70,6 +70,9 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
#endif
#if CONFIG_BLE_MESH_RELAY_ADV_BUF
case BLE_MESH_ADV_RELAY_DATA:
#endif
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
case BLE_MESH_ADV_PROXY_SOLIC:
#endif
case BLE_MESH_ADV_BEACON:
case BLE_MESH_ADV_URI: {
@ -96,9 +99,20 @@ static inline int adv_send(struct bt_mesh_adv_inst *inst, uint16_t *adv_duration
param.primary_phy = BLE_MESH_ADV_PHY_1M;
param.secondary_phy = BLE_MESH_ADV_PHY_1M;
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
err = bt_le_ext_adv_start(inst->id, &param, &ad, 1, NULL, 0);
#if CONFIG_BLE_MESH_PROXY_SOLIC_PDU_TX
if (BLE_MESH_ADV(buf)->type == BLE_MESH_ADV_PROXY_SOLIC) {
bt_mesh_adv_buf_ref_debug(__func__, buf, 3U, BLE_MESH_BUF_REF_SMALL);
struct bt_mesh_adv_data solic_ad[2] = {
BLE_MESH_ADV_DATA_BYTES(BLE_MESH_DATA_UUID16_ALL, 0x59, 0x18),
BLE_MESH_ADV_DATA(BLE_MESH_DATA_SVC_DATA16, buf->data, buf->len),
};
err = bt_le_ext_adv_start(CONFIG_BLE_MESH_ADV_INST_ID, &param, solic_ad, ARRAY_SIZE(solic_ad), NULL, 0);
} else
#endif
{
bt_mesh_adv_buf_ref_debug(__func__, buf, 4U, BLE_MESH_BUF_REF_SMALL);
err = bt_le_ext_adv_start(inst->id, &param, &ad, 1, NULL, 0);
}
}
break;
#if CONFIG_BLE_MESH_SUPPORT_BLE_ADV
@ -303,6 +317,7 @@ static uint32_t received_adv_evts_handle(uint32_t recv_evts)
CONFIG_BLE_MESH_GATT_PROXY_SERVER
if (unlikely(i == BLE_MESH_ADV_PROXY_INS)) {
BT_DBG("Mesh Proxy Advertising auto stop");
bt_mesh_proxy_server_adv_flag_set(false);
} else
#endif
{
@ -366,7 +381,7 @@ void bt_mesh_adv_update(void)
{
#if (CONFIG_BLE_MESH_NODE && CONFIG_BLE_MESH_PB_GATT) || \
CONFIG_BLE_MESH_GATT_PROXY_SERVER
BT_WARN("Mesh Proxy Advertising stopped manually");
BT_DBG("Mesh Proxy Advertising stopped manually");
bt_mesh_proxy_server_adv_stop();
if (adv_insts[BLE_MESH_ADV_PROXY_INS].busy) {
ble_mesh_adv_task_wakeup(ADV_TASK_PROXY_ADV_UPD_EVT);

View File

@ -1223,7 +1223,7 @@ int bt_le_ext_adv_start(const uint8_t inst_id,
interval >>= 1;
interval += (bt_mesh_get_rand() % (interval + 1));
BT_INFO("%u->%u", param->interval_min, interval);
BT_DBG("%u->%u", param->interval_min, interval);
}
#endif

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -31,7 +31,7 @@
static struct bt_mesh_proxy_server {
struct bt_mesh_conn *conn;
bt_mesh_addr_t addr;
enum __attribute__((packed)) {
CLI_NONE,
CLI_PROV,
@ -465,6 +465,7 @@ static void proxy_connected(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn, int
server->conn = bt_mesh_conn_ref(conn);
server->conn_type = CLI_NONE;
memcpy(&server->addr, addr, sizeof(bt_mesh_addr_t));
net_buf_simple_reset(&server->buf);
#if CONFIG_BLE_MESH_RPR_SRV && CONFIG_BLE_MESH_PB_GATT
@ -629,6 +630,12 @@ static ssize_t proxy_write_ccc(bt_mesh_addr_t *addr, struct bt_mesh_conn *conn)
return 0;
}
#if CONFIG_BLE_MESH_BQB_TEST
/* notify maybe received first */
if (server->conn_type == CLI_PROXY) {
return 0;
}
#endif
return -EINVAL;
}
@ -641,6 +648,16 @@ static ssize_t proxy_recv_ntf(struct bt_mesh_conn *conn, uint8_t *data, uint16_t
return -ENOTCONN;
}
#if CONFIG_BLE_MESH_BQB_TEST
/* update conn type if notify received before write ccc */
if (server->conn_type == CLI_NONE) {
server->conn_type = CLI_PROXY;
if (proxy_client_connect_cb) {
proxy_client_connect_cb(&server->addr, server - servers, server->net_idx);
}
}
#endif
if (server->conn_type == CLI_PROXY) {
return proxy_recv(conn, NULL, data, len, 0, 0);
}

View File

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

View File

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

View File

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

View File

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

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