Compare commits

...

3375 Commits

Author SHA1 Message Date
81900f4fb9 Implement i2c_master_multi_buffer_transmit_receive() 2025-12-01 12:44:27 +01:00
Wang Meng Yang
683ddf8a6e Merge branch 'bugfix/a2dp_deinit_crash' into 'master'
fix(bt): fixed crash caused by deinit during A2DP connection initiation

Closes IDFCI-3092, BT-4158, BTQABR2023-617, IDFCI-6268, and BT-4134

See merge request espressif/esp-idf!43534
2025-11-27 09:34:35 +08:00
Adam Múdry
862f000805 Merge branch 'feat/sdmmc_bdl' into 'master'
feat(bdl): Add support for SDMMC

Closes IDF-12751

See merge request espressif/esp-idf!39640
2025-11-26 17:46:10 +01:00
Tomas Rezucha
24efd7f1e7 Merge branch 'ci/reenable_p4_usb_device_tests' into 'master'
ci(usb/device): re-enable usb_device tests for ESP32-P4

Closes IDF-14369 and IDF-14832

See merge request espressif/esp-idf!43734
2025-11-26 14:44:12 +01:00
Roland Dobai
b60860eb7e Merge branch 'fix/cmakev2_unnecessary_config_generation' into 'master'
fix(cmakev2/kconfig): avoid unnecessary sdkconfig generation

Closes IDF-14431

See merge request espressif/esp-idf!43663
2025-11-26 13:32:12 +01:00
Roland Dobai
20e3e8a5af Merge branch 'feat/cmakev2_fast_reflashing' into 'master'
feat(cmakev2/ldgen): provide ldgen with a list of mutable libraries

Closes IDF-14322

See merge request espressif/esp-idf!43672
2025-11-26 13:31:58 +01:00
Jiang Jiang Jian
0638306b11 Merge branch 'bugfix/fix_get_current_band_error_after_set_bandmode' into 'master'
fix(wifi): fix get incorrect current band after set bandmode

Closes WIFIBUG-1575 and WIFIBUG-1588

See merge request espressif/esp-idf!43608
2025-11-26 20:28:28 +08:00
Ondrej Kosta
b111c84f9e Merge branch 'feat/upt_tests_new_runners' into 'master'
feat(ci): updated Ethernet test to align with new runners

Closes IDF-14823

See merge request espressif/esp-idf!43573
2025-11-26 17:52:43 +08:00
Rahul Tank
f888ded5fb Merge branch 'bugfix/check_psync_status' into 'master'
fix(nimble): Add a check for psync before processing

Closes BLERP-2293, BLERP-2397, and BLERP-2414

See merge request espressif/esp-idf!42377
2025-11-26 13:36:24 +05:30
Roland Dobai
e4a050c939 Merge branch 'change/pip_install_eager' into 'master'
CI: Upgrade the full dependency tree of CI-related Python packages

Closes IDF-14409

See merge request espressif/esp-idf!43265
2025-11-26 09:00:52 +01:00
Ren Peiying
a5d3f81c9c Merge branch 'docs/update_translation_for_size' into 'master'
docs: Update translation for size.rst

Closes DOC-12964

See merge request espressif/esp-idf!43702
2025-11-26 15:19:22 +08:00
Roland Dobai
584e8c71fd Merge branch 'ci/unlock_click' into 'master'
Fixed ctx.params resolving for the new Click version

Closes IDF-14158

See merge request espressif/esp-idf!42610
2025-11-26 08:09:59 +01:00
Song Ruo Jing
551b264193 Merge branch 'bugfix/ppa_srm_stuck_on_dma' into 'master'
fix(ppa): fix potential SRM operation stuck on DMA issue

Closes IDFGH-16401

See merge request espressif/esp-idf!42733
2025-11-26 15:01:50 +08:00
Wang Ning
08a3ef14fa Merge branch 'docs/update_twai_api_ref_struct' into 'master'
docs: update heading levels for twai api reference

Closes IDFGH-16815

See merge request espressif/esp-idf!43657
2025-11-26 14:36:26 +08:00
Wang Ning
914dc26402 docs: update heading levels for twai api reference 2025-11-26 14:36:25 +08:00
morris
c68237f5fa Merge branch 'feat/esp32p4_eco5_adc_cali' into 'master'
feat(adc): support ADC calibration on ESP32P4 ECO5

Closes IDF-14357

See merge request espressif/esp-idf!43685
2025-11-26 12:22:20 +08:00
Mahavir Jain
4186f75296 Merge branch 'feat/esp_tee_hw_stack_guard' into 'master'
feat(esp_tee): Support for the RISC-V H/W stack guard with ESP-TEE enabled

Closes IDF-10770 and IDF-14350

See merge request espressif/esp-idf!43162
2025-11-26 09:42:38 +05:30
Wu Zheng Hui
f45c68b63d Merge branch 'feat/enable_wakeup_tests_for_p4_v3' into 'master'
feat(esp_hw_support): re-enable P4 sleep wakeup tests for rev3.0

Closes IDF-14400

See merge request espressif/esp-idf!43674
2025-11-26 12:03:05 +08:00
Song Ruo Jing
a49d44b188 Merge branch 'ci/fix_p4_eco5_test_cases' into 'master'
fix(ci): re-enable p4 eco5 ledc, dma2d, rtc_clk test cases

Closes IDF-14398 and IDFGH-16808

See merge request espressif/esp-idf!43611
2025-11-26 12:00:45 +08:00
Shu Chen
5e33abd510 Merge branch 'feat/support_154_for_h4' into 'master'
feat(802.15.4): supported 802.15.4 for esp32h4

See merge request espressif/esp-idf!43148
2025-11-26 03:52:37 +00:00
xiongweichao
86975e6487 fix(bt): fixed crash caused by deinit during A2DP connection initiation
- Only clean up when idle
2025-11-26 11:31:56 +08:00
C.S.M
d628254a01 Merge branch 'feat/update_esp32s31_system_support' into 'master'
feat(esp32s31): Add esp_system component support

See merge request espressif/esp-idf!43655
2025-11-26 11:06:15 +08:00
Yi Wen Xiu
d061906490 Merge branch 'bugfix/update_thread_ci_testcases' into 'master'
feat(openthread): optimize fail cases in CI test

Closes IDFCI-3019, IDFCI-2537, and IDFCI-3623

See merge request espressif/esp-idf!43576
2025-11-26 11:01:47 +08:00
Ondrej Kosta
4e6b35ca9e feat(ci): updated Ethernet tests to align with new runners 2025-11-25 17:26:49 +01:00
Tomas Rezucha
98af307c66 ci(usb/device): re-enable usb_device tests for ESP32-P4 2025-11-25 16:06:57 +01:00
Erhan Kurubas
c9bee75b52 Merge branch 'fix/int_wdt_double_exception' into 'master'
fix(espcoredump): prevent double exception during int_wdt panic with custom stack

Closes IDF-9361

See merge request espressif/esp-idf!43185
2025-11-25 14:03:03 +01:00
Chen Ji Chang
a20b2fab82 Merge branch 'feat/esp_hal_rmt' into 'master'
feat(hal): graudate the RMT hal driver into a new component

Closes IDF-14083 and IDF-13684

See merge request espressif/esp-idf!43336
2025-11-25 19:48:52 +08:00
Konstantin Kondrashov
b7f0fb2827 Merge branch 'contrib/github_pr_17797' into 'master'
feat(esp_event): Allow an event carry more data without malloc (GitHub PR)

Closes IDFGH-16709

See merge request espressif/esp-idf!43128
2025-11-25 19:39:52 +08:00
morris
7540cc3ca0 Merge branch 'ci/add_esp_hal_components_in_g0_test' into 'master'
refactor(g0_components): update component list to dynamically include esp_hal_* components

See merge request espressif/esp-idf!43703
2025-11-25 19:28:05 +08:00
Roland Dobai
8b8301d845 ci(gitlab): Upgrade the full dependency tree of CI-related Python packages
The eager upgreade policy should upgrade the full dependency tree and
not just the packages listed in the requirements file. The disadvantage
is some extra time for package resolution.

This upgrade policy is applied to CI-related packages only because we
don't want this to be used for customer-facing packages and/or provide
the customers with a different environment to that tested in the CI.
2025-11-25 11:22:21 +01:00
Gao Xu
abbb392d70 Merge branch 'feat/p4_eco5_rng' into 'master'
feat(rng): support P4 ECO5 TRNG

Closes IDF-13521

See merge request espressif/esp-idf!42196
2025-11-25 17:41:41 +08:00
gaoxu
c5c586af3e ci(adc): re-enable ADC test on ESP32P4 2025-11-25 17:27:20 +08:00
C.S.M
4becb6dbf6 feat(esp32s31): Add esp_system component support 2025-11-25 17:11:59 +08:00
Jakub Kocka
402cf47f7a ci: Fixed MacOS default shell command 2025-11-25 09:58:53 +01:00
Jakub Kocka
6c2551b4a6 fix: Fixed ctx.params resolving because of the new Click 2025-11-25 09:58:53 +01:00
renpeiying
4b53e05572 docs: Update translation for size.rst 2025-11-25 16:41:40 +08:00
Zhang Wen Xu
7886209dfa Merge branch 'feature/change_ot_psram_default_config' into 'master'
feat(openthread): Use PSRAM by default for OpenThread message buffers when PSRAM is enabled

See merge request espressif/esp-idf!43512
2025-11-25 07:55:08 +00:00
Konstantin Kondrashov
6866cd1d95 Merge branch 'fix/p4_v3_efuse_missed_defines' into 'master'
fix(efuse): Fix test where size of field was obtained incorrectly and missed SOC defines

Closes IDF-14403

See merge request espressif/esp-idf!43574
2025-11-25 15:53:34 +08:00
Peter Dragun
2c0372a66c Merge branch 'tools/monitor_autocolor_docs' into 'master'
docs: Add note about automatic log coloring in IDF Monitor

Closes IDF-11995 and DOC-13023

See merge request espressif/esp-idf!43403
2025-11-25 15:27:00 +08:00
morris
e4192f88e6 refactor(g0_components): update component list to dynamically include esp_hal_* components 2025-11-25 15:21:48 +08:00
Song Ruo Jing
672005c642 fix(ppa): fix potential SRM operation stuck on DMA issue
Apply a workaound to bypass macro block order function in PPA SRM
when specific conditions are met to avoid SRM operation getting stuck
2025-11-25 15:19:41 +08:00
yiwenxiu
0898f62669 feat(openthread): optimize fail cases in CI test 2025-11-25 14:30:17 +08:00
Chen Jichang
2cb84ecf95 feat(hal): graudate the RMT hal driver into a new component 2025-11-25 14:21:01 +08:00
C.S.M
cb5f2ff4c2 Merge branch 'feat/update_esp32s31_g0_support' into 'master'
feat(esp32s31): Add g0 component support

See merge request espressif/esp-idf!43599
2025-11-25 13:49:55 +08:00
morris
c7f4c62e00 Merge branch 'refactor/bitscrambler_in_esp_hal_dma' into 'master'
refactor(hal): bitscrambler hal -> esp_hal_dma, usj hal -> esp_hal_usb

Closes IDF-14353

See merge request espressif/esp-idf!43542
2025-11-25 13:06:26 +08:00
Zhang Shuxian
bcedb69c37 docs: Update CN translation 2025-11-25 11:54:43 +08:00
Peter Dragun
007ae938c1 docs: Add note about automatic log coloring in IDF Monitor 2025-11-25 11:46:55 +08:00
gaoxu
2b24530b33 feat(rng): support P4 ECO5 TRNG 2025-11-25 11:17:48 +08:00
Song Ruo Jing
d33e8a48ad fix(ppa): YUV444 cannot be a PPA SRM output color mode 2025-11-25 10:53:15 +08:00
Song Ruo Jing
9079838b64 docs(ppa): add a note about bilinear scaling algorithm in PPA SRM
Closes https://github.com/espressif/esp-idf/issues/17531
2025-11-25 10:53:15 +08:00
gaoxu
7a352eb676 feat(adc): support ADC calibration on ESP32P4 ECO5 2025-11-25 10:44:01 +08:00
Island
c6f14a5663 Merge branch 'bugfix/fix_ble_scan_enable_timeout' into 'master'
Fixed scan HCI command timeout issue on ESP32

Closes BT-4153 and BLERP-2404

See merge request espressif/esp-idf!43344
2025-11-25 10:30:54 +08:00
C.S.M
b450150fff feat(esp32s31): Add g0 component support 2025-11-25 10:16:08 +08:00
morris
8981838fbe Merge branch 'fix/mcpwm_p4eco_psram_test' into 'master'
chor(mcpwm): replace p4 psram test

Closes IDF-14412

See merge request espressif/esp-idf!43651
2025-11-25 08:33:20 +08:00
Erhan Kurubas
69924c2322 Merge branch 'refactor_apptrace_uart' into 'master'
Refactor apptrace uart

Closes IDF-4323, IDF-4804, and IDF-7823

See merge request espressif/esp-idf!42885
2025-11-24 23:19:11 +01:00
Konstantin Kondrashov
ccee6d23a2 fix(efuse): Fix test where size of field was obtained incorrectly
When the eFuse field consists of single descriptor, its size can be
taken from struct member 'bit_count'. However, when the field consists of
multiple descriptors, the size should be obtained via esp_efuse_get_field_size()
2025-11-24 17:13:54 +02:00
Konstantin Kondrashov
3f519e8a97 fix(efuse): Adds missing SOC defines for ESP32-P4 v3 2025-11-24 17:13:54 +02:00
wuzhenghui
0728cfef74 feat(esp_hw_support): re-enable P4 sleep wakeup tests for rev3.0 2025-11-24 22:10:13 +08:00
Frantisek Hrbata
ca3974c937 feat(cmakev2/ldgen): provide ldgen with a list of mutable libraries
The build system keeps track of each component source. Currently
there are four types of sources:

1. "project_components" - project components
2. "project_extra_components" - components from EXTRA_COMPONENT_DIRS
3. "project_managed_components" - custom project dependencies managed by the IDF Component Manager
4. "idf_components" - ESP-IDF built-in components, typically under /components

This can be used to identify the component libraries that are likely to
change during application development and pass them to ldgen as mutable
libraries. Add all components with "project_components" as their source
as mutable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-24 14:58:02 +01:00
Laukik Hase
7c24682643 feat(esp_tee): Add support for the RISC-V H/W stack guard mechanism 2025-11-24 18:49:06 +05:30
Frantisek Hrbata
4ba40bce20 fix(cmakev2/kconfig): avoid unnecessary sdkconfig generation
Add a helper function `__should_generate_sdkconfig()` that checks
whether the sdkconfig file should be generated.  The
`__generate_sdkconfig()` function can be called multiple times, such as
when the initial sdkconfig is generated at the start of the build
process and later after additional components are fetched by the
component manager.  There might be no components fetched by the
component manager, for example, in the hello_world example, or the
downloaded components may not contain any configuration files. In such
cases, there is no need to regenerate the sdkconfig. This helper
function stores the list of configuration files in the
`__PREV_KCONFIGS`, `__PREV_KCONFIG_PROJBUILDS`, and
`__PREV_SDKCONFIG_RENAMES` build properties at its end, and at the
beginning, it compares them with the current lists of configuration
files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-24 13:44:01 +01:00
Erhan Kurubas
f2c75dcf52 change(app_trace): implement uart without driver APIs 2025-11-24 12:17:30 +01:00
Martin Vychodil
80ed20959d Merge branch 'feat/nvs_iteration_statistics_examples' into 'master'
feat(examples/storage): add nvs statistics and iteration examples

Closes DOC-12742

See merge request espressif/esp-idf!42327
2025-11-24 17:54:31 +08:00
Konstantin Kondrashov
18eee1daa6 Merge branch 'feat/esp_timer_systimer_h4_support' into 'master'
feat(systimer): Support systimer/esp_timer/OS tick for esp32h4

Closes IDF-12375, IDF-12377, and IDF-12327

See merge request espressif/esp-idf!43613
2025-11-24 17:44:04 +08:00
Fu Hanxi
26a01e843c Merge branch 'ci/known-failure-dut-id' into 'master'
ci: pytest-ignore skip using dut id

Closes CII-44

See merge request espressif/esp-idf!43539
2025-11-24 10:25:04 +01:00
Shen Meng Jing
a9523977dc Merge branch 'docs/sync_en_and_cn_docs' into 'master'
docs: Sync EN and CN docs without translation label

Closes DOC-13026

See merge request espressif/esp-idf!43628
2025-11-24 16:10:04 +08:00
morris
96120a5219 chor(mcpwm): replace p4 psram test 2025-11-24 16:03:46 +08:00
Sudeep Mohanty
256dd4df96 Merge branch 'fix/reenable_freertos_esp_system_test_apps_for_p4_eco5' into 'master'
Re-enable freertos and esp_system test apps for p4 eco5

Closes IDF-14419 and IDF-14421

See merge request espressif/esp-idf!43630
2025-11-24 08:30:07 +01:00
Gao Xu
8fc0489408 Merge branch 'fix/adc_continuous_iram_config' into 'master'
fix(adc): fix ESP32/S2 panic when use continuous ADC

Closes IDFGH-16388

See merge request espressif/esp-idf!41732
2025-11-24 14:14:58 +08:00
Sudeep Mohanty
25c7a8179d ci(esp_system): Re-enable esp_system tests for esp32p4 2025-11-24 10:25:48 +05:30
Sudeep Mohanty
4832c72163 ci(freertos): Re-enable freertos tests for esp32p4 2025-11-24 10:24:27 +05:30
zhanghaipeng
c5e50ccd19 fix(bt): Update esp32 libbtdm_app.a (15a18b1a)
- fix(ble): fixed BLE enable scan timeout
 - fix(ble): fixed crash in "btdm_controller_task"
2025-11-24 12:14:37 +08:00
Shen Mengjing
bc79ba454d docs: Sync EN and CN docs without translation label 2025-11-24 11:40:24 +08:00
Chen Ji Chang
16b81515b2 Merge branch 'fix/update_h4_mp_final_ld' into 'master'
fix(esp_rom): update H4 MP ld files

See merge request espressif/esp-idf!43590
2025-11-24 11:29:28 +08:00
gaoxu
93f4b9c13f fix(adc): fix ESP32/S2 panic when use continuous ADC 2025-11-24 11:16:07 +08:00
Rahul Tank
c9090a57f2 fix(nimble): Add a check for psync before processing 2025-11-24 08:27:41 +05:30
zhuanghang
6928688a1e fix(802.15.4): fix sfd_cnt and crc_cnt reg for 154 on h2 c5 c6 2025-11-24 10:39:09 +08:00
zhuanghang
ceef28fe9e feat(802.15.4): supported 802.15.4 for esp32h4 2025-11-24 10:39:01 +08:00
Island
470db615fb Merge branch 'feat/show_how_to_use_smp_in_blufi_example' into 'master'
feat(ble/blufi): Support setting BLE encryption for blufi

Closes BLERP-2232 and DOC-13032

See merge request espressif/esp-idf!41779
2025-11-24 10:31:03 +08:00
morris
49d5fa4532 Merge branch 'fix/usb_phy_on_linux' into 'master'
fix(usb): Fix USB PHY mocking on linux target

Closes IEC-418

See merge request espressif/esp-idf!43563
2025-11-23 11:48:32 +08:00
Marius Vikhammer
6a07ab8834 Merge branch 'bugfix/libc_unligned_opt_p4_eco5' into 'master'
fix(libc): fixed P4 ECO5 always using sub opt. version of memcpy and similar

Closes IDF-14415

See merge request espressif/esp-idf!43580
2025-11-21 23:49:03 +08:00
Konstantin Kondrashov
0084024973 feat(systimer): Support systimer/esp_timer/OS tick for esp32h4 2025-11-21 15:18:43 +02:00
Omar Chebib
41e9060961 Merge branch 'fix/reenable_eh_frame' into 'master'
ci: re-enable eh_frame for the ESP32-P4

Closes IDF-14424

See merge request espressif/esp-idf!43579
2025-11-21 20:56:35 +08:00
Song Ruo Jing
f4a5108d49 fix(uart): fix clock deinitialization in uart_detect_bitrate_stop 2025-11-21 20:41:19 +08:00
Song Ruo Jing
c10ddb0f52 fix(ci): improve rtc_clk test stability on esp32 32k xtal 2025-11-21 20:41:19 +08:00
Song Ruo Jing
5ca9827894 fix(uart): fix parenthesis typo on UART_INTR_CONFIG_FLAG macro
No real impact on the logic, just typo fix
Closes https://github.com/espressif/esp-idf/issues/17885
2025-11-21 20:41:19 +08:00
Song Ruo Jing
9f750b58be fix(ci): re-enable p4 eco5 ledc, dma2d, rtc_clk test cases 2025-11-21 20:41:19 +08:00
Zhang Shuxian
feff20614e docs: Update CN translation and improve formatting 2025-11-21 20:38:20 +08:00
Omar Chebib
0853adcac7 Merge branch 'ci/reenable_cxx_tests' into 'master'
ci: re-enable cxx tests_apps and examples for the ESP32-P4

Closes IDF-14402

See merge request espressif/esp-idf!43581
2025-11-21 20:37:56 +08:00
yinqingzhao
5e27f6623a fix(wifi): fix get incorrect current band after set bandmode 2025-11-21 19:25:26 +08:00
Michael (XIAO Xufeng)
92f4ade659 Merge branch 'feat/add_c5_v102_config' into 'master'
hw_support: add new config for c5 v1.2 and c61 v1.1

See merge request espressif/esp-idf!43532
2025-11-21 19:20:59 +08:00
Wang Meng Yang
289e04dcbe Merge branch 'bugfix/bt_idf_ci' into 'master'
fix(bt/examples): Fixed test_bt_l2cap not finding ESP_SDP_CREATE_RECORD_COMP_EVT

Closes IDFCI-6518

See merge request espressif/esp-idf!43428
2025-11-21 18:55:05 +08:00
C.S.M
16be3c2bfe Merge branch 'feat/update_esp32s31_efuse_rom' into 'master'
feat(esp32s31): Add efuse and esp_rom support

See merge request espressif/esp-idf!43533
2025-11-21 18:29:49 +08:00
zhanghaipeng
60a028fb17 feat(ble/blufi): Support setting BLE encryption for blufi 2025-11-21 16:41:33 +08:00
Chen Jichang
0ce7125942 fix(esp_rom): update H4 MP ld files 2025-11-21 16:18:23 +08:00
morris
b1fdb0db2b refactor(hal_usb): move USB Serial JTAG HAL from hal component 2025-11-21 16:10:17 +08:00
morris
bc064a353a refactor(hal_dma): move bitscrambler from hal component
because bitscrambler can't live without DMA, it's highly binded with the
GDMA peripheral.
2025-11-21 16:10:16 +08:00
Omar Chebib
473dd5c134 ci: re-enable cxx tests_apps and examples for the ESP32-P4 2025-11-21 15:54:41 +08:00
Wang Meng Yang
e48d37f307 Merge branch 'feat/add_param_indicate_create_spp_records' into 'master'
feat(bt): Add an SPP API parameter to indicate whether to create the SPP record

See merge request espressif/esp-idf!43485
2025-11-21 15:47:10 +08:00
Marius Vikhammer
aefab81f37 fix(libc): fixed P4 ECO5 always using sub opt. version of memcpy and similar 2025-11-21 15:45:18 +08:00
Omar Chebib
58e2fc7926 ci: re-enable eh_frame for the ESP32-P4 2025-11-21 15:40:40 +08:00
Konstantin Kondrashov
2b0edd6714 Merge branch 'fix/p4_v3_ipc_isr_example_test' into 'master'
fix(examples): Fix IPC ISR RISC-V test for ESP32-P4 rev3

Closes IDF-14423

See merge request espressif/esp-idf!43555
2025-11-21 15:37:59 +08:00
Armando (Dou Yiwen)
852d56a8f0 Merge branch 'feat/esp_hal_cam' into 'master'
cam:graudate the camera hal driver into a new component

Closes IDF-14277

See merge request espressif/esp-idf!43169
2025-11-21 07:25:03 +00:00
Island
b978710fd1 Merge branch 'feat/support_bhost2025_52' into 'master'
feat(ble/nimble): support runtime allocation for mempool

Closes BLERP-2341

See merge request espressif/esp-idf!42963
2025-11-21 15:24:01 +08:00
Marius Vikhammer
673c27dcf8 Merge branch 'bugfix/stall_wfi' into 'master'
fix(system): fixed p4 eco5 getting stuck when stalling other CPU

See merge request espressif/esp-idf!43577
2025-11-21 15:16:20 +08:00
Zhang Wen Xu
8df5b40dcc Merge branch 'fix/remove_the_duplicate_macro_definition' into 'master'
fix(openthread): remove the duplicate macro definition

See merge request espressif/esp-idf!43540
2025-11-21 07:04:02 +00:00
Fu Hanxi
6c585a0e18 Merge branch 'ci/simplify-ci' into 'master'
Ci/simplify ci

Closes IDFCI-6717

See merge request espressif/esp-idf!43157
2025-11-21 07:34:24 +01:00
C.S.M
fc697158a5 feat(esp32s31): Add efuse and esp_rom support 2025-11-21 11:43:27 +08:00
igor.udot
083200737c ci: pytest-ignore skip using dut id 2025-11-21 11:43:15 +08:00
Island
80454bbc59 Merge branch 'bugfix/bug_ble_max_device_record' into 'master'
fix(ble/bluedroid): Fixed BLE incorrect device record count issue

Closes BLERP-2405

See merge request espressif/esp-idf!43450
2025-11-21 11:37:47 +08:00
Marius Vikhammer
47d9739bb5 Merge branch 'ci/enable_esp_timer_eco5' into 'master'
ci(esp_timer): re-enable ci tests for esp-timer on p4 eco5

See merge request espressif/esp-idf!43575
2025-11-21 11:34:09 +08:00
Island
e7e5a82a02 Merge branch 'bugfix/fix_ble_no_conn_and_disconn_evt' into 'master'
fix(ble/bluedroid): Fixed missing BLE connect and disconnect events

Closes BLERP-2340

See merge request espressif/esp-idf!42962
2025-11-21 11:25:03 +08:00
Mahavir Jain
70be8e404d Merge branch 'bugfix/protocomm_sec1_validation' into 'master'
fix(protocomm): add validation for Security1 client verifier data

See merge request espressif/esp-idf!43545
2025-11-21 08:49:29 +05:30
Mahavir Jain
130fdc7ce7 Merge branch 'fix/fix_bootloader_skip_validate_in_deep_sleep' into 'master'
fix(bootloader): fix signature verification skip in deep sleep scenarios

Closes IDFGH-14871

See merge request espressif/esp-idf!43067
2025-11-21 08:49:12 +05:30
armando
66da426c83 feat(hal):graudate the camera hal driver into a new component 2025-11-21 10:51:28 +08:00
Marius Vikhammer
461c0d8f65 Merge branch 'bugfix/p4_zcmp_fix' into 'master'
fix(interrupts): fixed interrupted related issues due to ZCMP on P4 ECO5

See merge request espressif/esp-idf!43523
2025-11-21 10:46:35 +08:00
Marius Vikhammer
32ebe139c4 fix(system): fixed p4 eco5 getting stuck when stalling other CPU 2025-11-21 10:12:40 +08:00
Marius Vikhammer
9a32500f74 ci(esp_timer): re-enable ci tests for esp-timer on p4 eco5 2025-11-21 09:47:40 +08:00
Marius Vikhammer
257ee931cd Merge branch 'bugfix/p4_eco5_init_arrays' into 'master'
fix(system): fixed constructors not working properly on P4 ECO5

Closes IDF-14425

See merge request espressif/esp-idf!43547
2025-11-21 09:42:26 +08:00
Marius Vikhammer
9632e67efd Merge branch 'bugfix/ulp_p4_eco5_fixes' into 'master'
fix(lp-core): fixed rtc mem conflict on p4 eco5 between app and ULP

Closes IDF-14422

See merge request espressif/esp-idf!43544
2025-11-21 09:40:45 +08:00
Marius Vikhammer
963bc0fa5e Merge branch 'bugfix/p4_eco_5_rom_tests' into 'master'
fix(rom): fixed systimer hal implementation from ROM always being used on P4

Closes IDF-14417 and IDF-14420

See merge request espressif/esp-idf!43538
2025-11-21 09:21:53 +08:00
Roland Dobai
69a5c7384f Merge branch 'change/add-support-for-kconfig-report' into 'master'
Change/add support for kconfig report

Closes IDF-11816

See merge request espressif/esp-idf!37165
2025-11-20 23:30:54 +01:00
Mahavir Jain
0da64692c4 Merge branch 'update/update_certs_bundle' into 'master'
Update esp_crt_bundle certificates

See merge request espressif/esp-idf!43500
2025-11-20 21:54:26 +05:30
Lu Wei Ke
7c4e2d0aa2 Merge branch 'docs/update_bt_common_homepage' into 'master'
docs: Add intro and brief descriptions to Bluetooth Common API home page

Closes DOC-11910

See merge request espressif/esp-idf!42582
2025-11-21 00:20:14 +08:00
Lu Wei Ke
c69210ef09 Merge branch 'docs/update_bt_classic_homepage' into 'master'
docs: Add intro and profile summaries to Bluetooth Classic API home page

Closes DOC-11911

See merge request espressif/esp-idf!42612
2025-11-21 00:13:19 +08:00
Roland Dobai
cbfda195a8 Merge branch 'feat/update_ccache_to_4.12.1' into 'master'
feat(tools): Updated ccache 4.11.2 -> 4.12.1

Closes IDFGH-16658

See merge request espressif/esp-idf!43521
2025-11-20 13:41:44 +01:00
Tomas Rezucha
da7d0e6979 fix(usb): Fix USB PHY mocking on linux target 2025-11-20 12:44:11 +01:00
luweike
ac4cd16cdf docs: Add intro and brief descriptions to Bluetooth Common API home page 2025-11-20 18:56:15 +08:00
luweike
83a26231a6 docs: Add intro and profile summaries to Bluetooth Classic API home page 2025-11-20 18:53:46 +08:00
Konstantin Kondrashov
da720ce74c fix(examples): Fix IPC ISR RISC-V test for ESP32-P4 rev3
Remove checks for MSTATUS and MCAUSE values that
may vary in different chip revisions.
2025-11-20 12:38:30 +02:00
Erhan Kurubas
083999290e fix(espcoredump): prevent double exception during int_wdt panic with custom stack 2025-11-20 11:14:42 +01:00
Marius Vikhammer
641420c5e0 fix(system): fixed constructors not working properly on P4 ECO5 2025-11-20 17:37:48 +08:00
Ondrej Kosta
1e6f49d178 Merge branch 'chore/update-protocol-eth-connect' into 'master'
feat(protocol_examples_common): Use Ethernet Init component

Closes IDF-14227

See merge request espressif/esp-idf!42265
2025-11-20 17:28:17 +08:00
morris
8799b8bc72 Merge branch 'contrib/github_pr_17803' into 'master'
Fixes for reference pages (GitHub PR)

Closes IDFGH-16714

See merge request espressif/esp-idf!43085
2025-11-20 17:27:44 +08:00
Marius Vikhammer
0961294484 fix(interrupts): fixed interrupted related issues due to ZCMP on P4 ECO5 2025-11-20 17:07:45 +08:00
Marius Vikhammer
cd0e6ec2ca fix(lp-core): fixed rtc mem conflict on p4 eco5 between app and ULP 2025-11-20 17:03:23 +08:00
Mahavir Jain
9c6f6c7470 fix(protocomm): add validation for Security1 client verifier data
Add checks to validate client_verify_data pointer and length before
processing in handle_session_command1. Prevents NULL pointer dereference
when client omits verifier data in Session_Command1, which could cause
device crash during provisioning (remote DoS attack).
2025-11-20 14:22:40 +05:30
C.S.M
3f7a004cee Merge branch 'feat/update_esp32s31_socs_3' into 'master'
feat(esp32s31): Add soc register from t~z and manually headers

See merge request espressif/esp-idf!43511
2025-11-20 16:46:40 +08:00
Fu Hanxi
accfcc96f4 ci: move host test unittest jobs to pytest 2025-11-20 09:07:22 +01:00
Fu Hanxi
8e130d4cd6 Merge branch 'ci/macos-timeout' into 'master'
ci: set macos timeout

See merge request espressif/esp-idf!43515
2025-11-20 08:56:44 +01:00
Xu Si Yu
330c174117 fix(openthread): remove the duplicate macro definition 2025-11-20 15:51:39 +08:00
Marius Vikhammer
4ebad0a47d fix(rom): fixed systimer hal implementation from ROM always being used on P4 2025-11-20 15:36:26 +08:00
morris
c48a08803f Merge branch 'feat/dedic_gpio_esp32h4' into 'master'
feat(gpio): support fast gpio driver on esp32h4

Closes IDF-12401 and IDF-12391

See merge request espressif/esp-idf!43472
2025-11-20 15:24:28 +08:00
Xiao Xufeng
762fceb5f8 feat(hw_support): add config version for c61 v1.1 2025-11-20 14:41:41 +08:00
Xiao Xufeng
419c2ddfcf feat(hw_support): add config version for c5 v1.2 2025-11-20 14:41:41 +08:00
Island
6dbd7b4183 Merge branch 'feat/ble_log_compression_modularized' into 'master'
refactor(ble): modularize compressed log scripts for better maintainability

Closes BLERP-2400, BLERP-2401, and BLERP-2402

See merge request espressif/esp-idf!43473
2025-11-20 14:33:24 +08:00
morris
795f5c6aa3 Merge branch 'fix/touch_bit_swap_esp32' into 'master'
fix(touch): Add missing bit swap to fix channel 8 and 9

See merge request espressif/esp-idf!43268
2025-11-20 14:26:11 +08:00
Mahavir Jain
aef3656efc Merge branch 'fix/https_server_cert_generation_command' into 'master'
fix(https_server): Fixed the server cert generation command

See merge request espressif/esp-idf!43432
2025-11-20 10:29:11 +05:30
Mahavir Jain
32da6e0f03 fix(bootloader): fix signature verification skip in deep sleep scenario
For CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP enabled and exit from
deep sleep case the secure boot signature verification must be skipped
to improve the wakeup performance.

Closes https://github.com/espressif/esp-idf/issues/15590
2025-11-20 10:28:27 +05:30
Kevin (Lao Kaiyao)
5d49a68b0f Merge branch 'refactor/esp_hal_parlio' into 'master'
feat(hal): graudate the parlio hal driver into a new component

Closes IDF-14099

See merge request espressif/esp-idf!43359
2025-11-20 12:41:28 +08:00
Zhang Wen Xu
e50f12974d Merge branch 'fix/ieee802154_energy_detect_result' into 'master'
fix(802.15.4): fixed energy detection result

See merge request espressif/esp-idf!43242
2025-11-20 04:26:35 +00:00
C.S.M
958a4bffc8 feat(esp32s31): Add soc register from t~z and manually headers 2025-11-20 11:58:03 +08:00
He Binglin
0b9dce89f4 Merge branch 'bugfix/esp_idf_h2_flash_cs_hold' into 'master'
fix(esp_hw_support): fix flash cs unhold during sleep when pd top in esp32h2

Closes IDF-7359

See merge request espressif/esp-idf!43509
2025-11-20 10:44:44 +08:00
Jiang Jiang Jian
5b04e26ebc Merge branch 'bugfix/esp_idf_h21_static_cpu_retention' into 'master'
fix(esp_hw_support): fix sleep_cpu_static.c compile error

See merge request espressif/esp-idf!43474
2025-11-20 10:33:14 +08:00
Chen Chen
33e56cb115 Merge branch 'fix/ledc_isr_handle' into 'master'
fix(ledc): fix potential null dereference issue & add test case

See merge request espressif/esp-idf!43505
2025-11-20 10:05:22 +08:00
C.S.M
395aa3fe4f Merge branch 'feat/update_esp32s31_socs_2' into 'master'
feat(esp32s31): Add soc register from j~s

See merge request espressif/esp-idf!43489
2025-11-20 00:29:01 +08:00
Vaia Patta
ef4f475a73 docs: fix anonymous flags in various structs
I noticed a few structs where the flags didn't show up correctly in the
docs.
Naming the flag struct makes the individual flags appear properly in the
nested struct.

Merges https://github.com/espressif/esp-idf/pull/17803
Closes https://github.com/espressif/esp-idf/issues/17804
2025-11-19 23:12:17 +08:00
glmfe
f398594982 feat(protocol_examples_common): Use Ethernet Init component
- Refactored protocol_examples_common to use ethernet_init component
2025-11-19 15:58:12 +01:00
Marek Fiala
a279eeac29 feat(tools): Updated ccache 4.11.2 -> 4.12.1
Closes https://github.com/espressif/esp-idf/issues/17756
2025-11-19 15:54:26 +01:00
Marek Fiala
0ce86cbb7b refactor(tools): test_idf_tools.py ruff changes 2025-11-19 15:53:25 +01:00
Frantisek Hrbata
b07432e42c Merge branch 'feat/cmakev2_size_targets' into 'master'
fix(cmakev2): add size report targets

Closes IDF-14184

See merge request espressif/esp-idf!43490
2025-11-19 15:18:08 +01:00
Erhan Kurubas
1a4828cca8 Merge branch 'update_jtag_docs' into 'master'
Update jtag docs

Closes OCD-525

See merge request espressif/esp-idf!43210
2025-11-19 13:38:13 +01:00
Martin Vychodil
a6e7046c30 Merge branch 'feat/fatfs_r_0_16' into 'master'
feat(storage/fatfs): Update to FatFS R0.16

Closes IDF-14371

See merge request espressif/esp-idf!42810
2025-11-19 19:47:42 +08:00
Fu Hanxi
9603ea6af8 ci: set macos timeout 2025-11-19 11:47:30 +01:00
Frantisek Hrbata
e08aca162a feat(cmakev2/size): add idf_create_size_report function
The idf_create_size_report function allows for the creation of size
report targets based on the generated link map file. The size report
targets are created using the TARGET option name: "<target>",
"<target>-files", and "<target>-components". These size report targets
are added to the idf_default_project with the TARGET set to "size",
resulting in the creation of "size", "size-files", and "size-components"
targets for the default project.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-19 11:35:36 +01:00
Frantisek Hrbata
e216eeeebc fix(cmakev2/project): unset global variables in idf_project_init macro
The idf_project_init macro is evaluated within the global variable
scope, and currently, there are a few variables still set. Let's ensure
all variables are properly unset to avoid polluting the global variable
namespace.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-19 11:34:03 +01:00
Frantisek Hrbata
bba4446ee0 fix(cmakev2/build): display a warning when the MINIMAL_BUILD property is set
The MINIMAL_BUILD property is not relevant in cmakev2, as only
components explicitly linked through targets are included in the build
by design. Display a warning when this outdated build property is set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-19 11:34:03 +01:00
Frantisek Hrbata
2b35b5b1bb fix(cmakev2/build): fix the generation of the link map file
The link flag for generating the map file is currently added globally to
the link_options. If multiple executables are generated, the link map
file is overwritten by the last created executable. Since cmakev2
supports building multiple executables, the link map file options need
to be set for each executable individually. To address this, add a new
MAPFILE_TARGET option to the idf_build_executable function. When set,
the link map file will be generated by the linker, and a target
specified in the MAPFILE_TARGET option will be created for the map file.

This also splits the idf_project_default macro.  Only the
idf_project_init macro needs be called within the global scope, as it
includes the project_include.cmake files and the cmake version of the
configuration. The remaining functionality of the idf_project_default
macro is implemented in a __project_default helper function to avoid
polluting the global variable space.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-19 11:33:57 +01:00
Frantisek Hrbata
e97027214e fix(cmakev2/build): pass binary target to idf_build_generate_metadata
Currently, the `idf_build_generate_metadata` function takes an
executable target as an argument, and the binary name is stored in the
`EXECUTABLE_BINARY` property. This approach is inconvenient because a
single executable might generate multiple binary images, making it
unreliable to store the binary image name in the executable property due
to the N:1 relationship. To address this, pass the binary image target
instead of the executable target to the `idf_build_generate_metadata`
function. This change is facilitated by linking the binary target,
executable target, and library interface targets with the following
properties:

binary:EXECUTABLE_TARGET -> executable:LIBRARY_INTERFACE -> library

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-19 11:30:18 +01:00
Frantisek Hrbata
5130b7d228 fix(cmakev2/project): remove temporary workaround for partition and bootloader flash dependencies
With commit b719292b75 ("refactor(build-system): Simplify flash target creation"),
partition table and bootloader components are correctly adding their
dependency on the flash target, so there is no need for this to be done
in the build system. This removes the temporary workaround.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-19 11:26:07 +01:00
Fu Hanxi
fa776a7d50 ci: move host test jobs into host-test.yml 2025-11-19 10:54:26 +01:00
Fu Hanxi
18bb5bacca ci: move the retry_failed_jobs to pre_check stage 2025-11-19 10:51:20 +01:00
Fu Hanxi
8ae96e188f ci: cleanup gcc_static_analyzer and .rules:build 2025-11-19 10:50:53 +01:00
Chen Chen
3ae65813ca fix(ledc): fix potential null dereference issue & add test case 2025-11-19 17:31:58 +08:00
Fu Hanxi
2988329deb ci: cleanup build_template_app jobs 2025-11-19 10:29:26 +01:00
Fu Hanxi
04a9e1ba23 ci: cleanup build_clang_test_apps jobs 2025-11-19 10:29:23 +01:00
Fu Hanxi
0f0d97f958 ci: cleanup after_script:build related rules 2025-11-19 10:27:07 +01:00
Fu Hanxi
aa60a836b5 ci: upload build junit files 2025-11-19 10:26:56 +01:00
Fu Hanxi
5304e95ac5 ci: remove generate_build_child_pipeline.py 2025-11-19 10:26:53 +01:00
Fu Hanxi
6adb0ea457 ci: remove temp minio variables 2025-11-19 10:23:17 +01:00
Sudeep Mohanty
c7b4804ffa Merge branch 'feat/cmakev2_features_and_test_updates' into 'master'
Enable more cmakev2 CI tests and support dfu, uf2 targets

Closes IDF-14181, IDF-14182, and IDF-14183

See merge request espressif/esp-idf!43460
2025-11-19 10:15:08 +01:00
Xu Si Yu
bc432615f2 feat(openthread): Use PSRAM by default for OpenThread message buffers when PSRAM is enabled 2025-11-19 17:05:50 +08:00
Armando (Dou Yiwen)
47d6c9c227 Merge branch 'fix/fix_sdspi_ci_pytest' into 'master'
sdspi: fixed sdspi pytest check

Closes IDFCI-2620

See merge request espressif/esp-idf!43464
2025-11-19 08:33:41 +00:00
hebinglin
8043966ff0 fix(esp_hw_support): fix flash cs unhold during sleep when pd top in esp32h21 2025-11-19 16:20:38 +08:00
hrushikesh.bhosale
be9ec4c179 fix(https_server): Fixed the server cert generation command
- Added the SAN field in the openssl command, to make it
compatible with modern browsers
2025-11-19 13:33:11 +05:30
Shen Mengjing
15c6cff6eb docs: Edit the CN translation from AI 2025-11-19 15:35:20 +08:00
Fu Hanxi
11ae9be9ea Merge branch 'ci/macos-tart' into 'master'
Ci/macos tart

Closes ITOPS-165

See merge request espressif/esp-idf!43346
2025-11-19 08:26:55 +01:00
Chen Chen
a59110d9cc Merge branch 'fix/isp_typos' into 'master'
fix(isp): fix some typos in isp document

See merge request espressif/esp-idf!43458
2025-11-19 15:22:25 +08:00
Fu Hanxi
8857ea99a1 Merge branch 'chore/size_json_artifact' into 'master'
chore(ci): update artifact pattern for size.json

Closes CII-6

See merge request espressif/esp-idf!43486
2025-11-19 08:08:16 +01:00
laokaiyao
873d90218c refactor(parlio): refactor of the private parlio caps 2025-11-19 14:32:40 +08:00
luoxu
0cf6f50179 refactor(ble): modularize compressed log scripts for better maintainability 2025-11-19 14:21:35 +08:00
laokaiyao
377c4d2f39 feat(hal): graudate the parlio hal driver into a new component 2025-11-19 14:16:02 +08:00
Kevin (Lao Kaiyao)
c94d08b9f2 Merge branch 'reafactor/esp_hal_i2s' into 'master'
feat(hal): graudate the I2S hal driver into a new component

Closes IDF-14078

See merge request espressif/esp-idf!43267
2025-11-19 14:08:20 +08:00
xiongweichao
67efd21f3d feat(bt): Adds an SPP API parameter to indicate whether to create SPP record 2025-11-19 06:06:01 +00:00
C.S.M
33d29b4365 feat(esp32s31): Add soc register from j~s 2025-11-19 11:32:08 +08:00
Chen Chen
70a0fb5b7f Merge branch 'fix/handle_shared_intr' into 'master'
Fix/handle shared intr

Closes IDF-12904

See merge request espressif/esp-idf!43149
2025-11-19 11:05:37 +08:00
C.S.M
929c24d6dd Merge branch 'feat/update_esp32s31_socs' into 'master'
feat(esp32s31): Add esp32s31 soc header files part1 (auto generate from a~i)

See merge request espressif/esp-idf!43471
2025-11-19 10:59:39 +08:00
Wu Zheng Hui
27bb77e77c Merge branch 'feat/support_get_pm_lock_aquired_counts' into 'master'
feat(esp_pm): add APIs to get PM lock statistics

Closes IDFGH-16676

See merge request espressif/esp-idf!43002
2025-11-19 10:52:40 +08:00
Wang Meng Yang
f5d1a87f1e Merge branch 'bugfix/refactor_c3_hci_example' into 'master'
refactor(example/bt): Refactor controller_hci_uart example for ESP32-C3/S3 to use UHCI driver

Closes IDF-14345

See merge request espressif/esp-idf!43270
2025-11-19 10:20:16 +08:00
Jan Procházka
110591ab6e fix(touch): Add missing bit swap to fix channel 8 and 9 2025-11-19 10:10:50 +08:00
Espressif BOT
96eb7ae213 change(mbedtls/crt_bundle): Update esp_crt_bundle certificates 2025-11-19 10:00:39 +08:00
Mahavir Jain
4f7e2a3597 Merge branch 'contrib/github_pr_17894' into 'master'
docs: fix typos in some files (GitHub PR)

Closes IDFGH-16818

See merge request espressif/esp-idf!43463
2025-11-19 00:09:09 +05:30
Fu Hanxi
0922674c04 ci: run macos with tart runners 2025-11-18 17:02:11 +01:00
Jan Beran
542a4f7d1f ci: move kconfig documentation under tools codeowners 2025-11-18 20:42:38 +08:00
Jan Beran
bf9b9a0259 change(kconfig): add support for configuration report 2025-11-18 20:42:38 +08:00
Alexey Gerenkov
4cf7aebfa0 Merge branch 'extend_freertos_debug_table' into 'master'
change(freertos): add task count and pointer width to OpenOCD debug table

See merge request espressif/esp-idf!43438
2025-11-18 19:21:01 +08:00
morris
3b450469d9 Merge branch 'contrib/github_pr_17858' into 'master'
fix (GitHub PR)

Closes IDFGH-14772

See merge request espressif/esp-idf!43405
2025-11-18 18:51:49 +08:00
Evgeny Torbin
d78c9317be ci: update artifact pattern for size.json 2025-11-18 10:44:40 +01:00
Harshal Patil
b873a82d5b Merge branch 'feat/generic_key_mgr_key_types' into 'master'
Store key_len field in the key_config

See merge request espressif/esp-idf!42692
2025-11-18 15:12:03 +05:30
Sudeep Mohanty
cad80548b1 test(cmakev2): Enable test_build_uf2 for buildv2 CI tests 2025-11-18 15:08:56 +05:30
Sudeep Mohanty
94809d6638 feat(cmakev2): Add uf2 target support for cmakev2
This commit adds support for uf2 targets for cmake2. The following
changes have been made:
- Adds a new tools/cmakev2/uf2.cmake.
- Adds the idf_create_uf2() function to create the uf2 targets. This
  function now takes the executable as an argument thus allowing the uf2
  target to be created per-executable.
- idf_project_default() is updated to create the uf2 targets.
2025-11-18 15:08:53 +05:30
Sudeep Mohanty
a609d5bcd2 test(cmakev2): Enable test_build_dfu for buildv2 CI tests 2025-11-18 15:08:20 +05:30
Sudeep Mohanty
5b0d81bc50 feat(cmakev2): Add dfu target support for cmakev2
This commit adds support for dfu targets for cmake2. The following
changes have been made:
- Adds a new tools/cmakev2/dfu.cmake file on similar lines as the
  tools/cmake/dfu.cmake file.
- Adds the idf_create_dfu() function to create the dfu targets. This
  function now takes the executable as an argument thus allowing the dfu
  target to be created per-executable.
- idf_project_default() is updated to create the dfu target.
2025-11-18 15:08:12 +05:30
Mahavir Jain
7da52654ba Merge branch 'feature/enable_ecc_support_for_esp32h4' into 'master'
feat: enable ecc peripheral support for ESP32H4

Closes IDF-12264

See merge request espressif/esp-idf!41408
2025-11-18 15:03:16 +05:30
Roland Dobai
a295be6658 Merge branch 'feat/ldgen_fast_reflashing' into 'master'
feat(ldgen): initial support for fast reflashing

Closes IDF-14213

See merge request espressif/esp-idf!42780
2025-11-18 10:28:49 +01:00
morris
892611191b feat(gpio): support fast gpio driver on esp32h4 2025-11-18 16:59:27 +08:00
laokaiyao
bab5a7a8ed refactor(i2s): refactor of the private i2s caps 2025-11-18 16:13:14 +08:00
Ondrej Kosta
e3af4267f1 Merge branch 'fix/multicast_filter_test' into 'master'
fix(esp_eth): maked esp_eth_test_l2 more robust

Closes IDFCI-6131

See merge request espressif/esp-idf!43328
2025-11-18 16:04:12 +08:00
C.S.M
961bd0cf78 Merge branch 'feat/introduce_esp32s31' into 'master'
feat(esp32s31): Introduce new target esp32s31

See merge request espressif/esp-idf!43316
2025-11-18 15:55:16 +08:00
laokaiyao
e8f39b4c8d feat(hal): graudate the I2S hal driver into a new component 2025-11-18 15:47:16 +08:00
morris
614221e9d5 Merge branch 'fix/no_function_call_in_min_max' into 'master'
refactor: avoid function calls inside MIN/MAX macros

See merge request espressif/esp-idf!43429
2025-11-18 15:14:48 +08:00
Song Ruo Jing
30e81e35df Merge branch 'bugfix/uart_c5_stuck_in_update' into 'master'
fix(uart): watchdog got triggered due to uart sclk not exist

Closes IDFGH-15851, IDFGH-16685, IDFGH-16687, IDFCI-2846, and TIDF-228846

See merge request espressif/esp-idf!43279
2025-11-18 14:59:58 +08:00
wuzhenghui
a5b5f19101 docs(esp_pm): add PM lock debugging and profiling documentation 2025-11-18 14:59:22 +08:00
hebinglin
91b4ac82c9 fix(esp_hw_support): fix sleep_cpu_static.c compile error 2025-11-18 14:58:48 +08:00
C.S.M
e0d62e664b feat(esp32s31): Add soc registers from a~i 2025-11-18 14:41:25 +08:00
armando
359ada9413 fix(ci): fixed sdspi pytest check 2025-11-18 14:10:22 +08:00
Sudeep Mohanty
f72292b0d7 test(cmakev2): Enable test_rebuild.py for buildv2 CI tests
The test_rebuild_no_changes test verifies that running idf.py build
successively without any file changes results in identical build
artifacts on the second run (i.e., nothing gets rebuilt).

This test was failing in buildv2 because it expected kconfig_menus.json
to be present in build/config/ after a normal build. However, in
cmakev2, kconfig_menus.json is not generated during regular builds.

In cmakev1, kconfig_menus.json was generated globally during every
build alongside other config files (sdkconfig.h, sdkconfig.cmake, etc).

In cmakev2, kconfig_menus.json generation does not happend for
normal builds because it depends on the Kconfig menu hierarchy
and cannot be generated globally. It must be generated per-executable.

Hence, this commit updates the artefacts list for cmakev2 to not expect
the kconfig_menus.json file during a build/re-build action.
2025-11-18 10:12:12 +05:30
Sudeep Mohanty
bf8129433a test(cmakev2): Enabled test_idf_extensions.py for builv2 CI tests 2025-11-18 10:12:12 +05:30
Chen Chen
47f5ac96fb fix(intr_alloc): Fix ISR allocate methods in several drivers 2025-11-18 12:33:03 +08:00
Chen Chen
4467a58fb0 fix(isp): fix some typos in isp document 2025-11-18 12:21:13 +08:00
khanhkhanhlele
22ad2e6c4c Fix typos in some files 2025-11-18 11:17:45 +07:00
Jiang Jiang Jian
2e0748aab9 Merge branch 'bugfix/ftm_terminate_asap' into 'master'
bugfix(wifi): Add the termination dialog token in ASAP FTM

Closes WIFIBUG-1504

See merge request espressif/esp-idf!43404
2025-11-18 11:25:30 +08:00
zhanghaipeng
9bfd9c5340 fix(ble/bluedroid): Fixed BLE incorrect device record count issue 2025-11-18 11:25:22 +08:00
morris
484bc2ff4b Merge branch 'change/psram_200m_as_default' into 'master'
psram: use 200MHz as default on p4

See merge request espressif/esp-idf!43427
2025-11-18 11:02:42 +08:00
Jiang Jiang Jian
504c82ff6a Merge branch 'bugfix/update_wifi_fragment_doc' into 'master'
docs(wifi): update wifi fragment doc

Closes WIFI-7097

See merge request espressif/esp-idf!43044
2025-11-18 10:50:27 +08:00
morris
3875c659d4 Merge branch 'feat/mcpwm_support_h21' into 'master'
feat(mcpwm): support mcpwm on esp32h21

Closes IDF-11601 and IDF-11602

See merge request espressif/esp-idf!43351
2025-11-18 09:36:59 +08:00
Marius Vikhammer
d3ffbccfb8 Merge branch 'ci/ulp_fsm_i_wr_reg' into 'master'
test(ulp): added larger delay in ULP FSM I_WR_REG instruction test

Closes IDFCI-3495 and IDFCI-3334

See merge request espressif/esp-idf!43420
2025-11-18 09:30:25 +08:00
Jiang Jiang Jian
75cb5ad5ff Merge branch 'feat/phy_lib_update_c5eco3_coex' into 'master'
feat(phy): updated phy lib for ESP32-C5 ECO2/ECO3 coex

See merge request espressif/esp-idf!43381
2025-11-17 23:31:50 +08:00
Song Ruo Jing
8955f13944 fix(uart): fix some wdt get triggered due to uart sclk not exist on C5
Interrupt wdt would get triggered on uart_driver_install if uart driver was deleted before
Closes https://github.com/espressif/esp-idf/issues/17779

RTC wdt would get triggered on esp_restart if uart driver was deleted before
2025-11-17 22:29:56 +08:00
morris
aa1fd9c611 refactor: avoid function calls inside MIN/MAX macros 2025-11-17 22:17:54 +08:00
Song Ruo Jing
c16d50dd20 fix(ci): increase memory leak threshold for uart rs485 test app 2025-11-17 21:52:19 +08:00
Song Ruo Jing
335273c53e fix(uart): fix send_size calculation in uart_write_bytes
MIN() macro is only an expansion of a conditional operator.
xRingbufferGetCurFreeSize was called twice in the original code,
which may return different values in two calls, leading to incorrect
send_size calculation and eventually could trigger task watchdog.
2025-11-17 21:52:18 +08:00
Song Ruo Jing
f4703a2629 fix(gpio): oe control by register only take effect when func sel is GPIO 2025-11-17 21:52:18 +08:00
Song Ruo Jing
c4c932ad2b fix(console): UART0 TX pin was not properly disabled
Closes https://github.com/espressif/esp-idf/issues/16764
Closes https://github.com/espressif/esp-idf/issues/17459
2025-11-17 21:52:18 +08:00
Erhan Kurubas
799de719d7 change(freertos): add task count and pointer width to OpenOCD debug table 2025-11-17 14:48:27 +01:00
Island
ce13ec7630 Merge branch 'fix/ble_mesh_cpp_compile_issue' into 'master'
fix(ble_mesh): resolve C++ compilation issue in net.h

Closes BLERP-2398 and BLERP-2399

See merge request espressif/esp-idf!43418
2025-11-17 20:44:44 +08:00
Chen Chen
c6ab28f336 feat(mcpwm): support mcpwm on esp32h21 2025-11-17 19:01:16 +08:00
Armando (Dou Yiwen)
1275fb1f42 Merge branch 'feat/make_p4_rev3_default' into 'master'
p4: make v3 as default

See merge request espressif/esp-idf!43142
2025-11-17 10:10:05 +00:00
morris
a7d2fb7d02 Merge branch 'feat/sdm_esp32h21' into 'master'
Support SDM, GPIO Glitch Filter, Fast GPIO on esp32h21

Closes IDF-11573, IDF-11612, and IDF-11621

See merge request espressif/esp-idf!43324
2025-11-17 17:52:10 +08:00
Akshat Agrawal
6f1618f69d bugfix(wifi): Add the termination dialog token in ASAP FTM
1. Increase the dwell time for Off-chan FTM
2. Perform the Off-Chan FTM in 20Mhz
2025-11-17 15:07:16 +05:30
Kevin (Lao Kaiyao)
f1b979d865 Merge branch 'feature/support_force_eof_workaround_for_parlio_rx' into 'master'
feat(parlio_rx): support to force trigger eof

Closes IDF-14143, IDFCI-2958, IDFCI-6027, IDFCI-2929, and IDFCI-6242

See merge request espressif/esp-idf!43116
2025-11-17 17:28:21 +08:00
yangfeng
43808ef7a9 fix(bt/examples): Fixed test_bt_l2cap not finding ESP_SDP_CREATE_RECORD_COMP_EVT 2025-11-17 16:52:08 +08:00
armando
c3995ad93e change(psram): use 200M as default 2025-11-17 16:25:57 +08:00
Marius Vikhammer
cef2f5a264 Merge branch 'feature/esp_stdio_cmakev2' into 'master'
feat(stdio): updated CMakelists.txt to support cmake v2 build system

Closes IDF-13984

See merge request espressif/esp-idf!43272
2025-11-17 16:20:50 +08:00
Marius Vikhammer
da79b1989f test(ulp): added larger delay in ULP FSM I_WR_REG instruction test
Test is flakey, could possibly be due to the ULP occasionally needing
a bit more time to start up.
2025-11-17 16:03:21 +08:00
chenjianhua
1e89ab704e feat(ble/nimble): support runtime allocation for mempool 2025-11-17 15:26:35 +08:00
harshal.patil
1c1bcf44be feat(esp_security): Support ECDSA-P384 key deployment using Key Manager 2025-11-17 12:34:09 +05:30
harshal.patil
dac0bbfcc2 change(mbedtls): Generalize key source union for the hardware ECDSA context 2025-11-17 12:34:09 +05:30
harshal.patil
1f2cbde525 change(esp_key_mgr): Store key_len field in the key_info
- Update the Key Manager key types to be generic
- Define a new enum to determine the length of the keys
- Refactor the Key Manager driver support generic key types and key lengths
- Also store key deployment mode in the key recovery info
2025-11-17 12:34:09 +05:30
C.S.M
a90c93541c feat(esp32s31): Introduce new target esp32s31 2025-11-17 14:48:55 +08:00
luoxu
e4f514ae10 fix(ble_mesh): add type casting for adv data pointer 2025-11-17 14:44:19 +08:00
luoxu
7ae9d8deb6 fix(ble_mesh): resolve C++ compilation issue in net.h
Closes https://github.com/espressif/esp-idf/issues/17868
2025-11-17 14:34:40 +08:00
Zhou Xiao
5286451f2e feat(phy): ESP32-C5 ECO2/ECO3 coex and ESP32-C6 track reset
* C5 phy_version: 1 107, 8c534c84, Nov 17 2025
* C6 phy_version: 343, b513b46, Nov 14 2025
2025-11-17 14:25:26 +08:00
armando
b25ba4a0c1 ci(p4): disable p4 rev3 invalid tests temporarily 2025-11-17 12:11:39 +08:00
armando
aac218036d refactor(sleep_cpu): suppress infinite loop warnings with compiler diagnostics 2025-11-17 12:11:39 +08:00
armando
a4821ab7f5 ci(p4): re-enable p4 jobs 2025-11-17 12:11:39 +08:00
armando
3847e78f77 change(p4): make v3 as default 2025-11-17 12:11:39 +08:00
Alexey Lapshin
8b1bb83af7 Merge branch 'feature/dynamic_flags_in_toolchain_cmake' into 'master'
feat(build): propagate compiler flags from files to toolchain.cmake

Closes IDF-11323

See merge request espressif/esp-idf!42966
2025-11-17 07:52:41 +04:00
xiongweichao
7daac582ac refactor(example/bt): Remove APIs starting with periph_ 2025-11-17 11:47:43 +08:00
xiongweichao
3618b4732a refactor(example/bt): Refactor controller_hci_uart example for ESP32-C3/S3 to use UHCI driver 2025-11-17 11:47:43 +08:00
Aleksei Apaseev
6b5eaec464 Merge branch 'ci/add-example-count-generation' into 'master'
ci: add example count generation

Closes SRV-19

See merge request espressif/esp-idf!41600
2025-11-17 08:48:19 +08:00
Aleksei Apaseev
fb1fae9627 ci: add generate metrics of the target examples count 2025-11-17 08:28:42 +08:00
Armando (Dou Yiwen)
8f1e7bc4e0 Merge branch 'feat/cache_mem_iram_h4' into 'master'
cache: use icache memroy as diram when single core

See merge request espressif/esp-idf!43352
2025-11-14 18:06:00 +00:00
Mahavir Jain
6f9c5204e9 Merge branch 'contrib/github_pr_17710' into 'master'
fix(nvs_sec_provider): replace abort() when nvs_keys is missing with a warrnig log (GitHub PR)

Closes IDFGH-16597

See merge request espressif/esp-idf!43337
2025-11-14 21:48:29 +05:30
Guilherme Ferreira
4e33677e27 Merge branch 'fix/fix-sniffer-sdcard-build' into 'master'
fix(network): Fix Sniffer Build with SD Card

Closes IDF-13850

See merge request espressif/esp-idf!43300
2025-11-14 23:13:40 +08:00
Alexey Lapshin
233015265d fix(docs): remove note about externalproject_add limitation 2025-11-14 21:04:58 +07:00
Alexey Lapshin
583a9075fa fix(test): fix tests according to the new toolchain flags 2025-11-14 21:04:58 +07:00
Alexey Lapshin
b0388ad4a5 feat(build): add COMPILER_ENABLE_RISCV_ZCMP option
Applicable for chips affected by interrupt issue:
  - ESP32C5
  - ESP32C61
  - ESP32H4

For all other chips that support the ZCMP extension without issues,
it will be enabled unconditionally.
2025-11-14 21:04:58 +07:00
Alexey Lapshin
0c1d917f78 feat(build): propagate compiler flags from files to toolchain.cmake
This change improves build consistency across external projects integrated
through CMake by ensuring that compiler flags defined in configuration files
are passed correctly to the toolchain. It covers the majority of use cases,
as external projects are typically also CMake-based. For projects that use
a custom build system, users will still need to specify the required flags
manually.
2025-11-14 21:04:54 +07:00
wuzhenghui
0ce91afc94 feat(esp_pm): add APIs to get PM lock statistics
Add new APIs to retrieve statistics about power management locks:
- esp_pm_get_lock_stats(): Get statistics for all PM lock types
- esp_pm_get_lock_instance_stats(): Get statistics for a single PM lock instance

Also update the test cases to verify the new functionality and
enable PM profiling in test configuration.

Closes https://github.com/espressif/esp-idf/issues/17770
2025-11-14 20:36:44 +08:00
Shu Chen
0fb25912fc Merge branch 'fix/fix_some_deadlock_issue' into 'master'
fix(openthread): resolve deadlock issues due to switching_lock

See merge request espressif/esp-idf!43357
2025-11-14 12:15:01 +00:00
Jiang Jiang Jian
d6d19da799 Merge branch 'bugfix/add_migration_guides_for_esp_wifi_init' into 'master'
fix(wifi): add migration guides for esp_wifi_init

See merge request espressif/esp-idf!43077
2025-11-14 19:29:00 +08:00
morris
f86febdc87 feat(gpio): add fast gpio && sdm && filter support on esp32h21 2025-11-14 18:34:06 +08:00
morris
5fb55adb74 Merge branch 'feat/etm_esp32h21' into 'master'
feat(etm): support ETM driver on esp32h21

Closes IDF-11576, IDF-11577, and IDF-11614

See merge request espressif/esp-idf!43294
2025-11-14 17:00:59 +08:00
Wu Zheng Hui
10baab1cf8 Merge branch 'fix/check_usj_status_before_access' into 'master'
fix(esp_driver_usb_serial_jtag): check USJ accessibility before read/write

Closes PM-400

See merge request espressif/esp-idf!42562
2025-11-14 16:30:40 +08:00
Wu Zheng Hui
728fc6a254 Merge branch 'fix/fix_c6_rtc_periph_depends_on_top' into 'master'
fix(esp_hw_support): add dependency of the TOP domain to the RTC_PERIPH domain for esp32c6

See merge request espressif/esp-idf!43289
2025-11-14 16:28:32 +08:00
morris
5189f9af3c Merge branch 'feat/isp_crop_driver' into 'master'
feat(isp): support Crop driver on p4 rev3

Closes IDF-12216 and IDF-13933

See merge request espressif/esp-idf!42586
2025-11-14 15:53:52 +08:00
Michael (XIAO Xufeng)
167db20ca5 Merge branch 'feat/hw_support_dep_remove_c6' into 'master'
esp_hw_support: Removed unsed priv require

See merge request espressif/esp-idf!43177
2025-11-14 15:19:47 +08:00
Jiang Jiang Jian
eaa0e3ab77 Merge branch 'feat/support_p4_unicore_auto_clock_gating' into 'master'
feat(esp_hw_support): support unicore auto clock gating for esp32p4 rev3+

Closes IDF-13501

See merge request espressif/esp-idf!43321
2025-11-14 13:57:48 +08:00
Krzysztof Lewandowski
7c536b251b fix(nvs_sec_provider): Emit warning when nvs_keys partition is missing
- Instead of returning error (ESP_FAIL), which led to an abort
  in the startup
2025-11-14 10:24:00 +05:30
Mahavir Jain
fd01095f5c Merge branch 'fix/cert_bundle_stress_test_failure' into 'master'
Fix cert bundle stress test

Closes IDFCI-2754

See merge request espressif/esp-idf!43322
2025-11-14 09:40:20 +05:30
Wu Zheng Hui
53183f9294 Merge branch 'fix/fix_xtal32k_power_breaks_adc' into 'master'
fix(esp_system): fix XTAL32K power breaks ADC function on 32k XTAL clock pin

See merge request espressif/esp-idf!43208
2025-11-14 12:06:37 +08:00
Tan Yan Quan
2d022def21 fix(openthread): resolve deadlock issues due to switching_lock
* esp-openthread: thread_zigbee/esp-openthread@068a8f4d2
* openthread: espressif/openthread@36b14d3ef
* esp-idf: espressif/esp-idf@a7e81b99d
2025-11-14 03:18:46 +00:00
Jiang Jiang Jian
a7e81b99dd Merge branch 'bugfix/ftm_recalib_esp32c5' into 'master'
Re-calibrate FTM for ESP32-C5 (ECO2) to resolve status 5 failures

Closes WIFIBUG-1434

See merge request espressif/esp-idf!43254
2025-11-14 11:10:56 +08:00
Chen Ji Chang
2aff980290 Merge branch 'fix/mipi_dsi_phy_clk_type' into 'master'
fix(lcd): fix mipi dsi phy type for p4 version below 3.0

See merge request espressif/esp-idf!43327
2025-11-14 11:06:44 +08:00
morris
6bd8524115 feat(etm): support ETM driver on esp32h21 2025-11-14 10:40:40 +08:00
armando
a28d9869c1 feat(cache): use icache memroy as diram when single core 2025-11-14 10:35:39 +08:00
Chen Ji Chang
e2e0da1a26 Merge branch 'feat/esp_hal_pcnt' into 'master'
feat(hal): graudate the PCNT hal driver into a new component

Closes IDF-14098

See merge request espressif/esp-idf!43138
2025-11-14 10:34:57 +08:00
Jiang Jiang Jian
b7c549d111 Merge branch 'bugfix/fix_espnow_send_fail_when_coex_enable' into 'master'
fix(coex): fixed the espnow send fail when coex enable

Closes WIFIBUG-1538 and WIFIBUG-1436

See merge request espressif/esp-idf!43298
2025-11-14 10:21:50 +08:00
Marius Vikhammer
d209293856 feat(stdio): updated CMakelists.txt to support cmake v2 build system 2025-11-14 10:13:38 +08:00
Frantisek Hrbata
368e55a7bc fix(ldgen): use format specifiers instead of percent format
Resolve ruff's UP031 errors related to the use of percent formatting for
strings.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
e65807a901 fix(ldgen): ruff formating changes and copyright update
Changes generated by pre-commit related to ruff-format and an update to
the copyright date.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
a034ef8713 feat(build): add initial configuration for fast reflashing
Introduce ESPTOOLPY_FAST_REFLASHING configuration option. It instructs
ldgen to group entity mappings for libraries deemed mutable (prone to
change) separately from those considered immutable (unlikely to change).

Organizing mutable and immutable libraries separately in the linker
script allows the linker to form larger contiguous blocks of data for
immutable libraries in the application's output sections. These blocks
are likely to stay mostly unchanged between application recompilations,
enabling them to be skipped during reflashing.

Separating mutable and immutable libraries in the linker script to
minimize changes in the output sections is insufficient. Padding is
added after the input sections of mutable libraries in the default data
and text output sections. This creates a buffer for the mutable
libraries, allowing additional changes to be made without altering the
layout of the binary image.

Additionally two optimizations currently in use can still mix data from
these libraries, leading to significant changes even within the grouped
immutable libraries.

1. constant merging

    Linker will try to merge input sections that have the MERGE and
    STRING flags from different libraries (object files) to perform
    optimizations like tail merging. For example, adding a string
    literal in a mutable library will also change the addresses of
    string literals from immutable libraries in such a merged section,
    causing changes in the generated code when those literals are
    referenced.

    Disabled with COMPILER_DISABLE_MERGE_CONSTANTS(-fno-merge-constants)

2. literal pools on Xtensa

    As optimization, the linker may merge literal pools from different
    libraries (object files) to improve the generated code size. This
    has the same effect as constant merging, and changes in mutable
    libraries may cause changes in the generated code for immutable
    libraries. To get larger unchanged continuous blocks in the text
    output sections for immutable libraries, we need to ensure that the
    Xtensa literal pools remain close to their references and are not
    merged.

    Disabled with CONFIG_COMPILER_ENABLE_TEXT_SECTION_LITERALS(-mtext-section-literals)

When ESPTOOLPY_FAST_REFLASHING is enabled, these two optimizations are
disabled to achieve larger unchaged continuous blocks for the grouped
immutable libraries, even though disabling these optimizations results
in slightly larger code.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
1eceeaace2 feat(build): provide ldgen with a list of mutable libraries
The build system keeps track of each component source. Currently
there are four types of sources:

1. "project_components" - project components
2. "project_extra_components" - components from EXTRA_COMPONENT_DIRS
3. "project_managed_components" - custom project dependencies managed by the IDF Component Manager
4. "idf_components" - ESP-IDF built-in components, typically under /components

This can be used to identify the component libraries that are likely to
change during application development and pass them to ldgen as mutable
libraries. Add all components with "project_components" as their source
as mutable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
8ac9e65f4f feat(ldgen): print entity tree in debug mode
Add the `--debug` option to print the entity tree to stdout. This can be
useful for viewing the entire entity tree state to identify potential
issues or incorrect placements.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
3d081f0e23 fix(ldgen/test): ruff formating changes and long lines
Changes generated by pre-commit related to ruff-format and fixed long
lines.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
61193678e5 feat(ldgen/test): add test class for mutable libraries
Add basis tests for mutable libraries.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
299e172fca feat(ldgen): place input sections from mutable libraries into mutable markers
Introduce a new `--mutable-libraries-file` option that accepts a file
containing the filenames of mutable libraries, each listed on a separate
line. Mutable libraries are component libraries expected to change
during development. In contrast, immutable component libraries are not
expected to change. In the generated linker script, the input sections
of mutable libraries are grouped together rather than being mixed with
those of immutable libraries. The goal is to create large continuous
areas in the ELF file's output sections that remain unchanged for
immutable libraries during application recompilation, allowing these
areas to be skipped during flashing.

The build system identifies the mutable libraries and passes them to
ldgen using the `--mutable-libraries-file` option. It maintains
information about component sources, one of which is
`project_components`. This source type identifies components that are
directly related to the project being developed and are very likely to
change.

Mappings for mutable libraries are explicitly created for all sections
in the default scheme. This happens before the entity
`(archive:object_file:symbol/input_section)` node tree with placements is
generated and is equivalent to having these mappings in the mapping
linker fragment. All placements for mappings, whether newly added or
already existing as defined in linker fragments, associated with mutable
libraries are flagged as `mutable` in the entity node tree. This flag
ensures that these placements are included in the final linker script.
Currently, ldgen only emits placements that are either significant or
forced. A placement is considered significant if, for example, it is not
already covered by a placement in parent node. For instance, `*(.iram1
.iram1.*)` placement already includes `*libapp_trace.a:(.iram1
.iram1.*)`, so the latter is not emitted by default. The `mutable` flag
ensures that placements for mutable libraries are emitted in the linker
script and placed at dedicated location.

The locations where placements for mutable libraries are specified in
the linker script are identified by a new `mutable` marker, for example,
`mutable[flash_text]`. The placements for immutable libraries remain in
the existing `mapping` marker, for example, `mapping[flash_text]`. The
`mutable` marker for each target is placed after the `mapping` marker.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:42 +01:00
Frantisek Hrbata
2ade22ff85 feat(esp_system): add mutable markers to sections.ld.in templates
Entity mappings for immutable libraries are placed in the existing
`mapping[target]` marker, while those for mutable libraries are placed
in the new `mutable[target]` marker, which comes after the `mapping`
marker. Additionally, include padding after the input sections of
mutable libraries in the default data and text output sections,
providing a headroom for the mutable libraries to grow.  Padding is
currently not added, for example, in the `.iram0.data` output section,
which is not expected to change frequently. Padding for other mutable
input sections may be added in the future.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-13 15:30:36 +01:00
Mahavir Jain
4a53c4e651 Merge branch 'bugfix/esp32c5_encrypted_flash_write_v2' into 'master'
fix(esp_system): limit CPU clock to 160MHz in ESP32-C5 for flash encryption

See merge request espressif/esp-idf!43301
2025-11-13 18:01:04 +05:30
Chen Jichang
b3e48fd001 test(parlio): fix sleep test issue 2025-11-13 19:01:49 +08:00
Island
a365e7984a Merge branch 'feat/ble_mesh_lib_log_output_opt' into 'master'
feat(ble_mesh): add ext log initialization functions

Closes BLERP-2336

See merge request espressif/esp-idf!42926
2025-11-13 18:11:35 +08:00
Laukik Hase
9ee468a096 Merge branch 'feat/tee_c61_examples_and_docs' into 'master'
feat(esp_tee): Enable ESP-TEE examples and documentation for ESP32-C61

Closes IDF-14254 and IDF-14255

See merge request espressif/esp-idf!43251
2025-11-13 15:18:42 +05:30
Jiang Jiang Jian
388ec4cd6d Merge branch 'ci/rename_wifi_two_duts' into 'master'
ci: rename wifi_two_dut to two_duts

See merge request espressif/esp-idf!43269
2025-11-13 16:54:51 +08:00
Akshat Agrawal
342c82fe95 bugfix(wifi): Re-calibrate FTM for ESP32-C5 (ECO2) 2025-11-13 14:24:20 +05:30
Ondrej Kosta
f39c0633d3 fix(esp_eth): maked esp_eth_test_l2 more robust 2025-11-13 09:53:49 +01:00
Jiang Jiang Jian
f7c694ecc3 Merge branch 'ci/fix_wifi_sdkconfig_ci' into 'master'
ci: fix sdkconfig.ci.xxx for wifi examples

See merge request espressif/esp-idf!43293
2025-11-13 16:53:30 +08:00
Chen Jichang
4989cc9266 feat(hal): move i2c_periph.h to hal folder 2025-11-13 16:52:47 +08:00
Chen Jichang
3daafd870f feat(hal): graudate the PCNT hal driver into a new component 2025-11-13 16:52:45 +08:00
Chen Jichang
893b1ea2f1 fix(lcd): fix mipi dsi phy type for p4 version below 3.0 2025-11-13 16:35:07 +08:00
Wang Meng Yang
3c447d998d Merge branch 'bugfix/fix_hid_memory_leak' into 'master'
fix(bt/bluedroid): Fixed HID memory leak

Closes BTQABR2023-602

See merge request espressif/esp-idf!43118
2025-11-13 16:30:47 +08:00
Wang Meng Yang
80961aa3f4 Merge branch 'bugfix/bluetooth_chan_map_error' into 'master'
fix(bt/controller): fixed Bluetooth hardware error of 'CHMAP_ERROR'

See merge request espressif/esp-idf!43201
2025-11-13 15:24:54 +08:00
Guilherme Ferreira
7b8ad5deb1 Merge branch 'refact/split-hal-emac' into 'master'
refactor(hal): graduate emac hal into a new component

Closes IDF-14088

See merge request espressif/esp-idf!43058
2025-11-13 15:12:43 +08:00
harshal.patil
25fe0d6786 test(examples): Fix cert bundle stress test 2025-11-13 12:34:56 +05:30
wuzhenghui
83d91a153d feat(esp_hw_support): support unicore auto clock gating for esp32p4 rev3+ 2025-11-13 14:30:55 +08:00
Jiang Jiang Jian
5004daabca Merge branch 'feat/avoid_disconnect_when_set_bandmode' into 'master'
feat(wifi): avoid disconnect when set band mode and fix some wifi bugs

Closes WIFIBUG-1532

See merge request espressif/esp-idf!43073
2025-11-13 13:46:34 +08:00
Armando (Dou Yiwen)
828aea712e Merge branch 'feat/psram_250m_p4' into 'master'
psram: support 250MHz in experimental

See merge request espressif/esp-idf!32066
2025-11-13 05:05:34 +00:00
Harshal Patil
0debe71b3d Merge branch 'feat/flash_enc_using_key_manager' into 'master'
Support Flash Encryption using Key Manager

Closes IDF-13462 and IDF-14278

See merge request espressif/esp-idf!41879
2025-11-13 07:55:15 +05:30
glmfe
b4d7ede1c3 fix(network): Fix Sniffer Build with SD Card
- Added sdkConfig to cover all available SoC's
 - Defaults to the official devkit with Micro SD Card Available (ESP32 ESP-WROVER-KIT)
2025-11-12 23:05:19 -03:00
Chen Chen
61d363fd58 feat(isp): support Crop driver on p4 rev3
Add support for crop driver on p4eco5 and update example in
`isp/multi_pipelines`
2025-11-13 08:47:11 +08:00
Mahavir Jain
3c5d2e6b58 fix(esp_system): limit CPU clock to 160MHz in ESP32-C5 for flash encryption
Encrypted flash write operation sometimes result in random corruption in
certain bytes. Root cause points to sudden current surge due to involvement of
encryption block overwhelming LDO supply. More details will be provided
in the ESP32-C5 SoC Errata document.

This fix limits the CPU clock to 160MHz for flash encryption enabled
case. Failing encrypted flash write tests could successfully pass in
this configuration. Going ahead, a dynamic clock adjustment in flash
driver will be considered to mitigate this issue.
2025-11-12 19:14:55 +05:30
Jiang Jiang Jian
db1efdec09 Merge branch 'feat/set_pull_mode_of_coex_input_pin' into 'master'
feat(esp_coex): set the pull mode of the external coex input pin

See merge request espressif/esp-idf!43066
2025-11-12 21:08:44 +08:00
muhaidong
bedb741d93 fix(wifi): add migration guides for esp_wifi_init 2025-11-12 19:46:25 +08:00
zhangyanjiao
e255a4e014 fix(coex): fixed the espnow send fail when coex enable 2025-11-12 19:23:34 +08:00
muhaidong
9cbd5c2804 docs(wifi): update wifi fragment doc 2025-11-12 19:15:28 +08:00
Chen Yudong
d784a1e098 ci: fix sdkconfig.ci.xxx for wifi examples 2025-11-12 18:42:38 +08:00
glmfe
9fd020d9da refactor(hal): graduate emac hal into a new component
- Separate emac from hal component to a new one: esp_hal_emac.
2025-11-12 06:55:46 -03:00
Jiang Jiang Jian
a2d9d85a99 Merge branch 'bugfix/fix_wifi_init_issue' into 'master'
fix(wifi): fix wifi init fail issue

Closes IDFGH-12651

See merge request espressif/esp-idf!37876
2025-11-12 17:50:07 +08:00
Island
b1c7498580 Merge branch 'feat/support_bluedroid_host_pawr' into 'master'
feat(ble/bluedroid): Add bluedroid host PAwR and Advertising Coding Selection features

Closes BLERP-1974, BLERP-1975, BLERP-1982, BLERP-2061, and BLERP-2377

See merge request espressif/esp-idf!39128
2025-11-12 17:27:26 +08:00
Erhan Kurubas
9f0d7c2f06 Merge branch 'enable_gcov_tests' into 'master'
test(gcov): re-enable gcov builds and tests

See merge request espressif/esp-idf!43252
2025-11-12 10:12:17 +01:00
Euripedes Rocha
1da98604f9 Merge branch 'removes_esp_mqtt' into 'master'
change(mqtt): Removes the mqtt client from idf

Closes IDF-14118 and DOC-12722

See merge request espressif/esp-idf!40286
2025-11-12 10:10:22 +01:00
wuzhenghui
19e9890fb3 fix(esp_hw_support): add dependency of the TOP domain to the RTC_PERIPH domain for esp32c6 2025-11-12 17:03:45 +08:00
luoxu
a027b8cccb feat(ble_mesh): update mesh lib to a4262f4214 2025-11-12 16:55:56 +08:00
luoxu
7b7b9de28d feat(ble_mesh): add ext log initialization functions 2025-11-12 16:55:56 +08:00
Armando
972a6195f2 feat(psram): support 250MHz in experimental 2025-11-12 16:14:02 +08:00
Tomas Rezucha
a16739a950 Merge branch 'contrib/github_pr_17831' into 'master'
fix(hal): Fix USB PHY selection logic in usb_wrap_ll.h (GitHub PR)

Closes IDFGH-16746

See merge request espressif/esp-idf!43255
2025-11-12 08:54:30 +01:00
Laukik Hase
7a1ab62cf7 docs(esp_tee): Enable ESP-TEE documentation for ESP32-C61 2025-11-12 12:48:27 +05:30
Laukik Hase
b6a51f0ff6 ci(esp_tee): Enable the TEE examples for ESP32-C61 2025-11-12 12:48:26 +05:30
Song Ruo Jing
a2901819b4 Merge branch 'feature/esp32p4_eco5_io_hold' into 'master'
feat(gpio): add IO hold support for Deep-sleep for ESP32-P4 ECO5

Closes IDF-12844 and IDF-13518

See merge request espressif/esp-idf!43147
2025-11-12 15:13:36 +08:00
Mahavir Jain
a037d9613e Merge branch 'bugfix/lwip_stack_in_psram_limitation' into 'master'
fix(lwip): allow task stack from SPIRAM except for ESP32 ECO2 and below

Closes IDFGH-16740

See merge request espressif/esp-idf!43119
2025-11-12 12:41:55 +05:30
yinqingzhao
bb2f7e08f5 feat(wifi): avoid disconnect when set band mode and fix some wifi bugs 2025-11-12 14:32:59 +08:00
Jin Cheng
b607198192 fix(bt/controller): Fixed some controller bugs
- Fixed Bluetooth hardware error of 'CHMAP_ERROR'
- Fixed encryption collision bug
2025-11-12 14:27:16 +08:00
Island
94de317b37 Merge branch 'fix/increase_ble_log_task_stack_size_for_xtensa_chips' into 'master'
fix(ble): increase default ble log stack size for xtensa chips

See merge request espressif/esp-idf!43250
2025-11-12 14:00:53 +08:00
Meet Patel
b11ce34971 Merge branch 'contrib/github_pr_17848' into 'master'
Bump up log_v2's max arg count (GitHub PR)

Closes IDFGH-16764

See merge request espressif/esp-idf!43256
2025-11-12 10:02:34 +05:30
Jeremy Boynes
4dfad2ecc6 fix(esp_lcd): Issue where M5Stack CoreS3 uses GPIO 35 for MISO and LCD D/C
Adopts approach used by M5GFX that enables/diables output during SPI transaction.
2025-11-11 20:23:45 -08:00
laokaiyao
3fa53e16e4 fix(parlio_rx): fixed incorrect dma buffer length calculation 2025-11-12 10:35:22 +08:00
laokaiyao
297093f46b feat(parlio_rx): support to receive data into external ram 2025-11-12 10:35:22 +08:00
laokaiyao
77cae1fc61 feat(parlio_rx): support to force trigger eof 2025-11-12 10:35:22 +08:00
Chen Yudong
d591aaf1ae ci: rename wifi_two_dut to two_duts 2025-11-12 10:05:07 +08:00
Omar Chebib
8e12c7f3ab Merge branch 'fix/task_tracing_crashing' into 'master'
fix(heap): fix a bug where the biggest heap would be NULL on boot

Closes IDFGH-16182 and IDFGH-16183

See merge request espressif/esp-idf!41024
2025-11-12 09:33:32 +08:00
Jiang Jiang Jian
78986757de Merge branch 'bugfix/fix_send_wakenull_off_channel' into 'master'
fix(wifi): fix issue that disarm send wake null timer donot take effect and sta bolck scan timeout

Closes WIFI-7020, WIFIBUG-1523, and WIFIBUG-1379

See merge request espressif/esp-idf!43158
2025-11-12 09:30:22 +08:00
Adam Múdry
1725be256d feat(storage): Add support for SDMMC BDL 2025-11-11 14:59:56 +01:00
zhiweijian
738a684c36 fix(ble/bluedroid): Fixed CTE IQ sample data copy error 2025-11-11 20:00:44 +08:00
zhiweijian
a742abdcf5 fix(ble/bluedroid): Optimize some bluedroid code 2025-11-11 20:00:44 +08:00
zhiweijian
38e3f2ad3b fix(ble/bluedroid): Fixed big event status error 2025-11-11 20:00:44 +08:00
zhiweijian
d0f7140057 feat(ble/bluedroid): support bluedroid host channel sounding feature 2025-11-11 20:00:44 +08:00
zhiweijian
cb8b4df798 feat(ble/bluedroid): Supported BLE bluedroid host pawr connection 2025-11-11 20:00:34 +08:00
zhiweijian
865bccedbf feat(ble/bluedroid): Support LE Security Levels Characteristic 2025-11-11 19:58:38 +08:00
zhiweijian
9405c68bed feat(ble/bluedroid): Add bluedroid host Advertising Coding Selection feature 2025-11-11 19:58:26 +08:00
zhiweijian
056e83e3b8 feat(ble/bluedroid): Add bluedroid host PAwR feature 2025-11-11 19:58:14 +08:00
Mahavir Jain
da1ff709ce Merge branch 'fix/axi_dma_ext_mem_alignment_c5' into 'master'
Align AES and SHA buffers to 16 when SPIRAM encryption is enabled

Closes DIG-754 and IDF-14344

See merge request espressif/esp-idf!43004
2025-11-11 17:14:47 +05:30
Mahavir Jain
619cbb85b3 Merge branch 'fix/disallow_enabling_sb_sha384_when_sb_sha256_is_enabled_p4' into 'master'
fix(efuse): Disallow enabling SB using SHA-384 when SB using SHA-256 is enabled (ESP32-P4 ECO5)

Closes IDF-14063

See merge request espressif/esp-idf!42884
2025-11-11 17:11:47 +05:30
Radek Tandler
1611f123a7 Merge branch 'storage/fix_spi_flash_verify_write' into 'master'
Fix spi flash verify write of blocks shorter than 4 bytes

Closes IDF-14288

See merge request espressif/esp-idf!42614
2025-11-11 12:27:43 +01:00
sibeibei
4e2f33d445 fix(wifi): fix issue that disarm send wake null timer donot take effect 2025-11-11 17:29:38 +08:00
Erhan Kurubas
5947a29c51 test(gcov): re-enable gcov builds and tests 2025-11-11 10:23:29 +01:00
Zhou Xiao
3e0d005987 fix(ble): increase default ble log stack size for xtensa chips 2025-11-11 17:07:42 +08:00
Song Ruo Jing
7008558fe5 fix(clk): 400MHz CPU should still be selectable on ESP32-P4 less than rev3 2025-11-11 17:03:25 +08:00
Song Ruo Jing
c17644a400 feat(gpio): add IO hold support for Deep-sleep for ESP32-P4 ECO5 2025-11-11 17:03:24 +08:00
Tomas Rezucha
8948bf6ba7 Merge branch 'refactor/make_usb_hal_independent' into 'master'
refactor(usb): Make usb hal layer independent

Closes IDF-14092

See merge request espressif/esp-idf!43155
2025-11-11 09:53:45 +01:00
Mahavir Jain
d42cb3b3f7 fix(lwip): allow task stack from SPIRAM except for ESP32 ECO2 and below
Closes https://github.com/espressif/esp-idf/issues/17827
2025-11-11 14:14:22 +05:30
Mahavir Jain
437ddd1a45 Merge branch 'feat/update_mbedtls_3.6.5' into 'master'
feat(mbedtls): update to version 3.6.5

See merge request espressif/esp-idf!42623
2025-11-11 14:09:43 +05:30
Zhang Shuxian
41c3c2d539 docs: Update CN translation 2025-11-11 09:21:37 +01:00
Euripedes Rocha Filho
448714b056 remove(mqtt): Moves esp-mqtt to component manager
esp-mqtt is now a managed component at espressif/mqtt
2025-11-11 09:21:37 +01:00
Wang Meng Yang
b712ec5696 Merge branch 'bugfix/cod_chg_by_scan_ena' into 'master'
fix(bt/bluedroid): update the COD before enabling inquiry scan

Closes BTQABR2023-546

See merge request espressif/esp-idf!41481
2025-11-11 15:45:07 +08:00
Michael (XIAO Xufeng)
39f2a54179 esp_hw_support: Removed unsed priv require 2025-11-11 15:04:43 +08:00
zwx
73f7561e53 fix(802.15.4): fixed energy detection result 2025-11-11 15:01:07 +08:00
harshal.patil
0c3c284819 feat(bootloader_support): Support FE XTS-AES-256 using Key Manager for ESP32-C5 2025-11-11 12:23:27 +05:30
harshal.patil
f73cfa5def fix(hal): Force HUK power up when configuring HUK for ESP32-C5 2025-11-11 12:23:27 +05:30
harshal.patil
38f8b57fe5 feat(flash_encryption): Remove mspi reset when switching the XTS-AES key source 2025-11-11 12:23:27 +05:30
harshal.patil
c9417e418b change(bootloader_support): Rename the esp_flash_encryption_enable_key_mgr() API 2025-11-11 12:23:26 +05:30
harshal.patil
540c719c66 change(esp_key_mgr): Make Key Manager driver bootloader compatible
- Independent of heap
2025-11-11 12:23:26 +05:30
harshal.patil
8abea3c537 feat(bootloader_support): Support Flash Encryption using Key Manager 2025-11-11 12:23:25 +05:30
harshal.patil
304bd1c77b fix(esp_security/esp_key_mgr): Fix missed error codes and some cleanup 2025-11-11 12:22:08 +05:30
Gao Xu
dca6abf984 Merge branch 'fix/adc_c6_get_high_result' into 'master'
fix(adc): fix ESP32C6 ADC get high result after enable

Closes ESPCS-1045

See merge request espressif/esp-idf!42964
2025-11-11 14:13:07 +08:00
Laukik Hase
d2f8a8f86a Merge branch 'feat/esp_tee_c61' into 'master'
feat(esp_tee): Support for ESP32-C61

Closes IDF-14253

See merge request espressif/esp-idf!42054
2025-11-11 11:42:37 +05:30
C.S.M
b642a6229c Merge branch 'fix/i2c_buffer_place' into 'master'
fix(i2c): Add check for buffer place when iram safe enabled

Closes IDFGH-11486

See merge request espressif/esp-idf!43178
2025-11-11 13:34:49 +08:00
nilesh.kale
551fd1b50b feat: enable ecc peripheral support for ESP32H4 2025-11-11 10:52:01 +05:30
Harshal Patil
ed57a94687 Merge branch 'feat/extend_pmp_protection_esp32p4_eco5' into 'master'
Extend PMP memprot for ESP32-P4 V3

Closes IDF-14075

See merge request espressif/esp-idf!42402
2025-11-11 10:07:21 +05:30
Konstantin Kondrashov
8ab409e17e Merge branch 'contrib/github_pr_17648' into 'master'
docs(shared_stack): Fix incorrect or misleading expressions (GitHub PR)

Closes IDFGH-16521 and IDFGH-16500

See merge request espressif/esp-idf!42340
2025-11-11 12:32:14 +08:00
Tinyu
43574a2a92 fix(hal): correct PHY selection logic in usb_wrap_ll.h 2025-11-11 04:24:04 +00:00
Kevin (Lao Kaiyao)
0f4fa41d93 Merge branch 'bugfix/fix_gpio_reservation_issue_in_touch_driver' into 'master'
fix(touch): make the gpio init symmetric

Closes IDFGH-16717

See merge request espressif/esp-idf!43166
2025-11-11 11:59:05 +08:00
Zhang Wen Xu
6bf93681b8 Merge branch 'fix/fix_save_line_in_debug_for_154' into 'master'
fix(802.15.4): fix line save in 154 debug

See merge request espressif/esp-idf!43200
2025-11-11 03:08:10 +00:00
renpeiying
b3f95ab7b0 Update docs acc to review 2025-11-11 10:44:50 +08:00
Island
25ba007105 Merge branch 'feat/support_bhost2025_44' into 'master'
feat(ble/bluedroid): Add more debug log for bluedroid

Closes BLERP-2374

See merge request espressif/esp-idf!43093
2025-11-11 10:39:39 +08:00
laokaiyao
6c29488d9f docs(pm): updated i2s pm lock type in DFS
Related https://github.com/espressif/esp-idf/issues/14707
2025-11-11 10:23:34 +08:00
laokaiyao
3492e8fb48 fix(touch): make the gpio init symmetric
Closes https://github.com/espressif/esp-idf/issues/17806
2025-11-11 10:23:34 +08:00
Ashish Sharma
9fe50060e6 feat(mbedtls): update to version 3.6.5 2025-11-11 10:07:05 +08:00
Guillaume Souchere
518dc8d45b Merge branch 'feat/heap-support-esp32h21' into 'master'
feat(heap): Support heap for esp32h21

Closes IDF-13085

See merge request espressif/esp-idf!42961
2025-11-11 02:55:14 +01:00
Erhan Kurubas
abc6784446 docs(jtag): document program_esp_bins command 2025-11-10 19:51:34 +01:00
Erhan Kurubas
c623b12c8d docs(jtag): replace OpenOCD build instructions with GH workflow reference 2025-11-10 19:51:34 +01:00
Erhan Kurubas
08cf6c1a40 Merge branch 'move_sysview_to_component_registry' into 'master'
Move sysview to component registry

Closes IDF-13403 and DOC-12867

See merge request espressif/esp-idf!43011
2025-11-10 19:19:17 +01:00
Tomas Rezucha
b6db931b0d refactor(usb): Make usb hal layer independent 2025-11-10 17:04:22 +01:00
morris
25d5007f8b Merge branch 'refactor/minimal_build_peripheral_examples' into 'master'
refactor(example): enable minimal build for peripheral examples

Closes IDFGH-16751

See merge request espressif/esp-idf!43192
2025-11-10 22:17:03 +08:00
Guillaume Souchere
7a58d6d8fb fix(heap): Update RTC test to account for esp32h21 characteristics
"RTC memory should be lowest priority and its free size should be big enough"
was failing because the expected size of RTC heap left after init was bigger
than the total RTC size itself.

The test was updated to:
- check that the minimum free RTC heap size matches the current size
- the current RTC heap size is bigger than 80% of the total RTC memory region
2025-11-10 14:43:16 +01:00
Island
1e4520baf2 Merge branch 'feat/ble_mesh_log_enh' into 'master'
feat(ble_mesh): Miscellaneous log enhancement

Closes BLERP-2392

See merge request espressif/esp-idf!41683
2025-11-10 21:20:05 +08:00
luoxu
d0800c044d fix(ble_mesh): resolve miscellaneous logging issues 2025-11-10 20:07:19 +08:00
Rainer
3a431963e6 fix(ble_mesh): fixed issues with incorrect logs format and position 2025-11-10 20:07:19 +08:00
luoxu
ad6aab1396 feat(ble_mesh): Miscellaneous log enhancement for Provisioning 2025-11-10 20:07:19 +08:00
Liu Linyan
1fbf94ae38 feat(ble_mesh): Miscellaneous log enhancement for BLE Mesh 2025-11-10 20:07:19 +08:00
Linyan Liu
6a733ce055 feat(ble_mesh): Miscellaneous update for BLE Mesh 2025-11-10 20:07:19 +08:00
Tomáš Rohlínek
36045c6ca1 feat(storage/fatfs): Make host_test results easier to understand 2025-11-10 12:48:53 +01:00
Tomáš Rohlínek
f781970329 feat(storage/fatfs): Update to FatFS R0.16 2025-11-10 12:42:52 +01:00
Zhang Shuxian
f13c16e031 docs: Update CN translation for NVS statistics example 2025-11-10 12:18:31 +01:00
Martin Havlik
ca16bf9c68 docs(examples/storage): Add docs entries for 2 new NVS examples
Extend the existing mentions of NVS examples with 2 newly added
`nvs_statistics` and `nvs_iteration`.
2025-11-10 12:18:31 +01:00
Martin Havlik
42056cca1d feat(examples/storage): Add NVS iteration example
Add a new example showcasing iterating over NVS entries
of a specific (or any) type, and the info to be obtained from therein.
2025-11-10 12:18:31 +01:00
Martin Havlik
7d756ebd0a feat(examples/storage): Add NVS statistics example
Add a new example showcasing how to obtain and interpret statistics
about the usage of an NVS partition.

Also demonstrates how stats change after writing some key-value pairs
in 2 separate namespaces.
2025-11-10 11:53:04 +01:00
Rahul Tank
1744b070b8 Merge branch 'contrib/github_pr_17824' into 'master'
Fix typos in NimBLE example comments (GitHub PR)

Closes IDFGH-16737

See merge request espressif/esp-idf!43102
2025-11-10 16:09:59 +05:30
wuzhenghui
d815fdbe70 fix(esp_system): fix XTAL32K power breaks ADC function on 32k XTAL clock pin 2025-11-10 17:40:49 +08:00
morris
26dc40594e refactor(example): enable minimal build for peripheral examples
Closes https://github.com/espressif/esp-idf/issues/17836
2025-11-10 17:13:58 +08:00
yangfeng
98864d279f fix(bt/example): Fixed hf_ag build error 2025-11-10 16:59:16 +08:00
chenjianhua
9df842f2c3 fix(bt/bluedroid): Fixed memory debug error 2025-11-10 16:59:16 +08:00
chenjianhua
1aeb965607 feat(ble/bluedroid): Add more debug log for bluedroid 2025-11-10 16:59:16 +08:00
Roland Dobai
c0d6b67938 Merge branch 'fix/github_template_esptool_cmd' into 'master'
fix: Update esptool command in GitHub template to use legacy command for backward compatibility

Closes IDFGH-16670

See merge request espressif/esp-idf!43179
2025-11-10 09:36:18 +01:00
Song Ruo Jing
5b97ebde7e Merge branch 'refactor/gpio_rom_func_rename' into 'master'
refactor(rom/gpio): add 'rom_' prefix to GPIO ROM functions

Closes IDFGH-13174, IDF-9805, and IDF-14209

See merge request espressif/esp-idf!42213
2025-11-10 16:02:54 +08:00
Zhang Shuxian
824d1c7520 docs: Update translation for sysview 2025-11-10 15:58:15 +08:00
Erhan Kurubas
dfd26a79c7 change(examples): disable sysview tests until sysview component is uploaded to registry 2025-11-10 15:55:41 +08:00
Erhan Kurubas
79cda70029 change(app_trace): move sysview to component registry 2025-11-10 15:55:41 +08:00
zhuanghang
4b964d8405 fix(802.15.4): fix line save in 154 debug 2025-11-10 15:28:45 +08:00
Frantisek Hrbata
ee4cd8a4fe Merge branch 'fix/cmake_esp_hal_jpeg' into 'master'
fix(esp_hal_jpeg): initialize the includes variable

See merge request espressif/esp-idf!43176
2025-11-10 08:18:47 +01:00
gaoxu
c2b54dcbe0 fix(adc): fix ESP32C6 ADC get high result after enable 2025-11-10 10:47:52 +08:00
Omar Chebib
0b1aba6579 fix: wrong name in the README file for advanced heap tracing example
Closes https://github.com/espressif/esp-idf/issues/17233
2025-11-10 10:27:48 +08:00
Omar Chebib
3d5023b3a7 fix(heap): fix a bug where the biggest heap would be NULL on boot
Closes https://github.com/espressif/esp-idf/issues/17232
2025-11-10 10:27:48 +08:00
Wang Meng Yang
d02602de17 Merge branch 'bugfix/oob_in_bta_dm_sdp_result' into 'master'
fix(bt/blurdoird): fixed an OOB write in bta_dm_sdp_result

Closes BT-4137

See merge request espressif/esp-idf!42950
2025-11-10 10:01:41 +08:00
Igor Masar
8af4edb0e7 Merge branch 'docs/esp32h4-usb' into 'master'
docs(usb): add ESP32-H4 support notes and pin map

See merge request espressif/esp-idf!42723
2025-11-10 06:34:03 +08:00
nvmd
3a9c3524ae change(esp_log): Bump up log_v2's max arg count 2025-11-09 17:41:54 -03:00
Peter Marcisovsky
bd796b9cc5 Merge branch 'feat/usb_host_pwr_clk_gating_ll' into 'master'
feat(usb_host): Add power and clock gating LL, HAL functions

Closes IDF-14305

See merge request espressif/esp-idf!42762
2025-11-09 04:35:21 +01:00
Peter Dragun
943843b118 fix: Update esptool command in GitHub issue template to use legacy command
Closes https://github.com/espressif/esp-idf/issues/17765
2025-11-07 16:01:38 +01:00
renpeiying
bcef36325b docs: Update CN translation 2025-11-07 12:19:34 +01:00
igor.masar
7492f9b9cd docs(usb): add ESP32-H4 support notes and pin map
- usb_device: add esp32h4 DP/DM defaults (GPIO22/21) and "only:: esp32h4";
  add H4 PHY considerations; add H4 MSC write-speed table; generalize MSC SD
  note to {IDF_TARGET_NAME}; exclude tusb_ncm on H4
- usb_host: include esp32h4 in feature gates; add H4 PHY considerations
- usb_host_notes_dwc_otg: enable H4 by extending "only::" selector
- examples/usb: add ESP32-H4 row to DP/DM pin map
- docs_not_updated: drop H4 entries for usb_device, usb_host, and related
  usb_host notes now covered
- soc(esp32h4): set internal PHY mapping to DP=22, DM=21
2025-11-07 12:19:26 +01:00
Laukik Hase
5b80a58953 ci(esp_tee): Enable the TEE test-apps for ESP32-C61 2025-11-07 14:54:16 +05:30
Laukik Hase
f533502324 feat(esp_tee): Add support for TEE secure storage encryption for ESP32-C61 2025-11-07 14:54:16 +05:30
Laukik Hase
b9a503e9ec feat(esp_tee): Support for ESP32-C61 - the rest of the components 2025-11-07 14:54:16 +05:30
Laukik Hase
bbdd1499f1 feat(esp_tee): Support for ESP32-C61 - the esp_tee component 2025-11-07 14:54:11 +05:30
Narukara
e14dfb8b5a docs(shared_stack): Fix incorrect or misleading expressions
Merges https://github.com/espressif/esp-idf/pull/17648
Closes https://github.com/espressif/esp-idf/issues/17639
2025-11-07 11:17:04 +02:00
C.S.M
e898c7ef39 fix(i2c): Add check for buffer place when iram safe enabled,
Closes https://github.com/espressif/esp-idf/issues/12613
2025-11-07 16:45:38 +08:00
peter.marcisovsky
066318dea9 feat(usb_host): Add power and clock gating LL, HAL
- part of suspend/resume (remote wakeup) sequences
2025-11-07 16:26:02 +08:00
Frantisek Hrbata
3f7844905a fix(esp_hal_jpeg): initialize the includes variable
The cmakev2 build system may evaluate components recursively and all
components has to make sure all their variables are properly
initialized.

Fixes: a7115b6b36 ("refactor(jpeg): Split hal layer for jpeg")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-07 08:59:59 +01:00
Armando (Dou Yiwen)
c71729610f Merge branch 'feat/isp_shadow_reg' into 'master'
isp: added shadow reg settings

Closes IDF-13937

See merge request espressif/esp-idf!42698
2025-11-07 07:34:21 +00:00
Fu Hanxi
d738849397 Merge branch 'ci/attach_dut_log_url' into 'master'
ci: attach_log_url for multi dut tests

Closes CII-27

See merge request espressif/esp-idf!42899
2025-11-07 08:28:41 +01:00
Song Ruo Jing
56cbd596f5 refactor(gpio): add esp_err_t return type to gpio_uninstall_isr_service
Closes https://github.com/espressif/esp-idf/issues/14114
2025-11-07 15:26:52 +08:00
Song Ruo Jing
266c06354d refactor(gpio): remove some useless macros from io_mux_reg.h 2025-11-07 15:26:52 +08:00
Song Ruo Jing
4b8633cc2b refactor(rom/gpio): add 'rom_' prefix to GPIO ROM functions 2025-11-07 15:26:52 +08:00
Island
286b8cb76d Merge branch 'change/ble_update_lib_20251106' into 'master'
change(ble): [AUTO_MR] 20251106 - Update ESP BLE Controller Lib

Closes BLERP-2379, BLERP-2380, BLERP-2372, and BLERP-2373

See merge request espressif/esp-idf!43154
2025-11-07 14:28:26 +08:00
Konstantin Kondrashov
a8453ffabb Merge branch 'feature/ulp_ticks_and_cycles' into 'master'
feat(ulp): Removes ambiguity between ticks and cycles in ULP APIs

Closes IDFGH-16733

See merge request espressif/esp-idf!43153
2025-11-07 14:21:33 +08:00
Chen Chen
83c315c28d Merge branch 'feat/mcpwm_support_h4' into 'master'
Feat/mcpwm support h4

Closes IDF-12380 and IDF-12381

See merge request espressif/esp-idf!43003
2025-11-07 11:46:03 +08:00
Kevin (Lao Kaiyao)
be3dd5a591 Merge branch 'feature/support_i2s_on_h21' into 'master'
feat(i2s): support i2s on esp32h21

Closes IDF-11606, IDF-11607, and IDF-11608

See merge request espressif/esp-idf!41767
2025-11-07 11:41:45 +08:00
He Binglin
2213716fd5 Merge branch 'feat/esp_idf_lp_uart_wakeup' into 'master'
feat(esp_hw_support): support lp uart wakeup during sleep

Closes PM-533

See merge request espressif/esp-idf!41704
2025-11-07 11:03:08 +08:00
armando
e0b530bd64 feat(isp): added shadow reg settings 2025-11-07 10:49:34 +08:00
morris
6b9427a9f7 Merge branch 'feat/lcd_driver_use_four_cc' into 'master'
refactor(lcd): unify the color conversion API in RGB and DSI driver

Closes IDF-14235

See merge request espressif/esp-idf!43137
2025-11-07 10:37:39 +08:00
Armando (Dou Yiwen)
58e250e0bd Merge branch 'change/isp_wbg_api_change' into 'master'
isp: make wbg API standalone

See merge request espressif/esp-idf!42890
2025-11-07 02:05:13 +00:00
zhaoweiliang
29890c8916 feat(ble): add peripheral fast rx data in latency config on ESP32-C5 2025-11-07 09:59:34 +08:00
zhaoweiliang
0f03da43c8 feat(ble): add peripheral fast rx data in latency config on ESP32-C6 2025-11-07 09:59:31 +08:00
Chen Chen
4a22e36ab4 feat(mcpwm): support mcpwm on esp32h4 2025-11-07 09:28:31 +08:00
Rasmus Buurman
3794bfd96d fix(examples): Fix typos in NimBLE example comments 2025-11-06 20:13:24 +08:00
Laukik Hase
32eb85066e Merge branch 'ci/tee_flash_prot_failures' into 'master'
ci(esp_tee): Remove incorrect error checks for TEE flash protection tests

Closes IDFCI-3299, IDFCI-4947, IDFCI-4092, IDFCI-4093, and IDF-14283

See merge request espressif/esp-idf!43140
2025-11-06 17:14:21 +05:30
Roman Leonov
4be7070aa6 Merge branch 'feature/tusb_hid_remote_wakeup' into 'master'
feat(tusb_hid_example): Added possibility to wakeup the Host with the button press

Closes IDFGH-12837

See merge request espressif/esp-idf!41851
2025-11-06 19:15:32 +08:00
Laukik Hase
fdc86f8f7d Merge branch 'fix/tee_hal_ci_failures' into 'master'
ci(hal/tee): Fix intermittent hang-ups in `PERI_APM` tests on ESP32-C5

Closes IDFCI-3274, IDFCI-4807, and IDFCI-4808

See merge request espressif/esp-idf!42937
2025-11-06 16:39:09 +05:30
Jin Cheng
6ca6f422da fix(bt/blurdoird): fixed an OOB write in bta_dm_sdp_result 2025-11-06 18:57:55 +08:00
cjin
ed6587b132 feat: rename ble sleep related apt on ESP32-C5 2025-11-06 17:32:16 +08:00
cjin
658efa27f0 feat: rename ble sleep related apt on ESP32-H2 2025-11-06 17:31:44 +08:00
cjin
8e1292e1f2 feat: rename ble sleep related apt on ESP32-C6 2025-11-06 17:31:44 +08:00
zhaoweiliang
23a57eee8e change(ble): [AUTO_MR] Update lib_esp32c2 to 27b6e1dc 2025-11-06 17:25:48 +08:00
zhaoweiliang
287052fd95 change(ble): [AUTO_MR] Update lib_esp32c6 to b6027aeb 2025-11-06 17:25:48 +08:00
zhaoweiliang
a54d4fe42b change(ble): [AUTO_MR] Update lib_esp32c5 to b6027aeb 2025-11-06 17:25:48 +08:00
zhaoweiliang
f15085b592 change(ble): [AUTO_MR] Update lib_esp32h2 to b6027aeb 2025-11-06 17:25:48 +08:00
laokaiyao
6bb2a6b66d feat(i2s): support i2s on esp32h21 2025-11-06 17:23:15 +08:00
Konstantin Kondrashov
e7054752ed feat(ulp): Removes ambiguity between ticks and cycles in ULP APIs
Closes https://github.com/espressif/esp-idf/issues/17820
2025-11-06 11:11:11 +02:00
hebinglin
bf38ef3abc feat(esp_hw_support): support lp uart wakeup during sleep 2025-11-06 16:19:57 +08:00
Song Ruo Jing
b9eb99d6d9 Merge branch 'bugfix/s3_uart2_rx_break_on_rst' into 'master'
fix(uart): fix some uart port generate a RX BRK_DET intr on reset issue

See merge request espressif/esp-idf!43064
2025-11-06 16:10:28 +08:00
igor.udot
2ee022ed3d ci: attach_log_url for multi dut tests 2025-11-06 08:55:06 +01:00
morris
f24c115f4b refactor(lcd): unify the color conversion API in RGB and DSI driver
Also adopt the FourCC standard to describe color format.
See also
https://developer.espressif.com/blog/2025/04/esp-fourcc-introduction/
2025-11-06 15:02:26 +08:00
harshal.patil
a6de2c79ed fix(mbedtls/port): Align AES and SHA DMA buffers to 16 when SPIRAM encryption is enabled
- Targets that support GDMA and MSPI encryption module need data and addresses aligned to 16
2025-11-06 12:28:19 +05:30
Laukik Hase
e27e0eb6a7 ci(esp_tee): Remove incorrect error checks for TEE flash protection tests
- Also fixed coverity issue from TEE secure storage
2025-11-06 12:22:36 +05:30
David Čermák
27baa4a261 Merge branch 'fix/ci_netif_deps' into 'master'
[esp-netif]: Improve CI builds of netif tests

See merge request espressif/esp-idf!43136
2025-11-06 14:18:44 +08:00
Island
5e8f251b71 Merge branch 'change/ble_update_lib_20251105' into 'master'
change(ble): [AUTO_MR] 20251105 - Update ESP BLE Controller Lib

Closes BLERP-2367

See merge request espressif/esp-idf!43101
2025-11-06 10:40:15 +08:00
armando
5d1c607174 fix(isp): use atomic fsm check 2025-11-06 02:32:37 +00:00
armando
235d607671 change(isp): make wbg standalone 2025-11-06 02:32:37 +00:00
Fu Hanxi
cc72cf9953 Merge branch 'ci/enable-junit-report-in-mr' into 'master'
ci: enable junit report in MR

See merge request espressif/esp-idf!42925
2025-11-06 03:32:19 +01:00
C.S.M
404cc3e29a Merge branch 'refactor/split_jpeg_hal' into 'master'
refactor(jpeg): Split hal layer for jpeg

Closes IDF-14084

See merge request espressif/esp-idf!43028
2025-11-06 10:29:35 +08:00
Jimmy Wennlund
e2a6653680 feat(esp_event): Allow an event carry more data without malloc
This is both a feature and an optimization.

Feature:
Adjustable size of the internal storage in esp_event queue, currently
used by ISR posting, as they wont be able to make a malloc.

Optimization:
When non-isr is posting an event, use the inernal storage in the struct
instead of always allocating a new heap for the data. Most events in
esp-idf only contains a few bytes event information, and we have that
allocation payed for anyway.

This solved in a big part our memory fragmentation issue, as events
happens freqvently and used to create small memory allocations for just
4 bytes, and then in the event handler we usually allocated a bigger
chunk of heap for our feature. When returning from the event handler,
the 4 byte allocation was freed, leaving a hole in the heap.

Merges: https://github.com/espressif/esp-idf/pull/17797
2025-11-05 17:46:00 +02:00
Song Ruo Jing
d30846578f fix(uart): fix uart_write_bytes gets stuck internally if ring buffer is full
Introduced in c062cd9a95
2025-11-05 22:45:49 +08:00
Song Ruo Jing
8818157e42 fix(uart): fix some uart port generate a RX BRK_DET intr on reset issue
Issue saw on S3 UART2 and some LP_UART ports
2025-11-05 22:45:44 +08:00
Roland Dobai
9a704a51eb Merge branch 'fix/precommit_check_readmes' into 'master'
ci(pre-commit): exclude buildv2_test_app from check-readmes

See merge request espressif/esp-idf!43135
2025-11-05 13:55:22 +01:00
Laukik Hase
905913a8db Merge branch 'ci/esp_tee_c5_enable' into 'master'
ci(esp_tee): Re-enable test-apps and examples for ESP32-C5

Closes IDF-10431, IDFCI-3086, and IDFCI-3097

See merge request espressif/esp-idf!42791
2025-11-05 16:06:04 +05:30
Chen Ji Chang
fc3709f050 Merge branch 'fix/pcnt_example_pytest' into 'master'
test(pcnt): fix pcnt example pytest

Closes IDFCI-3827, IDFCI-3590, and IDFCI-4802

See merge request espressif/esp-idf!43081
2025-11-05 18:23:19 +08:00
David Cermak
4f8aa980be fix(ci): Refine depends pattern for netif test apps 2025-11-05 10:41:24 +01:00
Marius Vikhammer
02ff6e9656 test(netif): fixed protocols test-apps building for unrelated comp. changes 2025-11-05 10:40:39 +01:00
David Cermak
e061dec036 fix(example): Fix mtu example to use minimal build 2025-11-05 10:33:36 +01:00
Frantisek Hrbata
1a9d0ce3f5 ci(pre-commit): exclude buildv2_test_app from check-readmes
The `tools/test_build_system/buildv2_test_app` is a cmakev2 build system
testing application, same as `build_test_app`, which should be removed
from the readme check performed by check_build_test_rules.py.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-05 10:21:52 +01:00
Fu Hanxi
a0068b7917 ci: enable junit report in MR 2025-11-05 10:17:14 +01:00
Fu Hanxi
2160ce6c56 ci: remove generate pytest report job
this is a temp workaround, since the current job takes too much time.
should replace it a new implementation
2025-11-05 10:17:14 +01:00
Roland Dobai
d1b91b79b5 Merge branch 'fix/cmakev2_fixes' into 'master'
fix(cmakev2): sync with cmakev1 changes

See merge request espressif/esp-idf!43095
2025-11-05 09:51:30 +01:00
harshal.patil
c66ef46f99 feat(cpu_region_protect): Extend PMP memprot for ESP32-P4 V3 2025-11-05 13:34:47 +05:30
liqigan
fa813a666d fix(bt/bluedroid): Fixed HID memory leak 2025-11-05 15:06:01 +08:00
Kevin (Lao Kaiyao)
70b28a8d8a Merge branch 'fix/fix_i2s_div_zero_coverity_issues' into 'master'
Fix/fix i2s div zero coverity issues

Closes IDF-9839, IDF-12527, IDF-12528, IDF-13108, and IDF-13115

See merge request espressif/esp-idf!43043
2025-11-05 14:53:09 +08:00
Mahavir Jain
79099ee40d Merge branch 'feat/added_force_close_test_for_async_handler' into 'master'
feat(http_server/async_handler): Added test for async handler

Closes IDF-12971

See merge request espressif/esp-idf!43080
2025-11-05 10:27:08 +05:30
Mahavir Jain
4558769ebd Merge branch 'contrib/github_pr_17752' into 'master'
fix: indexing in DNS server IP address retrieval #17751 (GitHub PR)

Closes IDFGH-16654

See merge request espressif/esp-idf!43089
2025-11-05 10:22:38 +05:30
Island
09717c2be6 Merge branch 'feat/support_cble50y25_277' into 'master'
feat(ble): Support controller log compression for ESP32-C3 and ESP32-S3(0871069)

Closes BLERP-2287, BLERP-2288, BLERP-2286, and BLERP-2285

See merge request espressif/esp-idf!42293
2025-11-05 11:27:10 +08:00
Sudeep Mohanty
d96f744e20 Merge branch 'test/freertos_flaky_tests_stabilization' into 'master'
test(freertos): Added miscellaneous stability fixes to unit tests

Closes IDFCI-4361, IDFCI-5963, IDFCI-3577, IDFCI-4619, IDFCI-4932, IDFCI-6043, IDFCI-4849, IDFCI-4804, and IDFCI-4095

See merge request espressif/esp-idf!43027
2025-11-05 04:26:13 +01:00
Zhou Xiao
4ce499148e change(ble): [AUTO_MR] updated rom linker script for ESP32-C2 2025-11-05 11:24:44 +08:00
Zhou Xiao
0be8704ba6 change(ble): [AUTO_MR] Update lib_esp32c2 to eb2959f9 2025-11-05 11:24:43 +08:00
harshal.patil
3090e91e60 fix(esp_security): Set WR_DIS_SECURE_BOOT_SHA384_EN by default when
Flash Encryption Release mode is enabled and Secure Boot P384 scheme not is enabled.
2025-11-05 08:39:55 +05:30
harshal.patil
7168b9f7d3 fix(esp_security): Fix undefined efuse build failure in case of ESP32-P4
- The `wr_dis` efuse bit corresponding to `SECURE_BOOT_SHA384_EN` is absent in P4
2025-11-05 08:39:55 +05:30
harshal.patil
86b52c4f64 change(efuse): Fix the incorrect efuse field name of SECURE_BOOT_EN_SHA384 2025-11-05 08:39:50 +05:30
C.S.M
a7115b6b36 refactor(jpeg): Split hal layer for jpeg 2025-11-05 10:32:41 +08:00
Gao Xu
a359f6fbc9 Merge branch 'feat/p4_eco5_dvp' into 'master'
feat(cam): support esp32p4 eco5 dvp cam

Closes IDF-13929

See merge request espressif/esp-idf!41892
2025-11-05 10:09:46 +08:00
morris
318867b3a2 Merge branch 'refactor/mcpwm_independent_hal' into 'master'
refactor(mcpwm): make mcpwm_hal independent & cleanup soc_caps

Closes IDF-13638 and IDF-14299

See merge request espressif/esp-idf!42886
2025-11-05 09:36:50 +08:00
Armando (Dou Yiwen)
6c8e58b388 Merge branch 'feat/p4_eco5_target_test' into 'master'
esp32p4: temporarily disable target test

Closes CII-17

See merge request espressif/esp-idf!42603
2025-11-05 01:32:16 +00:00
Roman Leonov
dc2013697a feat(tusb_hid_example): Added possibility to wakeup the Host with the button press 2025-11-04 22:17:25 +08:00
Frantisek Hrbata
999cc27599 feat(cmakev2/project): add warning for usage of deprecated variables
The COMPONENTS and EXCLUDE_COMPONENTS variables are unused in cmakev2. A
deprecation warning will be printed if they are set. This change also
includes a helper functions for printing deprecation warnings.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 14:38:13 +01:00
Island
2104c051d7 Merge branch 'change/ble_update_lib_20251103' into 'master'
change(ble): [AUTO_MR] 20251103 - Update ESP BLE Controller Lib

See merge request espressif/esp-idf!43068
2025-11-04 21:22:55 +08:00
He Binglin
32a9b8a8fe Merge branch 'bugfix/esp_idf_esp32h4_dualcore_crash' into 'master'
fix(esp_hw_support): resolved setting mie to disable interrupts failed in sleep flow

Closes IDF-14279

See merge request espressif/esp-idf!42605
2025-11-04 19:10:08 +08:00
Frantisek Hrbata
de5ad78f6b fix(cmakev2/project): drop prefix_map_gdbinit in favor of gdbinit/prefix_map
The cmakev1 dropped generation of prefix_map_gdbinit, reflect this
change also in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 12:08:50 +01:00
Frantisek Hrbata
947d78a04e fix(kconfig): distinguish project configuration menu for excluded components
Currently both menu configs, for component's project configuration and
component's configuration, for components not included in the build have
the same name: "Configuration for components not included in the build".
This might be confusing. Let's use "Project configuration for components
not included in the build" for component Kconfig.projbuild files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 11:39:19 +01:00
Frantisek Hrbata
37efbf8675 fix(cmakev2/project): bump C and CXX standard
The cmakev1 bumped C and CXX standard to gnu23 and gnu++26, do the same
in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 11:10:02 +01:00
Frantisek Hrbata
c98146a8c6 fix(cmakev2/compat): add esp_stdio to common requires
The cmakev1 added esp_stdio to common requires, add it in cmakev2 too
for backward compatibility.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-11-04 11:06:02 +01:00
Mahavir Jain
d06c3d9589 fix(ci): address pre-commit hook failure - spellcheck 2025-11-04 15:11:01 +05:30
Ashish Sharma
b768059299 Merge branch 'fix/incorrect_response_status_code_captive_portal' into 'master'
fix(http_server): Fixed response status code for temporary redirect

Closes IDFGH-16702

See merge request espressif/esp-idf!43061
2025-11-04 17:11:59 +08:00
Gao Xu
db3b7575e8 Merge branch 'fix/delete_deprecated_adc_format' into 'master'
fix(adc): removed deprecated continuous format config

See merge request espressif/esp-idf!43079
2025-11-04 17:00:59 +08:00
Chen Jichang
c696401782 test(pcnt): fix pcnt example pytest 2025-11-04 15:16:41 +08:00
hrushikesh.bhosale
940b8df3cc feat(http_server/async_handler): Added test for async handler
Added test for Async Handler example, hits the /long request
and client closes it forcefully before completion
2025-11-04 12:45:18 +05:30
gaoxu
7a933cdc07 fix(adc): removed deprecated continuous format config 2025-11-04 15:11:34 +08:00
Laukik Hase
bcfe915b74 ci(hal/tee): Fix intermittent hang-ups in PERI_APM tests on ESP32-C5 2025-11-04 11:35:52 +05:30
Laukik Hase
3f82eaed0f ci(esp_tee): Enable the TEE examples for ESP32-C5 2025-11-04 11:33:52 +05:30
Laukik Hase
052f380262 ci(esp_tee): Re-enable the TEE test-apps for ESP32-C5 2025-11-04 11:33:51 +05:30
zhaoweiliang
23847f18da change(ble): [AUTO_MR] Update lib_esp32c6 to ebb26a72 2025-11-04 14:03:45 +08:00
zhaoweiliang
d6474da2ac change(ble): [AUTO_MR] Update lib_esp32c5 to ebb26a72 2025-11-04 14:03:45 +08:00
zhaoweiliang
f667bcab5c change(ble): [AUTO_MR] Update lib_esp32h2 to ebb26a72 2025-11-04 14:03:45 +08:00
Kevin (Lao Kaiyao)
ce65a06cc2 Merge branch 'refactor/parlio_rx_use_dma_link' into 'master'
refactor(parlio_rx): use gdma_link for better gdma link management

Closes IDF-13369, IDF-13627, and IDFGH-16449

See merge request espressif/esp-idf!40743
2025-11-04 12:04:45 +08:00
gaoxu
96959a2128 feat(cam): support esp32p4 eco5 dvp cam 2025-11-04 11:46:38 +08:00
Gao Xu
6aaff2a44c Merge branch 'refactor/rng_ll_c2' into 'master'
refactor(rng): refactor to use hal/ll apis for ESP32C2

Closes IDF-12537

See merge request espressif/esp-idf!42887
2025-11-04 11:43:12 +08:00
laokaiyao
ca8996bfac fix(i2s): fixed divide-by-zero coverity issue 2025-11-04 11:35:47 +08:00
Roland Dobai
a0b589c147 Merge branch 'feat/cmakev2' into 'master'
feat(cmakev2): introduce cmake-based build system v2

See merge request espressif/esp-idf!42691
2025-11-04 02:53:36 +01:00
Roland Dobai
a6396a5387 Merge branch 'feature/cmake_presets' into 'master'
feat(tools): add idf.py support for CMake configuration presets

Closes IDF-13090, IDF-9350, and DOC-12674

See merge request espressif/esp-idf!40552
2025-11-03 17:15:46 +01:00
hrushikesh.bhosale
29d1bfb950 fix(http_server): Fixed response status code for temporary redirect
Closes https://github.com/espressif/esp-idf/issues/17791
2025-11-03 19:54:39 +05:30
hebinglin
128e1e7dc2 change(esp_hw_support): use true critical_frame length to check crc 2025-11-03 20:57:58 +08:00
zwx
7d5bcf64fb feat(esp_coex): set the pull mode of the external coex input pin 2025-11-03 19:49:44 +08:00
Sudeep Mohanty
ba9591f753 test(freertos): Added miscellaneous stability fixes to unit tests
This commit adds fixes for freertos unit tests for a more deterministic
run and avoid occational failures.
2025-11-03 17:55:45 +08:00
Zhou Xiao
b525e6555b feat(ble): make ble log task stack size configurable 2025-11-03 17:46:21 +08:00
chenjianhua
b870a8fb5a feat(ble): Enable get bt ts for ESP32-C3 and ESP32-S3 2025-11-03 17:46:21 +08:00
chenjianhua
03758ba550 feat(bt): Update bt lib for ESP32-C3 and ESP32-S3(0871069)
- Added more log for BLE
- Support BLE log filter and simeple output
- Support BLE log compression
2025-11-03 17:46:21 +08:00
Island
9eff48730e Merge branch 'fix/ble_mesh_fixed_incorrect_log' into 'master'
fix(ble_mesh): fixed incorrect log argument

Closes BLERP-808

See merge request espressif/esp-idf!43025
2025-11-03 16:30:49 +08:00
Rahul Tank
3d71614836 Merge branch 'bugfix/fix_compilation_issues' into 'master'
fix(nimble): Address compilation issues in nimble examples

See merge request espressif/esp-idf!42563
2025-11-03 13:57:31 +05:30
Mahavir Jain
8cc741cece Merge branch 'contrib/github_pr_17641' into 'master'
Allow the https server to request client certs only with OPTIONAL (GitHub PR)

Closes IDFGH-16506

See merge request espressif/esp-idf!42393
2025-11-03 13:51:48 +05:30
Mahavir Jain
3d5aa8cad1 Merge branch 'fix/add_bootloader_and_partition_table_as_encrypted_flash_targets' into 'master'
Add Bootloader, Partition Table and ESP-TEE as dependencies for encrypted-flash

See merge request espressif/esp-idf!43022
2025-11-03 09:43:58 +05:30
Mahavir Jain
06805d177c Merge branch 'feature/mbedtls_psa_migration_migrate_esp_http' into 'master'
Migrate esp_http_client and esp_http_server to PSA API

See merge request espressif/esp-idf!41035
2025-11-03 09:39:54 +05:30
Mahavir Jain
de349404a8 Merge branch 'fix/fix_coverity_483744' into 'master'
fix: fix unused value in esp uart driver (coverity 487344)

Closes IDF-13755

See merge request espressif/esp-idf!42908
2025-11-03 09:36:26 +05:30
Ondrej Kosta
2cb9c7177e Merge branch 'fix/bridge_example' into 'master'
fix(examples): fixed bridge example test endnode to host send

Closes IDFCI-2994

See merge request espressif/esp-idf!42928
2025-11-03 11:26:10 +08:00
igor.udot
824c7f7320 ci: extend wildcard support for no_runner_tags 2025-11-03 02:48:04 +00:00
igor.udot
7a411e8a1b ci: extend wildcard support for EXCLUDE_RUNNER_TAGS 2025-11-03 02:48:04 +00:00
armando
2c9c5c66c8 change(ci): temporarily disable p4 target test 2025-11-03 02:48:04 +00:00
Fu Hanxi
5a5d1ae7d9 Merge branch 'ci/improve-tests' into 'master'
tests: change wifi tests expect timeout to 60

See merge request espressif/esp-idf!42888
2025-11-03 03:45:57 +01:00
luoxu
0b20cc4bed fix(ble_mesh): fixed incorrect log argument 2025-11-03 10:41:25 +08:00
morris
0332719183 Merge branch 'refactor/remove_twai_errata_config' into 'master'
refactor(driver_twai): remove twai errata config

Closes IDF-13623 and IDF-13002

See merge request espressif/esp-idf!42850
2025-11-03 10:28:29 +08:00
gaoxu
064cd69661 refactor(rng): refactor to use hal/ll apis for ESP32C2 2025-11-03 10:25:41 +08:00
Chen Chen
d1612b952e refactor(mcpwm): make mcpwm_hal independent & cleanup soc_caps 2025-11-03 09:36:23 +08:00
Shu Chen
08d45b8ef3 Merge branch 'bugfix/fix_thread_ci_testcases_not_stable' into 'master'
feat(openthread): optimize fail cases in CI test

Closes IDFCI-2537, IDFCI-2642, IDFCI-3576, IDFCI-3623, IDFCI-3955, IDFCI-5136, IDFCI-5072, IDFCI-5065, IDFCI-4997, IDFCI-3026, IDFCI-3019, and IDFCI-3020

See merge request espressif/esp-idf!42971
2025-11-03 01:30:16 +00:00
Fu Hanxi
1e79c69fc4 tests: change wifi tests expect timeout to 60
- wifi_router
- wifi_ap
- wifi_high_traffic
2025-11-03 09:19:02 +08:00
harshal.patil
9840685b2d fix(build_system): Add Bootloader and Partition Table as dependencies for encrypted-flash
- If ESP-TEE is enabled, also add it as the dependency for the encrypted-flash target
2025-10-31 14:15:26 +05:30
Island
b50619304e Merge branch 'fix/hci_log_spi_out_ceva' into 'master'
fix(ble): fixed hci event log when link layer logging is disabled

See merge request espressif/esp-idf!42985
2025-10-31 16:06:02 +08:00
yiwenxiu
f58b23ed74 feat(openthread): optimize fail cases in CI test 2025-10-31 14:54:57 +08:00
Chen Ji Chang
7184854500 Merge branch 'feat/switch_h4_ci_build_to_mp' into 'master'
feat(esp32h4): switch default h4 build to mp version

Closes IDF-13771

See merge request espressif/esp-idf!42814
2025-10-31 14:54:41 +08:00
hebinglin
6d51f0ea8b fix(esp_hw_support): resolved setting mie to disable interrupts failed in sleep flow 2025-10-31 14:37:25 +08:00
Mahavir Jain
eda03db6d3 Merge branch 'fix/mmu_psram_anti_fi_target_condition' into 'master'
Fix MMU PSRAM anti-fi MMU target check

See merge request espressif/esp-idf!42940
2025-10-31 09:36:45 +05:30
Mahavir Jain
6f22bedf7c Merge branch 'feature/enable_ecc_const_time_support_for_esp32p4_eco5' into 'master'
feat(hal): add support for ECC constant time function in ESP32-P4 ECO5

Closes IDF-13523

See merge request espressif/esp-idf!42343
2025-10-31 09:23:47 +05:30
Jiang Jiang Jian
dc2b545a16 Merge branch 'bugfix/fix_aid_issue_and_wrong_channel_number_issue' into 'master'
fix(wifi): fix some wifi bugs related bandwidth, twt and regdomain

Closes WIFIBUG-1490

See merge request espressif/esp-idf!42564
2025-10-31 08:55:15 +08:00
morris
604e58c90a Merge branch 'bugfix/fix_gdma_acquire_and_release' into 'master'
fix(gdma): fix the concurrent contention issue of gdma application or release

Closes IDF-13548

See merge request espressif/esp-idf!40501
2025-10-31 08:47:22 +08:00
Erhan Kurubas
b3132d31ed Merge branch 'esp_tracing_component' into 'master'
New Esp tracing component

Closes IDF-13405 and DOC-12721

See merge request espressif/esp-idf!41755
2025-10-30 23:07:49 +01:00
Jiang Jiang Jian
be55a703e8 Merge branch 'fix/p4_rev3_further_fixes' into 'master'
fix(esp_hw_support): p4 rev3 further fixes

See merge request espressif/esp-idf!42939
2025-10-31 05:13:30 +08:00
Shen Meng Jing
310f973583 Merge branch 'docs/sync_en_and_cn_docs' into 'master'
docs: Sync EN and CN docs without 'needs translation' label

Closes DOC-12700

See merge request espressif/esp-idf!42919
2025-10-30 23:01:35 +08:00
Erhan Kurubas
1dac8685db feat(tracing): add new component for tracing 2025-10-30 12:15:35 +01:00
Island
3671a41e35 Merge branch 'fix/ble_mesh_trans_enh_seg_rpl' into 'master'
fix(ble_mesh): fixed incorrect rpl behavior in transport enh

Closes BLERP-2342

See merge request espressif/esp-idf!42974
2025-10-30 19:06:52 +08:00
muhaidong
7b79f8c671 fix(wifi): fix wifi init fail issue
Closes https://github.com/espressif/esp-idf/issues/13643
2025-10-30 17:22:56 +08:00
Frantisek Hrbata
7116d9dc01 feat(toolchain): more remove_duplicated_flags function to separate file
Currently, the toolchain CMake files use the remove_duplicated_flags
function from utilities.cmake. The cmakev2 implementation also includes
this function for backward compatibility. Move the
remove_duplicated_flags function to a separate file,
deduplicate_flags.cmake, so it can be shared between cmakev1 and
cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a5866a2566 ci(codeowners): add tools/cmakev2 into CODEOWNERS
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
4153910238 ci(pre-commit): revert temporary disable check-kconfig-files
Enable check-kconfig-files. It was temporarily disabled because it was
not possible to add a new sourced file through an environment variable,
as kconfcheck had a fixed list of allowed environment variable names.
This issue should now be resolved.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e65fc5ee09 ci(cmakev2): run the buildv2 tests only if the buildv2 label is set
Currently, the buildv2 tests are initiated using the same patterns as
the tests for the current build system. This means that any change in
the current build system will also trigger the buildv2 tests. Initially,
it might be wise not to block the CI for changes in the current build
system in case there is an issue with buildv2. Therefore, let's
explicitly start the buildv2 tests only when the buildv2 label is set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
67c8d97280 fix(esp_libc/cmake): add vfs as requirement if CONFIG_VFS_SUPPORT_IO is enabled
The esp_libc relies on the stdio implementation of the vfs component if
CONFIG_VFS_SUPPORT_IO is enabled. This is not an issue in cmakev1
because if the vfs component is not included in the project build, its
configuration is not available, and CONFIG_VFS_SUPPORT_IO is not set.
However, in cmakev2, the configuration for all components is available,
and the presence of some component configuration options does not
necessarily mean that the component is included in the project build.
When esp_libc is compiled without the vfs dependency but with
CONFIG_VFS_SUPPORT_IO enabled, the libc initialization will encounter a
panic due to a NULL pointer dereference (fp->_flags) in __swsetup_r, as
fopen in esp_libc_init_global_stdio will return NULL.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
b8ded7cb65 feat(cmakev2/docs): add note about v2 being technical preview
Although the current documentation exposes only limited functionality,
which is unlikely to change, add an explicit note that the build system
v2 is currently a technical preview intended for testing and early
evaluation.

Ensure consistency in referring to v2 throughout the documentation. In
some places, it is referred to as V2 or Version 2; unify this to v2.

Additionally, update the hello_world example for v2 to use the
idf::spi_flash alias instead of the interface variable to maintain
consistency with the rest of the documentation.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
abdf8af8e5 feat(cmakev2/docs): prefer idf_component_register to create new components
Extend the current documentation to recommend using the
idf_component_register function as the preferred method for creating a
new component for v2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
997cd81675 feat(cmakev2/compat): add idf_component_register to the API
Using idf_component_register is the preferred method for creating new
components for cmakev2. This approach ensures compatibility with both
versions of the build system. The KCONFIG and KCONFIG_PROJBUILD options
have been removed from the API documentation, but are retained in code
in case a cmakev1 component uses these options to warn about
incompatibility. Also remove a note about `project_include.cmake`,
because cmakev2 includes all project_include files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
74efd5e386 feat(cmakev2/docs): extend esp_target_info component example
Enhance the `esp_target_info` component example by adding some of
the missing features that the component might require. This includes
adding a linker script, a linker fragment, linking the component archive
as a whole library, and providing an example of how the linker options
can be set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
94a797872c feat(cmakev2/docs): add information about cmakev2 component incompatibility with cmakev1
Components designed exclusively for cmakev2 are not compatible with
cmakev1 due to the lack of forward compatibility. It is important to
clarify this at the very beginning of the `Creating a New Component`
section. Additionally recommended a guidance on how to create a
component that will be compatible with both versions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
fc1f995e5e fix(cmakev2/component): set the cmakev2 component archive name
Currently, the archive file name is set only in the cmakev1
idf_component_register shim. The predictable component archive file name
is important, for example, for usage in linker fragments. Ensure that
the cmakev2 component also has the archive file name set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a7977d0d14 fix(cmakev2/component): fix setting SOURCES for cmakev2 components
Currently, when the cmakev2 component sources are set, the SRCS target
property is used.  This is obviously wrong because the correct CMake
property is SOURCES.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2760eca984 feat(cmakev2/build): rename LINKER_SCRIPTS_STATIC to LINKER_SCRIPTS
Rename the LINKER_SCRIPTS_STATIC component property to LINKER_SCRIPTS.
This property stores linker scripts that are not processed by ldgen,
which essentially includes all of them. The only linker script processed
by ldgen is sections.ld, which is handled by the esp_system component.
This implies that there is likely no practical use case for other
components to utilize ldgen processed linker scripts. This change is
purely cosmetic to allow components to add linker scripts with:

idf_component_set_property(${COMPONENT_TARGET} LINKER_SCRIPTS linker_script.ld APPEND)

instead of

idf_component_set_property(${COMPONENT_TARGET} LINKER_SCRIPTS_STATIC linker_script.ld APPEND)

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
87fc989e54 feat(cmakev2/docs): initial basic documentation
Add very basic documentation. It is currently written with the
expectation that the reader is already familiar with the existing build
system and focuses more on the changes that might be necessary to adapt
existing components to work with cmakev2.  Additionally, it provides
basic information on how to create a new component and project.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
229000b186 fix(cmakev2/docs): keep only the very basic functions in API
Currently, we include numerous functions in the automatically generated
documentation for the build system API. Let's begin with only the
essential functions and gradually add more to the API based on requests
and actual needs.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
e50a9112ee feat(cmakev2): Enable buildv2 tests for windows on CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
e744534fca fix(cmakev2): Add workaround in idf_build_component for duplicate managed component
This commit adds a workaround in idf_build_component shim to avoid
initialization of a duplicate managed component. The component manager
when running on a Windows system returns duplicate managed components
upon successive invocations.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
06ae65cca4 fix(cmakev2/component): fix component library link with whole archive
The current approach involves wrapping the library target within the
library interface target with the whole-archive flags, such as for the
GCC linker. However, this does not work as expected because the library
target is expanded, and the whole-archive flags are also applied to
other library targets that the wrapped library target depends on. IOW
the whole-archive flags surround multiple archives, not just the one
requrested.  Generally, using linker flags like whole-archive in the
library INTERFACE(INTERFACE_LINK_LIBRARIES) does not seem to work as
CMake may perform deduplication and rearrange the flags [1].

The proof of concept used `CMAKE_LINK_LIBRARY_USING_<FEATURE>` with the
WHOLE_ARCHIVE feature, which was introduced in CMake 3.24 to specify how
the library target should be linked. There are two issues with this.
First, this feature is only available from CMake 3.24 onwards, while our
minimum CMake version is set to 3.22. More importantly, all occurrences
of a library on the link line are wrapped.  For example, if a library
like `vfs` appears multiple times on the link line due to dependencies,
each occurrence will be wrapped with whole-archive, causing the linker
to complain about multiple symbol definitions. Therefore, even though
WHOLE_ARCHIVE is recommended for handling whole-archive linkage, it does
not seem suitable for our purposes. This was overlooked in the PoC
because only a simple testing component was used to check the
WHOLE_ARCHIVE behavior.

One way to address this issue is to adopt the same approach used in
cmakev1, which involves specifying the whole-archive flags when linking
component library targets to the final executable. In this case, CMake
retains the flags without any alteration, unlike when the flags are
specified in INTERFACE_LINK_LIBRARIES for the component interface
targets. While this approach is feasible, it would alter the current
logic, where we have a single library interface for the entire idf
library that can be linked to the executable. This change would also
complicate the direct use of the idf library, as it would no longer be
possible to simply link it to the executable. Instead, the executable
would need to correctly link the component libraries with the
whole-archive flags. We could encapsulate this process within the
idf_build_executable function, but projects that only use
idf_build_library would need to implement the same solution.

It appears possible to address this issue by using target_link_options
instead. This allows to specify exactly what should appear on the link
command line. One side effect of this approach is that the library
appears on the link command line multiple times: first when used with
target_link_options and second when used in target_link_libraries.
However, this does not seem to pose a problem. The flags specified with
target_link_options appear on the command line first, ensuring that the
whole-archive is prioritized, and the component archive libraries may be
repeated on the link line anyway due to dependencies. Essentially, the
final link command line is very similar to the one from cmakev1. We may
revisit this approach in the future, but for now, it seems to work as
expected.

[1] https://gitlab.kitware.com/cmake/cmake/-/issues/20078
[2] https://cmake.org/cmake/help/latest/variable/CMAKE_LINK_LIBRARY_USING_FEATURE.html
[3] https://discourse.cmake.org/t/automatically-wrapping-a-static-library-
    in-whole-archive-no-whole-archive-when-used-during-linking/5883

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6284960254 fix(cmakev2/component): sanitize PATHS argument before calling __get_relative_paths
Currently, when the cmakev1 properties for INCLUDE_DIRS and
PRIV_INCLUDE_DIRS are constructed in the
__set_component_cmakev1_properties function, the return values from the
get_target_property function for INCLUDE_DIRECTORIES and
INTERFACE_INCLUDE_DIRECTORIES properties are not checked. If a component
target does not set e.g. INCLUDE_DIRECTORIES property,
get_target_property will return a value such as `include_dirs-NOTFOUND`.
This value is subsequently passed to __get_relative_paths in the PATHS
argument, causing the file(RELATIVE_PATH) call in __get_relative_paths
to fail with an error.

```
CMake Error at /home/fhrbata/work/esp-idf/tools/cmakev2/utilities.cmake:235 (file):
  file RELATIVE_PATH must be passed a full path to the file:
  include_dirs-NOTFOUND
```

Fix this by explicitly set the PATHS to an empty list before passing it
to the __get_relative_paths function if the property is not set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
496ebf0583 feat(cmakev2): Enabled test_cmake.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
f3ffef0075 feat(cmakev2): ruff formatting changes for test_cmake.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
577c0117cc feat(cmakev2): Create executable dummy source only if it does not exist
idf_build_executable() creates a dummy source file to create the
executable target. Since this file is created unconditionally everytime
CMake configuration happens, a source file change is registered which
causes CMake to execute other targets even though no other source file
changed.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
22eb926468 feat(cmakev2): Enabled all component manager tests for cmakev2 2025-10-30 17:17:49 +08:00
Peter Dragun
a66fecf16e fix: Update esptool commands to use new syntax 2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1139551fde fix(test_build_system): disable tests related to outside component dependencies
The commit adb2d5deee ("feat(cmake): Produce warnings when component dependen..")
introduced additional checks for source files and include directories
used by a component that are located outside the component's directory.
If these files and directories belong to another component, a warning is
issued. This feature has not yet been implemented in cmakev2, so related
tests are temporary disabled.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
84e65e5d24 feat(cmakev2): Enable test_components.py for cmakev2 in CI 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
bb3ce41141 feat(cmakev2): ruff formatting changes for test_components.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
7030b25137 feat(cmakev2): Store COMPONENT_OVERRIDEN_DIR property for components 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
0666fb28ea feat(cmakev2): Enabled test_common.py for cmakev2 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
7fe743896d feat(cmakev2): Rename buildv2_test_app source file
This commit renames the buildv2_test_app.c file to build_test_app.c in
the buildv2_test_app template to enable tests to refer to the same
source file name when writing tests for both cmakev1 and cmakev2.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
c63063f3f6 feat(cmakev2): Enabled test_versions.py for cmakev2 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
f51b79dbe0 feat(cmakev2): ruff formatting changes for test_versions.py 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
3f69493a1e feat(cmakev2): Enable completely passing build tests for cmakev2 in CI
This commit enables the following tests for cmakev2 in CI which do not
need any updates:
- test_bootloader.py
- test_git.py
- test_kconfig.py
- test_partition.py
- test_reproducible_build.py
- test_sdkconfig.py
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e0525d7e94 feat(cmakev2/component): add __set_component_cmakev1_properties function
In cmakev1, certain arguments provided to the idf_component_register
function are stored as component properties. These properties are used
to generate the project_description.json file, which other tools rely
on. Since the idf_component_register function is obsolete in cmakev2, we
need to recreate component properties such as INCLUDE_DIRS,
PRIV_INCLUDE_DIRS, REQUIRES, and PRIV_REQUIRES, which were previously
provided by the idf_component_register function in cmakev1.  To achieve
this, let's examine the component's real target cmake properties and
reconstruct them to maintain compatibility with cmakev1.

The real target cmake properties may include generator expressions,
which are ignored. This should be acceptable, as they were not addressed
in cmakev1 either, and handling them is likely not feasible.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
ccab0ba626 feat(cmakev2/utilities): add __list_difference function
Return the difference between two lists, meaning the elements that are
present in the first list but not in the second.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
0e9ffe7ea9 feat(cmakev2/utilities): add __list_intersection function
Return the intersection of elements in the two lists.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e1a697ef3c feat(cmakev2/utilities): add __remove_genex function
This helper function removes entries containing generator expressions
from the given list. The list is modified in place.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
ec9c540926 feat(cmakev2/utilities): add __get_relative_paths function
This is a helper function that returns a list of paths relative to a
given base directory for a list of input paths.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
31ce25ba60 feat(cmakev2/build): preprocess linker scripts with the C preprocessor
When a linker script file with a .in extension is added using the
target_linker_script function, it is processed with the C preprocessor.
The linker scripts are preprocessed only once, even if they are used in
multiple libraries, because they are the same.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
caac44f382 feat(cmakev2/utilities): add __preprocess_linker_script function
Add a helper function to enable C preprocessing of linker script files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
291cc6898d feat(cmakev2/component): add COMPONENT_BUILD_DIR component property
During the initialization of a component in the __init_component
function, add the COMPONENT_BUILD_DIR property. This can be used to
store component-specific generated files, such as preprocessed linker
scripts.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2bcea86b83 fix(esp_hal_i2c/cmake): fix the usage of the uninitialized variable
The `includes` list variable is used without initialization. Initialize
it explicitly.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
7ff30604fb fix(cmakev2/compat): newlib renamed to esp_libc
The component has been renamed, update the name in the common
requirements for the cmakev1 components.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
92036ee22f feat(cmakev2/build): introduce component interface cache
The component can be referenced by multiple identifiers such as the
component name, which is derived from the component directory name,
component target, interface, or aliases. All component properties are
attached to the component interface target, which is also used for
declaring component dependencies. The cmakev2 build system has a
function called __get_component_interface, which is responsible for
identifying the component interface based on the given component
identifier. Since this function is called frequently, it needs to be
reasonably fast.

This introduces a new __idf_component_interface_cache INTERFACE target,
which serves as a mapping cache between component identifiers and the
component interface. The cache for each component is initialized in the
__init_component function, which introduces a component to the build
system. Currently, the component interface search is conducted by
examining the COMPONENTS_DISCOVERED and COMPONENT_INTERFACES lists
stored as build properties. Since the build system is aware of most
component identifiers, such as component name, target, and alias, during
component initialization, it can add mappings between component
identifiers and the component interface to a cache, which is built as
the components are initialized. This cache is used in the
__get_component_interface function instead of looking into the
COMPONENTS_DISCOVERED or COMPONENT_INTERFACES lists. This significantly
speeds up the component interface search and also makes the code much
simpler and more readable.

The component interface cache also completely replaces the existing
component name resolution, which was introduced because of the component
manager, and the cache used for resolved component names. This is
possible because all the necessary information is available during
component initialization when the component interface cache is
populated. The ambiguity of components is resolved based on component
source/priority.

Here is an example of the component interface mapping for the
espressif__led_strip component to the idf_espressif__led_strip interface
target. The component name, without the namespace, is referred to as the
short name. In this example, it is led_strip.

- espressif__led_strip -> idf_espressif__led_strip      # name(directory name)
- idf_espressif__led_strip -> idf_espressif__led_strip  # interface
- idf::espressif__led_strip -> idf_espressif__led_strip # alias
- _idf_espressif__led_strip -> idf_espressif__led_strip # real target
- led_strip -> idf_espressif__led_strip                 # short name

When another component with the same espressif__led_strip name is
initialized with a different priority, there is no need to change
anything in the cache, because the mapping stays the same.

The cache must be updated when two components share the same short name
but belong to different namespaces. This situation is likely uncommon.
For instance, consider espressif__led_strip and my__led_strip. If
my__led_strip has a higher priority, the cache is updated to reflect the
short name as follows:

- led_strip -> idf_my__led_strip

If both components have the same priority, the short name mapping for
led_strip is entirely removed. Conversely, if my__led_strip has a lower
priority, no short name mapping is added for it.

The short name is also added to the COMPONENT_SHORT_NAME property of the
component.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
998c8870eb feat(cmakev2/kconfig): add idf_create_confserver function
This is a revised version of the existing __create_confserver_target
function. It creates a specified confserver target for a given
executable. The kconfig_menus.json file, used by the IDEs, is generated
when the confserver starts. This differs from the previous behavior,
where kconfig_menus.json was created globally along with other sdkconfig
formats. The reason for this change is that kconfig_menus.json contains
the Kconfig menu hierarchy and it is not just a flat option-value
format. It needs to accurately reflect which configurations for which
components are included or excluded. The kconfig_menus.json is generated
at `build/kconfig_menus.json`, where IDEs expect it. This means the file
is overwritten every time the server starts by kconfig_menus.json
version for given executable, so only one confserver can run at a time.

This is likely acceptable, as I don't believe it's possible to safely
run multiple instances of confserver due to the potential race
conditions when the sdkconfig file are generated.

In the future, we may include the location of kconfig_menus.json in
project_description.json so it can be easily identified by IDEs for
each executable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
c5d21936be fix(cmakev2/kconfig): do not automatically generate the kconfig_menus.json file
Currently, when the initial sdkconfig is generated, the
kconfig_menus.json format is also created alongside other formats like
CMake, JSON, or C header. The kconfig_menus.json depends on the Kconfig
hierarchy and cannot be generated globally. It must be generated for
each executable to ensure that included and excluded components are
correctly positioned within the Kconfig menu hierarchy. Remove the
automatic generation of kconfig_menus.json.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
9da953f3a7 fix(cmakev2/kconfig): remove --env-file argument from base kconfgen command
The current base kconfgen command is stored in the __BASE_KCONFGEN_CMD
build property, and it includes the --env-file option pointing to the
`build/config.env` file. The `build/config.env` file does not separate
component configuration files into included and excluded components,
because it is created before any executable is added and we need it for
the initial sdkconfig generation. The global `build/config.env` can be
used for every sdkconfig format (cmake, json, txt), but not for the
kconfig_menus.json format, because kconfig_menus.json relies on the
Kconfig layout and hierarchy. Let's allow specifying the --env-file for
each kconfgen invocation and remove it from the base kconfgen command.
This allows you to specify an --env-file for each executable, each with
its own config.env file.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
21dc3cdac9 fix(cmakev2/kconfig): __run_kconfgen does not take any arguments
The __run_kconfgen function does not take any arguments. The output
formats and related files are stored in the __KCONFGEN_OUTPUTS_CMD build
property.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e7fad46ea7 feat(cmakev2/kconfig): add idf_create_save_defconfig function
This is basically a renamed version of __create_save_defconfig_target.
The creation of the save-defconfig target is done in
`idf_project_default()`.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
019e8ab9a6 feat(cmakev2/kconfig): add idf_create_menuconfig function
For a specified executable, create a menuconfig target using the name
provided in the TARGET option. The function generates a config.env file
specific to the executable, where Kconfig files for components linked to
the executable and Kconfig files for components not linked to it are
separated. This separation allows for a clear visual distinction between
the configuration of components that are linked and those that are not
linked to the executable within the menuconfig.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
02e6beb695 feat(cmakev2/kconfig): add __create_executable_config_env_file function
Generate the config.env file for the specified executable. The
configuration file will be stored in the build directory, within a
directory named after the executable target name. The kconfigs*.in
files, which are generated by prepare_kconfig_files.py, will also be
stored in this directory.

This function primarily prepares the arguments for the
__create_config_env_file function based on the components linked to the
executable, ensuring that component Kconfig files are stored in the
appropriate kconfigs*.in files, depending on whether the component is
linked to the executable.

The directory where the generated files are stored is added to the
executable CONFIG_ENV_DIR property.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
b88d40ce07 feat(cmakev2/kconfig): allow to specify Kconfig files for __create_config_env_file
The __create_config_env_file function generates a configuration file for
the prepare_kconfig_files.py script. Currently, it specifies the paths
for the kconfigs*.in files, which are generated by
prepare_kconfig_files.py, to be located in the build directory. The
kconfigs*.in files, along with the configuration file, must also be
generated for each executable, as each executable may have a
different set of linked components. Set the paths for the
kconfigs*.in files to be generated by the prepare_kconfig_files.py
script in the same directory as the configuration file.

Also allow explicit specification of which component configuration files
should be placed in different kconfigs*.in files. For sdkconfig
generation, it is not relevant whether a component's Kconfig file is
placed in the kconfigs.in or kconfigs_excluded.in file. This distinction
is only important for visually separating the configuration of included
and excluded components in the menuconfig. For the main sdkconfig, all
component Kconfig files are placed in the kconfigs.in file, and the
generated kconfigs*.in files are stored in the build directory. For
executables, the generated kconfigs*.in files will be stored in separate
directories for each executable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1bfda962ef fix(cmakev2/kconfig): do not add excluded Kconfig files in the build properties
The excluded Kconfig files cannot be collected globally, they must be
collected per executable. The distinction between included and excluded
Kconfig files is relevant only for menuconfig, which is specific to each
executable, as each executable may have a different set of linked
components. For the global sdkconfig file and its CMake and JSON
variants, whether the Kconfig files are excluded or not is irrelevant.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
75cf711cc3 fix(test_build_system): use block comment instead of return for cmakev2 test app
Commit 46b41dfec187 ("test(cmakev2): Enable CI tests for component manager ..")
introduced a temporary workaround for the cmakev2 testing
application by including the cmakev1 project.cmake file after the
return() statement. The issue is that some tests, such as
test_build_fail_on_build_time, append commands to the project's
CMakeLists.txt. These commands are placed after the newly added return()
statement, causing them to be ignored and resulting in test failures. To
resolve this, include the cmakev1 project.cmake within the cmake block
comment.

Fixes: 46b41dfec187 ("test(cmakev2): Enable CI tests for component manager ..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6e643709cc ci(cmakev2): enable test_build.py test for cmakev2
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
99002a86af feat(test_build_system): enable test_build.py to be executed using cmakev2
Three tests are disabled for cmakev2:
* test_build_dfu
* test_build_uf2
* test_build_loadable_elf

and one is modified:
* test_build_skdconfig_phy_init_data

the other 14 tests should pass.

The tests, test_build_dfu and test_build_uf2, are temporarily disabled
because cmakev2 currently does not include the dfu and uf2 targets.
These tests should be re-enabled once support is added to cmakev2.

The test_build_loadable_elf is disabled because the bootloader_support
component determines its requirements based on the sdkconfig values,
specifically the CONFIG_APP_BUILD_TYPE_RAM used in this test. When
CONFIG_APP_BUILD_TYPE_RAM is set, bootloader_support declares a
dependency on micro-ecc. This is wrong even in cmakev1 and should be
fixed.

The test_build_skdconfig_phy_init_data test requires the esp_phy
component but does not specify it in its requirements. It relies on the
cmakev1 behavior, where all components are included in the build by
default. This approach does not work for cmakev2. To resolve this, make
the dependency on esp_phy explicit, ensuring compatibility with both
versions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
22689ce62e fix(cmakev2/kconfig): make warnings about misspelled Kconfig names consistent with cmakev1
Currently, the cmakev2 implementation of Kconfig name consistency has a
slightly different warning message compared to cmakev2, causing the test
`test_build.py::test_build_with_misspelled_kconfig` to fail.  Make the
warning messages consistent with cmakev1.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f28ebc5175 fix(test_build_system): rename Kconfig.projbuild to KConfig.projbuild
The test_build_with_misspelled_kconfig test expects a KConfig.projbuild
file in the main component. However, the file is correctly named
Kconfig.projbuild, which causes the test to fail for cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6594924bbe fix(cmakev2/component): remove EXCLUDE_FROM_ALL when calling add_subdirectory
Currently, cmakev2 evaluates each component using add_subdirectory with
the EXCLUDE_FROM_ALL option. The intention was to exclude all components
from being built by default unless they are explicitly linked to an
executable based on dependencies. This approach aims to avoid building
components that are included but not actually linked to the executable.
However, this has the side effect of preventing components from adding
their custom targets to the "all" target, which is used, for example, by
esp_phy. Generally, we should not restrict components from adding
targets to "all". Since components are only included if explicitly
requested by default, removing the EXCLUDE_FROM_ALL option should be
acceptable.

The downside is that if IDF_INCLUDE_ALL_COMPONENTS is set and the user
runs `idf.py build`, all components will be built, even if they are not
linked to the executable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e4fabbca80 fix(cmakev2/idf): target consistency check with sdkconfig
Currently, the check is based on the existence of sdkconfig, but there
may be situations where sdkconfig exists without containing
CONFIG_IDF_TARGET. Perform a target consistency check only if the target
is identified in the main sdkconfig file.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
fc6564f008 fix(cmakev2/utilities): fix typo in __get_sdkconfig_option description
The function name is __get_sdkconfig_option, not __get_config_option.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
548a4bfbac fix(cmakev2): Add build properties to store resolved component names 2025-10-30 17:17:49 +08:00
Frantisek Hrbata
abddda342f fix(cmakev2/docs): reformat function arguments for API documentation
The function arguments in the documentation comments were using field
list, which caused text overflow in the generated documentation and
generally resulted in poor formatting. Let's use paragraphs for
the argument descriptions instead.

The documentation comments are written in reStructuredText, but
currently, they use inconsistent indentation. Standardize all the
documentation comments to use a four-character indentation.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
17d7507f29 feat(docs): add build system v2 documentation files
Add stump files for the build system v2 documentation with automatic API
generation from CMake files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
8146123890 feat(docs): load esp_docs_cmakev2_extension
Load the esp_docs_cmakev2_extension to process documentation comments
from CMake files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
dc846dbe8d feat(cmakev2/docs): add esp_docs_cmakev2_extension sphinx extension
Add a Sphinx extension that introduces a new `cmakev2` domain with
multiple directives, allowing for the automatic extraction of
documentation comments from CMake files and their inclusion in the
Sphinx-generated documentation.

Directives:

- `cmakev2:include`: The included CMake file is processed for
  documentation comments within the `#[[api` and `#]]` marks, which
  should contain valid reStructuredText markup.

- `cmakev2:function`: Creates a CMake function node. All function nodes
  are sorted by name and placed into the `_cmakev2_functions` section.

- `cmakev2:macro`: Creates a CMake macro node. All macro nodes are
  sorted by name and placed into the `_cmakev2_macros` section.

- `cmakev2:variable`: Describes a CMake variable node. All variable
  nodes are sorted by name and placed into the `_cmakev2_variables`
  section.

Each node can be referenced with `` :cmakev2:ref:`<node name>` ``, where
the node name is the function, macro, or variable name as used in the
related directive.

Example:

CMake file:
```
 #[[api
        .. cmakev2:function:: idf_flash_binary
 #]]
```

This function can be referenced with `` :cmakev2:ref:`idf_flash_binary` ``
and will be placed in the `.. _cmakev2_functions:` section.

The extension is currently located in esp-idf, but in the future, we
should consider moving it to esp-docs.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
0c69d53b68 test(cmakev2): Enable CI tests for component manager for cmakev2
This commit adapts the component manager build tests for cmakev2 and
enables them for CI test runs.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
1017be951b feat(cmakev2): Allow users to set the dependencies lock file 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
012670a6e0 fix(cmakev2): Build must include component manager output when re-run is expected
The build system should include the file generated by the component
manager after downloading components even if the component manager
requested a re-run due to a missing Kconfig.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
79eefd1ba9 feat(cmakev2): Reorganise build system initialization
This commit updates the order of initialization for build system v2. All
non-project initializations are handled in idf.cmake and all
project-specific initializations are now moved to idf_project_init().
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
63695ad838 feat(cmakev2/project): add idf_build_generate_flasher_args function
Generate the flasher_args.json file for the global flash target for
tools that require it.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
7e808b34ec feat(cmakev2/test): add binary image generation and flash targets
Generate binary images and add flash targets for hello_world_example and
fatfs_example.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
aacbd1773b fix(cmakev2/build): rename FILE to OUTPUT_FILE option for idf_build_generate_metadata
All other functions, such as idf_build_binary, use OUTPUT_FILE. This is
more descriptive and provides more flexibility to add additional
file-related options in the future if necessary. Make
idf_build_generate_metadata consistent with the other function
interfaces by using OUTPUT_FILE.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
df9010f894 feat(cmakev2/project): add binary genration and flash targets to idf_project_default
Use idf_build_binary, idf_sign_binary, and idf_flash_binary to generate
and flash the default project application.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
b514ed5ae7 feat(cmakev2/build): add idf_check_binary_signed function
Given the binary target generated by the idf_build_binary or
idf_sign_binary function, add a new POST_BUILD dependency that displays
a message indicating the binary image must be manually signed before
flashing. This situation arises when CONFIG_SECURE_SIGNED_APPS is
enabled, but CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES is not set.  As a
result, the binary image is not signed during the build process and
requires manual signing.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
73ee5ee8e2 feat(cmakev2/build): add idf_check_binary_size function
Given the binary target created by the idf_build_binary or
idf_sign_binary function, add a new dependency that verifies whether the
binary image fits within the smallest application partition.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1dbdeb6bb1 feat(cmakev2/build): add idf_flash_binary function
Create a new flash target for a previously created binary target using
the idf_build_binary or idf_sign_binary function. Specify the new target
name with the TARGET option. The binary image path is stored in the
BINARY_PATH property of the binary target and is set when the binary
target is created using the idf_build_binary or idf_sign_binary
function. Use the NAME option as a prefix for the generated esptool
argument file, and the FLASH option can be used to include the binary
image flashing in the global flash target.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
db2770b281 feat(cmakev2/build): add idf_sign_binary function
Create a signed binary image from a previously generated binary using
the `idf_build_binary` function. This image can be signed with an
optional key from a KEYFILE or, by default, with the key specified in
the sdkconfig. A new custom command is added to generate the signed
binary, which is stored at the location specified by the OUTPUT_FILE
option and a new custom target is created for it, with the name provided
in the TARGET option. The BINARY_PATH property is added to this new
TARGET, containing the path to the signed binary image.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
646c16f4f2 feat(cmakev2/build): add idf_build_binary function
The `idf_build_binary` function generates a binary image for a specified
executable target, which may or may not have been created using the
`idf_build_executable` function. It adds a custom command to generate
the binary image file at the location specified by the `OUTPUT_FILE`
option and creates a new target for it, with the name specified by the
`TARGET` option. The path of the generated binary file is also stored in
the `BINARY_PATH` property of the newly created binary target.
Additionally, this binary path is stored in the `EXECUTABLE_BINARY`
property of the given executable. This information is used by the
`idf_build_generate_metadata` function, which takes the executable
target as an argument and includes the binary name in the
`project_description.json`.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
c7bde33b67 feat(cmakev2/project): initialize global flash targets
The global flash targets are created using
__create_project_flash_targets, but these are merely placeholders that
allow components to declare their dependencies on the global flash or
encrypted-flash target in their project_include.cmake. The actual logic
for flash targets is located in the project_include.cmake of the
esptool_py component. Therefore, the targets must be initialized
after this file has been included. To address this, a new function,
__init_project_flash_targets, has been added for this purpose.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
efae51696f feat(cmakev2/idf): enable ccache if requested
Enable ccache if CCACHE_ENABLE is set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
c60f7bec27 feat(cmakev2/utilities): add fail_at_build_time helper
Create a phony target that intentionally fails the build, displaying the
error messages specified in the message arguments. An empty CMake file is
created and included, which is then deleted when the target is executed.
This forces CMake to rerun, as the file is added to the CMake rerun
dependencies.

This has been carried over from cmakev1 as it is used by several
components.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
070590986a fix(mbedtls/cmake): handle lwip dependency in cmakev2
Currently, the lwip is linked to mbedtls if CONFIG_LWIP_ENABLE is set.
This approach works in cmakev1 because only the configuration for
BUILD_COMPONENTS is available during component evaluation. However, this
is not the case in cmakev2, where the configuration for all components
is available. This means that even if CONFIG_LWIP_ENABLE is set, it does
not guarantee that the lwip component is included in the build. For
cmakev2, modify the check to use a generator expression to ensure that
lwip is linked to mbedtls only if lwip is actually included in the
build.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
65ed7732fe feat(cmakev2): Added support for injecting dependencies for components 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
c7e9385427 feat(cmakev2): Added download of component-level managed components 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
37d1a3064f feat(cmakev2): Added idf_build_component shim to compat.cmake 2025-10-30 17:17:49 +08:00
Frantisek Hrbata
020cceab23 feat(cmakev2/project): add __init_project_flash_targets helper
Some components rely on the existence of flash targets to declare
dependencies. Add flash and encrypted-flash targets during project
initialization to ensure they are available before including
project_include.cmake files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e45b86ac9d fix(test_build_system): use idf_project_default in buildv2 test app
Since the idf_project_default is already available, let's use it in the
buildv2 testing application. Also change the test app name from
buildv2_test_app to build_test_app, as some tests require the ELF and
bin images to be created under this name.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a6c6193232 fix(cmakev2/compat): use alias target in idf_component_optional_requires
The optional dependency is currently added if the optional component
interface target exists, which is always the case unless a non-existent
component is requested. Instead, base the optional dependency on the
component interface target alias, as it is created only when the
component is included in the project.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
fdd8a924bc feat(cmakev2/project): allow to include all discovered components
If the IDF_INCLUDE_ALL_COMPONENTS variable is set, all discovered
components will be included. By default, components are included based
on their requirements. When IDF_INCLUDE_ALL_COMPONENTS is enabled, the
all_component_info dictionary in the project_description.json file will
be fully populated.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
b36e5adeff feat(cmakev2/build): add idf_build_generate_metadata function
The `idf_build_generate_metadata()` function is used to generate project
metadata, specifically the `project_description.json` file, for a given
executable target. The output file path can be specified as an argument
to the function, allowing metadata generation for multiple executables.
It identifies the library, created by the `idf_build_library` function,
that is linked to the executable based on the `LINK_LIBRARIES`
executable target property. The `LIBRARY_INTERFACES` build property
tracks all library interfaces created with the `idf_build_library`
function, so the targets in the `LINK_LIBRARIES` executable property are
checked against this list to find the library. The library contains
information about components linked to it in the
`LIBRARY_COMPONENTS_LINKED` library property. These components are
processed and added to the `build_component_info` dictionary in the
`project_description.json` along with other information.

Note that, compared to cmakev1, the `all_component_info` dictionary in
`project_description` does not include some information by default, such
as included directories. This information is available in cmakev1 due to
early component evaluation, which is not done in cmakev2. This will
likely require some adjustments on the hints side.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
767e73b811 feat(cmakev2/utilities): add __make_json_list helper
Helper function for converting a CMake list to a JSON list.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2e667ee990 feat(cmakev2/component): add __PREFIX component property in __init_component()
The cmakev1 sets __PREFIX as a component property. To maintain backward
compatibility, set it in cmakev2 as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
06449dc17d feat(cmakev2/utilities): add __get_executable_library_or_die helper
Search for the library interface target created with the
idf_build_library() function and linked to the executable, examine the
LINK_LIBRARIES for the executable and the LIBRARY_INTERFACES build
property, which stores all library interface targets created by the
idf_build_library() function.

This helper is intended for use by functions, such as the
idf_build_generate_metadata() function, which accepts the executable
target as an argument to find the library linked to it.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1af119a431 feat(cmakev2/project): add idf_project_default macro
The idf_project_default macro is intended to be used by default for
ESP-IDF projects. Currently, it handles the necessary project
initialization that must occur after CMake's project() is called. It
creates the default executable based on the project name and links a
library to it, based on the main component and its transitive
dependencies. This macro will be further extended to also generate
binary image, project metadata, and add other expected targets. It
primarily serves as a replacement for the project() macro used in
cmakev1.

Expected typical usage:
```
cmake_minimum_required(VERSION 3.22)
include($ENV{IDF_PATH}/tools/cmakev2/idf.cmake)
project(hello_world LANGUAGES C CXX ASM)
idf_project_default()
```

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2a093bcb0c feat(cmakev2/build): add idf_build_executable function
Create an empty source file for the add_executable target, along with a
library containing specified components, and then create an executable.
This approach allows for the easy creation of multiple executables by
specifying the component with the app_main function, as demonstrated in
the test.

```
idf_build_executable(fatfs_example COMPONENTS fatfs_example)
idf_build_executable(hello_world_example COMPONENTS hello_world_example)
```

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
213d128718 feat(cmakev2/build): remove INTERFACE option from idf_build_library
The option is unnecessary and complicates the interface. Additionally,
it does not adhere to the previously established naming convention. The
target name for the library interface is provided as a standard function
argument.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
22cf5a61ef fix(esp_usb_cdc_rom_console/cmake): avoid using uninitialized srcs variable
In cmakev2, the component CMakeLists.txt files are evaluated recursively
based on the component dependencies. This means that variables from
previously evaluated components are set and available in the scope of
the currently evaluated component. It is necessary to initialize every
variable that is used.

Fixes: 56e0c11bb6 ("feat(usb_cdc_console): moved usb-cdc ROM console to n..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6152758c99 feat(cmakev2/test): add fatfs_example and hello_world_example
Add two components: fatfs_example and hello_world_example. These are
simply copies of the main components from the existing examples.

Enhance the test_executable test to create targets for two
executables, which can be built after CMake configuration.

```
cmake --build build/ --target hello_world_example
cmake --build build/ --target fatfs_example
```

Additionally, move the test_component_priority to the end of the test
chain, as it modifies the esp_system component, which interferes with
the linkage of the executables.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
3804fcfb2c feat(cmakev2/ldgen): add ldgen integration
Integrate the ldgen into cmakev2. With this change, it becomes possible
to actually link the project executables.

In cmakev2, the handling of linker scripts is deferred to
idf_build_library, unlike in cmakev1, where linker scripts were added
and generated during the target_linker_script call. In cmakev2, the
target_linker_script only adds the linker scripts and templates, along
with the output filenames for the linker scripts generated from the
templates, to the component property. When idf_build_library is called
and all the requested components are included, it uses the
__get_target_dependencies function to obtain all transitively linked
targets to the library interface target. These targets are mapped to the
components, and the LIBRARY_COMPONENTS_LINKED library property is set.
It contains all components linked to the library interface target. The
components from LIBRARY_COMPONENTS_LINKED are used to collect linker
fragments and linker scripts utilized in the library. Additionally, all
targets transitively linked to the library are used to identify archive
files used in the library. This includes component archives and archives
added with the add_prebuilt_library function. The archives and
ldfragments related to the components linked to the library are used
when ldgen generates the linker scripts from templates.

The linker scripts, both static and generated by ldgen, are added to the
library interface link options and INTERFACE_LINK_DEPENDS property. For
generated linker scripts, a custom target is created and added as a
dependency for the library interface to ensure they are generated before
the link.

The difference compared to cmakev1 is that the generated linker scripts,
currently only sections.ld, are not global in the project but are
generated per library. This means there might be multiple versions of
sections.ld depending on the components included in the library. For
example, a component like esp_system may be linked to multiple library
interface targets, each with a different set of components. This results
in different sets of fragment files and library archives and different
versions of the sections.ld linker script. This should ensure proper
dependencies between targets. In other words, if a component changes its
linker fragment, only executables linked to libraries using this
component should be re-linked. As a consequence of this approach, the
generated linker scripts for different libraries need to have different
names or be stored in different directories to avoid overwriting the
linker script for one library with the linker script for another library
using the same component. This is handled with a suffix, which is based
on the library interface target name and appended to the generated
linker script. So, for example, there is no sections.ld, but instead
sections.ld_fatfs_lib or sections.ld_hello_world_lib. As a next step, we
can add a DEFAULT option to idf_build_library and avoid adding the
suffix for the default library.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e06624f552 feat(cmakev2/build): track components linked to library
There may be multiple libraries, each linking a different set of
components. Introduce a new library property, LIBRARY_COMPONENTS_LINKED,
to track the components linked with a specific library. This property
can be used, for example, by menuconfig to distinguish between included
and excluded components on a per-library or per-executable basis, or by
ldgen to identify linker scripts for the linked components.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
965650dc11 feat(cmakev2/feat): add __get_target_dependencies helper
Based on the INTERFACE_LINK_LIBRARIES and LINK_LIBRARIES properties,
recursively retrieve the list of dependencies for the specified target.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f000545630 feat(cmakev2/compat): initialize common components within idf_component_register
Currently, the common components are initialized in the idf_project_init
macro, which means they are included even for cmakev2 components.
However, cmakev2 components are expected to explicitly specify all their
dependencies instead of relying on common components being automatically
linked. Therefore, common components are only relevant within the
context of cmakev1 components. To address this, move the
__init_common_components function call to idf_component_register and
include common components only when they are truly needed for a cmakev1
component.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
edf62c3557 feat(cmakev2/test): add simple executable test
Add a simple test_executable that links to all discovered components.
This is intended to verify if the component sources can be compiled
using the command `cmake --build build/ --target test_executable`. The
ldgen is not yet integrated, so the test_executable is not actually
created or linked. However, this process can be used to check if the
components are compiled.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
ff79ab7733 fix(cmakev2/project): add ESP_PLATFORM to compile_definitions
Set the ESP_PLATFORM macro to indicate to component sources that they
are being compiled with ESP-IDF.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
663460379c fix(cmakev2/utilities): avoid overwriting compile_options in __get_compile_options
Currently, the generic compile_options are ignored because they are
unset after retrieving the build property. To fix this, avoid explicitly
setting compile_options, as this variable is initialized with the
idf_build_get_property(compile_options ...) call.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d9eb78c1fd feat(cmakev2/compat): link common components in idf_component_register
Automatically link commonly required components to the component target
created in the idf_component_register function. This is still necessary
even in cmakev2, as existing components depend on this behavior.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
bede750fcd feat(cmakev2/project): initialize and include commonly required components
Identify the commonly required components based on the target and
architecture, and store them in the __COMPONENT_REQUIRES_COMMON build
property. These components are automatically included, and their
interfaces are stored in the __COMMON_COMPONENT_INTERFACES build
property. The commonly required component interfaces are automatically
linked to each component.

Existing components for cmakev1 rely on the automatic linking of common
components. Therefore, at least initially, we need to implement the same
functionality in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
427c5ba8df fix(xtensa/cmake): do not include project_include.cmake if the architecture is not xtensa
In cmakev2, the project_include.cmake files for every component are
included. This means that even when working with RISC-V, the
project_include.cmake file for Xtensa is still included. Ensure that the
architecture is verified, and exit if it is not Xtensa.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
69a67e7e6e feat(cmakev2/idf): initialize IDF_TARGET_ARCH build property
Based on the configuration, set the IDF_TARGET build property. This is
also set by cmakev1 and can be used to easily determine the architecture
for the project.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
9040925c1c feat(cmakev2/component): add embedded files in idf_component_include
Add embedded source files to the component target sources. This is
intentionally managed in idf_component_include instead of
idf_component_register, allowing even cmakev2 components to set the
component's EMBED_FILES and EMBED_TXTFILES properties. Although it might
be more convenient to call the target_add_binary_data helper function
directly in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e84250998d feat(cmakev2/compat): add idf_component_register function
Add a backward-compatible idf_component_register function. This is
necessary to enable existing components to integrate with cmakev2. Note
that, by design, when the configuration is evaluated first, the KCONFIG
and KCONFIG_PROJBUILD options become obsolete, and an error is reported
if non-default configuration file names are specified.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
edf8f4b689 fix(esp_eth/cmake): avoid using BUILD_COMPONENTS build property for IDF_BUILD_V2
IDF_BUILD_V2 does not have BUILD_COMPONENTS build property. Therefore,
when IDF_BUILD_V2 is defined, use a generator expressions instead.
The inclusion of esp_eth_netif_glue.c, which relies on the presence of
the esp_netif component, should ideally be managed by a configuration
option. The same applies to the requirements for esp_eth. Currently,
only a basic adjustment has been made to enable the inclusion of esp_eth
in cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
3777b19bcc fix(esp_common/cmake): avoid using BUILD_COMPONENTS build property for IDF_BUILD_V2
IDF_BUILD_V2 does not have BUILD_COMPONENTS build property. Therefore,
when IDF_BUILD_V2 is defined, use idf_component_optional_requires and
generator expressions instead. I believe that the one-liner should also
work with IDF_BUILD_V1, but the change is kept separate to clearly show
the difference between IDF_BUILD_V1 and IDF_BUILD_V2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1b40b10dc1 fix(heap/cmake): avoid using BUILD_COMPONENTS build property for IDF_BUILD_V2
IDF_BUILD_V2 does not have BUILD_COMPONENTS build property. Therefore,
when IDF_BUILD_V2 is defined, use a generator expressions instead. I
believe that the one-liner should also work with IDF_BUILD_V1, but the
change is kept separate to clearly show the difference between
IDF_BUILD_V1 and IDF_BUILD_V2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
4c88b9c31b feat(cmakev2/component): create component alias only after it has been included
Add a component interface alias only after the actual target is created,
meaning the component is included. The alias has a well-defined name and
can be used in generator expressions like
`$<$<TARGET_EXISTS:idf::esp_netif>:>` without needing to retrieve the
COMPONENT_ALIAS property.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1129e8b8d4 feat(cmakev2/utilities): add add_prebuilt_library function
Imported from cmakev1 to enable the addition of prebuilt libraries into
the build.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6431c056f7 feat(cmakev2/utilities): add target_add_binary_data function
Add binary data into the build target by converting it into a generated
source file, which is then compiled into a binary object as part of the
build process.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
cb426066d7 feat(cmakev2/utilities): add add_deprecated_target_alias function
The add_deprecated_target_alias function is used by some existing
components, so it should be added to cmakev2 as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
c83102eb5e feat(cmakev2/utilities): add file_generate function
The file_generate function is used by some existing components, so it
should be added to cmakev2 as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d03257c9a9 feat(cmakev2/utilities): add fail_target function
The fail_target function is used by some existing components, so it
should be added to cmakev2 as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e52884fc68 feat(cmakev2/utilities): add add_prefix function
The add_prefix function is used by some existing components, so it
should be added to cmakev2 as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e909e51c59 feat(cmakev2/utilities): add spaces2list function
The spaces2list function is used by some existing components, so it
should be added to cmakev2 as well.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1fe41c4521 feat(cmakev2/compat): add idf_component_optional_requires function
Add the specified component as a dependency only if it is included in
the build. This functions the same way as in cmakev1, but it uses
generator expressions because cmake2 does not maintain the
BUILD_COMPONENTS build property, which would list all components
included in the build.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
07cffc73fa feat(cmakev2/compat): add target_linker_script stump
Currently, this is just a placeholder without implementation. The
implementation will be completed in a subsequent patch set that
integrates ldgen. For now, this is enough for ESP-IDF components can be
included by cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d77a3c84ad fix(cmakev2/component): add component name to __DEPENDENCY_CHAIN
The __DEPENDENCY_CHAIN was not properly created because the component
names were not added to it. Fix this by maintaining it correctly.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1b6375050b feat(cmakev2/component): evaluate all components
This removes the temporary restriction that only allowed components with
project_components as their source to be evaluated.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
c67dabd5c3 feat(cmakev2/compat): add __get_component_sources helper
This helper function collects component sources within the component's
directory. It will be used by the idf_component_register.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
49b7b2244e feat(cmakev2/utilities): add BASE_DIR option to __get_absolute_paths
Add an optional BASE_DIR option to specify a directory that will serve
as the base directory for evaluating input paths. This can be useful,
for example, when collecting component sources.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
fe94c95ad6 feat(cmake/toolchain): include utilities.cmake from correct build system version
The toolchain files are using the remove_duplicated_flags function from
utilities.cmake. However, we want to avoid mixing utilities from cmakev1
and cmakev2. Use `IDF_BUILD_VER_TAG` to include utilities from the
currently used build system version.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f0346ce56b feat(cmakev2/utilities): add remove_duplicated_flags function
This function is primarily used by the toolchain files.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6187d988bc feat(cmakev2/idf): add IDF_BUILD_VER_TAG identifier
Add the IDF_BUILD_VER_TAG variables to include the build system version
tag. These variables can be used in files, such as CMake toolchain
files, which are shared between cmakev1 and cmakev2. This allows for the
inclusion of files from the currently running build system version. For
example:
include($ENV{IDF_PATH}/tools/cmake${IDF_BUILD_VER_TAG}/utilities.cmake).

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
a1c36677d0 fix(cmakev2): Fix Kconfig interactive targets
This commit fixes the Kconfig interactive targets (such as menuconfig)
commands to have the correct Kconfig output files.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
bb2cc6113c ci(pre-commit): temporary disable check-kconfig-files
It is not possible to add a new sourced file through an environment
variable because kconfcheck has a fixed list of allowed environment
variable names. This issue is tracked under IDF-13847.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
0d7d6f6b3e feat(cmakev2/compat): add check_expected_tool_version helper
The compat.cmake file is intended to include functions necessary for
backward compatibility with cmakev1.

Add the check_expected_tool_version function, which is used by some
project_include.cmake files to verify if the tool's version matches the
installed tool. This functionality is used, for example, by esp_common.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
645c2d468f feat(cmakev2/test): add Kconfig files for testing components
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
5cc570960e feat(cmakev2/test): generate project_description.json
Some idf.py commands, such as menuconfig, use build_target and call
ensure_build_directory, which requires the project_description.json file
to be generated. To enable the use of idf.py commands with the testing
example, call __generate_project_info() to generate the
project_description.json file. This allows you to execute idf.py
menuconfig.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
e248b36676 feat(cmakev2/kconfig): use cmakev2 specific config_buildv2.env.in
The current config.env.in template cannot be easily extended and shared
between cmakev1 and cmakev2. Although the root Kconfig is shared and
sources COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE and
COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE, these environment
variables cannot be set to empty strings. This issue arises unless we
also adjust cmakev1 and esp-docs, which use prepare_kconfig_files.py, to
properly set COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE and
COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE.

If an environment variable is set to an empty string and sourced in
Kconfig, kconfgen will expand the variable with expandvars(), resulting
in an empty value. This expanded variable is then appended to the root
Kconfig or the currently processed Kconfig directory path, depending on
whether osource or orsource is used, and passed to iglob. The iglog will
return the directory as a result, and when Kconfig attempts to open the
file, it will encounter an error because it is a directory.

To resolve this issue and enable sharing of the root Kconfig file, a new
config_buildv2.env.in template has been added, which includes
environment variables for the excluded components.

For cmakev1, kconfgen will encounter the osource command for
COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE. Since this variable is not
defined in config.env.in, expandvars() will return the environment
variable name instead of expanding it, and iglob will not match
anything. Because osource is used for excluded components, the
non-existent file for osource will be skipped.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
8567273b37 feat(cmakev2/kconfig): pass environment variables with excluded components to menuconfig
Pass the environmental variables COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE
and COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE to menuconfig.
This will display the configuration for excluded components under new
menus in menuconfig. Additionally, set the IDF_BUILD_V2 environment
variable to make these new menus visible. The IDF_BUILD_V2 variable is
also passed to all kconfgen commands.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a6af14bc89 fix(tools): ruff formatting in prepare_kconfig_files.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
38e0242636 feat(tools): generate kconfig.in files for components not included in the build
To generate a complete configuration for all discovered components, we
need to ensure that even kconfig files for the excluded components are
seen by Kconfig. Modify the prepare_kconfig_files.py script to generate
files that list the Kconfig files for excluded components. These files
are sourced in the root Kconfig using the
COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE and
COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE environment variables.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2c518b2ca3 feat(Kconfig): source configuration for components not included in the build
Introduce new configuration menus for components that are not part of
the build. These menus will only be visible if the IDF_BUILD_V2
environment variable is defined and it will be set only in cmakev2. This
enables sharing of the root Kconfig file between cmakev1 and cmakev2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
4d329250ac feat(cmakev2/idf): include ExternalProject module
For backward compatibility, since externalproject_add is used by
project_include.cmake in the bootloader component. The ExternalProject
should probably be included there instead.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
01279ea4c3 feat(cmakev2/project): include project_include.cmake files
During the initialization of a component in the __init_component
function, store the full path of the project_include.cmake file in the
component's __PROJECT_INCLUDE property, if it exists. Include the
project_include.cmake files for all discovered components at the global
scope within the idf_project_init macro.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2967ff3e2e feat(cmakev2/idf): initialize build system version variables
Set the global variables IDF_BUILD_V2 and IDF_BUILD_VER, along with the
build properties and environmental variables. These are intended to be
used by components to determine which build system version they are
evaluated under and to make adjustments based on this information.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
70f5366408 feat(cmakev2/project): move all project-related items into project.cmake
The current approach involves transparently calling __init_build within
idf_build_library and performing all post-project() initialization
there. The issue with this method is that project_include.cmake files
also need to be included during post-project() initialization, but they
should be included in the global scope. This cannot be achieved within
the __init_build function unless it is converted into a macro. Although
using a macro is a potential solution, it risks causing global scope
pollution. Another complication is the location where project() can be
invoked; it must be explicitly[1] stated in the project's
CMakeLists.txt.  This requirement conflicts with our intention to wrap
it within the idf_project_default helper. Given these challenges, it
makes sense to introduce an explicit idf_project_init macro, where all
post-project() initialization occurs, including the inclusion of
project_include.cmake files. While we can still encapsulate this within
idf_project_default, for the plumbing commands (idf_build_library,
idf_build_executable, ...), it will need to be explicitly called after
the project() invocation.

Usage for default project:

cmake_minimum_required(VERSION 3.22)
include($ENV{IDF_PATH}/tools/cmakev2/idf.cmake)
project()
idf_project_default()

Usage for plumbing commands:

cmake_minimum_required(VERSION 3.22)
include($ENV{IDF_PATH}/tools/cmakev2/idf.cmake)
project()
idf_project_init()
idf_build_library()
...

[1] https://cmake.org/cmake/help/latest/command/project.html#usage

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
21430acb4f ci(cmakev2): enable buildv2 CI testing
A new pytest_buildv2_system job has been added to execute selected tests
from the existing test_build_system test suite. Currently, only the
test_non_default_target.py is enabled. The ultimate goal is to run most
of the build system tests with buildv2. This should help ensure
compatibility between IDF build system v1 and v2.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f2a7c311fd feat(test_build_system): add buildv2_skip marker
This marker enables the skipping of tests that, for any reason, cannot
be executed with the IDF build system version 2. It accepts an optional
string argument that explains why the test cannot be run with version 2.
If no explanation is provided, a default message is used. This marker is
used in the `pytest_collection_modifyitems` hook to skip tests marked
with it when the `--buildv2` pytest command line option is used.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
05ec102b9f fix(test_build_system): fix ruff formatting for conftest.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
1da7f3714f feat(test_build_system): add --buildv2 pytest option and buildv2 test app
The IDF build system v2 should be backward compatible with IDF build
system v1 in most situations. Therefore, it makes sense to reuse the
existing v1 tests and run them for v2 as well. This approach will help
ensure that v2 maintains backward compatibility. Introduce a new
--buildv2 option, which switches the existing tests to use the newly
added buildv2_test_app for v2. The goal is to enable the existing v1
tests incrementally in CI as the v2 implementation progresses.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
82e295ac6f fix(cmakev2/idf): fix IDF_TARGET initialization
Currently, the target consistency check with sdkconfig is performed even
if sdkconfig is not present, by comparing the selected target with the
target defined in sdkconfig.defaults. This results in an inconsistency
report when a different target is set in the IDF_TARGET environment
or cmake variable compared to sdkconfig.defaults. The behavior in
cmakev1 is to prioritize IDF_TARGET and ignore values in
sdkconfig.defaults. Perform the consistency check only if the
sdkconfig file exists.

Additionally, skip this consistency check if a set-target action is
taking place, as the old target in sdkconfig is being replaced with a
new value anyway.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d5befe0742 fix(test_build_system): fix ruff formatting for test_non_default_target.py
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
5bdcfc4a5b fix(test_build_system): pop SDKCONFIG_DEFAULTS from the environment
The test for guessing the target from the SDKCONFIG_DEFAULTS environment
variable is not cleaning up after itself, leaving the SDKCONFIG_DEFAULTS
environment variable set. The subsequent test performs target guessing
from SDKCONFIG_DEFAULTS passed to cmake with the -D option. The
SDKCONFIG_DEFAULTS environment variable should take precedence over the
SDKCONFIG_DEFAULTS cmake variable. This is correctly handled in cmakev2
, but in cmakev1, the SDKCONFIG_DEFAULTS cmake variable is used even if
the SDKCONFIG_DEFAULTS environment variable is set. This appears to be a
bug or at least an inconsistency in cmakev1.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f1e467eeee feat(cmakev2/build): add __generate_project_info stub
Currently, this generates a very basic project_description.json file,
allowing idf.py commands that call ensure_build_directory, such as
reconfigure, to be used with cmakev2. The ensure_build_directory
function sets a global context, which is presently used only for hints,
and the project_description.json file is loaded as part of this context.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
3dfc8cdc49 feat(cmakev2/test): add simple test for component include
Add two project components, component1 and component2, and verify that
their real targets are created when they are included.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
77e10e0df0 feat(cmakev2/build): use idf_component_include into idf_build_library
Call idf_component_include for all components requested in the library
and link them into it.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
bcfd5f680f feat(cmakev2/component): add idf_component_include function
Add a core function of the build system, responsible for including the
specified component identified by name, into the build
process.

Currently, the non-project components written in cmakev1 are ignored and
not evaluated with the add_subdirectory command because there are no
shims for the cmakev1 API yet. However, this allows for the evaluation
of project components written using the cmakev2 approach, which is
closer to the native CMake usage.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
51de444e4f feat(cmakev2/idf): enable the generation of compile_commands.json
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
fcdc05b4c8 feat(cmakev2/utilities): add __get_compile_options helper
Gather the compilation options from COMPILE_OPTIONS, C_COMPILE_OPTIONS,
CXX_COMPILE_OPTIONS, and ASM_COMPILE_OPTIONS build properties into a
single list using generator expressions. This list can then be used with
the target_compile_options call.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f6f7edede2 feat(cmakev2/build): set LINKER_TYPE build property in __init_build_configuration
Set the LINKER_TYPE build property. Different linkers may have varying
options, so it's important to identify the linker type to configure the
options correctly. Currently, LINKER_TYPE is used to set the appropriate
linker options for linking the entire archive, which differs between the
GNU and Apple linkers when building on the host.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
0f536b45d8 feat(cmakev2/test): add simple test for PROJECT_NAME and PROJECT_VER
Simple test for PROJECT_NAME and PROJECT_VER build properties to ensure
they are set according to the values provided in the project() call.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
11dba11e36 fix(cmakev2/utilities): respect CMake's regular variables in __get_default_value
Currently, only the value stored in CMake's cache is considered when
setting the default value. Allow regular variables as well, which may be
set in the project's CMakeLists.txt file.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
72d4fecfa9 feat(cmakev2/build): set PROJECT_VER build property
Initialize the PROJECT_VER build property based on the following
precedence.

1. The PROJECT_VER environment or CMake variable.
2. The version.txt file located in the top-level project directory.
3. The VERSION argument, if provided, in the project() macro.
4. The output of git describe if the project is within a Git repository.
5. Defaults to 1 if none of the above conditions are met.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
754ef56594 feat(cmakev2/build): set PROJECT_NAME build property
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a4b0ad0cf3 feat(cmakev2/build): add build configuration
Add the __init_build_configuration() function to set all C, CXX, ASM,
and linker options, along with compilation defines, in a single
location. In cmakev1, these settings are scattered across multiple
places and it seems logical to group them together.

This function is called from the __init_build(), which is invoked after
project(). This sequence is necessary because some options depend on the
CMake information about the compiler, which is only available once the
toolchain has been initialized in project().

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d58d08aacc feat(cmakev2/build): add __init_build() stub
Most of the global settings are configured in idf.cmake, but certain
elements can only be initialized after the project() function is called
and the toolchain is set up. For example, this includes the compilation
options, which may depend on identified compiler or the project name and
version set in the project() call. The __init_build function is called
at the beginning of the idf_build_library() function, meaning it should
be executed after the project() call. It ensures that initialization
occurs only once by setting the __BUILD_INITIALIZED build property.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
01663e7c12 ci(cmakev2): fix cmakev2 exclusion location in exclude_check_tools_files.txt
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
abbf75acec feat(cmakev2/idf): add git submodules initialization
Initialize submodules that are not yet initialized, and issue a warning
for submodules that do not match the recorded hash in the git tree.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
5c6f37f057 feat(cmakev2/utilities): add __split helper to split the string into a list
When working with command output, it is sometimes necessary to handle it
line by line. Add a `__split` helper function that can split an input
string based on a specified separator, which defaults to a newline, and
store the results in a list. This function also offers modifiers to
strip whitespace and remove empty entries.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
572f07a340 feat(cmakev2/idf): add __init_idf_version to set IDF_VER
Initialize the IDF_VER build property using the version.txt file, or use
git-describe. If neither is available, fall back to the value of the
IDF_VERSION environment variable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
ba16364ab5 feat(cmakev2/idf): add __git_init to identify the git executable
The Git tool will be used in various parts of the build system, such as
retrieving the IDF version using git-describe or checking submodules.
Similar to the Python interpreter, add an initialization function to
identify the Git executable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
f1b143a23b fix(cmakev2/kconfig): add missing parentheses after the else condition
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
6249c46617 feat(cmakev2/kconfig): Added support for excluded Kconfigs in menuconfig
This commit adds support for processing Kconfig files from excluded
components.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
0458b98bfa feat(cmakev2/kconfig): Added basic test for Kconfig generation 2025-10-30 17:17:49 +08:00
Sudeep Mohanty
22914237b0 feat(cmakev2/kconfig): Added support for Kconfig target creation
The following functions are added to tools/cmakev2/kconfig.cmake:
- __create_kconfig_targets(): Calls other target creation functions.
- __create_menuconfig_target(): Creates menuconfig target.
- __create_confserver_target(): Creates confserver target.
- __create_save_defconfig_target(): Creates save-defconf target.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
72e2fa0005 feat(cmakev2/kconfig): Added support for Kconfig output generation
The following functions are added to tools/cmakev2/kconfig.cmake:
- __generate_kconfig_outputs(): Generates Kconfig output files.
- __create_base_kconfgen_command(): Creates command for running
  kconfgen.
- __run_kconfgen(): Invokes kconfgen tool.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
b774ca25bc feat(cmakev2/kconfig): Added support for Kconfig environment preparation
The following functions are added to tools/cmakev2/kconfig.cmake:
- __setup_kconfig_environment(): Creates Kconfig environment for Kconfig
  output generation.
- __get_init_config_version(): Fetch ESP-IDF version and set the
  environment variable.
- __create_config_env_file(): Create the config.env file for kconfgen.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
135fed5a49 feat(cmakev2/kconfig): Added support for Kconfig files collection
The following functions are added to tools/cmakev2/kconfig.cmake:
- __collect_kconfig_files_from_components(): Collect Kconfig files from
  components.
- __collect_kconfig_files_from_bootloader_components(): Collect Kconfig
  files from bootloader components.
- __collect_kconfig_files_from_directory(): Collect Kconfig files from
  a directory.
2025-10-30 17:17:49 +08:00
Sudeep Mohanty
085633de35 feat(cmakev2/kconfig): Added __init_kconfig() and initial Kconfig properties
This commit adds the tools/cmakev2/kconfig.cmake file for Kconfig
processing. The file provides the following functions:

- __init_kconfig(): Placeholder to initialize Kconfig build properties,
  collect kconfig files and generate the initial sdkconfig.
- __generate_sdkconfig(): Placeholder to generate sdkconfig output files.
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
3b28a2ac33 feat(cmakev2/utilities): add __dump_all_properties helper
Dump all properties for build, components, and libraries.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a71a2e1c4e fix(cmakev2/component): correct function descriptions and typos
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d669f1841b feat(cmakev2/build): add idf_build_library stub
Add idf_build_library function and enable setting and getting its
properties. This lays the groundwork for future initialization that
needs to occur after the project() call, such as determining compilation
options and others.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
bc645db318 fix(cmakev2/test): correct indentation in testing CMakeLists.txt
Fixes: 3488300671da ("feat(cmakev2/test): add simple test for toolchain set..")
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
b72b14a159 feat(cmakev2/utilities): add __set_property and __get_property helpers
The `idf_build_(set|get)_property` and
`idf_component_(set|get)_property` functions share a lot of similar
code. Move these common parts into new `__(set|get)_property` helper
functions. With the upcoming `idf_build_library` API function, we might
need to add properties for the interface target created for the library,
which would otherwise lead to yet another code duplication for setting
and getting library interface properties.

Update the current implementations of `idf_build_(set|get)_property` and
`idf_component_(set|get)_property` to utilize these new helper
functions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
27e726b176 feat(cmakev2/test): add simple test for toolchain settings
Also format the current testing CMakeLists.txt properly.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
d37f7eaeb6 feat(cmakev2/idf): initialize toolchain
Determine the IDF_TOOLCHAIN from the following sources in this order:
environmental variable and CMake cache variable.  Ensure there are no
inconsistencies between the values set in these different locations.

Set the IDF_TOOLCHAIN and IDF_TOOLCHAIN_FILE build properties. Also,
configure the IDF_TOOLCHAIN CMake cache variable and set the
CMAKE_TOOLCHAIN_FILE global variable.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
ec600a8132 feat(cmakev2/idf): initialize IDF_TARGET build property
Determine the IDF_TARGET from the following sources in this order:
environmental variable, CMake cache variable, and sdkconfig files.
Ensure there are no inconsistencies between the values set in these
different locations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
6e27038dc3 feat(cmakev2/utilities): add __get_sdkconfig_option helper
Search for the configuration option value in the specified sdkconfig
file.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
62db5692cd feat(cmakev2/idf): initialize SDKCONFIG and SDKCONFIG_DEFAULTS build properties
Based on the environmental variables, CMake cache variables, or default
values, set the DKCONFIG and SDKCONFIG_DEFAULTS build properties.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
ed34c24de6 feat(cmakev2/idf): add Python interpreter detection
Determine the Python interpreter and verify package dependencies if the
CMake cache variable PYTHON_DEPS_CHECKED is not set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
00671f2f1e feat(cmakev2/idf): add IDF_VERSION variables
The version.cmake file should be the sole file used from the cmakev1
build system. There's no need to maintain the IDF_VERSION information in
two separate locations.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
95f4d88dac feat(cmakev2/utilities): add __get_default_value helper
Helper for obtaining the default value of a variable. It returns the
value of the specified variable based on the following order of
precedence, with the highest precedence first:

1. Environmental variable
2. CMake cache variable
3. Provided default value

This can be used to retrieve the value of variables that might also be
set in the environment or cache, such as PYTHON or SDKCONFIG.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
4b02439599 fix(cmakev2/utilities): make the PATHS option optional in __get_absolute_paths
With the default signature of `cmake_parse_arguments`, without using
`PARSE_ARGV`, it's not possible to determine if options were not
specified or set as an empty string (or empty list)[1]. If an empty
string is passed to the `PATHS` option, the variable parsed by
`cmake_parse_arguments` is not defined. This issue can be addressed by
using `PARSE_ARGV`, but this approach only works for functions and
requires CMake version 3.31 or newer. Additionally, when `PARSE_ARGV` is
used for multiple value option, the values are not concatenated into a
single list, which is inconvenient, as the lists are instead escaped. If
the `PATHS` option is not defined, set it to an empty string.  This
allows passing an empty string, as well as a mix of lists and
individual strings, through PATHS.

The behaviour can be seen with a simple example:

$ cmake -P test.cmake

```test.cmake
cmake_minimum_required(VERSION 3.22)

function(test)
    set(options)
    set(one_value)
    set(multi_value PATHS)

    cmake_parse_arguments(ARG "${options}" "${one_value}" "${multi_value}" ${ARGN})
    #cmake_parse_arguments(PARSE_ARGV 0 ARG "${options}" "${one_value}" "${multi_value}")

    message("PATHS: ${ARG_PATHS}")
endfunction()

test(PATHS "one;two;three" "four" "five;six" "seven")
```

```
PATHS: one;two;three;four;five;six;seven
vs
PATHS: one\;two\;three;four;five\;six;seven
```

Also update the current usage of __get_absolute_paths, as the check for
empty PATHS is no longer necessary.

[1] https://cmake.org/cmake/help/latest/policy/CMP0174.html#policy:CMP0174

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
2cbeb7a1a2 test(cmakev2): add testing project CMakeLists.txt
This is a basic CMake project that currently includes tests for
displaying build and component properties, as well as testing component
priority. These tests should be removed once proper CI testing is
in place.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
050ed5c76a ci(cmakev2): temporarily exclude cmakev2 from CI testing
There are currently no CI tests for CMakeV2, so add it to the
exclude_check_tools_files.txt file. Once CI testing is implemented, this
change should be reverted.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Frantisek Hrbata
a9d55936ef feat(cmakev2): add basic component initialization
Discover component directories and initialize components within them.
This process does not include managed components, which should be added
separately at a later stage. To facilitate this, some minimal
functionalities are introduced, such as build properties, component
properties, and other helper functions.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-30 17:17:49 +08:00
Island
583cca8f8d Merge branch 'feat/support_blecrt_361' into 'master'
fix(ble/bluedroid): Fixed GATT response timeout setting

Closes BLERP-2041 and BLERP-2042

See merge request espressif/esp-idf!40187
2025-10-30 17:11:19 +08:00
laokaiyao
ff1c14b1a3 refactor(parlio_rx): refactor to support unaligned user payload buffer
Closes https://github.com/espressif/esp-idf/issues/17581
2025-10-30 16:12:34 +08:00
Chen Ji Chang
a177fe6483 Merge branch 'feat/rgb_lcd_memory' into 'master'
feat(rgb_lcd): allow users to manage the lifecycle of the frame buffer

Closes IDF-13917

See merge request espressif/esp-idf!41457
2025-10-30 16:07:15 +08:00
laokaiyao
75eacee3ec refactor(parlio_rx): use gdma_link for better gdma link management 2025-10-30 16:06:12 +08:00
laokaiyao
49284c3f8d feat(gdma_link): support to select final node link type 2025-10-30 16:06:12 +08:00
morris
717312f472 fix(gdma): fixed the race conditon in of gdma resource allocation 2025-10-30 16:05:44 +08:00
wuzhenghui
487f9204dd change(esp_hw_support): esp32p4 rev3.0 dummy read workaround refactor 2025-10-30 14:50:33 +08:00
wuzhenghui
e9da2e3606 fix(esp_hw_support): add p4 rev3.0 MSPI workaround for deepsleep 2025-10-30 14:50:27 +08:00
Shen Meng Jing
b3eaeaea7a Merge branch 'docs/update_cn_translation' into 'master'
docs: Update CN translation for several docs

Closes DOC-12708 and DOC-12686

See merge request espressif/esp-idf!42918
2025-10-30 14:42:01 +08:00
Island
ed0a86ad53 Merge branch 'fix/ble_mesh_adv_rpt_fix' into 'master'
fix(ble_mesh): check data length before assigning adv data pointer

Closes BLERP-2343

See merge request espressif/esp-idf!42976
2025-10-30 14:23:46 +08:00
Island
c705b71ffe Merge branch 'change/ble_update_lib_20251030' into 'master'
change(ble): [AUTO_MR] 20251030 - Update ESP BLE Controller Lib

Closes BLERP-2344

See merge request espressif/esp-idf!42979
2025-10-30 14:23:40 +08:00
Rahul Tank
2738c5ac76 fix(nimble): Address compilation issues in nimble examples 2025-10-30 10:54:36 +05:30
nilesh.kale
e1f7a5e1fc feat: added test_cases for ECC P-384 curve operations 2025-10-30 10:42:40 +05:30
nilesh.kale
b132ab96d3 feat(hal): add support for ESP32-P4 ECO5 ECC peripheral
This commit also enabled constant time mode for ECC.
2025-10-30 10:42:40 +05:30
radek.tandler
fffef09b50 fix(spi-flash): Fixed missing flash write check of non 4-byte aligned data 2025-10-30 12:20:32 +08:00
Shen Mengjing
3e501f5bff docs: Sync EN and CN docs without 'needs translation' label 2025-10-30 12:07:54 +08:00
Chen Ji Chang
0630fe8870 Merge branch 'fix/fix_esp32_rmt_pm_lock_type' into 'master'
fix(rmt): fix pm lock type to increase stability

Closes IDFCI-3746 and IDFCI-3343

See merge request espressif/esp-idf!42970
2025-10-30 11:53:29 +08:00
Zhou Xiao
777f21783b fix(ble): fixed hci event log when link layer logging is disabled 2025-10-30 11:44:37 +08:00
radek.tandler
c16f82b367 fix(spi-flash): Fixed wrong offset calculation in s_verify_write log message 2025-10-30 11:38:40 +08:00
Chen Jichang
73bc04afec feat(esp32h4): switch default h4 build to mp version 2025-10-30 11:23:51 +08:00
Island
338c4c471f Merge branch 'docs/ble_add_low_power_intro' into 'master'
Added BLE Low Power Mode Introduction

See merge request espressif/esp-idf!40106
2025-10-30 11:06:23 +08:00
yinqingzhao
4656a3cc7c fix(wifi): fix some wifi bugs related to bandwidth, twt and regdomain 2025-10-30 10:46:58 +08:00
zhaoweiliang
16a893e934 change(ble): [AUTO_MR] Update lib_esp32c6 to 5b8adfa8 2025-10-30 10:45:18 +08:00
zhaoweiliang
baf8a20a5e change(ble): [AUTO_MR] Update lib_esp32c5 to 5b8adfa8 2025-10-30 10:45:18 +08:00
zhaoweiliang
4e07ce892d change(ble): [AUTO_MR] Update lib_esp32h2 to 5b8adfa8 2025-10-30 10:45:18 +08:00
Jiang Jiang Jian
23455e9fd0 Merge branch 'feat/libphy_c3_s3_c2_rxdc_20250804' into 'master'
feat(phy): update esp32c3 esp32s3 esp32c2 esp32s2 libphy for PHY cali param opt

Closes ESPCS-1019

See merge request espressif/esp-idf!41045
2025-10-29 20:06:46 +08:00
luoxu
6202aa89a6 fix(ble_mesh): check data length before assigning adv data pointer 2025-10-29 20:00:06 +08:00
He Binglin
2e0f0dc66a Merge branch 'test/esp_idf_hp_uart_wakeup' into 'master'
fix(esp_driver_uart): resolve the issue of other chips receiving break data

Closes IDFCI-4616 and IDFCI-4810

See merge request espressif/esp-idf!42952
2025-10-29 19:45:26 +08:00
wanckl
a31e2b4018 refactor(driver_twai): using hal/config in hal layer 2025-10-29 17:46:15 +08:00
wanckl
59d2692bc5 refactor(driver_twai): remove errata config selection 5 2025-10-29 17:46:15 +08:00
wanckl
3bebf1041d refactor(driver_twai): remove errata config selection 4 2025-10-29 17:46:15 +08:00
wanckl
cd483606c9 refactor(driver_twai): remove errata config selection 3 2025-10-29 17:46:15 +08:00
wanckl
66f56f9ed1 refactor(driver_twai): remove errata config selection 2 2025-10-29 17:46:15 +08:00
wanckl
e894d65548 refactor(driver_twai): remove errata config selection 1 2025-10-29 17:45:43 +08:00
Chen Jichang
74b18dac5c feat(rgb_lcd): allow users to manage the lifecycle of the frame buffer 2025-10-29 17:39:18 +08:00
morris
f58a86a82a Merge branch 'feat/deprecate_legacy_twai' into 'master'
feat(driver_twai): add legacy driver deprecated warning

Closes IDF-14261

See merge request espressif/esp-idf!42622
2025-10-29 17:05:26 +08:00
luoxu
29a722296f fix(ble_mesh): fixed incorrect rpl behavior in transport enh 2025-10-29 17:03:51 +08:00
David Čermák
9748cae749 Merge branch 'fix/lwip_sys_mem_frag' into 'master'
[lwip]: Allocate signals/mboxes once to reduce heap frag

Closes IDF-11823

See merge request espressif/esp-idf!42116
2025-10-29 16:10:57 +08:00
David Čermák
113a68fb14 Merge branch 'feat/esp_netif_custom_ip_events' into 'master'
[esp_netif]: Add support for custom got-ip/lost-ip events

Closes IDF-3212

See merge request espressif/esp-idf!42148
2025-10-29 16:09:56 +08:00
Chen Jichang
f9cf0394e5 fix(rmt): fix pm lock type to increase stability 2025-10-29 15:40:31 +08:00
Kevin (Lao Kaiyao)
0d1a38e520 Merge branch 'ci/fixed_parlio_rx_test_case_incorrect_condition' into 'master'
ci(parlio): fixed incorrect condition in rx test case

See merge request espressif/esp-idf!42965
2025-10-29 15:26:41 +08:00
Meet Patel
b340a1ff15 Merge branch 'bugfix/rtc_wdt_test_app' into 'master'
fix(test_rtc_wdt): Fixed CI test failures for RTC WDT by increasing margin

Closes IDFCI-4816, IDFCI-4835, IDFCI-5863, IDFCI-4799, and IDFCI-4817

See merge request espressif/esp-idf!42959
2025-10-29 12:18:22 +05:30
Armando (Dou Yiwen)
12aebb36d0 Merge branch 'feat/c5_flash_psram_timing_tuning_120m' into 'master'
mspi: supported psram & flash 120MHz timing tuning

See merge request espressif/esp-idf!42508
2025-10-29 06:12:32 +00:00
Mahavir Jain
b463f8f1d3 Merge branch 'bugfix/psram_mmap_for_all_targets' into 'master'
fix(esp_psram): make SPIRAM_USE_MEMMAP available for all targets

Closes IDFGH-16669

See merge request espressif/esp-idf!42878
2025-10-29 10:52:51 +05:30
Zhang Shuxian
30832dcbc8 docs: Update CN translation 2025-10-29 11:47:40 +08:00
Marek Fiala
9155e04f06 docs(idf-py.rst): Added cmake preset paragraph 2025-10-29 11:47:40 +08:00
Marek Fiala
1e351a8b67 test(tools): Moved preset parsing into core_ext.py and added tests 2025-10-29 11:47:40 +08:00
Ivan Grokhotkov
78ae7ab085 feat(build): add idf.py support for CMake configuration presets
This commit adds a new idf.py --preset NAME argument, which allows
selecting the CMake configuration preset with a given name.
For idf.py, selecting the preset does two things:
- sets the build directory, which is specified in the preset itself
  using "binaryDir" field
- passes --preset argument to CMake configuration phase

The multi_config example is updated to illustrate how this feature is
expected to be used.
2025-10-29 11:47:40 +08:00
Marek Fiala
86ec7c7d6b Merge branch 'revert/env_locale' into 'master'
Revert "fix: Updated locale handling to prevent issues with build tools"

See merge request espressif/esp-idf!42953
2025-10-29 11:39:58 +08:00
C.S.M
fe29544346 Merge branch 'test/usj_test' into 'master'
test(usj): Fix usj test failure for fsync function

See merge request espressif/esp-idf!42956
2025-10-29 10:41:38 +08:00
Marius Vikhammer
74d5a120c3 Merge branch 'ci/limit_test_app_builds' into 'master'
test(test_apps): set minimal build for misc test-apps

Closes IDF-14198, IDF-14208, IDF-14194, and IDF-14199

See merge request espressif/esp-idf!42921
2025-10-29 03:56:43 +08:00
hebinglin
4e388abd0a fix(esp_driver_uart): resolve the issue of other chips receiving break data 2025-10-28 19:53:46 +08:00
laokaiyao
d229fbcf0f ci(parlio): fixed incorrect condition in rx test case 2025-10-28 18:01:46 +08:00
zhanghaipeng
2dcbd64616 fix(ble/bluedroid): Fixed missing BLE connect and disconnect events 2025-10-28 16:56:07 +08:00
muhaidong
f2af9fa65a feat(phy): update esp32c3 esp32s3 esp32c2 esp32s2 libphy for RXDC 2025-10-28 15:40:04 +08:00
Wei Yu Han
8c90e65db6 docs(ble): Optimized the BLE low power guide 2025-10-28 13:00:39 +08:00
Wei Yuhan
13b04ab89e docs(ble): Replaced the current table with the link to the Power Save README 2025-10-28 13:00:39 +08:00
Wei Yuhan
c55a1180eb docs(ble): Fixed the common operation path for all chips 2025-10-28 13:00:39 +08:00
Wei Yuhan
acc8a99aae docs(ble): Replaced BLE with Bluetooth LE 2025-10-28 13:00:39 +08:00
Wei Yuhan
19fc7319c6 docs(ble): Revisied BLE Low Power Giude 2025-10-28 13:00:39 +08:00
weiyuhan
1e84dea7d0 Added BLE Low Power Mode Introduction 2025-10-28 13:00:39 +08:00
Meet Patel
4b7a049ad7 fix(test_rtc_wdt): Fixed CI test failures for RTC WDT by increasing margin
The CI tests for RTC WDT test app were failing because we allowed only
20% margin between configured vs actual timeout of wdt. However, the
RC oscillator accuracy on some boards is very poor and it results in
almost 25% difference between configured and actual timeout. Hence,
increased the failure margin from 20% to 30%. Also some boards like
ESP32P4 have known problem and gives timeout after twice the configured
time. Hence, increased the wdt interrupt wait time to three times the
configured value, so we don't miss the interrupts for such boards.
2025-10-28 09:54:54 +05:30
C.S.M
9c7ef954b1 test(usj): Fix usj test 2025-10-28 11:51:37 +08:00
wuzhenghui
596e32312e fix(esp_hw_support): fix mie lost after pd_cpu sleep request reject 2025-10-28 11:51:17 +08:00
wuzhenghui
fcb76189aa change(esp_hw_support): set HP/LP mem in retention mode in sleep 2025-10-28 11:51:13 +08:00
He Binglin
87d18b0d3d Merge branch 'feat/esp_idf_esp32h4h21_gpioworkaround' into 'master'
feat(esp_hw_support): add gpio reset workaround in chips except ESP32 and ESP32S2

Closes PM-602

See merge request espressif/esp-idf!42512
2025-10-28 11:39:47 +08:00
C.S.M
6659af07c8 Merge branch 'fix/soft_resume' into 'master'
fix(spi_flash): Fix software resume wrong config name in flash init

See merge request espressif/esp-idf!42697
2025-10-28 11:17:22 +08:00
Marek Fiala
3c9ad9c091 Revert "fix: Updated locale handling to prevent issues with build tools"
This reverts commit 7e09b471ab.
2025-10-28 04:02:21 +01:00
wanckl
029ac60144 feat(driver_twai): add legacy driver deprecated warning 2025-10-28 10:54:48 +08:00
Marius Vikhammer
27059a16f8 test(test_apps): set minimal build for misc test-apps 2025-10-28 10:17:41 +08:00
armando
755ee49b72 feat(mspi): supported psram & flash 120MHz timing tuning 2025-10-28 09:52:36 +08:00
Michael (XIAO Xufeng)
06dfc5eda2 Merge branch 'doc/compatibility_add_p4_1.3' into 'master'
compatibility: update chip revision compatibility docs

See merge request espressif/esp-idf!42722
2025-10-28 00:40:23 +08:00
morris
6fd24b6f5b Merge branch 'bugfix/fix_gptimer_premature_match_partial_data' into 'master'
fix(gptimer): update regex patterns in example test to include non-digit characters

Closes IDFCI-4481

See merge request espressif/esp-idf!42911
2025-10-27 23:53:17 +08:00
Rahul Tank
4beeff6694 Merge branch 'feat/read_all_local_remote_sup_feat' into 'master'
feat(nimble): Add support for read all local / remote supported features / adv monitor HCI cmd

See merge request espressif/esp-idf!42183
2025-10-27 21:21:47 +05:30
harshal.patil
fbcb51653a fix(hal): Fix MMU PSRAM anti-fi MMU target check
In case of ESP32-C5 and ESP32-C61, mmu_ids for PSRAM and Flash
MMU are the same due to their shared memory space. Thus, instead of
mmu_id we should use mmu_target_t.
2025-10-27 19:10:48 +05:30
Jiang Jiang Jian
d4b4762707 Merge branch 'bugfix/fix_tkip_fragment_issue' into 'master'
fix(wifi): fix fragment issue with wpa tkip encryption

Closes WIFI-7080 and WIFIBUG-1505

See merge request espressif/esp-idf!42817
2025-10-27 21:26:58 +08:00
Ondrej Kosta
86c9decedc Merge branch 'fix/eth_connect' into 'master'
fix(esp_eth): made LAN8720 test write register function more robust

See merge request espressif/esp-idf!42856
2025-10-27 18:57:12 +08:00
Song Ruo Jing
fab48ae1b7 Merge branch 'feature/ledc_etm_support' into 'master'
feat(ledc): add ETM support for LEDC peripheral

Closes IDF-6355, IDFGH-10620, IDFGH-16378, and IDF-10683

See merge request espressif/esp-idf!41543
2025-10-27 18:28:20 +08:00
Abhik Roy
27a76f5a36 Merge branch 'examples/vlan_test_fix' into 'master'
fix: Reorder Ethernet initialization in VLAN example

Closes IDFCI-3146, IDFCI-3145, IDFCI-3144, IDFCI-5092, IDFCI-5091, and IDFCI-5090

See merge request espressif/esp-idf!42401
2025-10-27 18:27:09 +08:00
Ondrej Kosta
eb7c6a0df4 fix(examples): fixed bridge example test endnode to host send 2025-10-27 10:38:20 +01:00
chenjianhua
b936d0075c fix(ble/bluedroid): Fixed GATT response timeout setting 2025-10-27 17:34:52 +08:00
Li Shuai
7795570721 Merge branch 'docs/pm-548' into 'master'
support esp32c5 system and wifi low power programming guide docs

Closes PM-548

See merge request espressif/esp-idf!42572
2025-10-27 17:29:57 +08:00
morris
1d809c5e9c Merge branch 'bugfix/fix_lcd_coverity_warnings' into 'master'
fix(lcd): refactor get_frame_buffer functions to fix Coverity warnings

Closes IDF-13896

See merge request espressif/esp-idf!42876
2025-10-27 17:08:33 +08:00
Jiang Jiang Jian
f5f005247e Merge branch 'docs/remove_doxy_groups_in_espnow' into 'master'
fix(wifi/espnow): Remove doxygen groups as esp-docs is flat docs style

See merge request espressif/esp-idf!42737
2025-10-27 15:38:29 +08:00
Marius Vikhammer
a95eb187fb Merge branch 'ci/add_test_wdt_helper' into 'master'
test(core): add WDT protection to detect stuck tests

See merge request espressif/esp-idf!42828
2025-10-27 14:46:58 +08:00
Jiang Jiang Jian
1ff8cadfc9 Merge branch 'fix/fix_esp32p4_cache_error_false_alarm_after_wakeup' into 'master'
fix(esp_hw_support): esp32p4 eco5 hardware issues workaround

Closes PM-558

See merge request espressif/esp-idf!42626
2025-10-27 14:45:29 +08:00
Meet Patel
fbe73cce82 Merge branch 'bugfix/esp_event_performance_test_fix' into 'master'
fix(esp_event): Updated minimum events dispatched test pass criteria

Closes IDF-12299

See merge request espressif/esp-idf!42714
2025-10-27 12:04:57 +05:30
Shu Chen
7bb8a95403 Merge branch 'feat/allow_set_ot_netif_config' into 'master'
feat: allow set ot netif config

See merge request espressif/esp-idf!42847
2025-10-27 06:34:46 +00:00
Marius Vikhammer
7b6d81ebb8 Merge branch 'ci/split_system_build_test' into 'master'
test(system): restructured system build test test-apps

Closes IDF-14206

See merge request espressif/esp-idf!42320
2025-10-27 14:32:43 +08:00
Shen Mengjing
5339194a11 docs: Update CN translation for several docs 2025-10-27 14:21:11 +08:00
5b56b00ac8 feat(esp_http_server): Allow the https server to request client certs optionally
Closes https://github.com/espressif/esp-idf/pull/17641
2025-10-27 14:19:17 +08:00
morris
e3cf730cfa fix(gptimer): update regex patterns in example test to include non-digit characters
This prevents premature matching on partial data when the output is
being streamed, which was causing the test to capture 100000 instead of
the full 1000002.
2025-10-27 14:18:09 +08:00
Mahavir Jain
23c04b681e Merge branch 'feat/esp_tee_mspi_tuning' into 'master'
change(esp_tee): Fix TEE SPI flash API issues on ESP32-C5

Closes IDF-13826

See merge request espressif/esp-idf!41952
2025-10-27 10:09:29 +05:30
Shu Chen
100a45cbe4 Merge branch 'feat/support_dhcpv6' into 'master'
feat(openthread): support OT upstream dhcpv6 feature

See merge request espressif/esp-idf!40053
2025-10-27 04:16:31 +00:00
Shu Chen
9a53a10319 Merge branch 'feat/ot_timing_optimization' into 'master'
feat(openthread): add kconfig option for timing optimization

See merge request espressif/esp-idf!42825
2025-10-27 04:13:14 +00:00
Shu Chen
8193de8a80 Merge branch 'change/154_cca_threshold' into 'master'
change(802.15.4): change the default cca threshold to -75dBm

See merge request espressif/esp-idf!42824
2025-10-27 04:12:31 +00:00
morris
3ed6979a4d Merge branch 'fix/anacmpr_etm_test' into 'master'
fix(test): deley some time to ensure gptimer is stopped

Closes IDFCI-3431, IDFCI-3432, and IDFCI-3525

See merge request espressif/esp-idf!42863
2025-10-27 11:02:56 +08:00
Ashish Sharma
5b8cd3f626 fix: fix unused value in esp uart driver 2025-10-27 11:02:48 +08:00
muhaidong
369c6e8300 fix(wifi): fix fragment issue with wpa tkip encryption 2025-10-27 10:40:18 +08:00
Jiang Jiang Jian
c83ea47012 Merge branch 'bugfix/fix_espnow_offchan_crash_issue' into 'master'
fix(wifi/espnow): fix the crash issue when using espnow off channel tx

Closes WIFI-7011 and WIFI-7074

See merge request espressif/esp-idf!42633
2025-10-27 10:35:06 +08:00
Jiang Jiang Jian
ff97953b32 Merge branch 'ci/switch_to_v6.1' into 'master'
Start of v6.1 development

See merge request espressif/esp-idf!42808
2025-10-27 10:32:24 +08:00
morris
d0c49385e1 fix(lcd): refactor get_frame_buffer functions to fix Coverity warnings
Refactored esp_lcd_rgb_panel_get_frame_buffer and
esp_lcd_dpi_panel_get_frame_buffer
to follow the standard printf/vprintf pattern:

- Created static _v helper functions that take va_list as parameter
- Moved parameter validation to the public API functions
- Public functions now handle va_start/va_end and call the helper
2025-10-27 10:10:57 +08:00
Marius Vikhammer
cd741e995f test(system): restructured system build test test-apps 2025-10-27 09:25:07 +08:00
Ashish Sharma
acf89924c8 feat(esp_http): migrate esp_http to PSA API 2025-10-26 10:13:14 +08:00
Mahavir Jain
68c8f46158 fix(esp_psram): make SPIRAM_USE_MEMMAP available for all targets
This reverts earlier commit d2858847 and thereby making SPIRAM_USE_MEMMAP
available for all targets.

This config option has no direct usage but just avoids adding the PSRAM
to heap but still keeps it memory mapped.

Closes https://github.com/espressif/esp-idf/issues/17764
2025-10-24 14:21:14 +05:30
Xu Si Yu
f05099871e feat(openthread): update examples for API changes 2025-10-24 15:59:56 +08:00
Xu Si Yu
5759c4ca27 feat(openthread): support custom netif config during initialization 2025-10-24 15:59:51 +08:00
Roland Dobai
f21b4c2381 change(version): Update version to 6.1-dev
Start of v6.1 development
2025-10-24 09:01:34 +02:00
Song Ruo Jing
d76364c2a4 Merge branch 'bugfix/uart_get_tx_buffer_free_size' into 'master'
fix(uart): correct uart_get_tx_buffer_free_size calculation

Closes IDFGH-15188

See merge request espressif/esp-idf!42701
2025-10-24 14:30:39 +08:00
David Čermák
d878a786fd Merge branch 'fix/netif_enable_lostip_timer' into 'master'
[esp_netif]: Enable/disable the lost-ip-timer explicitely

Closes IDF-10922

See merge request espressif/esp-idf!42044
2025-10-24 14:23:33 +08:00
David Čermák
42abb32a86 Merge branch 'fix/netif_verbose_level_for_trace' into 'master'
[esp_netif]: Change debug->verbose level for tracing logs

Closes IDFGH-12320

See merge request espressif/esp-idf!42344
2025-10-24 14:19:40 +08:00
Mahavir Jain
9172ed9727 Merge branch 'fix/fix_host_transport_ci_test' into 'master'
fix: fix failing test_transport_on_host test in the CI pipeline

See merge request espressif/esp-idf!42621
2025-10-24 11:10:40 +05:30
David Čermák
8a64cc15a5 Merge branch 'feat/netif_mtu_path_disc' into 'master'
[esp_netif]: Support for MTU path discovery

Closes IDFGH-10355 and IDFGH-14560

See merge request espressif/esp-idf!42088
2025-10-24 13:29:03 +08:00
Island
94d2e8eff0 Merge branch 'change/ble_update_lib_20251022' into 'master'
change(ble): [AUTO_MR] 20251022 - Update ESP BLE Controller Lib

Closes BLERP-2329, BLERP-2315, BLERP-2316, BLERP-2325, BLERP-2256, BLERP-2326, BLERP-2327, BLERP-2328, BLERP-2330, BLERP-2331, BLERP-2302, BLERP-2300, and BLERP-2301

See merge request espressif/esp-idf!42821
2025-10-24 13:17:29 +08:00
Marius Vikhammer
f04d9ac50e Merge branch 'ci/ulp_fsm_reset_between_tests' into 'master'
ci(ulp): reset board between ulp-fsm tests

Closes IDFCI-3334 and IDFCI-3336

See merge request espressif/esp-idf!42857
2025-10-24 12:22:15 +08:00
morris
8b3e5b297b fix(test): deley some time to ensure gptimer is stopped 2025-10-24 11:38:49 +08:00
Marius Vikhammer
113d69f188 test(core): add WDT protection to detect stuck tests 2025-10-24 10:48:13 +08:00
C.S.M
af0187ebaf fix(spi_flash): Fix software resume wrong config name in flash init 2025-10-24 10:35:40 +08:00
Guillaume Souchere
67b258d55a Merge branch 'fix/console-deinit-test-threshold' into 'master'
fix(console): Update the leak threashold after struct update in intr_alloc.c

See merge request espressif/esp-idf!42809
2025-10-24 04:28:12 +02:00
Marius Vikhammer
865f0f4f0e ci(ulp): reset board between ulp-fsm tests 2025-10-24 10:15:35 +08:00
zhangyanjiao
345fcf2834 fix(wifi/espnow): Remove doxygen groups as esp-docs is flat docs style 2025-10-24 10:08:02 +08:00
Kevin (Lao Kaiyao)
37b8f8f3e6 Merge branch 'bugfix/fix_touch_curr_scan_workaround_on_p4' into 'master'
fix(esp32p4): P4 touch channel 14 failure fix

Closes IDFGH-16661

See merge request espressif/esp-idf!42818
2025-10-24 04:46:39 +08:00
David Čermák
b3afa26a60 Merge branch 'feat/netif_sntp_events' into 'master'
[esp_netif]: Support posting event on SNTP time updates

Closes IDF-1729

See merge request espressif/esp-idf!42075
2025-10-24 04:42:00 +08:00
David Čermák
4a59e94b4e Merge branch 'fix/lwip_dhcps_fuzz' into 'master'
[lwip]: Fix dhcp server minor issues found when fuzzing

See merge request espressif/esp-idf!42315
2025-10-24 04:41:24 +08:00
Ondrej Kosta
0640d918bb fix(esp_eth): made LAN8720 test write register function more robust 2025-10-23 15:30:15 +02:00
Tomas Rohlinek
06004072cb Merge branch 'feat/vfs_disable_termios_by_default' into 'master'
feat(storage/vfs): Disable termios support by default

Closes IDF-7998

See merge request espressif/esp-idf!42175
2025-10-23 13:25:11 +02:00
Tomas Rohlinek
734c1725fb Merge branch 'feat/fatfs_update_default_options' into 'master'
feat(storage/fatfs): Update default configuration to better fit average usecase

Closes IDF-14042

See merge request espressif/esp-idf!42174
2025-10-23 13:23:13 +02:00
Michael (XIAO Xufeng)
746485f640 Merge branch 'fix/cpu_reset_dma' into 'master'
dma: fixed issue that DMA are not reset when CPU reset

See merge request espressif/esp-idf!41512
2025-10-23 16:26:57 +08:00
Song Ruo Jing
cc3577e31a feat(ledc): add ETM support for LEDC peripheral
Closes https://github.com/espressif/esp-idf/issues/11855
2025-10-23 16:24:11 +08:00
Song Ruo Jing
21237012e6 change(example/ledc): add power management support for the example
Closes https://github.com/espressif/esp-idf/issues/17517
2025-10-23 16:24:11 +08:00
Song Ruo Jing
4fb40fa91a fix(console): wrong uart console pin info when UART console is not used 2025-10-23 16:24:11 +08:00
Song Ruo Jing
5a3eda65df fix(uart): fix -Wunused-parameter warning with uart.h 2025-10-23 16:24:11 +08:00
Li Shuai
bb29315083 docs(Power Management): support esp32c5 system and wifi low power programming guide docs 2025-10-23 15:33:15 +08:00
Tan Yan Quan
0153494eec feat(openthread): add kconfig option for timing optimization 2025-10-23 14:49:04 +08:00
zhangyanjiao
07c74dfd1a fix(wifi/espnow): fix the crash issue when using espnow off channel tx 2025-10-23 14:30:00 +08:00
David Cermak
a6b216ac22 fix(esp_netif): Change debug->verbose level for tracing logs 2025-10-23 13:57:11 +08:00
David Cermak
787bb39765 feat(esp_netif): Support posting event on SNTP time update 2025-10-23 13:56:02 +08:00
David Čermák
6bfcd4b41c Merge branch 'fix/netif_igmp_cb' into 'master'
[esp_netif]: Fix calling IGMP callbacks after igmp_init()

Closes IDF-13554

See merge request espressif/esp-idf!42310
2025-10-23 13:53:51 +08:00
David Čermák
406c7f3ec6 Merge branch 'fix/netif_deprecated_inc' into 'master'
[lwip]: Removed deprecated headers

Closes IDF-6414

See merge request espressif/esp-idf!41868
2025-10-23 13:51:26 +08:00
David Cermak
4709069e13 fix(lwip): Fix dhcp-server to use callback only if configured 2025-10-23 13:49:21 +08:00
David Cermak
0cc53db591 fix(lwip): Fix dhcp-server to mem_free() items allocated by mem_alloc() 2025-10-23 13:49:21 +08:00
David Cermak
4c69bf826f feat(esp_netif): Add support for initial MTU in netif config
Closes https://github.com/espressif/esp-idf/issues/15319
2025-10-23 07:41:42 +02:00
Meet Patel
510a7f792e fix(esp_event): Updated minimum events dispatched test pass criteria
For the dual core chips like ESP32H4 that are running on slow CPU
clock frequency (96MHz), the number of events getting dispatched in
the test case called "performance test - no dedicated task" were
falling short of expectation because of extra overhead with locks
etc when runing with a non dedicated task. Even for other chips like
ESP32S3, if the main CPU core is running at 80MHz, the result is same.
Hence, added a consideration for CPU clock frequency when deciding
pass criteria for this test case.
2025-10-23 10:32:19 +05:30
Gao Xu
23dc9a9f47 Merge branch 'fix/esp32_adc_continuous_loss_sample' into 'master'
Fix/esp32 adc continuous loss sample

Closes IDFGH-9225, IDF-8427, and FCS-1773

See merge request espressif/esp-idf!41933
2025-10-23 12:50:06 +08:00
morris
920efaabbd Merge branch 'feat/esp_hal_lcd' into 'master'
feat(hal):graudate the LCD hal driver into a new component

Closes IDF-13676 and IDF-14100

See merge request espressif/esp-idf!42751
2025-10-23 12:36:59 +08:00
Rahul Tank
d27fb27181 feat(nimble): Add support for HCI commands / events
1. Read all local supported feature
      2. Read remote supported feature
      3. Advertising monitor.
2025-10-23 09:52:25 +05:30
Tan Yan Quan
35f5dcf16d feat(openthread): update thread-lib for new OT upstream 36b14d3ef
* esp-openthread: thread_zigbee/esp-openthread@397da59b2
* openthread: espressif/openthread@36b14d3ef
* esp-idf: espressif/esp-idf@49a872fc6
2025-10-23 04:21:24 +00:00
zhaoweiliang
96bdca38a1 feat(ble): add priority level config on ESP32-C5 2025-10-23 11:25:42 +08:00
zhaoweiliang
75f2b8d4a1 feat(ble): add priority level config on ESP32-H2 2025-10-23 11:25:42 +08:00
zhaoweiliang
09337109b7 feat(ble): add priority level config on ESP32-C6 2025-10-23 11:25:37 +08:00
C.S.M
19fef9f5ac Merge branch 'refactor/remove_flash_rom_patch_cfg' into 'master'
refactor(spi_flash): Remove spi_flash rom driver patch config option

Closes IDF-1578

See merge request espressif/esp-idf!42108
2025-10-23 11:24:46 +08:00
Shu Chen
49824abf08 change(802.15.4): change the default cca threshold to -75dBm 2025-10-23 10:54:17 +08:00
laokaiyao
c253f82bec ci(touch): add test case for the curr measuring channel 2025-10-23 10:47:48 +08:00
Pete Kabaragoya
7adc84467f fix(esp32p4): P4 touch channel 14 failure fix
Merges https://github.com/espressif/esp-idf/pull/17759

Core dump when using all touch channels on a P4 unless curr_chan is allowed to be 14
2025-10-23 10:47:48 +08:00
Wang Meng Yang
f95a5f5231 Merge branch 'bugfix/oob_in_avrc_vendor_msg' into 'master'
fix(bt/bluedroid): fixed potential OOB in AVRCP vendor command composition

Closes BT-4130

See merge request espressif/esp-idf!42410
2025-10-23 09:52:42 +08:00
wuzhenghui
8741edd26d test(esp_pm): add test case for USJ printing performance during wake-up
Add a new test case to verify that USJ printing doesn't block CPU on chip
wake-up from light sleep. The test measures the average time per print
operation and ensures it's below 5000 microseconds.
2025-10-22 17:57:32 +08:00
wuzhenghui
8b87565b53 fix(esp_driver_usb_serial_jtag): check USJ accessibility before read/write
Add connection checks to usb_serial_jtag_write and usb_serial_jtag_read
functions to return -EIO error code when the USB Serial JTAG is not
connected.
2025-10-22 17:57:32 +08:00
cjin
5ff01bf027 fix(ble): fix ble wakeup causes error on ESP32-H2 2025-10-22 17:50:53 +08:00
cjin
4d1872c66d fix(ble): fix ble wakeup causes error on ESP32-C6 2025-10-22 17:50:47 +08:00
cjin
350ae64dad fix(ble): fix ble wakeup causes error on ESP32-C5 2025-10-22 17:50:40 +08:00
cjin
5407e36e4a fix(ble): fix ble wakeup causes error on ESP32-C2 2025-10-22 17:50:35 +08:00
Zhou Xiao
557b7bae2e change(ble): [AUTO_MR] updated rom linker script for ESP32-C2 2025-10-22 17:48:43 +08:00
Zhou Xiao
ee2c7247fb change(ble): [AUTO_MR] Update lib_esp32c2 to 283861b8 2025-10-22 17:48:41 +08:00
Zhou Xiao
f4d881ff59 change(ble): [AUTO_MR] Update lib_esp32c6 to a76948d4 2025-10-22 17:48:41 +08:00
Zhou Xiao
f4ebf33964 change(ble): [AUTO_MR] Update lib_esp32c5 to a76948d4 2025-10-22 17:48:41 +08:00
Zhou Xiao
ab5c1b0e3b change(ble): [AUTO_MR] Update lib_esp32h2 to a76948d4 2025-10-22 17:48:41 +08:00
Tan Yan Quan
49a872fc6c feat(openthread): support OT upstream dhcpv6 feature 2025-10-22 17:28:48 +08:00
Tan Yan Quan
60ccb1a3bf feat(openthread): update OT upstream to 36b14d3ef 2025-10-22 17:28:24 +08:00
morris
d4d8b09ced feat(hal):graudate the LCD hal driver into a new component
- Introduced new HAL components for LCD and MIPI DSI, including:
  - `lcd_hal.c` and `lcd_hal.h` for LCD hardware abstraction layer.
  - `mipi_dsi_hal.c` and `mipi_dsi_hal.h` for MIPI DSI hardware
abstraction layer.
  - Peripheral connection definitions in `lcd_periph.c` and
`lcd_periph.h`.
  - Added necessary types and utility functions in `lcd_types.h` and
`mipi_dsi_types.h`.

- Updated CMakeLists to include the new HAL components in the build
system.
- Removed legacy references to LCD and MIPI DSI in the HAL and SOC
CMakeLists.
2025-10-22 17:00:18 +08:00
Guillaume Souchere
018cd86846 fix(console): Update the leak threashold after struct update in intr_alloc.c 2025-10-22 09:24:40 +02:00
Laukik Hase
eb74a5f9dd feat(esp_tee): Enable MSPI tuning for Flash and PSRAM 2025-10-22 11:44:34 +05:30
Laukik Hase
02cb0425b9 fix(esp_tee): Handle the SPI1 WB mode incompatibility in TEE flash APIs on ESP32-C5
- When `esp_flash_read()` is invoked from REE, it internally enables WB mode
  via `spi_flash_ll_wb_mode_enable()`. However, the ROM flash APIs used by TEE
  do not support WB mode, resulting in failures when TEE attempts to access
  flash after this call.
- This commit adds a workaround in the TEE flash layer by saving WB mode state,
  temporarily disabling it for ROM API calls, and restoring it afterward.
2025-10-22 11:44:34 +05:30
Laukik Hase
71aff04c0d fix(esp_tee): Use HAL APIs instead of ROM APIs for SPI flash service calls
Currently, REE SPI flash HAL operations are routed as service calls to TEE,
but the TEE implementation incorrectly uses ROM APIs instead of HAL APIs.
This leads to issues and is not the recommended approach.
2025-10-22 11:44:33 +05:30
Jiang Jiang Jian
8e1ebcad18 Merge branch 'feat/support_nan_usd' into 'master'
Add support for Unsynchronized Service Discovery (USD)

See merge request espressif/esp-idf!30990
2025-10-22 14:00:49 +08:00
Island
883eca3119 Merge branch 'feat/ble_mesh_ble_50_micellaneous_fix' into 'master'
fix(ble_mesh): resolve issues in long packet mode

Closes BLERP-2324, BLERP-2323, BLERP-2322, BLERP-2321, BLERP-2320, and BLERP-2319

See merge request espressif/esp-idf!42745
2025-10-22 10:46:54 +08:00
Island
d5086b36ac Merge branch 'feature/ble_mesh_dfu_support' into 'master'
Feature/ble mesh dfu support

Closes BLERP-808

See merge request espressif/esp-idf!31579
2025-10-22 10:42:39 +08:00
C.S.M
c81cf3bdf6 refactor(spi_flash): Remove spi_flash rom driver patch config option 2025-10-22 10:37:19 +08:00
Chen Chen
23b76aaf92 Merge branch 'refactor/i2c_op_array_type' into 'master'
refactor(i2c_master): Change member type of i2c_operation_job_t

Closes IDFGH-16453

See merge request espressif/esp-idf!42036
2025-10-22 10:29:05 +08:00
gaoxu
97a3b51d11 fix(adc): fix ESP32 ADC continuous loss sample times 2025-10-22 10:11:18 +08:00
David Čermák
3d5c2efb82 Merge branch 'netif_return_error' into 'master'
Makes netif receive to return error

Closes IDF-7194

See merge request espressif/esp-idf!40325
2025-10-22 03:06:18 +08:00
Jiang Jiang Jian
93f0ecfe2e Merge branch 'fix/eth_init' into 'master'
fix(examples): fixed examples ethernet_init dependency

Closes IDFCI-4847

See merge request espressif/esp-idf!42770
2025-10-22 02:37:12 +08:00
morris
0566fb4260 Merge branch 'pr/17754' into 'master'
build(deps-dev): bump vite

Closes IDFGH-16656

See merge request espressif/esp-idf!42734
2025-10-21 22:31:07 +08:00
Shu Chen
25d269dab6 Merge branch 'feat/ot_ci_log_output' into 'master'
feat(openthread): output logs of host for debugging CI issues

See merge request espressif/esp-idf!42587
2025-10-21 12:02:26 +00:00
Ondrej Kosta
6e160e2e47 fix(examples): fixed examples ethernet_init dependency 2025-10-21 13:06:04 +02:00
Island
160df75e64 Merge branch 'feat/support_get_ble_local_irk' into 'master'
feat(ble/bluedroid): add API to get local BLE IRK

Closes BLERP-2278

See merge request espressif/esp-idf!42214
2025-10-21 18:03:09 +08:00
Roland Dobai
c4cabac522 Merge branch 'fix/root_build_error' into 'master'
Fixed unsuccessful build for the IDF root directory attempts in Windows

See merge request espressif/esp-idf!42000
2025-10-21 11:30:14 +02:00
David Čermák
76966b3d8d Merge branch 'fix/docs_dhcp_acd' into 'master'
[lwip]: Clarify and test DHCP conflict detection

Closes IDF-7271

See merge request espressif/esp-idf!42020
2025-10-21 17:28:14 +08:00
luoxu
9f62db74d3 fix(bt): Fixed the issue of duplicate MAX macro definitions 2025-10-21 17:22:22 +08:00
luoxu
1b1a646891 feat(ble_mesh): Adapt DFU/MBT to esp-idf 2025-10-21 17:22:22 +08:00
luoxu
9fd27046c5 feat(ble_mesh): Device Firmware Update (Zephyr v4.0.0) 2025-10-21 17:22:22 +08:00
dependabot[bot]
f3aa1e81a9 build(deps-dev): bump vite version
Merges https://github.com/espressif/esp-idf/pull/17754
2025-10-21 16:38:27 +08:00
luoxu
0772e12f58 fix(ble_mesh): resolve issues in long packet mode
- Fix ignored extended advertising parameters from application
- Fix incorrect filtering of extended advertising reports
- Fix segmentation logic errors in long packet mode
2025-10-21 16:00:48 +08:00
C.S.M
06e5eeb494 Merge branch 'refactor/jpeg_fourcc' into 'master'
refactor(jpeg): Use fourcc for jpeg format

Closes IDF-14231

See merge request espressif/esp-idf!42581
2025-10-21 15:57:20 +08:00
Roland Dobai
ca6cfada99 Merge branch 'feat/add_idf_py_mcp' into 'master'
tools: add idf.py mcp-server support

Closes DOC-12659

See merge request espressif/esp-idf!40833
2025-10-21 09:43:13 +02:00
luoxu
b01490fc95 fix(ble_mesh): fixed the uninitialized relay advertisement queue on provisioner 2025-10-21 15:42:02 +08:00
luoxu
950b000be6 fix(ble_mesh): Fixed an issue where BLE advertisement packets failed to be sent 2025-10-21 15:41:56 +08:00
luoxu
67539296dd fix(ble_mesh): fixed ble50 advertising on bluedroid 2025-10-21 15:41:48 +08:00
Chen Chen
3d73884ae8 refactor(i2c_master): Change member type of i2c_operation_job_t
Closes https://github.com/espressif/esp-idf/issues/17585
2025-10-21 14:52:57 +08:00
Jakub Kocka
138ef35683 Merge branch 'fix/env_locale' into 'master'
Updated setting of locale to prevent Windows issues with building tools

Closes IDFGH-16402

See merge request espressif/esp-idf!42110
2025-10-21 14:48:34 +08:00
Wang Meng Yang
f207bec03c Merge branch 'bugfix/ci_c3eco7_pwr_save_fail' into 'master'
fix(ble): fix ci power save test connection failure

Closes IDFCI-3036

See merge request espressif/esp-idf!42636
2025-10-21 14:40:56 +08:00
Chen Chen
bb80291429 Merge branch 'refactor/pre_i2c_removal' into 'master'
refactor(i2c): Add disclaimer for legacy driver

Closes IDF-14262

See merge request espressif/esp-idf!42607
2025-10-21 14:39:09 +08:00
Kevin (Lao Kaiyao)
311158878f Merge branch 'bugfix/fixed_i2s_write_invalid_offset_issue' into 'master'
fix(i2s): fixed invalid offset in the big gap writing scenario

See merge request espressif/esp-idf!42735
2025-10-21 14:33:25 +08:00
Kevin (Lao Kaiyao)
dc2415aedf Merge branch 'contrib/github_pr_17742' into 'master'
fix(i2s_hal): fix typo in PDM2PCM check (GitHub PR)

Closes IDFGH-16642

See merge request espressif/esp-idf!42712
2025-10-21 14:29:28 +08:00
laokaiyao
9b69fa150f fix(i2s): fixed invalid offset in the big gap writing scenario 2025-10-21 11:17:49 +08:00
Lv Xin Yue
73115c34c9 Merge branch 'docs/improve_cam_ctrl_header_files' into 'master'
improve cam driver header files

See merge request espressif/esp-idf!42431
2025-10-21 09:15:02 +08:00
jojo2massol
b801fa0f70 fix(examples/captive_portal): Fixed indexing in DNS server IP address retrieval 2025-10-20 17:16:24 +02:00
Zhang Shuxian
512a1d8028 docs: Update CN translation 2025-10-20 16:22:54 +02:00
Marek Fiala
c4347a682d feat: Install mcp with initialization scripts 2025-10-20 16:22:54 +02:00
Mahavir Jain
7c517deb35 tools: add idf.py mcp-server support 2025-10-20 16:22:54 +02:00
Island
7a20f71935 Merge branch 'bugfix/fix_ble_deinit_memory_leak' into 'master'
fix(ble/bluedroid): fix memory leak during deinit when service table is created but not started

Closes BCI-565

See merge request espressif/esp-idf!42456
2025-10-20 22:03:27 +08:00
David Cermak
62fd7276b4 feat(esp_netif): Add support for custom got-ip/lost-ip events 2025-10-20 13:46:24 +02:00
David Cermak
37a711d829 fix(esp_netif): Enable/disable the lost-ip-timer explicitely
Previously we had to set the timer to 0 to disable it completely,
    now we have a specific config option to switch it on/off
2025-10-20 18:40:51 +08:00
David Cermak
a80c9ef7ab fix(esp_netif): Fix calling IPv6 MLD callbacks after netif_init() 2025-10-20 12:38:55 +02:00
David Cermak
91bb47ec68 fix(esp_netif): Fix calling IGMP callbacks after igmp_init() 2025-10-20 12:38:55 +02:00
Lv Xin Yue
31700298ed improve cam driver header files 2025-10-20 18:26:46 +08:00
David Cermak
11921c10b9 fix(esp_netif): Fix return value of PPP input function 2025-10-20 12:22:38 +02:00
David Cermak
ee97356448 fix(esp_netif): Add Backward compat option for external components to adjust 2025-10-20 12:22:38 +02:00
David Cermak
fd9de0c19e fix(openthread): Update OT netif layers to return error 2025-10-20 12:22:38 +02:00
Euripedes Rocha
afd7d930ee change(esp_netif): Makes netif receive to return error
Makes esp_netif_recv to return errors unconditionally
2025-10-20 12:22:38 +02:00
Zhang Shu Xian
e8ce6566d5 Merge branch 'docs/update_reference_to_esp32_errata' into 'master'
docs: Update reference to the specific section in ESP32 Errata

Closes DOC-10080

See merge request espressif/esp-idf!42514
2025-10-20 17:54:19 +08:00
David Cermak
0b319e1670 fix(esp_err): Regenerated esp_err_to_name after lwip header removed 2025-10-20 17:51:39 +08:00
David Cermak
18907c2c8f fix(lwip): Remove deprecated ping wrappers over lwip raw api 2025-10-20 17:51:39 +08:00
David Cermak
a04c5ba9bc fix(esp_netif): Remove deprecated sntp.h 2025-10-20 17:51:39 +08:00
David Cermak
fdd86721e7 feat(esp_netif): Support for MTU path discovery
Closes https://github.com/espressif/esp-idf/issues/11613
2025-10-20 11:43:36 +02:00
Abhik Roy
fc197edc29 fix: Reorder Ethernet initialization in VLAN example
- Moved `ethernet_init_all` to after default event loop creation
  to ensure the event loop exists before Ethernet driver initialization.
2025-10-20 20:43:34 +11:00
David Cermak
5a9d6a5027 fix(lwip): Allocate signals/mboxes once to reduce heap frag 2025-10-20 11:21:30 +02:00
Armando (Dou Yiwen)
a02b44deef Merge branch 'fix/fix_xip_power_reset_stuck_issue_p4_rev3' into 'master'
psram: fixed p4 rev3 xip stuck after board reset issue

See merge request espressif/esp-idf!42146
2025-10-20 09:05:58 +00:00
Agócs Dániel
041130244c fix(i2s_hal): fix typo in PDM2PCM check
Merges https://github.com/espressif/esp-idf/pull/17742
2025-10-20 16:42:33 +08:00
Song Ruo Jing
c062cd9a95 fix(uart): correct uart_get_tx_buffer_free_size calculation
Modified a bit on the TX ring buffer push size logic

 Closes https://github.com/espressif/esp-idf/issues/15859
2025-10-20 16:24:21 +08:00
C.S.M
8a41bb02b4 refactor(jpeg): Use fourcc for jpeg format 2025-10-20 16:18:09 +08:00
Roland Dobai
d4900702d5 Merge branch 'ci/github-docker-build' into 'master'
GitHUB CI fix: Add GH hosted large runner for Docker builds

Closes ITOPS-196

See merge request espressif/esp-idf!42684
2025-10-20 10:15:05 +02:00
Erhan Kurubas
8ee473d06e Merge branch 'change/apptrace_public_interface' into 'master'
Apptrace API changes and allow runtime destination selection

Closes DOC-12445, IDF-4738, and IDF-3357

See merge request espressif/esp-idf!41597
2025-10-20 10:10:01 +02:00
wuzhenghui
a36983c784 change(esp_hw_support): set HP LDO powerdown in sleep by default 2025-10-20 15:56:16 +08:00
wuzhenghui
1bb84c07ad change(esp_hw_support): set HP/LP mem in retention mode in sleep 2025-10-20 15:56:16 +08:00
wuzhenghui
b71a6ce55a change(esp_hw_support): update TOP pd sleep dependency
Disable peripheral powerdown lightsleep if PSRAM if enabled on P4 v3
Force powerdown Flash if peripheral power down lightsleep is enabled
2025-10-20 15:56:15 +08:00
wuzhenghui
2bb369f542 fix(esp_hw_support): add PD_TOP lightsleep mspi failure workaround for p4 rev3 2025-10-20 15:56:15 +08:00
wuzhenghui
c7dddbb35d fix(esp_hw_support): fix esp32p4 v3 cache error false alarm after PD_TOP wakeup 2025-10-20 15:56:15 +08:00
morris
2fb0c3cdfe Merge branch 'fix/i2c_disable_od_in_delete' into 'master'
fix(i2c): disable open drain mode on deinit

Closes IDFGH-16635

See merge request espressif/esp-idf!42644
2025-10-20 15:27:06 +08:00
Sarvesh Bodakhe
4c3d6c1292 fix(wifi): Add refactoring and migration guide for USD, Offchan_tx, ROC
1. fix(wifi): Rename old NAN configuration to NAN-Sync
  - Rename CONFIG_ESP_WIFI_NAN_ENABLE to CONFIG_ESP_WIFI_NAN_SYNC_ENABLE to indicate
    the support for Synchronized NAN (Wi-Fi Aware).
  - Because the original flag really controls the synchronized feature set, rename it
    to CONFIG_ESP_WIFI_NAN_SYNC_ENABLE so the NAN-Sync and NAN-USD paths can be
    selected independently without confusion.
2. Document esp_wifi_start requirement and fix USD examples
3. Rename nan_callbacks to nan_sync_callbacks
4. Remove the discovery_flag, clarify docs for sync vs USD flows, and add USD start/stop APIs
5. Require esp_wifi_start() before USD start
6. docs(nan): add NAN-USD application examples
7. add migration guide and hints for NAN-USD proto field
8. Improve allow_broadcast documentation
9. Add attention to the API esp_wifi_remain_on_channel
10. fix(wifi): align NAN API renames and docs for v6.0
  - keep shared APIs under esp_wifi_nan_* while reserving
    sync/usd names for mode-specific entry points
  - clarify synchronized-cluster scope in headers, docs, and migration notes (EN/zh-CN)
  - update examples for renamed helpers and WIFI_NAN_SYNC_CONFIG_DEFAULT()
  - rename `wifi_nan_config_t` to `wifi_nan_sync_config_t`
11. Mark NAN-USD as esp-idf experimental feature
2025-10-20 12:46:55 +05:30
Sarvesh Bodakhe
a5f6bc639b feat(wifi): Add support to set BSSID (A3) in esp_wifi_action_tx_req 2025-10-20 12:46:44 +05:30
Sarvesh Bodakhe
93347494b3 feat(wifi): Add support for Wi-Fi Aware: Unsynchronized Service Discover (USD)
1.  Remove redundant fixes in upstream wpa_supplicant for USD
    - Upstream supplicant has mostly fixed the issues regarding the
      unnecessary resetting pauseStateTimeout.
    - Upstream supplicant still needs one fix to avoid resetting the
      pauseStateTimeout when subscribe message is received from the peer
      which had triggered the pauseStateTimeout previously.

2.  Replace array-based channel list with bitmap for NaN-USD

    Use `wifi_scan_channel_bitmap_t` to represent the channel list for NaN-USD
    publisher and subscriber configurations. This replaces the previous approach
    that used a large array to store allowed channels.

    Also aligns with internal scan bitmap conventions across Wi-Fi stack.

3.  call esp_wifi_nan_stop() after USD exchange or STA stop

    Ensure esp_wifi_nan_stop() is called after publish/subscribe activity
    completes or when WIFI_EVENT_STA_STOP is received. This prevents NAN stop
    errors due to inactive interface. NaN-USD currently uses STA interface
    for Tx/Rx.

4.  Fix task watchdog timer triggered in active USD subscriber:

    As both USD supplicant and offchan TX component gets executed
    in the wifi task, it created a deadlock like scenario where offchan TX
    done callback was never getting executed and supplicant 'nan_de_timer'
    keeps running but failing to send any subscribe frame.

5.  Make sure that device is able to recieve action management frames
    of size more than 1400 bytes.

6.  Update proto field in SSI to match Wi-Fi Aware (NaN) spec format

    The 'proto' field in the 'wifi_nan_wfa_ssi_t' structure previously used an
    enum (wifi_nan_svc_proto_t), resulting in a 32-bit field. According to
    the Wi-Fi NAN Specification (Table 5.7), this field must be a single
    octet (8 bits). This commit updates the type to uint8_t to ensure
    compliance with the specification.

    This mismatch previously triggered warnings but did not cause functional
    errors.

7.  Set `allow_broadcast` to true in USD Remain on channel

    This enables the peer discovery as USD uses NAN-Network Multicast BSSID
    as A3 address in publish frames.

8.  Implement custom channel<->frequency conversion for NAN-USD

    NaN-USD only permits 20 MHz bandwidth channels in the 2.4 GHz and 5 GHz bands
    (as per section 4.5.3 of the Wi-Fi Aware Specification v4.0). To avoid linking
    a large portion of upstream supplicant code for frequency-to-channel and
    channel-to-frequency conversion, implement minimal custom helper functions.

9.  Limit NAN_DE_MAX_SERVICE to 2 for ESP_SUPPLICANT

10. Note: Upstream clamps negative `os_reltime` deltas to zero in `nan_de_srv_time_to_next()`,
    but our ESP_SUPPLICANT port keeps `os_time_t` unsigned, so that guard just provokes a
    compiler warning. We skip it for now because the scheduling loop validates past timestamps
    before computing the diff.

Co-authored-by: Shyamal Khachane <shyamal.khachane@espressif.com>
2025-10-20 12:18:28 +05:30
Sarvesh Bodakhe
6255a67654 fix(wifi): Add support to receive broadcast frames in ROC (Remain on Channel)
This commit adds the support to receive broadcast frames in ROC Rx
callback. Some use cases may need to receive broadcast packets for
discovery of other peers.

- This can be enabled/disabled through 'allow__broadcast' flag in
  'wifi_roc_req_t' structure.
- In default configration, broadcast packets will always be filtered out and
  will not be passed to the Rx callback to save CPU consumption.
2025-10-20 12:18:19 +05:30
Sarvesh Bodakhe
b1d1897547 fix(wifi): Make sure that USD APIs do not alter the SSI information
1.  Make sure that wpa_supplicant does not encapsulate user-given SSI info
    with WFA OUI.

2.  USD component shall transfer the SSI given by user as it is, without
    any modification or encapsulation.

3.  Note that this will break the compatibility of ESP USD implementation
    with a device running upstream wpa_supplicant as wpa_supplicant
    encapsulates the SSI information with WfA oui.
    For compatibility with wpa_supplicant, user needs to handle the
    SSI encapsulation/decapsulation.
2025-10-20 12:18:19 +05:30
Andrei Otcheretianski
0ad3af78a6 NAN: Remove excessive debug print about the next timer
As it polutes the log too much.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2025-10-20 12:18:19 +05:30
Andrei Otcheretianski
a83d66cb88 NAN: Fix A3 for unicast P2P2 USD
According to the Wi-Fi Direct spec draft, address 3 in unicast USD
frames shall be set to the P2P Device Address of the sender (i.e., this
differs from the Wi-Fi Aware specification). Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2025-10-20 12:18:19 +05:30
Andrei Otcheretianski
706b211dbf NAN: Fix A3 for multicast P2P2 USD
According to the Wi-Fi Direct spec draft, address 3 in multicast USD
frames shall be set to wildcard BSSID (i.e., this differs from the Wi-Fi
Aware specification). Fix it.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2025-10-20 12:18:19 +05:30
Shivani Baranwal
105225be91 NAN USD: Use different group address for P2P2
P2P2 uses USD with a different group address than the NAN Network ID
defined in the Wi-Fi Aware specification. Select the group address based
on whether USD is used with P2P2 or something else. This changes
behavior only for the P2P2 cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
8489c48dda NAN: Do not expire USD services based on last TX/RX message
This behavior is not described in the Wi-Fi Aware specification, so
remove it and instead, expect services to terminate USD explicitly when
no further Follow-up messages are needed.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
63445ae0f7 NAN: Wait on the channel with publisher is in pauseState
Remain waiting for additional Follow-up messages on a publisher that is
in pauseState for a service that requires further service discovery.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
62e7fa86ab NAN: Limit pauseState to be within service lifetime
If a publish service is configured with an explicit lifetime (ttl), do
not allow pauseState duration to exceed that.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
7ba048a8c5 NAN: Print a debug entry on TX wait time expiration
This can be helpful for understanding NAN DE behavior.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
1c18f52de0 NAN: Make DE aware of maximum driver supported listen time
This can be used to optimize listen operations to be as long as the
driver supports instead of having to use a small enough value to work
with all drivers.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
fd7b14af83 NAN: Do not unpause publisher on fixed Follow-up message timeout
Do not unpause publisher if more than one second has passed from the
last Follow-up message TX or RX. There is no such behavior described in
the Wi-Fi Aware specification and it is possible for a service to need
more time to generate Follow-up messages. Leave it to the service itself
to force timeout, if desired, or terminate pauseState after the 60
second overall timeout.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
aa433f46c9 NAN: Handle A3 copying internally to simplify control interface
There is no need to copy the A3 value for follow-up frames through the
control interface events and commands since it can be handled internally
in the service with sufficient accuracy. More parallel operations with
multiple peers might need per-peer information, but that can be extended
in the future, if that level of complexity is really needed in practice.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
6fe979cad1 NAN: Update A3 for USD to use NAN Network ID or NAN Cluster ID in A3
Wi-Fi Aware spec v4.0 was not clear on all cases and used a bit unclear
definition of A3 use in Table 5 (Address field definiton for NAN SDF
frames in USD). That resulted in the initial implementation using
Wildcard BSSID to comply with the IEEE 802.11 rules on Public Action
frame addressing.

For USD to have chances of working with synchronized NNA devices, A3
needs to be set to the NAN Cluster ID when replying to a frame received
from a synchronized NAN device. While there is no cluster ID for USD,
this can be done by copying the A3 from the received frame. For the
cases where sending out an unsolicited multicast frame, the NAN Network
ID should be used instead of the Wildcard BSSID.

While this behavior is not strictly speaking compliant with the IEEE
802.11 standard, this is the expected behavior for NAN devices, so
update the USD implementation to match.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
cbb2ee7ba7 NAN: Process received NAN SDFs with NAN Network ID in A3 on AP
hostapd did not accept NAN SDFs that used NAN Network ID instead of
Wildcard BSSID in A3. Extend this to process NAN Network ID just like
Wildcard BSSID for these frames to allow the specific group address to
be used.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Shivani Baranwal
bbeb70d81b NAN USD: Add publishChannelList option for Subscriber
Add frequency list to active NAN USD Subscriber to search for a
Publisher on multiple channels. This is the publish channel list used by
the Subscriber to periodically search for a service on these channels.
publishChannelList was already supported in the Publisher and this
commit extends that to the Subscriber.

This is needed for a P2P2 seeker that is an active subscriber looking
for an advertiser on a list of publish channels.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2025-10-20 12:18:19 +05:30
Shivani Baranwal
59dfc2ec32 P2P2: Allow P2P IE to be added into NAN SDFs
Extend the NAN Subscribe and Publish methods to allow p2p=1 to be
specified to include P2P attributes in a P2P IE to be added into the NAN
Element Container attribute. In addition, use the P2P Device Address for
the NAN SDFs for the P2P cases.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2025-10-20 12:18:19 +05:30
Shivani Baranwal
8173b5cc87 NAN: Option to offload NAN DE for USD into the driver
Support implementation architecture where the NAN discovery engine is
located in the driver/firmware instead of wpa_supplicant.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
2025-10-20 12:18:19 +05:30
Chien Wong
35e508258d NAN: Reject undefined publish type
The Wi-Fi Aware Specification v4.0 only defines unsolicited
transmissions only, solicited transmissions only and both unsolicited
and solicited transmissions publish. The other possibility is undefined
so we should reject it.

Signed-off-by: Chien Wong <m@xv97.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
6a1c9a5f26 NAN: Unsynchronized service discovery (USD)
Add NAN discovery engine and wpa_supplicant interface to use it for the
subset of NAN functionality that is needed for USD.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:19 +05:30
Jouni Malinen
e1791e769c NAN: Protocol definitions
Add NAN protocol definitions that are needed for USD based on Wi-Fi
Aware specification v4.0.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-10-20 12:18:18 +05:30
Jiang Jiang Jian
6566973398 Merge branch 'bugfix/fix_ptk_key_memory_leak_issue' into 'master'
fix(wifi): fix pkt key memory leak issue

Closes WIFI-7065

See merge request espressif/esp-idf!42417
2025-10-20 14:04:56 +08:00
Chen Chen
4ac9954101 refactor(i2c): Add disclaimer for legacy driver 2025-10-20 11:38:26 +08:00
hebinglin
77dc17dc60 feat(esp_hw_support): add gpio reset workaround in esp32h21 & esp32h4 2025-10-20 11:13:59 +08:00
armando
9fadbf2588 fix(psram): fixed p4 rev3 xip stuck after board reset issue 2025-10-20 03:09:47 +00:00
Shen Meng Jing
c8bbe90e26 Merge branch 'docs/update_cn_storage' into 'master'
docs: Update CN translation for storage.rst

Closes DOC-12508

See merge request espressif/esp-idf!42533
2025-10-20 10:42:12 +08:00
Shen Meng Jing
76dc7098a0 Merge branch 'docs/update_cn_translation' into 'master'
docs: Update CN translation

Closes DOC-12501

See merge request espressif/esp-idf!42467
2025-10-20 10:37:44 +08:00
Xiao Xufeng
40dd5e3957 dma: fixed issue that DMA are not reset when CPU reset
When DMA keep writing the memory, some data may be corrupted after reset. For example, the stack of bootloader may be overwritten and failed to boot until a higher scope of reset (Core).

Also removed the DPORT_PERIP_RST_EN_REG alias on ESP32S2. Now it's the same as some following chips (EN0).
2025-10-20 01:34:32 +08:00
Xiao Xufeng
676dc207e6 docs(compatibility): update chip revision compatibility docs 2025-10-20 01:31:01 +08:00
morris
8f87fe4770 Merge branch 'feat/esp_hal_dma' into 'master'
feat(dma): graduate the dma driver into a single component: esp_hal_dma

Closes IDF-14080, IDF-13675, and IDF-13673

See merge request espressif/esp-idf!42250
2025-10-20 00:16:47 +08:00
morris
2de3be7300 feat(dma): graduate the dma driver into a single component 2025-10-19 22:06:46 +08:00
Erhan Kurubas
2ef718fc29 change(app_trace): breaking changes related to destination selection
- Destination selection is unified for SystemView and app_trace
- Destination param is removed from app_trace APIs
- Destinaiton and related configuration now can be override from users
  with a callback from system_init_fn
2025-10-18 02:28:31 +08:00
Erhan Kurubas
68764bf80f refactor(app_trace): remove redundant init call from startup 2025-10-18 02:28:31 +08:00
Erhan Kurubas
006ab972c7 docs(app_trace_to_plot): fixed OpenOCD command in README 2025-10-18 02:28:31 +08:00
Erhan Kurubas
72b45ab2a6 change(examples): disable gcov build and tests because of apptrace breaking changes 2025-10-18 02:28:31 +08:00
Marius Vikhammer
ca626ae04f Merge branch 'fix/missing_requirement_in_test_app' into 'master'
fix(esp_hw_support): add the missing dependency of esp_hal_wdt component in test app

See merge request espressif/esp-idf!42681
2025-10-18 00:00:40 +08:00
Mahavir Jain
e351376dcf Merge branch 'fix/esp_tee_int_wdt' into 'master'
fix(esp_tee): Sync M-U interrupt thresholds during service calls from critical sections

See merge request espressif/esp-idf!42365
2025-10-17 17:40:53 +05:30
Mahavir Jain
1b8994c739 Merge branch 'feat/esp32p4_eco5_support_km_memprot' into 'master'
Support newer Key Manager key sources for ESP32-P4 V3

Closes IDF-13524, IDF-13527, IDF-13528, and IDF-12233

See merge request espressif/esp-idf!42360
2025-10-17 17:33:02 +05:30
Island
4cd13a9317 Merge branch 'fix/update_pawr_example_docs' into 'master'
Fix/update pawr example docs

See merge request espressif/esp-idf!42161
2025-10-17 18:03:00 +08:00
Shen Mengjing
d67a677331 docs: Update CN translation for storage.rst 2025-10-17 17:57:28 +08:00
zhanghaipeng
9df828835c fix(ble/bluedroid): fix memory leak during deinit when service table is created but not started 2025-10-17 17:45:35 +08:00
zhanghaipeng
3c68650d7e feat(ble/bluedroid): add API to get local BLE IRK 2025-10-17 17:36:45 +08:00
Shen Mengjing
5d57ad769d docs: Update CN translation 2025-10-17 17:21:56 +08:00
Wu Zheng Hui
6d2487082e Merge branch 'fix/fix_coverity_issues' into 'master'
fix(esp_hw_support): fix coverity issues in esp_hw_support

Closes IDF-13819, IDF-13892, and IDF-13894

See merge request espressif/esp-idf!42566
2025-10-17 16:53:49 +08:00
muhaidong
f5db0eafbe fix(wifi): fix pkt key memory leak issue 2025-10-17 16:22:09 +08:00
Marius Vikhammer
19e0997436 Merge branch 'feature/esp_stdio' into 'master'
feat(stdio): added new esp_stdio component

Closes IDF-13799

See merge request espressif/esp-idf!41625
2025-10-17 16:11:16 +08:00
Jakub Kocka
7e09b471ab fix: Updated locale handling to prevent issues with build tools
Closes https://github.com/espressif/esp-idf/issues/17542
2025-10-17 09:58:44 +02:00
Jakub Kocka
21c2ad8c23 fix: Added check to prevent IDF root directory build failed attempts in Win
Closes https://github.com/espressif/esp-idf/issues/17516
2025-10-17 09:37:04 +02:00
Armando (Dou Yiwen)
57bc0fe12c Merge branch 'feat/mspi_axi_arb' into 'master'
mspi: axi arb priority

Closes IDF-14125

See merge request espressif/esp-idf!42602
2025-10-17 06:07:51 +00:00
Jiang Jiang Jian
4563f8ee5f Merge branch 'change/remove_rtc_attrs' into 'master'
fix(esp_hw_support): fix rtc_clk test case time stamp lost

Closes IDF-14228

See merge request espressif/esp-idf!42632
2025-10-17 14:00:09 +08:00
Marius Vikhammer
4dd3fe78f7 Merge branch 'ci/update_mr_template' into 'master'
ci(gitlab): remove refs to release notes in MR templates

See merge request espressif/esp-idf!42601
2025-10-17 13:36:40 +08:00
morris
ee8e47ffa1 fix(esp_hw_support): add the missing dependency of esp_hal_wdt component in test app 2025-10-17 13:10:57 +08:00
morris
f4ba6279f1 fix(i2c): remove notfix(i2c): disable open drian mode on deinit
Closes https://github.com/espressif/esp-idf/issues/17737
2025-10-17 13:08:25 +08:00
morris
e5da8951b3 fix(uart): always add NOP workaround for UART FIFO read on esp32 2025-10-17 13:08:25 +08:00
Tomas Sebestik
e337f85adc ci(github-docker-build): add GH hosted large runner for docker builds 2025-10-17 07:02:46 +02:00
Laukik Hase
66c16561f5 Merge branch 'fix/c5_tee_sram_prot' into 'master'
fix(esp_tee): Split TEE SRAM as I/DRAM for ESP32-C5 with PMA

See merge request espressif/esp-idf!42347
2025-10-17 10:21:09 +05:30
Mahavir Jain
ac6aeda1ec Merge branch 'feat/enable_pseudo_round_support_for_aes' into 'master'
feat: enable pesudo round functionality for AES in ESP32P4 ECO5

Closes IDF-13526 and IDF-13437

See merge request espressif/esp-idf!42204
2025-10-17 08:26:32 +05:30
Mahavir Jain
fcc01f872b Merge branch 'fix/allign_hal_crypto_ecdsa_test_parameters_with_mbedtls_tests' into 'master'
feat(hal/test_apps): Align hal/crypto ECDSA test parameters to mbedtls test_apps

See merge request espressif/esp-idf!42226
2025-10-17 08:25:49 +05:30
Wang Meng Yang
171fc377ce Merge branch 'bugfix/fix_bt_coverity' into 'master'
fix(esp_coex): fix explicit null dereferenced reported by coverity

Closes IDF-14126

See merge request espressif/esp-idf!42062
2025-10-16 18:58:40 +08:00
Nilesh Kale
92d4e3afd1 Merge branch 'feature/partial_download_over_single_connection' into 'master'
feat(esp_https_ota): Support partial downloading of OTA over single connection

Closes IDF-13400

See merge request espressif/esp-idf!41911
2025-10-16 18:32:15 +08:00
Konstantin Kondrashov
610971835b Merge branch 'feature/support_efuses_esp32p4_eco5' into 'master'
feat(efuse): Support efuses for ESP32-P4 ECO5

Closes IDF-13512 and IDF-13562

See merge request espressif/esp-idf!41607
2025-10-16 17:31:59 +08:00
Rahul Tank
7ae7dcd1da Merge branch 'fix/ble_gap_conn_handle_overflow' into 'master'
fix(nimble) Fix array overflow caused by invalid connection handle indexing

Closes BLERP-2297 and BLERP-2298

See merge request espressif/esp-idf!42124
2025-10-16 14:32:16 +05:30
Konstantin Kondrashov
fb91ddd813 Merge branch 'fix/test_time_ut' into 'master'
fix(esp_libc): Fix test_time UTs for newlib nano format

Closes IDFCI-3389

See merge request espressif/esp-idf!42399
2025-10-16 16:24:56 +08:00
He Binglin
f840c0bd32 Merge branch 'feat/esp_idf_c61_doc' into 'master'
docs(pm): update power management related docs for esp32c61

Closes IDF-10116

See merge request espressif/esp-idf!42515
2025-10-16 16:09:43 +08:00
xiongweichao
7920885608 fix(ble): fix ci power save test connection failure 2025-10-16 15:59:19 +08:00
Kevin (Lao Kaiyao)
30d0ededbe Merge branch 'refactor/remove_legacy_touch_dependency_in_ulp' into 'master'
refactor(touch): remove legacy touch driver dependency in ulp

Closes IDF-14263

See merge request espressif/esp-idf!42404
2025-10-16 15:26:02 +08:00
Meet Patel
6491647fcb Merge branch 'feature/rtc_wdt_test_app' into 'master'
feat(rtc_wdt): Added unity app to test rtc watchdog timer functions

Closes IDF-12273

See merge request espressif/esp-idf!42568
2025-10-16 12:55:13 +05:30
Wu Zheng Hui
e1b6006761 Merge branch 'fix/fix_esp32c5_xtal32k_clock_lost_in_sleep' into 'master'
fix(esp_system): manage slow clock sleep pd in select_rtc_slow_clk

See merge request espressif/esp-idf!41591
2025-10-16 15:24:50 +08:00
wuzhenghui
c396fd5ec3 fix(esp_hw_support): fix rtc_clk test case time stamp lost 2025-10-16 14:51:52 +08:00
Chen Chen
260443fe73 Merge branch 'fix/i2c_lp_test' into 'master'
fix(i2c/gpio): Add error checks to the i2c driver & Fix errors in gpio

Closes IDF-13942

See merge request espressif/esp-idf!41527
2025-10-16 13:51:18 +08:00
Ashish Sharma
8f0a19d169 fix: fix the failing tcp_transport host test in the CI 2025-10-16 11:47:08 +08:00
morris
d5ff73e928 Merge branch 'feature/esp32p4_eco5_support' into 'master'
feat(gpio/ledc/uart/2ddma/ppa): ESP32P4 ECO5 related updates

Closes IDF-13419, IDF-13425, IDF-13427, IDF-13436, IDF-13740, IDF-13741, IDF-13675, IDF-12225, IDF-13823, IDF-13514, IDF-13539, and IDF-13533

See merge request espressif/esp-idf!41980
2025-10-16 11:16:34 +08:00
Gao Xu
5d8af45b21 Merge branch 'refactor/rng_ll_c3' into 'master'
refactor(rng): refactor to use hal/ll apis for C3

Closes IDF-12535

See merge request espressif/esp-idf!42249
2025-10-16 11:16:08 +08:00
Island
1f085d5c0e Merge branch 'fix/change_api_to_enable_rc32k' into 'master'
fix: change the api to enable rc32k

Closes BLERP-2283

See merge request espressif/esp-idf!42284
2025-10-16 11:11:13 +08:00
Armando (Dou Yiwen)
ba7d244762 Merge branch 'change/remove_rtc_attrs' into 'master'
rtc: removed rtc related memory attrs on no-rtc-support chips

Closes IDF-7680 and IDF-14228

See merge request espressif/esp-idf!42101
2025-10-16 03:04:25 +00:00
Zhang Shuxian
52aa593617 docs: Update reference to the specific section in ESP32 Errata 2025-10-16 10:08:16 +08:00
Marius Vikhammer
a257812e14 feat(stdio): added esp_stdio component
esp_stdio contains everything the old esp_vfs_console contained (the vfs stdio glue layer)
as well as other functionality related to stdio (previously referred to as console)
2025-10-16 10:01:59 +08:00
Laukik Hase
9de1d631b4 feat(esp_tee): Reclaim unused TEE IRAM memory as heap
- Changed the default TEE code placement to use the flash
  text section instead of IRAM text, making it consistent
  with the default data placement.
2025-10-15 18:22:44 +05:30
Laukik Hase
20344640e3 fix(esp_tee): Split TEE SRAM as I/DRAM for ESP32-C5 with PMA 2025-10-15 18:22:43 +05:30
Konstantin Kondrashov
6f9e137336 feat(efuse): Adds calibration efuses for ESP32-P4 ECO5 2025-10-15 15:36:56 +03:00
Konstantin Kondrashov
969d017c56 feat(efuse): Support efuses for ESP32-P4 ECO5 2025-10-15 15:36:55 +03:00
Island
7ce5732049 Merge branch 'feat/esp32c2_add_get_used_heap_size' into 'master'
Feat/esp32c2 add get used heap size

Closes BLERP-2245, BLERP-2276, and BLERP-2277

See merge request espressif/esp-idf!42168
2025-10-15 20:14:30 +08:00
Wu Zheng Hui
dfeae969a4 Merge branch 'feat/support_esp32p4_eco5_pmu' into 'master'
feat(esp_hw_support): Update esp32p4 eco5 lowpower features support

See merge request espressif/esp-idf!41162
2025-10-15 19:47:43 +08:00
Tomas Rohlinek
7d7c5f1412 Merge branch 'fix/vfs_new_api_docs' into 'master'
fix(storage/vfs): Fix typo in code snippet in docs

Closes IDF-14285

See merge request espressif/esp-idf!42609
2025-10-15 13:34:15 +02:00
Chen Ji Chang
a480689459 Merge branch 'feat/re_support_i80_on_p4_eco5' into 'master'
feat(i80_lcd): re-support i80 lcd on p4eco5

Closes IDF-13821

See merge request espressif/esp-idf!42117
2025-10-15 19:14:31 +08:00
Shreeyash
dd2cdf18cc fix(nimble): fix array overflow caused by invalid connection handle indexing 2025-10-15 15:58:08 +05:30
harshal.patil
609d52c6bf feat(esp32p4): Support newer Key Manager key sources for ESP32-P4 V3 2025-10-15 15:49:20 +05:30
morris
ab149384e1 Merge branch 'refactor/clean_soc_caps_gptimer' into 'master'
refactor(hal): graduate watch dog hal driver into a new component: esp_hal_wdt

Closes IDF-14091

See merge request espressif/esp-idf!42338
2025-10-15 17:18:20 +08:00
Marius Vikhammer
668ce92cc3 Merge branch 'ci/test_apps_ulp_dep' into 'master'
ci(network): fixed dependencies for misc network and wifi related test apps

Closes IDF-14193, IDF-14201, IDF-14205, IDF-14204, IDF-14192, and IDF-14196

See merge request espressif/esp-idf!42592
2025-10-15 17:16:56 +08:00
Song Ruo Jing
6776f65fc9 feat(ppa): ESP32P4 ECO5 PPA related updates
PPA SRM engine added YUV422 and GRAY8 color mode support
PPA SRM engine macro block size increased to 32x32
PPA Blending engine added YUV420, YUV422 and GRAY8 color mode support
2025-10-15 16:49:22 +08:00
Song Ruo Jing
dd5d4bd8d7 feat(2ddma): ESP32P4 ECO5 2DDMA related updates
Added one more pair of 2DDMA channels
Priority bit width increased corespondingly
Added three new CSC modes for RX channel 0
Also cleaned up DMA2D capability definitions in soc_caps.h
2025-10-15 16:49:22 +08:00
Song Ruo Jing
4b0524258d feat(interrupts): ESP32P4 ECO5 interrupt sources update 2025-10-15 16:49:22 +08:00
Song Ruo Jing
08bc91ecc5 fix(clk): allow P4 CPU clk freq can auto switch between 360/400MHz according to revision 2025-10-15 16:49:21 +08:00
Song Ruo Jing
ccca5a19ca feat(uart): ESP32P4 ECO5 UART related updates 2025-10-15 16:49:21 +08:00
Song Ruo Jing
22dfacc18d feat(ledc): ESP32P4 ECO5 LEDC related updates 2025-10-15 16:49:21 +08:00
morris
a1f765b68f Merge branch 'feat/support_parlio_cs_on_p4_eco5' into 'master'
feat(parlio_tx): support cs signal on esp32p4 eco5

Closes IDF-13519 and IDF-12219

See merge request espressif/esp-idf!41787
2025-10-15 16:39:26 +08:00
Tomáš Rohlínek
4568f6c776 fix(storage/vfs): Fix typo in code snippet in docs 2025-10-15 10:08:52 +02:00
Tomáš Rohlínek
f6ba0d8aa0 feat(storage/fatfs): Update default configuration to better fit average usecase 2025-10-15 09:30:02 +02:00
Tomáš Rohlínek
d99e984a90 feat(storage/vfs): Disable termios support by default 2025-10-15 09:29:34 +02:00
Xu Si Yu
13df28d5c9 feat(openthread): output logs of host for debugging CI issues 2025-10-15 15:28:39 +08:00
Rahul Tank
03dd5e31e0 Merge branch 'feat/channel_sounding_nimble' into 'master'
feat(nimble): Add initial support for CS HCI

See merge request espressif/esp-idf!41865
2025-10-15 12:46:15 +05:30
zwl
e87ace3a33 feat(ble): change free api on ESP32-C5 2025-10-15 15:11:06 +08:00
zwl
034172154a feat(ble): change free api on ESP32-C6 2025-10-15 15:11:06 +08:00
zwl
e18972e94e feat(ble): change free api on ESP32-C2 2025-10-15 15:11:06 +08:00
zwl
149f6c56b3 feat(ble): add get used mem api 2025-10-15 15:11:02 +08:00
Laukik Hase
8770ae9db4 fix(esp_tee): Sync TEE-REE intr thresholds during service calls from critical sections
- Previously, only the U-mode interrupt threshold was raised in REE critical sections,
  leaving M-mode at the lowest level.
- As a result, when a service call transitioned to M-mode, all interrupts were still
  allowed to fire, including those that should have been masked.
2025-10-15 12:33:31 +05:30
Meet Patel
9b86dc25ab feat(rtc_wdt): Added unity app to test rtc watchdog timer functions
Unity based test app configures RTC WDT to verify following features:
1. Verify all 4 stages of RTC WDT are able to trigger timeout and
   invoke the pre-configured interrupt service routine
2. Verify RTC WDT can reset the main SYSTEM or main SYSTEM + RTC
2025-10-15 12:14:19 +05:30
Chen Chen
29f8fcf7b7 fix(i2c/gpio): Add error checks to the i2c driver
Add more checks to i2c driver, as well as fixed some GPIO issues
together with it.
2025-10-15 10:38:59 +08:00
armando
abfad4d255 feat(mspi): axi arb priority 2025-10-15 09:59:16 +08:00
laokaiyao
14cf724f64 refactor(touch): remove legacy touch driver dependency in ulp 2025-10-15 09:44:43 +08:00
Marius Vikhammer
8a10c7ae6a ci(gitlab): remove refs to release notes in MR templates 2025-10-15 09:39:10 +08:00
Marius Vikhammer
4b2a8b946f ci(network): fixed dependencies for misc network and wifi related test apps 2025-10-15 09:37:00 +08:00
wuzhenghui
5bdcc8f5b0 change(esp_hw_support): update RTC mem attr in sleep_modes.c 2025-10-15 01:19:02 +00:00
armando
0f6adbebed change(memory): removed rtc related memory attrs on no-rtc-support chips 2025-10-15 01:19:02 +00:00
morris
f4e999fd3e Merge branch 'reproduce/32_spi_slave_hold_miso_when_deactive' into 'master'
fix(driver_spi): add some parameter checks

Closes IDFGH-7020, IDFGH-262, and IDFGH-16313

See merge request espressif/esp-idf!21648
2025-10-15 05:27:13 +08:00
Jiang Jiang Jian
1d2147cbf2 Merge branch 'bugfix/mac_deinit_esp32' into 'master'
fix(esp_wifi): fix esp32 mac deinit stuck issue

See merge request espressif/esp-idf!42487
2025-10-14 23:56:22 +08:00
wanckl
a0f8df9a9a doc(driver_spi): added note for esp32 slave hardware limitaion
Closes https://github.com/espressif/esp-idf/issues/8638
2025-10-14 20:29:27 +08:00
wanckl
b7adf3e7db fix(driver_spi): added warning for esp32 dma translength unalign to 4 byte
Closes https://github.com/espressif/esp-idf/issues/2085
2025-10-14 20:29:27 +08:00
wanckl
30af6c59b1 fix(driver_spi): override_freq_hz add validation check
Closes https://github.com/espressif/esp-idf/issues/17460
2025-10-14 20:29:27 +08:00
Jiang Jiang Jian
29fe500e2c Merge branch 'fix/improve_get_start_doc_notes' into 'master'
fix(doc): fix get start process in port notes

See merge request espressif/esp-idf!38524
2025-10-14 19:23:22 +08:00
Jiang Jiang Jian
785ace5ea0 Merge branch 'bugfix/static_analyzer_rsnxe_fix' into 'master'
fix(esp_wifi): Add validation before accessing RSNXE

Closes IDF-14257

See merge request espressif/esp-idf!42403
2025-10-14 19:03:17 +08:00
Chen Chen
a8ace9db09 Merge branch 'feat/i2c_slave_reset_tx_fifo' into 'master'
feat(i2c_slave): Add API to perform slave tx buffer reset

Closes IDFGH-15612

See merge request espressif/esp-idf!42091
2025-10-14 19:00:57 +08:00
Rahul Tank
38364c0ef3 fix(nimble): Added CS service support 2025-10-14 16:21:17 +05:30
David Cermak
0586066d1b fix(lwip): Clarify and test DHCP conflict detection 2025-10-14 12:48:58 +02:00
Wang Meng Yang
d822e9bbbe Merge branch 'bugfix/fix_ble_deinit_crash' into 'master'
fix(ble/bluedroid): prevent crash when deinit/disable host during scan

Closes BLERP-2266, BLERP-2267, BLERP-2268, BLERP-2270, and BLERP-2274

See merge request espressif/esp-idf!42134
2025-10-14 18:00:45 +08:00
chenjianxing
23ee556379 fix(esp_wifi): fix esp32 mac deinit stuck issue 2025-10-14 16:38:40 +08:00
wuzhenghui
065dd70056 change(esp_hw_support): move ESP_SLEEP_POWER_DOWN_CPU to Kconfig 2025-10-14 16:33:30 +08:00
wuzhenghui
69553da81a fix(esp_hw_support): fix P4 v3.0 USB leakage on PU_CNNT lightsleep 2025-10-14 16:33:30 +08:00
wuzhenghui
f68896ca53 fix(esp_hw_support): add the TOP domain's power-off dependency on the CNNT domain 2025-10-14 16:33:30 +08:00
wuzhenghui
e1e649ab89 fix(esp_hw_support): disable HP regulator if DCDC keeps powering during sleep 2025-10-14 16:33:29 +08:00
wuzhenghui
bedcf4ad88 change(esp_hw_support): allocate memory with MALLOC_CAP_RETENTION for regdma link 2025-10-14 16:33:29 +08:00
wuzhenghui
3b950401d8 change(soc): reset L2 Cache sync after config restore 2025-10-14 16:33:29 +08:00
wuzhenghui
af1c8a568d feat(esp_hw_support): update cpu_pd support for esp32p4 v3.0 2025-10-14 16:33:28 +08:00
wuzhenghui
0eab2428c3 feat(esp_hw_support): update pmu support for esp32p4 v3.0 2025-10-14 16:33:28 +08:00
wuzhenghui
ff6d219775 feat(soc): support esp32p4 rev3.0 soc 2025-10-14 16:33:28 +08:00
Zhang Shu Xian
5ab96242e8 Merge branch 'docs/add_note_for_rom' into 'master'
docs: Add a note about ROM version in the boot log

Closes DOC-12460

See merge request espressif/esp-idf!42228
2025-10-14 15:29:54 +08:00
C.S.M
5a14ccfe64 Merge branch 'fix/add_error_check' into 'master'
fix(jpeg): Add check for jpeg marker parser in order to enhance safety

See merge request espressif/esp-idf!42435
2025-10-14 15:04:31 +08:00
Rahul Tank
300bf85b45 feat(nimble): Base support for Channel sounding HCI command and events 2025-10-14 12:08:38 +05:30
C.S.M
79cc42a940 Merge branch 'fix/cache_32m_map' into 'master'
fix(spi_flash): Fix the cache map 32M flash failed on esp32c5

See merge request espressif/esp-idf!42506
2025-10-14 14:28:02 +08:00
Rahul Tank
7c1700b0ee Merge branch 'bugfix/use_nimble_mem_apis' into 'master'
fix(nimble): Use nimble platform mem malloc / free APIs

Closes BLERP-2279

See merge request espressif/esp-idf!42234
2025-10-14 11:49:52 +05:30
C.S.M
12c633fd75 Merge branch 'fix/i2c_wdt_after_nack' into 'master'
fix(i2c): Fix the potential wdt might happen after nack

Closes IDFGH-16612

See merge request espressif/esp-idf!42554
2025-10-14 13:58:26 +08:00
Jin Cheng
565fa98d0c fix(bt/bluedroid): fixed potential OOB in AVRCP vendor command composition 2025-10-14 11:55:47 +08:00
morris
e8de5b5a95 refactor(gptimer): clean up SOC capabilities for GPTIMER and Timer Group
- Remove GPTIMER and TIMG related definitions from soc_caps_full.h files
- Move timer peripheral definitions to appropriate HAL layer files
- Update references across components to use proper HAL abstractions
- Consolidate timer group and GPTIMER capabilities organization
- Ensure consistent timer configuration across all ESP32 variants

This refactoring improves the separation of concerns between SOC
capabilities and HAL implementations for timer-related functionality.
2025-10-14 11:44:38 +08:00
morris
56c3dc4755 feat(wdt): graduate watch dog hal driver into a new component: esp_hal_wdt 2025-10-14 11:44:32 +08:00
wuzhenghui
55bab4c4b2 fix(esp_hw_support): fix Coverity static analysis issue in regdma_link_update_next 2025-10-13 20:47:50 +08:00
wuzhenghui
e71265839e change(esp_hw_support): fix dead code in esp_sleep_pd_config and add detailed comments 2025-10-13 20:35:10 +08:00
yangfeng
d9ce1e6bc9 fix(esp_coex): fix explicit null dereferenced reported by coverity 2025-10-13 19:39:51 +08:00
Wang Meng Yang
1904fd4d9c Merge branch 'fix/incorrect_assert_in_acl_data_process' into 'master'
fix(bt): avoid asserting when previous data hasn't finished transmitting

See merge request espressif/esp-idf!42532
2025-10-13 19:03:41 +08:00
Frantisek Hrbata
91f7664571 Merge branch 'docs/minimal_build_migration' into 'master'
docs(migration): add note about MINIMAL_BUILD to 5.5 migration guide

Closes DOC-12499

See merge request espressif/esp-idf!41192
2025-10-13 11:29:46 +02:00
C.S.M
2523fee9cd fix(i2c): Fix the potential wdt might happen after nack,
Closes https://github.com/espressif/esp-idf/issues/17720
2025-10-13 16:07:22 +08:00
Laukik Hase
6e51fac96e Merge branch 'fix/esp_tee_flash_op_bound_checks' into 'master'
fix(esp_tee): Correct flash operation bound checks to handle all overlap cases

Closes IDF-14129

See merge request espressif/esp-idf!41946
2025-10-13 13:31:03 +05:30
Island
6b40ac65cb Merge branch 'fix/ble_log_acl_data_copy' into 'master'
fix(ble): copy acl data by omdata buffer copy

Closes BLERP-2294

See merge request espressif/esp-idf!42444
2025-10-13 14:26:29 +08:00
Island
53249ade21 Merge branch 'feat/ble_mesh_long_package_support' into 'master'
feat(ble_mesh): long packet mode support

Closes BLERP-2273

See merge request espressif/esp-idf!39175
2025-10-13 14:25:55 +08:00
Mahavir Jain
269acda53c Merge branch 'cleanup/use_cjson_from_registry' into 'master'
cleanup: move cJSON to component manager

See merge request espressif/esp-idf!42379
2025-10-13 11:54:10 +05:30
zhanghaipeng
ca2c78f53e fix(ble/bluedroid): prevent crash when deinit/disable host during scan
Crash occurs if the BLE host is deinitialized or disabled while scanning is still active.
This usage is not recommended.
2025-10-13 13:27:04 +08:00
Island
6424b52fb7 Merge branch 'bugfix/fix_cble50y25_305' into 'master'
Fixed GPIO matrix function calls on ESP32-C3 and ESP32-S3(18b5cbe)

Closes BLERP-2299

See merge request espressif/esp-idf!42507
2025-10-13 12:07:35 +08:00
Laukik Hase
88444df58b Merge branch 'docs/esp_tee_c5' into 'master'
docs(esp_tee): Enable ESP-TEE documentation for ESP32-C5

Closes IDF-10432

See merge request espressif/esp-idf!42390
2025-10-13 09:29:20 +05:30
Chen Jichang
dde8fac6b8 feat(parlio_tx): support cs signal on esp32p4 eco5 2025-10-13 11:48:47 +08:00
Song Ruo Jing
9056974051 feat(gpio): ESP32P4 ECO5 GPIO related update 2025-10-13 11:48:47 +08:00
Chen Ji Chang
3b0d8508c0 Merge branch 'fix/fix_esp32_rmt_disable_timeout_in_special_condition' into 'master'
fix(rmt): use memset to clear entire RMT memory block instead of single word

Closes IDFGH-16574

See merge request espressif/esp-idf!42510
2025-10-13 10:49:12 +08:00
gongyantao
3a1a579d9a fix(bt): avoid asserting when previous data hasn't finished transmitting 2025-10-13 09:44:33 +08:00
morris
5c3a562af1 Merge branch 'chor/clean_driver_dependency_in_build_system' into 'master'
refactor: remove unnecessary driver dependencies from build rules

Closes IDF-10696

See merge request espressif/esp-idf!42405
2025-10-12 17:19:43 +08:00
Zhang Shuxian
2ce0c51e8e docs: Update translation for build-system.rst 2025-10-12 02:16:56 +08:00
Frantisek Hrbata
f2f5a4ff80 docs(migration): add note about MINIMAL_BUILD to 5.5 migration guide
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-12 02:16:56 +08:00
chenjianhua
25adf4c934 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(18b5cbe)
- Fixed GPIO matrix function calls
2025-10-11 19:38:41 +08:00
Wang Meng Yang
e11789a999 Merge branch 'bugfix/bt_idf_ci' into 'master'
fix(example/classic_bt): Fix the potential stack overflow tasks

Closes IDFCI-4308

See merge request espressif/esp-idf!42513
2025-10-11 16:59:53 +08:00
morris
f348a101f9 Merge branch 'refactor/remove_deprecated_periph_module_enable_disable_functions' into 'master'
refactor(hw_support): remove unused periph_module_t members

Closes IDF-11855

See merge request espressif/esp-idf!42147
2025-10-11 16:43:56 +08:00
yangfeng
4606fa87c7 fix(example/classic_bt): Fix potential stack overflow tasks 2025-10-11 16:40:43 +08:00
hebinglin
f8a5ae28a7 docs(pm): update power management related docs for esp32c61 2025-10-11 16:14:19 +08:00
Wang Meng Yang
549a7272bf Merge branch 'bugfix/several_esp32_bugs' into 'master'
fix(bt/controller): fixed several controller bugs

Closes BT-4103 and BT-4100

See merge request espressif/esp-idf!41644
2025-10-11 16:02:36 +08:00
Chen Jichang
5868098168 feat(lcd): re-support i80 lcd and support underrun inerrupt on p4 rev 3.0 2025-10-11 14:32:09 +08:00
Zhou Xiao
322eb33f0d fix(ble): copy acl data by omdata buffer copy 2025-10-11 14:14:40 +08:00
He Binglin
f2b6070837 Merge branch 'feat/support_esp32h4_psram' into 'master'
feat(esp_hw_support): support psram during sleep for esp32h4

See merge request espressif/esp-idf!41780
2025-10-11 14:11:17 +08:00
Zhang Shu Xian
5b59fdcd0b Merge branch 'docs/update_translation_for_esp_netif' into 'master'
docs: Update translation for esp_netif

Closes DOC-12459

See merge request espressif/esp-idf!42239
2025-10-11 14:08:03 +08:00
morris
cd41b6a640 refactor: remove unnecessary driver dependencies from build rules 2025-10-11 14:02:29 +08:00
Wu Zheng Hui
3a0eba4c46 Merge branch 'fix/fix_32k_config_revoke_breaks_io_holding' into 'master'
fix(esp_system): fix ext 32k io revoking breaks sleep io holding

Closes IDFGH-16262

See merge request espressif/esp-idf!41380
2025-10-11 12:59:35 +08:00
Chen Jichang
9e28a8d05c fix(rmt): use memset to clear entire RMT memory block instead of single word
closes https://github.com/espressif/esp-idf/issues/17692
2025-10-11 11:27:52 +08:00
C.S.M
942f2dd0f9 fix(spi_flash): Fix the cache map 32M flash failed on esp32c5 2025-10-11 11:05:47 +08:00
luoxu
93a36fbf99 feat(ble_mesh): add BLE 5.0 extended advertising and long packet support
- Add extended advertising configuration with customizable PHY selection (1M, 2M, Coded)
- Implement long packet mode to overcome standard BLE Mesh packet length limitations
- Add configurable advertising parameters: interval, count, channel map, TX power
- Introduce enhanced message context structure for fine-grained advertising control
- Add Kconfig options for buffer management and segment count configuration
- Support both forced and preferred long packet transmission modes
- Update advertising buffer pools to accommodate extended and long packet types
- Add validation for enhanced advertising parameters and packet length limits
- Maintain backward compatibility with existing BLE Mesh functionality
2025-10-11 10:57:46 +08:00
wuzhenghui
4bb6a01959 fix(esp_system): fix ext 32k io revoking breaks sleep io holding 2025-10-10 19:44:07 +08:00
C.S.M
c38a6691b9 fix(jpeg): Add check for jpeg marker parser in order to enhance safety 2025-10-10 18:44:27 +08:00
nilesh.kale
709b869a34 feat(esp_https_ota): Support partial downloading of OTA over single connection
This commit added support to download OTA with partial download feature
over single HTTP connection if server supports persistent connection.
2025-10-10 15:42:47 +05:30
Roland Dobai
d816c3fb5b Merge branch 'contrib/github_pr_17594' into 'master'
fix(depgraph): Add double quotes around dependency names (GitHub PR)

Closes IDFGH-16471

See merge request espressif/esp-idf!41989
2025-10-10 11:27:06 +02:00
Jiang Jiang Jian
5f5f96384c Merge branch 'feat/support_esp32c5_cert_test_example' into 'master'
Feat/support esp32c5 cert test example

See merge request espressif/esp-idf!42103
2025-10-10 17:03:31 +08:00
morris
d331400e7a Merge branch 'fix/gcc_analyzer_warning_on_preview_targets' into 'master'
refactor(sleep_cpu): suppress infinite loop warnings with compiler diagnostics

See merge request espressif/esp-idf!42457
2025-10-10 16:45:32 +08:00
Wang Meng Yang
1d0db55941 Merge branch 'bugfix/bt_idf_ci' into 'master'
fix(example/classic_bt): Fix the stack overflow of the SPPAppT and mouse_move_task tasks

Closes IDFCI-3985 and IDFCI-3631

See merge request espressif/esp-idf!42474
2025-10-10 16:09:36 +08:00
yangfeng
dc1c22f090 fix(example/classic_bt): Fix the stack overflow of the SPPAppT and mouse_move_task tasks 2025-10-10 14:42:01 +08:00
Nilesh Kale
20098cb71c Merge branch 'bugfix/ota_resumption_saved_size_alignmnet' into 'master'
fix: Ensure OTA written size for 16-byte alignment

See merge request espressif/esp-idf!41887
2025-10-10 13:49:24 +08:00
morris
efe05d829b refactor(sleep_cpu): suppress infinite loop warnings with compiler diagnostics 2025-10-10 13:37:29 +08:00
Wang Meng Yang
b92235223a Merge branch 'bugfix/fix_some_bt_bugs' into 'master'
fix(bt): fix some bluetooth bugs

Closes IDFGH-16334 and IDFGH-15166

See merge request espressif/esp-idf!42261
2025-10-10 12:10:25 +08:00
Wang Meng Yang
3e0545f28b Merge branch 'bugfix/fix_bt_security' into 'master'
fix(bt/bluedroid): Fix the boundary conditions when checking EIR data

See merge request espressif/esp-idf!42253
2025-10-10 09:07:49 +08:00
morris
4e62b0e44e Merge branch 'refactor/mcpwm_generator_remove_varg_api' into 'master'
refactor(mcpwm): remove varg action setting functions for timer, compare, and brake events

Closes IDF-13901, IDF-13890, IDF-13865, and IDF-13880

See merge request espressif/esp-idf!42259
2025-10-10 03:25:40 +08:00
Martin Vychodil
1e1b95cfa1 Merge branch 'feature/esp_partition_bdl_support' into 'master'
Feat(storage): esp_partition BDL support

Closes IDF-12748

See merge request espressif/esp-idf!40288
2025-10-10 01:55:35 +08:00
Adam Múdry
3eb74a7e95 fix(sdspi): esp_driver_sdpsi test app increase timeout to 180 2025-10-09 15:13:23 +02:00
wuzhenghui
aab33f3219 fix(esp_system): manage slow clock sleep pd in select_rtc_slow_clk 2025-10-09 20:03:49 +08:00
Fu Hanxi
c27bccaf81 Merge branch 'ci/fix-pipeline-commit-sha-in-build-docker' into 'master'
Ci/fix pipeline commit sha in build docker

Closes IDFCI-3918

See merge request espressif/esp-idf!42381
2025-10-09 13:22:45 +02:00
Fu Hanxi
f10537a76d Merge branch 'ci/remove-extra-custom-yml' into 'master'
ci: move extra targets need to be built by default to `--additional-build-targets`

Closes IDFCI-3230

See merge request espressif/esp-idf!42230
2025-10-09 12:48:23 +02:00
Igor Masar
4f578d8375 Merge branch 'feat/usb-h4-support' into 'master'
feat(soc/usb): Add USB support for ESP32-H4

Closes IDF-12341 and IDF-12342

See merge request espressif/esp-idf!41642
2025-10-09 18:28:16 +08:00
Samuel Obuch
86b39c6315 Merge branch 'esp_rom_fix_defalut_typos' into 'master'
fix(esp_rom):  correct typos defalut -> default

Closes IDFGH-16547

See merge request espressif/esp-idf!42294
2025-10-09 17:25:05 +08:00
muhaidong
57aa42bb43 fix(phy): fix cmd get_rx_result log error issue 2025-10-09 16:48:52 +08:00
muhaidong
a5bc5a3f7f fix(phy): add tx_contain_en cmd for esp32c5 2025-10-09 16:40:01 +08:00
muhaidong
68f0386405 feat(phy): support esp32c5 cert test 2025-10-09 16:40:01 +08:00
morris
b76254895c refactor(mcpwm): remove varg action setting functions for timer, compare, and brake events 2025-10-09 16:38:39 +08:00
Mahavir Jain
02af1db1dd Merge branch 'feat(esp-tls)/add_more_server_configurations' into 'master'
feat(esp_tls): supports setting tls version and ciphersuite in server config

Closes IDFGH-16537

See merge request espressif/esp-idf!42323
2025-10-09 13:43:38 +05:30
Chen Chen
8b8b5df141 feat(i2c_slave): Add API to perform slave tx buffer reset
Closes https://github.com/espressif/esp-idf/issues/16241
2025-10-09 16:08:19 +08:00
Wei Yu Han
51d5e8fd08 Merge branch 'docs/update_nimble_pts_info' into 'master'
docs(ble): Updated NimBLE certification info

See merge request espressif/esp-idf!42264
2025-10-09 15:46:05 +08:00
Chen Jichang
d0e24e4a81 refactor(hw_support): remove unused periph_module_t members 2025-10-09 15:27:20 +08:00
C.S.M
068c8ab965 Merge branch 'refactor/temperature_cpp' into 'master'
refactor(temperature_sensor): Make temperature sensor adapt to cpp

Closes IDFGH-16532 and IDF-14190

See merge request espressif/esp-idf!42247
2025-10-09 15:24:52 +08:00
Martin Vychodil
3ce5725282 fix(esp_partition): read-only and encrypted partition support 2025-10-09 09:06:54 +02:00
Martin Vychodil
5c8a10e61e fix(esp_partition): fixes related to BDL update 2025-10-09 09:06:40 +02:00
Mahavir Jain
56098593d9 Merge branch 'fix/http_async_handler_ci_test_failure' into 'master'
fix(http_server): Fix CI test failure async_handler

Closes IDFCI-3119

See merge request espressif/esp-idf!42037
2025-10-09 12:26:05 +05:30
Rahul Tank
26636cebac fix(nimble): Use nimble platform mem malloc / free APIs 2025-10-09 10:37:21 +05:30
Kapil Gupta
092338b78d fix(esp_wifi): Add validation before accessing RSNXE 2025-10-09 09:32:56 +05:30
morris
c76d25edc1 Merge branch 'fix/lwip_rename_task_docs' into 'master'
[lwip]: Mention lwip task name change in migration-docs

See merge request espressif/esp-idf!42346
2025-10-09 10:32:26 +08:00
Fu Hanxi
b207b3320b ci: use merged result commit in build_docker job
also change to shanghai runners
2025-10-08 13:59:18 +02:00
Frantisek Hrbata
a73644800d fix(test_apps): reflect changes in component_deps.dot in the g1_components test
The commit 51f3c021158d ("Add quotes around node ID in dependency
graph") introduced proper quoting for node IDs in the generated dot
file. Since the dot format does not allow dashes in node names without
quoting, and dashes are used in component names, the component names in
the generated dot file are now correctly quoted. Adjust the
g1_components test to accommodate this change by stripping the quotes.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-10-08 19:55:21 +08:00
Vincent-Dalstra
a36c8b8725 fix: Add quotes around node ID in dependency graph
Graphviz node ID's are represented as strings, that can only use a
restricted set of characters (characters, digits, and underscores), and
must not match a reserved keyword. These restrictions do not apply when
the string is wrapped in double quotes. This allows for component names
with dashes in them, for example.

Closes https://github.com/espressif/esp-idf/pull/17594
2025-10-08 19:55:21 +08:00
nilesh.kale
28e332b7fa feat: enable pesudo round functionality for AES in ESP32P4 ECO5 2025-10-08 15:40:25 +05:30
Ondrej Kosta
08e4aba740 Merge branch 'fix/eth_connect' into 'master'
fix(protocol_examples_common): Temporal fix of backwards compatibility

See merge request espressif/esp-idf!42398
2025-10-08 17:06:47 +08:00
Konstantin Kondrashov
caf15b8f66 fix(esp_libc): Fix test_time UTs for newlib nano format
Optimized UTs for newlib nano format (where no support 64 bits print).
(C2 chip with CONFIG_LIBC_NEWLIB_NANO_FORMAT=y)
2025-10-08 12:00:34 +03:00
radek.tandler
b695279ee8 feat(storage): esp_blockdev added to G1 components 2025-10-08 10:18:10 +02:00
Alexey Gerenkov
3316e9d706 Merge branch 'feature/update-esp-clang-to-esp-20.1.1_20250829' into 'master'
feat(tools): update esp-clang version to esp-20.1.1_20250829

See merge request espressif/esp-idf!41728
2025-10-07 21:23:08 +08:00
Roland Dobai
d44fca613c Merge branch 'change/use_esptool_to_list_ports' into 'master'
change(tools): Use esptool to detect available ports

See merge request espressif/esp-idf!42380
2025-10-07 14:32:24 +02:00
Ondrej Kosta
8619f96018 fix(protocol_examples_common): Temporal fix of backwards compatibility 2025-10-07 13:28:45 +02:00
Fu Hanxi
1f69dbf456 ci: populate PIPELINE_COMMIT_SHA in pipeline_variables 2025-10-07 11:18:36 +02:00
Martin Vychodil
4493b39d18 feat(storage): Added Block Device Layer support for esp_partition component 2025-10-07 14:55:36 +08:00
nilesh.kale
873fd18c5a fix: add check to ensure OTA buffer size for 16-byte aligned
This commit added guide to, round off OTA written size to allowed
aignmnet when flash ecnryption enabled.
2025-10-07 11:19:35 +05:30
Martin Vychodil
46def9972a Merge branch 'feature/esp_blockdev_updates' into 'master'
fix(storage): BDL interface comprehensive update

See merge request espressif/esp-idf!42371
2025-10-07 01:27:49 +08:00
Alexey Gerenkov
e1f647906d fix(build): Add missing '-nostartfiles' option in Clang toolchain files 2025-10-06 22:37:41 +08:00
Alexey Gerenkov
8d8d7de672 feat(tools): update esp-clang version to esp-20.1.1_20250829 2025-10-06 22:37:41 +08:00
Martin Vychodil
832b8f8b83 fix(storage): BDL interface comprehensive update
Closes https://github.com/espressif/esp-idf/issues/17654
2025-10-06 15:38:34 +02:00
Laukik Hase
afe8fea489 docs(esp_tee): Enable ESP-TEE documentation for ESP32-C5 2025-10-06 18:49:01 +05:30
Guillaume Souchere
75305c2719 Merge branch 'feat/make-use-of-exec-cap-compile-time-error' into 'master'
feat(heap): Make MALLOC_CAP_EXEC illegal use a compile time error

Closes IDFGH-14014 and IDF-11690

See merge request espressif/esp-idf!34903
2025-10-06 13:34:16 +02:00
Roland Dobai
7832985037 Merge branch 'fix/deprecated-opts-in-lf' into 'master'
fix: Ensure deprecated options are correctly handled in linker fragments

Closes IDF-13571

See merge request espressif/esp-idf!42096
2025-10-06 10:39:26 +02:00
Mahavir Jain
439b1d6d08 cleanup: move cJSON to component manager 2025-10-06 14:08:06 +05:30
Jaroslav Burian
64379596dd change(tools): Use esptool to detect available ports
This changes how available ports are detected. It removes code duplication
for MacOS filtering which already is in esptool and prepares for port
prioritization to be used from esptool.
2025-10-06 09:50:18 +02:00
Rahul Tank
448b5c08a1 Merge branch 'bugfix/fix_os_mbuf_dup' into 'master'
fix(nimble): Address mbuf from different chains traversal during copying

See merge request espressif/esp-idf!41893
2025-10-06 11:53:21 +05:30
David Čermák
9f4a28fc8f Merge branch 'fix/lwip_remove_unused_flags' into 'master'
[lwip]: Removed unused lwip flags

Closes IDF-10227

See merge request espressif/esp-idf!42123
2025-10-05 02:20:24 +08:00
Kevin (Lao Kaiyao)
a3a86438f3 Merge branch 'refactor/clean_up_touch_soc_caps' into 'master'
refactor(touch): clean up touch sensor caps

Closes IDF-13698

See merge request espressif/esp-idf!42149
2025-10-04 16:42:22 +08:00
David Cermak
69baa8f998 fix(lwip): Removed unused lwip flags 2025-10-03 14:41:31 +02:00
Roland Dobai
c613d438da Merge branch 'ci/bump_up_kconfcheck_precommit' into 'master'
ci(pre-commit): bump up kconfcheck pre-commit hook version to 3.2.0

See merge request espressif/esp-idf!42339
2025-10-03 14:24:36 +02:00
Roland Dobai
d6609597aa Merge branch 'fix/missing_version_in_extension_test_files' into 'master'
fix(test_idf_py): Added extension API version into test extensions files

See merge request espressif/esp-idf!42354
2025-10-03 14:15:12 +02:00
Fu Hanxi
a322abb127 Merge branch 'ci/fix-windows-test-download-map-prefix' into 'master'
ci: fix windows test jobs download source

See merge request espressif/esp-idf!42361
2025-10-03 14:12:26 +02:00
Fu Hanxi
31431069d4 ci: fix windows test jobs download source 2025-10-03 12:47:01 +02:00
Rahul Tank
39fe3d5037 fix(nimble): Address mbuf from different chains traversal during copying 2025-10-03 15:16:02 +05:30
Ashish Sharma
62f852a93b feat(esp_tls): supports setting tls version and ciphersuite in server config
Closes https://github.com/espressif/esp-idf/issues/17660
2025-10-03 15:19:41 +08:00
Rahul Tank
f8935f87e7 Merge branch 'bugfix/update_hci_log_datalen' into 'master'
fix(nimble): update HCI log functions to use uint16_t for data length

See merge request espressif/esp-idf!42013
2025-10-03 11:43:32 +05:30
laokaiyao
cc949123ee refactor(touch): clean up touch sensor caps 2025-10-03 13:39:11 +08:00
igor.masar
c74ce1c201 feat(usb/h4): Add USB OTG host support for ESP32-H4
- hal: add DWC OTG core LL (usb_dwc_ll.h) and USB wrap LL (usb_wrap_ll.h)
- soc: add DWC register map/cfg (usb_dwc_struct.h, usb_dwc_cfg.h) and caps
- soc/kconfig: enable SOC_USB_OTG_SUPPORTED=1, SOC_USB_OTG_PERIPH_NUM=1
- docs: add ESP32-H4 to usb_phy test app “Supported Targets”
- ld: export USB_WRAP symbol
- doxygen: include USB Host headers for H4 to emit .inc files
2025-10-02 23:21:08 +02:00
Roland Dobai
eff16d4981 Merge branch 'fix/small-limit-for-kconfserver' into 'master'
fix: allow larger buffer size for commands (especially for idf.py confserver)

Closes IDFCI-3569 and IDF-13919

See merge request espressif/esp-idf!42312
2025-10-02 18:52:03 +02:00
David Čermák
44767e48f9 Merge branch 'feat/dhcps_support_hostname_per_client_cleanup' into 'master'
fix(esp_netif): Simplify reporting clients hostname

See merge request espressif/esp-idf!42233
2025-10-02 23:33:30 +08:00
Marek Fiala
854f6b0a3e fix(test_idf_py): Added extension API version into test extensions files 2025-10-02 15:37:29 +02:00
Marek Fiala
248c3a996e change(test_idf_py): ruff formatting idf_ext.py & some_ext.py 2025-10-02 15:34:31 +02:00
Radek Tandler
207199a2bb Merge branch 'refactor/nvs_header_cleanup' into 'master'
Cleanup of NVS copyright notices, header pragma once and NVS related constants

See merge request espressif/esp-idf!42353
2025-10-02 15:08:45 +02:00
Radek Tandler
69d20790b7 Merge branch 'bugfix/storage_nvs_tool_keys' into 'master'
Bugfix/storage nvs tool keys

See merge request espressif/esp-idf!37068
2025-10-02 14:38:46 +02:00
Jan Beran
b51329bdb1 fix: set sufficient buffer limit for idf.py confserver 2025-10-02 13:19:30 +02:00
radek.tandler
801091c079 refactor(nvs_flash): NVS constants were consolidated
- Constant definitions depending on spi_flash were added to nvs_constants
2025-10-02 12:39:37 +02:00
radek.tandler
a11c30a3e3 refactor(nvs_flash): Adjusted copyright notices and header file pragma once 2025-10-02 12:35:50 +02:00
Samuel Obuch
66de4ef8ca fix(esp_rom): correct typos defalut -> default 2025-10-02 17:41:40 +08:00
David Cermak
35b47648e0 fix(esp_netif): Simplify reporting clients hostname 2025-10-02 16:58:15 +08:00
David Čermák
9063a6c279 Merge branch 'feat/lwip_netif_callbacks' into 'master'
[lwip]: Add support for netif link callback

Closes IDFGH-16317

See merge request espressif/esp-idf!42097
2025-10-02 12:37:37 +08:00
radek.tandler
1c6e2d2f88 fix(nvs_flash): Parsing NVS partition containing non ASCII keys 2025-10-02 05:59:14 +02:00
Kevin (Lao Kaiyao)
726a4304d6 Merge branch 'refactor/clean_up_some_soc_caps' into 'master'
refactor(i2s): clean up i2s soc caps

Closes IDF-13685 and IDF-10014

See merge request espressif/esp-idf!41944
2025-10-02 03:21:33 +08:00
laokaiyao
fec96035be refactor(i2s): replace the enum i2s_port_t with int type 2025-10-01 21:53:55 +08:00
laokaiyao
91a6387005 refactor(i2s): clean up i2s soc caps 2025-10-01 21:51:58 +08:00
David Cermak
4e82073310 fix(docs): Mention lwip task name change in migration-docs 2025-10-01 21:00:56 +08:00
David Čermák
31602cbe66 Merge branch 'fix/lwip_rename_task' into 'master'
[lwip]: Rename TCPIP_THREAD_NAME "tiT" -> "tcpip" (GitHub PR)

Closes IDFGH-12516

See merge request espressif/esp-idf!41915
2025-10-01 21:00:48 +08:00
Roland Dobai
18d6b53195 Merge branch 'fix/dont-regenerate-unnecessary-config-files' into 'master'
fix(kconfig.cmake): Do not regenerate unnecessary config files

Closes IDF-14220

See merge request espressif/esp-idf!42231
2025-10-01 14:52:04 +02:00
Peter Marcisovsky
4dc77d1976 Merge branch 'refactor/usb_host_remove_usb_component' into 'master'
Refactor/usb host remove usb component

Closes IDF-14022

See merge request espressif/esp-idf!41690
2025-10-01 12:59:06 +02:00
Rahul Tank
7a876031e1 Merge branch 'bugfix/re_organize_nimble_kconfig' into 'master'
fix(nimble): Declutter the nimble menu config options

Closes BLERP-2227

See merge request espressif/esp-idf!41829
2025-10-01 16:28:31 +05:30
David Cermak
16b02aeb7a feat(lwip): Add support for netif link callback 2025-10-01 17:58:47 +08:00
Shreeyash
222e62ae3e fix(nimble): update HCI log functions to use uint16_t for data length 2025-10-01 15:23:08 +05:30
Alexey Lapshin
8939bdad63 Merge branch 'feature/update-toolchain-to-esp-15.2.0_20250929' into 'master'
feat(tools): update toolchain version to esp-15.2.0_20250929

See merge request espressif/esp-idf!42271
2025-10-01 11:43:58 +04:00
Guillaume Souchere
7a24a8aef6 Merge branch 'fix/console-coverity-findings' into 'master'
fix(console): Remove dead code findings from coverity

Closes IDF-13098 and IDF-13134

See merge request espressif/esp-idf!42324
2025-10-01 08:39:12 +02:00
Peter Dragun
800f141f94 Merge branch 'feat/esptool_v5' into 'master'
Update esptool to v5: replace deprecated commands, documentation updates and cleanup

Closes IDF-12564

See merge request espressif/esp-idf!41176
2025-10-01 14:36:26 +08:00
Nebojša Cvetković
8760e3f38f feat(lwip): TCPIP_THREAD_NAME "tcpip" 2025-10-01 14:07:18 +08:00
Rahul Tank
9ba0b373bd Merge branch 'bugfix/fix_ext_adv_data_reattempt' into 'master'
fix(nimble): Avoid ext adv data in reattempt advertising

Closes BLERP-2234

See merge request espressif/esp-idf!41789
2025-10-01 09:32:41 +05:30
Alexey Lapshin
2df79c2671 feat(tools): update toolchain version to esp-15.2.0_20250929 2025-10-01 10:36:31 +08:00
morris
310870784b Merge branch 'fix/mcpwm_prescale_regression' into 'master'
fix(mcpwm): fix division by zero error in prescale

Closes IDFGH-16544

See merge request espressif/esp-idf!42322
2025-10-01 08:10:47 +08:00
David Čermák
5c7a237161 Merge branch 'fix/lwip_port_consistent_alloc' into 'master'
[lwip]: Make lwip alloc/free consistend in port layer

Closes IDFGH-10271

See merge request espressif/esp-idf!42081
2025-10-01 05:39:02 +08:00
morris
22a0f9aecb Merge branch 'refactor/remove_driver_dependency' into 'master'
refator(driver): remove unnecessary driver dependencies

Closes IDF-11475

See merge request espressif/esp-idf!41747
2025-10-01 03:09:57 +08:00
Kapil Gupta
04174c4928 Merge branch 'bugfix/concurrency_issue_roam_app' into 'master'
fix(esp_wifi): Add some fixes in roaming app

See merge request espressif/esp-idf!42262
2025-09-30 23:25:48 +05:30
Konstantin Kondrashov
a249714f3b Merge branch 'fix/esp_efuse_enable_rom_secure_download_mode' into 'master'
fix(efuse): Fix enabling ROM secure download mode

See merge request espressif/esp-idf!41541
2025-10-01 01:38:16 +08:00
Mahavir Jain
b9cf9ea31f Merge branch 'fix/mmu_psram_anti_fi' into 'master'
fix(security): add anti-FI checks while setting up PSRAM encryption

Closes IDF-13761

See merge request espressif/esp-idf!41750
2025-09-30 21:18:01 +05:30
Peter Dragun
4c53f42dc7 fix: Execute esptool scripts in interactive mode
The new version of esptool has a quite interactive output that supports
folding steps and overriding progress bar. Using interactive mode to run
esptool scripts will make the output propagate to the terminal immediately.
2025-09-30 15:28:55 +02:00
Peter Dragun
9eb07f92ba docs: Update unify and update espefuse command outputs 2025-09-30 15:28:55 +02:00
Peter Dragun
1ce7513222 change: Accept --fill-flash-size in merge-bin as deprecated option 2025-09-30 15:28:55 +02:00
Peter Dragun
b22d45146f change: Remove esptool.py deprecated warnings from ignore_build_warnings.txt 2025-09-30 15:28:55 +02:00
Peter Dragun
e3198fff3c feat: Update esptool to v5 2025-09-30 15:28:55 +02:00
Jan Beran
94c59a9755 fix: Ensure deprecated options are correctly handled in linker fragments 2025-09-30 14:55:54 +02:00
Jan Beran
f7e1c5ec6c ci(pre-commit): bump up kconfcheck pre-commit hook version to 3.2.0 2025-09-30 14:40:18 +02:00
Sonika Rathi
053fb47e78 Merge branch 'fix/esp_partition_api_with_error_reporting' into 'master'
feat(esp_partition): add error-returning variants for partition find APIs

Closes IDFGH-7740

See merge request espressif/esp-idf!42089
2025-09-30 18:11:54 +08:00
Rahul Tank
303d9b0624 fix(nimble): Declutter the nimble menu config options 2025-09-30 14:38:31 +05:30
David Cermak
d744d16fb0 fix(lwip): Make lwip alloc/free consistend in port layer
Merges https://github.com/espressif/esp-idf/pull/11534
2025-09-30 17:07:44 +08:00
Ashish Sharma
59f5bb4540 Merge branch 'contrib/github_pr_17652' into 'master'
fix(esp_tls_conn_new_sync): Fix `esp_tls_conn_new_sync`'s doc to reflect its implementation (GitHub PR)

Closes IDFGH-16528 and IDFGH-16475

See merge request espressif/esp-idf!42263
2025-09-30 16:46:37 +08:00
Chen Chen
a4710cc206 refactor(driver): remove redundant driver dependencies
now the driver component only contains legacy code for i2c, twai and
touch sensor
2025-09-30 15:47:45 +08:00
Roland Dobai
af1ceb322f Merge branch 'feat/remove_legacy_esp_size' into 'master'
Tools/esp-idf-size: Remove --legacy argument and replace JSON format with JSON2

Closes IDF-8772 and DOC-12437

See merge request espressif/esp-idf!41743
2025-09-30 09:47:44 +02:00
Guillaume Souchere
b6b7337f5b fix(console): Remove dead code findings from coverity 2025-09-30 09:31:34 +02:00
C.S.M
a417158514 Merge branch 'feat/mspi_suspend_p4_eco5' into 'master'
feat(spi_flash): Support flash suspend on esp32p4 resivion 3

Closes IDF-13511

See merge request espressif/esp-idf!42104
2025-09-30 15:14:09 +08:00
Konstantin Kondrashov
be280d3431 fix(efuse): Fix enabling ROM secure download mode 2025-09-30 15:08:27 +08:00
C.S.M
023981bebf refactor(temperature_sensor): Make temperature sensor adapt to cpp,
Closes https://github.com/espressif/esp-idf/issues/17656
2025-09-30 14:57:54 +08:00
Laukik Hase
466c1d66b6 refactor(esp_tee): Remove the spi_flash_erase_chip service call
- Also fix coverity bug from TEE HMAC-PBKDF2 routine
2025-09-30 12:22:26 +05:30
Laukik Hase
8b92f3603f fix(esp_tee): Correct flash operation bound checks to handle all overlap cases
- Ensure bound checks correctly handle all scenarios, including
  when a requested operation's (SPI0/1) range fully contains the
  TEE-protected region.
- Disable delegation of INTWDT timeout and Cache error interrupts as they reset
  the device after the panic handler
2025-09-30 12:22:25 +05:30
Peter Marcisovsky
19cc026b0c Merge branch 'feat/usb_host_suspend_status_hal_check' into 'master'
feat(usb_host): Add hal check for the global root port suspend

See merge request espressif/esp-idf!42098
2025-09-30 08:50:05 +02:00
cjin
9c3bcab65c fix: change the api to enable rc32k on ESP32-H2 2025-09-30 14:18:30 +08:00
Kapil Gupta
cf65928773 fix(esp_wifi): Cancel roaming_app_periodic_scan_internal_handler correctly 2025-09-30 14:18:29 +08:00
Kapil Gupta
a75a3710c4 fix(esp_wifi): Add some fixes in roaming app 2025-09-30 14:18:29 +08:00
Harshal Patil
f088a128ac Merge branch 'test/set_minimal_build_for_security_test_apps' into 'master'
test(security): Use minimal build in the security test apps

Closes IDF-14203

See merge request espressif/esp-idf!42292
2025-09-30 11:38:21 +05:30
Mahavir Jain
343fd79462 Merge branch 'fix/allow_pre_programmed_efuse_pseudo_round_level_when_set_release_mode' into 'master'
Allow pre-programmed XTS-AES psuedo round level efuses

See merge request espressif/esp-idf!42041
2025-09-30 11:09:43 +05:30
harshal.patil
1d4a634b98 test(security): Use minimal build in the security test apps 2025-09-30 10:52:03 +05:30
Mahavir Jain
ad059d385b fix(security): add anti-FI checks while setting up PSRAM encryption 2025-09-30 10:22:53 +05:30
Jiang Jiang Jian
729be4656b Merge branch 'fix/increase_c5_pau_work_time' into 'master'
fix(esp_hw_support): increase esp32c5 wifi link working cost

See merge request espressif/esp-idf!41620
2025-09-30 12:44:01 +08:00
Meet Patel
0f776d31ae Merge branch 'feature/ulp_riscv_pulse_counter_example' into 'master'
feat(ulp_riscv): Add pulse counter example code for ulp riscv

Closes IDF-14106

See merge request espressif/esp-idf!42107
2025-09-30 10:13:21 +05:30
Chen Jichang
0c95b8c267 fix(mcpwm): fix division by zero error in prescale
Closes https://github.com/espressif/esp-idf/issues/17665
2025-09-30 12:21:33 +08:00
Jiang Jiang Jian
7bd0eeff5e Merge branch 'fix/controll_dcdc_switch_by_pmu_in_dslp' into 'master'
fix(esp_hw_support): control DCDC switch by PMU FSM while control DCDC_EN by software

See merge request espressif/esp-idf!41310
2025-09-30 11:50:55 +08:00
Jiang Jiang Jian
b23594125b Merge branch 'bugfix/fix_regdomain_information_of_pk_incorrect' into 'master'
fix(wifi): fix regdomain information of PK is incorrect

See merge request espressif/esp-idf!42001
2025-09-30 11:50:49 +08:00
Chen Ji Chang
01a27c8a70 Merge branch 'feat/rmt_support_psram' into 'master'
feat(rmt): support receive buffer to psram

Closes IDF-8997

See merge request espressif/esp-idf!41327
2025-09-30 11:03:22 +08:00
Jared Pon
2b42a6aa2b fix(esp_tls_conn_new_sync): Fix esp_tls_conn_new_sync's doc to reflect its implementation
Closes https://github.com/espressif/esp-idf/pull/17652
Closes https://github.com/espressif/esp-idf/issues/17598
2025-09-30 10:02:20 +08:00
Jiang Jiang Jian
b7deee951e Merge branch 'feat/ft_with_sae' into 'master'
Add FT with SAE feature for station

See merge request espressif/esp-idf!39994
2025-09-30 10:01:21 +08:00
Samuel Obuch
b5ba537bcd Merge branch 'feat/esp32h4_unicore_stop_other_core' into 'master'
feat(esp_system): stop other core for unicore esp32h4

See merge request espressif/esp-idf!41640
2025-09-30 04:12:34 +08:00
Roland Dobai
e0d86d8e8c Merge branch 'fix/component_validation' into 'master'
Build & config: correct component targets property name in validation

See merge request espressif/esp-idf!42170
2025-09-29 21:57:23 +02:00
Wan Lei
7a2f6a8254 Merge branch 'fix/twai_hid_provider_word_ctu' into 'master'
fix(driver_twai): hide the provider keyword ctu in idf

See merge request espressif/esp-idf!42142
2025-09-30 00:58:32 +08:00
peter.marcisovsky
b3bb053160 refactor(usb_host): Remove usb component form esp-idf
- usb component was relocated from esp-idf to esp-usb
    - the component is now a managed component
2025-09-29 17:15:17 +02:00
Roland Dobai
52f7cebcd3 ci: Support known failure cases in pytests on Windows runners 2025-09-29 15:38:43 +02:00
Roland Dobai
bc01141098 fix(cmake): correct component targets property name in validation
The component validation script was using an incorrect property name
'__COMPONENT_TARGETS' when retrieving component targets. This should be
'__BUILD_COMPONENT_TARGETS' to match the actual property name used
throughout the build system.

This fix ensures the component validation can properly access the list
of component targets and perform validation checks correctly.
2025-09-29 15:37:54 +02:00
Abhik Roy
57013ba404 Merge branch 'lwip/dhcps_add_dns_remove' into 'master'
feat(lwip): Remove deprecated LWIP_DHCPS_ADD_DNS Kconfig option

Closes IDF-11334 and DOC-12462

See merge request espressif/esp-idf!42119
2025-09-29 21:26:01 +08:00
Abhik Roy
d574382d7b feat(lwip): Remove deprecated LWIP_DHCPS_ADD_DNS Kconfig option 2025-09-29 21:26:01 +08:00
tarun.kumar
324337369d feat(wifi) : Add FT with SAE feature 2025-09-29 18:40:47 +05:30
sonika.rathi
5b65634b49 feat(esp_partition): add error-returning variants for partition find APIs
Add esp_partition_find_err() and esp_partition_find_first_err() to provide
error reporting while maintaining backward compatibility.

Closes https://github.com/espressif/esp-idf/issues/9281
2025-09-29 15:00:41 +02:00
Song Ruo Jing
f1e6e66fb5 Merge branch 'bugfix/usb_dp_pin_unusable_after_cpu_reset' into 'master'
fix(gpio): fix USB DP pin unusable after CPU reset for S3/C3

Closes IDFGH-16345

See merge request espressif/esp-idf!41694
2025-09-29 20:10:53 +08:00
Alexey Lapshin
e0b693493e Merge branch 'feature/enable_zc_extensions_for_esp32p4' into 'master'
feat(tools): enable zc* extensions for esp32p4 revision >= 3.0

See merge request espressif/esp-idf!42166
2025-09-29 15:57:47 +04:00
Rocha Euripedes
050de89fa7 Merge branch 'removes_mqtt_host_test' into 'master'
ci: Removes esp-mqtt host test

See merge request espressif/esp-idf!42285
2025-09-29 19:51:45 +08:00
Fu Hanxi
1cf5d3115b ci: print with color 2025-09-29 13:22:46 +02:00
Fu Hanxi
3175db5346 ci: move extra targets need to be built by default to --additional-build-targets 2025-09-29 13:22:42 +02:00
Lv Xin Yue
508618432b Merge branch 'docs/improve_camera_controller' into 'master'
update camera driver document

See merge request espressif/esp-idf!42102
2025-09-29 17:15:06 +08:00
Euripedes Rocha Filho
a87d3e1040 ci: Removes esp-mqtt host test
Test is failing and was moves to esp-mqtt already
2025-09-29 10:05:12 +02:00
Jan Beran
f7393ab305 fix(kconfig.cmake): Do not regenerate unnecessary config files 2025-09-29 10:03:47 +02:00
yinqingzhao
2826580a2d fix(wifi): fix pre_commit issue of reg_parse.py 2025-09-29 14:52:59 +08:00
yinqingzhao
76d43feca4 fix(wifi): fix country code PK miss 2.4G permission 2025-09-29 14:52:59 +08:00
wuzhenghui
464392bfc3 fix(esp_hw_support): increase esp32c5 wifi link working cost 2025-09-29 14:37:52 +08:00
Kevin (Lao Kaiyao)
9ef6d3eac4 Merge branch 'bugfix/fixed_possible_i2s_failure_on_p4' into 'master'
ci(i2s): fixed occationally failure on P4

Closes IDFCI-3185, IDFCI-3186, IDFCI-3191, IDFCI-3192, IDFCI-3193, IDFCI-3194, IDFCI-3195, IDFCI-3196, IDFCI-3197, IDFCI-3198, IDFCI-3199, IDFCI-3200, IDFCI-3201, IDFCI-3202, IDFCI-3203, IDFCI-3204, IDFCI-3205, IDFCI-3206, IDFCI-3207, and IDFCI-3208

See merge request espressif/esp-idf!42229
2025-09-29 14:24:25 +08:00
zhanghaipeng
7ce921ed95 fix(ble/bluedroid): Fixed resolve adv data crash if host deinitialized or disabled 2025-09-29 11:57:30 +08:00
Mahavir Jain
5cf6b6d36d Merge branch 'contrib/github_pr_17582' into 'master'
fix(mbedtls): prevent vectorization fault in clang O2 optimization (GitHub PR)

Closes IDFGH-16450

See merge request espressif/esp-idf!41973
2025-09-29 09:19:05 +05:30
hebinglin
f4bc3c72f0 feat(esp_hw_support): support psram during sleep for esp32h4 2025-09-29 11:41:54 +08:00
Kevin (Lao Kaiyao)
b8a0d88a68 Merge branch 'doc/fix_i2s_es8311_ffmpeg_instruction' into 'master'
docs(i2s_es8311): fixed ffmpeg instruction in README

Closes IDFGH-16529

See merge request espressif/esp-idf!42260
2025-09-29 11:17:31 +08:00
Lv Xin Yue
e559d93da3 update camera driver document 2025-09-29 11:17:16 +08:00
morris
a15ab238fb Merge branch 'feat/mipi_dsi_vsync_event' into 'master'
feat(dsi): add vsync interrupt handling

Closes IDF-13503

See merge request espressif/esp-idf!42163
2025-09-29 10:54:58 +08:00
Guillaume Souchere
0f3f44be62 feat(heap): Add hidden Kconfig option to allow exec cap 2025-09-29 10:45:33 +08:00
Guillaume Souchere
da9d8a143a feat(heap): Report prohibited usage of MALLOC_CAPS_EXEC at compile time
Add a condition on the definition of the MALLOC_CAP_EXEC macro to
prevent it from being defined if ESP_SYSTEM_MEMPROT_FEATURE or
ESP_SYSTEM_PMP_IDRAM_SPLIT is enabled, thus throwing a compile time
error when using it.

Closes https://github.com/espressif/esp-idf/issues/14837
2025-09-29 10:45:32 +08:00
Ondrej Kosta
61aaaf3a8b Merge branch 'feat/remove_eth_drivers' into 'master'
Feat/remove eth drivers

Closes IDF-13553 and IDF-5865

See merge request espressif/esp-idf!42021
2025-09-29 10:14:42 +08:00
wuzhenghui
198e789ea2 change(esp_hw_support): remove DCDC-to-LDO power switch support in ESP32P4 lightsleep 2025-09-29 10:07:20 +08:00
wuzhenghui
be88f84bcc change(esp_hw_support): control DCDC switch by PMU FSM while control DCDC_EN by software 2025-09-29 10:07:20 +08:00
Jiang Jiang Jian
a44c3d444d Merge branch 'bugfix/ndp_wait_events_issue' into 'master'
fix(esp_wifi): Fix false wait events during NAN datapath setup

Closes WIFIBUG-1170 and WIFIBUG-1171

See merge request espressif/esp-idf!39151
2025-09-29 10:07:06 +08:00
Wei Yuhan
661ca1abf2 docs(ble): Updated NimBLE certification info 2025-09-29 10:06:03 +08:00
Jin Cheng
3fa9d23ad2 fix(bt/controller): fixed several controller bugs 2025-09-29 09:59:42 +08:00
Marius Vikhammer
6efd36f475 Merge branch 'feature/gcc_error_on_default_warnings_disable_final' into 'master'
feat(build): Default warnings to be considered as errors

Closes IDF-9675

See merge request espressif/esp-idf!42184
2025-09-29 09:19:56 +08:00
Adam Múdry
94083867a7 Merge branch 'refactor/fatfs_vfs_functions' into 'master'
fix(storage): Refactor FATFS VFS functions to be easier to understand

Closes IDF-14044

See merge request espressif/esp-idf!41679
2025-09-28 22:54:49 +02:00
Zhang Shuxian
4aaf5a1c29 docs: Update CN translation 2025-09-29 01:54:38 +08:00
Marek Fiala
56fa45c741 revert(tools): Removed --legacy option for esp-idf-size 2025-09-29 01:54:38 +08:00
Marek Fiala
8f4c52a358 change(tools): ruff formatting core_ext.py 2025-09-29 01:54:38 +08:00
Nachiket Kukade
5c73eef918 fix(esp_wifi): Partially revert NAN event API change from b0498569c8 2025-09-28 22:58:28 +05:30
Nachiket Kukade
783b80f9d5 fix(esp_wifi): NAN improvements and bugfixes
- Add NDP Peer inactivity detection and termination support
- Add NDP Action frames internal retries
- Fix NAN API return status to match with Tx status
- Fix false wait events during NAN datapath setup
- Replace NAN default event handlers with callbacks to
  avoid race conditions between wifi and user tasks
- Fix parsing Availability of third party devices

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

Co-authored-by: akshat <akshat.agrawal@espressif.com>
2025-09-28 22:58:22 +05:30
Kapil Gupta
e8f75f97b0 Merge branch 'feat/roaming_app_blacklist' into 'master'
fix(esp_wifi): Add blacklist logic in roaming app

Closes WIFIBUG-1219, WIFIBUG-1208, WIFIBUG-1109, WIFIBUG-1203, and WIFIBUG-1428

See merge request espressif/esp-idf!40802
2025-09-28 21:44:31 +05:30
Jiang Jiang Jian
37322d4a61 Merge branch 'feat/add_154_status_for_coex' into 'master'
feat(coex): add 802.15.4 status for coex

See merge request espressif/esp-idf!41627
2025-09-28 23:01:01 +08:00
C.S.M
3e4e6918fd Merge branch 'refactor/make_mspi_hal_independent' into 'master'
refactor(mspi): Make mspi hal layer independent

See merge request espressif/esp-idf!42035
2025-09-28 22:23:59 +08:00
Ondrej Kosta
d622d4d9ac feat(esp_eth): removed SPI Ethernet and PHY drivers from IDF 2025-09-28 16:19:42 +02:00
morris
f54c09e81e Merge branch 'feat/esp_hal_timg' into 'master'
feat(timg): graduate the hal driver into a single component

Closes IDF-14095

See merge request espressif/esp-idf!42202
2025-09-28 21:26:37 +08:00
laokaiyao
8ac2f4cc45 docs(i2s_es8311): fixed ffmpeg instruction in README
Closes https://github.com/espressif/esp-idf/issues/17653
2025-09-28 20:03:43 +08:00
Island
33321e59b1 Merge branch 'opt/opt_ble_log' into 'master'
feat(ble/bluedroid): Added BLE debug LOG for bluedroid

Closes BLERP-2258

See merge request espressif/esp-idf!41567
2025-09-28 19:18:03 +08:00
Xu Si Yu
036aedad6a feat(coex): add 802.15.4 status for coex 2025-09-28 18:44:10 +08:00
yangfeng
743036ad77 fix(bt/bluedroid): Fix the boundary conditions when checking EIR data 2025-09-28 17:50:48 +08:00
Jiang Jiang Jian
bdda8300d4 Merge branch 'bugfix/dont_use_flexible_arr_in_union' into 'master'
fix(bluedroid): removed the code relying on compiler-specific extension for FAM in union

Closes BT-4126

See merge request espressif/esp-idf!42236
2025-09-28 17:40:22 +08:00
laokaiyao
37ed3e0904 ci(i2s): fixed occationally failure on P4
read write case can sometimes failed due to the low frequency of the default I2S clock source on P4.
2025-09-28 17:13:16 +08:00
Jiang Jiang Jian
b2335ebe74 Merge branch 'fix/ci_add_supp_for_h2' into 'master'
Add supp for esp32h2 in softAP and station examples

See merge request espressif/esp-idf!41246
2025-09-28 17:09:27 +08:00
Wang Meng Yang
c4a2511659 Merge branch 'bugfix/enter_sniff_failed' into 'master'
fix(bt/controller): fixed the sniff anchor point can be mismatch from central and peripheral

Closes BTQABR2023-553

See merge request espressif/esp-idf!42240
2025-09-28 16:59:45 +08:00
Jiang Jiang Jian
44736c8bd2 Merge branch 'bugfix/sae_identifier_nvs' into 'master'
fix(esp_wifi): Set default nvs value for sae identifier to NULL

See merge request espressif/esp-idf!42047
2025-09-28 16:37:06 +08:00
C.S.M
f022b67486 feat(spi_flash): Support flash suspend on esp32p4 resivion 3 2025-09-28 16:25:28 +08:00
linruihao
8104d4578f fix(bt): fix btbb may not reinit when coex with wifi
Closes https://github.com/espressif/esp-idf/issues/15841
2025-09-28 15:56:55 +08:00
linruihao
8713de3b57 fix(bt/bluedroid): fix hfp ag external codec datapath issue
Closes https://github.com/espressif/esp-idf/issues/17480
2025-09-28 15:56:55 +08:00
Armando (Dou Yiwen)
53f96d8595 Merge branch 'feat/p4_rev3_isp_awb_wbg' into 'master'
isp: awb white balance gain feature and subwindow feature support on P4 ECO5

Closes IDF-13936

See merge request espressif/esp-idf!41858
2025-09-28 07:53:48 +00:00
wanckl
cee541614e fix(driver_twai): update twaifd register description 2025-09-28 14:45:27 +08:00
gaoxu
85144da53e refactor(rng): refactor to use hal/ll apis for C3 2025-09-28 14:34:30 +08:00
Jiang Jiang Jian
2812a4e745 Merge branch 'bugfix/fix_pm_offchan_execute_ready_cb_miss_issue' into 'master'
fix(wifi): fix pm offchan execute ready cb miss issue

Closes WIFI-7020

See merge request espressif/esp-idf!42154
2025-09-28 13:53:26 +08:00
Shreyas Sheth
0b0b38ea4c fix(esp_wifi): Set default nvs value for sae identifier to NULL
Resolves regression introduced in 6f7cf98ffe
which may impact WPA3 station connection in certain conditions
2025-09-28 10:37:19 +05:30
Zhang Shu Xian
f305d69ba1 Merge branch 'docs/correct_wrong_description_in_secure_boot_v2' into 'master'
docs: Correct wrong description in secure-boot-v2.rst

Closes DOC-12271

See merge request espressif/esp-idf!42090
2025-09-28 12:13:43 +08:00
tarun.kumar
fdda62267e fix(wifi) : Resetting current bssid for every roaming connection intiated
- Bssid reset after btm or legacy roam
     - Making few changes in CMake for wpa_supplicant and esp_wifi
2025-09-28 11:53:01 +08:00
Kapil Gupta
0f3034586b fix(esp_wifi): Address some review comments and issues 2025-09-28 11:53:01 +08:00
Kapil Gupta
7d18b82575 feat(roaming): ignore WPA2-only APs on transition disable
This commit introduces a new feature to the roaming logic. If the
currently connected AP has the 'transition disable' bit set in its
RSN IE, the roaming logic will now ignore any scanned APs that only
support WPA2-PSK. This prevents a security downgrade when roaming in a
mixed WPA2/WPA3 environment.

A new Kconfig option, CONFIG_ESP_WIFI_IGNORE_WPA2_ONLY_ON_TRANSITION_DISABLE,
has been added to control this feature. It is disabled by default.
2025-09-28 11:53:01 +08:00
Kapil Gupta
074b2d0f93 fix(roaming_app): resolve issues in blacklisting logic
This commit addresses several issues in the BSSID blacklisting
feature of the roaming application:

- Merged duplicate  functions into a single,
  unified function, resolving a compilation error.
- Corrected  and
  to properly access the  member of the
  struct, fixing invalid memory access.
- Introduced  in Kconfig to enable
  the manual blacklisting feature and made auto-blacklisting
  dependent on it.
- Updated  to use the
  correct BSSID from .
- Optimized the removal of expired blacklist entries by using
   for better efficiency.
2025-09-28 11:53:01 +08:00
Kapil Gupta
a7d2066913 fix(esp_wifi): Add blacklist logic in roaming app 2025-09-28 11:53:01 +08:00
Song Ruo Jing
15c5178d5a fix(gpio): fix USB DP pin unusable after CPU reset for S3/C3
Closes https://github.com/espressif/esp-idf/issues/17488
2025-09-28 11:45:37 +08:00
Shreyas Sheth
28219461ee fix(esp_wifi): Resolve comments for wpa3_compat mode documentation 2025-09-28 09:10:50 +05:30
Shreyas Sheth
1753f5ee63 fix(esp_wifi): Resolve some comments for wpa3_compatible_mode support 2025-09-28 09:10:42 +05:30
Shreyas Sheth
3eca66cc0d fix(esp_wifi): Resolve comments for wpa3_compatible_mode 2025-09-28 09:10:30 +05:30
Shreyas Sheth
a7f32f5a2a feat(esp_wifi): Add compile flag for wpa3 compatible mode 2025-09-28 09:10:29 +05:30
Shreyas Sheth
1b33c9daae fix(esp_wifi): Resolve comments for wpa3 compatible mode 2025-09-28 09:10:29 +05:30
Shreyas Sheth
fbfa3aa0e0 feat(esp_wifi): Add support of wpa3 compatible more for ap and sta 2025-09-28 09:10:29 +05:30
Sai Pratyusha Magam
e8a19841f4 RSNO: Generate IGTK if any of the RSN variants has PMF enabled
With RSN overriding enabled, AP can be configured to set MFPC to 0 and
MFPR to 0 in the RSNE and MFPC to 1 and MFPR to 1 in the RSNOE and
RSNO2E. IGTK generation, configuration to the driver, and inclusion of
the IGTK KDE in 4-way handshake should also take into account the
management frame protection settings in the override variants.

Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
c3d6a1ce73 Avoid undefined behavior in RSNXE capability bit checker
Integer promotion converts u8 rsnxe[i] to an int which is not
sufficiently large to be able to handle the maximum shift left of 24
bits here. Type cast rsnxe[i] to u32 explicitly to get rid of the sign
bit and avoid this undefined behavior from the shift operation.

Credit to OSS-Fuzz: https://issues.oss-fuzz.com/issues/376786400
Fixes: d675d3b15b40 ("Add helper functions for parsing RSNXE capabilities")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
22a15585fd RSNO: Omit RSNXE in (Re)Association Response frame like in Beacon frame
When rsn_override_omit_rsnxe=1 is used to omit the RSNXE from Beacon and
Probe Response frames, it should also be omitted from (Re)Association
Response frames since there is a general expectation on the RSNXE being
used consistently between these frames. This is unlikely to have much of
a difference for most use cases in practice, but this could impact FILS
association if the non-AP STA were to confirm that the unprotected and
protected version of the RSNXE from the AP were identical.

Fixes: 8b2ddfdbb688 ("RSNO: Allow RSNXE to be omitted")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Veerendranath Jakkam
1848be2f06 RSNO: Always enable SNonce cookie and RSN Override elements validation
Always set SNonce cookie and enable RSN Override elements validation
irrespective of the RSN Selection element usage in (Re)Association
Request frame when RSN overriding supported.

Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
5e1e2cd4ea RSNO: Do not enforce SNonce cookie and RSN Selection match if RSNO not used
A STA that supports RSN overriding will always use the SNonce cookie. An
AP that does not advertise RSN overriding elements must not enforce that
SNonce cookie is used with RSN Selection element since a STA includes
the latter only when it sees the AP advertising RSN overriding elements.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Veerendranath Jakkam
60643b71e7 RSNO: Add debug prints for RSN override elements in EAPOL frames
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
2025-09-28 09:10:29 +05:30
Shreyas Sheth
35e73c0147 fix(esp_wifi): Cosmetic changes for wpa_supplicant 2025-09-28 09:10:29 +05:30
Jouni Malinen
f7e886bfed RSNO: Include all RSNE/RSNXE variants in EAPOL-Key message 3/4
This allows all variants to be verified based on a protected frame to
achieve robust downgrade protection.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
8b8d5ebfc9 RSNO: Use SNonce cookie to indicate support for RSN overriding
This provides an implicitly protected (SNonce is used as an input to PTK
derivation) mechanism for a STA to indicate support for RSN overriding
in a manner that does not cause interopability issues with deployed APs.

In addition, update sm->SNonce on the Authenticator only based on
message 2/4 since that is the only EAPOL-Key message that is defined to
provide the actual SNonce value. While clearing of this internal buffer
on message 4/4 might not cause issues, it is better to keep the actual
SNonce value here since the SNonce cookie can be used at a later point
in the sequence.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
7ec6fbd49a RSNO: Use the RSN Selection element to indicate which variant was used
This replaces the use of the RSNE Override and RSNE Override 2 elements
with empty payload to indicate which RSNE variant was used.

In addition, this adds stricter validation of the RSNE in
(Re)Association Request frame to allow only the pairwise cipher suites
and AKMs listed in the indicated RSNE variant to be used.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Shreyas Sheth
a743612f6c fix(wifi): Restructure wpa_parse_kde_ies same as upstream 2025-09-28 09:10:29 +05:30
Jouni Malinen
8e71c23a0e RSNO: Remove unused override element generation
The separate RSNOE/RSNO2E/RSNXOE buffers were not actually used on the
Authenticator, so remove them.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Adil Saeed Musthafa
c5161c4012 RSNO: Protect wpa_ie_buf3 from reuse explicitly
Use else-if check for better clarity regarding usage of wpa_ie_buf3 to
make it explicit that memory is allocated for this pointer only once.

Signed-off-by: Adil Saeed Musthafa <quic_adilm@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
b347db7af7 RSNO: Remove override elements from EAPOL-Key msg 3/4
This was not done in case the STA did not use RSN overriding.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
34336d28b9 RSNO: Support over two octets of RSNXOE capabilities
The RSNXE generation function was extended to support this earlier, but
that update was missed from the RSNXOE variant.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
5a713f89d7 RSNO: Allow RSNXE to be omitted
Add an explicit rsn_override_omit_rsnxe=1 configuration parameter to
allow the RSNXE to be omitted when using the RSNXOE and wanting to
minimize interoperability issues with STAs that might recognize the
RSNXE, but not handle it correctly, e.g., when multiple octets of
payload is included.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Shreyas Sheth
1e7dfd7896 feat(esp_wifi): Restructure wpa_supplicant for wpa3_compatible mode 2025-09-28 09:10:29 +05:30
Jouni Malinen
18db88ab4a RSNE/RSNXE overriding for STA
Add support for RSNE/RSNXE Override elements. Use these elements to
determine AP's extended RSN parameters.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Shreyas Sheth
ee3723b922 feat(wifi): Add support for wpa3 compatible flag for softap 2025-09-28 09:10:29 +05:30
Jouni Malinen
434671f5e6 RSNE/RSNXE overriding for AP
Allow hostapd to be configured to advertised two separate sets of
RSNE/RSNXE parameters so that RSNE/RSNXE can use a reduced set of
capabilities (e.g., WPA2-Personal only) for supporting deployed STAs
that have issues with transition modes while the new override elements
can use a newer security option (e.g., WPA3-Personal only) for STAs that
support the new mechanism.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Shreyas Sheth
86f8c88161 fix(wifi): Restructure esp supplicant for softap 2025-09-28 09:10:29 +05:30
Jouni Malinen
21ec067ef8 Allow RSNXE Override element to override RSNXE contents during parsing
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jouni Malinen
7ed2e8cf7e Add helper functions for parsing RSNXE capabilities
Simplify the implementation by using shared functions for parsing the
capabilities instead of using various similar but not exactly identical
checks throughout the implementation.

Signed-off-by: Jouni Malinen <j@w1.fi>
2025-09-28 09:10:29 +05:30
Jouni Malinen
25e0d46688 Add RSN overriding elements into IE parsing
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Shreyas Sheth
071bedda27 feat(wifi): restructure ieee802_11_parse_elems similar to upstream suppliant 2025-09-28 09:10:29 +05:30
Jouni Malinen
67771bab39 Define WFA vendor specific element types for RSNE/RSNXE overriding
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
2025-09-28 09:10:29 +05:30
Jin Cheng
ac2be3a58e fix(bt/controller): fixed the sniff anchor point can be mismatch from central and peripheral 2025-09-28 11:33:25 +08:00
Marius Vikhammer
f3dedf6f62 Merge branch 'bugfix/pthread_sem_timeout_test_failure' into 'master'
test(pthread): fixed test-case overflow calc issue

Closes IDFCI-3520, IDFCI-3466, and IDFCI-3176

See merge request espressif/esp-idf!42237
2025-09-28 11:23:13 +08:00
Zhang Shuxian
dbb50edf5e docs: Update translation for esp_netif 2025-09-28 11:20:32 +08:00
Marius Vikhammer
90897a9df4 test(pthread): fixed test-case overflow calc issue 2025-09-28 10:14:46 +08:00
muhaidong
15fd77bbb0 fix(wifi): fix pm offchan execute ready cb miss issue 2025-09-28 10:13:46 +08:00
Jiang Jiang Jian
bdd8d25761 Merge branch 'bugfix/remove_depricated_code' into 'master'
WiFi: remove deprecated code

See merge request espressif/esp-idf!40576
2025-09-28 09:56:20 +08:00
armando
c8029ace8c feat(isp): support AWB driver setting wbgain and subwindow feature 2025-09-28 01:15:18 +00:00
Kapil Gupta
8b68791996 fix(tool): increase buffer size for kconfig server 2025-09-27 17:55:28 +05:30
morris
71cb24caab feat(timg): graduate the hal driver into a single component 2025-09-27 17:33:10 +08:00
morris
415d1aba79 feat(dsi): add vsync interrupt handling 2025-09-27 17:05:29 +08:00
morris
37e9ba55d1 feat(axi_icm): support esp32-p4 rev3.0 2025-09-27 16:55:42 +08:00
Jack
17f7fd5ba6 fix migration guide build error 2025-09-27 11:44:29 +05:30
David Čermák
82d8f9f605 Merge branch 'feat/esp_netif_status_event' into 'master'
[esp_netif]: Add support for netif status events

Closes IDF-13357

See merge request espressif/esp-idf!42143
2025-09-27 13:36:03 +08:00
JinCheng
5a6193ae14 fix(bluedroid): removed the code relying on compiler-specific extension for FAM in union 2025-09-27 11:28:54 +08:00
David Čermák
7ab29a89e5 Merge branch 'fix/esp_netif_minor_leak' into 'master'
Fix tiny memory leak when PPP connection creation fails in esp_netif_new_ppp (GitHub PR)

Closes IDFGH-16327

See merge request espressif/esp-idf!42126
2025-09-27 03:59:32 +08:00
Samuel Obuch
38498e67cf feat(esp_system): stop other core for unicore esp32h4 2025-09-27 01:41:48 +08:00
Kapil Gupta
552a8653ad fix(esp_wifi): Fix some compilation issues in examples 2025-09-26 21:51:38 +05:30
Kapil Gupta
7b665b6512 fix(esp_wifi): Correct some documentation 2025-09-26 21:43:32 +05:30
Nachiket Kukade
a82788180c fix(esp_wifi): Remove deprecated NAN API variables in examples 2025-09-26 21:43:26 +05:30
Kapil Gupta
f12debf4f5 fix(esp_wifi): Updated some documentation 2025-09-26 21:43:05 +05:30
Kapil Gupta
ce00aa9b78 fix(esp_wifi): Address review comments 2025-09-26 21:42:46 +05:30
Nachiket Kukade
b0498569c8 fix(esp_wifi): Remove deprecated fields in NAN & FTM API's
- Update wifi libs to remove references to deprecated API's, enums
and variables
2025-09-26 21:42:39 +05:30
Kapil Gupta
2563d6a2e8 fix(esp_wifi): Add dummy value for deprecated enums 2025-09-26 21:42:30 +05:30
Kapil Gupta
0f63b92501 fix(esp_wifi): remove esp_interface.h and update usages 2025-09-26 21:42:30 +05:30
Kapil Gupta
a28fefcf73 docs: add Wi-Fi migration guide for v6.0 2025-09-26 21:42:30 +05:30
Kapil Gupta
5898086eca fix(esp_wifi): Remove some more deprecated enum/functions 2025-09-26 21:42:30 +05:30
Kapil Gupta
f189052386 fix(esp_wifi): Remove esp_interface.h 2025-09-26 21:42:30 +05:30
Kapil Gupta
35f8d9d42c fix(esp_wifi): Remove deprecated arguments from some APIs 2025-09-26 21:42:30 +05:30
Kapil Gupta
f2cd005473 fix(esp_wifi): Removed deprecated rrm function 2025-09-26 21:42:30 +05:30
Kapil Gupta
b6e632900b fix(esp_wifi): Remove deprecated event for DPP 2025-09-26 21:42:29 +05:30
Kapil Gupta
6bb3306154 fix(esp_wifi): Remove deprecated esp_wpa2.h 2025-09-26 21:42:29 +05:30
David Čermák
747c172fdc Merge branch 'feat/dhcps_support_hostname_per_client' into 'master'
[lwip/dhcps]: Add support for reporting clients hostname

Closes IDFGH-9326

See merge request espressif/esp-idf!42094
2025-09-26 21:47:50 +08:00
Roland Dobai
bb3055b37e Merge branch 'ci/test_tool_ignore_list' into 'master'
ci: Support known failure cases in pytests of test_tools

See merge request espressif/esp-idf!42203
2025-09-26 15:07:27 +02:00
Shen Meng Jing
d170949daa Merge branch 'docs/sync_en_and_cn_docs' into 'master'
docs: Sync CN and EN docs missing translation labels

Closes DOC-12424

See merge request espressif/esp-idf!42145
2025-09-26 21:03:18 +08:00
Jiang Jiang Jian
369d464151 Merge branch 'feat/support_esp32h21_sleep_feature' into 'master'
feat: support esp32h21 lowpower features

Closes PM-425, PM-426, PM-427, PM-428, PM-430, PM-432, IDF-11512, IDF-11515, IDF-11516, IDF-11517, IDF-11519, and IDF-11520

See merge request espressif/esp-idf!40116
2025-09-26 20:17:46 +08:00
zhanghaipeng
45775a3e35 feat(ble/bluedroid): Added BLE debug LOG for bluedroid 2025-09-26 20:10:32 +08:00
Shen Meng Jing
e4015962ed Merge branch 'docs/update_random_cn' into 'master'
docs: Update CN translation for random.rst

Closes DOC-12345

See merge request espressif/esp-idf!42141
2025-09-26 19:05:29 +08:00
Zhang Shuxian
0f20366ea8 docs: Add a note about ROM version in the boot log 2025-09-26 18:57:27 +08:00
Meet Patel
af895be8f6 feat(ulp_riscv): Add pulse counter example code for ulp riscv
Added a pulse counter example code for ulp riscv chips. The example
works by HP core generating high frequency pulses on a GPIO, which
are counted by ULP core to find out the highest possible frequency
of pulses that can be achieved without missing any edges.
2025-09-26 15:59:07 +05:30
Adam Múdry
beaf579f9b fix(storage): Refactor FATFS VFS functions to be easier to understand 2025-09-26 18:17:15 +08:00
cjin
abfc2d766e feat(ble): allow a larger sca limit on ESP32-H2 2025-09-26 18:04:27 +08:00
cjin
b3c608f2cf feat(ble): allow a larger sca limit on ESP32-C6 2025-09-26 18:04:27 +08:00
cjin
f012fafe51 feat(ble): allow a larger sca limit on ESP32-C5 2025-09-26 18:04:27 +08:00
cjin
9ecf67b230 feat(ble): allow a larger sca limit on ESP32-C2 2025-09-26 18:04:19 +08:00
nilesh.kale
5bad8496dc feat(hal/test_apps): Aligh hal/crypto ECDSA test parameters to mbedtls test_apps
Updated the hal/crypto ECDSA test parameters to match the configuration used
mbedtls/ test applications for consistency and easier maintenance.
2025-09-26 15:09:22 +05:30
Zhang Shuxian
ff8c82169f docs: Correct wrong description in secure-boot-v2.rst 2025-09-26 17:23:05 +08:00
Gao Xu
26e77d1940 Merge branch 'refactor/adc_hal_no_config' into 'master'
refactor(adc): Remove sdkconfig dependency in adc hal layer

Closes IDF-13624

See merge request espressif/esp-idf!42015
2025-09-26 17:19:17 +08:00
Chen Jichang
51b253e945 feat(rmt): support receive buffer to psram 2025-09-26 16:42:33 +08:00
Chen Jichang
ddef1d3d52 refactor(gdma): move buffer aligment to buffer mount config 2025-09-26 16:42:33 +08:00
Chen Jichang
f2f62b590d fix(rmt): alloc channel memory from internal 2025-09-26 16:42:33 +08:00
Omar Chebib
056c40424c Merge branch 'feature/mailbox' into 'master'
feat(mailbox): define and implement a mailbox API for the ESP32-P4

See merge request espressif/esp-idf!39925
2025-09-26 16:34:41 +08:00
Jiang Jiang Jian
9fee9cc1f0 Merge branch 'bugfix/ftm_last_dial_tok' into 'master'
bugfix(wifi): Set the dialog token of last FTM resp to zero

Closes IDFGH-16186

See merge request espressif/esp-idf!41154
2025-09-26 16:00:49 +08:00
Xu Si Yu
29d8fbe896 Merge branch 'feat/add_openthread_start_stop_api' into 'master'
feat(openthread): add openthread start stop APIs

See merge request espressif/esp-idf!40349
2025-09-26 15:35:20 +08:00
Island
f514bd56f7 Merge branch 'feat/add_safe_unity_component' into 'master'
feat(ble): added safe unity component

Closes BLERP-2272

See merge request espressif/esp-idf!42190
2025-09-26 15:22:35 +08:00
Konstantin Kondrashov
0096599660 feat(build): Default warnings to be considered as errors 2025-09-26 10:15:46 +03:00
Wang Qixiang
105a64ab9e Merge branch 'component/remove_wifi_prov' into 'master'
change(wifi_prov): Remove wifi_provisioning component and esp_prov tool

See merge request espressif/esp-idf!41866
2025-09-26 15:15:17 +08:00
Alexey Lapshin
d081549979 feat(tools): enable zc* extensions for esp32p4 revision >= 3.0 2025-09-26 15:09:23 +08:00
Harshal Patil
fd7d9c9ee9 Merge branch 'fix/key_mgr_use_default_efuse_key' into 'master'
Configure the Key Manager to use XTS-AES efuse key by-default

Closes IDFCI-3135 and IDFCI-3136

See merge request espressif/esp-idf!42032
2025-09-26 12:34:19 +05:30
C.S.M
b145ede835 refactor(mspi): Make mspi hal layer independent 2025-09-26 14:57:54 +08:00
Island
76b28d8257 Merge branch 'feat/support_blecrt_489' into 'master'
feat(ble/bluedroid): Added API to set channel map for scanning

Closes BLERP-2204

See merge request espressif/esp-idf!41681
2025-09-26 14:36:58 +08:00
Roland Dobai
cb84b6860a ci: Support known failure cases in pytests of test_tools 2025-09-26 08:29:55 +02:00
hebinglin
97d01f229c change(soc): add TODO jira tickets for some changes in esp32h21 2025-09-26 14:02:55 +08:00
hebinglin
ac6fd31296 change(esp_hw_support): support mem pd during deepsleep for esp32h21 and esp32h4 2025-09-26 14:02:55 +08:00
hebinglin
225b1d8a37 change(esp_hw_support): change some pmu params for esp32h21 & esp32h4 2025-09-26 14:02:55 +08:00
hebinglin
92b2d1d4f2 change(esp_hw_support): need be reverted after supporting corresponding features in esp32h21 2025-09-26 14:02:55 +08:00
hebinglin
89795f6281 change(esp_hw_support): support static and dynamic sleep cpu retention for esp32h21 2025-09-26 14:02:55 +08:00
hebinglin
74b8939b50 fix(esp_hw_support): remove the dependency of not esp32h21 or esdp32h4 for PM_SLP_IRAM_OPT 2025-09-26 14:02:55 +08:00
wuzhenghui
9e0f49d57b feat(esp_hw_support): support PD_CPU and PD_TOP retention on esp32h21 2025-09-26 14:02:55 +08:00
wuzhenghui
3e7892122e feat(esp_hw_support): support lightsleep and deepsleep on esp32h21 2025-09-26 14:02:55 +08:00
wuzhenghui
ae34067f11 feat(soc): update esp32h21 lowpower related caps 2025-09-26 14:02:55 +08:00
David Cermak
75e0d62739 feat(lwip/dhcps): Add support for reporting clients hostname 2025-09-26 07:54:20 +02:00
David Cermak
48af385311 fix(esp_netif): Add support for netif status events 2025-09-26 07:11:04 +02:00
Xu Si Yu
4876f122cc feat(openthread): examples adaptation of new APIs 2025-09-26 10:59:59 +08:00
Xu Si Yu
41dbd0d03a feat(openthread): add common components for openthread examples 2025-09-26 10:59:59 +08:00
Xu Si Yu
c3035bb382 feat(openthread): add openthread start stop APIs 2025-09-26 10:59:52 +08:00
Island
9fe51958ae Merge branch 'change/ble_update_lib_20250925' into 'master'
change(ble): [AUTO_MR] 20250925 - Update ESP BLE Controller Lib

Closes BLERP-1350, BLERP-2254, BLERP-2253, BLERP-2271, BLERP-2223, BLERP-2221, BLERP-2269, BLERP-2224, BLERP-2213, BLERP-2226, BLERP-2225, and BLERP-2222

See merge request espressif/esp-idf!42158
2025-09-26 10:41:41 +08:00
Zhou Xiao
64ef451586 feat(ble): added safe unity component 2025-09-26 10:25:25 +08:00
gaoxu
41a6a7daa2 refactor(adc): Remove sdkconfig dependency in adc hal layer 2025-09-26 10:15:41 +08:00
Shen Mengjing
573058f0ad docs: Sync CN and EN docs missing translation labels 2025-09-26 09:57:56 +08:00
WanqQixiang
6b503d0db5 component: Remove wifi_provisioning component and esp_prov tool 2025-09-26 09:48:50 +08:00
Wang Meng Yang
bf695d08d4 Merge branch 'bugfix/possible_buffer_overflow' into 'master'
Bugfix/possible buffer overflow

Closes BT-4111

See merge request espressif/esp-idf!41878
2025-09-26 09:39:31 +08:00
Marius Vikhammer
25c40d4563 Merge branch 'fix/usb_host_uvc_example_uvc_desc' into 'master'
fix(usb_host): Updaing changed Kconfig value from usb_host_uvc

See merge request espressif/esp-idf!42172
2025-09-26 08:58:52 +08:00
tarun.kumar
ee248d6b6d fix(ci) : Add supp for esp32h2 in softAP and station examples 2025-09-26 03:02:04 +05:30
peter.marcisovsky
bb4c016d59 fix(usb_host): Updaing changed Kconfig value from usb_host_uvc component in UVC example 2025-09-26 03:41:37 +08:00
David Čermák
ba0b61d98d Merge branch 'fix/esp_netif_remove_deprecated_api' into 'master'
[esp_netif]: Remove deprecated APIs

Closes IDF-10213

See merge request espressif/esp-idf!42125
2025-09-25 21:23:01 +08:00
Nilesh Kale
d73cf17616 Merge branch 'docs/move_ecdsa_related_documentation_under_soc_capability' into 'master'
docs: move ecdsa documentation under soc capability for esp_http_client.rst

See merge request espressif/esp-idf!42169
2025-09-25 20:00:04 +08:00
Marius Vikhammer
56949379e0 Merge branch 'fix/fix_eth_build' into 'master'
fix(esp_eth): fixed ETH builds by forcing Ethernet init ver

See merge request espressif/esp-idf!42164
2025-09-25 18:45:22 +08:00
Shen Mengjing
10b4e56dca docs: Update CN translation for random.rst 2025-09-25 17:23:27 +08:00
nilesh.kale
f3dd701289 docs: move ecdsa documentation under soc capability for esp_http_client.rst 2025-09-25 13:53:55 +05:30
Sudeep Mohanty
25ffd0f128 Merge branch 'task/refactor_freertos_port_files' into 'master'
refactor(freertos): Refactor FreeRTOS port files

Closes IDF-4172

See merge request espressif/esp-idf!41981
2025-09-25 09:03:01 +02:00
Gao Xu
53a250b1aa Merge branch 'feat/p4_eco5_ccm' into 'master'
ISP:  support ccm on P4 eco5

Closes IDF-13934

See merge request espressif/esp-idf!42004
2025-09-25 15:02:35 +08:00
akshat
dfdf3d5a22 bugfix(wifi): Set the dialog token of last FTM resp to zero
This MR also adds the implementation to perform FTM in 40Mhz in disconnected State.

Closes https://github.com/espressif/esp-idf/issues/17235
2025-09-25 12:26:47 +05:30
cjin
164fec9e74 fix(ble): update the example docs for pawr 2025-09-25 14:37:04 +08:00
Ondrej Kosta
9662963a3d fix(esp_eth): fixed ETH builds by forcing Ethernet init ver 2025-09-25 07:28:12 +02:00
Akiyama Kohane
4358d21a06 fix(mbedtls): prevent vectorization fault in clang O2 optimization
Closes https://github.com/espressif/esp-idf/pull/17582
2025-09-25 13:22:12 +08:00
zwl
4d2d49f736 change(ble): [AUTO_MR] Update lib_esp32c2 to aabb0f68 2025-09-25 12:49:36 +08:00
zwl
810d7e0ec7 change(ble): [AUTO_MR] Update lib_esp32c6 to f0e815be 2025-09-25 12:49:36 +08:00
zwl
c99ebc69c4 change(ble): [AUTO_MR] Update lib_esp32c5 to f0e815be 2025-09-25 12:49:36 +08:00
zwl
0b203abf4b change(ble): [AUTO_MR] Update lib_esp32h2 to f0e815be 2025-09-25 12:49:36 +08:00
Alexey Lapshin
22cae61ee1 Merge branch 'feature/enable_zc_extensions' into 'master'
Enable zc* extensions for riscv chips supported them

Closes IDF-13918

See merge request espressif/esp-idf!40074
2025-09-25 08:42:07 +04:00
Wei Yu Han
6588b008d9 Merge branch 'docs/update_6.0_ble_feature_status' into 'master'
docs(ble): Added BLE 6.0 features support status

See merge request espressif/esp-idf!41982
2025-09-25 11:51:58 +08:00
Omar Chebib
32bb32b598 fix(ulp): fix warning in lp core I2C driver 2025-09-25 10:25:15 +08:00
Omar Chebib
324446da95 feat(mailbox): define and implement a mailbox API with hardware and software support 2025-09-25 10:25:15 +08:00
Marius Vikhammer
88c9af78a7 Merge branch 'change/allow_esp_timer_init_from_user_code' into 'master'
change(esp_timer): esp_timer_init_os now returns ESP_OK if esp_timer already initialized

Closes IDFGH-8182

See merge request espressif/esp-idf!42069
2025-09-25 10:23:11 +08:00
JinCheng
075ed218ca fix(bt/bluedroid): fixed potential OOB in Bluedroid 2025-09-25 10:20:10 +08:00
Marius Vikhammer
392226b37f Merge branch 'feat/remove-catch-from-tools' into 'master'
feat(tools): Remove tools/catch

Closes IDF-9203

See merge request espressif/esp-idf!40413
2025-09-25 10:16:55 +08:00
Li Shuai
661898c90a Merge branch 'feat/support_esp32h4_sleep_feature' into 'master'
change(esp_hw_support): support sleep features for esp32h4mp

Closes IDF-13838

See merge request espressif/esp-idf!41951
2025-09-25 10:05:51 +08:00
Alexey Gerenkov
f3dba4f778 Merge branch 'feature/add-constexpr-noinline-for-libstdcxx' into 'master'
feat(build): add CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR choise option

See merge request espressif/esp-idf!42079
2025-09-25 09:26:23 +08:00
Roland Dobai
746acf4632 Merge branch 'feat/check_external_component_includes' into 'master'
Produce cmake warnings if component includes or builds from outside the component

Closes IDF-12583

See merge request espressif/esp-idf!40800
2025-09-24 20:39:49 +02:00
Alexey Lapshin
dfac1a162c change(esp_tee): disable zcmp extension for esp_tee builds 2025-09-24 21:32:02 +07:00
gaoxiaojie
fab0bb1056 fix(esp_system): clear cache error interrupt in panic handler 2025-09-24 21:30:56 +07:00
Alexey Lapshin
73edc2903b fix(esp_wifi): fix bin_size_apsta test 2025-09-24 21:30:56 +07:00
Alexey Lapshin
6ed3fe13ca fix(build): add workaround for cm.push that triggers interrupt 2025-09-24 21:30:56 +07:00
Alexey Lapshin
a5b54a7ea3 feat(build): enable zc* extensions for riscv chips 2025-09-24 21:30:56 +07:00
Fu Hanxi
6fa8b5ff14 Merge branch 'ci/improve-git-changed-files' into 'master'
ci: improve git diff, avoid gitlab bug on CI_MERGE_REQUEST_DIFF_BASE_SHA

See merge request espressif/esp-idf!42092
2025-09-24 15:27:47 +02:00
Fu Hanxi
de12e8911d ci: improve git diff, avoid gitlab bug on CI_MERGE_REQUEST_DIFF_BASE_SHA 2025-09-24 14:25:33 +02:00
David Cermak
c9c3e4e972 fix(esp_netif): Remove deprecated APIs 2025-09-24 14:17:36 +02:00
Roland Dobai
5dad2a4884 ci(test): Improve test failures on Windows
Tests are made cancellable and to print STDOUT and STDERR upon failures.
2025-09-24 13:43:23 +02:00
Roland Dobai
36fb960e5f change(tools): Fix pre-commit checks for tools.py 2025-09-24 13:43:23 +02:00
Roland Dobai
ef878f4d25 ci(test): Test requiring pexpect.spawn cannot be run on Windows 2025-09-24 13:43:23 +02:00
Roland Dobai
9e8962c6cc change(tools): Fix pre-commit checks for test_idf_qemu.py 2025-09-24 13:43:23 +02:00
Roland Dobai
26ae9e8589 ci(gitlab): Split up Windows tests into (more) parallel jobs 2025-09-24 13:43:23 +02:00
Roland Dobai
adb2d5deee feat(cmake): Produce warnings when component dependencies are not defined
There are idf.py hints for helping the user to set component
dependencies properly instead of building sources out-of-component or
including headers from outside the component directory. These are
produced with
tools/idf_py_actions/hint_modules/component_requirements.py.

However, idf.py hints are printed only when the build fails. If the user
starts with a buildable solution then the suggestions to add component
dependencies are not printed.

This commit introduces cmake-level warnings for building source files
from outside the component and including header files without setting up
proper component dependencies.
2025-09-24 13:43:23 +02:00
Roland Dobai
c3729929a8 change(tools): Fix pre-commit checks for test_components.py 2025-09-24 13:43:23 +02:00
Roland Dobai
7cf02797d9 Merge branch 'ci/fix-unused-keyword' into 'master'
ci: remove unused keyword

See merge request espressif/esp-idf!42150
2025-09-24 13:41:07 +02:00
Fu Hanxi
809161fb19 ci: remove unused keyword 2025-09-24 13:06:58 +02:00
Roland Dobai
34f658a2c6 Merge branch 'feat/load_idf_ext_from_components' into 'master'
feat(tools): Load idf.py extensions from project's component directories and python packages

Closes IDF-5736 and IDF-4121

See merge request espressif/esp-idf!39875
2025-09-24 12:24:05 +02:00
Sudeep Mohanty
f620ab6dbd Merge branch 'feat/move_bootloader_part_table_flash_deps' into 'master'
refactor(build-system): Simplify flash target creation

See merge request espressif/esp-idf!41777
2025-09-24 11:43:48 +02:00
Guillaume Souchere
4c589d6282 Merge branch 'feat/add-ringbuf-reset' into 'master'
feat(esp_ringbuf): Add vRingbufferReset

Closes IDFGH-16385

See merge request espressif/esp-idf!41717
2025-09-24 10:11:07 +02:00
Mahavir Jain
b614744808 Merge branch 'fix(esp_tls)/dynamic_buffer_ssl_crash' into 'master'
fix(esp_tls): fix potential ssl crash with dynamic buffer

Closes IDF-14135

See merge request espressif/esp-idf!42120
2025-09-24 12:39:03 +05:30
David Čermák
fe059bc551 Merge branch 'fix/esp_netif_const_correct' into 'master'
[esp_netif]: Make esp_netif_ip6_get_addr_type() const correct

Closes IDFGH-15212

See merge request espressif/esp-idf!42085
2025-09-24 14:39:49 +08:00
morris
3124e04773 Merge branch 'fix/clear_force_on_reg_for_cache' into 'master'
fix(clk): do not clear force_on reg for cache

Closes IDFCI-2944, IDFCI-2988, and IDFCI-2953

See merge request espressif/esp-idf!42023
2025-09-24 14:27:16 +08:00
Jiang Jiang Jian
c0dc3323fe Merge branch 'refactor/wps_eap_cleanup' into 'master'
refactor(esp_wifi): Remove WPS task code

Closes WIFIBUG-1254 and WIFIBUG-1095

See merge request espressif/esp-idf!38555
2025-09-24 12:52:52 +08:00
Kapil Gupta
1e1d5601de refactor(esp_wifi): Remove WPS task code 2025-09-24 12:52:52 +08:00
Rahul Tank
19176ee11d fix(nimble): Avoid ext adv data in reattempt advertising 2025-09-24 09:28:21 +05:30
Gao Xu
ca1e19842d Merge branch 'refactor/rng_ll_s2' into 'master'
refactor(rng): refactor to use hal/ll apis for S2

Closes IDF-12538

See merge request espressif/esp-idf!42060
2025-09-24 11:55:02 +08:00
Rahul Tank
b722615489 Merge branch 'feat/separate_indicate' into 'master'
fix(nimble): Added code to handle sending indicate

See merge request espressif/esp-idf!41632
2025-09-24 09:08:56 +05:30
morris
e05d890ea1 Merge branch 'fix/enable_dsi_phy_cfg_clk' into 'master'
fix(dsi): enable dsi phy cfg clk

See merge request espressif/esp-idf!42043
2025-09-24 10:33:40 +08:00
Island
448f89e223 Merge branch 'feat/ble_log_v2_with_log_compression' into 'master'
feat(ble): Support ble log compression(draft)

Closes BLERP-2109

See merge request espressif/esp-idf!41758
2025-09-24 10:28:13 +08:00
gaoxu
294868362f feat(isp_color): support ISP color on P4 2025-09-24 10:23:42 +08:00
Gao Xu
3ec9502526 Merge branch 'bugfix/fix_temp_sensor_affect_by_adc' into 'master'
ADC: fix temp sensor affect by adc continuous reset

Closes IDFGH-14786

See merge request espressif/esp-idf!38921
2025-09-24 10:05:03 +08:00
Ashish Sharma
9cb348789c fix(esp_tls): limit ret code from esp_mbedtls_handshake 2025-09-24 09:36:38 +08:00
Armando (Dou Yiwen)
e13699a652 Merge branch 'feat/p4_rev3_isp_blc' into 'master'
isp: black level correction driver support on p4 eco5

Closes IDF-13931

See merge request espressif/esp-idf!41714
2025-09-24 01:10:40 +00:00
Armando (Dou Yiwen)
8bb5f0292a Merge branch 'change/g0_test_uses_p4_rev3' into 'master'
g0: use hw_ver3 to build g0 components test app

See merge request espressif/esp-idf!42106
2025-09-24 01:10:24 +00:00
Ivan Grokhotkov
0367cfea8e Merge branch 'feature/rename-bootloader_ld' into 'master'
change(bootloader): rename bootloader.ld -> bootloader.ld.in

Closes IDF-9793

See merge request !42014
2025-09-23 23:20:15 +02:00
Ivan Grokhotkov
c4f907a62c Merge branch 'feature/update-toolchain-to-esp-15.2.0_20250920' into 'master'
feat(tools): update toolchain version to esp-15.2.0_20250920

See merge request !42056
2025-09-23 23:14:27 +02:00
morris
4589f33c15 Merge branch 'refactor/remove_nt35510' into 'master'
refactor(lcd)!: moved nt35510 device driver to component registry

Closes IDF-13717

See merge request espressif/esp-idf!41864
2025-09-24 01:43:23 +08:00
Alexey Lapshin
d9389ba082 change(bootloader): rename bootloader.ld -> bootloader.ld.in
This change passes file through compiler preprocessor which unlocks
future code refactoring.
2025-09-24 00:51:54 +08:00
Harshal Patil
c6e65586e3 Merge branch 'feat/support_aes_block_and_dma_modes_during_runtime' into 'master'
Support AES block and DMA modes during runtime

Closes IDFGH-15251 and IDF-2594

See merge request espressif/esp-idf!40917
2025-09-23 19:46:49 +05:30
Alexey Lapshin
897f95ab1c feat(tools): update toolchain version to esp-15.2.0_20250920 2025-09-23 21:06:14 +07:00
Ondrej Kosta
64df28678c Merge branch 'fix/update-eth-init-calls' into 'master'
fix(ethernet_init): Update Ethernet Init Calls

See merge request espressif/esp-idf!41916
2025-09-23 22:02:11 +08:00
Roland Dobai
5872fe6c07 Merge branch 'test/run_supported_cmake_tests' into 'master'
test(tools): Added minimal supported cmake version tests

Closes IDF-11449

See merge request espressif/esp-idf!40839
2025-09-23 14:41:39 +02:00
Kapil Gupta
9b2f439ce2 Merge branch 'bugfix/eloop_lock' into 'master'
Made changes related to registering eloop timeout for eloop lock

Closes WIFIBUG-1306

See merge request espressif/esp-idf!40384
2025-09-23 18:10:52 +05:30
morris
ab7ee70c6f refactor(lcd)!: moved nt35510 device driver to component registry 2025-09-23 20:33:28 +08:00
Shu Chen
2f4c63b11c Merge branch 'feat/update_ot_upstream' into 'master'
feat(openthread): update OT upstream to 3b3dd203b

See merge request espressif/esp-idf!42040
2025-09-23 10:57:24 +00:00
Chen Jichang
40ebbc279f fix(dsi): enable dsi phy cfg clk 2025-09-23 18:12:06 +08:00
David Čermák
c33b88db13 Merge branch 'fix/esp_netif_docs' into 'master'
fix(docs): Remove esp_netif doxygen groups

Closes IDFGH-16050

See merge request espressif/esp-idf!40779
2025-09-23 17:25:36 +08:00
Kapil Gupta
0f215a4057 Merge branch 'bugfix/roam_app_neighbor_crash' into 'master'
fix(wifi_apps): Fix crash due to neighbor_list lock

Closes IDFGH-16029

See merge request espressif/esp-idf!40854
2025-09-23 14:24:18 +05:30
Armando (Dou Yiwen)
dfe8ee582d Merge branch 'change/remove_gpio_public_require_from_sdmmc' into 'master'
sdmmc: removed public requirement to esp_driver_gpio

Closes IDF-12851

See merge request espressif/esp-idf!42105
2025-09-23 08:40:44 +00:00
renpeiying
f53f02f3b5 docs(size): update CN translation for size.rst 2025-09-23 15:13:31 +07:00
Alexey Lapshin
6d1d5ccb1c feat(build): add CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR choise option
Allow to disable implicit inlining of constexpr functions from libstdc++.
This is a known GCC issue https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93008
that may affect C++ application size depending on its structure.
2025-09-23 15:13:28 +07:00
Guillaume Souchere
cdef6dce44 Merge branch 'feat/allow-adc-unit-2-ulp' into 'master'
feat(ulp): Allow usage of ADC unit 2 on RISCV co processor

Closes IDFGH-16376

See merge request espressif/esp-idf!41863
2025-09-23 10:00:16 +02:00
Chen Jichang
236c10c9a4 fix(clk): clear force_on reg for cache 2025-09-23 15:49:47 +08:00
renpeiying
6c6b8a5ee0 docs: Add CN translation to idf-py.rst 2025-09-23 15:26:33 +08:00
Marek Fiala
96ff174dac feat(tools): idf.py extension - added interface version 2025-09-23 15:26:33 +08:00
Marek Fiala
7ac1c541fd docs(tools): Updated documentation about extension options 2025-09-23 15:26:33 +08:00
Marek Fiala
74f75feb3a test(tools): Added idf extensions build system tests 2025-09-23 15:26:33 +08:00
Marek Fiala
4f8fb84caa feat(tools): Added check for duplicit action names/aliases from external extensions 2025-09-23 15:26:33 +08:00
Marek Fiala
732f68a2a5 feat(tools): Load idf_ext.py from build component directories & python entrypoints
Extend search for idf_ext.py beyond the project directory to include
all build components involved in the build. Also discover idf_ext.py
modules via Python entrypoints.
2025-09-23 15:26:33 +08:00
Marek Fiala
2ec170b2fb change(tools): idf.py & tools.py ruff formatting 2025-09-23 15:26:33 +08:00
armando
aeb590e1a3 change(g0): use hw_ver3 to build g0 components test app 2025-09-23 15:09:11 +08:00
Guillaume Souchere
1798034d3f feat(tools): Remove old copy of Catch2 in tools 2025-09-23 08:49:58 +02:00
tarun.kumar
20541fb8ee fix(wifi) : Made changes related to registering eloop timeout for eloop lock 2025-09-23 14:48:47 +08:00
glmfe
0b330482a7 fix(ethernet_init): Update Ethernet Init Calls
Removed references to components/ethernet_init to use new managed component ethernet_init.
2025-09-23 08:48:08 +02:00
Guillaume Souchere
c03987ca49 feat(esp_ringbuf): Update vRingbufferReset to return an error
when items are not sent, complete or returned, make the function
return an error instead of checking the state in an assert.
2025-09-23 08:42:09 +02:00
Shu Chen
22383e6be8 Merge branch 'feature/optimize-zb-utility-path' into 'master'
feat(zigbee): optimize the path of zcl_utility to compatible different platforms

See merge request espressif/esp-idf!41734
2025-09-23 06:24:14 +00:00
Shu Chen
185d4711c5 Merge branch 'fix/fix_openthread_cli' into 'master'
fix(openthread): check if the command is valid before calling the input function

See merge request espressif/esp-idf!42002
2025-09-23 06:23:19 +00:00
C.S.M
5aceeadd89 Merge branch 'contrib/github_pr_13963' into 'master'
fix(i2c): Don't print developer notes to ESP_LOG (GitHub PR)

Closes IDFGH-13015

See merge request espressif/esp-idf!31472
2025-09-23 14:19:40 +08:00
Armando (Dou Yiwen)
4447fdc018 Merge branch 'fix/use_heap_caps_to_maintain_desc_alignment' into 'master'
sdmmc: use heap_caps_alloc to maintain desc alignment

See merge request espressif/esp-idf!42038
2025-09-23 06:08:41 +00:00
Chen Chen
2d9b6c1179 Merge branch 'feat/p4eco5_hue_update' into 'master'
feat(isp): p4eco5 hue update

Closes IDF-13935

See merge request espressif/esp-idf!41705
2025-09-23 14:07:10 +08:00
armando
c136400c3b change(sd): removed public requirement to esp_driver_gpio 2025-09-23 13:58:28 +08:00
xieqinan@espressif.com
fa793efda0 feat(zigbee): move the zcl_utility into the examples_utils of zb_common_components 2025-09-23 12:14:01 +08:00
Shreyas Sheth
4757853836 fix(wifi_apps): Fix crash due to neighbor_list lock
Closes https://github.com/espressif/esp-idf/issues/16976
2025-09-23 12:01:39 +08:00
Marius Vikhammer
fb79d92005 Merge branch 'change/remove_deprecated_vfs_driver_funcs' into 'master'
change(vfs): removed uart and uart-jtag-serial API

See merge request espressif/esp-idf!41988
2025-09-23 10:17:54 +08:00
Armando (Dou Yiwen)
d7c975d9b6 Merge branch 'refactor/cache_hal_no_sdkconfig' into 'master'
cache: cache/mmu hal no sdkconfig

Closes IDF-13586

See merge request espressif/esp-idf!41929
2025-09-23 01:32:54 +00:00
Lu Wei Ke
17288256b7 Merge branch 'docs/add_qemu_extra_args' into 'master'
docs: Add --qemu-extra-args option to QEMU guide

Closes DOC-11842

See merge request espressif/esp-idf!42042
2025-09-23 09:15:40 +08:00
armando
70acf169e0 fix(sd): use heap_caps_alloc to maintain desc alignment 2025-09-23 01:15:33 +00:00
Marius Vikhammer
ac3c7ddb6f Merge branch 'docs/remove_readthedocs_link' into 'master'
docs(readthedocs): removed old leftover readthedocs references

See merge request espressif/esp-idf!41483
2025-09-23 09:13:00 +08:00
Rahul Tank
4e8b48e677 fix(nimble): Added code to handle sending indicate 2025-09-22 21:48:51 +05:30
chenjianhua
fd4bb69357 feat(ble/bluedroid): Added API to set channel map for scanning 2025-09-23 00:05:48 +08:00
peter.marcisovsky
57d48ef234 feat(usb_host): Add hal check for the global root port suspend 2025-09-22 17:56:20 +02:00
Marek Fiala
7e5b0a8bb0 feat(test): Used dockerfile with updated cmake versions 2025-09-22 16:47:50 +02:00
Marek Fiala
efa75a9b60 test(tools): Added minimal supported cmake versions build system tests 2025-09-22 16:47:42 +02:00
David Cermak
8c8a680082 fix(esp_netif): Remove doxygen groups as esp-docs is flat docs style
Closes https://github.com/espressif/esp-idf/issues/16993
2025-09-22 20:37:49 +08:00
Zhang Shu Xian
019bb7fa72 Merge branch 'docs/update_cn_translation_for_system' into 'master'
docs: Update CN translation for system.rst

Closes DOC-12310, DOC-12344, DOC-12354, DOC-12367, and DOC-12385

See merge request espressif/esp-idf!41999
2025-09-22 19:05:27 +08:00
Guillaume Souchere
1e0463673b feat(ulp): Allow usage oof ADC unit 2 on RISCV co processor 2025-09-22 12:38:37 +02:00
David Cermak
a7627b0ce2 fix(esp_netif): Make esp_netif_ip6_get_addr_type() const correct
Closes https://github.com/espressif/esp-idf/issues/15882
2025-09-22 11:42:44 +02:00
luoxu
ed0ae79d24 feat(ble): add libraries related to ble log compression 2025-09-22 17:09:58 +08:00
luoxu
eece778e55 feat(ble): Support ble log compression(draft) 2025-09-22 17:09:58 +08:00
Mahavir Jain
4e082efc24 Merge branch 'fix/change_write_protection_bit_of_shared_security_efuses' into 'master'
Reorder write protection bits of some shared security efuses

See merge request espressif/esp-idf!41619
2025-09-22 14:38:21 +05:30
Wan Lei
e8ec9546e4 Merge branch 'fix/c5_twai_listen_only_workaround' into 'master'
fix(driver_twai): added ctu_official workaround, fixed error count info

Closes IDFGH-16314, IDFGH-16278, IDFGH-16364, IDFGH-16383, IDFCI-3106, and IDFCI-3107

See merge request espressif/esp-idf!41570
2025-09-22 16:35:26 +08:00
hebinglin
c30ecd8777 change(esp_hw_support): support sleep features for esp32h4mp 2025-09-22 16:13:27 +08:00
Guillaume Souchere
ce9563d85c Merge branch 'fix/argtable3-coverity-findings' into 'master'
fix(console): Add input validation in arg_utils.c functions

Closes IDF-13986 and IDF-13987

See merge request espressif/esp-idf!41736
2025-09-22 09:45:44 +02:00
luweike
bfe6b51ac9 docs: Add --qemu-extra-args option to QEMU guide 2025-09-22 15:37:46 +08:00
Sudeep Mohanty
cf12478049 refactor(freertos): Deprecate xPortGetTickRateHz()
This commit deprecates xPortGetTickRateHz() from the FreeRTOS port API
as the FreeRTOS tickrate is constant for an application and can be
inferred using the CONFIG_FREERTOS_HZ config option.
2025-09-22 09:23:07 +02:00
Sudeep Mohanty
141e62806c feat(freertos-smp): Enabled FreeRTOS Runtime stats gathering for Amazon SMP Kernel 2025-09-22 09:23:07 +02:00
Sudeep Mohanty
9a4341bb87 refactor(freertos): Moved FreeRTOS Run Time Stats gathering to port.c
This commit creates a new port layer API xPortGetRunTimeCounterValue()
in port.c files. This helps to remove inclusion of header files such as
esp_timer.h and xtensa/hal.h from portmacro.h
2025-09-22 09:23:01 +02:00
harshal.patil
8b663ebe4d fix(esp_security): Configure the Key Manager to use XTS-AES efuse key by-default 2025-09-22 12:22:07 +05:30
Zhang Shuxian
8d88ea874d docs: Update CN translation for system.rst 2025-09-22 14:13:15 +08:00
Marius Vikhammer
16cdbd9f5c change(esp_timer): esp_timer_init_os now returns ESP_OK if already initialized
Previously it would return ESP_ERR_INVALID_STATE, which meant that if called from
user-code before the system tries to initialize the timer then esp-idf would
fail to boot.

This could happen if a user wanted to use esp-timer from a cpp constructor.

Closes https://github.com/espressif/esp-idf/issues/9679
2025-09-22 14:01:56 +08:00
Laukik Hase
649741fa9d Merge branch 'feat/nvs_flash_deregister_sec_scheme' into 'master'
feat(nvs_flash): Added an API to deregister the NVS security scheme context

Closes IDF-12456 and IDFGH-16210

See merge request espressif/esp-idf!41073
2025-09-22 11:11:34 +05:30
Marius Vikhammer
33f92c8fc8 Merge branch 'change/disable_assert_ndebug_eval_by_default' into 'master'
change(newlib): COMPILER_ASSERT_NDEBUG_EVALUATE default value changed to 'n'

Closes IDFGH-479 and IDF-10857

See merge request espressif/esp-idf!40295
2025-09-22 13:10:15 +08:00
Nebojsa Cvetkovic
298bd047f6 fix(i2c): Don't print developer notes to ESP_LOG,
Closes https://github.com/espressif/esp-idf/pull/13963
2025-09-22 11:55:40 +08:00
Marius Vikhammer
19337d2708 change(vfs): deleted deprecated uart and uart-jtag-serial API 2025-09-22 11:46:07 +08:00
Wei Yuhan
5e4c16410b docs(ble): Added BLE 6.0 features support status 2025-09-22 09:49:27 +08:00
armando
7a58274c73 feat(isp): support BLC driver 2025-09-22 09:22:58 +08:00
armando
8ebce9b805 change(cache): no use sdkconfig in cache/mmu hal 2025-09-22 01:01:03 +00:00
gaoxu
e5c6b87c10 fix(tsens): fix temp_sensor affect by adc reset 2025-09-22 08:19:46 +08:00
gaoxu
9619d2b05a ci(adc): add adc oneshot/continuous work with temp_sensor 2025-09-22 08:19:46 +08:00
Mahavir Jain
4c8833b6b6 Merge branch 'fix/ecdsa_efuse_purpose_check' into 'master'
fix(ecdsa): Fixed ECDSA efuse purpose check condition

See merge request espressif/esp-idf!41926
2025-09-21 19:41:10 +05:30
Mahavir Jain
0fa59a254c Merge branch 'fix/improve_rng_documentation' into 'master'
fix(docs): Improved RNG documentation

Closes IDFGH-13813

See merge request espressif/esp-idf!36038
2025-09-21 19:20:27 +05:30
Mahavir Jain
572119684c Merge branch 'fix/add_missing_event_tracter_capture_duirng_mbedtls_read' into 'master'
fix(esp-tls): added missing event tracker capture during mbedtls read operation

Closes IDFGH-15609

See merge request espressif/esp-idf!41266
2025-09-21 19:13:13 +05:30
Aditya Patwardhan
41b37f813b feat(docs): Added svg file for the RNG 2025-09-21 18:37:20 +05:30
Aditya Patwardhan
d2cd0e72ef fix(docs): Improved RNG documentation
Updated the RNG documentation to add more details
about the High speed ADC as a noise source
and its limitations.

Closes https://github.com/espressif/esp-idf/issues/14665
2025-09-21 18:37:13 +05:30
Alexey Lapshin
262a70a1f0 Merge branch 'feature/gdbinit-files-generation-update' into 'master'
gdbinit files generation update

Closes IDF-11667 and IDF-11692

See merge request espressif/esp-idf!41549
2025-09-20 17:35:00 +04:00
Tomas Rezucha
ecc1144054 Merge branch 'feature/usb_p4_ver2' into 'master'
feat(usb/host): Add USB support to ESP32-P4 v3 (ECO5)

Closes IDF-13507 and IDF-13742

See merge request espressif/esp-idf!41602
2025-09-20 14:57:53 +02:00
Jiang Jiang Jian
44a66c7521 Merge branch 'feature/add_channel_switch_api_for_espnow' into 'master'
feat(wifi): Added switch channel api for espnow

Closes WIFI-6379 and WIFI-5499

See merge request espressif/esp-idf!38767
2025-09-20 13:33:33 +08:00
harshal.patil
ade76189c5 test(hal/crypto): Update AES test app to remove redundant block operation 2025-09-20 10:55:07 +05:30
harshal.patil
c36aef9c19 change(mbedtls/port): Wrap headers with relevant soc_caps
- Needed to fix builds for the targets that are yet to supported
2025-09-20 10:55:07 +05:30
harshal.patil
8992f08bef feat(mbedtls/aes): Add config to support AES block and DMA modes during runtime
- Dynamically switch the AES operation modes based on the buffer operating length
- Shorter AES and SHA operations can now run faster and concurrently as well

Closes https://github.com/espressif/esp-idf/issues/15914
2025-09-20 10:55:07 +05:30
Laukik Hase
ac89a6f896 Merge branch 'feature/esp_tee_sec_stg_sign_w_pbkdf2' into 'master'
feat(esp_tee): Support for PBKDF2-based (HMAC) ECDSA signing

See merge request espressif/esp-idf!41074
2025-09-20 10:28:00 +05:30
Jiang Jiang Jian
c0de85c7a5 Merge branch 'change/ble_update_lib_20250919' into 'master'
change(ble): [AUTO_MR] 20250919 - Update ESP BLE Controller Lib

See merge request espressif/esp-idf!42026
2025-09-20 12:08:37 +08:00
morris
4e4d97fed5 Merge branch 'refactor/update_component_dependency' into 'master'
feat: Update driver dependency for new version external components

See merge request espressif/esp-idf!41976
2025-09-20 05:06:23 +08:00
Tomas Rezucha
0ac4b9a94b Merge branch 'fix/usb_host_intr_prio' into 'master'
fix(usb/host): Use ESP_INTR_FLAG_LOWMED interrupt priority for USB examples

See merge request espressif/esp-idf!42048
2025-09-19 17:33:05 +02:00
Tomas Rezucha
617a608027 fix(usb/host): Use ESP_INTR_FLAG_LOWMED interrupt priority for USB examples 2025-09-19 14:12:53 +02:00
gaoxu
5ba8f6a13f refactor(rng): refactor to use hal/ll apis for S2 2025-09-19 20:02:04 +08:00
Shen Mengjing
71f8405742 docs: Add the updated CN translation 2025-09-19 17:01:29 +05:30
harshal.patil
5aa5366e7f fix(bootloader_support): Reorder write disabling ECDSA_CURVE_MODE 2025-09-19 17:01:23 +05:30
cjin
41ecf44cb3 feat(ble): get wakeup cause when wake up on ESP32-H2 2025-09-19 16:47:57 +08:00
cjin
470e02ea6b feat(ble): get wakeup cause when wake up on ESP32-C5 2025-09-19 16:47:45 +08:00
cjin
622b7cf425 feat(ble): get wakeup cause when wake up on ESP32-C6 2025-09-19 16:47:35 +08:00
cjin
6ae338de34 feat(ble): get wakeup cause when wake up on ESP32-C2 2025-09-19 16:47:18 +08:00
Tan Yan Quan
25b70b0756 feat(openthread): update thread-lib for new OT upstream 3b3dd203
* esp-openthread: thread_zigbee/esp-openthread@d9c9e535e
* openthread: espressif/openthread@3b3dd203b
* esp-idf: espressif/esp-idf@bab69aec4
2025-09-19 08:31:47 +00:00
harshal.patil
6be7a17ce0 fix(bootloader_support): Allow pre-programmed XTS-AES psuedo round level efuses
- The API esp_flash_encryption_set_release_mode() by defualt programs
the XTS-AES pseudo round level efuse to level low but did not considered
any existing value that would have been programmed in the efuse bit.
2025-09-19 13:55:50 +05:30
Tan Yan Quan
bab69aec4a feat(openthread): update OT upstream to 3b3dd203b 2025-09-19 16:09:07 +08:00
Sudeep Mohanty
75619d8ef5 Merge branch 'task/remove_vportcleanuptcb_support' into 'master'
remove(freertos): Remove legacy vPortCleanUpTCB user hook

Closes IDF-8097

See merge request espressif/esp-idf!41867
2025-09-19 10:03:07 +02:00
Lu Wei Ke
b4e6cd62db Merge branch 'docs/add_idf_docker_related_doc' into 'master'
docs: Add Related Documents to IDF Docker Image

Closes DOC-11665

See merge request espressif/esp-idf!42011
2025-09-19 16:03:01 +08:00
Marius Vikhammer
9d4ea4f365 fix(parlio): fixed funcition with side-effect called in assert() 2025-09-19 15:42:09 +08:00
Marius Vikhammer
484d2c5c2f fix(system): fixed issues with unused variable warnings when compiling with NDEBUG 2025-09-19 15:42:07 +08:00
Marius Vikhammer
b46d001f6d change(newlib): COMPILER_ASSERT_NDEBUG_EVALUATE default value changed to 'n'
Closes https://github.com/espressif/esp-idf/issues/2758
2025-09-19 15:41:18 +08:00
hrushikesh.bhosale
896c8ecc80 fix(http_server): Fix CI test failure async_handler
pytest trying to hit the server, before registration
of URI handlers or starting of server
2025-09-19 13:07:45 +05:30
Ondrej Kosta
bc421db41b Merge branch 'feat/kconfig_clk_rm' into 'master'
feat(esp_eth): removed RMII CLK Kconfig option

Closes IDF-9724

See merge request espressif/esp-idf!41853
2025-09-19 15:35:50 +08:00
harshal.patil
d6c1184676 fix(bootloader_support): Reorder write protection bits of some shared security efuses 2025-09-19 13:02:00 +05:30
C.S.M
79c69cfa17 Merge branch 'test/add_c5_p4_usj_test' into 'master'
test(usj): add esp32-p4 usj test

See merge request espressif/esp-idf!41733
2025-09-19 15:00:47 +08:00
Omar Chebib
e1c2ddeab6 Merge branch 'fix/esp32p4_eco5_clic' into 'master'
fix: get rid of the hardware workarounds for the latest ESP32P4 revision

Closes IDF-13409, IDF-13781, and IDF-13782

See merge request espressif/esp-idf!41719
2025-09-19 15:00:21 +08:00
Marius Vikhammer
0ac9dfbbe0 Merge branch 'feature/lp_core_exception_wake' into 'master'
feat(ulp): added lp-core exception as wake-up source

See merge request espressif/esp-idf!39159
2025-09-19 14:48:33 +08:00
Konstantin Kondrashov
b7da740f12 Merge branch 'feature/log_v2_optimization' into 'master'
feat(log): Optimize idf components for binary logging

Closes IDF-12775

See merge request espressif/esp-idf!40289
2025-09-19 14:45:43 +08:00
Laukik Hase
c152663408 feat(esp_tee): Added support for PBKDF2-based (HMAC) ECDSA signing 2025-09-19 12:06:02 +05:30
renpeiying
536ec82dd3 docs: Update translation for nvs_encryption and security docs 2025-09-19 10:38:39 +05:30
Laukik Hase
1ea0fc261d change(nvs_sec_provider): Make the HMAC-based NVS security scheme default for supported SoCs
- When NVS encryption is enabled on SoCs with the HMAC peripheral that have flash encryption
  enabled, the HMAC-based NVS encryption scheme is now selected as default instead of the
  flash encryption-based scheme.
- If your application previously used the flash encryption-based scheme, you need to manually
  configure the NVS encryption scheme to flash encryption from HMAC through ``menuconfig``
  or your project's ``sdkconfig`` (i.e., setting ``CONFIG_NVS_SEC_KEY_PROTECT_USING_FLASH_ENC=y``).
2025-09-19 10:38:38 +05:30
Laukik Hase
f565fc2481 change(nvs_flash): Add a private dependency of the nvs_sec_provider component
- Closes https://github.com/espressif/esp-idf/issues/17256
2025-09-19 10:17:46 +05:30
Laukik Hase
f60bcaaa4d feat(nvs_flash): Added an API to deregister the NVS security scheme context 2025-09-19 10:17:45 +05:30
Zhou Xiao
09a3b29d01 change(ble): [AUTO_MR] updated rom linker script for ESP32-C2 2025-09-19 11:22:47 +08:00
Zhou Xiao
a56e7df710 change(ble): [AUTO_MR] Update lib_esp32c2 to 58398575 2025-09-19 11:22:44 +08:00
Zhou Xiao
26dcd59599 change(ble): [AUTO_MR] Update lib_esp32c6 to 390a8efd 2025-09-19 11:22:44 +08:00
Zhou Xiao
b75f862797 change(ble): [AUTO_MR] Update lib_esp32c5 to 390a8efd 2025-09-19 11:22:44 +08:00
Zhou Xiao
a7b87fe832 change(ble): [AUTO_MR] Update lib_esp32h2 to 390a8efd 2025-09-19 11:22:44 +08:00
Konstantin Kondrashov
333a2c0ebc Merge branch 'fix/coverity_newlib' into 'master'
fix(newlib): Fixes Coverity issues

Closes IDF-13926 and IDF-13927

See merge request espressif/esp-idf!41491
2025-09-19 10:35:34 +08:00
Chen Chen
7ea6b7ea52 feat: Update driver dependency for new version outside components 2025-09-19 10:35:11 +08:00
Alexey Lapshin
0c00523235 Merge branch 'fix/newlib-asm-inlining-issue' into 'master'
fix(newlib): fix riscv asm inlining for mem functions

See merge request espressif/esp-idf!41623
2025-09-19 06:17:04 +04:00
Chen Ji Chang
a3bf1b1a09 Merge branch 'feat/enable_esptool_stub_for_p4eco5' into 'master'
feat(hw_support): enable esptool stub for p4eco5

See merge request espressif/esp-idf!41965
2025-09-18 20:44:20 +08:00
Sonika Rathi
94b81282c6 Merge branch 'feat/support_larger_than_4m_partition_on_linux_target' into 'master'
feat(esp_partition): add support for partition tables larger than 4MB with linux target

See merge request espressif/esp-idf!41312
2025-09-18 19:04:02 +08:00
Aditya Patwardhan
b0cdc82996 fix(ecdsa): Fixed ECDSA efuse purpose check condition 2025-09-18 15:29:25 +05:30
luweike
7e669d3a71 docs: Add Related Documents to IDF Docker Image 2025-09-18 17:12:38 +08:00
He Binglin
28c4172ae9 Merge branch 'bugfix/esp_idf_esp32_reject_sleep' into 'master'
fix(esp_hw_support): fix the configuration of reject sources

Closes IDFGH-15823

See merge request espressif/esp-idf!41852
2025-09-18 16:46:57 +08:00
Radek Tandler
553d1034b0 Merge branch 'bugfix/nvs_blob_overwrite' into 'master'
Bugfix of old NVS Blobs handling when legacy compatibility option is set

See merge request espressif/esp-idf!41741
2025-09-18 10:45:42 +02:00
Xu Si Yu
a0777a0ee5 fix(openthread): check if the command is valid before calling the input function 2025-09-18 16:21:13 +08:00
Guillaume Souchere
f8cb539e29 feat(heap): Update test to CMake and use Catch2 component 2025-09-18 10:07:08 +02:00
Guillaume Souchere
903d613a4e feat(esp_gdbstub): Update test to CMake and use Catch2 component 2025-09-18 10:07:08 +02:00
morris
4680b976f4 Merge branch 'feat/spi_p4_eco5_support' into 'master'
feat(driver_spi): update p4 eco5 spi and twai support

Closes IDF-13509, IDF-13434, and IDF-13726

See merge request espressif/esp-idf!41676
2025-09-18 15:18:46 +08:00
Kapil Gupta
b789198c9b Merge branch 'bugfix/cleanup_ctr_drbg' into 'master'
wpa_supplicant: Replace use of mbedtls_ctr_drbg with esp_mbedtls_random()

Closes IDFGH-14978

See merge request espressif/esp-idf!39221
2025-09-18 11:30:10 +05:30
Hrushikesh Bhosale
fd5b86d005 Merge branch 'fix/http_server_async_requests_on_same_socket_blocks' into 'master'
Fix async requests on same socket blocking server

Closes IDFGH-16057 and IDF-13859

See merge request espressif/esp-idf!41724
2025-09-18 13:51:54 +08:00
wanckl
550e98970b fix(driver_twai): fixed dual_filter with extid, more accurate sample point
Closes https://github.com/espressif/esp-idf/issues/17504
Closes https://github.com/espressif/esp-idf/issues/17522
2025-09-18 12:01:12 +08:00
wanckl
89578cb372 fix(driver_twai): fixed tec_rec empty from get_info
Closes https://github.com/espressif/esp-idf/issues/17434
2025-09-18 12:01:12 +08:00
wanckl
1e1bf5aea3 fix(driver_twai): added ctu_official listen only workaround
Closes https://github.com/espressif/esp-idf/issues/17461
2025-09-18 12:01:06 +08:00
Chen Chen
0e84ce7e69 feat(isp): Update hue for esp32p4eco5 2025-09-18 11:39:37 +08:00
C.S.M
464a0f432a test(usj): add p4 usj test 2025-09-18 11:29:23 +08:00
Marius Vikhammer
04fdae2f67 feat(ulp): added lp-core exception as wake-up source 2025-09-18 11:14:02 +08:00
Omar Chebib
63ad383c2a Merge branch 'fix/eh_frame_parser_warnings' into 'master'
fix(esp_system): fix potential warnings related to array size in .eh_frame parser

See merge request espressif/esp-idf!41935
2025-09-18 10:09:18 +08:00
Guilherme Ferreira
54b5210584 Merge branch 'contrib/github_pr_16199' into 'master'
Fix/ws transport reject multisec (GitHub PR)

Closes IDFGH-15569

See merge request espressif/esp-idf!41873
2025-09-18 06:37:06 +08:00
Ondrej Kosta
5c5eb99eab Merge branch 'fix/emac_test_tmo' into 'master'
fix(ci): increased timeout for ethernet_int_emac_test

Closes IDFCI-3118

See merge request espressif/esp-idf!41909
2025-09-17 20:20:32 +08:00
Kapil Gupta
2d1b94cdc7 Merge branch 'bugfix/add_dependency_suiteb_on_enterprise' into 'master'
fix(esp_wifi): Add depenedency of 192 bit config on wifi enterprise

Closes IDFGH-16434

See merge request espressif/esp-idf!41836
2025-09-17 16:40:52 +05:30
Ondrej Kosta
5aa97623c1 feat(esp_eth): removed RMII CLK Kconfig option 2025-09-17 11:46:06 +02:00
Nachiket Kukade
cd757f7bb4 Merge branch 'ci/fix_wifi_testcase' into 'master'
fix(unit_test): Fix esp_wifi and wpa_supplicant unit tests

Closes IDF-5046

See merge request espressif/esp-idf!38808
2025-09-17 17:35:04 +08:00
Tomas Rezucha
ce590e4bae feat(usb/device): Add USB device support to ESP32-P4 v3 2025-09-17 11:17:25 +02:00
Tomas Rezucha
1711ed88aa feat(usb/host): Add USB Host support to ESP32-P4 v3 2025-09-17 11:17:25 +02:00
Alexey Lapshin
3d056ad1e2 fix(newlib): fix riscv asm inlining for mem functions 2025-09-17 17:15:57 +08:00
Ivan Grokhotkov
714b7445e2 Merge branch 'feature/update-gdb-to-16.3_20250913'
feat(tools): update gdb version to 16.3_20250913

See merge request !41877
2025-09-17 11:14:05 +02:00
Armando (Dou Yiwen)
4a383012b3 Merge branch 'feature/p4_rev3_sdmmc' into 'master'
sdmmc: supported sdmmc on p4 ECO5 real chip, and UHS-I SDR104 (200MHz)

Closes IDF-12222, IDF-13731, and IDF-14050

See merge request espressif/esp-idf!41563
2025-09-17 09:09:24 +00:00
Alexey Lapshin
2d12315b62 fix(tools): clean gdbinit files generation 2025-09-17 16:58:02 +08:00
Alexey Lapshin
612b5f88db fix(tools): apply pre-commit hook changes 2025-09-17 16:58:02 +08:00
Sudeep Mohanty
df1e1c2b73 Merge branch 'task/make_task_snapshot_public' into 'master'
refactor(freertos): Make task snapshot debug API public

Closes IDF-10038 and IDF-8143

See merge request espressif/esp-idf!41871
2025-09-17 10:48:43 +02:00
Chen Jichang
16ea481a6f feat(hw_support): enable esptool stub for p4eco5 2025-09-17 16:25:02 +08:00
Marius Vikhammer
37855ef350 Merge branch 'docs/ulp_gpio_wakeup_supported_c5' into 'master'
docs(ulp): fixed ETM and LP_IO wakeup sources saying not supported

See merge request espressif/esp-idf!41798
2025-09-17 16:21:42 +08:00
Rahul Tank
d84d8ab1e1 Merge branch 'fix/connect_gap_event_status_handling' into 'master'
fix(nimble): Fixed incorrect HCI status in connect event

See merge request espressif/esp-idf!41847
2025-09-17 13:47:03 +05:30
Laukik Hase
537b36de7a Merge branch 'fix/esp_tee_misc' into 'master'
feat(esp_tee): Miscellaneous fixes and updates

Closes IDF-13856, IDFCI-3085, IDFCI-3094, and IDFCI-3105

See merge request espressif/esp-idf!41433
2025-09-17 13:36:22 +05:30
Tomas Rezucha
961c10bffc Merge branch 'fix/usj_disable_help' into 'master'
fix: Add clarifying note to USJ_ENABLE_USB_SERIAL_JTAG

Closes IDFGH-13778

See merge request espressif/esp-idf!41874
2025-09-17 09:23:29 +02:00
Marius Vikhammer
292107a8b4 docs(ulp): fixed ETM and LP_IO wakeup sources saying not supported 2025-09-17 15:21:18 +08:00
Sonika Rathi
e2954eb315 Merge branch 'fix/sdio_init_for_io_card_only' into 'master'
fix(sdmmc): Allow disabling SDIO specific steps in sdmmc card init

See merge request espressif/esp-idf!40735
2025-09-17 14:34:26 +08:00
C.S.M
92b90afa77 Merge branch 'fix/log_safe_in_timing_tuning' into 'master'
fix(flash): Modify the log safety in timing tuning

See merge request espressif/esp-idf!41922
2025-09-17 14:31:11 +08:00
Ondrej Kosta
7a35466da7 Merge branch 'feat/phy802_rst' into 'master'
feat(esp_eth): changed ETH PHY API of esp_eth_phy_802_3_reset_hw

Closes IDF-11362

See merge request espressif/esp-idf!41759
2025-09-17 14:20:27 +08:00
Chen Ji Chang
9dc9d7de9f Merge branch 'refactor/remove_legacy_rmt_driver' into 'master'
remove(legacy_rmt)!: remove legacy rmt driver in IDF v6.0

Closes IDF-13175

See merge request espressif/esp-idf!40092
2025-09-17 14:07:31 +08:00
Kapil Gupta
65ab48229e fix(esp_wifi): Add depenedency of 192 bit config on wifi enterprise
Closes https://github.com/espressif/esp-idf/issues/17567
2025-09-17 14:03:23 +08:00
nilesh.kale
54d97fdac1 fix(esp-tls): removed unncessary log for certificate verification
This commit removed unnecessary and confusing log for
certificate verify if there is another issue during tls connection.
2025-09-17 13:04:16 +08:00
nilesh.kale
421b9abd0d fix(esp-tls): added missing event tracker capture during mbedtls read operation
This commit fixed missing event tracker capture and
added new error code ESP_ERR_MBEDTLS_SSL_READ_FAILED.

Closes https://github.com/espressif/esp-idf/issues/16239
2025-09-17 13:04:16 +08:00
morris
d0557133f5 Merge branch 'feat/ast_grep_scan_more_hal_components' into 'master'
fix(ci): update ast-grep rules to include esp_hal components

See merge request espressif/esp-idf!41954
2025-09-17 12:33:33 +08:00
Song Ruo Jing
e1aabf036a Merge branch 'bugfix/add_usb_phy1_io_support_esp32h4' into 'master'
fix(gpio): add USB PHY1 (USB OTG) pin support for ESP32H4

See merge request espressif/esp-idf!41727
2025-09-17 12:24:13 +08:00
morris
72979fb6c2 fix(ci): update ast-grep rules to include esp_hal components 2025-09-17 12:05:37 +08:00
Wang Meng Yang
c0667e61fd Merge branch 'bugfix/fix_bt_coverity' into 'master'
bugfix: Fix array compared against 0 in btc_manage.c and the issue of uninitialized pointer reading in coexist_printf

Closes IDF-13868

See merge request espressif/esp-idf!41455
2025-09-17 11:03:30 +08:00
Island
d883eaa2c1 Merge branch 'fix/fix_ble_log_config_for_esp32c3' into 'master'
fix(ble): fixed ble log config for ESP32-C3/ESP32-S3

See merge request espressif/esp-idf!41949
2025-09-17 10:58:23 +08:00
Song Ruo Jing
addfa2aa01 Merge branch 'feature/esp32h21_esp32h4_ledc_support' into 'master'
feat(ledc): Add LEDC support for ESP32H21 and ESP32H4

Closes IDF-12343, IDF-12344, IDF-12920, IDF-11568, IDF-11569, IDF-12115, and IDF-13672

See merge request espressif/esp-idf!41172
2025-09-17 10:55:00 +08:00
Island
a3b8073d96 Merge branch 'change/ble_update_lib_20250828' into 'master'
change(ble): [AUTO_MR] 20250828 - Update ESP BLE Controller Lib

Closes BLERP-2183, BLERP-2083, BLERP-2195, and BLERP-2196

See merge request espressif/esp-idf!41601
2025-09-17 10:33:14 +08:00
Armando (Dou Yiwen)
aec7c03724 Merge branch 'feat/p4_rev3_isp' into 'master'
isp: basic support on p4 eco5

Closes IDF-13439

See merge request espressif/esp-idf!41682
2025-09-17 01:45:10 +00:00
radek.tandler
96f4f78054 ci(nvs_flash): Enabled nvs_host_test in ci 2025-09-16 20:45:25 +02:00
radek.tandler
ccb455fc63 fix(nvs_flash): Fixed host test case when legacy compatibility mode is enabled 2025-09-16 20:45:25 +02:00
radek.tandler
0f5c963a03 fix(nvs_flash): Host test adopted to the new clang initializer rules 2025-09-16 20:45:08 +02:00
Kapil Gupta
88d71da23f fix(mbedtls): Addressed comments on PR15679 2025-09-16 22:10:53 +05:30
sonika.rathi
4d91eac13f fix(sdmmc): Allow disabling SDIO specific steps in sdmmc card init 2025-09-16 22:24:10 +08:00
sonika.rathi
2fa2010aa4 feat(esp_partition): add support for partition tables larger than 4MB with linux target 2025-09-16 22:23:06 +08:00
Fu Hanxi
863d682614 Merge branch 'ci/use-new-bucket' into 'master'
ci: use new minio server

See merge request espressif/esp-idf!41894
2025-09-16 15:59:35 +02:00
Armando (Dou Yiwen)
a4c03ceb01 Merge branch 'change/remove_deprecated_items' into 'master'
change: remove deprecated items

See merge request espressif/esp-idf!41769
2025-09-16 13:43:28 +00:00
Sonika Rathi
bd3b9291e1 Merge branch 'fix/cid_481432_overflowed_constant' into 'master'
fix(fatfs): fix overflowed constant issue observed in mount_volume of ff.c

See merge request espressif/esp-idf!41542
2025-09-16 20:58:36 +08:00
Zhou Xiao
4247876b36 fix(ble): fixed ble log config for ESP32-C3/ESP32-S3 2025-09-16 20:18:22 +08:00
Roland Dobai
4e4378a765 Merge branch 'contrib/github_pr_17586' into 'master'
Fix warning message in install.sh. (GitHub PR)

Closes IDFGH-16454

See merge request espressif/esp-idf!41890
2025-09-16 12:57:01 +02:00
C.S.M
f00755319a Merge branch 'refactor/make_i2c_hal_independent' into 'master'
refactor(i2c): Make i2c hal layer independent

See merge request espressif/esp-idf!41562
2025-09-16 18:51:57 +08:00
Ondrej Kosta
2ed090ba3d feat(esp_eth): changed ETH PHY API of esp_eth_phy_802_3_reset_hw 2025-09-16 17:54:35 +08:00
Island
06f84d323d Merge branch 'feat/ble_log_v2_esp_target_support' into 'master'
Feat/ble log v2 esp target support

Closes BLERP-2169

See merge request espressif/esp-idf!41891
2025-09-16 17:54:35 +08:00
hrushikesh.bhosale
dee9d760cd feat(esp_http_server/async_handler): Add CI test for request on same socket
Added a CI test to request on same socket one after the another
2025-09-16 15:02:28 +05:30
hrushikesh.bhosale
cfc056018c fix(esp_http_server): Fix async requests on same socket blocking issue
1. In async requests, if the two or more requests are made on same
socket then it used to block the second request.
2. The main thread is used to block on select call. And there done
no FD_SET for particular fd.

Closes https://github.com/espressif/esp-idf/issues/16998
2025-09-16 15:02:05 +05:30
Tomas Rezucha
aaa72fcc19 fix: Add clarifying note to USJ_ENABLE_USB_SERIAL_JTAG
Closes https://github.com/espressif/esp-idf/issues/14638
2025-09-16 17:31:39 +08:00
Laukik Hase
57432bb336 fix(esp_tee): Skip taking the service call mutex when in critical sections
- Fixes INT_WDT timeouts with mmap operations
- Add test-case for verifying parallel service calls
2025-09-16 14:57:27 +05:30
Laukik Hase
d8edbc8acf feat(esp_tee): ASM routine fixes and improvements
- Fix incorrect setting in the edge interrupt acknowledgement API
- Avoid executing the service call dispatcher in the U-mode ecall,
  rather execute `mret` to jump it
- Avoid `t1` register corruption when processing `ecall`
- Switch back to the bootloader stack from TEE stack after the
  execution of the entire TEE initialization routine
2025-09-16 14:57:10 +05:30
Laukik Hase
8b812d4192 feat(esp_tee): Miscellaneous fixes and updates
- Rename `tee_test_fw` app configs for better CI tracking
- Decrease the lower bound of TEE I/DRAM config options
- Trim the TEE test-apps build
- Improve the TEE/REE OTA pytest script with additional checks
- Fix build issues when `tee_sec_storage`/`tee_ota_ops` are a
  a part of the project build but ESP-TEE is disabled
2025-09-16 14:54:06 +05:30
Fu Hanxi
02531c5dce Merge branch 'ci/generate-build-child-pipeline' into 'master'
fix: union the build test set

See merge request espressif/esp-idf!41914
2025-09-16 11:20:39 +02:00
yangfeng
4e39ac7d49 fix(bt/btc): Fix array compared against 0 in btc_manage.c 2025-09-16 17:10:36 +08:00
yangfeng
d5758cd823 fix(esp_coex): Fix the issue of uninitialized pointer reading in coexist_printf 2025-09-16 17:10:36 +08:00
morris
1af474b1ae Merge branch 'bugfix/some_lcd_improvement' into 'master'
fix(lcd): allow i80 lcd to skip the setting of clk_src as default choice

See merge request espressif/esp-idf!41928
2025-09-16 16:54:10 +08:00
Roland Dobai
9e5304a77f change(tools): Fix ruff linting issues in idf_tools.py 2025-09-16 10:44:55 +02:00
Roland Dobai
791a70e6f3 fix(tools): Fix warning message from idf_tools.py 2025-09-16 16:35:03 +08:00
Artyom Lebedev
b13dcadfa2 fix(tools): Fix warning message from idf_tools.py
Closes https://github.com/espressif/esp-idf/pull/17586
2025-09-16 16:35:03 +08:00
Chen Jichang
092aa00be4 fix(rmt): fix the regression from gdma link refactor 2025-09-16 15:20:30 +08:00
Chen Jichang
883ead113d remove(legacy_rmt): remove legacy rmt driver in IDF v6.0 2025-09-16 15:20:10 +08:00
Zhou Xiao
10649fddc5 feat(ble): supported ble log v2 for ESP32 2025-09-16 14:43:07 +08:00
Zhou Xiao
1edaf8ebc1 feat(ble): supported ble log v2 for ESP32-C3/ESP32-S3 2025-09-16 14:43:03 +08:00
Omar Chebib
f2d6cbd832 fix(esp_system): fix potential warnings related to array size in .eh_frame parser 2025-09-16 14:41:22 +08:00
Zhou Xiao
66504599ba feat(ble): supported ble log v2 for ESP32-C5 2025-09-16 14:31:36 +08:00
Zhou Xiao
4a408af219 feat(ble): supported ble log v2 for ESP32-C2 2025-09-16 14:31:36 +08:00
Zhou Xiao
6758a47044 feat(ble): supported ble log v2 for ESP32-H2 2025-09-16 14:31:36 +08:00
Zhou Xiao
a9a7677ea8 feat(ble): supported ble log v2 for ESP32-C6 2025-09-16 14:31:36 +08:00
Zhou Xiao
d8a62a827d fix(ble): fixed ble log v2 configuration issues 2025-09-16 14:31:32 +08:00
morris
8e33c73451 fix(lcd): allow i80 lcd to skip the setting of clk_src as default choice 2025-09-16 14:22:26 +08:00
C.S.M
1b0b5ece97 fix(flash): Modify the log safety in timing tuning 2025-09-16 14:08:39 +08:00
morris
48ad332fd2 Merge branch 'docs/update_32khz_oscillator_amplitude_instructions' into 'master'
docs: Update the amplitude constraints for external 32 kHz oscillator

Closes DOC-12245

See merge request espressif/esp-idf!41693
2025-09-16 14:08:24 +08:00
Meet Patel
b59b3665c5 Merge branch 'refactor/lp_core_i2c_esp32c5_support' into 'master'
refactor(lp_core_i2c): Modify lp_core_i2c header to support ESP32C5

Closes IDF-14065

See merge request espressif/esp-idf!41885
2025-09-16 10:55:43 +05:30
Shen Mengjing
7943b1ff58 docs: Update the amplitude constraints for external 32 kHz oscillator 2025-09-16 12:12:06 +08:00
armando
28786d0732 feat(sdmmc): supported UHS-I SDR104 (200 MHz) on ESP32-P4 rev3 2025-09-16 12:03:03 +08:00
Song Ruo Jing
da785a8f71 fix(gpio): add USB PHY1 (USB OTG) pin support for ESP32H4 2025-09-16 11:59:04 +08:00
Song Ruo Jing
1cb1acd02e fix(ledc): update LEDC test file to cpp style 2025-09-16 11:18:10 +08:00
Song Ruo Jing
24a9cb7dde refactor(dedic_gpio): clean up dedic gpio soc caps 2025-09-16 11:18:10 +08:00
Song Ruo Jing
3e464a508e feat(ledc): Add channel deconfiguration option to release the occupied IOs
Closes https://github.com/espressif/esp-idf/issues/15666
2025-09-16 11:17:59 +08:00
morris
f4c40f7e69 Merge branch 'feat/dsi_bridge_new_feat' into 'master'
feat(dsi): More DPHY Clock sources supported on ESP32-P4 ECO5

Closes IDF-13537 and IDF-13538

See merge request espressif/esp-idf!41766
2025-09-16 10:24:36 +08:00
Kevin (Lao Kaiyao)
ac24f96a87 Merge branch 'feature/support_touch_on_p4_eco5' into 'master'
feat(touch): support touch sensor on p4 eco5

Closes IDF-13423 and IDF-13424

See merge request espressif/esp-idf!41802
2025-09-16 10:06:44 +08:00
Kevin (Lao Kaiyao)
e8ea973d50 Merge branch 'feature/support_i2s_on_p4_eco5' into 'master'
change(i2s): update i2s soc and hal for p4 hw_ver3

Closes IDF-13732

See merge request espressif/esp-idf!41688
2025-09-16 09:55:28 +08:00
Marius Vikhammer
166269fb93 Merge branch 'change/remove_deprecated_esp_rom_status' into 'master'
change(rom): removed deprecated STATUS enum, use ETS_STATUS instead

Closes IDF-7044 and DOC-12309

See merge request espressif/esp-idf!41860
2025-09-16 09:41:31 +08:00
armando
9a4d37f109 feat(isp): support on p4 rev3 2025-09-16 01:10:28 +00:00
zwl
c58f07ed1e feat(ble): add console command to get dtm rx rssi in hci example 2025-09-16 00:06:40 +08:00
zwl
b40f7c773b feat(ble): add console command to get dtm rx rssi on ESP32-C6 2025-09-16 00:06:40 +08:00
zwl
fc293cf672 fix(ble): update ext_version on ESP32-C5 2025-09-16 00:06:40 +08:00
zwl
b091ec843c fix(ble): update ext_version on ESP32-H2 2025-09-16 00:06:40 +08:00
zwl
3558f20a4e fix(ble): update ext_version on ESP32-C6 2025-09-16 00:06:40 +08:00
zwl
32c3556c7a change(ble): [AUTO_MR] updated rom linker script for ESP32-C2 2025-09-16 00:06:40 +08:00
zwl
0ec2a92d79 change(ble): [AUTO_MR] Update lib_esp32c2 to e08d6058 2025-09-16 00:06:40 +08:00
zwl
32a510900c change(ble): [AUTO_MR] Update lib_esp32c6 to 000475d3 2025-09-16 00:06:40 +08:00
zwl
77cf75ed53 change(ble): [AUTO_MR] Update lib_esp32c5 to 000475d3 2025-09-16 00:06:40 +08:00
zwl
141362fe48 change(ble): [AUTO_MR] Update lib_esp32h2 to 000475d3 2025-09-16 00:06:40 +08:00
Sajia
e68a552cbf fix(unit_test): Fix esp_wifi and wpa_supplicant unit tests
- Fixed offchan and eloop unit tests
 - Added more targets for wpa_supplicant unit tests
 - Removed ESP_WIFI_TESTING_OPTIONS from esp_wifi Kconfig
2025-09-15 20:30:20 +05:30
morris
42be8c8dbf feat(dsi): can use gray8 image as input 2025-09-15 22:52:01 +08:00
morris
eedbd9f8e3 feat(dsi): split the dphy config clock and pll reference clock
this is a breaking change in the esp32p4 ver3.0 silicon.
2025-09-15 22:52:01 +08:00
morris
b7fc7acb23 refactor(dsi): deprecate pixel_format configuration in favor of in_color_format 2025-09-15 22:52:01 +08:00
morris
9cee386af9 Merge branch 'refactor/remove_i2c_lcd_legacy' into 'master'
refactor(lcd_i2c): Remove legacy driver version used in lcd driver

Closes IDF-13719

See merge request espressif/esp-idf!39799
2025-09-15 22:17:45 +08:00
radek.tandler
233a76e808 fix(nvs_flash): Fixed overwrite of V1 BLOB when legacy compatibility mode is in place 2025-09-15 16:16:28 +02:00
Sudeep Mohanty
bb0f072c7a refactor(freertos): Make task snapshot debug API public
This commit makes the task snapshot related API public under the header
freertos_debug.h.
2025-09-15 16:13:29 +02:00
Song Ruo Jing
f56ce6334b feat(ledc): Add LEDC support for ESP32H21 and ESP32H4 2025-09-15 22:04:35 +08:00
hebinglin
ad0eb8ee87 fix(esp_hw_support): fix the configuration of reject sources 2025-09-15 21:21:41 +08:00
Fu Hanxi
54f57d0f47 fix: union the build test set 2025-09-15 15:11:18 +02:00
Konstantin Kondrashov
16d73cdab3 feat(log): Adds ESP_LOG_ATTR macro to control section placement 2025-09-15 15:59:52 +03:00
Konstantin Kondrashov
dcf486359e feat(log): Optimize log tag init for bin logging 2025-09-15 15:59:52 +03:00
Fu Hanxi
a2db7b56aa ci: use new minio server 2025-09-15 14:55:43 +02:00
Konstantin Kondrashov
00e90bea33 feat(log): Optimization of log buffers for bin log mode 2025-09-15 15:40:46 +03:00
Konstantin Kondrashov
8e7ed24eb6 feat(log): Reserve first 4 bytes as zero for vars pointed to NULL
For bin log, reserve the first 4 bytes as zero for variables that are pointed to NULL
and should not be printed in the log. So the esp-idf-monitor will skip printing
those variables.
2025-09-15 15:40:45 +03:00
Meet Patel
93cbfcf139 refactor(lp_core_i2c): Modify lp_core_i2c header to support ESP32C5
lp_core_i2c.h header file has sda and scl pins hardcoded to GPIO6 and
GPIO7 which works only for ESP32C6. ESP32C5 uses GPIO2 and GPIO3 for
I2C SDA and SCL. Hence, added LP_I2C_SCL_IO and LP_I2C_SDA_IO macros
under conditional compilation in library header file, so there is no
need to hardcode I2C GPIO pins and any other test apps or examples
that are including the LP I2C header file can also use Macro directly.
2025-09-15 17:30:20 +05:30
Ondrej Kosta
f7c4178103 fix(ci): increased timeout for ethernet_int_emac_test 2025-09-15 13:55:25 +02:00
Mahavir Jain
b05300be39 Merge branch 'bugfix/encrypt_len_for_sb_update_case' into 'master'
fix(bootloader): correct encryption length for secure update without secure boot

See merge request espressif/esp-idf!41665
2025-09-15 15:48:26 +05:30
Martin Vychodil
d4e58bf7dc Merge branch 'feature/esp_blockdev_component' into 'master'
feat(storage): Added block device layer interface component

Closes IDF-13495

See merge request espressif/esp-idf!40152
2025-09-15 17:46:13 +08:00
Armando (Dou Yiwen)
e95945bc59 Merge branch 'feat/p4_rev3_csi' into 'master'
csi: support on p4 eco5

Closes IDF-13736

See merge request espressif/esp-idf!41670
2025-09-15 07:40:33 +00:00
Tomas Rezucha
a9ba907a31 Merge branch 'docs/usb-ext-phy-tusb1106' into 'master'
docs(usb): add TUSB1106 to tested external PHY list

See merge request espressif/esp-idf!41855
2025-09-15 09:29:11 +02:00
Tomas Rezucha
5efa5ab9f5 Merge branch 'feature/usb_device_examples_update_v2.0.0' into 'master'
feature(usb_device): Examples update to esp_tinyusb v2.0.0

Closes IDF-13618

See merge request espressif/esp-idf!41610
2025-09-15 09:28:49 +02:00
Mahavir Jain
a148c61bef test: add test case for secure update with FE case 2025-09-15 12:31:57 +05:30
Mahavir Jain
e46313568b fix(bootloader): correct encryption length for secure update without secure boot
For secure update without secure boot case, the encryption length for
app image must consider signature block length as well. This was
correctly handled for secure boot case but not for secure update without
secure boot.
2025-09-15 12:31:56 +05:30
Astha Verma
e25ae45614 fix(nimble): Fixed incorrect HCI status in connect event 2025-09-15 10:54:46 +05:30
C.S.M
5ce39e8878 refactor(i2c): Make i2c hal layer independent 2025-09-15 11:26:48 +08:00
wanckl
7cb69a825f feat(driver_twai): update p4 eco5 twai support on real chip 2025-09-15 11:15:48 +08:00
wanckl
17e8ea18e5 feat(driver_spi): update p4 eco5 spi support on real chip 2025-09-15 11:15:48 +08:00
Deomid rojer Ryabkov
f933e51ad9 change(wpa_supplicant): Replace use of mbedtls_ctr_drbg with esp_mbedtls_random()
This way wpa_supplicant does not require ctr_drbg that saves some space
2025-09-15 11:09:21 +08:00
Deomid rojer Ryabkov
aa581523c9 feat(mbedtls): Add mbedtls_esp_random()
Suitable for passing as f_rng to various Mbed-TLS APIs that require it
2025-09-15 11:09:21 +08:00
zhangyanjiao
0f80318327 feat(wifi/espnow): Added switch channel API and remain on channel API for espnow 2025-09-15 11:07:00 +08:00
C.S.M
5ae6f626fc refactor(lcd_i2c): Remove legacy driver version used in lcd driver 2025-09-15 11:04:54 +08:00
armando
00022a379a change: remove deprecated items 2025-09-15 10:52:28 +08:00
Zhang Shuxian
8833953070 docs: Update translation for ROM Headers 2025-09-15 10:50:28 +08:00
laokaiyao
15c48ef1bc change(i2s): update i2s soc and hal for p4 hw_ver3 2025-09-15 10:38:14 +08:00
laokaiyao
87b19c10ad feat(touch): support touch sensor on p4 eco5 2025-09-15 10:36:49 +08:00
Marius Vikhammer
af91aa771b change(rom): removed deprecated STATUS enum, use ETS_STATUS instead 2025-09-15 10:36:16 +08:00
Marius Vikhammer
ab2829d65f Merge branch 'change/remove_legacy_unit_test_app' into 'master'
change(tools): removed the old legacy unit-test-app

Closes IDF-13565

See merge request espressif/esp-idf!41859
2025-09-15 10:12:13 +08:00
armando
406c54ebfb feat(csi): support csi on p4 rev3 2025-09-15 01:10:47 +00:00
armando
08d38349e4 change(dsi): add dpi_type configs 2025-09-15 01:10:47 +00:00
Marius Vikhammer
582bf08eb5 change(tools): removed the old legacy unit-test-app 2025-09-15 08:57:01 +08:00
Kapil Gupta
f82bcd2a65 Merge branch 'bugfix/dpp_roc_loop_error' into 'master'
fix(esp_wifi): Correctly set roc_in_progress flag

Closes WIFI-7013

See merge request espressif/esp-idf!41722
2025-09-14 22:52:56 +05:30
Shreyas Sheth
0e00b0f45b fix(esp_wifi): Correctly set roc_in_progress flag
Fix roc_in_progress flag to be set in `dpp_listen_next_channel` right after calling
`esp_wifi_remain_on_channel` to correctly reflect the ROC status.
2025-09-14 22:23:34 +05:30
morris
14ee268b3e Merge branch 'feat/update_h264_struct_bitfield' into 'master'
fix: standardize bitfield format in H264 struct headers

See merge request espressif/esp-idf!41598
2025-09-14 22:11:08 +08:00
Martin Vychodil
2d2f381bc3 feat(storage): Added Block Device Layer interface component 2025-09-14 14:48:35 +02:00
Alexey Lapshin
dba0925068 feat(tools): update gdb version to 16.3_20250913 2025-09-13 13:28:44 +00:00
igor.masar
06a32f2467 docs(usb): add TUSB1106 to tested external PHY list 2025-09-12 17:19:23 +02:00
Richard Allen
ec09815ed5 fix(transport_ws): Reject multiple Sec-WebSocket-Accept headers
Enforce RFC6455 requirement:
    The |Sec-WebSocket-Accept| header MUST NOT
    appear more than once in an HTTP response.
2025-09-12 10:03:42 -03:00
Guilherme Ferreira
eaa552f0fc Merge branch 'contrib/github_pr_16119' into 'master'
feat(ws_transport): add header callback hook (GitHub PR)

Closes IDFGH-15479

See merge request espressif/esp-idf!41596
2025-09-12 20:21:21 +08:00
C.S.M
e49093a2e2 Merge branch 'feat/jpeg_eco5' into 'master'
feat(jpeg): Add yuv444 yuv420 format support for encoder on esp32p4 eco5

Closes IDF-13532

See merge request espressif/esp-idf!41768
2025-09-12 20:13:07 +08:00
Hrushikesh Bhosale
eb1f0f4c6f Merge branch 'fix/build_failure_when_sbv2_ecdsa_enabled' into 'master'
fix(esp_tls): Fixed build failure for sbv2 ecdsa

See merge request espressif/esp-idf!41778
2025-09-12 20:06:13 +08:00
Ashish Sharma
030ba7d8cf Merge branch 'contrib/github_pr_17470' into 'master'
fix(http_server): Corrected initialization value for lru_counter at h… (GitHub PR)

Closes IDFGH-16325

See merge request espressif/esp-idf!41639
2025-09-12 19:59:20 +08:00
Harshal Patil
de36c80335 Merge branch 'fix/key_mgr_state_management' into 'master'
Fix incorrect key manager state management

See merge request espressif/esp-idf!41796
2025-09-12 17:09:52 +05:30
Rahul Tank
d1b3fd17db Merge branch 'bugfix/fix_periodic_reattempt' into 'master'
fix(nimble): Fixed reattempt count handling for perdiodic adv

Closes BLERP-2217, BLERP-2218, BLERP-2219, and BLERP-2220

See merge request espressif/esp-idf!41735
2025-09-12 16:21:46 +05:30
Roman Leonov
852ecc3338 feat(network): Update sta2eth example to esp_tinyusb v2.0.0 2025-09-12 11:28:38 +02:00
Roman Leonov
e55b7fe2b5 feat(usb_device): Update examples to esp_tinyusb v2.0.0 2025-09-12 11:28:35 +02:00
Ren Peiying
8c43f5491c Merge branch 'docs/add_link_to_qemu_doc' into 'master'
docs: add qemu doc link

See merge request espressif/esp-idf!41746
2025-09-12 17:13:43 +08:00
Xu Si Yu
1e0f4d8c82 Merge branch 'fix/fix_usb_ot_rcp_send' into 'master'
fix(openthread): resolve the RCP data transmission issue over USB Serial JTAG

See merge request espressif/esp-idf!41715
2025-09-12 17:08:58 +08:00
houhaiyan
9618527603 fix: standardize bitfield format in H264 struct headers 2025-09-12 17:06:28 +08:00
C.S.M
01a362ccb4 feat(jpeg_encoder): Add yuv444 and yuv420 jpeg encoder format on esp32p4 eco5 2025-09-12 16:45:13 +08:00
morris
609bf37fa0 Merge branch 'fix/cherry_usb_component_version_fix' into 'master'
feat(cherry_usb): Pin cherryusb component version

See merge request espressif/esp-idf!41818
2025-09-12 16:17:51 +08:00
Joonline
9e7074dd35 fix(http_server): Corrected initialization value for lru_counter at http session creation
Closes https://github.com/espressif/esp-idf/pull/17470
2025-09-12 15:31:27 +08:00
peter.marcisovsky
af4f9cbaed feat(cherry_usb): Pin cherryusb component version
- prerequisite for usb component migration from esp-idf
2025-09-12 09:13:29 +02:00
glmfe
11f8534266 feat(ws_transport): Merged set_header_hook and set_header_userp functions 2025-09-12 13:39:41 +08:00
Richard Allen
58befcae26 feat(transport_ws): add header callback hook
Move to a line-by-line header parser.
Support a callback hook for each header-line.
Migrate "Location" and "Sec-WebSocket-Accept" parsing.

Part of https://github.com/espressif/esp-protocols/issues/715
2025-09-12 13:39:41 +08:00
Richard Allen
cd4982a14f feat(transport_ws): buffer redir_host separately
Buffer separately to simplify future improvements.
2025-09-12 13:39:41 +08:00
harshal.patil
854ec3590f fix(esp_key_mgr): Fix incorrect key manager state management 2025-09-12 11:02:45 +05:30
Mahavir Jain
e6f945978e Merge branch 'fix/trigger_finish_event_if_data_retreived_successfully' into 'master'
fix(esp_http_client): fix dispatching of finish event condition

Closes IDFGH-16285

See merge request espressif/esp-idf!41624
2025-09-12 09:30:21 +05:30
Marius Vikhammer
2ca22098a8 Merge branch 'docs/freertos_watermark_bytes' into 'master'
docs(freertos): fixed stack watermark documentation bytes vs words issue

See merge request espressif/esp-idf!41667
2025-09-12 10:23:03 +08:00
Marius Vikhammer
365c8a3c37 Merge branch 'fix/remove_intr_types_header' into 'master'
fix(interrupts): removed deprecated intr_types.h header

Closes IDF-8190

See merge request espressif/esp-idf!41668
2025-09-12 10:22:52 +08:00
Marius Vikhammer
1ed1e95129 Merge branch 'bugfix/duplicate_lf_usb_console' into 'master'
fix(console): fixed leftover linker fragmentfile

See merge request espressif/esp-idf!41710
2025-09-12 00:01:07 +08:00
Sudeep Mohanty
c76cc9a24d remove(freertos): Remove legacy vPortCleanUpTCB user hook
This commit removes support for the vPortCleanUpTCB() user hook as well
as drops support for associated Kconfig option,
CONFIG_FREERTOS_STATIC_TASK_CLEAN_UP.
2025-09-11 16:05:11 +02:00
Alexey Gerenkov
4f90f3c507 Merge branch 'coredump_conditional_builds' into 'master'
change(coredump): make conditional build in cmake based on config options

Closes IDF-13794

See merge request espressif/esp-idf!41698
2025-09-11 20:13:25 +08:00
Alexey Gerenkov
ffad794b02 Merge branch 'docs/update_esp32h4_jtag_debugging' into 'master'
docs: update esp32h4 debugging docs (jtag + coredump)

Closes IDF-12954 and IDF-12958

See merge request espressif/esp-idf!41696
2025-09-11 18:22:18 +08:00
Rahul Tank
b72bbfdec9 Merge branch 'bugfix/set_tx_power_in_example' into 'master'
fix(nimble): Add Tx power information in adv data

Closes BLERP-2235

See merge request espressif/esp-idf!41797
2025-09-11 14:25:09 +05:30
morris
516a46c395 Merge branch 'revert/spi_lcd_mode_auto_detect' into 'master'
revert(lcd): data line number auto detect

See merge request espressif/esp-idf!41795
2025-09-11 16:33:27 +08:00
Ivan Grokhotkov
0d10158016 Merge branch 'feature/rename-newlib-to-esp_libc' into 'master'
change(esp_libc): rename newlib component to esp_libc

Closes IDF-11226

See merge request espressif/esp-idf!41584
2025-09-11 09:34:43 +02:00
Rahul Tank
0c9e215685 fix(nimble): Fixed reattempt count handling for perdiodic adv 2025-09-11 12:46:54 +05:30
Mahavir Jain
cf38555647 Merge branch 'refactor/move_api_to_set_ecdsa_key_blk_to_ecdsa_ll.h' into 'master'
refactor(hal): moved API efuse_ll_set_ecdsa_key_blk() to ecdsa_ll.h

Closes IDF-13549

See merge request espressif/esp-idf!41149
2025-09-11 12:27:32 +05:30
Kevin (Lao Kaiyao)
be099ca81f Merge branch 'refactor/move_touch_element_to_managed_component' into 'master'
remove(touch_element): remove touch_element from idf

Closes IDF-6155 and IDF-13348

See merge request espressif/esp-idf!41702
2025-09-11 14:55:55 +08:00
Wang Tao
67e149c9c0 Merge branch 'fix/dhcp_decline_restart_issue' into 'master'
fix(lwip): fix dhcp arp check issue

See merge request espressif/esp-idf!41605
2025-09-11 14:43:57 +08:00
Mahavir Jain
cde30c2407 Merge branch 'fix/rng_entropy_mixing_with_rtc_timer' into 'master'
fix(esp_hw_support): Fixed entropy mixing of RTC timer with RNG

See merge request espressif/esp-idf!41723
2025-09-11 12:01:39 +05:30
nilesh.kale
845275c6f1 fix(esp_http_client): fix dispatching of finish event condition
This commit updates the condition for dispatching of FINISH event.
With this, FINISH event will be dispatched after complete data is read.

Closes https://github.com/espressif/esp-idf/issues/17437
2025-09-11 14:18:28 +08:00
morris
08dc794e25 revert(lcd): data line number auto detect
quad_mode and octal_mode are not bus attribute but transaction attribute
in esp-idf SPI master driver

Closes https://github.com/espressif/esp-idf/issues/17455
2025-09-11 13:34:15 +08:00
morris
e3190c630a Merge branch 'refactor/remove_deprecated_driver_header_files' into 'master'
refactor(driver): remove deprecated header files && update P4 ECO5 registers for BS and LCD_CAM

Closes IDF-13733 and IDF-13745

See merge request espressif/esp-idf!41745
2025-09-11 13:29:10 +08:00
wangtao@espressif.com
c2d87d962b fix(lwip): fix dhcp arp check issue 2025-09-11 13:23:49 +08:00
Aditya Patwardhan
0cd73dfb43 fix(esp_hw_support): Fixed entropy mixing of RTC timer with RNG
Previously the RTC timer entropy was being mixed with the RNG timer
    in a wrong way. Which led to the overwriting of the LSB with rtc
    timer value.
    This change fixes that behaviour
2025-09-11 09:41:25 +05:30
Mahavir Jain
b8b4a4f065 Merge branch 'change/exclude_cve-2025-57052' into 'master'
change(cjson): Update to v1.7.19

See merge request espressif/esp-idf!41749
2025-09-11 09:40:49 +05:30
Mahavir Jain
ea24d5a0bf Merge branch 'fix/cjson_cpe' into 'master'
fix(cjson): add CPE with davegamble as vendor

See merge request espressif/esp-idf!41781
2025-09-11 09:39:10 +05:30
Island
208c7d2b87 Merge branch 'feat/ble_log_v2' into 'master'
feat(ble): refactored ble log module with layered design

Closes BLERP-2177, BLERP-2176, BLERP-2175, BLERP-2174, BLERP-2173, BLERP-2172, BLERP-2171, BLERP-2170, BLERP-2169, and BLERP-2185

See merge request espressif/esp-idf!41574
2025-09-11 10:50:18 +08:00
Marius Vikhammer
ecf0accf00 fix(console): fixed leftover linker fragmentfile
Placement rules now lives in the usb-cdc console component, but the old unused
file was still in esp-vfs
2025-09-11 10:35:45 +08:00
Island
07d9bb90de Merge branch 'fix/uninited_local_var_in_nimble_example' into 'master'
fix(ble): init return code in nimble example

Closes BLERP-2233

See merge request espressif/esp-idf!41783
2025-09-10 22:00:44 +08:00
Roland Dobai
6c1b6b6c99 Merge branch 'feat/readme_preview_chip_support' into 'master'
Add ESP32-H4 into the chip support matrix

Closes IDF-12242

See merge request espressif/esp-idf!41784
2025-09-10 13:02:52 +02:00
Ashish Sharma
70d9308f16 change(cjson): update cjson version to 1.7.19 2025-09-10 18:29:18 +08:00
Rahul Tank
035735ea2d fix(nimble): Add Tx power information in adv data 2025-09-10 15:40:24 +05:30
Roland Dobai
032b070cf8 feat(tools): Add ESP32-H4 into the chip support matrix 2025-09-10 10:55:24 +02:00
Mahavir Jain
b789445a67 Merge branch 'contrib/github_pr_17501' into 'master'
fix(esp_http_server): fix memory leak in httpd_req_async_handler_begin (GitHub PR)

Closes IDFGH-16361

See merge request espressif/esp-idf!41748
2025-09-10 13:15:36 +05:30
Chen Chen
02b2f6994c Merge branch 'example/i2c_u8g2' into 'master'
feat(i2c_u8g2_example): Add example for porting u8g2 display lib

Closes IDF-13798

See merge request espressif/esp-idf!41645
2025-09-10 15:41:24 +08:00
Marius Vikhammer
99935402b9 fix(interrupts): removed deprecated intr_types.h and interrupt_deprecated.h headers
intr_types.h has been replaced by esp_intr_types.h and the deprecated esprv_intc_*
from interrupt_deprecated.h have been replaced by the more generic
esprv_* functions.
2025-09-10 15:06:27 +08:00
Fu Hanxi
8f09a81463 Merge branch 'ci/increase_job_timeout' into 'master'
ci: increase build timeout

See merge request espressif/esp-idf!41496
2025-09-10 09:02:58 +02:00
Zhou Xiao
916f87b333 fix(ble): init return code in nimble example
* Closes https://github.com/espressif/esp-idf/issues/17547
2025-09-10 13:17:39 +08:00
Michael (XIAO Xufeng)
760e88a758 Merge branch 'feat/add_c5_c61_supported_master' into 'master'
feat(tools): add c5, c61 into supported targets list

See merge request espressif/esp-idf!41654
2025-09-10 11:36:11 +08:00
Marius Vikhammer
926817e872 docs(freertos): fixed stack watermark documentation bytes vs words issue
Upstream freertos reports stack sizes in words, while IDF-kernel uses bytes.
2025-09-10 08:50:16 +08:00
Erhan Kurubas
0d97c63885 change(coredump): make conditional build in cmake based on config options 2025-09-10 05:23:20 +08:00
Frantisek Hrbata
3263bb36b0 fix(cjson): add CPE with davegamble as vendor
The latest cJSON vulnerabilities appear to list "davegamble" as the
vendor instead of "cjson_project." Add a new CPE with "davegamble" as
the vendor.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-09-09 16:30:52 +02:00
Alexey Lapshin
9281e78381 change(esp_libc): rename newlib component to esp_libc 2025-09-09 22:00:44 +08:00
hrushikesh.bhosale
bf7dc18bd6 fix(esp_tls): Fixed build failure for sbv2 ecdsa
Made ESP_TLS_ECDSA_CURVE_SECP384R1 under SOC CAP.
2025-09-09 16:01:04 +05:30
Sudeep Mohanty
b719292b75 refactor(build-system): Simplify flash target creation
This commit refactors the flash target creation. Now bootloader and
partition table components add dependencies to the flash target directly
from their component CMakeLists.txt files instead of it being done in
the esptool_py component. The commit also removes the redundant
__esptool_py_setup_main_flash_target() function.
2025-09-09 12:21:31 +02:00
nilesh.kale
efb29736bb refactor(hal): moved ECDSA APIs from efuse to ecdsa 2025-09-09 15:01:32 +05:30
Xu Si Yu
132db34cfe fix(openthread): resolve the RCP data transmission issue over USB Serial JTAG 2025-09-09 14:08:09 +08:00
Lu Wei Ke
aae5071dff Merge branch 'docs/external_ram_vddspi' into 'master'
docs: Update external RAM voltage control for ESP32-S2/S3

Closes DOC-11795

See merge request espressif/esp-idf!41666
2025-09-09 10:46:56 +08:00
Zhou Xiao
b9dbc2ece7 feat(ble): refactored ble log module with layered design 2025-09-08 22:12:51 +08:00
Sergei Silnov
ee92f1371a Merge branch 'feat/jira_webhook' into 'master'
Set up GitHub Actions workflow to trigger JIRA issue comment webhook

See merge request espressif/esp-idf!41492
2025-09-08 14:19:22 +02:00
Shen Meng Jing
ab2ebaa26e Merge branch 'docs/update_cn_build_system' into 'master'
docs: Update the CN translation for build-system.rst

Closes DOC-12214

See merge request espressif/esp-idf!41692
2025-09-08 14:32:14 +08:00
renpeiying
5b7f668a35 docs: add qemu doc link 2025-09-08 11:42:27 +08:00
morris
c6f02a638d feat(soc):update lcd registers on esp32p4 rev3.0 2025-09-08 11:05:25 +08:00
morris
2991bcaa91 feat(ds18b20): upgrade the example to use ds18b20 version 0.2 2025-09-08 11:05:25 +08:00
morris
a157181399 refactor(driver): remove deprecated header files
use esp_private/periph_ctrl.h and esp_private/rtc_cntl.h in favor of
driver/periph_ctrl.h and driver/rtc_cntl.h
2025-09-08 11:05:25 +08:00
Xiao Xufeng
826db0f90f feat(tools): add c5, c61 into supported targets list 2025-09-08 02:44:59 +08:00
wangtao@espressif.com
d49ebfbae3 fix(doc): fix get start process in port notes 2025-09-04 16:25:23 +08:00
Jiang Jiang Jian
d85ad74c7f Merge branch 'feat/add_usj_notes_to_sleep_examples' into 'master'
change(example): adds USB-Serial-JTAG console usage notes to sleep examples

Closes IDFGH-15488

See merge request espressif/esp-idf!40990
2025-09-04 15:33:58 +08:00
Guillaume Souchere
dea3fd2ceb fix(console): Add input validation in arg_utils.c functions 2025-09-04 08:33:44 +02:00
Zhang Shu Xian
6b57250f8f Merge branch 'docs/update_translation_for_system' into 'master'
docs: Update CN translation for system.rst

Closes DOC-12244

See merge request espressif/esp-idf!41725
2025-09-04 14:10:26 +08:00
Ren Peiying
32f3fc37ff Merge branch 'feat/update_cn_chatbot_ui_language' into 'master'
Localize CN chatbot UI

See merge request espressif/esp-idf!41712
2025-09-04 14:06:39 +08:00
Mahavir Jain
9ddb3cda20 Merge branch 'fix/cleanup_ota_src_file' into 'master'
cleanup: remove ota app descriptor source

See merge request espressif/esp-idf!41703
2025-09-04 09:21:48 +05:30
Chen Chen
4ca0a9ffbe feat(i2c_u8g2_example): Add example and test for porting u8g2 display lib 2025-09-04 11:39:30 +08:00
laokaiyao
f15a60f2f6 remove(touch_element): remove touch_element from idf
Touch Element Library is moved to managed component.
(https://components.espressif.com/components/espressif/touch_element/versions/1.0.0/readme)
2025-09-04 11:26:17 +08:00
Shen Mengjing
5914456b52 docs: Update the CN translation for build-system.rst 2025-09-04 10:08:40 +08:00
Zhang Shuxian
58c976a262 docs: Update CN translation for system.rst 2025-09-03 19:15:44 +08:00
Omar Chebib
cea17beaba fix: get rid of the hardware workarounds for the latest ESP32P4 revision 2025-09-03 17:35:26 +08:00
morris
012318db96 Merge branch 'feat/support_pcnt_on_h4' into 'master'
feat(pcnt): support pcnt on esp32h4

Closes IDF-12338 and IDF-13637

See merge request espressif/esp-idf!41526
2025-09-03 17:15:11 +08:00
Darian Leung
589d5b132d feat(esp_ringbuf): Add vRingbufferReset
Function has similar behavior to xQueueReset() where...
    - Buffer is emptied
    - Blocked sender is unblocked

Aslo added associated unit test cases.
2025-09-03 10:55:23 +02:00
Li Shuai
6e45f4df9a Merge branch 'feat/support_esp32h4_top' into 'master'
Support cpu & modem & top domain and minimum system peripherals retention in esp32h4 beta5

Closes PM-449, PM-484, PM-448, PM-451, PM-497, IDF-12283, and IDF-12286

See merge request espressif/esp-idf!40605
2025-09-03 16:28:33 +08:00
renpeiying
9e1096c41a Localize CN chatbot UI 2025-09-03 14:42:32 +08:00
C.S.M
13ec7d2d2a Merge branch 'docs/uhci_doc_compiling' into 'master'
docs(uhci): Fix uhci compiling on non-supported target

See merge request espressif/esp-idf!41677
2025-09-03 13:45:20 +08:00
Mahavir Jain
ce4ef7a2bf cleanup: remove ota app descriptor source
Leftover from earlier cleanup commit 42914e01ee
2025-09-03 09:09:04 +05:30
C.S.M
1b4ad917c5 docs(uhci): Fix uhci compiling on non-supported target 2025-09-03 10:35:38 +08:00
Li Peng
36229958d9 Merge branch 'feat/add_cherryusb_demo' into 'master'
feat(usb): add CherryUSB serial device and host example

See merge request espressif/esp-idf!39467
2025-09-03 10:14:46 +08:00
Veranika Saltanava
804c119556 ci(github-actions): set up GitHub Actions workflow to trigger JIRA issue comment webhook 2025-09-02 15:48:43 +02:00
Erhan Kurubas
fa472d0e41 docs(coredump): update docs_not_updated for esp32h4 2025-09-02 15:01:26 +03:00
Erhan Kurubas
2661c994db docs(jtag): update esp32h4 jtag debugging guide 2025-09-02 14:42:55 +03:00
Alexey Lapshin
0a7ace356d Merge branch 'change/remove-sys_dirent_h-include' into 'master'
change(newlib): prepare dirent.h to remove

Closes IDF-10675 and LLVM-330

See merge request espressif/esp-idf!41608
2025-09-02 13:42:18 +04:00
morris
7c369baf7a Merge branch 'feat/p4_eco5_pcnt' into 'master'
feat(pcnt,mcpwm,rmt): update struct on p4 eco5

Closes IDF-13734, IDF-13517, IDF-13738, IDF-13440, and IDF-13520

See merge request espressif/esp-idf!41571
2025-09-02 17:22:48 +08:00
Armando (Dou Yiwen)
f259da6a99 Merge branch 'fix/add_esp_video_url_in_camera_readme' into 'master'
doc: add esp-video link in camera isp examples

See merge request espressif/esp-idf!41646
2025-09-02 06:44:07 +00:00
Wang Yu Xin
7cd612a74b doc: add esp-video link in camera isp examples 2025-09-02 06:44:07 +00:00
Mahavir Jain
632dac5feb Merge branch 'doc/adds_sni_documentation' into 'master'
docs(esp_http): adds documentation regarding sni

See merge request espressif/esp-idf!41586

Related https://github.com/espressif/esp-idf/issues/9392
2025-09-02 09:26:12 +05:30
Gao Xu
8222f884cb Merge branch 'fix/wrong_channel_gpio_num_on_p4_adc2' into 'master'
ADC: add continuous parse data API

See merge request espressif/esp-idf!40243
2025-09-02 11:17:51 +08:00
Chen Ji Chang
290e3d655d Merge branch 'feat/p4_eco5_gdma' into 'master'
feat(gdma): update gdma struct on p4 eco5

Closes IDF-13729

See merge request espressif/esp-idf!41569
2025-09-02 11:12:37 +08:00
LiPeng
1f76ea953e fix(usb): fix ths bug that ALT escape input for USB HID keyboard 2025-09-02 10:42:39 +08:00
Shen Meng Jing
5e4f67cc68 Merge branch 'docs/update_cn_toolchain' into 'master'
docs: Update CN translation for toolchain.rst and ram-usage.rst

Closes DOC-12092

See merge request espressif/esp-idf!41477
2025-09-01 21:54:19 +08:00
Rahul Tank
7ef3215011 Merge branch 'fix/table_structure' into 'master'
fix(nimble): Restructure the table in README.md file

See merge request espressif/esp-idf!41647
2025-09-01 17:14:22 +05:30
Shen Mengjing
8777791852 docs: Update CN translation for toolchain.rst and ram-usage.rst 2025-09-01 17:00:22 +08:00
Chen Jichang
444346d3b3 feat(gdma): update gdma struct on p4 eco5 2025-09-01 15:29:21 +08:00
Chen Jichang
c2a95b1bcf feat(pcnt,mcpwm,rmt): update struct on p4 eco5 2025-09-01 15:29:05 +08:00
luweike
3a2185b5e8 docs: Update external RAM voltage control for ESP32-S2/S3 2025-09-01 15:15:42 +08:00
Armando (Dou Yiwen)
a92168b934 Merge branch 'fix/improve_adc_oneshot_example_adc2_channel_selection' into 'master'
adc: removed oneshot example dead code for channel selection

See merge request espressif/esp-idf!41631
2025-09-01 06:56:35 +00:00
morris
151f943105 Merge branch 'refactor/i2c_tool_clean_up' into 'master'
refactor(i2c): clean up the i2ctool example

See merge request espressif/esp-idf!41638
2025-09-01 14:48:56 +08:00
renpeiying
e1eca70d2b docs: Update CN translation for esp_tls.rst 2025-09-01 12:09:05 +08:00
Chen Jichang
ad5bdc83a7 feat(pcnt): support pcnt on esp32h4 2025-09-01 10:50:55 +08:00
Gao Xu
abaa608074 Merge branch 'feat/dvp_format_trans' into 'master'
feat(cam): support format conversion function

See merge request espressif/esp-idf!40890
2025-09-01 10:16:38 +08:00
hebinglin
852aab4b64 change(esp_hw_support): replace pmu reg operation with pmu ll layer code 2025-09-01 10:13:52 +08:00
hebinglin
cfecbc99ce change(esp_hw_support): update sleep cpu flow 2025-09-01 10:13:52 +08:00
hebinglin
e2534b1b5f change(esp_hw_support): update wait pll calibration done in sleep_clock 2025-09-01 10:13:52 +08:00
hebinglin
752ca902f6 feat(esp_hw_support): support rtcio & extio wakeup in esp32h4 beta5 2025-09-01 10:13:52 +08:00
hebinglin
b0c8bd7236 change(esp_hw_support): optimize sleep retated parameters in esp32h4beta5 2025-09-01 10:13:52 +08:00
hebinglin
88fb870346 change(soc): support xtal32k in esp32h4beta5 2025-09-01 10:13:52 +08:00
hebinglin
ea2aaea88c change(hal): update lpperiph structure file and support rtcio for esp32h4beta5 2025-09-01 10:13:51 +08:00
hebinglin
0f04aa2359 change(esp_hw_support): support light sleep with top domain power down for esp32h4beta5 2025-09-01 10:13:51 +08:00
hebinglin
6078f64be4 change(esp_hw_support): update pau regdma register driver for esp32h4beta5 2025-09-01 10:13:51 +08:00
hebinglin
1a367fa649 fix(esp_hw_support): esp32h4 beta5 i2c config retention when pd modem refer to PM-487 2025-09-01 10:13:51 +08:00
hebinglin
cd294435dd change(esp_hw_support): support light sleep with modem domain power down for esp32h4beta5 2025-09-01 10:13:51 +08:00
hebinglin
bc4c9952bb change(esp_hw_support): support cpu domain power down and cpu retention for esp32h4 beta5 2025-09-01 10:13:51 +08:00
hebinglin
909573f8e7 Revert "change(esp_hw_support): comment out for ci pass in esp32h4beta5"
This reverts commit 9f4a568163.
2025-09-01 10:13:51 +08:00
gaoxu
3c7e54c422 feat(adc): add adc_continuous_parse_data api 2025-09-01 09:30:24 +08:00
gaoxu
622c07e0b2 fix(adc): fix ESP32-P4 ADC2 wrong channel num 2025-09-01 09:30:24 +08:00
Michael (XIAO Xufeng)
f236d29aee Merge branch 'test/gen_disabled_report' into 'master'
ci: generate report for disabled apps

See merge request espressif/esp-idf!40354
2025-08-31 23:43:27 +08:00
Xiao Xufeng
5c6150033a ci: generate report for disabled apps 2025-08-31 00:24:24 +08:00
Alexey Lapshin
bc4a9ad406 change(newlib): remove sys/dirent.h from newlib component 2025-08-30 19:52:33 +07:00
Shreeyash
5fd48c8393 fix(nimble): Restructure the table in README.md file 2025-08-29 18:13:30 +05:30
Chen Jichang
04b934951e refactor(pcnt): clean up the soc_caps.h file for PCNT 2025-08-29 17:13:46 +08:00
Sergei Silnov
3a42fd8ca8 Merge branch 'ci/pre-commit-fix' into 'master'
ci(github-actions/pre-commit): Wrap Python version in quotes

See merge request espressif/esp-idf!41630
2025-08-29 10:40:15 +02:00
Ashish Sharma
08a4a2b506 docs(esp_tls): adds documentation regarding sni 2025-08-29 16:13:42 +08:00
Chen Chen
00e5effb42 Merge branch 'doc/fix_i2c_typo' into 'master'
docs(i2c_master): Fix a typo in description

Closes IDFGH-16329

See merge request espressif/esp-idf!41439
2025-08-29 16:01:29 +08:00
morris
5db3254999 Merge branch 'fix/p4_edma_size' into 'master'
fix(gdma): correct the max burst size of p4 edma

See merge request espressif/esp-idf!41594
2025-08-29 15:54:53 +08:00
morris
57034c3bcf refactor(i2c): clean up the i2ctool example
removed unused console cli.
removed unnecessary dependencies.
behaviour changed: user must run the i2cconfig command before others
updated pytest as well
2025-08-29 15:52:02 +08:00
Mahavir Jain
6f5ec4b5a5 Merge branch 'bugfix/update_documentation_for_esp_http_client' into 'master'
fix(esp_http_client): fixed documentation for API esp_http_client_set_post_field()

Closes IDFGH-16112

See merge request espressif/esp-idf!41561
2025-08-29 13:21:02 +05:30
Alexey Lapshin
1275129a62 Merge branch 'fix/actulize_newlib_kconfig_variables' into 'master'
fix(config): actualize newlib Kcongig options

See merge request espressif/esp-idf!41301
2025-08-29 11:37:44 +04:00
Erhan Kurubas
9f38fa1b9a Merge branch 'test/sysview_uart' into 'master'
test(app_trace): add SystemView UART tracing tests for all targets

Closes IDF-11919, IDF-11920, IDF-11921, DOC-12212, and IDF-7660

See merge request espressif/esp-idf!41552
2025-08-29 09:37:37 +02:00
He Binglin
829f8d7835 Merge branch 'feat/esp_idf_c5_doc' into 'master'
docs(pm): update power management related docs for esp32c5

Closes IDF-9439

See merge request espressif/esp-idf!41389
2025-08-29 15:24:18 +08:00
armando
ae184a0682 change(adc): improve oneshot example channel selection 2025-08-29 15:21:20 +08:00
Peter Dragun
f212ddbd6d ci(github-actions/pre-commit): Wrap Python version in quotes 2025-08-29 08:53:32 +02:00
Alexey Lapshin
620d1cb519 Merge branch 'feature/enable_esp_chip_tuning' into 'master'
feat(build): enable -mtune=esp-base option for RISCV targets

See merge request espressif/esp-idf!40164
2025-08-29 10:52:03 +04:00
Jakub Kocka
117919d7d6 Merge branch 'fix/click_version' into 'master'
Fixed click deprecation warnings

Closes IDF-13075 and IDF-13088

See merge request espressif/esp-idf!40765
2025-08-29 14:48:55 +08:00
hebinglin
616991dd40 docs(pm): update power management related docs for esp32c5 2025-08-29 13:01:17 +08:00
Chen Chen
91d00fbbd7 docs(i2c_master): Fix a typo in description
Closes https://github.com/espressif/esp-idf/issues/17475
2025-08-29 11:22:41 +08:00
morris
6c968cee04 Merge branch 'feature/p4_eco5_real_chip' into 'master'
p4: p4 eco5 real chip

Closes IDF-13574 and IDF-13410

See merge request espressif/esp-idf!41396
2025-08-29 10:59:28 +08:00
Marius Vikhammer
5d98c9010b Merge branch 'bugfix/lp_core_array_bounds_p4' into 'master'
fix(lp_core): fixed array-bound warning when compiling on P4 with -Os

Closes IDFGH-16115

See merge request espressif/esp-idf!41583
2025-08-29 09:55:12 +08:00
Marius Vikhammer
adf05d99da Merge branch 'ci/fix_cpp_leak_test_case' into 'master'
test(cpp): fixed cpp test case mem leak

Closes IDFCI-3108

See merge request espressif/esp-idf!41585
2025-08-29 09:53:59 +08:00
Salvatore Mesoraca
fd33d02563 fix(esp_http_server): fix memory leak in httpd_req_async_handler_begin
Free scratch memory when response headers allocation fails
2025-08-29 02:11:13 +02:00
Jiang Jiang Jian
7a650c6d90 Merge branch 'bugfix/fixed_c5_rx_data_err' into 'master'
feat(ble): fixed ble rx pdu error issue on ESP32-C5

Closes BLERP-2193, BLERP-2192, and BLERP-2194

See merge request espressif/esp-idf!41572
2025-08-28 21:42:06 +08:00
Sudeep Mohanty
5eb8e746fc Merge branch 'fix/build_system_create_bin_gen_tgts' into 'master'
feat(build-system): Create build system hooks for post-elf processing

Closes IDFGH-16204

See merge request espressif/esp-idf!41097
2025-08-28 14:35:21 +02:00
armando
179d00a6f8 feat(p4): p4 rev3 real chip support 2025-08-28 17:56:16 +08:00
yanzihan@espressif.com
d4a821a03e feat(clk): add 100m/200m/400m cpu freq & change clk cal & change blk version 2025-08-28 17:40:37 +08:00
nilesh.kale
2d437a6d9a fix(esp_http_client): fixed documentation for API esp_http_client_set_post_data()
Closes https://github.com/espressif/esp-idf/issues/17053
2025-08-28 14:55:55 +05:30
morris
3655d4cdca Merge branch 'feat/mipi_dsi_p4_eco5' into 'master'
ESP32P4 ECO5 register update: DSI/TIMG/ETM/DW_GDMA

Closes IDF-13735, IDF-13429, IDF-13422, and IDF-13428

See merge request espressif/esp-idf!41568
2025-08-28 17:11:38 +08:00
Chen Jichang
a9959455ce fix(gdma): p4 ahb dma can assess psram 2025-08-28 17:02:50 +08:00
Chen Jichang
4df8aa247b fix(gdma): correct the max burst size of p4 edma 2025-08-28 17:01:44 +08:00
Zhang Shuxian
f8e0b79867 docs: Update CN translation for system 2025-08-28 16:44:52 +08:00
Ashish Sharma
6acdf78438 Merge branch 'doc/add_tls_client_session_management_doc' into 'master'
docs: Adds doc for client session tickets

Closes IDF-13019

See merge request espressif/esp-idf!39521
2025-08-28 16:12:58 +08:00
Jiang Jiang Jian
0bc2286c2a Merge branch 'docs/esp32c5_programming_guide' into 'master'
docs(wifi): support esp32c5 wifi programming guide docs

See merge request espressif/esp-idf!35218
2025-08-28 16:07:55 +08:00
Konstantin Kondrashov
eeb4ec56d0 Merge branch 'fix/esp_ringbuf_nosplit_full_return_one' into 'master'
feat(esp_ringbuf): Fixes full no-split buffer frees item incorrectly

Closes IDFGH-16320

See merge request espressif/esp-idf!41437
2025-08-28 15:31:51 +08:00
Marius Vikhammer
9c059738d3 Merge branch 'ci/ulp_defaults_config' into 'master'
ci(ulp): fixed default config not running in CI

See merge request espressif/esp-idf!41564
2025-08-28 15:13:58 +08:00
renpeiying
773c6ba164 docs: Update translation for esp_tls.rst 2025-08-28 14:26:09 +08:00
gaoxu
1e674fa044 feat(cam): support format conversion function 2025-08-28 14:14:36 +08:00
yinqingzhao
ab5dd9dd2d feat(docs): support esp32c5 wifi programming guide docs 2025-08-28 14:05:55 +08:00
Marius Vikhammer
140effda53 fix(lp_core): fixed array-bound warning when compiling on P4 with -Os
Closes https://github.com/espressif/esp-idf/issues/17054
2025-08-28 13:19:56 +08:00
Alexey Lapshin
28ced4efad fix(config): actualize newlib Kconfig options 2025-08-28 12:25:09 +08:00
Kevin (Lao Kaiyao)
42b065bdce Merge branch 'bugfix/add_modem_etm_into_cmake' into 'master'
fix(modem_etm): fixed the compile issue

See merge request espressif/esp-idf!41379
2025-08-28 12:13:16 +08:00
Alexey Lapshin
4ecb6c4f9f Merge branch 'change/remove_roms_json_from_tools' into 'master'
move roms json from tools to components

Closes IDF-11693

See merge request espressif/esp-idf!41436
2025-08-28 07:12:44 +04:00
morris
626fad990d chore(soc): checked P4-ECO5 regsiters for dw_gdma,timg,etm,dsi
chore(mipi_dsi): checked the register on P4 ECO5

checked timg and etm registers
2025-08-28 11:02:27 +08:00
Chen Chen
c4957f8cf1 Merge branch 'feat/esp32p4_i2c_eco5_support' into 'master'
refactor(i2c_p4eco5): update i2c_struct.h on P4 ECO5

Closes IDF-13728

See merge request espressif/esp-idf!41502
2025-08-28 11:01:08 +08:00
Marius Vikhammer
cb36cd3a94 Merge branch 'bugfix/esp_event_remove_freertos_header' into 'master'
change(esp_event): removed unnecessary freertos header includes

Closes IDF-5130

See merge request espressif/esp-idf!41476
2025-08-28 09:50:25 +08:00
Li Shuai
3549016311 Merge branch 'feat/static_sleep_cpu_retention_buffer_support' into 'master'
Support static sleep cpu retention

See merge request espressif/esp-idf!40778
2025-08-28 09:47:59 +08:00
Marius Vikhammer
1207e2cb7a test(cpp): fixed cpp test case mem leak 2025-08-28 09:38:40 +08:00
Omar Chebib
686165a7fc Merge branch 'fix/eh_frame_infinite_loop' into 'master'
fix(esp_system): prevent .eh_frame-based unwinding from looping indefinitely

Closes IDF-13814, BLERP-2140, BLERP-2152, BLERP-2153, and BLERP-2154

See merge request espressif/esp-idf!41164
2025-08-28 09:36:56 +08:00
Alexey Lapshin
c7db23458e Merge branch 'feature/gdbstub_q_and_xesppie_registers_support' into 'master'
GDBStub: riscv: support f- and q-registers

Closes IDF-7279 and IDF-12552

See merge request espressif/esp-idf!37484
2025-08-28 04:45:47 +04:00
Konstantin Kondrashov
e2a1a7be35 Merge branch 'fix/coverity_console' into 'master'
fix(system): Fixes Coverity issues

Closes IDF-13862, IDF-13869, IDF-13872, IDF-13873, IDF-13910, IDF-13908, IDF-13863, IDF-13878, IDF-13903, IDF-13902, and IDF-13907

See merge request espressif/esp-idf!41414
2025-08-28 03:15:35 +08:00
zwl
eaf12518af feat(ble): fixed ble rx pdu error issue on ESP32-C5 2025-08-27 19:58:45 +08:00
Konstantin Kondrashov
3ef17fe231 feat(esp_ringbuf): Fixes full no-split buffer frees item incorrectly
Closes https://github.com/espressif/esp-idf/issues/17466#issuecomment-3209730773
2025-08-27 14:02:20 +03:00
Erhan Kurubas
a4e06f0792 test(app_trace): add SystemView UART tracing tests for all targets 2025-08-27 13:44:16 +03:00
Marius Vikhammer
a791f7e85d ci(ulp): fixed default config not running in CI 2025-08-27 17:13:46 +08:00
LiPeng
8f9eeedae1 feat(usb): add CherryUSB support for multiple USB controllers selection 2025-08-27 16:59:37 +08:00
LiPeng
0ac445cbd6 feat(usb): add CherryUSB host msc example 2025-08-27 16:59:37 +08:00
LiPeng
4366f118ed feat(usb): add ALT escape input for USB HID keyboard 2025-08-27 16:59:37 +08:00
LiPeng
6069bdcdca feat(examples/peripherals/usb/cherryusb/host/cherryusb_host): add CherryUSB host example 2025-08-27 16:59:37 +08:00
LiPeng
f866fbd9bc feat(examples/peripherals/usb/cherryusb/device/cherryusb_serial_device): add CherryUSB serial device example 2025-08-27 16:59:37 +08:00
C.S.M
b191c34647 Merge branch 'fix/update_eco5_i3c_struct' into 'master'
fix(i3c): Update i3c master register struct

Closes IDF-13730

See merge request espressif/esp-idf!41508
2025-08-27 16:50:50 +08:00
Omar Chebib
11f3c47b95 fix(esp_system): prevent .eh_frame-based unwinding from looping indefinitely 2025-08-27 16:01:06 +08:00
laokaiyao
093a444d74 fix(modem_etm): fixed the compile issue 2025-08-27 15:48:35 +08:00
Alexey Lapshin
c8ff79a023 fix(gdbstub): remove unsupported options in qSupported packet 2025-08-27 14:45:10 +07:00
Alexey Lapshin
9958287a64 feat(gdbstub): add f- and q-registers support 2025-08-27 14:45:06 +07:00
Kevin (Lao Kaiyao)
a5bd9d2d13 Merge branch 'feature/i2s_support_merge_simplex_to_duplex' into 'master'
feat(i2s): support to lazy constitute full-duplex mode

Closes IDF-11696

See merge request espressif/esp-idf!39428
2025-08-27 14:46:56 +08:00
Alexey Lapshin
ecc37c12d7 feat(build): enable -mtune=esp-base option for RISC-V targets
The `-mtune=esp-base` option is identical to the default tuning profile,
except that `slow_unaligned_access` is set to false.

This reduces the instruction count for built-in `memcpy` and improves
performance, since our chips can handle misaligned access with minimal
penalty (without triggering exceptions).

Example:

  void load(uint32_t *r, char* x) {
    memcpy(r, x, sizeof(uint32_t));
  }
  void store(char* x, uint32_t v) {
    memcpy(x, &v, sizeof(uint32_t));
  }

Previously generated code:

  load:
        lbu     a5,2(a1)
        lbu     a3,0(a1)
        lbu     a4,1(a1)
        sb      a5,2(a0)
        sb      a3,0(a0)
        sb      a4,1(a0)
        lbu     a5,3(a1)
        sb      a5,3(a0)
        ret
  store:
        srli    a3,a1,8
        srli    a4,a1,16
        srli    a5,a1,24
        addi    sp,sp,-16
        sb      a1,0(a0)
        sb      a3,1(a0)
        sb      a4,2(a0)
        sb      a5,3(a0)
        addi    sp,sp,16
        jr      ra

With `-mtune=esp-base`:

  load:
        lw      a5,0(a1)
        sw      a5,0(a0)
        ret
  store:
        sw      a1,0(a0)
        ret

Inlining behavior
=================

Without `-mtune=esp-base`:
  - `memcpy()` is inlined only when the compile-time size is ≤ 12 bytes.
    - Maximum cost: ~25 instructions

With `-mtune=esp-base`:
  - `memcpy()` is inlined for all compile-time constant sizes.
    - Maximum cost: ~14 instructions

As a result, some applications may see reduced code size, while others
may increase slightly. However, performance always improves because
extra `memcpy` calls are eliminated.

Performance results
===================

esp32p4 (Ethernet iperf):
  - No noticeable difference

esp32c61 (Wi-Fi iperf):
  - ~2 Mb/s increase for TCP and UDP TX (may be within measurement error)

NOTE
====

Applies only to RISC-V chips that do not have the hardware issue marked
by the SOC_CPU_MISALIGNED_ACCESS_ON_PMP_MISMATCH_ISSUE macro.
2025-08-27 12:46:41 +07:00
Chen Ji Chang
2044fba6e7 Merge branch 'feat/h4_mp_update_rom_linker' into 'master'
feat(h4mp): update rom linker (part3)

Closes IDF-13770

See merge request espressif/esp-idf!41213
2025-08-27 11:43:40 +08:00
morris
5efe1dbe33 Merge branch 'contrib/github_pr_17422' into 'master'
fix: I2C driver should use I2C_CLK_SRC_REF_TICK e (GitHub PR)

Closes IDFGH-16266

See merge request espressif/esp-idf!41188
2025-08-27 11:04:46 +08:00
Li Shuai
d208a27ef5 feat(sleep): Increased/modified files for static sleep cpu retention buffer support 2025-08-27 09:51:51 +08:00
Li Shuai
b43f0ddc70 feat(sleep): Modify the build system 2025-08-27 09:50:21 +08:00
Fu Hanxi
b111672f42 Merge branch 'fix/kconfig-optional-dependency' into 'master'
fix(build): pass sdkconfig.json during injection to add kconfig optional dependencies correctly

See merge request espressif/esp-idf!41470
2025-08-26 16:38:52 +02:00
Fu Hanxi
de098b9a5f Merge branch 'fix/menuconfig-reload-sdkconfig-json' into 'master'
fix: make sure sdkconfig.json is updated after running the menuconfig

See merge request espressif/esp-idf!41495
2025-08-26 16:36:54 +02:00
Konstantin Kondrashov
91a2744d44 fix(rt): Fixes Coverity false positive in va_list initialization 2025-08-26 22:13:50 +08:00
Konstantin Kondrashov
1ca82baec3 fix(heap): Fixes Coverity false positive in va_list initialization 2025-08-26 22:13:50 +08:00
Konstantin Kondrashov
ca2ccf164c fix(log): Fixes Coverity false positive in va_list initialization 2025-08-26 22:13:50 +08:00
Konstantin Kondrashov
9b11b69a46 fix(console): Fixes Coverity false positive in va_list initialization 2025-08-26 22:13:50 +08:00
Jiang Jiang Jian
e6a11ba88e Merge branch 'fix/wrong_auth_mode_in_sta_connected_evt' into 'master'
fix(wifi): send correct wifi_auth_mode_t in WIFI_EVENT_STA_CONNECTED and logs

See merge request espressif/esp-idf!40769
2025-08-26 21:43:19 +08:00
sonika.rathi
b6956d7bc8 fix(fatfs): fix overflowed constant issue observed in mount_volume of ff.c 2025-08-26 13:58:56 +02:00
Jakub Kocka
6a8e47baf8 ci(pre-commit): Enhanced ruff pre-commit check to show fixes for better debugging 2025-08-26 13:50:45 +02:00
Jakub Kocka
2affbb9509 refactor(tools): Updated tests to corespond with massage changes 2025-08-26 13:50:45 +02:00
Jakub Kocka
7b65c5e0b7 refactor(tools): Strings to f-strings conversion an other pre-commit issues 2025-08-26 13:50:45 +02:00
Jakub Kocka
f1143b0b93 fix(tools): Fixed click function usage to solve deprecation issue 2025-08-26 13:50:45 +02:00
Jakub Kocka
c568e3e3de fix(tools): Avoided using the click's deprecated __version__ 2025-08-26 13:50:45 +02:00
Wan Lei
fecbfdc84d Merge branch 'fix/twai_legacy_zero_trans' into 'master'
fix(twai): twai legacy driver fixed zero dlc transmit

Closes IDFGH-16321

See merge request espressif/esp-idf!41425
2025-08-26 18:17:15 +08:00
laokaiyao
e3bf25de1c feat(i2s): support to lazy constitute full-duplex mode 2025-08-26 15:49:29 +08:00
Chen Ji Chang
f160701c29 Merge branch 'fix/rmt_tx_loop_mode' into 'master'
fix(rmt): correct the condition for warnings in loop mode

See merge request espressif/esp-idf!41060
2025-08-26 14:49:32 +08:00
Lu Wei Ke
14f2d9e6cf Merge branch 'docs/migration_guides_bt_classic' into 'master'
docs: Add SoC conditional flag for Bluetooth Classic in migration guides

Closes DOC-11554

See merge request espressif/esp-idf!41440
2025-08-26 14:37:45 +08:00
C.S.M
93e63944b5 fix(i3c): Update i3c master register struct 2025-08-26 14:27:48 +08:00
Aditya Patwardhan
cc37708f98 Merge branch 'feature/remove_ds_and_rsa_support_for_esp32h4' into 'master'
feat: remove ds and mpi support for esp32h4

Closes IDF-12443, IDF-12444, and IDF-12970

See merge request espressif/esp-idf!41339
2025-08-26 11:49:15 +05:30
Chen Ji Chang
f54046ae3a Merge branch 'fix/fix_twai_pre_commit' into 'master'
fix(twai): fix cybergear pre-commit check

See merge request espressif/esp-idf!41507
2025-08-26 13:38:05 +08:00
Chen Jichang
2496588185 fix(twai): fix cybergear pre-commit check 2025-08-26 13:25:26 +08:00
Dai Zi Yan
95cd03c724 Merge branch 'docs/clarify_c2_esp8684_relation' into 'master'
docs: add clarification about the relationship between ESP32-C2 and ESP8684

See merge request espressif/esp-idf!41454
2025-08-26 04:23:19 +00:00
Chen Chen
2ff0e32696 refactor(i2c_p4eco5): update i2c_struct.h on P4 ECO5
Update the i2c_struct.h file to support P4ECO5.
2025-08-26 12:10:59 +08:00
morris
c6d7d5d412 Merge branch 'feat/twai_xiaomi_motor_example' into 'master'
feat(twai): add cybergear example

Closes IDF-10549

See merge request espressif/esp-idf!40193
2025-08-26 11:37:04 +08:00
Sarvesh Bodakhe
f5ff4530a2 fix(wifi): send correct wifi_auth_mode_t in event WIFI_EVENT_STA_CONNECTED and logs
- Fixes the authmode sent in WIFI_EVENT_STA_CONNECTED for WPA3-Enterprise, which
  was previously taken directly from the AKM field. This caused incorrect values in some cases.
- Updates the "security" log to show the correct wifi_auth_mode_t.
- Fixes wrong authmode strength used in the connection path.
2025-08-26 08:35:29 +05:30
Marius Vikhammer
1f0152dd3c Merge branch 'feature/cdcacm_vfs_comp' into 'master'
feat(usb_cdc_console): moved usb-cdc ROM console to new component: esp_usb_cdc_rom_console

Closes IDF-13797

See merge request espressif/esp-idf!41040
2025-08-26 10:40:08 +08:00
daiziyan
a536b2b9f3 docs: add clarification about the relationship between ESP32-C2 and ESP8684 2025-08-26 10:32:53 +08:00
Yin Qing Zhao
9b0733ba7d Merge branch 'bugfix/fix_twt_beacon_timeout_and_bss_max_idle_not_enable' into 'master'
fix(wifi): fix twt beacon timeout and active scan on DFS channel

See merge request espressif/esp-idf!41341
2025-08-26 10:26:20 +08:00
morris
6fdaf37e16 Merge branch 'feat/twai_esp32h4' into 'master'
feat(twai): add driver support on esp32h4

Closes IDF-12352 and IDF-12354

See merge request espressif/esp-idf!41434
2025-08-25 23:30:11 +08:00
Fu Hanxi
7b81a731e2 ci: increase build timeout 2025-08-25 17:02:34 +02:00
Alexey Lapshin
c433a76325 Merge branch 'feature/xtensa-size-optimize-mno-target-align' into 'master'
change(xtensa): Add -mno-target-align to size-optimized builds

Closes IDFGH-14980

See merge request espressif/esp-idf!39348
2025-08-25 18:50:01 +04:00
Fu Hanxi
d65e0e39c6 fix: make sure sdkconfig.json is updated after running the menuconfig 2025-08-25 14:48:58 +02:00
Fu Hanxi
60e9ec429d fix: kconfig optional dependency in transitive dependency 2025-08-25 14:32:05 +02:00
Igor Masar
49ae853ddb Merge branch 'docs/usb-external-phy' into 'master'
docs(usb): add section on external USB PHY configuration

Closes DOC-3308

See merge request espressif/esp-idf!40670
2025-08-25 19:37:09 +08:00
Aditya Patwardhan
646377c622 Merge branch 'fix/http_client_coverity_warnings' into 'master'
fix(esp_http_client): address coverity generated warnings

Closes IDF-13867, IDF-13881, and IDF-13886

See merge request espressif/esp-idf!41411
2025-08-25 17:02:07 +05:30
Konstantin Kondrashov
5c3d03cee4 fix(newlib): Fixes Coverity issues 2025-08-25 14:27:42 +03:00
Rahul Tank
4dd2694760 Merge branch 'bugfix/post_conn_failure' into 'master'
fix(nimble): Add code to post connection failure

See merge request espressif/esp-idf!41062
2025-08-25 16:49:45 +05:30
Jiang Jiang Jian
a23fad19df Merge branch 'bugfix/fix_esp32_bt_sw_intr' into 'master'
fix(bt): fixed sw_intr issue with BT register or trigger error core on ESP32

Closes BT-3917

See merge request espressif/esp-idf!40365
2025-08-25 19:03:19 +08:00
Ren Peiying
779698c755 Merge branch 'docs/improve_descr_on_language_standard' into 'master'
docs: Update description on C++ language standard

See merge request espressif/esp-idf!41426
2025-08-25 18:53:35 +08:00
wanckl
7e7f0c5e14 fix(twai): twai legacy driver fixed zero dlc transmit
Closes https://github.com/espressif/esp-idf/issues/17467
2025-08-25 18:52:38 +08:00
Chen Jichang
b39507bc30 feat(twai): add cybergear example 2025-08-25 18:30:33 +08:00
Chen Ji Chang
f522f9cf3d Merge branch 'feat/h4_mp_breaking_reg_headers' into 'master'
feat(h4mp): update breaking soc headers(part2)

See merge request espressif/esp-idf!41212
2025-08-25 18:17:37 +08:00
Island
83fdd14e2f Merge branch 'doc/update_blufi_doc' into 'master'
docs(ble): add advisory for CVE-2025-55297 found in Blufi example

Closes BLERP-2148

See merge request espressif/esp-idf!41468
2025-08-25 17:25:21 +08:00
Marius Vikhammer
3215a889a5 docs(readthedocs): removed old leftover readthedocs references 2025-08-25 16:35:40 +08:00
Jiang Jiang Jian
610ca26be1 Merge branch 'bugfix/protect_sha_hal_api_call' into 'master'
fix(esp_wifi): skip call to esp_fast_psk() when hardware SHA is not supported

Closes WIFI-6959

See merge request espressif/esp-idf!40609
2025-08-25 16:35:21 +08:00
Peter Dragun
7d19c310c1 Merge branch 'feat/esptool_v5_minimal' into 'master'
Feat: Add minimal esptool v5 support

See merge request espressif/esp-idf!41314
2025-08-25 16:28:51 +08:00
yinqingzhao
7a2d2a5b9c fix(wifi): fix twt beacon timeout and active scan on DFS channel 2025-08-25 16:19:55 +08:00
Erhan Kurubas
38c906bc3d Merge branch 'limit_gcov_build' into 'master'
change(examples): enable minimal build for gcov

Closes IDF-13857

See merge request espressif/esp-idf!41376
2025-08-25 10:01:18 +02:00
JinCheng
fb04218563 fix(bt/bluedroid): update the COD before enabling inquiry scan 2025-08-25 15:53:48 +08:00
morris
5c97f96243 Merge branch 'features/twai_send_isr' into 'master'
features(twai): Added support for calling twai_node_transmit() from ISR contexts

See merge request espressif/esp-idf!41383
2025-08-25 15:19:18 +08:00
luweike
222560ade4 docs: Add SoC conditional flag for Bluetooth Classic in migration guides 2025-08-25 14:20:54 +08:00
zhanghaipeng
1952f0333c docs(ble): add advisory for CVE-2025-55297 found in Blufi example 2025-08-25 14:04:39 +08:00
Alexey Lapshin
e5026b2e07 fix(gdbstub): fix segfault when a non-running task is selected 2025-08-25 11:58:27 +07:00
Alexey Lapshin
3f158e7ef2 fix(gdbstub): use separate running and selected tasks
'running' - task that was running when execution stopped
  'selected' - task that was selected by used in GDB (command "thread <id>")

Note that initially, after the program is interrupted 'selected' == 'running'
2025-08-25 11:58:24 +07:00
Alexey Lapshin
b25cb2906c fix(freertos): fix xesppie registers save/restore 2025-08-25 11:58:21 +07:00
Alexey Lapshin
1f8096359d fix(riscv): split enable_fpu() to enable_fpu() and clear_fpu() 2025-08-25 11:58:15 +07:00
Mahavir Jain
47a659cd3e Merge branch 'contrib/github_pr_17429' into 'master'
docs(esp_http_client): document default timeout behaviour (GitHub PR)

See merge request espressif/esp-idf!41363
2025-08-25 10:21:53 +05:30
Aditya Patwardhan
4371348039 Merge branch 'contrib/github_pr_17464' into 'master'
Update the QEMU instructions for the security_features_app example (GitHub PR)

Closes IDFGH-16318 and IDFGH-16311

See merge request espressif/esp-idf!41438
2025-08-25 10:04:07 +05:30
Deomid rojer Ryabkov
e2e51c08f6 change(xtensa): Add -mno-target-align to size-optimized builds
Saves space, about 6K in our application

Merges https://github.com/espressif/esp-idf/pull/15677
2025-08-25 12:24:18 +08:00
Alexey Lapshin
54ba54b457 change(esp_rom): move roms.json from tools to esp_rom component 2025-08-25 10:52:08 +07:00
Jiang Jiang Jian
6e0fd570b2 Merge branch 'feat/remove_wifi_related_docs_for_esp32h21' into 'master'
feat(docs): remove wifi related docs from docs_not_updated for esp32h21

Closes IDF-12107

See merge request espressif/esp-idf!37823
2025-08-25 11:13:28 +08:00
Yuan Yu
e263cd2cfe docs(twai): Update twai_node_transmit function's note 2025-08-25 11:05:52 +08:00
Yuan Yu
37e23a113c fix(twai): Enhance ISR handling for TX queue operations 2025-08-25 11:05:52 +08:00
Kapil Gupta
fe9dbc2b1d fix(esp_wifi): skip call to esp_fast_psk() when hardware SHA is not supported 2025-08-25 11:05:25 +08:00
Marius Vikhammer
81dff2c991 change(esp_event): removed unnecessary freertos header includes 2025-08-25 11:00:58 +08:00
morris
921e62b81f fix(twai): busoff and clkout may not available in SOC
return ESP_ERR_NOT_SUPPORTED if these signals are required from user but
not available in SOC
2025-08-25 10:22:02 +08:00
morris
c54562ab72 feat(twai): add driver support on esp32h4 2025-08-25 10:22:02 +08:00
Soren Friis
391de423fd docs(security_features_app): Update the QEMU instructions for the security_features_app example
Closes https://github.com/espressif/esp-idf/issues/17458
Closes https://github.com/espressif/esp-idf/pull/17464
2025-08-25 10:12:36 +08:00
Gao Xu
a20fc1a717 Merge branch 'docs/update_camera_mipi_docs' into 'master'
docs(cam): add ldo initialization note when use MIPI camera

Closes DOC-11987

See merge request espressif/esp-idf!41316
2025-08-25 10:10:37 +08:00
Marius Vikhammer
097f8a9fea Merge branch 'bugfix/log_sys_time_year' into 'master'
fix(log): fixed wrong year timestamp with LOG_TIMESTAMP_SOURCE_SYSTEM_FULL

Closes IDFGH-16299

See merge request espressif/esp-idf!41328
2025-08-25 09:49:50 +08:00
Marius Vikhammer
f25ae4800d Merge branch 'bufix/assert_func_buf_too_small' into 'master'
fix(newlib): added kconfig option for configurable buffer length for assert msgs

Closes IDFGH-16305

See merge request espressif/esp-idf!41394
2025-08-25 09:47:21 +08:00
gaoxu
bd20730b80 docs(cam): add ldo initialization note when use MIPI camera 2025-08-25 09:21:05 +08:00
Jiang Jiang Jian
c17244b92f Merge branch 'bugfix/add_bt_phy_calibration_independent_support' into 'master'
feat(phy): add phy calibration independent support

Closes WIFIBUG-1409, PHY-348, and PHY-354

See merge request espressif/esp-idf!41391
2025-08-23 10:30:21 +08:00
Alexey Lapshin
177dee612f Merge branch 'feature/enable_misalign_optimization_for_iperf' into 'master'
feat(newlib): enable libc misalign optimized functions

Closes IDF-13820

See merge request espressif/esp-idf!41148
2025-08-22 22:14:53 +04:00
Ivan Grokhotkov
139236741c Merge branch 'feature/update-qemu-to-esp_develop_9.2.2_20250817' into 'master'
feat(tools): update qemu version to esp_develop_9.2.2_20250817

See merge request espressif/esp-idf!41381
2025-08-22 17:18:28 +02:00
Mahavir Jain
ed201f4f77 fix(esp_tee): address coverity warnings 2025-08-22 19:14:52 +05:30
Mahavir Jain
70cb9d1a5c fix(esp_http_client): address coverity generated warnings 2025-08-22 19:13:24 +05:30
Yuan Yu
4e5401ec8c Merge branch 'features/twai_ll_parse_frame' into 'master'
refactor(twai): Separate frame header and data parsing logic for Classic TWAI

See merge request espressif/esp-idf!41203
2025-08-22 18:58:14 +08:00
Adam Múdry
56160675e7 Merge branch 'feat/sdspi_option_to_disable_waiting_for_miso_poll_busy' into 'master'
feat(sdspi): Add an option to modify the waiting time for MISO before sending next command

Closes IDFGH-15977 and IDFGH-9089

See merge request espressif/esp-idf!41175
2025-08-22 12:51:45 +02:00
Ivan Grokhotkov
17fd3133d9 fix(tools): use nvram.esp32s3.efuse device in qemu_ext.py
Related to https://github.com/espressif/esp-idf/issues/17258
2025-08-22 11:20:15 +02:00
Ivan Grokhotkov
cd1bfdd463 fix(tools): pre-commit fixes for qemu_ext.py 2025-08-22 11:18:06 +02:00
Ivan Grokhotkov
e8157d8fde feat(tools): enable PSRAM by default in "idf.py qemu" for ESP32-S3 2025-08-22 11:17:38 +02:00
Rahul Tank
e6456654de fix(nimble): Add code to post connection failure
In event of a corner case, where connection is not completed,
connection reattempt is disabled, so need to post connection
failure event to application to make it aware of the failure
2025-08-22 14:22:56 +05:30
Chen Jichang
f8480a115a feat(h4mp): update breaking soc headers(part2) 2025-08-22 16:27:39 +08:00
Mahavir Jain
70fb18be3e Merge branch 'bugfix/ota_timeout_and_repetitive_server_start' into 'master'
fix: ota: increase timeout and remove redundant server restart in tests

See merge request espressif/esp-idf!41353
2025-08-22 13:24:31 +05:30
Mahavir Jain
f8f5560737 Merge branch 'bugdix/remove_ecdsa_doc_ref_from_docs_not_updated_file' into 'master'
docs: remove reference to ecdsa.rst from docs_not_updated/esp32c5.txt

See merge request espressif/esp-idf!41432
2025-08-22 13:05:57 +05:30
morris
01cba485dd Merge branch 'docs/update_introduction_for_adc_modes' into 'master'
docs: Update introduction for ADC modes

Closes DOC-12094

See merge request espressif/esp-idf!41435
2025-08-22 15:28:21 +08:00
Gao Xu
9dc7d37043 Merge branch 'h21_mp_soc_update' into 'master'
feat(h21_mp): update H21_MP soc headers

See merge request espressif/esp-idf!41224
2025-08-22 15:12:24 +08:00
Marius Vikhammer
32d85658fe Merge branch 'bugfix/esp_timer_dump_corruption' into 'master'
fix(esp_timer): fixed potential buffer overflow with esp_timer_dump()

Closes IDFGH-16067

See merge request espressif/esp-idf!41269
2025-08-22 15:10:59 +08:00
Island
b28c6c3102 Merge branch 'bugfix/fixed_ble_init_crash_issue' into 'master'
fix(ble): Invoke ble_transport_ll_init after ble_transport_hs_init for nimble

Closes BLERP-2164

See merge request espressif/esp-idf!41313
2025-08-22 14:23:19 +08:00
Alexey Lapshin
b266d829dd change(newlib): enable LIBC_OPTIMIZED_MISALIGNED_ACCESS by default 2025-08-22 13:46:43 +08:00
Alexey Lapshin
913d38ba14 fix(newlib): fix CONFIG_LIBC_OPTIMIZED_MISALIGNED_ACCESS for c2/c3/c6/h2/h21
PMP configurations for load and store addresses may
have different permissions (e.g., "R" vs. "RW").

Due to the timing alignment of internal signals, the address
permission check may be incorrectly applied during the second
part of a misaligned access transaction.

As a workaround, insert two instructions (e.g. ADDI/NOP) between
accessing to different memory regions. This spacing avoids the
false permission check caused by signal timing overlap.
2025-08-22 13:46:43 +08:00
David Čermák
453bd60576 Merge branch 'fix/sdkconfig.rename.docs' into 'master'
fix(docs): Update unclear sdkconfig.rename example

See merge request espressif/esp-idf!41424
2025-08-22 13:23:41 +08:00
Meet Patel
031a2f2f71 Merge branch 'refactor/ulp_riscv_i2c_logs' into 'master'
refactor(ulp_riscv): Modify i2c read/write API for better logging and return error code

Closes IDFGH-16269 and IDFGH-15237

See merge request espressif/esp-idf!41342
2025-08-22 10:35:37 +05:30
nilesh.kale
7fc57dbef5 fix: ota: increase timeout and remove redundant server restart in tests
This comit updated pytest file in advanced ota example and also updates
timeout for example to avoid recurring timeout errors in CI
2025-08-22 09:40:41 +05:30
Zhang Shuxian
daf33186c9 docs: Update introduction for ADC modes 2025-08-22 12:06:32 +08:00
nilesh.kale
2e66070862 feat: remove ds and mpi support for esp32h4 2025-08-22 09:08:57 +05:30
Marius Vikhammer
924540d861 Merge branch 'ci/deploy_docs_brew' into 'master'
ci(docs): move deployment to Brew runners

See merge request espressif/esp-idf!41047
2025-08-22 11:26:45 +08:00
yinqingzhao
4a15df3d0f feat(phy): add phy calibration independent support 2025-08-22 10:47:49 +08:00
Marius Vikhammer
56e0c11bb6 feat(usb_cdc_console): moved usb-cdc ROM console to new component: esp_usb_cdc_rom_console 2025-08-22 09:37:47 +08:00
Marius Vikhammer
42316ef7bf fix(newlib): added kconfig option for configurable buffer length for assert msgs
Closes https://github.com/espressif/esp-idf/issues/17454
2025-08-22 09:15:22 +08:00
Peter Dragun
eba6b814ba feat: Add support for esptool v5 and keep v4 for now 2025-08-21 15:53:39 +02:00
David Cermak
808ea4b989 fix(docs): Update unclear sdkconfig.rename example 2025-08-21 15:36:57 +02:00
Mastro Gippo
4c7a2159c2 Fix tiny memory leak when PPP connection creation fails in esp_netif_new_ppp 2025-08-21 14:44:39 +02:00
Jiang Jiang Jian
206be17ec9 Merge branch 'fix/fix_psram_cross_page_issue' into 'master'
psram: fixed psram cross page issue on c5 / c61

Closes DIG-717, WIFIBUG-1378, and WIFIBUG-1367

See merge request espressif/esp-idf!41299
2025-08-21 19:59:49 +08:00
C.S.M
3954083d05 Merge branch 'fix/tsens_log' into 'master'
fix(temperature_sensor): Fix temperature sensor hal log causing crash

Closes IDF-13912

See merge request espressif/esp-idf!41418
2025-08-21 18:51:03 +08:00
morris
709d13c89a Merge branch 'fix/lcd_get_frame_buffer' into 'master'
fix(lcd): uninitialized va_list

Closes IDF-13876

See merge request espressif/esp-idf!41402
2025-08-21 18:11:22 +08:00
nilesh.kale
659679adae docs: remove reference to ecdsa.rst from docs_not_updated/esp32c5.txt
This commit removef ecdsa.rst entry from esp32c5.txt as
ECDSA docs already merged
2025-08-21 15:34:25 +05:30
Konstantin Kondrashov
7b621ad88d Merge branch 'feature/adds_pthread_rwlock_timed_locks' into 'master'
feat(pthread): Adds timed locks for pthread_rwlock

Closes IDFGH-15461

See merge request espressif/esp-idf!40146
2025-08-21 17:53:27 +08:00
renpeiying
bd387f86fb docs: Update description on C++ language standard 2025-08-21 17:36:06 +08:00
Peter Marcisovsky
350f88e69b Merge branch 'fix/usb_host_full_mock_component_dir' into 'master'
fix(usb_host): Fixing USB Component mock component dir

See merge request espressif/esp-idf!41404
2025-08-21 08:58:33 +02:00
Shen Weilong
c3f42161a1 fix(ble): Invoke ble_transport_ll_init after ble_transport_hs_init for nimble 2025-08-21 06:50:57 +00:00
Yuan Yu
6fe547114d refactor(twai): Optimize the TWAI frame parsing function and separate frame header and data parsing logic 2025-08-21 14:45:46 +08:00
Chen Jichang
6c3d275342 fix(rmt): treat loop once as no loop 2025-08-21 14:25:30 +08:00
Chen Jichang
4e03f8df0f fix(rmt): correct the condition for warnings in loop mode 2025-08-21 14:25:30 +08:00
Chen Jichang
f041954ec3 change(ci): update regex to match soc headers in check_public_header.py 2025-08-21 14:19:41 +08:00
gaoxu
41f954facf feat(h21_mp): update H21_MP soc headers 2025-08-21 14:19:41 +08:00
Mahavir Jain
c91dc3f049 Merge branch 'cleanup/remove_deprecated_apis' into 'master'
feat: remove some deprecated APIs from 6.0 release

Closes IDF-13093

See merge request espressif/esp-idf!41211
2025-08-21 10:05:37 +05:30
Jiang Jiang Jian
f3c4f5a08d Merge branch 'fix/increase_c61_sleep_wakeup_ahead_time' into 'master'
change(esp_hw_support): increase esp32c61 s2a_work_time_us

Closes WIFIBUG-1385

See merge request espressif/esp-idf!41367
2025-08-21 11:50:32 +08:00
Wan Lei
54a9c2e1e9 Merge branch 'feat/twai_add_wait_done_api' into 'master'
feat(driver_twai): add tx wait all done api

Closes IDF-13417

See merge request espressif/esp-idf!40616
2025-08-21 11:38:27 +08:00
C.S.M
de621fe22d fix(temperature_sensor): Fix temperature sensor hal log causing crash 2025-08-21 10:32:58 +08:00
morris
09fce0cf2a Merge branch 'refactor/etm_driver_soc_caps' into 'master'
refactor(etm): clean up soc macros && enhance thread safety

Closes IDF-13634

See merge request espressif/esp-idf!41201
2025-08-21 10:19:19 +08:00
Wan Lei
f5e9a24c90 Merge branch 'contrib/github_pr_17002' into 'master'
fix(driver_twai): modify the calculation description of quanta_resolution_hz (GitHub PR)

Closes IDFGH-16055 and IDFGH-16061

See merge request espressif/esp-idf!41405
2025-08-21 10:18:29 +08:00
armando
ad4fe4c394 fix(psram): fixed psram cross page issue 2025-08-21 09:57:07 +08:00
Jiang Jiang Jian
23517c9317 Merge branch 'bugfix/fix_esp32c5_ersu_compatibility_issue' into 'master'
fix(wifi): fix ersu compatibility issue

Closes FCS-1761

See merge request espressif/esp-idf!41382
2025-08-21 00:09:25 +08:00
Harshal Patil
511292ba41 Merge branch 'fix/disable_efuse_xts_aes_256_esp32c5' into 'master'
Disable XTS-AES-256 using efuse key for ESP32-C5

See merge request espressif/esp-idf!41348
2025-08-20 21:33:39 +05:30
Hrushikesh Bhosale
183afd54be Merge branch 'feat/make_https_async_request_under_crt_bundle_config' into 'master'
feat(esp_http_client): Make https_async request under CERT BUNDLE config

See merge request espressif/esp-idf!41128
2025-08-20 23:55:08 +08:00
C.S.M
e769a36d8a Merge branch 'fix/i2c_test_fail' into 'master'
test(i2c): fix i2c test failure

See merge request espressif/esp-idf!41407
2025-08-20 23:29:43 +08:00
morris
90a3b66370 fix(lcd): uninitialized va_list 2025-08-20 21:44:47 +08:00
Wang Meng Yang
7cac735da0 Merge branch 'feat/remove_the_deprecated_api_and_parameter' into 'master'
feat(bt): remove the deprecated functions and parameters

Closes BT-4042

See merge request espressif/esp-idf!40435
2025-08-20 19:36:37 +08:00
Rahul Tank
a3808c928a Merge branch 'fix/adding_missing_apis_nimble' into 'master'
fix(nimble): Added helper APIs in NimBLE

Closes BLERP-2126 and BLERP-2138

See merge request espressif/esp-idf!40223
2025-08-20 16:01:46 +05:30
hrushikesh.bhosale
f38b8fec92 feat(esp_http_client): Make https_async request under CERT BUNDLE config
Make https_async rqeuest under MBEDTLS_CERTIFICATE_BUNDLE config
2025-08-20 18:01:03 +08:00
Mahavir Jain
1a615729d5 Merge branch 'fix/coverity_issue_483747' into 'master'
Fix possible double memory free in esp_http_client

Closes IDF-13757, IDF-13758, and IDF-13755

See merge request espressif/esp-idf!40934
2025-08-20 14:29:20 +05:30
Mahavir Jain
42914e01ee feat: remove some deprecated APIs from 6.0 release 2025-08-20 14:20:37 +05:30
Meet Patel
f5b7cb6766 refactor(ulp_riscv): Modify ulp i2c read/write functions to return error code
Updated the i2c read/write APIs ulp_riscv_i2c_master_read_from_device
and ulp_riscv_i2c_master_write_to_device in ulp_riscv component to
return error codes back to the application

Closes https://github.com/espressif/esp-idf/issues/15904
2025-08-20 14:16:44 +05:30
Meet Patel
7abc48157e refactor(ulp_riscv): Modify ESP_EARLY_LOG to ESP_LOG and move it outside critical section
Moved the error logs outside critical section for i2c communication errors
like READ fail, WRITE fail etc. in the ulp_riscv_i2c component

Also changed the error log API from ESP_EARLY_LOG to ESP_LOG, so we can support
tag based filtering and enabling/disabling of logs

Closes https://github.com/espressif/esp-idf/issues/17425
2025-08-20 14:16:44 +05:30
C.S.M
23f09d2617 test(i2c): fix i2c test failure 2025-08-20 16:33:00 +08:00
Tinyu
3aaa2adfe5 fix(driver_twai): modify the calculation description of quanta_resolution_hz
Closes https://github.com/espressif/esp-idf/issues/16996
Closes https://github.com/espressif/esp-idf/pull/17002
2025-08-20 16:25:57 +08:00
wanckl
a690789dcf fix(driver_twai): update example using wait_tx_done api 2025-08-20 16:11:42 +08:00
wanckl
6288067296 feat(driver_twai): add tx wait all done api 2025-08-20 16:11:39 +08:00
C.S.M
65a6e9c294 Merge branch 'fix/flash_qio_read_failed' into 'master'
fix(spi_flash): Fix spi flash qio read failed on gpspi flash

See merge request espressif/esp-idf!41204
2025-08-20 16:11:06 +08:00
peter.marcisovsky
b61f60ab6a fix(usb_host): Fixing USB Component mock component dir 2025-08-20 09:22:02 +02:00
Adam Múdry
9db29df39a feat(sdspi): Add an option to modify wait time for MISO before sending next command
Closes https://github.com/espressif/esp-idf/issues/16909
2025-08-20 08:57:51 +02:00
Island
e31611d6a3 Merge branch 'change/ble_update_lib_20250814' into 'master'
change(ble): [AUTO_MR] 20250814 - Update ESP BLE Controller Lib

Closes BLERP-2160 and BLERP-2159

See merge request espressif/esp-idf!41260
2025-08-20 14:11:54 +08:00
Wang Meng Yang
f82e101dcc Merge branch 'bugfix/fix_tmp_key_bug' into 'master'
bugfix/fix_tmp_key_bug

See merge request espressif/esp-idf!41296
2025-08-20 14:07:00 +08:00
Wan Lei
9f43c02e89 Merge branch 'fix/mcpwm_foc_example_fix_angle_calc' into 'master'
fix(driver_mcpwm): in foc example correct the angle calcutation

Closes IDFGH-16074

See merge request espressif/esp-idf!41384
2025-08-20 12:06:15 +08:00
Island
dfc67f0876 Merge branch 'bugfix/ble_enhanced_security' into 'master'
Update BluFi document

Closes BLERP-2148

See merge request espressif/esp-idf!41158
2025-08-20 11:29:12 +08:00
renpeiying
8b2b2729bb docs: Add CN translation to usb_host and usb_device.rst 2025-08-20 10:16:27 +08:00
Ivan Grokhotkov
1c6c901730 Merge branch 'feature/api_check_prereq' into 'master'
change(tools): export esp-clang-libs location as ESP_CLANG_LIBS_PATH

See merge request espressif/esp-idf!41144
2025-08-20 00:48:20 +02:00
harshal.patil
d59bcb633c fix(soc): Disable XTS-AES-256 using efuse key for ESP32-C5 2025-08-19 21:54:26 +05:30
Roland Dobai
86fc2e116f Merge branch 'revert/legacy_export_scripts' into 'master'
revert(tools): Revert backup option to use legacy export scrips

Closes IDF-11027

See merge request espressif/esp-idf!41309
2025-08-19 16:30:04 +02:00
Roland Dobai
c43d311126 Merge branch 'feat/update_cmake_versions' into 'master'
feat(tools): Upgraded cmake versions (supported to 3.22.1, reccomended to 4.0.3)

See merge request espressif/esp-idf!40364
2025-08-19 15:58:04 +02:00
Island
3216dfa3b3 Merge branch 'bugfix/fix_bleqabr25_1004' into 'master'
fix(ble/bluedroid): Fixed the status setting in the HCI event

Closes BLERP-2020

See merge request espressif/esp-idf!40055
2025-08-19 21:10:46 +08:00
Roland Dobai
47d11179f1 fix(components/tcp_transport): Fix missing file extension in the test_app 2025-08-19 14:44:32 +02:00
Marek Fiala
af168c75b3 docs(migration-guide): Information on how to update CMake 2025-08-19 14:44:32 +02:00
Marek Fiala
9d35d63651 feat(cmake): Update minimum cmake version to 3.22 (whole repository) 2025-08-19 14:44:32 +02:00
Marek Fiala
d7faae9ae4 change(tools): ruff formating test_hints.py 2025-08-19 14:44:31 +02:00
Marek Fiala
9aada24169 feat(tools): Updated cmake versions - tools.json
recommended v3.30.2 -> v4.0.3
supported v3.16.3 -> v3.22.1
2025-08-19 14:44:31 +02:00
wanckl
fdb292798e fix(driver_mcpwm): in foc example correct the angle calcutation
Closes https://github.com/espressif/esp-idf/issues/17015
2025-08-19 19:40:37 +08:00
muhaidong
d0b499ecf3 fix(wifi): fix ersu compatibility issue 2025-08-19 19:26:09 +08:00
Laukik Hase
ba80256748 Merge branch 'ci/esp_tee_disable_c5_temp' into 'master'
ci(esp_tee): Disable the TEE test-apps for ESP32-C5 temporarily

See merge request espressif/esp-idf!41356
2025-08-19 16:37:16 +05:30
Alexey Lapshin
03855b90f8 Merge branch 'feature/update-gnu-standards' into 'master'
feat(build): update gnu17->gnu23 and gnu++2b->gnu++26

See merge request espressif/esp-idf!41014
2025-08-19 14:30:34 +04:00
Ivan Grokhotkov
3c4aa1a5a5 feat(tools): update qemu version to esp_develop_9.2.2_20250817 2025-08-19 09:39:18 +00:00
Ivan Grokhotkov
a939f410dd Merge branch 'bugfix/ldgen_prebuilt_library_placements' into 'master'
build: pass pre-built libraries to ldgen, clean up how blobs are added

Closes IDF-12049 and IDF-12736

See merge request espressif/esp-idf!40353
2025-08-19 10:50:31 +02:00
Ivan Grokhotkov
d9b6d4ed17 change(tools): export esp-clang-libs location as ESP_CLANG_LIBS_PATH
This allows tools which depend on libclang to find the library
location.
2025-08-19 10:48:41 +02:00
Chen Chen
6af87b6287 Merge branch 'change/i2c_return_val' into 'master'
change(i2c_master): Change the I2C return value to ESP_ERR_INVALID_RESPONSE when NACK detected

Closes IDF-13751

See merge request espressif/esp-idf!41251
2025-08-19 16:14:18 +08:00
gongyantao
179a730a03 feat(bt): remove the deprecated functions and parametes 2025-08-19 16:07:05 +08:00
Erhan Kurubas
312261785c change(examples): enable minimal build for gcov 2025-08-19 09:53:33 +03:00
Astha Verma
3c579545a4 fix(nimble): Added missing api in nimble which present in bluedroid 2025-08-19 12:21:04 +05:30
Rocha Euripedes
bf9d085bba Merge branch 'reduce_scope_of_mqtt_publish_connet' into 'master'
fix(mqtt): Reduce scope of dependencies for mqtt test

See merge request espressif/esp-idf!39825
2025-08-19 14:47:42 +08:00
Rocha Euripedes
a23bc29a84 fix(mqtt): Reduce scope of dependencies for mqtt test 2025-08-19 14:47:42 +08:00
Zhang Shu Xian
702301ad91 Merge branch 'docs/update_cn_translation_for_iram_docs' into 'master'
docs: Update CN translation for IRAM-related docs

Closes DOC-12056

See merge request espressif/esp-idf!41340
2025-08-19 14:35:44 +08:00
Island
74bb9f6563 Merge branch 'feat/ble_iso_nimble_support' into 'master'
feat(ble): ISO minor support for NimBLE Host

See merge request espressif/esp-idf!40268
2025-08-19 14:25:15 +08:00
Chen Chen
c35ddc1258 change(i2c_master): Change return value when NACK detected 2025-08-19 12:12:52 +08:00
liqigan
98df3fa714 fix(bt/controller): Fixed some controller bugs 2025-08-19 11:57:10 +08:00
Wang Meng Yang
892ec6a114 Merge branch 'bugfix/fix_bt_security' into 'master'
fix(bt/bluedroid): Prevent out-of-bounds access and add type check when resolving EIR data

Closes BT-4071

See merge request espressif/esp-idf!41167
2025-08-19 11:54:10 +08:00
wuzhenghui
4193bf56c4 change(esp_hw_support): increase s2a_work_time_us 2025-08-19 11:50:03 +08:00
Zhang Shuxian
5b11b017a9 docs: Update CN translation for IRAM-related docs 2025-08-19 11:35:02 +08:00
Alexey Lapshin
4c481c863f feat(build): update gnu17->gnu23 and gnu++2b->gnu++26 2025-08-19 10:29:37 +07:00
He Binglin
316d744845 Merge branch 'feat/support_esp32h4_dfs' into 'master'
Support dfs and light & deep sleep  in esp32h4 beta5

Closes PM-446

See merge request espressif/esp-idf!40595
2025-08-19 10:50:48 +08:00
Alexey Lapshin
5276a56911 Merge branch 'fix/misalign_memory_test_limit_values' into 'master'
fix(newlib): increase limit for misaligned access testcases

Closes IDFCI-2917

See merge request espressif/esp-idf!41209
2025-08-18 19:14:45 +04:00
Shen Wei Long
219e38bfbc Merge branch 'bugfix/check_bd_addr_only_for_bredr' into 'master'
fix(bt): check bd address only for bredr in bluedroid host l2cu_allocate_lcb()

See merge request espressif/esp-idf!40063
2025-08-18 13:18:14 +00:00
Laukik Hase
9b807a253d ci(esp_tee): Disable the TEE test-apps for ESP32-C5 temporarily 2025-08-18 18:42:02 +05:30
cjin
2f7e200fc8 feat(ble): support pawr feature in ble sdk on ESP32-H2 2025-08-18 19:18:10 +08:00
cjin
6c15fccddd feat(ble): support pawr feature in ble sdk on ESP32-C5 2025-08-18 19:18:10 +08:00
cjin
410d904845 feat(ble): support pawr feature in ble sdk on ESP32-C6 2025-08-18 19:18:10 +08:00
cjin
50e7825ba9 feat(ble): add clk source freq change of ble slow clock on ESP32-C5 2025-08-18 19:18:10 +08:00
cjin
cb60528f23 feat(ble): add clk source freq change of ble slow clock on ESP32-H2 2025-08-18 19:18:10 +08:00
cjin
b5ce766c7f feat(ble): add clk source freq change of ble slow clock on ESP32-C6 2025-08-18 19:18:10 +08:00
Zhou Xiao
236baa7585 change(ble): [AUTO_MR] Update lib_esp32c6 to 9492a0cb 2025-08-18 19:18:10 +08:00
Zhou Xiao
859d762fcf change(ble): [AUTO_MR] Update lib_esp32c5 to 9492a0cb 2025-08-18 19:18:10 +08:00
Zhou Xiao
ea32d4cd18 change(ble): [AUTO_MR] Update lib_esp32h2 to 9492a0cb 2025-08-18 19:18:10 +08:00
morris
53a399971f Merge branch 'refactor/i2c_testapp_c++' into 'master'
refactor(i2c_test_apps): Refactor from C to C++

Closes IDF-13806

See merge request espressif/esp-idf!41126
2025-08-18 17:37:41 +08:00
morris
661590940a refactor(etm): enhance thread safety and clean up soc macros 2025-08-18 14:58:24 +08:00
morris
8b96e82077 Merge branch 'contrib/github_pr_17444' into 'master'
fix PuTTY link in establish-serial-connection.rst (GitHub PR)

Closes IDFGH-16292

See merge request espressif/esp-idf!41326
2025-08-18 14:47:05 +08:00
chenjianhua
4ae438cca2 fix(ble/bluedroid): Fixed the status setting in the HCI event 2025-08-18 14:40:36 +08:00
Chen Jichang
d0ad1145fc feat(h4mp): update rom linker (part3) 2025-08-18 14:24:12 +08:00
Mahavir Jain
758939caec Merge branch 'fix/enable_ssl_cookie_support_by_default' into 'master'
fix(mbedtls): enable ssl cookie support by default

See merge request espressif/esp-idf!41235
2025-08-18 11:42:24 +05:30
Marius Vikhammer
9fef6e587c Merge branch 'docs/misc_c5_c61' into 'master'
docs(misc): cleanup docs for C5 and C61

Closes IDF-9498

See merge request espressif/esp-idf!41225
2025-08-18 14:12:08 +08:00
Ondrej Kosta
5aab43eb21 Merge branch 'contrib/github_pr_16869' into 'master'
feat(examples): improved example for Ethernet SPI polling mode without interrupt (GitHub PR)

Closes IDFGH-15933

See merge request espressif/esp-idf!41071
2025-08-18 14:05:52 +08:00
Marius Vikhammer
9ec0f18607 fix(log): fixed wrong year timestamp with LOG_TIMESTAMP_SOURCE_SYSTEM_FULL
struct tm contains the number of years since 1900, but the printing code
assumed it contained actual current year.

It would also print it as YYYY, while the documentation and code implies
it should be YY.

Closes https://github.com/espressif/esp-idf/issues/17451
2025-08-18 13:40:39 +08:00
hebinglin
8f8a97787d change(esp_hw_support): change clock kconfig name in eso32h4beta5 2025-08-18 12:55:42 +08:00
Liu Linyan
77c51051b9 feat(ble): ISO minor support for NimBLE Host 2025-08-18 12:02:19 +08:00
Chen Chen
8361d150de fix(i2c_test_apps): Fix the conflict when including spimem_flash_ll
Update to avoid the conflict that C++ compiler complains about low level C
code
2025-08-18 11:20:16 +08:00
Chen Chen
34d2abf533 refactor(i2c_test_apps): Refactor i2c test apps from C to C++ 2025-08-18 11:20:16 +08:00
hebinglin
9f4a568163 change(esp_hw_support): comment out for ci pass in esp32h4beta5 2025-08-18 11:02:16 +08:00
Marius Vikhammer
c6f435f390 docs(misc): cleanup docs for C5 and C61 2025-08-18 10:55:01 +08:00
Shen Weilong
61c13ef849 fix(bt): check bd address only for bredr in bluedroid host l2cu_allocate_lcb() 2025-08-18 10:44:22 +08:00
C.S.M
34f9863115 fix(spi_flash): Fix spi flash qio/dio read failed on gpspi flash 2025-08-18 10:37:04 +08:00
C.S.M
185857aee2 fix(spi_flash): Fix spi_flash clock for gpspi on esp32c5/p4 2025-08-18 10:37:04 +08:00
yangfeng
a0fe68ce45 fix(bt/bluedroid): Prevent out-of-bounds access and add type check when resolving EIR data 2025-08-18 09:20:05 +08:00
emanulato
81974e696d fix PuTTY link in establish-serial-connection.rst
The link to PuTTY was pointing to putty.org. This domain has no relation to the PuTTY project! Instead, the website run by the actual PuTTY team can be found under https://putty.software , see https://github.com/zephyrproject-rtos/zephyr/blob/main/boards/snps/iotdk/doc/index.rst
2025-08-16 15:04:48 +02:00
Konstantin Kondrashov
659ae57c83 Merge branch 'feature/log_remove_deprecated_items' into 'master'
remove(log): Remove deprecated functions and header file

Closes IDF-9809 and DOC-11832

See merge request espressif/esp-idf!40539
2025-08-16 00:20:11 +08:00
Shen Meng Jing
c37d4a6512 Merge branch 'docs/sync_cn_and_en' into 'master'
docs: Sync CN and EN docs

Closes DOC-11933

See merge request espressif/esp-idf!41027
2025-08-15 22:25:46 +08:00
hebinglin
afc51051bf change(esp_hw_support): update pmu register context structure and driver for esp32h4 beta5 2025-08-15 20:52:13 +08:00
Sudeep Mohanty
4cfc196680 feat(build-system): Create build system hooks for post-ELF processing
This commit adds new CMake APIs for the build system, viz.,
idf_build_add_post_elf_dependency() and
idf_build_get_post_elf_dependencies().
These APIs allow components to add post-ELF processing hooks before the
binary file is generated.

Closes https://github.com/espressif/esp-idf/issues/17251
2025-08-15 12:22:47 +02:00
Konstantin Kondrashov
6b8d4cc1fb remove(log): Remove deprecated functions and header file 2025-08-15 18:04:08 +08:00
hebinglin
498f78dc40 change(esp_hw_support): support esp32h4beta5 power management dfs flow 2025-08-15 17:49:27 +08:00
Mahavir Jain
14ccee1981 Merge branch 'fix/ecdsa_p384_tee_build_failure' into 'master'
fix(esp_tee): Fix build failure due to ECDSA-P384

See merge request espressif/esp-idf!41302
2025-08-15 14:52:38 +05:30
Marek Fiala
d548d283b9 revert(tools): Revert backup option to use legacy export scrips
This reverts commit 7b417fc3f2.
2025-08-15 09:11:02 +02:00
harshal.patil
da5dda1131 fix(esp_tee): Fix build failure due to ECDSA-P384 2025-08-15 12:10:36 +05:30
zhanghaipeng
3f4bedd3a5 feat(blufi): Update BluFi document 2025-08-15 14:18:05 +08:00
Island
f1572ae61d Merge branch 'fix/spi_ble_log_get_lc_ts_ceva' into 'master'
fix(ble): disabled get lc ts for ESP32-C3 and ESP32-S3

Closes BLERP-2157

See merge request espressif/esp-idf!41226
2025-08-15 13:48:34 +08:00
He Binglin
7e1f3e35e1 Merge branch 'bugfix/es_idf_clkicg_idf-13119' into 'master'
fix(esp_hw_support): fix dead code and out-of-bounds in esp_sleep_clock_config function

Closes IDF-13119 and IDF-13103

See merge request espressif/esp-idf!40989
2025-08-15 13:08:36 +08:00
Shu Chen
e36d80e172 Merge branch 'feat/update_phylib_for_c5' into 'master'
feat(esp_phy): update phylib for C5

See merge request espressif/esp-idf!41191
2025-08-15 04:11:48 +00:00
Wang Meng Yang
1979646199 Merge branch 'bugfix/epr_collision' into 'master'
fix(bt/controller): fixed some controller bugs

Closes BT-4034

See merge request espressif/esp-idf!40775
2025-08-15 09:38:08 +08:00
Sudeep Mohanty
11b80a7f11 Merge branch 'feat/freertos_in_flash_by_default' into 'master'
feat(freertos): Place FreeRTOS in flash by default

Closes IDF-12695

See merge request espressif/esp-idf!40579
2025-08-15 02:18:57 +02:00
David Cermak
a0802b1e58 Merge branch 'feat/esp32p4_soc_ver2' into 'master'
feat(soc): added emac_reg.h to hw_ver2

See merge request espressif/esp-idf!41248

Note: Merged manaully, due to build errors from both TWAI and EMAC
2025-08-14 17:02:50 +02:00
Konstantin Kondrashov
481c3fc89f Merge branch 'feature/update_esp32c61_efuse_docs' into 'master'
feat(docs): Update ESP32-C61 efuse documentation

Closes IDF-10169

See merge request espressif/esp-idf!41262
2025-08-14 20:33:15 +08:00
Wan Lei
851cd92100 Merge branch 'fix/fix_twai_cpp_build_error' into 'master'
fix(driver_twai): test app fix cpp build error

See merge request espressif/esp-idf!41255
2025-08-14 20:16:56 +08:00
Mahavir Jain
74da6d7a2f Merge branch 'feature/esp_tee_c5' into 'master'
feat(esp_tee): Initial support for ESP32-C5

Closes IDF-10426, IDF-10427, IDF-10428, IDF-10429, and IDF-10430

See merge request espressif/esp-idf!38807
2025-08-14 17:44:12 +05:30
Marius Vikhammer
b0b76f3792 fix(esp_timer): fixed potential buffer overflow with esp_timer_dump()
esp_timer_dump could overflow when dumping a large amount of timers

Closes https://github.com/espressif/esp-idf/issues/17008
2025-08-14 20:01:55 +08:00
Island
c6923d2a26 Merge branch 'bugfix/ble_enhanced_security_v2' into 'master'
fix(ble/bluedroid): Fixed potential out-of-bounds memory access when resolve adv data

Closes BLERP-2149

See merge request espressif/esp-idf!41160
2025-08-14 17:28:13 +08:00
Sudeep Mohanty
7a6559f7d5 Merge branch 'fix/panic_handler_reboot_before_halt' into 'master'
fix(panic_handler): Fixed a issue where the system reboots before halt

Closes IDFGH-16214

See merge request espressif/esp-idf!41194
2025-08-14 11:00:02 +02:00
Konstantin Kondrashov
d834e4333a feat(docs): Update ESP32-C61 efuse documentation 2025-08-14 11:52:03 +03:00
wanckl
7d22590cf9 fix(driver_twai): test app fix cpp build error 2025-08-14 15:55:26 +08:00
Mahavir Jain
05e149ea78 Merge branch 'feature/add_ecdsa_p384_support_and_testcases' into 'master'
feat: add ecdsa-p384 testcases and relative support for ESP32C5 ECO2

Closes IDF-13008 and IDF-12630

See merge request espressif/esp-idf!38857
2025-08-14 12:33:25 +05:30
Ondrej Kosta
b62c0feb3b feat(soc): added emac_reg.h to hw_ver2 2025-08-14 08:54:04 +02:00
Konstantin Kondrashov
b0f34bd8b5 Merge branch 'featue/allow_custom_key_purposes' into 'master'
feat(efuse): Allow custom key purposes

See merge request espressif/esp-idf!40799
2025-08-14 14:48:37 +08:00
Yuan Yu
0563c8608a Merge branch 'bugfix/twai_utils_down' into 'master'
fix(twai): fix the twai_utils's pytest to turn canbus down

Closes IDFCI-3079

See merge request espressif/esp-idf!41238
2025-08-14 14:48:04 +08:00
Mahavir Jain
f0cc4528f5 Merge branch 'feat/disable_protocomm_sec0_1_schemes' into 'master'
feat(protocomm): disable security version 0 and 1 by default

See merge request espressif/esp-idf!41184
2025-08-14 12:01:05 +05:30
Chen Ji Chang
3c60941aa0 Merge branch 'feat/h4_mp_compatibility_changes' into 'master'
feat(h4mp): update compatible soc headers (part1)

See merge request espressif/esp-idf!41205
2025-08-14 14:10:42 +08:00
Mahavir Jain
71d3492124 Merge branch 'fix/handle_error_and_dispatch_event_while_reading_data_from_server' into 'master'
feat(esp_http_client): handle error while reading data from server

Closes IDF-13454

See merge request espressif/esp-idf!40544
2025-08-14 11:27:36 +05:30
Aleksei Apaseev
8880b4e626 Merge branch 'ci/fix_bin_size_report_generation' into 'master'
ci: fix bin size report generation

See merge request espressif/esp-idf!41065
2025-08-14 13:12:01 +08:00
Wan Lei
675fe2d4ba Merge branch 'feat/twai_new_driver_example' into 'master'
feat(driver_twai): update example to using new driver

Closes IDFGH-6837

See merge request espressif/esp-idf!39531
2025-08-14 12:51:08 +08:00
Ashish Sharma
2b8703ef9f fix(mbedtls): enable ssl cookie support by default 2025-08-14 12:05:02 +08:00
Shen Meng Jing
4b43f6cbeb Merge branch 'docs/update_cn_6.0_tools' into 'master'
docs: Update CN translation for tools.rst

Closes DOC-11915

See merge request espressif/esp-idf!41151
2025-08-14 12:04:22 +08:00
Yuan Yu
c386170aad fix(twai): make sure that can bus is shut down properly 2025-08-14 11:43:09 +08:00
Ren Peiying
13f422501d Merge branch 'bugfix/update_struct_in_ledc_header' into 'master'
docs: Update struct for correct building of ledc.h

Closes IDFGH-7219

See merge request espressif/esp-idf!41133
2025-08-14 11:03:43 +08:00
Zhou Xiao
c17bf63874 fix(ble): disabled get lc ts for ESP32-C3 and ESP32-S3 2025-08-14 11:03:33 +08:00
Chen Ji Chang
7324fc6dd9 Merge branch 'refactor/use_gdma_link_in_rmt' into 'master'
refactor(rmt): use gdma link list driver to mount buffer

Closes IDFGH-15289 and IDFGH-15421

See merge request espressif/esp-idf!39350
2025-08-14 10:49:19 +08:00
Wan Lei
7d1e974f77 Merge branch 'bugfix/twai_driver_cxx_test' into 'master'
fix(twai): fixed build errors in cxx environment

Closes IDFGH-16058

See merge request espressif/esp-idf!40818
2025-08-14 09:41:23 +08:00
Armando (Dou Yiwen)
68cbef3175 Merge branch 'change/change_msync_vaddr_not_cacheable_behaviour' into 'master'
cache: when vaddr is not cacheable, msync will return not supported

See merge request espressif/esp-idf!41105
2025-08-14 01:21:33 +00:00
Armando (Dou Yiwen)
5046f31c1b Merge branch 'change/p4_soc_cmake' into 'master'
soc: simplify p4 soc cmake

See merge request espressif/esp-idf!41161
2025-08-14 01:20:16 +00:00
Fu Hanxi
2dec2f59d5 Merge branch 'ci/fix-extra-default-build-targets' into 'master'
Ci: exclude standalone pytest folders

See merge request espressif/esp-idf!41189
2025-08-14 01:48:49 +02:00
Ondrej Kosta
3fb1f9add3 Merge branch 'feat/p4_emac_sleep' into 'master'
feat(esp_eth): added EMAC sleep retention for ESP32P4

Closes IDF-9919

See merge request espressif/esp-idf!40385
2025-08-14 02:52:29 +08:00
Aditya Patwardhan
286f7fe082 Merge branch 'change/ecdsa_does_not_use_mpi_esp32h2_eco5' into 'master'
The ECDSA module of ESP32-H2 ECO5 does not use the MPI module

See merge request espressif/esp-idf!41156
2025-08-13 23:22:51 +05:30
Erhan Kurubas
5ac81c17cd Merge branch 'move_gcov_to_component_registry' into 'master'
Move gcov to component registry

Closes IDF-13404 and DOC-11978

See merge request espressif/esp-idf!40752
2025-08-13 19:29:34 +02:00
Konstantin Kondrashov
2fdeaa882f feat(pthread): Adds timed locks for pthread_rwlock
Closes https://github.com/espressif/esp-idf/issues/16099
2025-08-13 20:22:27 +03:00
Richard Allen
69404c8d83 docs(esp_http_client): document default timeout behaviour 2025-08-13 10:07:38 -05:00
Konstantin Kondrashov
fdc3206767 Merge branch 'feature/ipc_allows_recursion_calls' into 'master'
feat(ipc): Allow IPC recursion calls in esp_ipc_call

Closes IDF-13722

See merge request espressif/esp-idf!40792
2025-08-13 21:49:07 +08:00
Sudeep Mohanty
f1ab53eda0 test(panic_handler): Added unit test to verify panic handler can halt
This test verifies that the panic handler can indeed halt when
configured to print and halt instead of rebboting.
2025-08-13 15:40:07 +02:00
wanckl
fe8f0f08f3 feat(driver_twai): update and simplify network example using new driver 2025-08-13 19:41:06 +08:00
wanckl
959557d00a feat(driver_twai): update error recover example using new driver
Closes https://github.com/espressif/esp-idf/issues/8461
2025-08-13 19:40:20 +08:00
wanckl
6440f9d5d7 feat(driver_twai): remove self test example since it's meanless 2025-08-13 19:36:41 +08:00
JinCheng
88722d50d5 fix(bt/controller): fixed some controller bugs 2025-08-13 19:27:35 +08:00
JinCheng
81d7ce47db fix(bt/bluedroid): correct a description error in the GAP header file 2025-08-13 19:27:35 +08:00
Yuan Yu
c4de1ae390 Merge branch 'features/twai_utils_example' into 'master'
feat(twai/example): Adds a TWAI utility example like can-utils.

Closes IDF-6093

See merge request espressif/esp-idf!39387
2025-08-13 19:25:08 +08:00
Wu Zheng Hui
feb1dc97b9 Merge branch 'fix/fix_submode_lost_in_reset' into 'master'
fix(esp_hw_support): fix ESP_SLEEP_RTC_USE_RC_FAST_MODE submode lost in reset

Closes IDFGH-15614

See merge request espressif/esp-idf!41080
2025-08-13 18:58:10 +08:00
Sudeep Mohanty
36eaa2c4a1 fix(panic_handler): Fixed a issue where the system reboots before halt
This commit fixes an issue where the panic handler may reboot even if it
is configured to halt the CPU.

Closes https://github.com/espressif/esp-idf/issues/17260
2025-08-13 12:19:23 +02:00
Laukik Hase
bb55b0cefc ci(esp_tee): Enable the TEE test-apps for ESP32-C5 2025-08-13 14:09:00 +05:30
Laukik Hase
ab8400df4a ci(esp_tee): Refactor the ESP-TEE test-cases
- Improve the interrupt-related test cases
- Fix potential issues in the task-switching test
  during secure service calls
2025-08-13 14:09:00 +05:30
Laukik Hase
340de9823a feat(esp_tee): Support for ESP32-C5 - the rest of the components 2025-08-13 14:08:59 +05:30
Laukik Hase
11d3a2480f feat(esp_tee): Support for ESP32-C5 - the esp_tee component 2025-08-13 14:08:58 +05:30
Yuan Yu
9a95e2719c docs(twai): update example description for TWAI utilities 2025-08-13 16:31:35 +08:00
Yuan Yu
f1da574ae5 feat(twai): add TWAI utility commands and configuration
- Introduced TWAI utility commands for sending, dumping, and managing TWAI frames.
- Added configuration options for TWAI GPIO pins and support for TWAI-FD.
- Created necessary CMake and Kconfig files for building the TWAI utilities.

This enhancement provides a comprehensive interface for TWAI operations.
2025-08-13 16:31:35 +08:00
morris
78f2b2ad10 Merge branch 'doc/mipi_dphy_power' into 'master'
doc(lcd): explain the DPHY power supply

Closes IDF-13816

See merge request espressif/esp-idf!41186
2025-08-13 16:18:06 +08:00
Alexey Lapshin
33cc3511e8 fix(newlib): increase limit for misaligned access testcases 2025-08-13 15:17:33 +07:00
Chen Jichang
18420f8d3d feat(h4mp): part1 update compatible soc headers 2025-08-13 14:05:32 +08:00
Mahavir Jain
056e4a4162 Merge branch 'feat/add_new_client_state_and_update_state_flow' into 'master'
feat(esp_http_client): added new HTTP state HTTP_STATE_CONNECTING and change state flow

Closes IDFGH-15423 and IDFGH-15362

See merge request espressif/esp-idf!40507
2025-08-13 11:29:18 +05:30
Harshal Patil
2f15501cae Merge branch 'ci/enable_flash_enc_test_esp32p4' into 'master'
Enable flash encryption test case for ESP32-P4 in the CI

Closes IDF-10982

See merge request espressif/esp-idf!41026
2025-08-13 09:46:04 +05:30
Mahavir Jain
80adff3cd0 Merge branch 'bugfix/psram_enc_workaround' into 'master'
fix(psram): provide boot warning about PSRAM encryption issue on C5/C61

See merge request espressif/esp-idf!40913
2025-08-12 21:05:10 +05:30
morris
d75789beb9 fix(twai): fixed build errors in cxx environment
Closes https://github.com/espressif/esp-idf/issues/16999
2025-08-12 21:25:38 +08:00
Konstantin Kondrashov
1113ef2ff0 feat(ipc): Allow IPC recursion calls in esp_ipc_call 2025-08-12 16:16:09 +03:00
igor.masar
10252a8fb7 docs(usb): add section on external USB PHY configuration
Add top-level section for configuring and initializing external USB PHY
on ESP32-S3. Includes GPIO mapping, code example, and guidance on
suspend and speed selection pins.

Link to ESP USB PHY guide for SP5301 setup to avoid duplicating content.
Add dedicated schematic reference for STUSB03E with analog switch.
2025-08-12 14:26:46 +02:00
Island
5152593a74 Merge branch 'feat/support_blufi_adv_with_name' into 'master'
feat(bt/blufi): Support Blufi start advertising with specified name

Closes BLERP-1405

See merge request espressif/esp-idf!35761
2025-08-12 20:21:18 +08:00
Island
fbea0c641f Merge branch 'feat/support_cble50y24_108' into 'master'
Support multi-connection optimization and examples on Bluedroid

Closes BLERP-2088 and BLERP-2089

See merge request espressif/esp-idf!40487
2025-08-12 20:21:12 +08:00
nilesh.kale
7edb4fae49 feat(esp_http_client): avoid dispatching of spurious event while closing closes connection
This commit updated the client closing condition to avoid spurious
dispatching of event HTTP_EVENT_DISCONNECTED while closing closeed connection.

Closes https://github.com/espressif/esp-idf/issues/16070
2025-08-12 17:31:50 +05:30
nilesh.kale
9984cc4aab feat(esp_http_client): added new HTTP state HTTP_STATE_CONNECTING and change state flow
This commit added new http state HTTP_STATE_CONNECTING, and made states public.
Also added public API to get current state.
Updated state flow in esp_http_client_perform()

Closes https://github.com/espressif/esp-idf/issues/16019
2025-08-12 17:30:38 +05:30
Fu Hanxi
7198ae518c ci: remove duplicated new lines 2025-08-12 13:44:35 +02:00
Fu Hanxi
e01cc4be89 ci: exclude folders with custom pytest.ini 2025-08-12 13:41:33 +02:00
Fu Hanxi
08d21989a9 ci: fix extra default build targets 2025-08-12 13:41:30 +02:00
Fu Hanxi
4115f5836a ci: update file patterns CMakeList.txt to CMakeLists.txt 2025-08-12 13:37:51 +02:00
Mahavir Jain
c3960c810e Merge branch 'fix/handle_return_during_assiging_header_for_range_request' into 'master'
fix(esp_https_ota): fixed missing return check during setting range header

Closes IDF-13825

See merge request espressif/esp-idf!41185
2025-08-12 15:16:48 +05:30
Rahul Tank
92c125d1c2 Merge branch 'fix/update_ble_gatts_show_local_with_cpfd' into 'master'
fix(nimble): Update ble_gatts_show_local with CPFDs and CAFDs

Closes BLERP-2151 and BLERP-2139

See merge request espressif/esp-idf!41028
2025-08-12 14:52:37 +05:30
zwx
55246f0fde feat(esp_phy): update phylib for C5 2025-08-12 17:04:12 +08:00
Peter Marcisovsky
ab49455449 Merge branch 'fix/run_esp_usb_pre_commit' into 'master'
Run pre-commit fom esp-usb on usb-related files

See merge request espressif/esp-idf!40864
2025-08-12 10:18:44 +02:00
morris
b137fe0227 doc(lcd): explain the DPHY power supply 2025-08-12 16:15:59 +08:00
Darian Leung
cc48f7c67d fix: I2C driver should use I2C_CLK_SRC_REF_TICK enum 2025-08-12 15:56:22 +08:00
Jiang Jiang Jian
4b559f6253 Merge branch 'enhancement/protect_from_odd_phy_disable_operations_by_single_modem' into 'master'
esp_phy: Add protection of consecutive disable operations by single modem source

See merge request espressif/esp-idf!41152
2025-08-12 15:46:33 +08:00
C.S.M
bb554a74dd Merge branch 'refactor/tsens_hal' into 'master'
refactor(temperature_sensor): Move temperature calculation from hw_support to hal

See merge request espressif/esp-idf!40296
2025-08-12 15:39:06 +08:00
Marius Vikhammer
7aca8b8df2 Merge branch 'bugfix/usb_serial_jtag_tests_console_p4_c5' into 'master'
ci(system): enable usb-serial-jtag console tests for p4 and c5

See merge request espressif/esp-idf!41039
2025-08-12 15:32:23 +08:00
Gao Xu
b67635cbd4 Merge branch 'ci/add_s3_eye_test_and_runner' into 'master'
ci(camera): add esp32s3eye test and runner for DVP

See merge request espressif/esp-idf!41109
2025-08-12 14:58:03 +08:00
zinkett
0fdb9e1764 feat(examples): improved example for Ethernet SPI polling mode without interrupt
Update example for polling mode, without interrupt pin
2025-08-12 14:42:10 +08:00
morris
185a1c5a1e Merge branch 'fix/i2c_example' into 'master'
fix(i2x_basic_example): Fix the param passed to i2c API

Closes IDFGH-16197

See merge request espressif/esp-idf!41182
2025-08-12 14:34:12 +08:00
Konstantin Kondrashov
9e07bb10a0 feat(efuse): Allow custom key purposes 2025-08-12 14:32:01 +08:00
Mahavir Jain
f9e2ebaea5 feat(protocomm): disable security version 0 and 1 by default
Change default values for protocomm security configuration options to improve
security:
- CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0 now defaults to 'n'
- CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1 now defaults to 'n'

This reduces code size by default and encourages use of more secure protocomm
implementations.
Projects using these security versions must explicitly enable them in their
configuration.
2025-08-12 11:43:12 +05:30
harshal.patil
16873520fd ci(flash_enc): Extend flash encryption and mbedtls test case to test PSRAM encryption 2025-08-12 11:29:00 +05:30
Alexey Lapshin
4339a7eafb Merge branch 'fix/newlib_kconfig_variables' into 'master'
change(newlib): change CONFIG_NEWLIB* prefix to CONFIG_LIBC_NEWLIB*

See merge request espressif/esp-idf!41153
2025-08-12 09:54:45 +04:00
nilesh.kale
cc95457c22 fix(esp_https_ota): fixed missing return check during setting range header
This commit added return value check during setting the range header
for partial download procedure of esp_https_ota
2025-08-12 10:26:14 +05:30
chenjianhua
b8996f3953 feat(ble/bluedroid): Added BLE multiple connections examples 2025-08-12 12:20:34 +08:00
chenjianhua
f0cfb6e33c feat(ble/bluedroid): Support multi-connection optimization vendor hci command 2025-08-12 12:14:51 +08:00
Chen Chen
7d1f5d7d46 fix(i2x_basic_example): Fix the param passed to i2c API
Closes https://github.com/espressif/esp-idf/issues/17246
2025-08-12 11:27:47 +08:00
morris
5df7a0a8c9 Merge branch 'fix/gpio_example_conflict' into 'master'
fix(generic_gpio): Avoid conflict when using USB-OTG

Closes IDFGH-15615

See merge request espressif/esp-idf!41177
2025-08-12 11:22:30 +08:00
Gao Xu
d1feaf5b01 Merge branch 'fix/spi_flash_speed_on_fpga' into 'master'
fix(flash): fix H21/H4 error on FPGA because of wrong flash speed

See merge request espressif/esp-idf!41166
2025-08-12 11:22:26 +08:00
chenjianhua
437aba1653 fix(ble/bluedroid): Fixed the connection count limit in multi-connection 2025-08-12 11:02:38 +08:00
xuzhekai
2ccae5330e fix(bt/bluedroid): adjust L2CAP round robin msg send strategy 2025-08-12 11:02:38 +08:00
morris
100a0570e9 Merge branch 'feat/hal_config_macro_func' into 'master'
refactor(hal): use HAL_CONFIG() macro function

Closes IDF-13629

See merge request espressif/esp-idf!41127
2025-08-12 10:49:28 +08:00
Island
ee1efc59ad Merge branch 'fix/specify_scan_channel_for_esp32c2' into 'master'
fix(ble): wrapped specify scan channel vs cmd

See merge request espressif/esp-idf!41150
2025-08-12 10:44:53 +08:00
Chen Chen
fb4cfde6f5 fix(generic_gpio): Avoid conflict when using USB-OTG
Changed the default GPIO out pins in generic_gpio for ESP32S3, to avoid the pin
conflict at GPIO 19 when using USB-OTG to communicate.

Closes https://github.com/espressif/esp-idf/issues/16244
2025-08-12 09:53:46 +08:00
Lu Wei Ke
d87d950abc Merge branch 'docs/update_tcm_to_spm_esp32p4' into 'master'
docs: Update TCM to SPM for ESP32-P4 memory types

Closes DOC-11704

See merge request espressif/esp-idf!40472
2025-08-12 09:25:05 +08:00
Alexey Lapshin
8f97220a48 feat(newlib): add test for newlib_nano with esp32-psram 2025-08-11 21:28:55 +07:00
Wan Lei
4bd3661faf Merge branch 'contrib/github_pr_17268' into 'master'
Add note about drive capability for GPIO pins in SPI slave example (GitHub PR)

Closes IDFGH-16223

See merge request espressif/esp-idf!41157
2025-08-11 21:54:54 +08:00
Mahavir Jain
1a7bf1b2e9 Merge branch 'fix/esp32h21_no_issue_on_block9' into 'master'
fix(efuse): ESP32-H21 no issues on BLOCK9 with AES_XTS and ECDSA keys

See merge request espressif/esp-idf!40698
2025-08-11 19:20:18 +05:30
brahim ghouma
b9bb6b5aa4 Add note about drive capability for GPIO pins in SPI slave example 2025-08-11 21:38:30 +08:00
Mahavir Jain
d2858847b2 fix(esp_psram): make SPIRAM_USE_MEMMAP depend on ESP32 target 2025-08-11 18:06:11 +05:30
Mahavir Jain
54c7803cd3 fix(psram): provide boot warning about PSRAM encryption issue on C5/C61
For C5/C61 revision 1.0, PSRAM encryption has hardware issue. This will
be addressed in future silicon version. Add explicit warning about this.
2025-08-11 18:06:11 +05:30
Konstantin Kondrashov
4bf5d62683 fix(efuse): ESP32-H21 no issues on BLOCK9 with AES_XTS and ECDSA keys 2025-08-11 17:49:43 +05:30
Alexey Lapshin
4dc6cb3fa1 change(newlib): change CONFIG_NEWLIB* prefix to CONFIG_LIBC_NEWLIB* 2025-08-11 19:06:44 +07:00
Sumeet Singh
1fb909466a fix(nimble): Update ble_gatts_show_local with CPFDs and CAFDs 2025-08-11 17:30:24 +05:30
Cody
6b360dacf6 fix(ble/bluedroid): Update Gatt_Server_Service_Table_Example_Walkthrough.md 2025-08-11 19:48:04 +08:00
BLKDASH
6b212c7d47 fix(ble/bluedroid): Fixed the problem of macro definition error 2025-08-11 19:41:32 +08:00
peter.marcisovsky
4deccbc4a6 fix(usb_host): Run esp-usb pre-commit:
- trailing whitespaces
    - end-of-file-fixer
    - codespell
    - astyle_py: align pointer name
2025-08-11 13:14:36 +02:00
Ondrej Kosta
b3e2f89f49 feat(esp_eth): added EMAC sleep retention for ESP32P4 2025-08-11 12:53:24 +02:00
nilesh.kale
dedc9889de feat: added config member to store block number for hign part of ecdsa key 2025-08-11 16:01:10 +05:30
nilesh.kale
08e781c876 feat: added new config member to provide ecdsa curve type 2025-08-11 16:01:09 +05:30
nilesh.kale
68f06a94bd feat: add ecdsa-p384 testcases and relative support for ESP32C5 ECO2
This commit adds testcases in crypto/hal and mbedtls testapps.
2025-08-11 16:01:01 +05:30
Erhan Kurubas
f5ffef1556 change(app_trace): move gcov component to the esp-component-registry 2025-08-11 13:24:42 +03:00
morris
ae221cb24f Merge branch 'feat/sdm_sleep_retention' into 'master'
sdm driver sleep retention support and thread safety enhancement

Closes IDF-12348, IDF-13686, IDF-10700, IDF-9742, IDF-9771, and IDF-10396

See merge request espressif/esp-idf!41088
2025-08-11 18:23:50 +08:00
gaoxu
5433c4c3c5 fix(flash): fix H21/H4 error on FPGA because of wrong flash speed 2025-08-11 18:09:44 +08:00
Shen Mengjing
1319fe05e1 docs: Sync CN and EN docs 2025-08-11 17:42:59 +08:00
Shen Mengjing
a130dea2c9 docs: Update CN translation for tools.rst 2025-08-11 16:58:21 +08:00
nilesh.kale
73d8ad9083 feat(esp_http_client): handle error while reading data from server
This commit updated API esp_http_cleint_perform() to handle error and
dispatched error  event if any error occured whiling reading data from server.
2025-08-11 16:39:22 +08:00
Sudeep Mohanty
3ef41363cf Merge branch 'task/remove_freertos_compatibility' into 'master'
remove(freertos): Removed freertos_compatibility.c

Closes IDF-3851 and IDF-8144

See merge request espressif/esp-idf!40652
2025-08-11 10:25:33 +02:00
renpeiying
2f2cb51904 docs: Update struct for correct building of ledc.h
Closes https://github.com/espressif/esp-idf/issues/8813
2025-08-11 16:18:01 +08:00
armando
987c901fa5 change(soc): simplify p4 soc cmake 2025-08-11 15:36:15 +08:00
harshal.patil
9e87b50307 change(mbedtls/ecdsa): The ECDSA module of ESP32-H2 ECO5 does not use MPI module 2025-08-11 12:08:51 +05:30
Chen Jichang
e321d3f85f feat(rmt): support unaligned receive buffer with DMA
The driver will help to align the buffer to mem_alignment in DMA mode
2025-08-11 14:22:28 +08:00
Chen Jichang
f4a76612fa feat(rmt): allow to set init level before any tx transmission
Closes https://github.com/espressif/esp-idf/issues/16068
2025-08-11 14:22:28 +08:00
Chen Jichang
7d0d7c52db fix(rmt): deal with spurious RX done interrupts on ESP32
Closes https://github.com/espressif/esp-idf/issues/15948
2025-08-11 14:22:28 +08:00
Chen Jichang
4ee0feeb6f refactor(rmt): use gdma link list driver to mount buffer 2025-08-11 14:22:28 +08:00
morris
844dc17b43 Merge branch 'fix/rmt_simple_encoder_done_with_mem_full' into 'master'
fix(rmt): fix the state of simple encoder with mem full

Closes IDFGH-16195

See merge request espressif/esp-idf!41070
2025-08-11 14:01:57 +08:00
Rahul Tank
4f84ba0ae7 Merge branch 'feat/add_vsc_specify_scan_chan' into 'master'
fix(nimble): Add VSC for Set Scan Channel Bitmap

Closes BLERP-2131

See merge request espressif/esp-idf!40933
2025-08-11 11:23:32 +05:30
Wang Mengyang
15d88a149b fix(esp_phy): Add protection of consecutive disable operations by single modem source 2025-08-11 13:47:48 +08:00
Aditya Patwardhan
b72e532598 Merge branch 'feature/move_partial_download_code_under_config' into 'master'
feat(esp_http_client): move partial download related code under config

Closes IDF-13464

See merge request espressif/esp-idf!40270
2025-08-11 11:09:49 +05:30
zhanghaipeng
12df54e8d1 fix(ble/bluedroid): Fixed potential out-of-bounds memory access when resolve adv data 2025-08-11 13:08:14 +08:00
Song Ruo Jing
451cfc91c3 Merge branch 'contrib/github_pr_17241' into 'master'
Refactor: Use enum values when assigning "pull_[up|down]_en" fields of "gpio_config" (GitHub PR)

Closes IDFGH-16192

See merge request espressif/esp-idf!41058
2025-08-11 12:08:16 +08:00
C.S.M
0121a14699 refactor(temperature_sensor): Move temperature calculation from hw_support to hal 2025-08-11 11:47:20 +08:00
wuzhenghui
a0ca0fe7be fix(esp_hw_support): test ESP_SLEEP_RTC_USE_RC_FAST_MODE sleep submode after reset 2025-08-11 11:28:38 +08:00
wuzhenghui
b4aa2de9c4 fix(esp_hw_support): fix ESP_SLEEP_RTC_USE_RC_FAST_MODE sub_mode lost after cpu/sys reset
Closes https://github.com/espressif/esp-idf/issues/16243
2025-08-11 11:28:34 +08:00
Zhang Wen Xu
29af244a49 Merge branch 'feat/add_154_mac_logs_when_ot_assert' into 'master'
feat(openthread): add option to dump 802.15.4 MAC debug info on assert

See merge request espressif/esp-idf!40936
2025-08-11 02:35:43 +00:00
Zhou Xiao
33febd990c fix(ble): wrapped specify scan channel vs cmd 2025-08-11 10:25:56 +08:00
hebinglin
52ef5c8072 fix(esp_hw_support): change if condition to fix idf-13103 2025-08-11 10:24:12 +08:00
hebinglin
1e89698c60 fix(esp_hw_support): change esp_sleep_clock_option_t to fix idf-13119 2025-08-11 10:24:12 +08:00
morris
0eb611a797 feat(sdm): add driver support for esp32-h4 2025-08-11 10:16:03 +08:00
morris
f808fb9eaf feat(sdm): add sleep retention support 2025-08-11 10:15:40 +08:00
morris
83512e3e7c feat(sdm): enhance the thread safety 2025-08-11 10:13:57 +08:00
Shen Meng Jing
e58562e030 Merge branch 'docs/update_cn_mbedtls' into 'master'
docs: Update the CN translation for mbedtls.rst

Closes DOC-11889

See merge request espressif/esp-idf!40956
2025-08-11 10:06:36 +08:00
armando
71a09b82a4 change(cache): when vaddr is not cacheable, msync will return not supported 2025-08-11 01:53:16 +00:00
gaoxu
178b5802f3 ci(camera): add esp32s3eye test and runner for DVP 2025-08-10 18:45:02 +08:00
Chen Ji Chang
6c8d12a670 Merge branch 'feat/support_pcnt_on_h21' into 'master'
feat(pcnt): support pcnt on esp32h21

Closes IDF-11566, IDF-11567, IDF-9907, IDF-9739, IDF-8469, and IDF-9768

See merge request espressif/esp-idf!40889
2025-08-10 01:36:03 +08:00
Jiang Jiang Jian
bba5292866 Merge branch 'bugfix/update_librtc' into 'master'
fix(esp_phy): update esp32 librtc.a for coex problems

See merge request espressif/esp-idf!41046
2025-08-09 00:46:46 +08:00
Jiang Jiang Jian
dbb2d4f027 Merge branch 'change/ble_update_lib_20250806' into 'master'
change(ble): [AUTO_MR] 20250806 - Update ESP BLE Controller Lib

Closes BLERP-2128, BLERP-2124, and BLERP-1825

See merge request espressif/esp-idf!41075
2025-08-08 22:49:43 +08:00
Roland Dobai
5caacd42ff Merge branch 'docs/add-config-migration' into 'master'
docs: add link to esp-idf-kconfig migration guide

See merge request espressif/esp-idf!40898
2025-08-08 16:14:24 +02:00
Nachiket Kukade
e3269dc618 Merge branch 'bugfix/ftm_example_issues' into 'master'
Improve FTM Query logging for AP-Sta mode

Closes WIFIBUG-1256 and WIFIBUG-1257

See merge request espressif/esp-idf!39741
2025-08-08 21:18:51 +08:00
akshat
13a46dcfcf bugfix(wifi): Improve FTM Query logging for AP-Sta mode 2025-08-08 17:43:45 +05:30
Jiang Jiang Jian
51ed23be67 Merge branch 'bugfix/fix_ht20_check_wrong' into 'master'
Bugfix/fix ht20 check wrong

Closes WIFIBUG-1333 and WIFIBUG-1377

See merge request espressif/esp-idf!41086
2025-08-08 20:00:15 +08:00
LiPeng
c99850e50d fix(bt): fixed sw_intr issue with BT register or trigger error core on ESP32 2025-08-08 19:50:37 +08:00
morris
afd35e411a refactor(hal): use HAL_CONFIG() macro function 2025-08-08 18:25:24 +08:00
Gao Xu
465c37d5eb Merge branch 'feat/support_uart_on_h4' into 'master'
feat(uart): support uart on ESP32H4

Closes IDF-12398, IDF-12400, and IDF-12948

See merge request espressif/esp-idf!39224
2025-08-08 18:03:30 +08:00
Ren Peiying
fbe5dc7c92 Merge branch 'docs/update_struct_in_lcd_spi' into 'master'
docs: Update lcd_io_spi.h for correct documentation building

Closes DOC-11820

See merge request espressif/esp-idf!41087
2025-08-08 17:46:38 +08:00
Erhan Kurubas
b98d27c7f9 Merge branch 'fix/coredump_max_tasks_num' into 'master'
fix(coredump): implement CONFIG_ESP_COREDUMP_MAX_TASKS_NUM limitation

Closes IDFGH-13516

See merge request espressif/esp-idf!41008
2025-08-08 10:36:24 +02:00
yinqingzhao
7c490492a0 fix(wifi): fix ht20 state check incorrect 2025-08-08 15:57:48 +08:00
yinqingzhao
9ac8d9c3e5 feat(wifi): improve iperf performance of esp32c61 2025-08-08 15:53:34 +08:00
Jiang Jiang Jian
55086dffc7 Merge branch 'bugfix/fix_espnow_coexist_mode_switch_issue' into 'master'
fix(wifi): fix some esp-now issues and lightsleep issues

Closes WIFIBUG-1124, WIFIBUG-1302, WIFIBUG-1303, WIFIBUG-1312, and WIFIBUG-1304

See merge request espressif/esp-idf!40454
2025-08-08 15:30:18 +08:00
gaoxu
db32e42122 feat(uart): support uart on ESP32H4 2025-08-08 14:48:12 +08:00
Chen Jichang
e6f5a9ab5a feat(pcnt): support pcnt on esp32h21 2025-08-08 14:45:16 +08:00
Chen Jichang
587583cc5f remove(pcnt): remove unused retention reg 2025-08-08 14:45:16 +08:00
Island
890229d30b Merge branch 'feat/ble_log_uart_dma_out_console' into 'master'
feat(ble): support ble log console

Closes BLERP-2144

See merge request espressif/esp-idf!41081
2025-08-08 14:33:51 +08:00
Island
5540a8c8a0 Merge branch 'opt/opt_ble_stability' into 'master'
Improve ESP32 stability and security

Closes BLERP-2121, BTQABR2023-538, and BTQABR2023-548

See merge request espressif/esp-idf!40791
2025-08-08 14:31:21 +08:00
Armando (Dou Yiwen)
b57f726a41 Merge branch 'fix/fix_dvp_dma_desc_type_on_s3_1' into 'master'
camera: fixed dvp dma desc type on s3

See merge request espressif/esp-idf!41104
2025-08-08 06:08:20 +00:00
Jiang Jiang Jian
e71760b79e Merge branch 'fix/fix_esp32c5_mac_link_bad_trigger' into 'master'
fix(hal): fix esp32c5 wifimac link bad trigger

See merge request espressif/esp-idf!41057
2025-08-08 13:59:03 +08:00
Rahul Tank
b821dfabaa fix(nimble): Add VSC for Set Scan Channel Bitmap 2025-08-08 11:27:59 +05:30
Rahul Tank
6fbc17c945 Merge branch 'bugfix/correct_attr_count_in_get_db_api' into 'master'
fix(nimble): Updating the count parameter when fetching the gatt db

Closes BLERP-2125 and BLERP-2137

See merge request espressif/esp-idf!40771
2025-08-08 11:14:30 +05:30
Marius Vikhammer
4c9c30831a Merge branch 'fix/cdcacm-callback-placement' into 'master'
fix(esp_vfs_console): Update placement of cdcacm_xx_cb when ETS print enabled

Closes IDFGH-16059

See merge request espressif/esp-idf!40945
2025-08-08 13:24:15 +08:00
Aleksei Apaseev
d19fc2958d ci: fix bin size report generation 2025-08-08 12:22:17 +08:00
Zhou Xiao
36cdf54b37 feat(ble): added ble log console for ble log uhci out 2025-08-08 12:01:43 +08:00
renpeiying
219c331b50 docs: Update struct for correct building 2025-08-08 11:29:27 +08:00
Omar Chebib
4f4083ecda Merge branch 'feature/dsp_coprocessor_support' into 'master'
feat(riscv): add support for the DSP coprocessor

Closes IDF-13087 and LLVM-369

See merge request espressif/esp-idf!40866
2025-08-08 11:06:22 +08:00
armando
458070b1b6 fix(cam): fixed dvp dma desc type on s3 2025-08-08 10:17:05 +08:00
Marius Vikhammer
706800c56b ci(docs): move deployment to Brew runners 2025-08-08 09:46:08 +08:00
Marius Vikhammer
bb8346aad2 Merge branch 'bugfix/enable_misc_test_case' into 'master'
ci: cleanup misc system build-test-rules

See merge request espressif/esp-idf!41067
2025-08-08 09:25:25 +08:00
renpeiying
9f9dbf3270 docs: Add CN trans to tools.rst, Update build-system.rst translation 2025-08-07 19:40:32 +02:00
Jan Beran
152aa6bf63 docs: add link to esp-idf-kconfig migration guide 2025-08-07 19:37:00 +02:00
Erhan Kurubas
55c60e1c34 fix(coredump): implement CONFIG_ESP_COREDUMP_MAX_TASKS_NUM limitation
Closes https://github.com/espressif/esp-idf/issues/14407
2025-08-07 17:17:01 +03:00
Erhan Kurubas
50ab1bff4b fix(coredump): do not build sources when coredump is not enabled 2025-08-07 17:13:44 +03:00
Erhan Kurubas
51f8f625ec fix(coredump): rename uart test config file 2025-08-07 17:13:44 +03:00
zhanghaipeng
8ec5410236 fix(bt): Update esp32 libbtdm_app.a (f1dc7d8)
- Improve ESP32 stability and security
2025-08-07 21:19:06 +08:00
Sudeep Mohanty
fe2ee39a99 feat(esp_ringbuf): Place Ring buffer in flash by default
The following updates have been made in this commit:
- The commit places ring buffer code in flash memory by default.
- CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH has been removed.
- CONFIG_RINGBUF_IN_IRAM is added and can be used to restore the
  previous memory placement.
2025-08-07 19:56:30 +08:00
Sudeep Mohanty
26c19928a9 feat(freertos): Place FreeRTOS in flash by default
The following updates have been made in this commit:
- The commit places FreeRTOS code in flash memory by default.
- CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH has been removed.
- CONFIG_FREERTOS_IN_IRAM is unhidden and can be used to restore the
  previous memory placement.
- A test has been added for users to conduct performance impact testing
  based on memory placement configurations.
2025-08-07 19:56:30 +08:00
Zhou Xiao
2818eb91f1 change(ble): enabled specify scan channel vs hci cmd for ESP32-C2 2025-08-07 17:58:39 +08:00
Song Ruo Jing
8651d6c240 Merge branch 'feature/uart_dtr_dsr_support' into 'master'
feat(uart): add DTR and DSR signals support for UART

Closes IDF-13392, IDFGH-4377, and IDFGH-15328

See merge request espressif/esp-idf!40508
2025-08-07 17:28:28 +08:00
Song Ruo Jing
2319386d9d Merge branch 'bugfix/gpio_esp32_workaround' into 'master'
fix(gpio): fix ESP32 GPIO sleep mode handling

Closes IDF-13626

See merge request espressif/esp-idf!40988
2025-08-07 17:14:58 +08:00
Armando (Dou Yiwen)
cde7e3af50 Merge branch 'fix/fix_dvp_dma_desc_type_on_s3' into 'master'
camera: fixed dvp dma desc type on s3

See merge request espressif/esp-idf!41082
2025-08-07 07:48:50 +00:00
Omar Chebib
63cf7c06d3 test(freertos): add a test case for the DSP coprocessor 2025-08-07 14:40:30 +08:00
Omar Chebib
03f4744497 feat(riscv): add support for the DSP coprocessor 2025-08-07 14:40:30 +08:00
armando
b4a482eae1 fix(cam): fixed dvp dma desc type on s3" 2025-08-07 14:11:20 +08:00
Aditya Patwardhan
4a69fcbdfd Merge branch 'fix/regression_issue_in_digest_auth' into 'master'
fix(esp_http_client): fixed regression issue during enabling digest auth in client

Closes IDFGH-16189

See merge request espressif/esp-idf!41069
2025-08-07 10:53:39 +05:30
C.S.M
6183a566e6 Merge branch 'test/add_i3c_multi_test' into 'master'
test(i3c_master): Add multi test for i3c master, adding i3c slave ll support.

Closes IDFCI-3058

See merge request espressif/esp-idf!41049
2025-08-07 13:19:28 +08:00
Darian Leung
5454499877 refactor: Use enum values for gpio pull up/down fields
Ensure that enum values are used When assigning `pull_up_en` and `pull_down_en`
fields of `gpio_config_t`. Helps avoid `invalid conversion` errors when
building those code snippets in C++.
2025-08-07 11:45:11 +08:00
Chen Jichang
579a744fb3 fix(rmt): fix the state of the simple encoder with mem full
Closes https://github.com/espressif/esp-idf/issues/17244
2025-08-07 11:16:43 +08:00
Jiang Jiang Jian
dd73346503 Merge branch 'feat/support_11ax_rate_for_cert_test' into 'master'
Feat/support 11ax rate for cert test

Closes FCS-1715

See merge request espressif/esp-idf!40950
2025-08-07 10:05:36 +08:00
zwl
7f7c8e2c85 change(ble): [AUTO_MR] updated rom linker script for ESP32-C2 2025-08-06 21:05:01 +08:00
zwl
043143ab8b change(ble): [AUTO_MR] Update lib_esp32c2 to dbd33ef2 2025-08-06 21:04:50 +08:00
zwl
fe22519bb5 change(ble): [AUTO_MR] Update lib_esp32c6 to 898f73cb 2025-08-06 21:04:50 +08:00
zwl
3abfca1e2c change(ble): [AUTO_MR] Update lib_esp32c5 to 898f73cb 2025-08-06 21:04:50 +08:00
zwl
4990dfdd23 change(ble): [AUTO_MR] Update lib_esp32h2 to 898f73cb 2025-08-06 21:04:50 +08:00
Kevin (Lao Kaiyao)
a19ad8df86 Merge branch 'bugfix/fix_multi_pdm_rx_slot_clock_issue' into 'master'
fix(i2s_pdm): fixed pdm multi slot clock issue

Closes IDFGH-16117

See merge request espressif/esp-idf!40855
2025-08-06 19:23:55 +08:00
liuning
b9688b97ec fix(wifi): fix some esp-now issues and lightsleep issues
1. fix tbtt issues when wifi_slp_iram_opt is not enabled and light sleep
   enabled
2. support espnow rx all the time at coexistence default mode, fix some
   coexist perfermance issue with coexistence default mode.
3. support connectionless ps with enhanced_light_sleep
4. fix espnow coexist issue when switching to coexistence mode
5. fix concurrent issue of connectionless_interval_set API
2025-08-06 19:17:58 +08:00
Jiang Jiang Jian
e6dfb60309 Merge branch 'change/remove_assert_in_esp_sleep_pd_config' into 'master'
change(esp_hw_support): warning in esp_sleep_pd_config instead of assert

Closes IDFGH-15936

See merge request espressif/esp-idf!40608
2025-08-06 19:15:56 +08:00
Guillaume Souchere
5ee5280195 fix(esp_vfs_console): Update placement of cdcacm_xx_cb when ETS print enabled 2025-08-06 12:13:24 +02:00
nilesh.kale
ce4a901460 fix(esp_http_client): fixed regression issue during enabling digest auth in client
This commit solved the issue introduced in commit a0bcffcce9
for enabling digest auth for esp_http_client.

Closes https://github.com/espressif/esp-idf/issues/17238
2025-08-06 15:38:25 +05:30
C.S.M
818579b78d test(i3c_master): Add multi test for i3c master 2025-08-06 18:04:29 +08:00
C.S.M
cc9aebf0ae feat(i3c_slave): Add hal support for i3c slave 2025-08-06 18:04:29 +08:00
morris
949296e4bd Merge branch 'refactor/i2c_driver_use_gpio_num_t' into 'master'
refactor(i2c): use gpio_num_t to declare GPIO number

See merge request espressif/esp-idf!41061
2025-08-06 18:04:19 +08:00
Konstantin Kondrashov
d9241bf545 Merge branch 'fix/ulp_riscv_delay_cycles' into 'master'
fix(ulp_riscv): Fix ulp_riscv_delay_cycles() to handle small delays correctly

Closes IDFGH-15960

See merge request espressif/esp-idf!40708
2025-08-06 18:01:05 +08:00
Marius Vikhammer
43667179f4 ci(system): enabled and cleanup misc system test-apps build-test-rules 2025-08-06 17:50:50 +08:00
muhaidong
ccb4e418e8 feat(docs): remove wifi related docs from docs_not_updated for esp32h21 2025-08-06 17:34:43 +08:00
morris
5053084a9e Merge branch 'fix/i2c-master-write-buffer-const' into 'master'
fix(i2c): make write_buffer const in i2c_master_transmit_multi_buffer_info_t

Closes IDFGH-15959

See merge request espressif/esp-idf!40773
2025-08-06 17:22:14 +08:00
Wan Lei
fe3c676d13 Merge branch 'feature/h4_spi_support' into 'master'
feat(driver_spi): support esp32h4 spi driver

Closes IDF-12362, IDF-12364, IDF-12366, and IDF-11521

See merge request espressif/esp-idf!40862
2025-08-06 16:26:34 +08:00
Konstantin Kondrashov
cd5b581425 fix(ulp_riscv): Fix a delay function to handle small delays correctly
Fixed ulp_riscv_delay_cycles function

Closes https://github.com/espressif/esp-idf/issues/16891
2025-08-06 15:57:03 +08:00
Kevin (Lao Kaiyao)
d622116355 Merge branch 'bugfix/fix_touch_isr_safe_issue' into 'master'
fix(legacy_touch): fixed touch read API can't be called in ISR context

Closes IDFGH-16104

See merge request espressif/esp-idf!41021
2025-08-06 15:36:59 +08:00
morris
db9bee20b6 refactor(i2c): use gpio_num_t to declare GPIO number 2025-08-06 15:26:09 +08:00
Shen Mengjing
dfd3ccf5fd docs: Update the CN translation for mbedtls.rst 2025-08-06 11:32:14 +08:00
laokaiyao
b5fd5da6e8 fix(legacy_touch): fixed touch read API can't be called in ISR context
Closes https://github.com/espressif/esp-idf/issues/17045
2025-08-06 11:07:07 +08:00
Chen Ji Chang
6e0dd0581c Merge branch 'fix/fix_psram_incr16' into 'master'
fix(dma): add burst size check when dma access psram

See merge request espressif/esp-idf!40991
2025-08-06 11:02:25 +08:00
wuzhenghui
9a4abbdd3a fix(hal): fix esp32c5 mac link bad trigger 2025-08-06 10:51:30 +08:00
morris
6ea0fa1a57 Merge branch 'refactor/remove_lcd_deprecated' into 'master'
esp_lcd clean up

Closes IDF-13711, IDF-13712, IDF-13713, IDF-13714, and IDF-13715

See merge request espressif/esp-idf!40848
2025-08-06 10:41:20 +08:00
Xiao Xufeng
208fad5616 fix(i2c): make write_buffer const in i2c_master_transmit_multi_buffer_info_t
Fixes https://github.com/espressif/esp-idf/issues/16890
2025-08-06 10:38:48 +08:00
Harshal Patil
eae2f70381 Merge branch 'change/remove_esp_security_dependency_from_esp_hw_support' into 'master'
Move security-related modules present in esp_hw_support component to esp_security

Closes IDF-10733

See merge request espressif/esp-idf!39490
2025-08-06 06:27:12 +05:30
Song Ruo Jing
9a2984b4c0 fix(gpio): fix ESP32 GPIO sleep mode handling
The previous workaround does not work, the backup/restore should apply to RTC IO registers.
Also moved the workaround to sleep_gpio.c to avoid gpio hal using kconfig.
2025-08-05 21:02:09 +08:00
Alexey Lapshin
44aeff1319 Merge branch 'feature/libc_init_array-from-toolchain' into 'master'
fix(esp_system): fix .init_array.*/.ctors.* ordering

Closes IDF-1176 and DOC-11527

See merge request espressif/esp-idf!39811
2025-08-05 16:09:00 +04:00
nilesh.kale
2db4bcf87d feat(esp_http_client): move partial download related code under config
This MR added an menuconfig option to enable partial download feature.
2025-08-05 17:38:10 +05:30
Hrushikesh Bhosale
5c15e41d9a Merge branch 'fix/update_postman_root_certificate' into 'master'
Updated postman root certificate

Closes IDF-13779

See merge request espressif/esp-idf!41022
2025-08-05 18:48:10 +08:00
Song Ruo Jing
c6dad68e81 refactor(uart): remove UART_FIFO_LEN macro for v6.0 2025-08-05 17:08:32 +08:00
Astha Verma
7f7aedbae5 fix(nimble): Handle count correctly by considering offset. 2025-08-05 14:25:51 +05:30
Song Ruo Jing
6bfdc93593 feat(uart): add DTR and DSR signals support for UART 2025-08-05 16:45:46 +08:00
Astha Verma
6a2d105bf0 fix(nimble): Updating the count parameter when fetching the gatt db 2025-08-05 14:14:53 +05:30
hrushikesh.bhosale
4dd10c458c fix(esp_http_client): Moved httpd_async request from cert_pem to crt_bundle
Moved the httpd_async request from cert_pem to esp_crt_bundle. As cert_pem
is alredy tested for howmyssl URL
2025-08-05 14:06:44 +05:30
morris
b8a5ebfa01 refactor(i2c): clean up i2c driver header file
remove unnecessary dependencies
2025-08-05 15:11:07 +08:00
morris
8a3aef7542 refactor(lcd): simplify the spi_lcd_touch example 2025-08-05 15:09:40 +08:00
morris
b4e39631d3 refactor(i2c_lcd): test app in cxx environment 2025-08-05 15:09:40 +08:00
morris
414dba5009 refactor(lcd)!: remove deprecated types 2025-08-05 15:09:40 +08:00
wanckl
37c6608ab3 feat(driver_spi): support esp32h4 spi driver 2025-08-05 15:08:02 +08:00
laokaiyao
c415c060bd feat(i2s): add PLL240M clock source on S3 and C6
Closes https://github.com/espressif/esp-idf/issues/17056
2025-08-05 15:01:04 +08:00
laokaiyao
f7439317f0 fix(i2s_pdm): fixed pdm multi slot clock issue
Fixed the sample rate slow down issue when using more than 4 slots in  pdm rx mode.
2025-08-05 15:01:04 +08:00
Sudeep Mohanty
471a659e84 remove(freertos): Removed freertos_compatibility.c
The freertos_compatibility.c file has been removed and appropriate
guidelines have been added to hints.yml and the migration guide to use
alternatives for the backward compatibility functions that have been
removed.
2025-08-05 08:41:47 +02:00
JinCheng
54f1f22e69 fix(esp_phy): update esp32 librtc.a for coex problems
- ESP32 phy_version: 4861, b71b5ad, Aug, 5 2025
- ESP32 librtc version: 6758f983, Mar 22 2024, 13:39:26
2025-08-05 12:08:57 +08:00
morris
8b41a42372 refactor(lcd)!: use gpio_num_t to define gpio numbers used by LCD driver 2025-08-05 11:51:09 +08:00
Chen Jichang
4957e09e5e fix(dma): add burst size check when dma access psram 2025-08-05 11:36:24 +08:00
Armando (Dou Yiwen)
72cb973022 Merge branch 'feat/cache_panic_h4' into 'master'
cache: panic support on h4

Closes IDF-12288

See merge request espressif/esp-idf!41023
2025-08-05 03:23:56 +00:00
morris
4173af5620 Merge branch 'bugfix/fix_es7210_example_dependency_breaking_change' into 'master'
fix(i2s_es7210): fixed breaking change of dependency migration

See merge request espressif/esp-idf!41041
2025-08-05 11:20:16 +08:00
Armando (Dou Yiwen)
ebab455d4d Merge branch 'feat/p4_eco5_soc_part4' into 'master'
feat(soc): p4 hw ver2 registers (part 4, final)

Closes IDF-13573

See merge request espressif/esp-idf!40887
2025-08-05 03:07:11 +00:00
laokaiyao
55482616f7 fix(i2s_es7210): fixed breaking change of dependency migration 2025-08-05 10:59:07 +08:00
Jiang Jiang Jian
07db7c3ca5 Merge branch 'bugfix/fix_scan_done_event_miss_issue' into 'master'
fix(wifi): fix scan done event miss issue

Closes WIFI-6965

See merge request espressif/esp-idf!40983
2025-08-05 10:05:24 +08:00
Marius Vikhammer
d8f40df79c ci(system): enable usb-serial-jtag console tests for p4 and c5 2025-08-05 09:56:38 +08:00
Ashish Sharma
414397c048 fix(esp_http_client): fix possible double memory free 2025-08-05 09:48:22 +08:00
Song Ruo Jing
df5bff7a07 Merge branch 'contrib/github_pr_17047' into 'master'
change(esp32): Calling gpio_reset_pin on an input only pin should not produce an error message. (GitHub PR)

Closes IDFGH-16106

See merge request espressif/esp-idf!40975
2025-08-04 21:27:48 +08:00
Roland Dobai
138336b9c6 Merge branch 'feat/deprecate-py39' into 'master'
Tools: Deprecate Python 3.9

Closes IDF-7996

See merge request espressif/esp-idf!40851
2025-08-04 15:13:55 +02:00
muhaidong
a349edaf76 fix(wifi): fix scan done event miss issue 2025-08-04 21:04:29 +08:00
Samuel Obuch
b59bc28553 Merge branch 'feat/esp32c5_lp_debug_example' into 'master'
feat(ulp): esp32c5 and esp32p4 support in debugging example

See merge request espressif/esp-idf!39471
2025-08-04 17:43:00 +08:00
armando
e179056b7c fix(rtc): fixed rtc_clk.c not in iram issue 2025-08-04 17:03:34 +08:00
armando
7a1e5f540e feat(cache): supported cache panic driver on h4 2025-08-04 17:03:34 +08:00
armando
2a586022c4 fix(system): fixed wrong CPU_LOCKUP reset reason value 2025-08-04 17:03:34 +08:00
zwx
6b9e4405a6 feat(openthread): add option to dump 802.15.4 MAC debug info on assert 2025-08-04 06:31:42 +00:00
harshal.patil
60ff4bca9b refactor(esp_system): Update all references of the memory protection configs 2025-08-04 11:43:01 +05:30
harshal.patil
abaef73667 refactor(esp_system): Place all memory protection options under one option 2025-08-04 11:43:01 +05:30
harshal.patil
5c6c73ece4 change(riscv): Remove redundant definition of MEMPROT_ISR 2025-08-04 11:43:01 +05:30
harshal.patil
d70b5000cc remove(esp_hw_support): Remove redundant and unsupported memprot mentions 2025-08-04 11:43:01 +05:30
harshal.patil
55e0730a8d change(esp_hw_support): Move security-related modules to the esp_security component
- Also adds support to whitelist target specific expected dependency violations
in check_dependencies.py
2025-08-04 11:43:01 +05:30
Olivér Remény
9317ecb4ea fix(gpio): Avoid error message when calling reset on an input only pin.
The `gpio_reset_pin` function attempted to enable internal pullup on pins which does not have one. This change adds a guard to `gpio_reset_pin` for calling `gpio_pullup_en` - the same guard that makes `gpio_pullup_en` print the error.
2025-08-04 12:16:31 +08:00
Zhang Shuxian
1d1bba2164 docs: Update cn translation for build-system.rst 2025-08-04 11:33:44 +08:00
Alexey Lapshin
019dc93ae0 feat(esp_system): switch to standard __libc_init_array initialization
Initially, ESP-IDF used the do_global_ctors() function to run global
constructors. This was done to accommodate Xtensa targets that emit
.ctors.* sections, which are ordered in descending order.

For RISC-V, compilation used .init_array.* sections, which are designed
to have ascending order. Priority constructors in .init_array.* sections
were correctly processed in ascending order. However, non-priority
.init_array section was processed in descending order, as it was done
for Xtensa .ctors.

Starting with ESP-IDF v6.0, the implementation switched to the standard
LibC behavior (__libc_init_array()), which processes both priority and
non-priority constructors in ascending order.

To achieve this, a breaking changes were introduced:
  - Xtensa .ctors.* priority entries converted to .init_array.* format
    (ascending), to be passed to __libc_init_array().
  - Processing order of non-priority .init_array and .ctors sections was
    changed from descending to ascending.

Also, this change introduces .preinit_array for linking. This may be
needed for some C++ or sanitizer features.

Related to https://github.com/espressif/esp-idf/issues/15529
2025-08-04 11:33:44 +08:00
armando
9956a6230e feat(soc): p4 hw ver2 registers 2025-08-04 02:14:10 +00:00
muhaidong
f1d55e162d feat(phy): update 11ax rate for cert test 2025-08-03 17:07:28 +08:00
muhaidong
8a425253d1 feat(phy): add 11ax rate for cert test 2025-08-03 17:07:28 +08:00
Gao Xu
819970f439 Merge branch 'fix/correct_adc_periph_num_on_c2' into 'master'
fix(adc): fix ESP32-C2/P4 wrong adc periph num

See merge request espressif/esp-idf!40542
2025-08-03 14:45:23 +08:00
Jiang Jiang Jian
397c273ec0 Merge branch 'feat/chip_esp32c61_update_libphy' into 'master'
feat(phy): update libphy for esp32c61/esp32c5/esp32h2

See merge request espressif/esp-idf!40907
2025-08-02 01:29:55 +08:00
Jiang Jiang Jian
47c0e262e0 Merge branch 'bugfix/fix_bt_hci_not_effective' into 'master'
Fixed bt hci event was not report to host when hci command was sent(master)

Closes BTQABR2023-538 and BTQABR2023-548

See merge request espressif/esp-idf!40992
2025-08-02 00:56:07 +08:00
Jiang Jiang Jian
97c4eed16a Merge branch 'bugfix/fixed_ble_dtm_err' into 'master'
Bugfix/fixed ble dtm err

Closes BLERP-2129

See merge request espressif/esp-idf!40935
2025-08-01 22:48:56 +08:00
wuzhenghui
9f53ff77a1 change(example): adds USB-Serial-JTAG console usage notes to sleep examples
Closes https://github.com/espressif/esp-idf/issues/16129
2025-08-01 20:28:09 +08:00
yinqingzhao
5eea5464c4 feat(phy): update libphy for esp32c61/esp32c5/esp32h2 2025-08-01 20:12:54 +08:00
zhanghaipeng
155c32be20 fix(bt/ble): Update esp32 libbtdm_app.a (722c907a)
- Fixed bt hci event was not report to host when hci command was sent
2025-08-01 19:21:28 +08:00
Shen Mengjing
a091b84298 docs: Edit the CN translation 2025-08-01 16:40:35 +08:00
Marius Vikhammer
978f2e9720 Merge branch 'bugfix/test_utils_comp_missing' into 'master'
test(system): fixed missing test_utils component dependency

See merge request espressif/esp-idf!40969
2025-08-01 16:17:18 +08:00
Chen Ji Chang
ee779a0b72 Merge branch 'feat/support_twai_on_h21' into 'master'
feat(twai): support twai on esp32h21

Closes IDF-11574 and IDF-11575

See merge request espressif/esp-idf!40888
2025-08-01 15:35:35 +08:00
Shen Mengjing
cbd1ede64c docs: Update CN translation for linux-macos-setup.rst 2025-08-01 14:39:42 +08:00
Peter Dragun
300ff9fc78 change: fix linting errors in python files 2025-08-01 08:05:13 +02:00
Peter Dragun
519042a1e2 feat: Deprecate Python 3.9
BREAKING CHANGE:
- Minimal supported Python version is now 3.10.
2025-08-01 08:05:10 +02:00
Jiang Jiang Jian
84b4605ffa Merge branch 'fix/wpsreg_crash_due_to_double_reset' into 'master'
fix(wifi): Fix crash in WPS-registrar due to nested 'eap_wsc_reset()' calls

Closes WIFIBUG-1342

See merge request espressif/esp-idf!40751
2025-08-01 13:55:17 +08:00
Marius Vikhammer
73bd521d7a test(system): fixed missing test_utils component dependency 2025-08-01 13:40:47 +08:00
C.S.M
142a8301e8 Merge branch 'fix/make_bootloader_flash_size_correct' into 'master'
fix(bootloader_flash): Make bootloader flash size accurate

See merge request espressif/esp-idf!40847
2025-08-01 12:02:42 +08:00
Armando (Dou Yiwen)
1b22d58779 Merge branch 'feat/h4_mmu' into 'master'
mmu: h4 support

Closes IDF-12305

See merge request espressif/esp-idf!40565
2025-08-01 03:58:33 +00:00
Marius Vikhammer
4065fb20f3 Merge branch 'feature/esp_test_utils_component' into 'master'
change(test_utils): moved test_utils out of unit-test-app project

See merge request espressif/esp-idf!40678
2025-08-01 11:04:37 +08:00
Jiang Jiang Jian
1c08475950 Merge branch 'bugfix/classic_bt-safe-string-handling' into 'master'
Bugfix/classic bt safe string handling

Closes IDFGH-16085

See merge request espressif/esp-idf!40868
2025-08-01 10:39:52 +08:00
Jiang Jiang Jian
2bbf9b6160 Merge branch 'fix/chip_esp32c5_eco2_supp' into 'master'
Get operating class in dual band

Closes IDF-10613

See merge request espressif/esp-idf!38892
2025-08-01 10:27:34 +08:00
Sarvesh Bodakhe
8631f5dafd fix(wifi): prevent crash in WPS-registrar due to nested 'eap_wsc_reset()' calls
When a WPS handshake is already in progress and the enrollee sends another EAPOL-Start
(e.g., due to missed packets or timeout), the registrar resets its state by calling
'eap_wsc_reset()'. This function frees 'sm->eap_method_priv' and then calls
'esp_wifi_ap_wps_disable()', which internally triggers another call to 'eap_wsc_reset()'.

This results in a double reset where the second invocation accesses the already freed
'sm->eap_method_priv', leading to a crash.

This fix sets 'sm->eap_method_priv' to NULL immediately after freeing it to ensure
any subsequent calls to eap_wsc_reset() do not access an invalid pointer.
2025-08-01 10:27:08 +08:00
Marius Vikhammer
96512006c0 Merge branch 'ci/core_tests_use_caps' into 'master'
ci(system): update system pytest apps to use SOC_CAPs

See merge request espressif/esp-idf!40865
2025-08-01 10:25:16 +08:00
JinCheng
720108b220 fix(bt/bluedroid): safe string returns and cleanups for bt_discovery example 2025-08-01 09:40:21 +08:00
Nikheel Savant
90782249c7 fix(bt/bluedroid): safe string returns and cleanups 2025-08-01 09:40:21 +08:00
Alex Lisitsyn
be5e48bf83 Merge branch 'feature/modbus_remove_examples' into 'master'
remove(modbus): remove modbus examples in IDF v6.0

Closes IDF-13491

See merge request espressif/esp-idf!40477
2025-07-31 14:44:33 +01:00
tarun.kumar
5a5b20f44d fix(wifi): Get operating class in dual band 2025-07-31 21:01:59 +08:00
Mahavir Jain
8096a2a295 Merge branch 'feat/mbedtls_no_buffer_alloc_on_session_reset' into 'master'
feat(mbedtls): disable unnecessary buffer allocation in dynamic buffer session reset

See merge request espressif/esp-idf!40126
2025-07-31 17:53:50 +05:30
Song Ruo Jing
e94d9cee7a Merge branch 'refactor/rtc_cal_clk' into 'master'
refactor(clk): add soc_clk_calibration_clk_src_t for all targets

Closes IDF-11790

See merge request espressif/esp-idf!40737
2025-07-31 19:49:17 +08:00
Samuel Obuch
7024babc31 fix(lp_core): dont reset lp cpu with debug attached 2025-07-31 13:48:45 +02:00
Samuel Obuch
1a49af0fb6 feat(ulp): esp32c5 support in debugging example 2025-07-31 13:48:40 +02:00
Fu Hanxi
6bd8b52ad7 Merge branch 'ci/improve-check_build_test_rules-output' into 'master'
ci: improve the output of check_build_test_rules.py

See merge request espressif/esp-idf!40703
2025-07-31 13:42:26 +02:00
Marius Vikhammer
9788d33351 ci(system): update system pytest apps to use SOC_CAPs 2025-07-31 19:05:58 +08:00
Jiang Jiang Jian
1a25df75a6 Merge branch 'fix/c6_phylib_for_modem_state' into 'master'
fix(esp_phy): fix c6 modem state

Closes TZ-1912 and BT-4020

See merge request espressif/esp-idf!40867
2025-07-31 18:15:12 +08:00
aleks
50e724a534 remove(modbus): remove modbus examples in IDF v6.0 2025-07-31 18:10:34 +08:00
Fu Hanxi
fdcc1930d2 ci: improve the output of check_build_test_rules.py 2025-07-31 11:52:13 +02:00
Fu Hanxi
1adb3d6bfe ci: update pre-commit image tag to 2 2025-07-31 11:52:13 +02:00
Aditya Patwardhan
a783974d00 Merge branch 'feat/support_authentication_feature_for_ws' into 'master'
Added pre handshake callback for websocket

Closes IDF-13605

See merge request espressif/esp-idf!40706
2025-07-31 15:04:07 +05:30
Peter Dragun
dba8cb3f76 Merge branch 'feat/ide_requirements' into 'master'
feat(tools/requirements): Add IDE requirements files

See merge request espressif/esp-idf!40348
2025-07-31 17:31:50 +08:00
Jiang Jiang Jian
73e638ecc0 Merge branch 'feat/softap_gcmp_support' into 'master'
fix(wifi): add GCMP_128 cipher support for SoftAP mode

Closes WIFIBUG-558

See merge request espressif/esp-idf!40764
2025-07-31 16:44:22 +08:00
zwl
6f0a61ab0d fix(ble): fixed dtm function error on ESP32-C5 2025-07-31 14:53:29 +08:00
zwl
43c82b3b20 fix(ble): fixed dtm function error on ESP32-H2 2025-07-31 14:52:59 +08:00
zwl
ca0fdad4f2 fix(ble): fixed dtm function error on ESP32-C6 2025-07-31 14:17:07 +08:00
hrushikesh.bhosale
a40ceffb19 feat(esp_http_server): Added pre handshake callback for websocket
1. If the user wants authenticate the request, then user needs to do
this before upgrading the protocol to websocket.
2. To achieve this, added pre_handshake_callack, which will execute
before handshake, i.e. before switching protocol.
2025-07-31 11:06:18 +05:30
wuzhenghui
bf19cddafd change(esp_hw_support): warning in esp_sleep_pd_config instead of assert
Closes https://github.com/espressif/esp-idf/issues/16872#event-18649904083
2025-07-31 11:56:20 +08:00
armando
67ce0580b5 feat(mmu): supported esp_mmu_map and flash_mmap drivers on esp32h4 2025-07-31 03:43:15 +00:00
Gao Xu
9ac4a3400c Merge branch 'refactor/rng_ll_s3' into 'master'
refactor(rng): refactor to use hal/ll apis for S3

Closes IDF-12536

See merge request espressif/esp-idf!39585
2025-07-31 11:41:21 +08:00
Chen Jichang
b670fe9b50 feat(twai): support twai on esp32h21 2025-07-31 10:56:45 +08:00
Sarvesh Bodakhe
3cc59d2cd8 fix(wifi): add GCMP-128 cipher support for SoftAP mode
GCMP-256 SoftAP support was previously added as part of SAE Extended Key handling.
2025-07-31 10:40:28 +08:00
Wu Zheng Hui
f1df2f3be6 Merge branch 'fix/fix_lightsleep_pd_modem_breaks_common_fe_clock' into 'master'
fix(esp_hw_support): fix lightsleep pd modem breaks common fe clock

Closes FCS-1741

See merge request espressif/esp-idf!40437
2025-07-31 10:33:16 +08:00
Jiang Jiang Jian
dafc793707 Merge branch 'bugfix/snd_chan_update' into 'master'
fix(esp_wifi): Fix incorrect values for negotiated bandwidth for 2040 coex cases

Closes WIFIBUG-1199 and WIFIBUG-1201

See merge request espressif/esp-idf!39577
2025-07-31 10:32:30 +08:00
Mo Fei Fei
9fe514f597 Merge branch 'docs/fix_rmt_loop_transmit_desc' into 'master'
docs: fix rmt loop transmit description

Closes DOC-11696

See merge request espressif/esp-idf!40905
2025-07-31 09:55:18 +08:00
Erhan Kurubas
521f3e3911 Merge branch 'coredump_breaking_changes' into 'master'
change(coredump): drop binary format and crc checksum

Closes IDF-9020 and IDFGH-14364

See merge request espressif/esp-idf!40324
2025-07-30 20:34:27 +02:00
Mahavir Jain
4e036983a7 Merge branch 'feat/restructure_mbedtls_configurations' into 'master'
Restructure mbedTLS configurations

Closes IDF-12984 and IDF-12982

See merge request espressif/esp-idf!39941
2025-07-30 20:11:11 +05:30
Mahavir Jain
08d2d5fe76 Merge branch 'bugfix/brownout_log' into 'master'
fix: change brownout log from INFO to ERROR

See merge request espressif/esp-idf!40817
2025-07-30 19:17:31 +05:30
zwx
f7c209c70b fix(esp_phy): fix c6 modem state 2025-07-30 20:43:03 +08:00
Mahavir Jain
d72bb81702 Merge branch 'refactor/hide_ecdsa_kconfig_option_from_hal' into 'master'
refactor(hal): Move CONFIG options used in ecdsa_hal.c under config.h

Closes IDF-13584

See merge request espressif/esp-idf!40713
2025-07-30 17:36:57 +05:30
Song Ruo Jing
48233e0e7e refactor(ledc): remove deprecated LEDC_USE_RTC8M_CLK macro for v6.0 2025-07-30 20:01:47 +08:00
Song Ruo Jing
f61e780f60 refactor(clk): deprecate rtc_cal_sel_t enum 2025-07-30 20:01:46 +08:00
Song Ruo Jing
2b01b7c6f8 refactor(clk): add soc_clk_calibration_clk_src_t for all targets
Cleaned up RTC calibration clock selection code
2025-07-30 20:01:46 +08:00
Song Ruo Jing
07120c1d38 remove(clk): remove RTC_CLK_SRC_INT_RC32K option for C6 (v6.0) 2025-07-30 20:01:46 +08:00
Song Ruo Jing
248c87ac78 Merge branch 'bugfix/release_console_uart_pins' into 'master'
fix(console): release default console UART pins if console is switched in bootloader

Closes IDFGH-15851

See merge request espressif/esp-idf!40578
2025-07-30 19:27:47 +08:00
C.S.M
5611d88e6a Merge branch 'feat/usb_serial_jtag_h21' into 'master'
feat(usb_serial_jtag): Add usb serial jtag support for esp32h21

Closes IDF-11616

See merge request espressif/esp-idf!40873
2025-07-30 18:46:55 +08:00
Ashish Sharma
d9c431268a feat(mbedtls): restructure mbedtls configuration page 2025-07-30 17:47:54 +08:00
Ashish Sharma
f7be43c83d feat(mbedtls): adds more configuration options 2025-07-30 17:47:54 +08:00
Ashish Sharma
6259505f18 feat(mbedtls): disable unnecessary buffer allocation in dynamic buffer session reset 2025-07-30 17:45:16 +08:00
Shreyas Sheth
02be35610b fix(esp_wifi): Fix incorrect values for negotiated bandwidth for 2040 coex cases 2025-07-30 15:07:23 +05:30
C.S.M
47218f6291 fix(bootloader_flash): Make bootloader flash size accurate 2025-07-30 17:10:59 +08:00
Mahavir Jain
65cf3d0a20 Merge branch 'bugfix/fix_dangerous_realloc_patterns' into 'master'
fix(security): improve memory allocation handling in multiple components

Closes IDF-13612 and IDF-13622

See merge request espressif/esp-idf!40629
2025-07-30 14:40:43 +05:30
C.S.M
de58c6d0a3 Merge branch 'feat/support_gd55' into 'master'
feat(spi_flash): Add support for gd55f flash chip

See merge request espressif/esp-idf!40878
2025-07-30 17:05:48 +08:00
Armando (Dou Yiwen)
f2742dffdb Merge branch 'feat/c61_psram_timing_tuning' into 'master'
psram: psram timing tuning support on c61

Closes IDF-9256

See merge request espressif/esp-idf!40844
2025-07-30 08:53:47 +00:00
Wu Zheng Hui
e8ef305398 Merge branch 'feat/support_c5_c61_clkoutput' into 'master'
feat(esp_hw_support): support clock output feature on esp32c5/esp32c61

Closes IDF-10968 and IDF-10970

See merge request espressif/esp-idf!40801
2025-07-30 16:13:52 +08:00
mofeifei
c654f653fd docs: fix rmt loop transmit description 2025-07-30 15:24:02 +08:00
Chen Ji Chang
b0f22503b4 Merge branch 'feat/support_rmt_on_h21' into 'master'
feat(rmt): support rmt on esp32h21

Closes IDF-11622 and IDF-11623

See merge request espressif/esp-idf!40859
2025-07-30 12:24:47 +08:00
C.S.M
1c18d65416 feat(spi_flash): Add support for gd55f flash chip 2025-07-30 11:37:21 +08:00
Zhou Xiao
09f54c7f90 Merge branch 'change/ble_update_lib_20250728' into 'master'
change(ble): [AUTO_MR] 20250728 - Update ESP BLE Controller Lib

Closes BLERP-2091, BLERP-2072, BLERP-2105, BLERP-2054, BLERP-1858, BLERP-2094, BLERP-2093, BLERP-2123, BLERP-2111, and BLERP-2110

See merge request espressif/esp-idf!40846
2025-07-30 11:29:04 +08:00
C.S.M
ef299a8d4e feat(usb_serial_jtag): Add usb serial jtag support for esp32h21 2025-07-30 11:17:31 +08:00
renpeiying
d1df341c5d docs: Update CN translation 2025-07-29 22:31:40 +03:00
Erhan Kurubas
a877a070cb change(coredump): return ESP_ERR_NOT_FOUND for blank partition
Closes https://github.com/espressif/esp-idf/issues/15153
2025-07-29 22:31:40 +03:00
Erhan Kurubas
fb53d6e719 change(coredump): drop binary format and crc checksum 2025-07-29 22:31:40 +03:00
Song Ruo Jing
a4bd638385 refactor(uart): use U0RXD_GPIO_NUM and U0TXD_GPIO_NUM macros when possible 2025-07-29 21:59:49 +08:00
Song Ruo Jing
db1b7fc48c fix(ci): add ci test for gpio etm test cases 2025-07-29 21:59:20 +08:00
Song Ruo Jing
0787da6eea fix(console): release default console UART pins if console is switched in bootloader
Also print out console UART pin number in app cpu_startup stage

Closes https://github.com/espressif/esp-idf/issues/16764
2025-07-29 21:59:10 +08:00
chenjianhua
ea8bcdc360 feat(bt/blufi): Support Blufi start advertising with specified name 2025-07-29 21:04:39 +08:00
Jiang Jiang Jian
ee064300cd Merge branch 'bugfix/fix_esptouch_v2_fail_on_5g_router' into 'master'
fix(wifi/esptouch): fixed the esptouch v2 fail on 5g router

See merge request espressif/esp-idf!40744
2025-07-29 19:05:21 +08:00
Rahul Tank
72a678da84 Merge branch 'bugfix/minor_update_readme' into 'master'
fix(nimble): Documentation update in btsnoop script README

See merge request espressif/esp-idf!40857
2025-07-29 16:15:58 +05:30
wuzhenghui
5747c1784b change(esp_hw_support): always do hardware clock enable in modem module enabling 2025-07-29 17:02:12 +08:00
wuzhenghui
feffdee63b fix(esp_hw_support): fix MODEM_ADC_COMMON_FE destroyed by modem powerdown lightsleep 2025-07-29 17:02:11 +08:00
C.S.M
69224e4f43 Merge branch 'feat/usb_serial_jtag_h4' into 'master'
feat(usb_serial_jtag): Add usb serial jtag support for esp32h4

Closes IDF-12396

See merge request espressif/esp-idf!40736
2025-07-29 16:38:30 +08:00
C.S.M
0313af10a5 Merge branch 'refactor/flash_hal_no_config' into 'master'
refactor(spi_flash): Remove sdkconfig dependency in flash hal layer

Closes IDF-13625

See merge request espressif/esp-idf!40858
2025-07-29 16:34:46 +08:00
Island
a3146c7b5c Merge branch 'opt/opt_ble_hid_example_pair_fail' into 'master'
fix(ble/bluedroid): set sec_conn only on successful pairing in ble_hid_device_demo

Closes BLERP-2115

See merge request espressif/esp-idf!40733
2025-07-29 16:16:37 +08:00
Armando (Dou Yiwen)
008b232947 Merge branch 'feat/p4_eco5_soc_part3' into 'master'
p4: eco5 soc registers (part3)

See merge request espressif/esp-idf!40776
2025-07-29 06:45:24 +00:00
Gao Xu
37ba98d29f Merge branch 'fix/fix_dvp_loss_isr' into 'master'
Cam: fixed dvp lose frame issue

See merge request espressif/esp-idf!40679
2025-07-29 14:45:22 +08:00
Island
f5e3dc4bb2 Merge branch 'fix/ble_mesh_micellaneous_fix' into 'master'
Fix/ble mesh micellaneous fix

Closes BLERP-2023 and BLERP-2024

See merge request espressif/esp-idf!40078
2025-07-29 14:29:53 +08:00
armando
0189be39a0 feat(psram): psram 80M timing tuning on c61 2025-07-29 14:12:07 +08:00
Armando (Dou Yiwen)
b32c31e500 Merge branch 'feat/c5_flash_timing_tuning' into 'master'
flash: flash timing tuning support on c5

Closes IDF-8649

See merge request espressif/esp-idf!40763
2025-07-29 06:09:22 +00:00
Rahul Tank
aa1c21fa44 Merge branch 'bugfix/fix_compilation_issue' into 'master'
fix(nimble): Fixed compilation issue with BLE_GATTS flag

See merge request espressif/esp-idf!40725
2025-07-29 11:26:15 +05:30
Chen Jichang
bbb78fedbb feat(rmt): support rmt on esp32h21 2025-07-29 10:46:20 +08:00
zhangyanjiao
7c8e8bd72a fix(wifi/esptouch): fixed the esptouch v2 fail on 5g router 2025-07-29 10:27:03 +08:00
gaoxu
9a57629e73 refactor(rng): refactor to use hal/ll apis for S3 2025-07-29 09:52:54 +08:00
armando
65db12cfa6 feat(flash): flash 80M timing tuning on c5 2025-07-29 00:48:58 +00:00
armando
23007ee307 feat(soc): p4 hw ver2 registers 2025-07-29 00:48:46 +00:00
Song Ruo Jing
2fbd8779d6 Merge branch 'feature/esp32h4_rtcio_support' into 'master'
feat(lp_io): Add LP_IO support for ESP32H4

Closes IDF-12393

See merge request espressif/esp-idf!40599
2025-07-28 19:58:05 +08:00
Rahul Tank
1aa93c5522 fix(nimble): Minor documentation update in btsnoop script usage 2025-07-28 16:12:44 +05:30
C.S.M
6ad49c1146 refactor(spi_flash): Remove sdkconfig dependency in flash hal layer 2025-07-28 18:16:19 +08:00
Roland Dobai
757d3432da Merge branch 'change/rename-kconfiglib-module' into 'master'
change: use esp_kconfiglib and esp_menuconfig in ESP-IDF

See merge request espressif/esp-idf!40147
2025-07-28 12:07:25 +02:00
Armando (Dou Yiwen)
9e2d857c9a Merge branch 'feat/h4_psram' into 'master'
psram: h4 support

Closes IDF-12351 and IDF-12350

See merge request espressif/esp-idf!40484
2025-07-28 09:39:41 +00:00
zhanghaipeng
50fe55ca59 fix(ble/bluedroid): set sec_conn only on successful pairing in ble_hid_device_demo 2025-07-28 15:49:59 +08:00
Fu Hanxi
93655332e8 Merge branch 'ci/fix-non-test-related-apps-only' into 'master'
CI: fix non test related apps only

See merge request espressif/esp-idf!40804
2025-07-28 09:47:59 +02:00
C.S.M
df8a9d26c2 feat(usb_serial_jtag): Add usb serial jtag support for esp32h4 2025-07-28 15:12:38 +08:00
Zhou Xiao
f99389e00d feat(ble): ble log spi out dev phase 5
* supported ts sync for light sleep
* removed controller event queue dependency
* supported get lc ts for ESP32-C3/S3
* optimized ble log spi out code size
2025-07-28 14:11:26 +08:00
zwl
312de57214 feat(ble): add flash only param config api on ESP32-C5 2025-07-28 14:11:22 +08:00
zwl
4c8258ca38 feat(ble): add flash only param config api on ESP32-H2 2025-07-28 14:11:16 +08:00
zwl
dc65875e57 feat(ble): add flash only param config api on ESP32-C6 2025-07-28 14:11:10 +08:00
Zhou Xiao
ac6acf3629 change(ble): [AUTO_MR] updated rom linker script for ESP32-C2 2025-07-28 14:09:21 +08:00
Zhou Xiao
0a7660d0f3 change(ble): [AUTO_MR] Update lib_esp32c2 to 4556045f 2025-07-28 14:09:18 +08:00
Zhou Xiao
f2741f1932 change(ble): [AUTO_MR] Update lib_esp32c6 to 499c41fb 2025-07-28 14:09:18 +08:00
Zhou Xiao
7b921c71b3 change(ble): [AUTO_MR] Update lib_esp32c5 to 499c41fb 2025-07-28 14:09:17 +08:00
Zhou Xiao
ee48ef2167 change(ble): [AUTO_MR] Update lib_esp32h2 to 499c41fb 2025-07-28 14:09:17 +08:00
Rahul Tank
b9659277c9 fix(nimble): Added code under correct flags to fix compilation warnings 2025-07-28 10:20:02 +05:30
Song Ruo Jing
6b0eb7fcb3 fix(lp_io): w1ts/w1tc register access performance is improved
by avoiding "read-modify-write" operation. The registers designed to be
write only.
2025-07-28 11:17:32 +08:00
Song Ruo Jing
63050580f5 feat(lp_io): Add LP_IO support for ESP32H4 2025-07-28 11:17:32 +08:00
armando
9be8dccef5 feat(psram): psram support on h4 2025-07-28 10:16:48 +08:00
Ashish Sharma
6b02906822 fix(security): improve memory allocation handling in multiple components 2025-07-28 10:05:50 +08:00
gaoxu
5c96c978c9 fix(dvp): fix dvp loss frame error 2025-07-26 17:43:46 +08:00
Mahavir Jain
8886097fe4 Merge branch 'patch/ets_delay_us' into 'master'
fix(esp_tee): Patch the `esp_rom_delay_us` API to use U-mode cycle CSR

See merge request espressif/esp-idf!40105
2025-07-25 19:02:59 +05:30
morris
f071b5462e Merge branch 'bugfix/remove_lcd_signals_on_delete' into 'master'
fix(lcd): reserve the GPIOs used by RGB LCD and disconnect the LCD signals when the dirver is uninstalled.

Closes AUD-6545

See merge request espressif/esp-idf!40734
2025-07-25 21:07:54 +08:00
Island
a8d3b4808b Merge branch 'bugfix/fix_find_the_oldest_device' into 'master'
Bugfix/fix find the oldest device

Closes BCI-542

See merge request espressif/esp-idf!40464
2025-07-25 19:50:33 +08:00
Chen Ji Chang
cfca52255e Merge branch 'feat/support_rmt_on_h4' into 'master'
feat(rmt): support rmt on ESP32-H4

Closes IDF-12402

See merge request espressif/esp-idf!40523
2025-07-25 19:41:24 +08:00
Rahul Tank
d1ea45202e Merge branch 'fix/clear_gatt_svc_len' into 'master'
fix(nimble): Clear GATT service entries counter upon GATT deinit

Closes BLERP-2063

See merge request espressif/esp-idf!40351
2025-07-25 16:32:34 +05:30
Jakub Kocka
ba08899b90 Merge branch 'delete/virtualenv' into 'master'
remove(tools): Dropping of virtualenv support

Closes IDF-10945

See merge request espressif/esp-idf!40650
2025-07-25 17:53:02 +08:00
Jiang Jiang Jian
f356e36f5e Merge branch 'bugfix/offchan_fixes' into 'master'
fix(wifi): Fix issues discovered by customer for offchannel

See merge request espressif/esp-idf!40613
2025-07-25 17:36:30 +08:00
Shu Chen
aca957cfaf Merge branch 'fix_ot_src_addr_select' into 'master'
Fix ot src addr select

See merge request espressif/esp-idf!40768
2025-07-25 09:15:59 +00:00
Wei Yu Han
5181747949 Merge branch 'docs/added_release_5.5_readme' into 'master'
Updated ESP-IDF SoC Compatibility for v5.5

See merge request espressif/esp-idf!40680
2025-07-25 16:36:37 +08:00
Mahavir Jain
3886400466 fix: change brownout log from INFO to ERROR 2025-07-25 12:43:41 +05:30
zwx
bf12839e08 fix(openthread): use OpenThread API in lwIP source address selection hook 2025-07-25 06:53:53 +00:00
zwx
77660c2dde fix(openthread): fix the preference of the ip6 address set to lwip 2025-07-25 06:53:53 +00:00
Jakub Kocka
fb4612778d remove(tools): Dropping of virtualenv support 2025-07-25 14:42:52 +08:00
Shreyas Sheth
6a1f6e2add fix(wifi): Fix issues discovered by customer for offchannel 2025-07-25 14:18:44 +08:00
wuzhenghui
bf3c79068d feat(esp_hw_support): support clock output feature on esp32c5/esp32c61 2025-07-25 14:18:04 +08:00
Mahavir Jain
004da6773c Merge branch 'ci/tee_intr_test_app' into 'master'
ci(hal): Extend the PMS hal test-app for verifying TEE-based interrupt scenarios

Closes IDF-12642, IDF-12645, IDF-12873, and IDF-12876

See merge request espressif/esp-idf!40322
2025-07-25 11:08:53 +05:30
chenjianxing
6d996a0634 fix(wifi): fix wifi rom code using ets_delay_us for C5 and C61 2025-07-25 09:55:10 +05:30
Laukik Hase
f2b0f256ab fix(esp_rom): Patch the esp_rom_delay_us API to use U-mode cycle CSR 2025-07-25 09:54:42 +05:30
Wei Yuhan
2ed4f6ddb7 Added v6.0 chip support status in README 2025-07-25 11:10:15 +08:00
Wei Yuhan
d7ada4d40f Removed v5.0 from SoC Compatibility in README 2025-07-25 10:53:23 +08:00
Wei Yuhan
9664d069df Updated ESP-IDF SoC Compatibility for v5.5 2025-07-25 10:53:23 +08:00
zhanghaipeng
b6dc79af47 fix(ble/bluedroid): Fixed fail to disconnect when device record is cleared 2025-07-25 10:30:11 +08:00
zhanghaipeng
ac385530af fix(ble/bluedroid): fix incorrect resolving_list_avail_size update 2025-07-25 10:27:53 +08:00
Fu Hanxi
860dd1128e ci: load non-test-related apps list 2025-07-24 22:58:00 +02:00
Jiang Jiang Jian
4235058d9a Merge branch 'bugfix/fix_crash_when_twt_setup' into 'master'
fix(wifi): fix crash issue and tx error 0xa1

See merge request espressif/esp-idf!40783
2025-07-24 23:42:25 +08:00
Mahavir Jain
d8a3ef511c Merge branch 'fix/gcm_fallback_must_depend_on_software_gcm_symbol' into 'master'
fix(mbedtls/gcm): Allow enabling GCM fallback only if software GCM is available

See merge request espressif/esp-idf!40780
2025-07-24 19:12:44 +05:30
zhanghaipeng
61606a6f95 fix(ble/bluedroid): ensure resolving list is updated when the oldest device is removed 2025-07-24 21:29:27 +08:00
yinqingzhao
8603c91f47 fix(wifi): fix crash issue and tx error 0xa1 2025-07-24 20:16:44 +08:00
Harshal Patil
7043cbf615 Merge branch 'docs/update_bootloader_max_size' into 'master'
docs(bootloader): Update the maximum supported bootloader size

See merge request espressif/esp-idf!40787
2025-07-24 17:34:06 +05:30
harshal.patil
35944b8a4d docs(bootloader): Change the default value of maximum supported bootloader size 2025-07-24 15:56:41 +05:30
Harshal Patil
8ab9e36eec Merge branch 'docs/update_bootloader_max_size' into 'master'
Update the maximum supported bootloader size

See merge request espressif/esp-idf!40506
2025-07-24 15:42:40 +05:30
Island
d26f280415 Merge branch 'bugfix/fix_some_ble_bugs_250628_cjh_esp32' into 'master'
Fixed some BLE bugs 250628 on esp32(d9a3de0)

Closes BLERP-1697, BLERP-1965, BLERP-2075, BLERP-2077, and BLERP-1991

See merge request espressif/esp-idf!40421
2025-07-24 18:06:09 +08:00
harshal.patil
c8e4b69e7f fix(mbedtls/gcm): Allow enabling GCM fallback only if software GCM is available 2025-07-24 12:42:57 +05:30
Song Ruo Jing
3fdb473174 Merge branch 'bugfix/ledc_update_duty_wait' into 'master'
fix(ledc): duty_start update bit should wait for its self-clear before next set

Closes IDF-11989

See merge request espressif/esp-idf!39949
2025-07-24 14:55:16 +08:00
Mahavir Jain
22adc7ed75 Merge branch 'feat/secure_boot_ecdsa_p384' into 'master'
Support Secure Boot using ECDSA-P384 curve

Closes IDF-10016, IDF-10221, and IDF-12990

See merge request espressif/esp-idf!38517
2025-07-24 11:59:59 +05:30
morris
1f82b347a6 Merge branch 'feat/upgrade_restful_server_example' into 'master'
Upgrade restful server example (Vue2->Vue3) (The webpage is mostly done by AI with tons of prompts)

See merge request espressif/esp-idf!40669
2025-07-24 13:36:22 +08:00
Jiang Jiang Jian
f50f6913fa Merge branch 'bugfix/ftm_failure_40m' into 'master'
bugfix(wifi): Resolved FTM failure in 40M bandwidth

Closes WIFIBUG-1291

See merge request espressif/esp-idf!40345
2025-07-24 13:26:46 +08:00
Rahul Tank
d67bc8a5ad Merge branch 'bugfix/retry_packet_alloc' into 'master'
fix(nimble): Add packet allocation retry for limited iteration

Closes BT-4049

See merge request espressif/esp-idf!40677
2025-07-24 10:12:47 +05:30
Aditya Patwardhan
9cd759c3bc Merge branch 'feature/support_rng_sampling' into 'master'
Feature/support rng sampling

See merge request espressif/esp-idf!40433
2025-07-24 09:42:39 +05:30
Chen Jichang
d6a9a0f5d5 feat(rmt): support rmt on esp32-h4 2025-07-24 10:47:13 +08:00
akshat
9a77d59b8b fix(wifi): Add suport for FTM in ESP32C61
Resolve FTM failure in 40M Bandwidth
2025-07-23 17:39:35 +05:30
He Binglin
1408adcb47 Merge branch 'bugfix/esp_idf_c5_idfci-3010' into 'master'
feat(esp_hw_support): support xtal as RTC FAST CLK during sleep for esp32c5

Closes IDFCI-3010

See merge request espressif/esp-idf!40702
2025-07-23 19:38:30 +08:00
Rahul Tank
346870a304 Merge branch 'bugfix/add_old_btsnoop_hci_py' into 'master'
fix(nimble): Updated parser script for HCI log creation

See merge request espressif/esp-idf!40726
2025-07-23 16:21:20 +05:30
C.S.M
bc58afc758 Merge branch 'test/add_c61_usj_test' into 'master'
test(usj): Add test for usb_seiral_jtag on c61

See merge request espressif/esp-idf!40753
2025-07-23 18:49:20 +08:00
Jiang Jiang Jian
40eefe1d69 Merge branch 'bugfix/fix_inactive_time_reset_when_disconnect' into 'master'
fix(wifi): fix inactive time reset when wifi disconnect

See merge request espressif/esp-idf!40419
2025-07-23 18:43:15 +08:00
morris
e0ddcb8013 fix(lcd): reserve the GPIOs used by RGB LCD
and disconnect the LCD signals when the dirver is uninstalled.
2025-07-23 18:15:54 +08:00
Armando (Dou Yiwen)
b22fcf6dbd Merge branch 'feat/p4_eco5_soc_part2' into 'master'
p4: eco5 soc registers (part2)

See merge request espressif/esp-idf!40694
2025-07-23 10:08:11 +00:00
Aditya Patwardhan
96170ea10b refactor(hal): Move CONFIG options used in ecdsa_hal.c under config.h 2025-07-23 15:34:05 +05:30
Jiang Jiang Jian
33493d43e0 Merge branch 'bugfix/fix_phy_test_crash' into 'master'
fix(PHY): Fixed phy test example crash

Closes IDFGH-15957 and BLERP-2107

See merge request espressif/esp-idf!40707
2025-07-23 17:47:34 +08:00
Aditya Patwardhan
03ffe90f95 feat(soc): Added soc capabilities related to RNG for ESP32C5 2025-07-23 14:22:09 +05:30
C.S.M
6f7ca07018 Merge branch 'fix/fix_gpspi_flash_frequency' into 'master'
refactor(spi_flash): Refactor gpspi flash for making it's clock accurate

Closes IDF-13566

See merge request espressif/esp-idf!40651
2025-07-23 16:46:30 +08:00
Mahavir Jain
a2935a5750 Merge branch 'fix/mqtt_ssl_ds_build_failure' into 'master'
fix(mqtt): Increased partition size to fix build failure

See merge request espressif/esp-idf!40759
2025-07-23 14:11:45 +05:30
Wan Lei
62136054cd Merge branch 'ci/c61_enable_multi_dev_runner' into 'master'
ci(esp32c61): enable multi dut runner for c61 eco3

Closes IDF-10949 and IDFCI-3037

See merge request espressif/esp-idf!40724
2025-07-23 14:57:39 +08:00
Aditya Patwardhan
5cc1e8c0d5 fix(mqtt): Increased partition size to fix build failure 2025-07-23 11:33:15 +05:30
harshal.patil
f4b329386f docs(bootloader): Update the maximum supported bootloader size 2025-07-23 11:17:54 +05:30
Laukik Hase
3d402ca938 ci(hal): Extend the PMS hal test-app for verifying TEE-based interrupt scenarios 2025-07-23 10:00:24 +05:30
C.S.M
22cd0d615f test(usj): Add test for usb_seiral_jtag on c61 2025-07-23 12:07:13 +08:00
Chen Jichang
d29e7b3bb6 fix(rmt): add pll and rcfast clock src on c5 2025-07-23 11:36:37 +08:00
C.S.M
90d3d658bb Merge branch 'refactor/remove_flash_ut' into 'master'
refactor(spi_flash): Remove the useless flash/psram unit test

See merge request espressif/esp-idf!40739
2025-07-23 11:03:25 +08:00
Kevin (Lao Kaiyao)
1a242d132c Merge branch 'feature/support_i2s_and_etm_on_h4' into 'master'
feat(i2s & etm): support i2s and etm on esp32-h4

Closes IDF-12385, IDF-12355, and IDF-13396

See merge request espressif/esp-idf!39698
2025-07-22 20:27:11 +08:00
Zhang Shuxian
b615ab5a40 docs: Update CN translation for secure boot 2025-07-22 19:14:46 +08:00
yinqingzhao
8b67238e85 fix(wifi): fix inactive time reset when wifi disconnect 2025-07-22 17:50:36 +08:00
Jiang Jiang Jian
b37a159603 Merge branch 'feature/hosted_examples' into 'master'
feat(hosted_examples): Added ESP-Hosted to Wi-Fi examples

See merge request espressif/esp-idf!37624
2025-07-22 17:48:26 +08:00
wanckl
cb257ede27 ci(esp32c61): enable multi dut runner for c61 2025-07-22 17:10:55 +08:00
chenjianhua
f20c6a2813 fix(bt): Update bt lib for ESP32(d9a3de0)
- Support BLE vendor HCI related params reset
- Support multi conn optimization vendor hci command
- Fixed the issue where rssi of conn is incorrect when latency is no zero
- Fixed prio setting for BLE events
- Fixed disconnection issue when coexisting with other BLE events
- Fixed crash due to bandwidth full when updating conn params
2025-07-22 16:14:27 +08:00
luoxu
21b934aeb2 feat(ble_mesh): fixed issues with adv evts process 2025-07-22 15:21:58 +08:00
luoxu
4905b6eae1 feat(ble_mesh): add adv lock to avoid allocated buffers 2025-07-22 15:21:58 +08:00
luoxu
334e2bf8ab feat(ble_mesh): Add lock to avoid tx being modified at the same time 2025-07-22 15:21:58 +08:00
Song Ruo Jing
63e2d6828b refactor(ledc): deprecate ledc_isr_register and ledc_channel_config_t::intr_type 2025-07-22 15:10:52 +08:00
Song Ruo Jing
dca8f204eb refactor(ledc): remove deprecated API/macro for v6.0 2025-07-22 15:05:10 +08:00
Song Ruo Jing
d87de032df fix(ledc): duty_start bit should wait for its self-clear before next set on esp32 2025-07-22 15:05:10 +08:00
Soh Kam Yung
2bec3bc441 feat(hosted_examples): Added ESP-Hosted to Wi-Fi examples
- add ESP32-P4 and ESP32-H2 as Supported Targets to following
  examples, using ESP-Hosted and Wi-Fi Remote as components:
  - iperf (H2)
  - getting_started/softAP
  - getting_started/station
  - scan
  - fast_scan
  - softap_sta
- updated `.build-test-rules.yml` to enable pre-commit to accept ESP-P4
  and ESP-H2 as Supported Targets
- updated iperf sdkconfig.defaults for P4 to use parameters from wifi-remote
2025-07-22 14:28:57 +08:00
Wu Zheng Hui
92b84443f3 Merge branch 'feat/support_modify_regdma_link_skip_flag_dynamically' into 'master'
feat(esp_hw_support): add API to supoport modify retention skip flag dynamically

See merge request espressif/esp-idf!40596
2025-07-22 14:19:29 +08:00
Rahul Tank
d2799fa657 fix(nimble): Add packet allocation retry for limited iteration 2025-07-22 11:47:41 +05:30
Kevin (Lao Kaiyao)
3750278c84 Merge branch 'feature/parlio_rx_support_queue_in_callback' into 'master'
feat(parlio_rx): supported to append receive queue in the ISR context.

Closes IDF-8567

See merge request espressif/esp-idf!40311
2025-07-22 14:16:30 +08:00
C.S.M
7e6b11618f Merge branch 'feature/i3c_i2c_support' into 'master'
feat(i3c_master): support i2c mode in i3c driver. 🏋🏻‍♀️

See merge request espressif/esp-idf!36638
2025-07-22 13:29:55 +08:00
C.S.M
6b19cd3932 refactor(spi_flash): Remove the useless flash/psram unit test 2025-07-22 12:02:41 +08:00
C.S.M
332614165b refactor(spi_flash): Refactor gpspi flash for making it's clock accurate 2025-07-22 11:59:45 +08:00
C.S.M
f1ebe5d1ce Merge branch 'feat/support_flash_h21' into 'master'
feat(spi_flash): Add basic flash support for esp32h21, esp32h4

Closes IDF-12388 and IDF-11609

See merge request espressif/esp-idf!40643
2025-07-22 11:38:18 +08:00
Wu Zheng Hui
6f8dbe8a89 Merge branch 'fix/fix_submode_assert_in_slowck_changed_ota' into 'master'
fix(esp_hw_support): fix assert when changing 8MD256 RTC slow clock source during OTA

Closes PM-478

See merge request espressif/esp-idf!40292
2025-07-22 11:33:32 +08:00
laokaiyao
263a056486 feat: add i2s & etm sleep retention entry on H4 2025-07-22 10:05:12 +08:00
armando
ee68450342 feat(soc): p4 hw ver2 registers 2025-07-22 01:50:34 +00:00
Roland Dobai
b1d190826c Merge branch 'feat/extend_shell_classes_uppercase' into 'master'
feat(tools): Normalize detected shell name to lowercase on Windows

Closes IDFGH-15932

See merge request espressif/esp-idf!40598
2025-07-21 17:47:50 +02:00
Jan Beran
806775f54e change: use esp_kconfiglib instead of kconfiglib in Python imports 2025-07-21 16:36:55 +02:00
laokaiyao
eee0f0266c docs(parlio_rx): add parlio rx programming guide 2025-07-21 22:26:01 +08:00
Jiang Jiang Jian
8448452e03 Merge branch 'bugfix/add_lib_target_git_reversion_message' into 'master'
fix(wifi):fix open mode rx fragment fail issue

Closes WIFIBUG-1272 and WIFIBUG-1315

See merge request espressif/esp-idf!39426
2025-07-21 22:04:03 +08:00
muhaidong
a6a9c41573 fix(wifi): fix open mode rx fragment fail issue 2025-07-21 20:17:38 +08:00
C.S.M
b765ad43cf feat(spi_flash): Add flash suspend support on esp32h21, esp32h4 2025-07-21 19:24:00 +08:00
C.S.M
50aee21d33 feat(spi_flash): Add basic support for esp32h4 2025-07-21 19:24:00 +08:00
C.S.M
bc9fa040da feat(spi_flash): support spi_flash on esp32h21 2025-07-21 19:24:00 +08:00
C.S.M
9b17b8470e feat(i3c): Add example for i2c mode in i3c peripheral 2025-07-21 19:23:29 +08:00
C.S.M
1d07729b91 test(i3c): Add simple test for i2c mode in i3c peripheral 2025-07-21 19:23:29 +08:00
C.S.M
9bec7c3651 feat(i3c): Add support for i2c mode in i3c peripheral 2025-07-21 19:23:29 +08:00
Ivan Grokhotkov
83ac9be085 Merge branch 'fix/bootloader_secure_boot_target_not_created' into 'master'
fix(bootloader): Fixed bootloader secure boot target creation failure

See merge request espressif/esp-idf!40732
2025-07-21 13:22:12 +02:00
Marek Fiala
a6a4f8a705 feat(tools): Normalized detected shell names to lowercase on Windows
Closes https://github.com/espressif/esp-idf/issues/16868
2025-07-21 11:16:10 +02:00
Marek Fiala
b7efec31d2 change(tools): shell_types.py ruff formatting 2025-07-21 11:16:10 +02:00
Roman Leonov
75809d4397 Merge branch 'refactor/usb_host_hid_example_open_proto_only' into 'master'
refactor(usb_host_example): Added opening only for HID device with proto

See merge request espressif/esp-idf!40228
2025-07-21 16:01:23 +08:00
Sudeep Mohanty
5d9ee7cc1a fix(bootloader): Fixed bootloader secure boot target creation failure
This commit fixes an issue where the bootloader POST_BUILD target
depended on the signed bootloader image even if it is not created.
2025-07-21 09:40:41 +02:00
Rahul Tank
54e65df985 fix(nimble): Add support to parser script to parse logs with/without ts
Introduced a new "--has-ts" input parameter to script to detect if logs
has timestamp information or not
2025-07-21 12:10:21 +05:30
Marius Vikhammer
bf84ab652a change(test_utils): moved test_utils component to tools/test_apps/components/ 2025-07-21 14:05:50 +08:00
morris
70d62b1a54 feat(restful_server): upgrade the example to use vue3+vuetify3
also cleaned up the backend firmware to use littlefs filesystem.
2025-07-21 12:03:10 +08:00
Sudeep Mohanty
52e2f17378 Merge branch 'fix/bootloader_add_custom_command_incorrect' into 'master'
fix(bootloader): Correct add_custom_command 'DEPENDS' usage

See merge request espressif/esp-idf!40510
2025-07-21 06:01:08 +02:00
Ivan Grokhotkov
a5d53fc6a6 Merge branch 'doc/remove_cpp_section_placement_limitation' into 'master'
docs(cplusplus): remove the limitation on IRAM_ATTR for templates

See merge request espressif/esp-idf!40688
2025-07-21 05:58:07 +02:00
harshal.patil
4fc9fd4891 fix(esp_system): Remove redundant crypto clock source selection 2025-07-21 09:19:42 +05:30
harshal.patil
94019776bd ci(security): Security test app updated yml
- Also fixes the errors generated by the check-test-scripts command
2025-07-21 09:19:42 +05:30
harshal.patil
dbcaddb745 docs(secure-boot-v2): Update the signature verification timings
- THe timings are calculated for the ROM verifying the bootloader's signature
2025-07-21 09:19:42 +05:30
harshal.patil
37e5c0701a docs(secure_boot_v2): Add documentation for Secure Boot V2 using ECDSA-P384 2025-07-21 09:19:42 +05:30
harshal.patil
0f51640674 test(secure_boot): Add tests for ECDSA-based secure boot scheme 2025-07-21 09:19:42 +05:30
harshal.patil
5699619606 test(examples/efuse): Add test for secure boot v2 using ecdsa-p384 2025-07-21 09:19:42 +05:30
harshal.patil
130e72f82b feat(bootloader_support): Support Secure Boot using ECDSA-P384 curve 2025-07-21 09:19:42 +05:30
harshal.patil
03ea07155a change(bootloader_support/secure_boot): Allow NULL as verified_digest for app build
The esp_secure_boot_verify_sbv2_signature_block() and esp_secure_boot_verify_rsa_signature_block()
APIs need and use the verified_digest argument only for BOOTLOADER_BUILD, but the argument is
not used in the application code, and the value present in verified_digest is considered invalid.
Thus, allow passing NULL as the verified_digest parameter to help some save space.
2025-07-21 09:19:42 +05:30
harshal.patil
3f9ab5d5e7 fix(bootloader_support/secure_boot): Fix incorrect usage of ESP_SECURE_BOOT_KEY_DIGEST_LEN 2025-07-21 09:19:42 +05:30
Wang Meng Yang
61ccbbe7f0 Merge branch 'bugfix/fix_external_codec_build_issue' into 'master'
fix(bt/bluedroid): Fix build issue when using external sbc codec

Closes BT-4051

See merge request espressif/esp-idf!40554
2025-07-21 10:44:02 +08:00
zhiweijian
e2e5d4915b fix(rf/example): Fixed phy test example crash 2025-07-21 10:21:55 +08:00
Kevin (Lao Kaiyao)
1c74e1a8a2 Merge branch 'docs/check_ana_cmpr_and_touch_for_c61' into 'master'
docs: remove touch_pad.rst from C61 not_updated list

Closes IDF-10146, IDF-10136, IDF-10128, IDF-10122, IDF-10139, and IDF-10131

See merge request espressif/esp-idf!40681
2025-07-20 14:36:48 +08:00
Jiang Jiang Jian
7add0c1547 Merge branch 'fix/disconnect_sta_in_wps_start' into 'master'
fix(wifi): Disconnect station from previous AP in wps_start instead of wps_enable

Closes WIFIBUG-1263

See merge request espressif/esp-idf!40306
2025-07-19 09:05:47 +08:00
Sarvesh Bodakhe
762a5c68e0 fix(wifi): Disconnect station in wps_start instead of wps_enable
Modifies changes from 3ee449bc5d
2025-07-18 23:50:09 +08:00
Jiang Jiang Jian
0d6f8e3930 Merge branch 'fix/fix_esp32c2_eco4_ld_issue' into 'master'
fix(wifi): fix esp32c2 eco4 ld issue

See merge request espressif/esp-idf!40224
2025-07-18 22:10:08 +08:00
wangtao@espressif.com
d32b2f6ca6 fix(wifi): fix esp32c2 eco4 ld issue 2025-07-18 17:54:44 +08:00
hebinglin
7981d1743f feat(esp_hw_support): support xtal as RTC FAST CLK during sleep 2025-07-18 17:47:47 +08:00
laokaiyao
8fa39ee0fe docs: remove touch_pad.rst from C61 not_updated list 2025-07-18 17:25:39 +08:00
Gao Xu
c03ab39028 Merge branch 'feat/support_sdio_on_c61' into 'master'
feat(sdio): supported slave sdio on esp32c61

Closes IDF-12883, IDF-12594, and IDF-10151

See merge request espressif/esp-idf!40485
2025-07-18 16:37:48 +08:00
Armando (Dou Yiwen)
7611a37de3 Merge branch 'feat/h4_cache_msync' into 'master'
cache: h4 cache msync support

Closes IDF-12289

See merge request espressif/esp-idf!40491
2025-07-18 08:06:02 +00:00
laokaiyao
424991faaf feat(i2s): support new sync feature on H4 2025-07-18 15:51:37 +08:00
laokaiyao
0a110478ea feat(modem_etm): support modem etm on h4 2025-07-18 15:51:34 +08:00
laokaiyao
026370e5b3 feat(etm): support etm on esp32-h4 2025-07-18 15:51:00 +08:00
laokaiyao
3992f734bf feat(i2s): support i2s on esp32-h4 2025-07-18 15:48:02 +08:00
wuzhenghui
d7e1a747a6 fix(esp_hw_support): enable ESP_SLEEP_RTC_FAST_USE_XTAL_MODE only once in RTC_FAST selection 2025-07-18 15:29:07 +08:00
wuzhenghui
80cde5f3e6 fix(esp_hw_support): fix assert when changing 8MD256 RTC slow clock source during OTA 2025-07-18 15:25:34 +08:00
Gao Xu
fae24cfcda Merge branch 'feat/c61_adc_calibration' into 'master'
ESP32C61 ADC calibration and add runner

Closes IDF-9303

See merge request espressif/esp-idf!40500
2025-07-18 15:18:33 +08:00
Guillaume Souchere
361c1b1fd6 Merge branch 'fix/linenoise-arrow-usage' into 'master'
fix(linenoise): Read escape sequences one character at a time

Closes IDFGH-15849

See merge request espressif/esp-idf!40601
2025-07-18 08:57:15 +02:00
Jiang Jiang Jian
3c3ee159c5 Merge branch 'bugfix/fix_mesh_sta_send_data_error_on_c61' into 'master'
fix(wifi/mesh): fixed the mesh STA sends data error on c61

Closes WIFIBUG-1330

See merge request espressif/esp-idf!40630
2025-07-18 14:48:06 +08:00
morris
c8fcebd9bd Merge branch 'fix/spi_slave_dma_stop_unexpectly_when_start' into 'master'
fix(driver_spi): fixed esp32c5 spi slave dma potential rx error

Closes IDFCI-2919, IDFCI-2915, and IDFCI-2918

See merge request espressif/esp-idf!40446
2025-07-18 14:46:13 +08:00
laokaiyao
f0c45b7115 feat(parlio_rx): support to receive in isr context 2025-07-18 14:23:52 +08:00
Ivan Grokhotkov
5b71cc29bd docs(cplusplus): remove the limitation on IRAM_ATTR for templates
The issue has been fixed since GCC 14.

Related to https://github.com/espressif/esp-idf/issues/4542
2025-07-18 14:16:25 +08:00
C.S.M
5812b19e91 Merge branch 'refactor/gpio_valid_2_soc' into 'master'
refactor(gpio): Move valid gpio_caps macro from driver layer to soc layer

Closes IDF-13564

See merge request espressif/esp-idf!40521
2025-07-18 13:18:46 +08:00
Armando (Dou Yiwen)
bfcba51ca1 Merge branch 'feat/p4_eco5_soc_part1' into 'master'
p4: soc support (part 1, move hw ver1 registers to `hw_ver1` dir)

See merge request espressif/esp-idf!40518
2025-07-18 01:51:31 +00:00
Zhang Shu Xian
5636a2fad2 Merge branch 'docs/remove_incorrect_info_for_esp32p4_sdmmc' into 'master'
docs: Remove incorrect description for ESP32-P4 SDMMC

Closes DOC-11817

See merge request espressif/esp-idf!40631
2025-07-18 09:35:09 +08:00
gaoxu
a4bbc07ad8 docs(sdio): update c61 sdio support docs 2025-07-18 09:29:37 +08:00
gaoxu
d3e2177342 ci(sdio): enable 32_c61 sdio test and runner 2025-07-18 09:29:37 +08:00
gaoxu
01080bb062 fix(sdio): supported slave sdio on esp32c61 2025-07-18 09:29:37 +08:00
wanckl
0992a1db62 fix(driver_spi): fixed esp32c5 spi slave dma potential rx error 2025-07-18 09:29:27 +08:00
gaoxu
33560f506e ci(adc): enable esp32c61 adc test 2025-07-18 09:29:23 +08:00
gaoxu
1e76669a8b feat(adc): support ADC calibration on ESP32C61 2025-07-18 09:29:23 +08:00
Marius Vikhammer
2e619615de Merge branch 'bugfix/c61_systimer_etm' into 'master'
fix(systimer): fixed ETM not working with systimer on C61 ECO3

Closes IDFCI-3000, IDFCI-3002, and IDFCI-3003

See merge request espressif/esp-idf!40526
2025-07-18 09:17:13 +08:00
armando
b25bde3378 change(cache): use bus id to get cache vaddr bus 2025-07-18 01:15:06 +00:00
armando
84ae601fef feat(cache): msync driver support on h4 2025-07-18 01:15:06 +00:00
Erhan Kurubas
fb3e616750 Merge branch 'apptrace_breaking_changes' into 'master'
Apptrace breaking changes

Closes IDF-9993 and IDF-4316

See merge request espressif/esp-idf!40380
2025-07-17 17:45:31 +02:00
Sudeep Mohanty
c8f68c72a7 Merge branch 'feat/remove_global_cmake_vars' into 'master'
change(esptool_py): Make esptool_py component idempotent in the build

Closes IDF-13073

See merge request espressif/esp-idf!39589
2025-07-17 17:13:49 +02:00
morris
e1213c8874 Merge branch 'feat/soc_config_h' into 'master'
split soc_caps.h and standardize its name/usage

Closes IDF-11815

See merge request espressif/esp-idf!35445
2025-07-17 21:46:44 +08:00
Mahavir Jain
4e12ed0655 Merge branch 'contrib/github_pr_16076' into 'master'
fix(esp_http_client): fix spurious async open error (GitHub PR)

Closes IDFGH-15428

See merge request espressif/esp-idf!40273
2025-07-17 14:38:34 +05:30
armando
9477f88a0d change(g0): use hw_ver1 to build g0 components test app 2025-07-17 08:57:03 +00:00
armando
df7cd41765 change(ci): update regex to match soc headers in check_public_header.py 2025-07-17 08:57:03 +00:00
armando
4ea2ea5f02 p4: move hw ver1 registers 2025-07-17 08:57:03 +00:00
Mahavir Jain
c6cc403060 Merge branch 'bugfix/fix_memory_leak_on_http_header_fetch_failure' into 'master'
fix(esp_http_client): free header in case of ESP_ERR_HTTP_FETCH_HEADER

See merge request espressif/esp-idf!40528
2025-07-17 14:26:31 +05:30
C.S.M
001d01f93a refactor(gpio): Move valid gpio_caps macro from driver layer to hal 2025-07-17 16:54:54 +08:00
Igor Udot
b65366d5c4 Merge branch 'ci/fix-test-skip-ci-issue' into 'master'
ci: fix temp_skip_ci issue where test job was not skipped

Closes IDFCI-3032

See merge request espressif/esp-idf!40628
2025-07-17 16:53:01 +08:00
igor.udot
ab85534fb7 ci: fix temp_skip_ci issue where test job was not skipped 2025-07-17 16:27:00 +08:00
Ivan Grokhotkov
f45154b347 change(bt): use add_prebuilt_library to add blobs 2025-07-17 15:10:16 +08:00
Ivan Grokhotkov
71f481e9ae change(esp_phy): use add_prebuilt_library to add blobs 2025-07-17 15:10:16 +08:00
Island
918b2cfd7e Merge branch 'feat/support_ble_log_uart_dma_out' into 'master'
Feat/support ble log uart dma out

Closes BLERP-1935

See merge request espressif/esp-idf!40597
2025-07-17 14:17:35 +08:00
Rahul Tank
635169fdd8 Merge branch 'feat/add_timestamp' into 'master'
fix(nimble): Enhanced HCI logging by adding timestamp information

See merge request espressif/esp-idf!40620
2025-07-17 10:14:14 +05:30
Rahul Tank
2a1a76d6a6 Merge branch 'bugfix/make_blufi_adv_custom' into 'master'
feat(nimble): Add a way to make blufi advertising customizable

See merge request espressif/esp-idf!40453
2025-07-17 10:12:58 +05:30
Erhan Kurubas
8a2692edb6 change(app_trace): add dest parameter to down buffer config 2025-07-17 12:36:39 +08:00
Erhan Kurubas
3d7d7813c9 refactor(apptrace): replace xxx_TRAX with xxx_JTAG 2025-07-17 12:36:39 +08:00
Zhang Shuxian
907cf6390f docs: Remove incorrect description for ESP32-P4 SDMMC 2025-07-17 11:56:05 +08:00
zhangyanjiao
96e39022b3 fix(wifi/mesh): fixed the mesh STA sends data error on c61 2025-07-17 11:43:08 +08:00
Zhou Xiao
3671d7b59b feat(ble): support ble log uart dma out for ESP32-C5 2025-07-17 10:48:22 +08:00
Zhou Xiao
d45778f784 feat(ble): support ble log uart dma out for ESP32-H2 2025-07-17 10:48:22 +08:00
Zhou Xiao
ae8a7c8117 feat(ble): support ble log uart dma out for ESP32-C6 2025-07-17 10:48:22 +08:00
Zhou Xiao
534b43e85a feat(ble): support ble log uart dma out 2025-07-17 10:48:17 +08:00
morris
0999aeedbd refactor(timg): clean up soc layer meta data 2025-07-17 10:33:08 +08:00
morris
ccd092d7dc refactor(hal): clean up some hal file dependency on sdkconfig.h 2025-07-17 10:33:08 +08:00
morris
0296c30908 feat(soc): introduce the soc_caps_full.h for internal use only 2025-07-17 10:33:08 +08:00
Ashish Sharma
801ea1fc4e fix(esp_http_client): fix memory leak in current_header_value buffer
Fixed memory leak in esp_http_client_cleanup() where current_header_value
buffer was not being freed when ESP_ERR_HTTP_FETCH_HEADER is returned
during header parsing failures.
2025-07-17 10:32:50 +08:00
Marius Vikhammer
296bc7ddcc Merge branch 'feature/h4_reset_reasons' into 'master'
feat(system): updated H4 reset reasons

Closes IDF-12307

See merge request espressif/esp-idf!40499
2025-07-17 10:10:28 +08:00
Ivan Grokhotkov
425ff5f03f change(esp_wifi): use add_prebuilt_library to add blobs 2025-07-17 09:33:21 +08:00
Ivan Grokhotkov
47f695a930 change(xtensa): use add_prebuilt_library to add blobs 2025-07-17 09:33:21 +08:00
Ivan Grokhotkov
1a8a573ea8 test(ldgen): add test for placements of symbols in prebuilt libraries 2025-07-17 09:33:21 +08:00
Ivan Grokhotkov
e76e0673fc change(cmake): targets created by add_prebuilt_library are now GLOBAL
This allows the prebuilt libraries to be processed by ldgen.
2025-07-17 09:33:20 +08:00
Marius Vikhammer
36834844b2 fix(systimer): fixed ETM not working with systimer on C61 ECO3 2025-07-17 09:16:47 +08:00
Fu Hanxi
138a0941ca Merge branch 'ci/fixes' into 'master'
ci: a few fixes

Closes IDFCI-3018

See merge request espressif/esp-idf!40610
2025-07-17 03:13:52 +02:00
Fu Hanxi
d4cc559709 chore: add ci config files to CODEOWNER 2025-07-16 14:16:19 +02:00
Fu Hanxi
c5a562e6e0 ci: add examples/openthread to PYTHONPATH 2025-07-16 14:11:09 +02:00
Fu Hanxi
76181e5fce ci: skip app downloader for host test cases 2025-07-16 14:11:08 +02:00
Fu Hanxi
158eb78555 ci: add CI_JOB_ID as suffix to help ci-dashboard parse info easier 2025-07-16 14:09:44 +02:00
Fu Hanxi
95fbd6b81a ci: make sure test child pipeline only triggered when all build jobs succeeded 2025-07-16 14:09:44 +02:00
Fu Hanxi
d280d36405 tests: fix special characters in parametrize with variables 2025-07-16 14:09:44 +02:00
Jiang Jiang Jian
4324c48388 Merge branch 'bugfix/ci_release_zip_base_image' into 'master'
Bump ubuntu version for release zips workflow

See merge request espressif/esp-idf!40442
2025-07-16 19:40:23 +08:00
Guilherme Ferreira
8884211036 Merge branch 'fix/idfg-15478' into 'master'
fix(tcp_transport): off-by-one buffer corruption when WS header buffer full

Closes IDFGH-15478

See merge request espressif/esp-idf!39878
2025-07-16 18:18:06 +08:00
Rahul Tank
2823aac1a7 fix(nimble): Enhanced HCI logging by adding timestamp information 2025-07-16 15:31:39 +05:30
Ondrej Kosta
c76202c0a8 Merge branch 'fix/bridge_test_ssh' into 'master'
fix(esp_eth): bridge test to use SSH key when connect to endnode

Closes IDFCI-2994

See merge request espressif/esp-idf!40540
2025-07-16 17:37:38 +08:00
Mahavir Jain
464d03f999 Merge branch 'contrib/github_pr_15767' into 'master'
fix(esp_http_server): WebSocket frame parsing errors (GitHub PR)

Closes IDFGH-15086 and IDFGH-14461

See merge request espressif/esp-idf!40076
2025-07-16 13:58:37 +05:30
Zhang Wen Xu
9207ca0b45 Merge branch 'fix/ieee802154_example_rx' into 'master'
fix(ieee802154): set rx_when_idle to false when Rx stop

See merge request espressif/esp-idf!40475
2025-07-16 07:49:21 +00:00
Jiang Jiang Jian
bd557f9e5c Merge branch 'bugfix/crash_ap_mode_switch' into 'master'
fix(wifi): Fix crash due to BIP when ap mode change

Closes WIFIBUG-1323

See merge request espressif/esp-idf!40564
2025-07-16 15:12:27 +08:00
Fu Hanxi
d1a860bda5 ci: use fixed telnetlib since python 3.13 removed this from stdlib 2025-07-16 09:12:03 +02:00
Fu Hanxi
288fc561b7 tests: fix skipif markers. use temp_skip instead 2025-07-16 09:12:03 +02:00
Guillaume Souchere
b46f4689bd fix(linenoise): Read escape sequences one character at a time 2025-07-16 08:28:22 +02:00
Shen Meng Jing
c55e913b8d Merge branch 'docs/update_esp_crt_bundle_cn' into 'master'
docs: Update the CN translation for esp_crt_bundle.rst

Closes DOC-11550

See merge request espressif/esp-idf!40527
2025-07-16 12:19:56 +08:00
Wan Lei
cd945b22de Merge branch 'fix/twai_ci_repaire' into 'master'
fix(driver_twai): improve twai ci test

Closes IDFCI-3015 and IDFCI-3016

See merge request espressif/esp-idf!40585
2025-07-16 11:02:12 +08:00
shenmengjing
8f5e74ee86 docs: Update the CN translation for esp_crt_bundle.rst 2025-07-16 10:19:48 +08:00
Armando (Dou Yiwen)
c9ed1cee58 Merge branch 'doc/update_docs_c61' into 'master'
doc: update docs

Closes IDF-10130, IDF-10142, and IDF-10125

See merge request espressif/esp-idf!40581
2025-07-16 01:23:33 +00:00
wanckl
d9fdb0b241 fix(driver_twai): improve twai ci test 2025-07-16 08:45:08 +08:00
Marius Vikhammer
9319fcebf3 Merge branch 'ci/reenable_c5_lp_core_test' into 'master'
test(lp_core): re-enabled C5 lp-core test

Closes IDF-13583

See merge request espressif/esp-idf!40517
2025-07-16 08:40:55 +08:00
Samuel Obuch
037af2d40a Merge branch 'ci/enable_sysview_tests' into 'master'
ci: enable sysview example tests for all chips

Closes IDF-13342

See merge request espressif/esp-idf!39532
2025-07-15 21:52:41 +08:00
Fu Hanxi
2b29146881 Merge branch 'ci/fix-master-pipeline-artifact-downloading' into 'master'
ci: fix master pipeline artifacts downloading

Closes IDFCI-3008

See merge request espressif/esp-idf!40563
2025-07-15 13:17:02 +02:00
Samuel Obuch
824d54e707 ci: fix appimage_offset for esp32p4 in sysview heap trace example 2025-07-15 12:58:33 +02:00
Samuel Obuch
a678721e49 ci: enable c61 usb_serial_jtag tests 2025-07-15 12:58:26 +02:00
Samuel Obuch
afe83c15aa fix(sysview): fix timestamp freq when not using APB clock 2025-07-15 12:57:21 +02:00
Samuel Obuch
d7eea89e16 ci: enable example tests for esp32p4 2025-07-15 12:57:21 +02:00
Erhan Kurubas
55617bb5e7 feat(tools): add esp32c3 rev1.1 rom version string 2025-07-15 12:57:21 +02:00
Samuel Obuch
7b724fadd3 ci: use shared OpenOCD class for GDB test app 2025-07-15 12:57:21 +02:00
Samuel Obuch
ee65205183 ci: OpenOCD class as fixture 2025-07-15 12:57:19 +02:00
Samuel Obuch
66defc0c19 ci: enable sysview examples for all chips 2025-07-15 12:38:24 +02:00
Ondrej Kosta
3bd6e5d4bb fix(esp_eth): bridge test to use SSH key when connect to endnode 2025-07-15 12:26:05 +02:00
wuzhenghui
2dc52022ac feat(esp_hw_support): add API to supoport modify retention skip flag dynamically 2025-07-15 18:05:52 +08:00
Fu Hanxi
6ef01c9c26 ci: fix master pipeline artifacts downloading 2025-07-15 11:49:56 +02:00
Sudeep Mohanty
69702d8666 fix(bootloader): Correct dependency logic for custom commands
The bootloader build script incorrectly used the `DEPENDS` keyword with the
`add_custom_command(TARGET ...)` signature. This is unsupported, causes
warnings with modern CMake versions enforcing the CMP0175 policy.

This commit also updates the POST_BUILD messages generated during the
bootloader build to depend on more precise CMake targets rather than
depending on the generic bootloader.elf target.
2025-07-15 11:00:20 +02:00
armando
651817dc7f doc: update docs 2025-07-15 15:53:24 +08:00
Vincent Hamp
ab07377b11 fix(esp_http_server): WebSocket frame parsing errors
Fixes the Websocket frame pasring error, by making sure
that two bytes are read compulsary for length bytes 126.

Closes https://github.com/espressif/esp-idf/pull/15767
Closes https://github.com/espressif/esp-idf/issues/15235
2025-07-15 11:26:35 +05:30
C.S.M
64e49c2aad Merge branch 'fix/i2c_sleep_ci_h4' into 'master'
fix(i2c): Fxi the i2c sleep retention build failed on esp32h4

See merge request espressif/esp-idf!40580
2025-07-15 11:48:46 +08:00
C.S.M
f4ffc66927 fix(i2c): Fxi the i2c sleep retention build failed on esp32h4 2025-07-15 10:49:23 +08:00
Shreyas Sheth
98be62fe4e fix(wifi): Fix crash due to BIP when ap mode change 2025-07-15 10:32:53 +08:00
Ivan Grokhotkov
4dee9df0e7 Merge branch 'bugfix/tools_qemu_esp32s3' into 'master'
fix(toolchain): install qemu-xtensa if esp32s3 target is requested

See merge request espressif/esp-idf!37364
2025-07-14 12:04:08 +02:00
Ivan Grokhotkov
90518119d4 Merge branch 'contrib/github_pr_15974' into 'master'
fix(tools/idf-qemu): Append qemu_extra_args after monitor -serial not before (GitHub PR)

Closes IDFGH-15315

See merge request espressif/esp-idf!39257
2025-07-14 12:03:22 +02:00
Jiang Jiang Jian
9425367057 Merge branch 'bugfix/fix_pmksa_cache_expired_after_sntp_issue' into 'master'
fix(wifi): fix pmksa cache expiration caused by sntp time synchronization issue

Closes FCS-1730

See merge request espressif/esp-idf!39550
2025-07-14 15:21:41 +08:00
Sudeep Mohanty
46160b0f3d Merge branch 'task/remove_deprecated_funcs_in_idf_additions_h' into 'master'
remove(freertos): Remove deprecated functions from idf_additions.h

Closes IDF-8499, IDF-8158, and DOC-11732

See merge request espressif/esp-idf!40386
2025-07-14 08:36:54 +02:00
C.S.M
187212ba9d Merge branch 'feature/i2c_bringup_esp32h4' into 'master'
feat(i2c): Bringup i2c peripheral for esp32h4

Closes IDF-12359 and IDF-12357

See merge request espressif/esp-idf!40274
2025-07-14 14:19:45 +08:00
Omar Chebib
54065dda3c Merge branch 'docs/fix_some_broken_links' into 'master'
docs: Fix some broken links to OpenOCD Debugging

Closes DOC-11273

See merge request espressif/esp-idf!40541
2025-07-14 14:14:03 +08:00
Zhang Shuxian
3c012ee327 Provide CN translation 2025-07-14 12:22:07 +08:00
Sudeep Mohanty
7b57540cc4 feat(freertos): Add xTaskGetStackStart and deprecate pxTaskGetStackStart
The following changes have been made:
- Add new xTaskGetStackStart() function with proper StackType_t* return type
- Deprecate pxTaskGetStackStart() with wrapper implementation for backward compatibility
2025-07-14 12:18:05 +08:00
Sudeep Mohanty
669939d786 remove(freertos): Remove deprecated functions from idf_additions.h
This commit removes the following deprecated functions:
- xTaskGetAffinity()
- xTaskGetIdleTaskHandleForCPU()
- xTaskGetCurrentTaskHandleForCPU()
2025-07-14 12:18:05 +08:00
C.S.M
97a6b3bbab feat(i2c): Bringup i2c peripheral for esp32h4 2025-07-14 11:59:28 +08:00
Chen Ji Chang
c7561dc4cc Merge branch 'refactor/spi_lcd_detect_bus_mode_automatically' into 'master'
refactor(spi_lcd): detect the bus mode automatically

Closes IDF-11255 and IDFGH-15695

See merge request espressif/esp-idf!40308
2025-07-14 11:45:15 +08:00
linruihao
d5b14edec4 fix(bt/bluedroid): Fix build issue when using external sbc codec 2025-07-14 10:47:16 +08:00
gaoxu
bc84e7fc99 fix(adc): fix wrong adc periph num on C2/P4 2025-07-14 08:33:18 +08:00
Roland Dobai
a71bd0d6c2 Merge branch 'fix/username_special_characters' into 'master'
feat(tools): Added encoding when special characters used with username

Closes IDFGH-15599

See merge request espressif/esp-idf!40416
2025-07-13 17:57:05 +02:00
Roland Dobai
fee7256064 Merge branch 'feat/extend_pip_user_option_check' into 'master'
feat(tools): Disabled pip 'user' option, when installing ESP-IDF python virtual environment

Closes IDFGH-15556

See merge request espressif/esp-idf!40312
2025-07-13 17:50:51 +02:00
morris
3f1f3e4b26 Merge branch 'docs/add_a_note' into 'master'
docs: Add a note for temp_sensor

Closes DOC-11374

See merge request espressif/esp-idf!40543
2025-07-12 22:24:08 +08:00
Marek Fiala
8ae487d48e feat(tools): Enforce pip 'user' option to no, when installing python env
Closes https://github.com/espressif/esp-idf/issues/16189
2025-07-11 21:35:39 +08:00
Marek Fiala
285e1edbea feat(tools): Added encoding when special characters used with username
Closes https://github.com/espressif/esp-idf/issues/16229
2025-07-11 21:35:11 +08:00
Igor Masar
f4a861964e Merge branch 'refactor/usb-phy' into 'master'
refactor(usb_phy): move USB PHY implementation to esp_hw_support

Closes IDF-11144 and IDF-9021

See merge request espressif/esp-idf!39770
2025-07-11 20:49:36 +08:00
Sumeet Singh
651c6d8128 fix(nimble): Clear GATT service entries counter upon GATT deinit 2025-07-11 17:46:37 +05:30
Wang Meng Yang
706b7c8629 Merge branch 'feat/add_handl_in_sdp_evt' into 'master'
feat(bt): Add record_handle in ESP_SDP_REMOVE_RECORD_COMP_EVT

Closes BTQABR2023-537

See merge request espressif/esp-idf!40409
2025-07-11 19:29:48 +08:00
Wan Lei
cb3ddef853 Merge branch 'fix/c61_eco3_open_ci_test_generic' into 'master'
fix(ci): c61 eco3 open ci test

See merge request espressif/esp-idf!40480
2025-07-11 18:37:03 +08:00
Shen Mengjing
51979f5b35 docs: Add a note for temp_sensor 2025-07-11 17:41:49 +08:00
Shen Mengjing
ecb21d35ba docs: Fix some broken links 2025-07-11 16:41:15 +08:00
Song Ruo Jing
3519fbd30b Merge branch 'feature/esp32h4_clock_support' into 'master'
feat(clk): Add basic clock support for esp32h4

Closes IDF-12285, IDF-12912, and IDF-12499

See merge request espressif/esp-idf!40166
2025-07-11 15:51:43 +08:00
Marius Vikhammer
39d2225237 Merge branch 'change/cleanup_deprecated_rtc_h' into 'master'
change(hw_support): removed deprecated headers: rtc.h and soc_memory_types.h

Closes IDF-11951

See merge request espressif/esp-idf!40328
2025-07-11 15:50:49 +08:00
Rocha Euripedes
eb8833e285 Merge branch 'fix_mqtt_test_app_broker' into 'master'
fix(mqtt): Adds sdkconfig to use test broker

Closes IDFCI-2987

See merge request espressif/esp-idf!40406
2025-07-11 14:27:00 +08:00
Fu Hanxi
682388487a Merge branch 'ci/apply-idf-ci-1' into 'master'
ci: apply `idf-ci`

Closes IDFCI-2719

See merge request espressif/esp-idf!38755
2025-07-11 07:18:32 +02:00
luweike
f22f77b22a docs: Update TCM to SPM for ESP32-P4 memory types 2025-07-11 09:47:38 +08:00
Marius Vikhammer
914fc9f899 test(lp_core): re-enabled C5 lp-core test 2025-07-11 09:45:50 +08:00
Armando (Dou Yiwen)
c5a7513cb8 Merge branch 'feat/p4_eco5_fpga' into 'master'
esp32p4: eco5 support on FPGA

See merge request espressif/esp-idf!39917
2025-07-11 01:27:22 +00:00
Marius Vikhammer
374b31049b feat(system): updated H4 reset reasons 2025-07-11 09:24:57 +08:00
Marius Vikhammer
9d48db32d9 change(hw_support): removed deprecated headers: rtc. anmd soc_memory_types.h 2025-07-11 09:20:39 +08:00
Wu Zheng Hui
dd980b738d Merge branch 'fix/fix_esp32_core1_access_rtc_fast_in_sleep_code' into 'master'
fix(esp_hw_support): fix esp32 APP_CPU accessing RTCFAST memory in sleep code

Closes IDFGH-15614

See merge request espressif/esp-idf!40452
2025-07-10 21:29:21 +08:00
Erhan Kurubas
a083766688 Merge branch 'apptrace_changes' into 'master'
Apptrace improvements

Closes IDF-11982

See merge request espressif/esp-idf!40407
2025-07-10 15:07:36 +02:00
igor.masar
84a5812d55 refactor(usb_phy): Move USB PHY implementation to esp_hw_support
Moved USB PHY source and headers from `usb/` to `esp_hw_support/`
to better reflect their hardware-specific nature.
Replaced use of public GPIO driver APIs with internal LL (Low-Level) APIs
for more precise hardware control and alignment with ESP-IDF HAL best practices.
Deleted deprecated PHY helper functions.
Consolidated all SoC-specific declarations under `usb_periph.h`.

BREAKING CHANGE: deprecated USB PHY APIs have been removed; update
callers to use the new interfaces in esp_hw_support/usb_phy.h
2025-07-10 14:52:47 +02:00
Aditya Patwardhan
f8ebe0c936 Merge branch 'feat/enable_memory_region_protection_for_h21' into 'master'
feat(esp_hw_support): Enabled support for memory region protection for H21

Closes IDF-11917

See merge request espressif/esp-idf!39312
2025-07-10 17:13:36 +05:30
Island
b87b0dd440 Merge branch 'change/ble_update_lib_20250709' into 'master'
change(ble): [AUTO_MR] 20250709 - Update ESP BLE Controller Lib

Closes BLERP-2067

See merge request espressif/esp-idf!40465
2025-07-10 18:53:05 +08:00
Erhan Kurubas
f78d6d6366 change(app_trace): remove extra data buffering feature 2025-07-10 12:39:44 +02:00
Erhan Kurubas
a0ef187d10 refactor(apptrace): format apptrace component with astyle 2025-07-10 12:37:41 +02:00
Erhan Kurubas
2bb1ae8729 fix(apptrace): refactor timeout handling logs 2025-07-10 12:37:41 +02:00
Sudeep Mohanty
7204704b53 refactor(esptool_py): Move flash target creation and post-build activities into separate files
This commit trims the idf_build_executable() logic and refactors flash
target creation, utility target creation and post-build target creation
into their own separate cmake files/or functions.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
c29f473a78 refactor(esptool_py): Remove elf variable dependencies
This commit updates all test_apps that have dependency on the elf
variable. Such test_apps now fetch the executable target from the build
properties.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
b6ea668e6e refactor(esptool_py): Removed global scope variables from esptool_py project_include.cmake
This commit global variables such as ESPTOOLPY, ESPSECUREPY, ESPEFUSEPY,
ESPMONITOR and ESPTOOLPY_CHIP from the project_include.cmake file of
esptool_py component. All other components which use these variables
have been updated to fetch the same from esptool_py component's
properties.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
8582294caf refactor(esptool_py): Move utility target creation to project level
This commit refactors the esptool_py component to provide utility
functions for creating utility targets such as erase_flash, merge-bin
and monitor.

The following changes were done in this commit:
- Added __esptool_py_setup_utility_targets() to create utility targets.
- Utility target creation now happens in idf_build_executable() in
  build.cmake.
- Removed more global scope processing and variables from esptool_py
  component project_include.cmake.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
3a1f34386c refactor(esptool_py): Move flasher_args.json generation to project level
This commit refactors the esptool_py component to move the
flasher_args.json file generation to the main project level cmake file
when idf_build_executable() runs.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
7c75795a0b refactor(esptool_py): Move binary generation to project level and add utility functions
This commit refactors the esptool_py component to provide utility
functions for binary file generation targets instead of creating the
targets. Binary generation targets are now moved to the respective
projects.

The following changes were done in this commit:
- Added __idf_build_binary() function to esptool_py to create the binary
  file generation target.
- Added __idf_build_secure_binary() as the secure boot equivalent of the
  above function.
- Top level project build now creates its own binary targets in
  idf_build_executable() in build.cmake.
- Bootloader and esp_tee subprojects create their binary file generation
  targets in their respective CMakeLists.txt files.
- All post-build targets such as the app_size_check target are now
  created by the respective projects and not esptool_py.
- General clean-up of the esptool_py cmake files.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
ef4d6462e2 refactor(esptool_py): Move flash target creation to project level and add utility functions
This commit refactors the esptool_py component to provide utility
functions for flash target management instead of creating the targets
directly. Flash target creation is now moved to the project level in
build.cmake file when idf_build_executable() runs.

The following changes were done in this commit:
- Added __esptool_py_setup_tools(), __esptool_py_setup_estool_py_args()
  and __ensure_esptool_py_setup() functions to centralize esptool_py
  setup.
- Added __esptool_py_setup_main_flash_target() which is called by
  idf_build_executable() to create the flash targets.
- Updated esptool_py_flash_target(), esptool_py_custom_target() to
  accept an optional FILENAME_PREFIX argument to enable creation of
  build artifacts based on custom names.
- Create placeholder flash targets early in the build process when
  idf_build_process() is called for components to add dependencies on
  these targets.
- Moved app-flash target creation from esptool_py/CMakeLists.txt to
  build.cmake.
- Added function description to esptool_py functions.
2025-07-10 11:26:28 +02:00
Sudeep Mohanty
30083e07be refactor(esptool_py): Re-evalute dependencies of esptool_py
This commit establishes the foundation for making the esptool_py
component idempotent.

The following changes are made in this commit:

- Removes unnecessary dependency of esp_wifi component on esptool_py.
- Add missing esptool_py dependencies to components which directly use
  esptool_py specific functions or variables but do not declare a public
  or private dependency.
2025-07-10 11:26:28 +02:00
Song Ruo Jing
b3fd9b6afa fix(clk): XTAL_X2 clock is not usable on H21 MPW and H4 BETA5 2025-07-10 16:35:58 +08:00
Song Ruo Jing
caa382047b fix(clk): ESP32H21 uses RC_SLOW_D4 as RTC slow clock 2025-07-10 16:35:58 +08:00
Song Ruo Jing
28df79aee8 feat(clk): Add basic clock support for esp32h4 2025-07-10 16:35:53 +08:00
morris
ce92b0ab60 Merge branch 'refactor/remove_deprecated_uart_rom_functions' into 'master'
refactor(uart)!: deprecate esp_rom_uart.h

See merge request espressif/esp-idf!39423
2025-07-10 15:56:56 +08:00
Hrushikesh Bhosale
dee2895ab4 Merge branch 'feat/added_api_to_get_scartch_buffer_data_in_esp_http_server' into 'master'
Added API to get scratch buffer data in esp_http_server

Closes IDFGH-15185

See merge request espressif/esp-idf!39684
2025-07-10 15:09:15 +08:00
Aditya Patwardhan
bfc5e1b234 Merge branch 'feature/store_respnse_status_code_before_header_complete' into 'master'
feat(esp_http_client): Add HTTP_EVENT_ON_STATUS_CODE to notify early status code acquisition

Closes IDF-13452

See merge request espressif/esp-idf!40244
2025-07-10 12:35:10 +05:30
armando
bcf04e356b resolve comments, to squash 2025-07-10 06:24:32 +00:00
armando
dfb0662de2 feat(esp32p4): support eco5 on fpga 2025-07-10 06:24:32 +00:00
Kapil Gupta
76d24d2fe5 Merge branch 'feat/eap_method_limit' into 'master'
feat(esp_wifi): Add support to limit EAP methods

See merge request espressif/esp-idf!40198
2025-07-10 11:44:14 +05:30
Kapil Gupta
6c309b29e9 feat(esp_wifi): Add support to limit EAP methods 2025-07-10 11:44:14 +05:30
Rahul Tank
798a559f81 fix(nimble): Add a way to make blufi advertising customizable
Based on changes in https://github.com/espressif/esp-idf/pull/8958
2025-07-10 11:26:22 +05:30
wanckl
e685007490 fix(ci): c61 eco3 open ci test 2025-07-10 07:33:26 +08:00
Fu Hanxi
586d219934 ci: apply idf-ci for debug pipeline 2025-07-09 15:44:27 +02:00
hrushikesh.bhosale
9f6ab55a5b feat(http_server): Added API to get scratch buffer data
1. Added the API in esp_http_server to get the raw headers data
from the scratch buffer.
2. This data will be unparsed.

Closes https://github.com/espressif/esp-idf/issues/15857
2025-07-09 18:36:52 +05:30
Fu Hanxi
7ada32c39a ci: apply idf-ci for artifacts 2025-07-09 10:33:29 +02:00
Fu Hanxi
15b411270e ci: apply idf-ci on generating child pipelines 2025-07-09 10:33:29 +02:00
Fu Hanxi
a5257dcc39 ci: apply idf-ci pytest plugin
Removed

- target markers. Now must use target as parametrization in esp-idf
- host test markers. Now will be automatically added with linux target and qemu marker
2025-07-09 10:33:28 +02:00
Fu Hanxi
f33469dd63 ci: apply idf-ci build run
removed script:

- tools/ci/dynamic_pipelines/scripts/child_pipeline_build_apps.py -> idf-ci build run
- tools/ci/ci_build_apps.py -> idf-build-apps build

moved from remove from idf_pytest/constants.py to .idf_build_apps.toml

- DEFAULT_FULL_BUILD_TEST_COMPONENTS
- DEFAULT_FULL_BUILD_TEST_FILEPATTERNS
- DEFAULT_IGNORE_WARNING_FILEPATH
- DEFAULT_BUILD_LOG_FILENAME
- DEFAULT_SIZE_JSON_FILENAME
2025-07-09 10:33:28 +02:00
Fu Hanxi
c80d0aded4 ci: apply idf-ci gitlab dynamic-pipeline-variables
Renamed env vars:

- TEST_CASE_FILTERS -> IDF_CI_SELECT_BY_FILTER_EXPR
- BUILD_AND_TEST_ALL_APPS -> IDF_CI_SELECT_ALL_PYTEST_CASES

Removed env vars;

- IS_MR_PIPELINE (could use CI_MERGE_REQUEST_IID)
- REPORT_EXIT_CODE -> IDF_CI_IS_DEBUG_PIPELINE (fail fast)
- PYTEST_IGNORE_COLLECT_IMPORT_ERROR -> always skip import error
2025-07-09 10:33:27 +02:00
Fu Hanxi
0d5b3e60ac ci: remove --enable-pytest from install.sh 2025-07-09 10:33:26 +02:00
Fu Hanxi
bc15de99e1 ci: sort tools/ci/exclude_check_tools_files.txt 2025-07-09 10:33:25 +02:00
Fu Hanxi
8ca8f611ef ci: cleanup unused code 2025-07-09 10:33:24 +02:00
wuzhenghui
70825a78af feat(esp_hw_support): add core1 enter deepsleep test case 2025-07-09 14:59:56 +08:00
C.S.M
e5f155229e Merge branch 'feature/add_120m_clk' into 'master'
feat(clk): Add 120M pll clock support

See merge request espressif/esp-idf!40456
2025-07-09 14:59:27 +08:00
Tan Yan Quan
e451e5566e fix(ieee802154): set rx_when_idle to false when Rx stop 2025-07-09 14:56:12 +08:00
Tan Yan Quan
f01806f2b8 fix(ieee802154): initialize nvs before enable ieee802154 2025-07-09 14:55:15 +08:00
Rahul Tank
f03521b4f3 Merge branch 'fix/ble_ancs_adding_entry_for_chip' into 'master'
fix(nimble): Add ble_ancs example to build-test-rules.yml

See merge request espressif/esp-idf!40439
2025-07-09 10:06:13 +05:30
Zhou Xiao
f1838aeec1 fix(ble): updated rom linker script for ESP32-C2 2025-07-09 11:30:44 +08:00
cjin
3d93ce37da feat(ble): enable broker initialization on ESP32-C6 2025-07-09 11:25:23 +08:00
cjin
afee51e0ef feat(ble): enable broker initialization on ESP32-C5 2025-07-09 11:25:23 +08:00
cjin
64f216ae5a feat(ble): enable broker initialization on ESP32-H2 2025-07-09 11:25:23 +08:00
cjin
265a8746dc feat(ble): support memory allocation check debug feature on ESP32-H2 2025-07-09 11:25:23 +08:00
cjin
027766e0c2 feat(ble): support memory allocation check debug feature on ESP32-C6 2025-07-09 11:25:23 +08:00
cjin
1ce54a5fe8 feat(ble): support memory allocation check debug feature on ESP32-C5 2025-07-09 11:25:23 +08:00
cjin
7ef90d4113 feat(ble): support memory allocation check debug feature on ESP32-C2 2025-07-09 11:25:23 +08:00
Zhou Xiao
3d45e8578e change(ble): [AUTO_MR] Update lib_esp32c2 to c7732d48 2025-07-09 11:17:37 +08:00
Zhou Xiao
1e236a1feb change(ble): [AUTO_MR] Update lib_esp32c6 to ca6c20bc 2025-07-09 11:17:37 +08:00
Zhou Xiao
91e8ed2a10 change(ble): [AUTO_MR] Update lib_esp32c5 to ca6c20bc 2025-07-09 11:17:37 +08:00
Zhou Xiao
6a650312d4 change(ble): [AUTO_MR] Update lib_esp32h2 to ca6c20bc 2025-07-09 11:17:37 +08:00
C.S.M
92df25e7c0 Merge branch 'fix/i2c_master_multi_read' into 'master'
fix(i2c_master): Fix that master multi-read failed

Closes IDFGH-15601

See merge request espressif/esp-idf!40336
2025-07-09 10:49:44 +08:00
Marius Vikhammer
dea84337f5 Merge branch 'change/bootloader_o0_deprecate' into 'master'
change(bootloader): removed support for CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE

Closes IDF-9025

See merge request espressif/esp-idf!40331
2025-07-09 08:58:54 +08:00
Marius Vikhammer
cd48833c16 Merge branch 'bugfix/h4_panic_handler_stuck_fix' into 'master'
fix(system): fixed cpu_stall function stuck issue on H4

Closes IDF-12311

See merge request espressif/esp-idf!40420
2025-07-09 08:57:02 +08:00
Wu Zheng Hui
2461b0ca90 Merge branch 'fix/reinit_c5_clk_tree_after_app_changed' into 'master'
feat(esp_hw_support): manage clock tree hw/sw coherence during CPU reset lazily

See merge request espressif/esp-idf!39677
2025-07-08 23:02:44 +08:00
Erhan Kurubas
52e88763b5 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20250707' into 'master'
feat(tools): update openocd version to v0.12.0-esp32-20250707

See merge request espressif/esp-idf!40396
2025-07-08 14:39:07 +02:00
wuzhenghui
56c2831992 fix(esp_hw_support): fix esp32 APP_CPU accessing RTCFAST memory in sleep code
Closes https://github.com/espressif/esp-idf/issues/16243
2025-07-08 20:33:55 +08:00
nilesh.kale
5cc874068d feat(esp_http_client): added event HTTP_EVENT_ON_STATUS_CODE
This commit added event HTTP_EVENT_ON_STATUS_CODE and
acquire response status code before header or data.
2025-07-08 17:45:18 +05:30
Erhan Kurubas
168d95d1ef change(sysview): drop ESP mcore extension 2025-07-08 13:01:48 +02:00
Erhan Kurubas
6ae68c4f86 feat(sysview): update multicore files for testing 2025-07-08 13:01:48 +02:00
Erhan Kurubas
9af60ff085 change(sysview): set default core name as core0 2025-07-08 13:01:48 +02:00
Erhan Kurubas
a6ad633622 feat(sysview): Add SEGGER multicore trace file support 2025-07-08 13:01:48 +02:00
Erhan Kurubas
adba62ff7b change(docs): replace deprecated openocd cfg files 2025-07-08 13:01:48 +02:00
Erhan Kurubas
75dd466a3c feat(tools): update openocd version to v0.12.0-esp32-20250707 2025-07-08 13:01:48 +02:00
C.S.M
752c9fc805 feat(clk): Add 120M pll clock support 2025-07-08 18:59:31 +08:00
morris
c4d7b1cfce refactor(uart)!: deprcated esp_rom_uart.h 2025-07-08 18:56:17 +08:00
Rahul Tank
dffb03f00f Merge branch 'bugfix/fix_gatt_cache_server_compile' into 'master'
fix(nimble): Fix compilation issues when gatt caching is enabled in peripheral only mode

See merge request espressif/esp-idf!40343
2025-07-08 16:04:25 +05:30
zhanghaipeng
48235c7b25 fix(ble/bluedroid): Fix issue causing BTM_GetSecurityFlags failed 2025-07-08 17:12:30 +08:00
Dong Heng
20f1700053 Merge branch 'feature/lcd_cam_dvp_driver_only_gen_clock' into 'master'
feat(esp_driver_cam): DVP driver supports only initializing the clock and XCLK pin to generate a clock for the external device

Closes IDF-13385

See merge request espressif/esp-idf!39837
2025-07-08 16:49:51 +08:00
Astha Verma
b8833081a4 fix(nimble): Add ble_ancs example to build-test-rules.yml 2025-07-08 14:07:03 +05:30
Mahavir Jain
8cc71168cf Merge branch 'feature/support_ds_peripheral_rsa_decryption' into 'master'
feat(mbedtls): Add support for RSA decryption with DS peripheral

See merge request espressif/esp-idf!39390
2025-07-08 13:56:03 +05:30
Island
d73e172d31 Merge branch 'feat/ble_log_spi_out_dev_phase_4' into 'master'
BLE Log SPI Out Dev Phase 4

Closes BLERP-2033, BLERP-2032, BLERP-2014, BLERP-2019, BLERP-2016, and BLERP-2015

See merge request espressif/esp-idf!40190
2025-07-08 14:01:59 +08:00
nilesh.kale
d4167fea60 feat(esp_hw_support): Enabled support for memory region protection for H21
This commit enabled CPU region protection for ESP32H21.
This alos updated strture for ESP32C6 and ESP32H2.
2025-07-08 13:45:01 +08:00
Chen Yu Dong
29ea09ffa0 Merge branch 'ci/update_pre_commit_job' into 'master'
ci: update pre commit jobs

See merge request espressif/esp-idf!40337
2025-07-08 11:59:25 +08:00
wuzhenghui
6124c8e30c fix(esp_hw_support): maintain pll ref_cnt in rtc_clk_cpu_freq_set_config_fast 2025-07-08 11:54:49 +08:00
wuzhenghui
ff39ac40a1 feat(esp_hw_support): manage clock tree hw/sw coherence during CPU reset lazily 2025-07-08 11:54:48 +08:00
Island
652fe76dca Merge branch 'bugfix/fix_some_ble_bugs_250610_cjh_esp32c3' into 'master'
Fixed some BLE bugs 250220 on esp32c3(2edb0b0)

Closes BLERP-1961, BLERP-1963, BLERP-1967, BLERP-1986, and BLERP-1973

See merge request espressif/esp-idf!39798
2025-07-08 11:40:37 +08:00
Zhang Shu Xian
b151b28573 Merge branch 'docs/update_trans_for_wifi_provisioning' into 'master'
docs: Update CN translation for provisioning.rst

Closes DOC-11694

See merge request espressif/esp-idf!40397
2025-07-08 11:23:20 +08:00
Marius Vikhammer
a68022f5be fix(system): fixed cpu_stall function stuck issue on H4
cpu_utility_ll_stall_cpu() used to busy-wait check stalled status
after stalling the core. On H4 it turns out that this status will
not be set if the core happens to be in WFI state when stalled.

If this happened the stall function would just wait forever for
the status.
2025-07-08 10:56:58 +08:00
Wan Lei
8d3758b7e2 Merge branch 'fix/twai_c5_errata_warning' into 'master'
fix(driver_twai): added errata warning for c5 listen only mode

See merge request espressif/esp-idf!40304
2025-07-08 06:47:46 +08:00
Sergei Silnov
16ab070093 ci: bump ubuntu version for release zips workflow 2025-07-07 17:11:47 +02:00
Zhou Xiao
5f3ac91d63 change(ble): upgraded spi log frame header 2025-07-07 19:15:23 +08:00
xiongweichao
28404a6324 feat(bt): Add record_handle in ESP_SDP_REMOVE_RECORD_COMP_EVT 2025-07-07 19:12:00 +08:00
Dong Heng
c47b72daed feat(esp_driver_cam): DVP driver supports only initializing the clock and XCLK pin to generate a clock for the external device 2025-07-07 19:04:22 +08:00
Zhou Xiao
6e384644c8 fix(ble): nimble host & hci log write race condition workaround 2025-07-07 18:57:02 +08:00
Zhou Xiao
4946a1fe8d change(ble): support task buffer number configuration 2025-07-07 18:57:02 +08:00
Zhou Xiao
b8b7e153a7 fix(ble): update error code in controller init for ESP32-S3/ESP32-C3 2025-07-07 18:57:02 +08:00
Zhou Xiao
6ac541aa4a fix(ble): fixed controller log api call for ESP32-C3/ESP32-S3 2025-07-07 18:57:02 +08:00
Zhou Xiao
0088541f54 change(ble): removed esp log to save code size 2025-07-07 18:56:35 +08:00
Zhou Xiao
c60dd1a10e change(ble): enable hci log spi out for ESP chips 2025-07-07 18:56:35 +08:00
Zhou Xiao
c0d2792b9d change(ble): enable bluedroid logs over debug level through spi output 2025-07-07 18:56:35 +08:00
Zhou Xiao
066e1d3f1b feat(ble): support ble mesh log module 2025-07-07 18:56:35 +08:00
Zhou Xiao
dd4cbe5e00 feat(ble): support host & hci log module 2025-07-07 18:56:35 +08:00
Zhou Xiao
d353bf2802 change(ble): replaced ul log codes with template 2025-07-07 18:56:35 +08:00
Zhou Xiao
feaee0a6fe change(ble): replaced le audio log codes with template 2025-07-07 18:56:35 +08:00
Zhou Xiao
8b2c176eff change(ble): implemented log module template 2025-07-07 18:56:35 +08:00
Zhou Xiao
56e42be859 change(ble): updated ble log spi out ts sync module
* use freertos ts instead of esp ts for better performance
* enable ts sync sleep support by default
* use esp ts as fallback of lc time getter
2025-07-07 18:56:35 +08:00
Chen Jichang
57cbcf388e docs(lcd): fix the wrong hyperlink in readme
Closes https://github.com/espressif/esp-idf/issues/16389
2025-07-07 18:50:19 +08:00
Chen Jichang
08b75523cb refactor(spi_lcd): detect the bus mode automatically 2025-07-07 18:49:30 +08:00
Peter Dragun
adbec6eda2 Merge branch 'feat/espefuse_require_port' into 'master'
feat(tools/efuse): Make port mandatory for eFuse commands

Closes IDF-13378

See merge request espressif/esp-idf!40315
2025-07-07 18:21:13 +08:00
morris
bfd0c49a38 Merge branch 'refactor/i3c_hal' into 'master'
refactor(i3c): sync controller data structure with TRM

See merge request espressif/esp-idf!40381
2025-07-07 17:25:11 +08:00
Euripedes Rocha
a26a54076f fix(mqtt): Adds sdkconfig to use test broker
Changes the configuration to make test to use internal broker on CI
runs.
2025-07-07 11:10:22 +02:00
Armando (Dou Yiwen)
dadd027923 Merge branch 'fix/fix_sdmmc_dma_desc_placement_issue_on_s3' into 'master'
sdmmc: fixed dma desc on psram issue on s3

Closes IDF-13550

See merge request espressif/esp-idf!40307
2025-07-07 08:33:50 +00:00
Zhang Shuxian
caffcd70b6 docs: Update CN translation for provisioning.rst 2025-07-07 15:58:13 +08:00
morris
d5921d835a Merge branch 'docs/update_unsync_cn_translation' into 'master'
docs: Sync CN translation with EN

Closes DOC-11657

See merge request espressif/esp-idf!40262
2025-07-07 15:53:56 +08:00
C.S.M
7d8d1fb98f test(i2c_master): Add test for master multi read job 2025-07-07 15:43:18 +08:00
C.S.M
0e44dcf2ff fix(i2c_master): Fix that master multi-read failed,
Closes https://github.com/espressif/esp-idf/issues/16231
2025-07-07 15:43:18 +08:00
Zhang Shuxian
bc90a2e17d docs: Sync CN translation with EN 2025-07-07 14:08:17 +08:00
Gao Xu
4e7bfc3217 Merge branch 'fix/dvp_cam_gdma_wrong_align' into 'master'
feat(cam): add dvp dma buffer alloc function

See merge request espressif/esp-idf!40326
2025-07-07 14:03:31 +08:00
C.S.M
35cb68504b Merge branch 'doc/update_tsens_doc' into 'master'
doc(temperature_sensor): Update temperature snesor docs, remove inaccurate part

See merge request espressif/esp-idf!40369
2025-07-07 13:42:56 +08:00
Ashish Sharma
466a365a02 feat(mbedtls): adds support for RSA decryption with DS peripheral 2025-07-07 13:32:06 +08:00
gaoxu
ee3de247e2 feat(cam): add camera buffer alloc function 2025-07-07 11:23:07 +08:00
morris
4a5c630994 refactor(i3c): sync controller data structure with trm 2025-07-07 10:46:03 +08:00
Wang Meng Yang
8bca0ba4fb Merge branch 'fix/incorrect_unit_of_cpb_rx_clk' into 'master'
fix(bt): fixed the incorrect unit of clk in cpb rx event

See merge request espressif/esp-idf!40363
2025-07-07 10:29:22 +08:00
armando
df7b39da34 fix(sdmmc): fixed dma desc on psram issue on s3 2025-07-07 10:24:22 +08:00
Gao Xu
6de2b7a58d Merge branch 'ci/enable_emmc_test_on_p4' into 'master'
Ci/enable emmc test on p4

See merge request espressif/esp-idf!40269
2025-07-07 09:54:54 +08:00
Jiang Jiang Jian
48b84cebbe Merge branch 'bugfix/update_ld_files_of_esp32c5' into 'master'
bugfix/fix 11a rate index incorrect and twt sleep issue

See merge request espressif/esp-idf!40264
2025-07-06 15:13:42 +08:00
Jiang Jiang Jian
bacb0ce230 Merge branch 'bugfix/fix_c5_tx_pkt_failed' into 'master'
fix(pm): fix c5 tx pkt failed

Closes PM-433 and PM-475

See merge request espressif/esp-idf!40323
2025-07-06 15:08:25 +08:00
Jack
279ac417c5 use 240MHz PLL when necessary 2025-07-05 23:48:33 +08:00
yinqingzhao
9ec9b05163 fix(twt): fix some issus related itwt 2025-07-05 18:03:31 +08:00
Rahul Tank
9df0cb7150 fix(nimble): Fix compilation issues when gatt caching is enabled in server only mode 2025-07-05 15:28:28 +05:30
Rahul Tank
c513e95845 Merge branch 'bugfix/handle_3e_rem_feat_read_name' into 'master'
fix(nimble): Handle 0x3e disconnect during rem feat/ read version

See merge request espressif/esp-idf!38871
2025-07-05 14:52:06 +05:30
Mahavir Jain
a125326ce8 Merge branch 'fix/remove_mbedtls_gcc_15_cflag' into 'master'
fix(mbedtls): remove Wunterminated-string-initialization

Closes IDF-13375

See merge request espressif/esp-idf!40362
2025-07-04 21:42:38 +05:30
C.S.M
96283dd044 doc(temperature_sensor): Update temperature snesor docs, remove inaccurate part 2025-07-04 18:11:47 +08:00
sibeibei
2cb1fc4365 fix(pm): fix c5 tx pkt failed 2025-07-04 17:54:54 +08:00
yinqingzhao
2325ad7ac1 fix(wifi): update ld files of esp32c5 2025-07-04 16:56:44 +08:00
gongyantao
16f87fb8c8 fix(bt): fixed the incorrect unit of clk in cpb rx event 2025-07-04 14:29:02 +08:00
Jiang Jiang Jian
0fde8d2012 Merge branch 'bugfix/delay_eap_start' into 'master'
fix(wpa_supplicant): Add some fixes for wpa_supplicant

Closes WIFI-6874 and WIFI-6905

See merge request espressif/esp-idf!39750
2025-07-04 14:08:22 +08:00
Island
63f7d7eadf Merge branch 'bugfix/fix_ble_aa_check_v2' into 'master'
Optimize check Access Address when receive connection request PDU

Closes BLERP-2036

See merge request espressif/esp-idf!40162
2025-07-04 14:03:44 +08:00
Mahavir Jain
7c792377e9 fix(mbedtls): remove Wunterminated-string-initialization
- Fixed in upstream release 3.6.4
- Addressed few typos in Kconfig
2025-07-04 09:59:20 +05:30
Marius Vikhammer
3751479217 change(bootloader): removed support for CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE 2025-07-04 12:16:57 +08:00
Mahavir Jain
3f9a8953c4 Merge branch 'doc/update_esp_https_ota_pre_encrypted_doc' into 'master'
docs(system/esp_https_ota): adds ECIES-256 to pre-enc ota design doc

See merge request espressif/esp-idf!39515
2025-07-04 09:35:04 +05:30
Mahavir Jain
5301d39fa7 Merge branch 'feat/update_mbedtls_3.6.4' into 'master'
feat(mbedtls): update to version 3.6.4

See merge request espressif/esp-idf!40272
2025-07-04 09:33:13 +05:30
Kapil Gupta
f90f7a5c85 fix (esp_wifi): Set default akm as eap for non AKM APs 2025-07-04 11:04:41 +08:00
Kapil Gupta
eae83f993e fix(wpa_supplicant): Delay sending of EAP_START for EAP auth 2025-07-04 11:04:41 +08:00
Aditya Patwardhan
9820fd1d9f Merge branch 'fix/esp_key_mgr_incorrect_overlapping_comparisons' into 'master'
Fix incorrect overlapping comparisons in key manager driver

See merge request espressif/esp-idf!40344
2025-07-04 08:27:07 +05:30
Peter Dragun
24a8797409 change: Fix linting errors in serial_ext.py 2025-07-03 16:15:24 +02:00
Peter Dragun
b184766aa4 feat(tools/efuse): Make port mandatory for eFuse commands
BREAKING CHANGE:

Autodetection was removed from idf.py efuse* commands to prevent accidental use of the wrong port.
2025-07-03 16:15:22 +02:00
Peter Dragun
5741a3a0e1 feat(tools/requirements): Add IDE requirements files 2025-07-03 13:22:53 +02:00
Wang Ning
4bdd6b6f7b Merge branch 'contrib/github_pr_16236' into 'master'
docs: Fix idf_component_register  reference CN translation (GitHub PR)

Closes IDFGH-15606

See merge request espressif/esp-idf!40342
2025-07-03 18:54:27 +08:00
ESPCI_TOKEN
993f9622c2 docs: Fix idf_component_register reference CN translation (GitHub PR) 2025-07-03 18:54:27 +08:00
harshal.patil
dce0925f40 fix(esp_security/esp_key_mgr): Incorrect overlapping comparisons 2025-07-03 15:05:50 +05:30
Song Ruo Jing
d6894a1769 Merge branch 'refactor/remove_legacy_sdm_driver' into 'master'
remove(legacy_sdm)!: remove legacy sdm driver in IDF v6.0

Closes IDF-13174

See merge request espressif/esp-idf!40294
2025-07-03 17:26:02 +08:00
Jiang Jiang Jian
54fe3373ed Merge branch 'chip/add_wifi_support_for_esp32c61_eco3_rebase_master' into 'master'
feat(wifi): add esp32c61 eco3 wifi support

Closes IDF-9244, IDF-9245, IDF-9246, IDF-9247, IDF-9248, IDF-9250, IDF-9513, IDF-10382, IDF-10384, IDF-11003, IDF-11004, IDF-10643, IDF-10642, IDF-10619, IDF-10634, IDF-10632, IDF-10636, IDF-10637, IDF-10626, IDF-10620, IDF-10621, IDF-10623, IDF-10635, IDF-10629, IDF-10622, IDF-10624, and IDF-10625

See merge request espressif/esp-idf!39720
2025-07-03 16:44:35 +08:00
Jiang Jiang Jian
2bd39311b4 Merge branch 'fix/force_enable_uart0_sclk_in_esp_restart' into 'master'
fix(esp_system): force enable uart0 sclk in esp_restart

Closes PM-423 and PM-424

See merge request espressif/esp-idf!40196
2025-07-03 16:43:04 +08:00
gaoxu
26fe24b890 ci(emmc): enable emmc example test on ESP32-P4 2025-07-03 15:42:59 +08:00
Zhang Wen Xu
f9c7d37af7 Merge branch 'feat/support_disable_pll_track' into 'master'
Support disable pll track

See merge request espressif/esp-idf!39980
2025-07-03 06:23:49 +00:00
Chen Ji Chang
2200f30323 Merge branch 'refactor/remove_essl_component' into 'master'
remove(essl): remove essl related files

Closes IDF-13433

See merge request espressif/esp-idf!40261
2025-07-03 13:54:15 +08:00
Chen Yudong
3b91d7edc5 ci: update pre commit jobs 2025-07-03 13:11:52 +08:00
Laukik Hase
95efe53cde Merge branch 'ci/tee_apm_pms_test_app' into 'master'
ci(hal): Add HAL/LL-based test app for the TEE and APM peripherals

Closes IDF-8614, IDF-8615, IDF-9229, IDF-9230, IDF-10422, IDF-12646, IDF-12647, IDF-12648, IDF-12649, and IDF-12877

See merge request espressif/esp-idf!39873
2025-07-03 10:08:58 +05:30
renpeiying
7cfcb9308b docs: Update CN translation for esp_http_ota.rst 2025-07-03 12:19:47 +08:00
Mahavir Jain
09202785f8 Merge branch 'contrib/github_pr_16202' into 'master'
fix(esp_http_server): Fix regression in httpd_cookie_key_value introduced by commit 4a47cf8 (GitHub PR)

Closes IDFGH-15573

See merge request espressif/esp-idf!40230
2025-07-03 09:35:00 +05:30
wanckl
579373d5bb fix(driver_twai): added errata warning for c5 listen only mode 2025-07-03 11:53:39 +08:00
Armando (Dou Yiwen)
bfe5caf58f Merge branch 'doc/update_32b_addr_limit_in_flash_doc' into 'master'
flash: updated 32bit addr support related doc

See merge request espressif/esp-idf!40290
2025-07-03 03:39:46 +00:00
Chen Jichang
5909a4d685 remove(essl): remove essl related files 2025-07-03 11:36:45 +08:00
Ashish Sharma
9c546002cb feat(mbedtls): update to version 3.6.4 2025-07-03 11:23:34 +08:00
armando
bd55fc8a02 doc(flash): updated 32bit addr support doc 2025-07-03 10:34:36 +08:00
zhanghaipeng
a663a87fe0 fix(bt/ble): Update esp32 libbtdm_app.a (3a27e2e)
- Optimize check Access Address when receive connection request PDU
2025-07-03 10:26:48 +08:00
Hrushikesh Bhosale
b9c224215e Merge branch 'fix/wifi_prov_mgr_deinit_return_type_fixed' into 'master'
fix(wifi_prov_mgr): Fixed wifi_prov_mgr_deinit api return type

Closes IDF-8204

See merge request espressif/esp-idf!39220
2025-07-03 08:00:10 +08:00
Rahul Tank
1140c638c3 fix(nimble): Handle 0x3e disconnect during rem feat/ read version 2025-07-02 16:45:15 +05:30
Chen Ji Chang
22cfc7ef57 Merge branch 'fix/pcnt_miss_accum_value_when_overflow' into 'master'
fix(pcnt): fix the accum_value missing when overflow

See merge request espressif/esp-idf!39967
2025-07-02 19:07:53 +08:00
Rahul Tank
90b88aff5c Merge branch 'bugfix/add_missing_unlock' into 'master'
fix(nimble): Add missing ble_hs_unlock() call

See merge request espressif/esp-idf!40163
2025-07-02 16:20:43 +05:30
hrushikesh.bhosale
ccbb885c81 fix(wifi_prov_mgr): Fixed wifi_prov_mgr_deinit api return type
1. Updated the return type for wifi_prov_mgr_deinit api from void
to esp_err_t.
2. Due to void type unable to trace the api failure.
2025-07-02 15:14:53 +05:30
Wu Zheng Hui
60d9ca995c Merge branch 'feat/new_api_to_get_all_wakeup_causes' into 'master'
feat: add new api to get multiple wakeup causes

Closes PM-472

See merge request espressif/esp-idf!40139
2025-07-02 17:36:30 +08:00
Wang Meng Yang
0e92b38244 Merge branch 'bugfix/bt_sleep_log_consistent' into 'master'
fix(ble): keep the log of the bluetooth sleep clock source consistent

See merge request espressif/esp-idf!40281
2025-07-02 17:32:27 +08:00
Zhang Shu Xian
4527c3a7a7 Merge branch 'docs/add_index_page_for_adc' into 'master'
docs: Add index page for ADC

See merge request espressif/esp-idf!40079
2025-07-02 17:17:18 +08:00
Song Ruo Jing
a45b684b81 remove(legacy_sdm): remove legacy sdm driver in IDF v6.0 2025-07-02 15:36:29 +08:00
Island
5b11d5b26a Merge branch 'change/ble_update_lib_20250630' into 'master'
change(ble): [AUTO_MR] 20250630 - Update ESP BLE Controller Lib

Closes BLERP-2051, BLERP-2040, BLERP-2052, BLERP-2053, BLERP-2054, BLERP-1800, BLERP-2047, BLERP-2038, BLERP-2037, BLERP-2017, BLERP-2055, and BLERP-2056

See merge request espressif/esp-idf!40253
2025-07-02 14:57:03 +08:00
iranl
42704821d2 fix(esp_http_server): Fix regression in httpd_cookie_key_value
Fix regression in httpd_cookie_key_value introduced by commit 4a47cf8
2025-07-02 08:39:20 +02:00
Zhang Shuxian
c26a6f7830 docs: Add index page for ADC 2025-07-02 14:10:57 +08:00
Chen Jichang
6720cf769e fix(pcnt): fix the accum_value missing when overflow 2025-07-02 11:27:15 +08:00
Wan Lei
323e94257d Merge branch 'fix_c5_spi_master_slave_rx_issue' into 'master'
fix(driver_spi): fixed c5/c61/h21 rx issue and support c61 eco3 changes

Closes IDF-12880 and IDF-9300

See merge request espressif/esp-idf!40026
2025-07-02 10:57:09 +08:00
Zhang Shu Xian
dc51f79036 Merge branch 'docs/update_trans_for_migration_guides' into 'master'
docs: Provide translation for toolchain

Closes DOC-11604

See merge request espressif/esp-idf!40219
2025-07-02 10:51:50 +08:00
Laukik Hase
15a4d63441 ci(hal): Add HAL/LL-based test app for the TEE and APM peripherals 2025-07-01 17:27:46 +05:30
Laukik Hase
d8601f8245 feat(hal): Add CPU_APM support for ESP32-C61 2025-07-01 17:27:45 +05:30
Sonika Rathi
37733a877c Merge branch 'fix/sdspi_cmd52_error' into 'master'
fix(sdmmc): fix sdmmc initialization issue caused by CMD52 CRC error

See merge request espressif/esp-idf!40111
2025-07-01 19:35:48 +08:00
xiongweichao
c2d666a6d9 fix(ble): keep the log of the bluetooth sleep clock source consistent 2025-07-01 19:17:20 +08:00
Wu Zheng Hui
450baac52d Merge branch 'feat/support_esp32h4_pmu' into 'master'
feat(esp_hw_support): add esp32h4 pmu initial support

Closes PM-447

See merge request espressif/esp-idf!39867
2025-07-01 17:14:11 +08:00
chenjianhua
ad71a2cd33 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(2edb0b0)
- Fixed TX issue when the event is aborted
- Fixed BLE assert llc_llcp.c 487
- Fixed BLE assert sch_prog.c 304
- Fixed anonymous extended adv reporting
- Support vendor HCI related params reset
2025-07-01 16:18:09 +08:00
C.S.M
5aa9d6aeb8 Merge branch 'fix/make_nack_log_debug_lvl' into 'master'
fix(i2c): Make i2c nack log as debug level

See merge request espressif/esp-idf!40221
2025-07-01 15:35:16 +08:00
Adam Múdry
a9c5a2ae4a Merge branch 'feat/perf_benchmark_support_esp32p4' into 'master'
feat(storage): Update emmc and perf_benchmark example to work with ESP32-P4, fix SDMMC slot deinit bug in legacy driver

Closes IDF-13394 and IDF-13483

See merge request espressif/esp-idf!39826
2025-07-01 08:59:53 +02:00
Zhang Shuxian
7462166a8d docs: Provide translation for toolchain 2025-07-01 14:23:00 +08:00
Harshal Patil
78faa2535c Merge branch 'feat/support_key_manager_esp32c5' into 'master'
Support key manager esp32c5

Closes IDF-12626, IDF-12628, IDF-12629, IDF-8621, IDF-9007, IDF-12855, IDF-9070, IDF-7902, and IDF-7548

See merge request espressif/esp-idf!38894
2025-07-01 11:36:19 +05:30
Mahavir Jain
5aff8a9d11 Merge branch 'bugfix/ota_failing_for_aws_signed_url_with_partial_download_enabled' into 'master'
fix(esp_http_client): Fix OTA failure with partial download enabled

Closes IDF-12590

See merge request espressif/esp-idf!37843
2025-07-01 09:39:52 +05:30
Song Ruo Jing
dc527fbad2 Merge branch 'bugfix/uart_release_pin' into 'master'
fix(uart): fix release pin logic if switching only specific pins

See merge request espressif/esp-idf!40199
2025-07-01 11:22:56 +08:00
Zhou Xiao
cbe6f68d3c fix(ble): ensure ble controller disable safety for ESP32-C2 2025-07-01 10:45:36 +08:00
wuzhenghui
971787f0cb feat(esp_hw_support): add esp32h4 pmu initial support 2025-07-01 10:40:20 +08:00
Shu Chen
e5d11d11f9 Merge branch 'fix_br_selfhosted_address' into 'master'
feat(openthread): move mesh local address judeging function to public

See merge request espressif/esp-idf!40229
2025-07-01 02:28:22 +00:00
zwl
7b1a7cc4c3 fix(ble): fixed occasional assert triggered during controller disable on ESP32-C2 2025-07-01 10:17:28 +08:00
Xu Si Yu
611176d857 Merge branch 'feat/rcp_over_usb' into 'master'
feat(openthread): support rcp based on USB Serial JTAG

See merge request espressif/esp-idf!40189
2025-07-01 10:09:52 +08:00
zwl
6fac09d0c3 change(ble): [AUTO_MR] Update lib_esp32c2 to 9af627ef 2025-06-30 21:43:42 +08:00
zwl
736cd84967 change(ble): [AUTO_MR] Update lib_esp32c6 to d2d70d40 2025-06-30 21:43:42 +08:00
zwl
8d55aca9e7 change(ble): [AUTO_MR] Update lib_esp32c5 to d2d70d40 2025-06-30 21:43:41 +08:00
zwl
1671932345 change(ble): [AUTO_MR] Update lib_esp32h2 to d2d70d40 2025-06-30 21:43:41 +08:00
Chen Dejin
4aa70712fa fix(openthread/discovery): use mesh local for self-hosted service if OMR is not preferred
* esp-openthread: thread_zigbee/esp-openthread@f54481eb0
* openthread: espressif/openthread@b945928d7
* esp-idf: espressif/esp-idf@2bca368b1
2025-06-30 12:13:19 +00:00
Simonas Kazlauskas
51bcec7ac6 feat(openthread): support rcp based on USB Serial JTAG 2025-06-30 20:12:49 +08:00
morris
76cec451ce Merge branch 'fix/twai_fix_clock_sel_and_c5_errata' into 'master'
fix(driver_twai): fixed clock sel and c5 listen only mode errata

Closes IDF-13144 and IDF-13059

See merge request espressif/esp-idf!40057
2025-06-30 19:42:52 +08:00
wanckl
c6e18383b7 feat(driver_spi): c61 eco3 support master rx sample phase config 2025-06-30 19:32:11 +08:00
wanckl
a48afb4711 fix(driver_spi): fixed c5/c61/h21 eco spi master rx and slave rx issue 2025-06-30 19:31:17 +08:00
Aditya Patwardhan
9f5c9c7ef6 Merge branch 'feat/adding_hidden_config_for_dynamic_buffer_control_configuration' into 'master'
feat(esp_tls): Added hidden config in esp-tls for dynamic buffer strategy configuration

See merge request espressif/esp-idf!40172
2025-06-30 16:26:03 +05:30
chendejin
2bca368b1e feat(openthread): move mesh local address judeging function to public 2025-06-30 17:25:13 +08:00
Roman Leonov
7fbe72ca27 refactor(usb_host_example): Added opening only for device with proto 2025-06-30 11:19:42 +02:00
Song Ruo Jing
74c36f7660 Merge branch 'feature/esp32h4_regi2c_support' into 'master'
feat(regi2c): add regi2c support for esp32h4

Closes IDF-12315

See merge request espressif/esp-idf!39966
2025-06-30 16:22:58 +08:00
Ashish Sharma
0fa17c40a6 docs(system/esp_https_ota): adds ECIES-256 to pre-enc ota design doc 2025-06-30 16:04:45 +08:00
Armando (Dou Yiwen)
a08dff3a5e Merge branch 'change/h21_cache_reg_update' into 'master'
cache: updated cache registers for h21

See merge request espressif/esp-idf!40186
2025-06-30 08:01:57 +00:00
C.S.M
94765b5b7f Merge branch 'contrib/github_pr_16211' into 'master'
fix(temperature_sensor): remove spurious printf (GitHub PR)

Closes IDFGH-15581

See merge request espressif/esp-idf!40218
2025-06-30 15:19:13 +08:00
Mahavir Jain
a1b9581a7a Merge branch 'contrib/github_pr_16204' into 'master'
docs(esp_http_client): fix chunky function name (GitHub PR)

Closes IDFGH-15575

See merge request espressif/esp-idf!40212
2025-06-30 12:19:00 +05:30
C.S.M
6c2266473c fix(i2c): Make i2c nack log as debug level 2025-06-30 14:48:58 +08:00
C.S.M
c7b069781d Merge branch 'bugfix/fix_io_mux_reg_c61' into 'master'
fix(io_mux): Fix io_mux register on c61

See merge request espressif/esp-idf!40191
2025-06-30 14:26:40 +08:00
nilesh.kale
caf828dfaf fix(esp_http_client): Fix OTA failure with partial download enabled
This commit fixes an issue encountered during OTA when partial download
is enabled using an AWS signed URL restricted to GET requests.
It also adds an API to retrieve the OTA image size from the Content-Range header.
2025-06-30 11:18:26 +05:30
nilesh.kale
3e46a73964 fix(esp_https_ota): Check and handle missing image length in OTA HTTP response 2025-06-30 11:13:27 +05:30
Mahavir Jain
1f4612ec7a Merge branch 'feat/support_cross_signed_root_certs' into 'master'
feat(esp_crt): adds support for cross signed root certificates

Closes IDF-13364

See merge request espressif/esp-idf!39797
2025-06-30 10:15:54 +05:30
hrushikesh.bhosale
9c151bcd01 feat(esp_tls): Added hidden config in esp-tls for dynamic buffer strategy configuration
Added the hidden config in the esp-tls component for the dynamic buffer
strategy configuration feature. So that external components like ota
can findout whether this feature is supported or not
2025-06-28 13:17:47 +05:30
Chris Wedgwood
eda25c2ebb fix(temperature_sensor): remove spurious printf
remove accidentally included debugging
2025-06-27 23:27:27 -07:00
Richard Allen
561b325a0d docs(esp_http_client): fix chunky function name 2025-06-27 14:55:55 -05:00
wanckl
af6f1dcaaa fix(driver_twai): fixed clock source enable/disable 2025-06-27 22:08:24 +08:00
wanckl
e6fcaf4e34 fix(driver_twai): fixed c5 listenonly mode errata, add rx buffer check 2025-06-27 22:08:21 +08:00
Song Ruo Jing
ec358cfd7c fix(light_sleep/example): fix potential compilation error in light_sleep example
If ESP_CONSOLE_NONE is selected in menuconfig, compilation fails with
undefined CONFIG_ESP_CONSOLE_UART_BAUDRATE macro.
2025-06-27 21:53:54 +08:00
Song Ruo Jing
85f0da63fc fix(uart): fix release pin logic if switching only one pin 2025-06-27 21:53:54 +08:00
Laukik Hase
7f7d0afe40 Merge branch 'fix/esp_tee_coverity_issues' into 'master'
fix(esp_tee): Fix coverity issue from the `attestation` component

Closes IDF-12867

See merge request espressif/esp-idf!40054
2025-06-27 18:24:24 +05:30
wuzhenghui
f5cd1d848a fix(esp_system): LOGD for the log printing in sleep process 2025-06-27 20:53:23 +08:00
wuzhenghui
5436d1f0c4 fix(esp_system): force enable uart0 sclk in esp_restart 2025-06-27 20:04:13 +08:00
Rocha Euripedes
01e990e166 Merge branch 'mqtt_event_suback_reason_code' into 'master'
feat(mqtt): Add reason code to SUBSCRIBED event in examples

Closes IDF-6430

See merge request espressif/esp-idf!39970
2025-06-27 18:08:05 +08:00
harshal.patil
bba1448128 feat(esp_key_mgr): Support PSRAM XTS-AES key deployments using Key Manager 2025-06-27 15:15:26 +05:30
harshal.patil
ffefa9902d test(mbedtls): Extend the mbedtls ecdsa tests 2025-06-27 15:15:26 +05:30
harshal.patil
eb7c5654f6 test(esp_security): Extend the key manager tests 2025-06-27 15:15:26 +05:30
harshal.patil
ea322ee6ef test(hal/crypto): Add HMAC and DS using Key Manager key tests
- Also updated the test app to use esp_crypto_periph_clk.h
2025-06-27 15:15:26 +05:30
harshal.patil
6ca4d621b5 test(crypto): Change partition address and update the test cases
- Also format key manager test cases generation script
2025-06-27 15:15:26 +05:30
harshal.patil
50c41c3b59 change(esp_key_mgr): Refactor Key Manager driver to reduce logs 2025-06-27 15:15:26 +05:30
harshal.patil
a7af364112 fix(esp_security): Power up MPI memory registers when enabling MPI
Co-authored-by: Li HongXi <lihongxi@espressif.com>
2025-06-27 15:15:26 +05:30
harshal.patil
33d8c05d95 feat(esp_key_mgr): Support Digital Signature key deployments using Key Manager 2025-06-27 15:15:26 +05:30
harshal.patil
265b0d7579 feat(esp_key_mgr): Support HMAC key deployments using Key Manager 2025-06-27 15:15:26 +05:30
harshal.patil
8ab6b4d694 fix(esp_security/esp_key_mgr): Recharge HUK before the first usage 2025-06-27 15:15:26 +05:30
harshal.patil
a7c7b75dfd feat(soc): Update ESP32-C5's key manager reg and struct files to ECO2
- Also added a new soc_cap to denote if key manager key deployment is available
2025-06-27 15:15:26 +05:30
Aditya Patwardhan
662d793f37 feat(esp_security): Added support for key manager for esp32c5 2025-06-27 15:15:26 +05:30
Song Ruo Jing
cde716e093 feat(regi2c): add regi2c support for esp32h4 2025-06-27 17:18:33 +08:00
wuzhenghui
ed12f896f9 feat(doc): add migration-guides for esp_sleep_get_wakeup_causes 2025-06-27 16:18:14 +08:00
wuzhenghui
879713d589 change(esp_hw_support): deprecate esp_sleep_get_wakeup_cause with esp_sleep_get_wakeup_causes 2025-06-27 16:18:10 +08:00
C.S.M
ce75f77d7f fix(io_mux): Fix io_mux register on c61 2025-06-27 16:12:20 +08:00
wuzhenghui
5ba8b5e3dc feat(esp_hw_support): add new API to get all wakeup sources 2025-06-27 14:07:02 +08:00
Xu Si Yu
5103944449 feat(openthread): disable esp32c61 support for ot_br example 2025-06-27 14:05:18 +08:00
yinqingzhao
c1c78f5838 feat(wifi): add esp32c61 eco3 wifi support 2025-06-27 14:04:55 +08:00
yinqingzhao
f336022a94 feat(phy): update libphy for esp32c61 support 2025-06-27 14:00:21 +08:00
Li Shuai
8205a4808b change(esp_phy): update phy retention context for esp32c61 2025-06-27 14:00:07 +08:00
wuzhenghui
bc5bef5556 feat(esp_hw_support): fix some issues and update esp32c61 eco3 sleep features 2025-06-27 13:59:53 +08:00
wuzhenghui
8bd81b2bfd feat(esp_hw_support): update pmu sleep parameters and register header and structure file for esp32c61 2025-06-27 13:59:43 +08:00
wuzhenghui
0a25960783 feat(soc): update modem syscon and lpcon register header and structure file for esp32c61 2025-06-27 13:59:35 +08:00
Jiang Jiang Jian
7e570d246c Merge branch 'bugfix/add_the_cve_2025_52471_to_list' into 'master'
fix(wifi): Added CVE-2025-52471 to vulnerabilities list

See merge request espressif/esp-idf!39979
2025-06-27 12:34:00 +08:00
Island
dad2c53347 Merge branch 'change/ble_update_lib_20250613' into 'master'
change(ble): [AUTO_MR] 20250613 - Update ESP BLE Controller Lib

Closes BLERP-1992, BLERP-1988, BLERP-1902, BLERP-1977, BLERP-1993, BLERP-1995, and BLERP-1994

See merge request espressif/esp-idf!39872
2025-06-27 11:09:57 +08:00
Island
b0ad04b144 Merge branch 'fix/ensure_internal_mem_for_ble_log_spi_out' into 'master'
fix(ble): ensure internal malloc in ble log spi out

Closes BLERP-2025

See merge request espressif/esp-idf!40167
2025-06-27 10:44:50 +08:00
armando
15331216d5 change(cache): updated cache registers 2025-06-27 10:34:22 +08:00
zhangyanjiao
8c8eced34a fix(wifi): Added CVE-2025-52471 to vulnerabilities list 2025-06-27 09:51:12 +08:00
Omar Chebib
f496b43943 Merge branch 'bugfix/task_wdt_not_checking_ret' into 'master'
fix(esp_system): task wdt now checks the interrupt allocator return value

Closes IDF-13478

See merge request espressif/esp-idf!40155
2025-06-27 09:42:51 +08:00
Jiang Jiang Jian
dce4ca71cb Merge branch 'bugfix/fix_the_mesh_crash_issue_when_changing_authmode' into 'master'
fix(wifi/mesh): fixed the mesh crash issue when changing mesh AP's authmode

Closes WIFIBUG-1274 and IDFGH-15387

See merge request espressif/esp-idf!40165
2025-06-27 00:19:12 +08:00
David Čermák
84b969ecea Merge branch 'feat/menuconfig_for_rio_enable' into 'master'
feat(lwip/config): add menuconfig option to enable ND6 RIO support and set the RIO cache size

Closes IDFGH-13888

See merge request espressif/esp-idf!39488
2025-06-26 22:13:57 +08:00
Adam Múdry
20313f82e6 feat(storage): Update emmc and perf_benchmark example to work with ESP32-P4 2025-06-26 14:00:23 +02:00
Adam Múdry
7154cd3173 feat(sdmmc): Add ESP32-P4 eMMC test board definition 2025-06-26 14:00:22 +02:00
Adam Múdry
1ab7235b9e fix(sdmmc): Legacy driver slot deinit set NULL after free 2025-06-26 14:00:22 +02:00
glmfe
23572e043e fix(tcp_transport): off-by-one buffer corruption when WS header buffer full
- Fix out of boundaries access
 - Improve test cases to cover this issue
2025-06-26 08:05:46 -03:00
Gao Xu
7aca624322 Merge branch 'fix/fix_adc_cali_second_step_error' into 'master'
fix(adc): fix ESP32-C5 adc calibration error

See merge request espressif/esp-idf!40107
2025-06-26 17:41:57 +08:00
Tomas Rezucha
1bbf04cb4c Merge branch 'refactor/remove_old_usb_pins' into 'master'
refactor(usb): Remove deprecated USB pin definitions

Closes IDF-9029

See merge request espressif/esp-idf!40144
2025-06-26 11:22:01 +02:00
Lv Xin Yue
d846ca2ee6 Merge branch 'docs/update_deep_sleep_stub' into 'master'
fix(docs): Add time measuring methods

Closes DOC-4733

See merge request espressif/esp-idf!40004
2025-06-26 17:11:13 +08:00
Zhou Xiao
d300617aa6 fix(ble): ensure internal malloc in ble log spi out 2025-06-26 16:11:16 +08:00
Ashish Sharma
cabb5009f2 feat(esp_crt): adds support for cross signed root certificates 2025-06-26 16:01:11 +08:00
zhangyanjiao
8ed26569d1 fix(wifi/mesh): fixed the mesh crash issue when changing mesh AP's authmode
fix(wifi/mesh): fixed the esp_mesh_scan_get_ap_record() error in chain toplogy
Closes https://github.com/espressif/esp-idf/issues/16041
2025-06-26 14:55:14 +08:00
cjin
e44f1373a0 feat(ble): add sm count reserve cnt setting on ESP32-H2 2025-06-26 14:54:53 +08:00
cjin
ab92fef5be feat(ble): add sm count reserve cnt setting on ESP32-C6 and ESP32-C61 2025-06-26 14:54:53 +08:00
cjin
3d96faae5d feat(ble): add sm count reserve cnt setting on ESP32-C5 2025-06-26 14:54:53 +08:00
Lv Xin Yue
ee4026b355 fix(docs): Add time measuring methods 2025-06-26 14:18:49 +08:00
Rahul Tank
e8d24d0525 fix(nimble): Add missing ble_hs_unlock() call 2025-06-26 10:35:34 +05:30
Jiang Jiang Jian
7f325d47bf Merge branch 'bugfix/ignore_duplicated_offchan_error' into 'master'
fix(wifi): ignore duplicated offchan error, add coex wifi event imm

Closes TZ-1846, WIFIBUG-1279, WIFIBUG-1276, WIFIBUG-1283, WIFIBUG-1273, and WIFIBUG-1278

See merge request espressif/esp-idf!40062
2025-06-26 12:09:37 +08:00
Omar Chebib
20da6a9a5c fix(esp_system): task wdt now checks the interrupt allocator return value 2025-06-26 11:38:38 +08:00
morris
95b303cd8a Merge branch 'test/twai_new_driver_add_interactive_test' into 'master'
test(driver_twai): new driver add interctive test

See merge request espressif/esp-idf!39043
2025-06-26 11:27:30 +08:00
Armando (Dou Yiwen)
33821d1799 Merge branch 'change/remove_mmap_paddr_remap_warning_log' into 'master'
mmu: remove paddr remap warning log

See merge request espressif/esp-idf!40123
2025-06-26 03:18:29 +00:00
Alexey Lapshin
0223bfe530 Merge branch 'feature/update-toolchain-to-esp-15.1.0_20250607' into 'master'
feat(tools): update toolchain version to esp-15.1.0_20250607

See merge request espressif/esp-idf!39728
2025-06-26 06:32:54 +04:00
Shu Chen
c976203214 Merge branch 'feat/call_meshcop_mdns_publish_in_idf' into 'master'
Handle MeshCoP mDNS service in state change callback, update OpenThread upstream

See merge request espressif/esp-idf!39517
2025-06-26 01:45:21 +00:00
Wei Yu Han
7ee40d6640 Merge branch 'docs/update_ble_feature_status_latest' into 'master'
Updated BLE feature status

See merge request espressif/esp-idf!38980
2025-06-26 09:11:12 +08:00
Tomas Rezucha
65ac3f6f80 refactor(usb): Remove deprecated USB pin definitions
When connecting USB OTG to an external FSLS PHY,
the FSLS Serial Interface signals can be routed to any GPIO via the GPIO
matrix. Thus, these macros are meaningless.
2025-06-25 14:44:36 +02:00
Peter Marcisovsky
e744fc737b Merge branch 'refactor/usb_host_types_ch9' into 'master'
refactor(usb_host): IDF 6.0 breaking change: remove val types from USB Host stack

Closes IDF-9886

See merge request espressif/esp-idf!39773
2025-06-25 14:35:07 +02:00
Roland Dobai
214f86803d Merge branch 'doc/update-guide' into 'master'
docs: how to update ESP-IDF env without updating ESP-IDF itself

Closes IDFGH-15431 and DOC-11528

See merge request espressif/esp-idf!39761
2025-06-25 13:59:51 +02:00
wanckl
69f258b02f test(driver_twai): new driver add interctive test 2025-06-25 19:37:28 +08:00
Wu Zheng Hui
01753bfc04 Merge branch 'feat/support_esp32h4_pau' into 'master'
feat(esp_hw_support): add esp32h4 PAU initial support

Closes PM-444

See merge request espressif/esp-idf!39951
2025-06-25 19:27:24 +08:00
Xu Si Yu
96fb64d055 feat(openthread): update border router lib
* esp-openthread: thread_zigbee/esp-openthread@16bfed5ec
* openthread: espressif/openthread@b945928d7
* esp-idf: espressif/esp-idf@3ff78443f
2025-06-25 11:21:01 +00:00
Chen Ji Chang
0972e9d274 Merge branch 'refactor/remove_legacy_mcpwm_driver' into 'master'
remove(legacy_mcpwm)!: remove legacy mcpwm driver in IDF v6.0

Closes IDF-13173 and IDF-13352

See merge request espressif/esp-idf!39743
2025-06-25 19:17:16 +08:00
Xu Si Yu
3ff78443ff feat(openthread): update openthread upstream 2025-06-25 19:12:39 +08:00
Xu Si Yu
6e408155dc feat(openthread): handle MeshCoP mDNS service in state change callback 2025-06-25 19:12:39 +08:00
liuning
43e21a032f fix(wifi): fix duplicated offchan error, add coex wifi event imm
Closes https://github.com/espressif/esp-idf/issues/16183
2025-06-25 19:08:15 +08:00
Alexey Lapshin
0a07021989 fix(storage): fix std_filesystem test
it uses vfs_fat_truncate in resize_file
2025-06-25 18:01:50 +07:00
Alexey Lapshin
a3dfc82246 fix(build): add __attribute__((nonstring)) to nonsting variables 2025-06-25 18:01:50 +07:00
Alexey Lapshin
b65502f3f5 fix(bt): suppress -Wunterminated-string-initialization warning 2025-06-25 18:01:50 +07:00
Alexey Lapshin
243c587b70 fix(heap): avoid malloc calls optimization
GCC defines that malloc(0) returns a non-null pointer (glibc behavior).
This can break logic for some cases, because our implementation of
malloc(0) returns null pointer.
POSIX and the ISO C standard allow both behaviors.
2025-06-25 18:01:50 +07:00
Alexey Lapshin
2ff8f765ab fix(esp_wifi): fix test app diff threshold 2025-06-25 18:01:50 +07:00
Alexey Lapshin
2279047883 fix(panic): fix reset checking in panic tests 2025-06-25 18:01:50 +07:00
Alexey Lapshin
e89241586d test(ci): increase timeout for iperf expect 2025-06-25 18:01:50 +07:00
Alexey Lapshin
0f2e45c1ad feat(newlib): add dummy implementations for statvfs/fstatvfs 2025-06-25 18:01:50 +07:00
Alexey Lapshin
fdb4212f7d fix(soc): fix stddef.h missed include in pmu_struct.h headers 2025-06-25 18:01:50 +07:00
Alexey Lapshin
4b4ad77483 fix(esp_rom): fix esp32h21 syscall_stub_table structure 2025-06-25 18:01:50 +07:00
Alexey Lapshin
e521d37f6f feat(cxx): run c++ tests for esp32c61 and esp32p4 2025-06-25 18:01:50 +07:00
Alexey Lapshin
e82d51a9ee fix(picolibc): fix missed headers in sources 2025-06-25 18:01:50 +07:00
Alexey Lapshin
b6cfb7ecf6 fix(build): ensure zero-init of padding bits with GCC 15+
GCC 15 introduces a regression in guaranteed zero-initialization of
padding bits. The suggested solution is to add the
-fzero-init-padding-bits=unions compile option.

To prevent similar issues in the future, this change adds the
-fzero-init-padding-bits=all build option. It ensures that padding bits
in unions and structs are properly zeroed, avoiding regressions.
2025-06-25 18:01:50 +07:00
Alexey Lapshin
8384f4dffd fix(panic_test): avoid linker check on dangerous relocations
xtensa linker throws warning
dangerous relocation: windowed longcall crosses 1GB boundary; return may fail

create separate function to call function by pointer to avoid warnings
2025-06-25 18:01:50 +07:00
Alexey Lapshin
e28af6a002 fix(newlib): use optimized misalign access functions from libc.a 2025-06-25 18:01:50 +07:00
Alexey Lapshin
0be466755b feat(build): add CONFIG_COMPILER_DISABLE_GCC15_WARNINGS and toolchain migration-guide 2025-06-25 18:01:47 +07:00
Alexey Lapshin
74e26f8d29 fix(mbedtls): suppress -Wunterminated-string-initialization 2025-06-25 18:00:39 +07:00
Alexey Lapshin
1a464c0914 fix(esp_system): suppress -Wanalyzer-infinite-loop warning 2025-06-25 18:00:39 +07:00
Alexey Lapshin
86ca6ef829 fix(build): fix -Wanalyzer-undefined-behavior-ptrdiff warnings 2025-06-25 18:00:39 +07:00
Alexey Lapshin
2f9a46a665 feat(build): refactor toolchain cmakes and update riscv extensions 2025-06-25 18:00:39 +07:00
Alexey Lapshin
c25dcf284a fix(log): fix string size to include NUL 2025-06-25 18:00:39 +07:00
Alexey Lapshin
f143070235 feat(tools): update toolchain version to esp-15.1.0_20250607 2025-06-25 18:00:39 +07:00
cjin
e4238a4999 change(ble): update lib_esp32c6 and esp32c61 to ea6c58c7 2025-06-25 18:11:18 +08:00
cjin
aa95e30435 change(ble): update lib_esp32h2 to ea6c58c7 2025-06-25 18:11:18 +08:00
cjin
0c3a5db115 change(ble): update lib_esp32c5 to ea6c58c7 2025-06-25 18:11:18 +08:00
Zhou Xiao
c05688fe6b change(ble): [AUTO_MR] Update lib_esp32c2 to e865b4f9 2025-06-25 18:11:18 +08:00
Zhou Xiao
2076e4411c change(ble): [AUTO_MR] Update lib_esp32c6 to b8770ab2 2025-06-25 18:11:18 +08:00
Zhou Xiao
0d7c254bd3 change(ble): [AUTO_MR] Update lib_esp32c5 to b8770ab2 2025-06-25 18:11:18 +08:00
Zhou Xiao
3b66fc2465 change(ble): [AUTO_MR] Update lib_esp32h2 to b8770ab2 2025-06-25 18:11:18 +08:00
armando
432791f756 change(mmu): remove paddr remap warning log 2025-06-25 17:37:44 +08:00
Armando (Dou Yiwen)
5808358c3f Merge branch 'fix/change_log_level_from_w_to_d' into 'master'
psram: change logw to logd

See merge request espressif/esp-idf!40125
2025-06-25 09:27:41 +00:00
Wei Yuhan
b1bbf68bb5 Update BLE feature suppport status 2025-06-25 17:26:00 +08:00
Jiang Jiang Jian
fd030735a1 Merge branch 'ci/revert-submodule-cache-changes' into 'master'
Revert "ci: replace ci_fetch_submodules.py with submodule cache"

See merge request espressif/esp-idf!40135
2025-06-25 17:21:03 +08:00
Chen Jichang
4d1a4dfcbe feat(mcpwm): add a new api to get cap value directly 2025-06-25 15:49:07 +08:00
Island
09046275fd Merge branch 'bugfix/fix_some_ble_build_fail' into 'master'
fix(ble/bluedroid): fix build failure when some BLE features are disabled

Closes BLERP-2027

See merge request espressif/esp-idf!40109
2025-06-25 15:26:11 +08:00
armando
73113c0ce8 change(psram): change logw to logd 2025-06-25 06:45:33 +00:00
Fu Hanxi
4d7372beab Revert "ci: replace ci_fetch_submodules.py with submodule cache"
This reverts commit 0af3e2b1b2.
2025-06-25 08:01:06 +02:00
gaoxu
c602e556ef fix(adc): fix ESP32-C5 adc calibration error 2025-06-25 03:25:36 +00:00
Armando (Dou Yiwen)
ed32a3aaef Merge branch 'bugfix/fix_dvp_recv_trans_buf_error' into 'master'
fix(esp_driver_cam): Fix DVP get trans buffer error

Closes IDF-13461

See merge request espressif/esp-idf!40087
2025-06-25 03:00:03 +00:00
Michael (XIAO Xufeng)
d5b4654039 Merge branch 'bugfix/esp_flash_escape_checking' into 'master'
fix(esp_flash): fixed issue of escaping boundary check

See merge request espressif/esp-idf!36128
2025-06-25 01:23:26 +08:00
zhanghaipeng
a29cd4ad5f fix(ble/bluedroid): fix build failure when some BLE features are disabled 2025-06-24 20:26:43 +08:00
sonika.rathi
c4a3c1fc5b fix(sdmmc): fix sdmmc initialization issue in caused by CMD52 CRC error 2025-06-24 13:48:38 +02:00
Fu Hanxi
cf78d0a7ff Merge branch 'ci/fix-submodule-cache' into 'master'
ci: remove cached submodule metadata while checking with github

See merge request espressif/esp-idf!40081
2025-06-24 11:22:52 +02:00
Fu Hanxi
fcca033ff6 Merge branch 'ci/raise_macos_cache_to_50g' into 'master'
macOS runners - set CCACHE back to 50GB to help VMs

See merge request espressif/esp-idf!39950
2025-06-24 11:10:19 +02:00
Fu Hanxi
7c1eacb599 Merge branch 'ci/temp-disable-macos-test' into 'master'
ci: temp disable macos, only trigger by labels and run on master

See merge request espressif/esp-idf!40064
2025-06-24 10:19:18 +02:00
Li Peng
800a170e8a Merge branch 'feat/add_sdio_slave_reset_hardware_support' into 'master'
add sdio_slave_reset_hw

See merge request espressif/esp-idf!39686
2025-06-24 16:10:17 +08:00
Dong Heng
47721a5803 fix(esp_driver_cam): Fix DVP get trans buffer error 2025-06-24 16:09:14 +08:00
Fu Hanxi
d795ecf393 ci: temp disable macos, only trigger by labels and run on master 2025-06-24 09:48:08 +02:00
Xiao Xufeng
83ca12c8e0 fix(esp_flash): fixed issue of escaping boundary check
Also patched corresponding ROM functions
2025-06-24 15:30:11 +08:00
Jiang Jiang Jian
1b130f5061 Merge branch 'bugfix/connect_before_connected' into 'master'
fix(conn): wifi connect before connected status

See merge request espressif/esp-idf!39882
2025-06-24 15:23:56 +08:00
Jiang Jiang Jian
ac5fe121e3 Merge branch 'bugfix/fix_compatibility_issues_of_esp32c5' into 'master'
bugfix/fix compatibility issues of esp32c5

Closes WIFIBUG-1250, WIFIBUG-1238, and WIFIBUG-1225

See merge request espressif/esp-idf!40027
2025-06-24 15:20:04 +08:00
Fu Hanxi
aed61ed207 ci: remove cached submodule metadata while checking with github 2025-06-24 09:09:07 +02:00
Gao Xu
c59b42ca9e Merge branch 'fix/fix_h4_wrong_spinlock' into 'master'
fix(esp_system): fix wrong spinlock num on H4

See merge request espressif/esp-idf!39924
2025-06-24 10:50:29 +08:00
Chen Jichang
a2ef01fc5b remove(legacy_mcpwm): remove legacy mcpwm driver in IDF v6.0 2025-06-24 10:49:37 +08:00
C.S.M
a2b98b31a9 Merge branch 'fix/tsens_value_inaccurate' into 'master'
fix(temperature_sensor): Fix temperature sensor value accurency in high range variation

See merge request espressif/esp-idf!39896
2025-06-24 10:28:23 +08:00
Konstantin Kondrashov
ff53d5d32c Merge branch 'feature/iram_esp_system' into 'master'
feat(esp_system): Adds Kconfigs to place code in IRAM

Closes IDF-11426

See merge request espressif/esp-idf!38292
2025-06-24 05:46:09 +08:00
Michael (XIAO Xufeng)
fa41e76349 Merge branch 'feature/support_chip912_pvt_auto_dbias_360m' into 'master'
feat(p4): support chip912 pvt auto dbias 360m

Closes PM-357, PM-355, and IDF-8142

See merge request espressif/esp-idf!36615
2025-06-24 01:52:01 +08:00
Fu Hanxi
561f53cd24 Merge branch 'ci/remove-submodule-fetch-script' into 'master'
Ci/remove submodule fetch script

Closes IDFCI-2980

See merge request espressif/esp-idf!39992
2025-06-23 19:22:19 +02:00
morris
d8fa822ad7 Merge branch 'fix/spi_master_p4_change_default_clk_pll' into 'master'
fix(driver_spi): master driver change esp32p4 default src to pll

Closes IDF-8313, IDF-13345, IDF-13346, and IDF-13347

See merge request espressif/esp-idf!39700
2025-06-23 22:57:03 +08:00
Zhang Shuxian
f699058964 docs: Update CN translation for tools setup 2025-06-23 12:48:39 +02:00
Jan Beran
19d370f594 docs: how to update ESP-IDF environment without updating ESP-IDF itself
Closes https://github.com/espressif/esp-idf/issues/16077
2025-06-23 12:47:59 +02:00
Kevin (Lao Kaiyao)
63304e2d61 Merge branch 'refactor/migrate_i2c_driver_in_es7210_example' into 'master'
refactor(i2s_es7210): refactor es7210 example

Closes IDF-10769 and IDF-13148

See merge request espressif/esp-idf!40058
2025-06-23 18:46:10 +08:00
Konstantin Kondrashov
ff0408c087 feat(esp_system): Adds Kconfigs to place code in IRAM 2025-06-23 13:23:33 +03:00
Rocha Euripedes
92fa23b136 Merge branch 'contrib/github_pr_14871' into 'master'
fix: fix build failure when project name is not mqtt_ssl (GitHub PR)

Closes IDFGH-14052

See merge request espressif/esp-idf!39963
2025-06-23 18:13:49 +08:00
Xu Si Yu
ba2b0fd4b7 Merge branch 'feat/optimize_ot_trel_receive' into 'master'
feat(openthread): optimize trel reception

See merge request espressif/esp-idf!39624
2025-06-23 17:59:27 +08:00
Fu Hanxi
0af3e2b1b2 ci: replace ci_fetch_submodules.py with submodule cache 2025-06-23 11:39:42 +02:00
laokaiyao
aad133a0d3 refactor(i2s_es7210): refactor es7210 example 2025-06-23 17:33:57 +08:00
Shu Chen
5590a741ee Merge branch 'feat/concat_otcommand_for_console' into 'master'
feat(openthread): support openthread cli console command register

See merge request espressif/esp-idf!39653
2025-06-23 09:32:28 +00:00
wanckl
768a7a8442 fix(driver_spi): master driver change esp32p4 default src to pll 2025-06-23 16:40:21 +08:00
Omar Chebib
e6e898e9de fix(esp_system): fix the usage conditions of os_spinlock 2025-06-23 16:24:52 +08:00
Xiao Xufeng
5aa1a5f6ab esp_system: increase bootloader partition size in examples using framepointer 2025-06-23 16:22:38 +08:00
Gao Xu
459b241f7b Merge branch 'feat/lcd_cam_dvp_driver_s3' into 'master'
DVP support and example for ESP32S3

Closes IDF-10475

See merge request espressif/esp-idf!39323
2025-06-23 15:55:02 +08:00
C.S.M
d6a3e73f46 fix(temperature_sensor): Fix temperature sensor value accurency in high range variation 2025-06-23 15:38:10 +08:00
LiPeng
1d1ba47a7a feat(sdio): add sdio_slave_reset_hw 2025-06-23 15:09:30 +08:00
Laukik Hase
9b1aaa2778 fix(esp_tee): Fix coverity issues from the attestation component
- Also fix the incorrect marker set for TEE OTA tests
2025-06-23 11:45:12 +05:30
Chen Ji Chang
ffebb32117 Merge branch 'feat/add_callback_to_switch_buffer_in_parlio_tx' into 'master'
feat(parlio_tx): support buffer switched callback

Closes IDF-12903

See merge request espressif/esp-idf!39692
2025-06-23 11:42:29 +08:00
gaoxu
b7d65d94c3 feat(lcd_cam): add lc_dma_int value atomic protect for lcd and cam 2025-06-23 10:58:38 +08:00
gaoxu
8008347a7c fix(cam): fix camera kconfig about dw_gdma 2025-06-23 10:58:26 +08:00
gaoxu
b43daa6bbf feat(cam): add dvp example for ESP32S3-EYE 2025-06-23 10:58:24 +08:00
gaoxu
638cde24d0 feat(cam): add esp32s3 dvp cam support 2025-06-23 10:55:26 +08:00
Island
d2b6f832f5 Merge branch 'bugfix/fixed_set_conn_mode_assert_on_esp32c2' into 'master'
fix(ble): fixed assertion issue in connection state on ESP32C2-ECO4

Closes BLERP-2011

See merge request espressif/esp-idf!40019
2025-06-23 10:24:38 +08:00
Wu Zheng Hui
bac996a766 Merge branch 'feat/support_low_power_mode_in_monitor_state' into 'master'
feat(esp_hw_support): support enable analog lowpower mode by API

Closes IDFGH-6208

See merge request espressif/esp-idf!38924
2025-06-23 09:40:56 +08:00
yanzihan@espressif.com
08eea3c058 feat(esp_hw_support): use pvt to auto control digital ldo and rtc ldo for esp32p4 2025-06-23 00:28:53 +08:00
Aditya Patwardhan
b971cf5bf9 Merge branch 'docs/fix_secure_download_mode_unsupported_esp32' into 'master'
fix(bootloader): Fix documentation as ESP32 does not support secure download mode

See merge request espressif/esp-idf!40005
2025-06-20 22:08:20 +05:30
Roland Dobai
16e8efa344 Merge branch 'feat/diag_port' into 'master'
feat(diag): pass serial port to esp-idf-diag

See merge request espressif/esp-idf!39813
2025-06-20 15:44:14 +02:00
wuzhenghui
d62930223e change(hal): simplify some enable/disable function in pau_ll 2025-06-20 20:11:55 +08:00
wuzhenghui
86ea927ef9 change(hal): avoid the read-modify-write for a WT register in pau_ll 2025-06-20 20:11:55 +08:00
wuzhenghui
4a887a7b5a change(hal): move regdma related API from lp_aon_ll to pau_ll 2025-06-20 20:11:54 +08:00
wuzhenghui
aeba99290f feat(hal): add esp32h4 PAU initial support 2025-06-20 20:11:54 +08:00
wuzhenghui
ee9c1aee81 feat(soc): add esp32h4 PAU initial support 2025-06-20 20:11:01 +08:00
Wu Zheng Hui
5d8e56b4c9 Merge branch 'feat/support_esp32h4_modem_clock' into 'master'
feat(esp_hw_support): add esp32h4 modem clock initial support

Closes PM-445

See merge request espressif/esp-idf!39948
2025-06-20 17:27:09 +08:00
yinqingzhao
ca49c095e0 feat(wifi): add support for country EU 2025-06-20 16:10:11 +08:00
yinqingzhao
ee25c757f2 fix(wifi): comment out some functions for esp32c5 2025-06-20 16:09:53 +08:00
zwl
83fd955f11 fix(ble): fixed assertion issue in connection state on ESP32C2-ECO4 2025-06-20 15:12:40 +08:00
Fu Hanxi
598f19ea0f ci: chore fixes 2025-06-20 08:47:36 +02:00
harshal.patil
8de2eb01da fix(bootlaoder): Fix documentation as ESP32 does not support secure download mode 2025-06-20 10:50:28 +05:30
Chen Jichang
05c2ebcf16 feat(parlio_tx): support buffer switched callback 2025-06-20 11:19:46 +08:00
Fu Hanxi
667ed2a266 ci: remove host_test runner tag, use more precise build, shiny instead 2025-06-19 15:34:07 +02:00
wuzhenghui
e55d6d8b3c feat(esp_hw_support): support enable analog lowpower mode by API
Closes https://github.com/espressif/esp-idf/issues/7882
2025-06-19 19:35:16 +08:00
zwx
526a6f37f9 feat(openthread): support openthread cli console command register 2025-06-19 19:28:48 +08:00
yinqingzhao
1331108ca6 feat(wifi): set phy pll track disable default 2025-06-19 12:11:16 +08:00
Zhangwx
cc312818c7 feat(phy): add a config for pll track feature 2025-06-19 12:11:12 +08:00
Xu Si Yu
92b84d61e8 feat(openthread): optimize trel reception 2025-06-19 11:10:52 +08:00
ding huan
a54abb147e fix(conn): wifi connect before connected status 2025-06-18 20:32:16 +08:00
Euripedes Rocha
63b91c0608 feat(mqtt): Add reason code to SUBSCRIBED event in examples 2025-06-18 14:19:46 +02:00
Euripedes Rocha
d50fbe77d4 fix(mqtt): Make example binary data consistent
Improves user experience when copying examples to use as starting point.
2025-06-18 09:59:17 +02:00
Hossein.M
cfadf71093 fix: fix build failure when project name is not mqtt_ssl
fixes: #14870

Closes https://github.com/espressif/esp-idf/pull/14871
2025-06-18 07:49:21 +00:00
Peter Macko
c2ff554878 ci: macOS runners - set CCACHE back to 50GB to help VMs 2025-06-18 08:17:00 +02:00
wuzhenghui
d876dae93c change(hal): rename xx_force_clock to xx_clock_force 2025-06-18 11:54:16 +08:00
wuzhenghui
d8acb7b656 change(hal): remove modem_lpcon_ll_get_date 2025-06-18 11:50:13 +08:00
wuzhenghui
c7f114e0a9 change(hal): add union enum type for modem peripheral 32k source selection 2025-06-18 11:48:48 +08:00
chendejin
271532bbf3 feat(lwip/config): add menuconfig to enable ND6 RIO support and set the cache size 2025-06-18 11:19:09 +08:00
wuzhenghui
78baff95ec feat(hal): add esp32h4 modem_clock hal layer 2025-06-17 21:56:11 +08:00
wuzhenghui
dd9613bed0 feat(soc): update esp32h4 mdoem soc headers 2025-06-17 21:56:07 +08:00
Frantisek Hrbata
ef9e76236d fix(diag): ruff-format fixes from pre-commit
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-11 16:55:13 +02:00
Frantisek Hrbata
b2da8aae45 feat(diag): pass serial port to esp-idf-diag
If a port is specified for the idf.py command, pass it to esp-idf-diag.
This ensures that the esptools used for gathering target information
connect to the explicitly specified port rather than relying on
autodetection.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2025-06-11 16:52:18 +02:00
peter.marcisovsky
8f3b01d158 refactor(usb_host): Remove val types from USB Host stack 2025-06-10 13:35:47 +02:00
muhaidong
ea5a9cc3c0 fix(wifi): fix pmksa cache expiration caused by sntp time synchronization issue 2025-06-06 15:42:07 +08:00
Richard Allen
65a1d79af2 fix(esp_http_client): fix spurious async open error
Fix esp_http_client_open() often triggering a
spurious HTTP_EVENT_ERROR when is_async=true.

Fixes https://github.com/espressif/esp-idf/issues/16075
2025-06-05 17:54:05 -05:00
Ashish Sharma
f3da3ef9d4 docs(protocols/esp-tls): adds doc for client session tickets 2025-05-29 17:57:40 +08:00
Ivan Grokhotkov
09bb3c4572 fix(toolchain): install qemu-xtensa if esp32s3 target is requested
Related to https://github.com/espressif/vscode-esp-idf-extension/issues/1404
2025-05-26 11:29:10 +02:00
Ivan Grokhotkov
806ee244c4 change(qemu_ext): ruff pre-commit fixes
Fixup of https://github.com/espressif/esp-idf/pull/15974
2025-05-26 11:27:29 +02:00
Rohan Fletcher
15e8d43468 fix(tools/idf-qemu): Add qemu_extra_args after monitor stdio -serial 2025-05-18 07:02:40 +12:00
8513 changed files with 1185733 additions and 355631 deletions

View File

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

View File

@@ -26,7 +26,7 @@ body:
id: chip_revision
attributes:
label: Espressif SoC revision.
description: On which Espressif SoC revision does your application run on? Run `esptool chip_id` to find it.
description: On which Espressif SoC revision does your application run on? Run `esptool chip-id` (or `esptool.py chip_id` for ESP-IDF v5.5 and older) to find it.
placeholder: ex. ESP32-C3 (QFN32) (revision v0.3)
validations:
required: true

View File

@@ -21,7 +21,7 @@ jobs:
# Disable the job in forks
if: ${{ github.repository_owner == 'espressif' }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04-X64-large
steps:
# Depending on the branch/tag, set CLONE_BRANCH_OR_TAG variable (used in the Dockerfile
# as a build arg) and TAG_NAME (used when tagging the image).

View File

@@ -14,10 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Sync issue comments to JIRA
uses: espressif/github-actions/sync_issues_to_jira@master
uses: espressif/sync-jira-actions@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: IDFGH
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
WEBHOOK_URL: ${{ secrets.JIRA_ISSUE_COMMENT_WEBHOOK_URL }}

View File

@@ -14,10 +14,11 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Sync GitHub issues to Jira project
uses: espressif/github-actions/sync_issues_to_jira@master
uses: espressif/sync-jira-actions@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JIRA_PASS: ${{ secrets.JIRA_PASS }}
JIRA_PROJECT: IDFGH
JIRA_URL: ${{ secrets.JIRA_URL }}
JIRA_USER: ${{ secrets.JIRA_USER }}
WEBHOOK_URL: ${{ secrets.JIRA_ISSUE_COMMENT_WEBHOOK_URL }}

View File

@@ -23,7 +23,7 @@ jobs:
- name: Set up Python environment
uses: actions/setup-python@master
with:
python-version: v3.8
python-version: "3.10"
- name: Install python packages
run: |
pip install pre-commit

View File

@@ -8,7 +8,7 @@ on:
jobs:
release_zips:
name: Create release zip file
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Create a recursive clone source zip
uses: espressif/release-zips-action@v1

4
.gitignore vendored
View File

@@ -66,8 +66,6 @@ build_summary_*.xml
coverage.info
coverage_report/
test_multi_heap_host
# VS Code Settings
.vscode/
@@ -100,7 +98,7 @@ managed_components
pytest-embedded/
# legacy one
pytest_embedded_log/
list_job*.txt
app_info_*.txt
size_info*.txt
XUNIT_RESULT*.xml
.manifest_sha

View File

@@ -3,33 +3,30 @@ workflow:
# Disable those non-protected push triggered pipelines
- 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"'
when: never
# when running merged result pipelines, CI_COMMIT_SHA represents the temp commit it created.
# Please use PIPELINE_COMMIT_SHA at all places that require a commit sha of the original commit.
- if: $CI_OPEN_MERGE_REQUESTS != null
# merged result pipelines
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
variables:
PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
IS_MR_PIPELINE: 1
- if: $CI_OPEN_MERGE_REQUESTS == null
# else
- if: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA == null || $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA == ""
variables:
PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA
IS_MR_PIPELINE: 0
- when: always
# Place the default settings in `.gitlab/ci/common.yml` instead
include:
- '.gitlab/ci/danger.yml'
- '.gitlab/ci/common.yml'
- '.gitlab/ci/rules.yml'
- '.gitlab/ci/upload_cache.yml'
- '.gitlab/ci/docs.yml'
- '.gitlab/ci/static-code-analysis.yml'
- '.gitlab/ci/pre_commit.yml'
- '.gitlab/ci/pre_check.yml'
- '.gitlab/ci/build.yml'
- '.gitlab/ci/integration_test.yml'
- '.gitlab/ci/host-test.yml'
- '.gitlab/ci/deploy.yml'
- '.gitlab/ci/post_deploy.yml'
- '.gitlab/ci/retry_failed_jobs.yml'
- '.gitlab/ci/test-win.yml'
- ".gitlab/ci/danger.yml"
- ".gitlab/ci/common.yml"
- ".gitlab/ci/rules.yml"
- ".gitlab/ci/upload_cache.yml"
- ".gitlab/ci/docs.yml"
- ".gitlab/ci/static-code-analysis.yml"
- ".gitlab/ci/pre_commit.yml"
- ".gitlab/ci/pre_check.yml"
- ".gitlab/ci/build.yml"
- ".gitlab/ci/integration_test.yml"
- ".gitlab/ci/host-test.yml"
- ".gitlab/ci/deploy.yml"
- ".gitlab/ci/post_deploy.yml"
- ".gitlab/ci/test-win.yml"

View File

@@ -51,8 +51,9 @@
/.github/workflows/ @esp-idf-codeowners/ci
/.gitlab-ci.yml @esp-idf-codeowners/ci
/.gitlab/ci/ @esp-idf-codeowners/ci
/.idf_build_apps.toml @esp-idf-codeowners/ci
/.idf_ci.toml @esp-idf-codeowners/ci
/.pre-commit-config.yaml @esp-idf-codeowners/ci
/.readthedocs.yml @esp-idf-codeowners/docs
/.vale.ini @esp-idf-codeowners/docs
/CMakeLists.txt @esp-idf-codeowners/build-config
/COMPATIBILITY*.md @esp-idf-codeowners/peripherals
@@ -84,6 +85,7 @@
/components/efuse/ @esp-idf-codeowners/system
/components/esp_adc/ @esp-idf-codeowners/peripherals
/components/esp_app_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/esp_blockdev/ @esp-idf-codeowners/storage
/components/esp_bootloader_format/ @esp-idf-codeowners/system @esp-idf-codeowners/app-utilities
/components/esp_coex/ @esp-idf-codeowners/wifi @esp-idf-codeowners/bluetooth @esp-idf-codeowners/ieee802154
/components/esp_common/ @esp-idf-codeowners/system
@@ -92,6 +94,7 @@
/components/esp_eth/ @esp-idf-codeowners/network
/components/esp_event/ @esp-idf-codeowners/system
/components/esp_gdbstub/ @esp-idf-codeowners/debugging
/components/esp_hal_*/ @esp-idf-codeowners/peripherals
/components/esp_hid/ @esp-idf-codeowners/bluetooth
/components/esp_http_client/ @esp-idf-codeowners/app-utilities
/components/esp_http_server/ @esp-idf-codeowners/app-utilities
@@ -99,7 +102,9 @@
/components/esp_https_server/ @esp-idf-codeowners/app-utilities
/components/esp_hw_support/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals
/components/esp_hw_support/lowpower/ @esp-idf-codeowners/power-management
/components/esp_hw_support/usb_phy/ @esp-idf-codeowners/peripherals/usb
/components/esp_lcd/ @esp-idf-codeowners/peripherals
/components/esp_libc/ @esp-idf-codeowners/system @esp-idf-codeowners/toolchain
/components/esp_local_ctrl/ @esp-idf-codeowners/app-utilities
/components/esp_mm/ @esp-idf-codeowners/peripherals
/components/esp_netif/ @esp-idf-codeowners/network
@@ -112,12 +117,13 @@
/components/esp_ringbuf/ @esp-idf-codeowners/system
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
/components/esp_security/ @esp-idf-codeowners/security
/components/esp_stdio/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
/components/esp_system/ @esp-idf-codeowners/system
/components/esp_tee/ @esp-idf-codeowners/security
/components/esp_timer/ @esp-idf-codeowners/system
/components/esp-tls/ @esp-idf-codeowners/app-utilities
/components/esp_vfs_*/ @esp-idf-codeowners/storage
/components/esp_vfs_console/ @esp-idf-codeowners/storage @esp-idf-codeowners/system
/components/esp_trace/ @esp-idf-codeowners/debugging
/components/esp_usb_cdc_rom_console/ @esp-idf-codeowners/system @esp-idf-codeowners/peripherals/usb
/components/esp_wifi/ @esp-idf-codeowners/wifi
/components/espcoredump/ @esp-idf-codeowners/debugging
/components/esptool_py/ @esp-idf-codeowners/tools
@@ -125,17 +131,16 @@
/components/freertos/ @esp-idf-codeowners/system
/components/hal/ @esp-idf-codeowners/peripherals
/components/hal/test_apps/crypto/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/security
/components/hal/test_apps/tee/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/security
/components/heap/ @esp-idf-codeowners/system
/components/http_parser/ @esp-idf-codeowners/app-utilities
/components/idf_test/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/ieee802154/ @esp-idf-codeowners/ieee802154
/components/json/ @esp-idf-codeowners/app-utilities
/components/linux/ @esp-idf-codeowners/system
/components/log/ @esp-idf-codeowners/system
/components/lwip/ @esp-idf-codeowners/lwip
/components/mbedtls/ @esp-idf-codeowners/app-utilities/mbedtls @esp-idf-codeowners/security
/components/mqtt/ @esp-idf-codeowners/network
/components/newlib/ @esp-idf-codeowners/system @esp-idf-codeowners/toolchain
/components/nvs_flash/ @esp-idf-codeowners/storage
/components/nvs_sec_provider/ @esp-idf-codeowners/storage @esp-idf-codeowners/security
/components/openthread/ @esp-idf-codeowners/ieee802154
@@ -151,19 +156,17 @@
/components/spi_flash/ @esp-idf-codeowners/peripherals
/components/spiffs/ @esp-idf-codeowners/storage
/components/tcp_transport/ @esp-idf-codeowners/network
/components/touch_element/ @esp-idf-codeowners/peripherals
/components/ulp/ @esp-idf-codeowners/system
/components/unity/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/usb/ @esp-idf-codeowners/peripherals/usb
/components/vfs/ @esp-idf-codeowners/storage
/components/wear_levelling/ @esp-idf-codeowners/storage
/components/wifi_provisioning/ @esp-idf-codeowners/app-utilities/provisioning
/components/wpa_supplicant/ @esp-idf-codeowners/wifi @esp-idf-codeowners/app-utilities/mbedtls
/components/xtensa/ @esp-idf-codeowners/system
/docs/ @esp-idf-codeowners/docs
/docs/docs_not_updated/ @esp-idf-codeowners/all-maintainers
/docs/**/api-guides/tools/ @esp-idf-codeowners/tools
/docs/**/api-guides/kconfig/ @esp-idf-codeowners/tools
/docs/en/api-guides/core_dump.rst @esp-idf-codeowners/debugging
/docs/**/api-guides/wifi* @esp-idf-codeowners/wifi
/docs/**/api-guides/esp-wifi-mesh.rst @esp-idf-codeowners/wifi
@@ -199,7 +202,6 @@
/examples/peripherals/usb/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/peripherals/usb
/examples/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/examples/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/examples/provisioning/ @esp-idf-codeowners/app-utilities/provisioning
/examples/security/ @esp-idf-codeowners/security
/examples/storage/ @esp-idf-codeowners/storage
/examples/system/ @esp-idf-codeowners/system
@@ -210,12 +212,11 @@
/tools/ @esp-idf-codeowners/tools
/tools/ble/ @esp-idf-codeowners/app-utilities
/tools/bt/ @esp-idf-codeowners/bluetooth
/tools/catch/ @esp-idf-codeowners/ci
/tools/ci/ @esp-idf-codeowners/ci
/tools/cmake/ @esp-idf-codeowners/build-config
/tools/cmake/toolchain-*.cmake @esp-idf-codeowners/toolchain
/tools/cmakev2/ @esp-idf-codeowners/build-config
/tools/esp_app_trace/ @esp-idf-codeowners/debugging
/tools/esp_prov/ @esp-idf-codeowners/app-utilities
/tools/gdb_panic_server.py @esp-idf-codeowners/debugging
/tools/kconfig*/ @esp-idf-codeowners/build-config
/tools/ldgen/ @esp-idf-codeowners/build-config
@@ -226,15 +227,15 @@
/tools/test_apps/README.md @esp-idf-codeowners/docs @esp-idf-codeowners/ci
## Note: owners here should be the same as the owners for the same example subdir, above
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
/tools/test_apps/configs/ @esp-idf-codeowners/system
/tools/test_apps/linux_compatible/ @esp-idf-codeowners/system
/tools/test_apps/peripherals/ @esp-idf-codeowners/peripherals
/tools/test_apps/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/tools/test_apps/security/ @esp-idf-codeowners/security
/tools/test_apps/storage/ @esp-idf-codeowners/storage
/tools/test_apps/system/ @esp-idf-codeowners/system
/tools/test_apps/build_system/ @esp-idf-codeowners/build-config
/tools/test_apps/components/test_utils/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/tools/test_apps/configs/ @esp-idf-codeowners/system
/tools/test_apps/linux_compatible/ @esp-idf-codeowners/system
/tools/test_apps/phy/ @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi @esp-idf-codeowners/ieee802154
/tools/test_apps/protocols/ @esp-idf-codeowners/network @esp-idf-codeowners/app-utilities
/tools/test_apps/security/ @esp-idf-codeowners/security
/tools/test_apps/storage/ @esp-idf-codeowners/storage
/tools/test_apps/system/ @esp-idf-codeowners/system
/tools/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools
@@ -242,8 +243,6 @@
/tools/tools.json @esp-idf-codeowners/tools @esp-idf-codeowners/toolchain @esp-idf-codeowners/debugging
/tools/unit-test-app/ @esp-idf-codeowners/system @esp-idf-codeowners/tools
# sort-order-reset
/components/**/test_apps/**/*.py @esp-idf-codeowners/ci @esp-idf-codeowners/tools

View File

@@ -250,76 +250,9 @@ We're using the latest version of [idf-build-apps][idf-build-apps]. Please refer
In ESP-IDF CI, there's a few more special rules are additionally supported to disable the check app dependencies feature:
- Add MR labels `BUILD_AND_TEST_ALL_APPS`
- Pipeline variable `IDF_CI_SELECT_ALL_PYTEST_CASES=1`
- Run in protected branches
## Upload/Download Artifacts to Internal Minio Server
### Users Without Access to Minio
If you don't have access to the internal Minio server, you can still download the artifacts from the shared link in the job log.
The log will look like this:
```shell
Pipeline ID : 587355
Job name : build_clang_test_apps_esp32
Job ID : 40272275
Created archive file: 40272275.zip, uploading as 587355/build_dir_without_map_and_elf_files/build_clang_test_apps_esp32/40272275.zip
Please download the archive file includes build_dir_without_map_and_elf_files from [INTERNAL_URL]
```
### Users With Access to Minio
#### Env Vars for Minio
Minio takes these env vars to connect to the server:
- `IDF_S3_SERVER`
- `IDF_S3_ACCESS_KEY`
- `IDF_S3_SECRET_KEY`
- `IDF_S3_BUCKET`
#### Artifacts Types and File Patterns
The artifacts types and corresponding file patterns are defined in tools/ci/artifacts_handler.py, inside `ArtifactType` and `TYPE_PATTERNS_DICT`.
#### Upload
```shell
python tools/ci/artifacts_handler.py upload
```
will upload the files that match the file patterns to minio object storage with name:
`<pipeline_id>/<artifact_type>/<job_name>/<job_id>.zip`
For example, job 39043328 will upload these four files:
- `575500/map_and_elf_files/build_pytest_examples_esp32/39043328.zip`
- `575500/build_dir_without_map_and_elf_files/build_pytest_examples_esp32/39043328.zip`
- `575500/logs/build_pytest_examples_esp32/39043328.zip`
- `575500/size_reports/build_pytest_examples_esp32/39043328.zip`
#### Download
You may run
```shell
python tools/ci/artifacts_handler.py download --pipeline_id <pipeline_id>
```
to download all files of the pipeline, or
```shell
python tools/ci/artifacts_handler.py download --pipeline_id <pipeline_id> --job_name <job_name_or_pattern>
```
to download all files with the specified job name or pattern, or
```shell
python tools/ci/artifacts_handler.py download --pipeline_id <pipeline_id> --job_name <job_name_or_pattern> --type <artifact_type> <artifact_type> ...
```
to download all files with the specified job name or pattern and artifact type(s).
You may check all detailed documentation with `python tools/ci/artifacts_handler.py download -h`
Please refer to the documentation [here](https://docs.espressif.com/projects/idf-ci/en/latest/guides/cli.html)

View File

@@ -1,55 +1,14 @@
.build_template:
stage: build
extends:
- .after_script:build:ccache-show-stats:upload-failed-job-logs
- .before_script:build
- .after_script:build
image: $ESP_ENV_IMAGE
tags:
- build
# build only on shiny servers since shiny storage server is at the same location
- shiny
tags: [build, shiny]
variables:
# Enable ccache for all build jobs. See configure_ci_environment.sh for more ccache related settings.
IDF_CCACHE_ENABLE: "1"
dependencies: []
.build_cmake_clang_template:
extends:
- .build_template
- .before_script:build
- .after_script:build:ccache-show-stats
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
- pipeline_variables
artifacts:
paths:
# The other artifacts patterns are defined under tools/ci/artifacts_handler.py
# Now we're uploading/downloading the binary files from our internal storage server
#
# keep the log file to help debug
- "**/build*/build_log.txt"
# keep the size info to help track the binary size
- size_info.txt
- "**/build*/size.json"
expire_in: 1 week
when: always
variables:
IDF_TOOLCHAIN: clang
TEST_BUILD_OPTS_EXTRA: ""
TEST_DIR: tools/test_apps/system/clang_build_test
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
script:
# CI specific options start from "--parallel-count xxx". could ignore when running locally
- run_cmd python tools/ci/ci_build_apps.py $TEST_DIR -v
-t $IDF_TARGET
--copy-sdkconfig
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--modified-components ${MR_MODIFIED_COMPONENTS}
--modified-files ${MR_MODIFIED_FILES}
$TEST_BUILD_OPTS_EXTRA
- python tools/ci/artifacts_handler.py upload
######################
# build_template_app #
@@ -57,18 +16,11 @@
.build_template_app_template:
extends:
- .build_template
- .before_script:build
variables:
LOG_PATH: "${CI_PROJECT_DIR}/log_template_app"
BUILD_PATH: "${CI_PROJECT_DIR}/build_template_app"
BUILD_DIR: "${BUILD_PATH}/@t/@w"
BUILD_LOG_CMAKE: "${LOG_PATH}/cmake_@t_@w.txt"
BUILD_COMMAND_ARGS: ""
artifacts:
paths:
- log_template_app/*
- size_info.txt
- build_template_app/**/size.json
- build_template_app/**/size*.json
expire_in: 1 week
when: always
script:
@@ -82,190 +34,15 @@
# Only do the default cmake build for each target, remaining part are done in the build_template_app job
- tools/ci/build_template_app.sh ${BUILD_COMMAND_ARGS}
# build-related-pre-check-jobs ------------------------------------------------
# Build at least one project for each target at earliest stage to reduce build cost for obvious failing commits
fast_template_app:
extends:
- .build_template_app_template
- .rules:build:target_test
- .rules:build
stage: pre_check
tags: [fast_run, shiny]
variables:
BUILD_COMMAND_ARGS: "-p"
#------------------------------------------------------------------------------
#######################
# gnu_static_analyzer #
#######################
gcc_static_analyzer:
extends:
- .build_template_app_template
- .rules:build:target_test
stage: pre_check
tags: [build, shiny]
variables:
CI_CCACHE_DISABLE: 1
ANALYZING_APP: "examples/get-started/hello_world"
script:
- echo "CONFIG_COMPILER_STATIC_ANALYZER=y" >> ${ANALYZING_APP}/sdkconfig.defaults
- python -m idf_build_apps build -v -p ${ANALYZING_APP} -t all
########################################
# Clang Build Apps Without Tests Cases #
########################################
build_clang_test_apps_esp32:
extends:
- .build_cmake_clang_template
- .rules:build
variables:
IDF_TARGET: esp32
build_clang_test_apps_esp32s2:
extends:
- .build_cmake_clang_template
- .rules:build
variables:
IDF_TARGET: esp32s2
build_clang_test_apps_esp32s3:
extends:
- .build_cmake_clang_template
- .rules:build
variables:
IDF_TARGET: esp32s3
.build_clang_test_apps_riscv:
extends:
- .build_cmake_clang_template
variables:
# https://reviews.llvm.org/D90108.
# GNU 'as' lets .weak override .globl since binutils-gdb
# https://github.com/bminor/binutils-gdb/commit/5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996)
# while MC lets the last directive win (PR38921).
# For RISCV chips we use integrated assembler by default, so suppress this warning to pass CI pipeline.
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'changed binding to STB_WEAK'"
build_clang_test_apps_esp32c3:
extends:
- .build_clang_test_apps_riscv
- .rules:build
variables:
IDF_TARGET: esp32c3
build_clang_test_apps_esp32c2:
extends:
- .build_clang_test_apps_riscv
- .rules:build
variables:
IDF_TARGET: esp32c2
build_clang_test_apps_esp32c6:
extends:
- .build_clang_test_apps_riscv
- .rules:build
variables:
IDF_TARGET: esp32c6
build_clang_test_apps_esp32c5:
extends:
- .build_clang_test_apps_riscv
- .rules:build
variables:
IDF_TARGET: esp32c5
build_clang_test_apps_esp32h2:
extends:
- .build_clang_test_apps_riscv
- .rules:build
variables:
IDF_TARGET: esp32h2
build_clang_test_apps_esp32p4:
extends:
- .build_clang_test_apps_riscv
- .rules:build
variables:
IDF_TARGET: esp32p4
######################
# Build System Tests #
######################
.test_build_system_template:
stage: host_test
extends:
- .build_template
- .rules:build:check
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
optional: true
artifacts:
reports:
junit: XUNIT_RESULT.xml
paths:
- XUNIT_RESULT.xml
- test_build_system
expire_in: 1 week
when: always
script:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- python ${IDF_PATH}/tools/ci/get_known_failure_cases_file.py
- pytest
--cleanup-idf-copy
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--work-dir ${CI_PROJECT_DIR}/test_build_system
--junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
pytest_build_system:
extends: .test_build_system_template
parallel: 3
pytest_build_system_macos:
extends:
- .test_build_system_template
- .before_script:build:macos
- .after_script:build:macos:upload-failed-job-logs:ccache-show-stats
- .rules:build:macos
tags:
- 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
- .rules:build:docker
stage: host_test
needs: []
image: espressif/docker-builder:1
tags:
- build_docker_amd64_brno
variables:
DOCKER_TMP_IMAGE_NAME: "idf_tmp_image"
script:
- export LOCAL_CI_REPOSITORY_URL=$CI_REPOSITORY_URL
- if [ -n "$LOCAL_GITLAB_HTTPS_HOST" ]; then export LOCAL_CI_REPOSITORY_URL="https://gitlab-ci-token:${CI_JOB_TOKEN}@${LOCAL_GITLAB_HTTPS_HOST}/${CI_PROJECT_PATH}"; fi
- if [ -n "$LOCAL_GIT_MIRROR" ]; then export LOCAL_CI_REPOSITORY_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}"; fi
- echo "Using repository at $LOCAL_CI_REPOSITORY_URL"
- export DOCKER_BUILD_ARGS="--build-arg IDF_CLONE_URL=${LOCAL_CI_REPOSITORY_URL} --build-arg IDF_CLONE_BRANCH_OR_TAG=${CI_COMMIT_REF_NAME} --build-arg IDF_CHECKOUT_REF=${CI_COMMIT_TAG:-$PIPELINE_COMMIT_SHA}"
# Build
- docker build --tag ${DOCKER_TMP_IMAGE_NAME} ${DOCKER_BUILD_ARGS} tools/docker/
# We can't mount $PWD/examples/get-started/blink into the container, see https://gitlab.com/gitlab-org/gitlab-ce/issues/41227.
# The workaround mentioned there works, but leaves around directories which need to be cleaned up manually.
# Therefore, build a copy of the example located inside the container.
- docker run --rm --workdir /opt/esp/idf/examples/get-started/blink ${DOCKER_TMP_IMAGE_NAME} idf.py build
# This job builds template app with permutations of targets and optimization levels
build_template_app:
@@ -273,11 +50,66 @@ build_template_app:
- .build_template_app_template
- .rules:build
stage: host_test
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
########################################
# Clang Build Apps Without Tests Cases #
########################################
.build_cmake_clang_template:
extends:
- .build_template
- .rules:build
needs:
- job: fast_template_app
artifacts: false
- pipeline_variables
artifacts:
paths:
# The other artifacts patterns are defined under .idf_ci.toml
# Now we're uploading/downloading the binary files from our internal storage server
#
# keep the log file to help debug
- "**/build*/build_log.txt"
# keep the size info to help track the binary size
- size_info.txt
- "**/build*/size*.json"
expire_in: 1 week
when: always
variables:
IDF_TOOLCHAIN: clang
TEST_BUILD_OPTS_EXTRA: ""
script:
# CI specific options start from "--parallel-count xxx". could ignore when running locally
- run_cmd idf-build-apps build
-p tools/test_apps/system/clang_build_test
-t $IDF_TARGET
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--modified-components ${MR_MODIFIED_COMPONENTS}
--modified-files ${MR_MODIFIED_FILES}
$TEST_BUILD_OPTS_EXTRA
build_clang_test_apps_xtensa:
extends: .build_cmake_clang_template
parallel:
matrix:
- IDF_TARGET: [esp32, esp32s2, esp32s3]
build_clang_test_apps_riscv:
extends: .build_cmake_clang_template
variables:
# https://reviews.llvm.org/D90108.
# GNU 'as' lets .weak override .globl since binutils-gdb
# https://github.com/bminor/binutils-gdb/commit/5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996)
# while MC lets the last directive win (PR38921).
# For RISCV chips we use integrated assembler by default, so suppress this warning to pass CI pipeline.
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'changed binding to STB_WEAK'"
parallel:
matrix:
- IDF_TARGET: [esp32c3, esp32c2, esp32c6, esp32c5, esp32h2, esp32p4]
####################
# Dynamic Pipeline #
####################
@@ -297,12 +129,12 @@ generate_build_child_pipeline:
- non_test_related_apps.txt
expire_in: 1 week
when: always
variables:
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
script:
# requires basic pytest dependencies
- run_cmd bash install.sh --enable-pytest
- run_cmd python tools/ci/dynamic_pipelines/scripts/generate_build_child_pipeline.py
- run_cmd idf-ci --debug gitlab build-child-pipeline
-p components
-p examples
-p tools/test_apps
--modified-files $MR_MODIFIED_FILES
build_child_pipeline:
stage: build
@@ -313,12 +145,9 @@ build_child_pipeline:
- pipeline_variables
- generate_build_child_pipeline
variables:
IS_MR_PIPELINE: $IS_MR_PIPELINE
MR_MODIFIED_COMPONENTS: $MR_MODIFIED_COMPONENTS
MR_MODIFIED_FILES: $MR_MODIFIED_FILES
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
BUILD_AND_TEST_ALL_APPS: $BUILD_AND_TEST_ALL_APPS
REPORT_EXIT_CODE: $REPORT_EXIT_CODE
# https://gitlab.com/gitlab-org/gitlab/-/issues/214340
inherit:
variables: false
@@ -327,3 +156,22 @@ build_child_pipeline:
- artifact: build_child_pipeline.yml
job: generate_build_child_pipeline
strategy: depend
generate_disabled_apps_report:
extends:
- .build_template
tags: [fast_run, shiny]
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- pipeline_variables
- job: baseline_manifest_sha
optional: true
artifacts:
paths:
- disabled_report.html
expire_in: 1 week
when: always
script:
- pip install dominate idf-build-apps
- run_cmd python tools/ci/gen_disabled_report.py --output disabled_report.html --verbose --enable-preview-targets
- echo "Report generated at https://${CI_PAGES_HOSTNAME}:${CI_SERVER_PORT}/-/esp-idf/-/jobs/${CI_JOB_ID}/artifacts/disabled_report.html"

View File

@@ -12,7 +12,6 @@ stages:
- test_deploy
- deploy
- post_deploy
- retry_failed_jobs
variables:
# System environment
@@ -30,17 +29,14 @@ variables:
# - set GIT_STRATEGY: "clone" to shiny runners
# - set GIT_STRATEGY: "fetch" to brew runners
GIT_STRATEGY: clone
# we will download archive for each submodule instead of clone.
# we don't do "recursive" when fetch submodule as they're not used in CI now.
GIT_SUBMODULE_STRATEGY: none
# since we're using merged-result pipelines, the last commit should work for most cases
GIT_DEPTH: 1
# --no-recurse-submodules: we use cache for submodules
GIT_SUBMODULE_STRATEGY: none # here we use cache for submodules, so we don't need to fetch them every time
# since we're using merged-result pipelines, the last commit should work for most cases
# --prune --prune-tags: in case remote branch or tag is force pushed
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: v6.0-dev
LATEST_GIT_TAG: v6.1-dev
SUBMODULE_FETCH_TOOL: "tools/ci/ci_fetch_submodule.py"
# by default we will fetch all submodules
@@ -55,11 +51,10 @@ variables:
CHECKOUT_REF_SCRIPT: "$CI_PROJECT_DIR/tools/ci/checkout_project_ref.py"
# Docker images
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v6.0:1"
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v6.0:1-1"
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v6.0:1"
ESP_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-env-v6.1:1"
ESP_IDF_DOC_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-doc-env-v6.1:1-1"
TARGET_TEST_ENV_IMAGE: "${CI_DOCKER_REGISTRY}/target-test-env-v6.1:1"
SONARQUBE_SCANNER_IMAGE: "${CI_DOCKER_REGISTRY}/sonarqube-scanner:5"
PRE_COMMIT_IMAGE: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:1"
# cache python dependencies
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
@@ -70,7 +65,7 @@ variables:
CI_PYTHON_CONSTRAINT_BRANCH: ""
# Update the filename for a specific ESP-IDF release. It is used only with CI_PYTHON_CONSTRAINT_BRANCH.
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v6.0.txt"
CI_PYTHON_CONSTRAINT_FILE: "espidf.constraints.v6.1.txt"
# Set this variable to repository name of a Python tool you wish to install and test in the context of ESP-IDF CI.
# Keep the variable empty when not used.
@@ -101,6 +96,7 @@ variables:
CCACHE_MAXSIZE: "50G"
FF_USE_NEW_BASH_EVAL_STRATEGY: "true"
FORCE_COLOR: "1" # rich print with color
################################################
# `before_script` and `after_script` Templates #
@@ -123,7 +119,7 @@ variables:
source tools/ci/configure_ci_environment.sh
# add extra python packages
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
export PYTHONPATH="$IDF_PATH/tools:$IDF_PATH/tools/ci:$IDF_PATH/tools/esp_app_trace:$IDF_PATH/components/partition_table:$IDF_PATH/tools/ci/python_packages:$PYTHONPATH"
.setup_tools_and_idf_python_venv: &setup_tools_and_idf_python_venv |
# must use after setup_tools_except_target_test
@@ -131,7 +127,7 @@ variables:
# download constraint file for dev
if [[ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]]; then
wget -O /tmp/constraint.txt --header="Authorization:Bearer ${ESPCI_TOKEN}" ${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw?ref=${CI_PYTHON_CONSTRAINT_BRANCH}
wget -O /tmp/constraint.txt --header="Authorization:Bearer ${ESPCI_TOKEN}" "${GITLAB_HTTP_SERVER}/api/v4/projects/2581/repository/files/${CI_PYTHON_CONSTRAINT_FILE}/raw?ref=${CI_PYTHON_CONSTRAINT_BRANCH}"
mkdir -p ~/.espressif
mv /tmp/constraint.txt ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
fi
@@ -148,45 +144,56 @@ variables:
export IDF_PIP_WHEELS_URL=""
fi
# install.sh
if [[ "${CI_JOB_STAGE}" != "target_test" ]]; then
section_start "running_install_sh" "Running install.sh"
if [[ "${CI_JOB_STAGE}" == "build_doc" ]]; then
run_cmd bash install.sh --enable-ci --enable-docs
elif [[ "${CI_JOB_STAGE}" == "build" ]]; then
run_cmd bash install.sh --enable-ci
else
if ! echo "${CI_JOB_NAME}" | egrep ".*pytest.*"; then
run_cmd bash install.sh --enable-ci
else
run_cmd bash install.sh --enable-ci --enable-pytest --enable-test-specific
fi
run_cmd bash install.sh --enable-ci
fi
section_end "running_install_sh"
else
section_start "install_python_env" "Install Python environment"
run_cmd python tools/idf_tools.py install-python-env --features ci,pytest,test-specific
section_start "install_python_env" "Install Python environment, skip required tools check"
run_cmd python tools/idf_tools.py install-python-env --features ci,test-specific
export IDF_SKIP_TOOLS_CHECK=1
section_end "install_python_env"
fi
section_start "source_export" "Source export.sh"
source ./export.sh
section_end "source_export"
# Eager upgrade of CI dependencies
# Done after sourcing export.sh so that we could easily invoke the right pip
section_start "upgrade_ci_dependencies" "Upgrading CI dependencies"
pip install --upgrade --upgrade-strategy=eager -r $IDF_PATH/tools/requirements/requirements.ci.txt -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
pip install --upgrade --upgrade-strategy=eager -r $IDF_PATH/tools/requirements/requirements.test-specific.txt -c ~/.espressif/${CI_PYTHON_CONSTRAINT_FILE}
fi
section_end "upgrade_ci_dependencies"
REEXPORT_NEEDED=0
if [[ ! -z "$INSTALL_EXTRA_TOOLS" ]]; then
section_start "installing_optional_tools" "Install optional tools ${INSTALL_EXTRA_TOOLS}"
$IDF_PATH/tools/idf_tools.py --non-interactive install $INSTALL_EXTRA_TOOLS
run_cmd $IDF_PATH/tools/idf_tools.py --non-interactive install $INSTALL_EXTRA_TOOLS
section_end "installing_optional_tools"
REEXPORT_NEEDED=1
fi
# Install esp-clang if necessary (esp-clang is separately installed)
if [[ "$IDF_TOOLCHAIN" == "clang" && -z "$CI_CLANG_DISTRO_URL" ]]; then
$IDF_PATH/tools/idf_tools.py --non-interactive install esp-clang
REEXPORT_NEEDED=1
fi
if [[ "${CI_JOB_STAGE}" == "target_test" ]]; then
section_start "IDF_SKIP_TOOLS_CHECK" "Skip required tools check"
export IDF_SKIP_TOOLS_CHECK=1
section_end "IDF_SKIP_TOOLS_CHECK"
if [[ $REEXPORT_NEEDED -eq 1 ]]; then
section_start "re_source_export" "Re-source export.sh"
source ./export.sh
section_end "re_source_export"
fi
section_start "source_export" "Source export.sh"
source ./export.sh
section_end "source_export"
# Custom clang toolchain
if [[ "$IDF_TOOLCHAIN" == "clang" && ! -z "$CI_CLANG_DISTRO_URL" ]]; then
@@ -225,41 +232,19 @@ variables:
.show_ccache_statistics: &show_ccache_statistics |
# Show ccache statistics if enabled globally
section_start "ccache_show_stats" "Show ccache statistics"
test "$CI_CCACHE_STATS" == 1 && test -n "$(which ccache)" && ccache --show-stats -vv || true
section_end "ccache_show_stats"
.upload_failed_job_log_artifacts: &upload_failed_job_log_artifacts |
if [ $CI_JOB_STATUS = "failed" ]; then
python tools/ci/artifacts_handler.py upload --type logs
run_cmd idf-ci gitlab upload-artifacts --type log
fi
.before_script:minimal:
before_script:
- *common-before_scripts
.before_script:build:macos:
before_script:
# macos is running shell executor, which means it would use
# the system installed /usr/local/bin/python3 by default.
# Ensure pyenv and PYENV_VERSION installed
- eval "$(pyenv init -)"
- *common-before_scripts
# 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
- *setup_tools_and_idf_python_venv
- fetch_submodules
variables:
INSTALL_EXTRA_TOOLS: cmake ninja
.after_script:build:macos:upload-failed-job-logs:ccache-show-stats:
after_script:
# macos is running shell executor, which means it would use
# the system installed /usr/local/bin/python3 by default.
# Ensure pyenv and PYENV_VERSION installed
- eval "$(pyenv init -)"
- *upload_failed_job_log_artifacts
- *show_ccache_statistics
.before_script:build:
before_script:
- *common-before_scripts
@@ -269,12 +254,9 @@ variables:
- export EXTRA_CFLAGS=${PEDANTIC_CFLAGS}
- export EXTRA_CXXFLAGS=${PEDANTIC_CXXFLAGS}
.after_script:build:ccache-show-stats:
after_script:
- *show_ccache_statistics
.after_script:build:ccache-show-stats:upload-failed-job-logs:
.after_script:build:
after_script:
- source tools/ci/utils.sh
- *show_ccache_statistics
- *upload_failed_job_log_artifacts
@@ -314,7 +296,7 @@ variables:
.git_checkout_ci_commit_sha: &git_checkout_ci_commit_sha |
git checkout $CI_COMMIT_SHA
git clean ${GIT_CLEAN_FLAGS}
eval "git clean ${GIT_CLEAN_FLAGS}"
# git diff requires two commits, with different CI env var
#
@@ -336,9 +318,10 @@ variables:
TEMP_FILE=$(mktemp)
# merged results pipelines, by default
if [[ -n $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ]]; then
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA > "$TEMP_FILE"
git fetch origin $CI_MERGE_REQUEST_TARGET_BRANCH_SHA
git fetch origin $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA
git diff --name-only $CI_MERGE_REQUEST_TARGET_BRANCH_SHA...$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA > "$TEMP_FILE"
GIT_DIFF_OUTPUT=$(cat "$TEMP_FILE")
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
# merge request pipelines, when the mr got conflicts
@@ -372,13 +355,48 @@ variables:
before_script:
- *git_init
- *git_fetch_from_mirror_url_if_exists
- git fetch origin "${CI_COMMIT_SHA}" --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
- eval "git fetch --depth=1 ${GIT_FETCH_EXTRA_FLAGS} origin ${CI_COMMIT_SHA}"
- *git_checkout_ci_commit_sha
- *common-before_scripts
- *setup_tools_and_idf_python_venv
- add_gitlab_ssh_keys
# no submodules
.brew-macos-settings:
variables:
GIT_STRATEGY: none # we do manual git clone to use local mirror
IDF_CCACHE_ENABLE: "0"
CCACHE_DIR: "/var/tmp/cache/idf_ccache"
tags:
- macos-tart
image: macos-sequoia-idf-v6.1
cache: [] # pip cache is created under amd64, and submodules are downloaded with brew mirror, so disable cache here
before_script:
# assert LOCAL_GIT_MIRROR is set
- echo -e "section_start:`date +%s`:check_out\r\e[0Kchecking out from local git mirror, then reset to CI_COMMIT_SHA"
- |
if [ -z "${LOCAL_GIT_MIRROR:-}" ]; then
echo "Error: LOCAL_GIT_MIRROR not set, cannot clone from mirror."
exit 1
fi
- MIRROR_REPO_URL="${LOCAL_GIT_MIRROR}/${CI_PROJECT_PATH}"
- cd "${CI_PROJECT_DIR}"
# since .cache exists in CI_PROJECT_DIR, so can't direct `git clone .`
- git clone -b ${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_COMMIT_BRANCH}} --depth=1 --recursive --shallow-submodules "${MIRROR_REPO_URL}" tmp
- mv tmp/.git ./
- rm -rf tmp
- git reset --hard
# set remote url back
- git remote set-url origin "${CI_REPOSITORY_URL}"
- eval "git fetch --depth=1 ${GIT_FETCH_EXTRA_FLAGS} origin ${CI_COMMIT_SHA}"
- git checkout FETCH_HEAD
- git submodule update --init --recursive --depth=1
- echo -e "section_end:`date +%s`:check_out\r\e[0K"
- *common-before_scripts
- *setup_tools_and_idf_python_venv
after_script: [] # ccache now is disabled for macos brew runners
timeout: 30m
#############
# `default` #
#############

View File

@@ -2,21 +2,17 @@
# - extra_default_build_targets:
# besides of the SUPPORTED_TARGETS in IDF,
# enable build for the specified targets by default as well.
# !!! DEPRECATED: use `additional_build_targets` in .idf_build_apps.toml instead
#
# - bypass_check_test_targets:
# suppress the check_build_test_rules check-test-script warnings for the specified targets
#
# This file should ONLY be used during bringup. Should be reset to empty after the bringup process
extra_default_build_targets:
- esp32c5
- esp32c61
- esp32h21
- esp32h4
bypass_check_test_targets:
- esp32h21
- esp32h4
- esp32c5
- esp32c61
#
# These lines would

View File

@@ -1,19 +1,3 @@
.all_targets: &all_targets
- esp32
- esp32s2
- esp32s3
- esp32c3
- esp32c2
- esp32c6
- esp32c5
- esp32h2
- esp32p4
.target_test: &target_test
- example_test
- custom_test
- component_ut
##############
# Build Jobs #
##############
@@ -25,7 +9,6 @@
- build_system
- downloadable-tools
included_in:
- build:target_test
- build:check
# -------------------
@@ -43,13 +26,13 @@
"build:macos":
labels:
- build
# - build
- macos
- macos_test # for backward compatibility
patterns:
- build_system
- build_macos
- downloadable-tools
# patterns:
# - build_system
# - build_macos
# - downloadable-tools
# ---------------------------
# Add patterns to build rules
@@ -57,8 +40,6 @@
"patterns:template-app":
patterns:
- build_template-app
included_in:
- build:target_test
"patterns:build-check":
patterns:
@@ -92,3 +73,7 @@
- if-schedule-test-build-system-windows
patterns:
- build_system_win
"labels:buildv2":
labels:
- buildv2

View File

@@ -3,6 +3,27 @@
image: $ESP_ENV_IMAGE
tags: [ deploy ]
.metrics_template:
stage: deploy
tags: [ fast_run, shiny ]
image: python:3.13-slim
dependencies: []
needs: []
variables:
PIP_CACHE_DIR: ".cache/pip"
# Metrics - related env vars
ESP_METRICS_PROJECT_URL: "$CI_PROJECT_URL"
ESP_METRICS_PROJECT_ID: "$CI_PROJECT_ID"
ESP_METRICS_COMMIT_SHA: "$PIPELINE_COMMIT_SHA"
ESP_METRICS_BRANCH_NAME: "$CI_COMMIT_REF_NAME"
cache:
key: metrics-pip
paths:
- .cache/pip
before_script:
- echo "Installing esp-metrics-cli tool"
- pip install "esp-metrics-cli>=0.3,<1"
check_submodule_sync:
extends:
- .deploy_job_template
@@ -11,13 +32,13 @@ check_submodule_sync:
tags: [ brew, github_sync ]
retry: 2
variables:
# for brew runners, we always set GIT_STRATEGY to fetch
GIT_STRATEGY: fetch
GIT_STRATEGY: fetch # use brew local mirror first
SUBMODULES_TO_FETCH: "none"
PUBLIC_IDF_URL: "https://github.com/espressif/esp-idf.git"
dependencies: []
script:
- git submodule deinit --force .
- rm -rf .git/modules # remove all the cached metadata
# setting the default remote URL to the public one, to resolve relative location URLs
- git config remote.origin.url ${PUBLIC_IDF_URL}
# check if all submodules are correctly synced to public repository
@@ -36,10 +57,8 @@ push_to_github:
- check_submodule_sync
tags: [ brew, github_sync ]
variables:
# for brew runners, we always set GIT_STRATEGY to fetch
GIT_STRATEGY: fetch
# github also need full record of commits
GIT_DEPTH: 0
GIT_STRATEGY: fetch # use brew local mirror first
GIT_DEPTH: 0 # github needs full record of commits
script:
- add_github_ssh_keys
- git remote remove github &>/dev/null || true
@@ -58,11 +77,39 @@ deploy_update_SHA_in_esp-dockerfiles:
dependencies: []
variables:
GIT_DEPTH: 2
tags: [ shiny, build ]
tags: [build, shiny]
script:
- '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
name: deploy_update_SHA_in_esp-dockerfiles_production
deployment_tier: production
upload_junit_report:
extends:
- .deploy_job_template
tags: [ fast_run, shiny ]
needs:
- pipeline_variables
- job: build_child_pipeline
artifacts: false
script:
- run_cmd idf-ci gitlab download-artifacts --type junit
rules:
- when: always
artifacts:
reports:
junit: XUNIT_RESULT_*.xml
expire_in: 1 week
when: always
target-examples-count-metrics:
extends:
- .metrics_template
allow_failure: true
script:
- echo "Generating ESP-IDF examples count metrics"
- cd tools/ci/metrics/examples_count
- python3 generate_metrics.py
- esp-metrics-cli upload -d schema.yaml -i metrics.json

View File

@@ -8,7 +8,7 @@
.patterns-docs-partial: &patterns-docs-partial
- "components/**/*.h"
- "components/**/CMakeList.txt"
- "components/**/CMakeLists.txt"
- "components/**/sdkconfig*"
- "tools/tools.json"
- "tools/idf_tools.py"
@@ -58,7 +58,7 @@
check_readme_links:
extends:
- .pre_check_template
tags: ["build", "amd64", "internet"]
tags: ["amd64", "brew"]
allow_failure: true
rules:
- <<: *if-protected-check
@@ -148,8 +148,8 @@ build_docs_html_partial:
GIT_DEPTH: 0
stage: test_deploy
tags:
- deploy
- shiny
- brew
- amd64
script:
# ensure all tags are fetched, need to know the latest/stable tag for the docs
- git fetch --tags --prune

View File

@@ -2,18 +2,20 @@
extends: .rules:test:host_test
stage: host_test
image: $ESP_ENV_IMAGE
tags:
- host_test
tags: [build, shiny]
dependencies: # set dependencies to null to avoid missing artifacts issue
# run host_test jobs immediately, only after upload cache
needs:
- pipeline_variables
- job: upload-pip-cache
optional: true
artifacts: false
- job: upload-submodules-cache
optional: true
artifacts: false
- pipeline_variables
- job: fast_template_app
optional: true
artifacts: false
artifacts:
expire_in: 1 week
when: always
@@ -53,14 +55,14 @@ test_partition_table_on_host:
extends: .host_test_template
script:
- cd components/partition_table/test_gen_esp32part_host
- ./gen_esp32part_tests.py
- pytest_for_ut ./gen_esp32part_tests.py
test_ldgen_on_host:
extends: .host_test_template
script:
- cd tools/ldgen/test
- export PYTHONPATH=$PYTHONPATH:..
- python -m unittest
- pytest_for_ut .
variables:
LC_ALL: C.UTF-8
@@ -68,33 +70,19 @@ test_spiffs_on_host:
extends: .host_test_template
script:
- cd components/spiffs/test_spiffsgen/
- ./test_spiffsgen.py
- pytest_for_ut ./test_spiffsgen.py
test_fatfsgen_on_host:
extends: .host_test_template
script:
- cd components/fatfs/test_fatfsgen/
- ./test_fatfsgen.py
- ./test_wl_fatfsgen.py
- ./test_fatfsparse.py
test_multi_heap_on_host:
extends: .host_test_template
script:
- cd components/heap/test_multi_heap_host
- ./test_all_configs.sh
- pytest_for_ut ./test_fatfsgen.py ./test_wl_fatfsgen.py ./test_fatfsparse.py
test_certificate_bundle_on_host:
extends: .host_test_template
script:
- cd components/mbedtls/esp_crt_bundle/test_gen_crt_bundle/
- ./test_gen_crt_bundle.py
test_gdbstub_on_host:
extends: .host_test_template
script:
- cd components/esp_gdbstub/test_gdbstub_host
- make test
- pytest_for_ut ./test_gen_crt_bundle.py
# Test for create virtualenv. It must be invoked from Python, not from virtualenv.
# Use docker image system python without any extra dependencies
@@ -114,18 +102,20 @@ test_cli_installer:
# 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
# cmake@version that is supported
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
- python3 ${IDF_PATH}/tools/idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.22.1
- cd ${IDF_PATH}/tools/test_idf_tools
- python3 -m pip install jsonschema
# Testing with system python3, so don't use any third-party packages
- python3 ./test_idf_tools.py -v
- python3 ./test_idf_tools_python_env.py
# It runs at the end because it modifies dependencies
- IDF_TEST_MAY_BREAK_DEPENDENCIES=1 python3 ./test_idf_tools.py -v TestSystemDependencies.test_commands_when_nodeps
.test_efuse_table_on_host_template:
test_efuse_table_on_host:
extends: .host_test_template
variables:
IDF_TARGET: "esp32"
parallel:
matrix:
- IDF_TARGET: [esp32, esp32s2, esp32c3, esp32s3, esp32c2, esp32c6, esp32h2, esp32p4, esp32c5, esp32c61]
artifacts:
when: on_failure
paths:
@@ -135,35 +125,7 @@ test_cli_installer:
- ./efuse_table_gen.py -t "${IDF_TARGET}" ${IDF_PATH}/components/efuse/${IDF_TARGET}/esp_efuse_table.csv
- git diff --exit-code -- ${IDF_TARGET}/esp_efuse_table.c || { echo 'Differences found for ${IDF_TARGET} target. Please run idf.py efuse-common-table and commit the changes.'; exit 1; }
- cd ${IDF_PATH}/components/efuse/test_efuse_host
- ./efuse_tests.py
test_efuse_table_on_host_esp32:
extends: .test_efuse_table_on_host_template
test_efuse_table_on_host_esp32s2:
extends: .test_efuse_table_on_host_template
variables:
IDF_TARGET: esp32s2
test_efuse_table_on_host_esp32s3:
extends: .test_efuse_table_on_host_template
variables:
IDF_TARGET: esp32s3
test_efuse_table_on_host_esp32c3:
extends: .test_efuse_table_on_host_template
variables:
IDF_TARGET: esp32c3
test_efuse_table_on_host_esp32h2:
extends: .test_efuse_table_on_host_template
variables:
IDF_TARGET: esp32h2
test_efuse_table_on_host_esp32c6:
extends: .test_efuse_table_on_host_template
variables:
IDF_TARGET: esp32c6
- pytest_for_ut ./efuse_tests.py
test_logtrace_proc:
extends: .host_test_template
@@ -201,20 +163,21 @@ test_tools:
INSTALL_EXTRA_TOOLS: "qemu-xtensa qemu-riscv32" # for test_idf_qemu.py
script:
- stat=0
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- cd ${IDF_PATH}/tools/ci/test_autocomplete
- pytest --noconftest test_autocomplete.py --junitxml=${IDF_PATH}/XUNIT_AUTOCOMP.xml || stat=1
- run_cmd pytest --noconftest test_autocomplete.py --junitxml=${IDF_PATH}/XUNIT_AUTOCOMP.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- cd ${IDF_PATH}/tools/test_idf_py
- pytest --noconftest test_idf_py.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY.xml || stat=1
- pytest --noconftest test_hints.py --junitxml=${IDF_PATH}/XUNIT_HINTS.xml || stat=1
- pytest --noconftest test_idf_qemu.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY_QEMU.xml || stat=1
- run_cmd pytest --noconftest test_idf_py.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- run_cmd pytest --noconftest test_hints.py --junitxml=${IDF_PATH}/XUNIT_HINTS.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- run_cmd pytest --noconftest test_idf_qemu.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY_QEMU.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- cd ${IDF_PATH}/tools/test_bsasm
- pytest --noconftest test_bsasm.py --junitxml=${IDF_PATH}/XUNIT_BSASM.xml || stat=1
- run_cmd pytest --noconftest test_bsasm.py --junitxml=${IDF_PATH}/XUNIT_BSASM.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- cd ${IDF_PATH}/tools/test_mkdfu
- pytest --noconftest test_mkdfu.py --junitxml=${IDF_PATH}/XUNIT_MKDFU.xml || stat=1
- run_cmd pytest --noconftest test_mkdfu.py --junitxml=${IDF_PATH}/XUNIT_MKDFU.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- cd ${IDF_PATH}/tools/test_idf_size
- pytest --noconftest test_idf_size.py --junitxml=${IDF_PATH}/XUNIT_IDF_SIZE.xml || stat=1
- run_cmd pytest --noconftest test_idf_size.py --junitxml=${IDF_PATH}/XUNIT_IDF_SIZE.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- cd ${IDF_PATH}/tools/test_idf_diag
- pytest --noconftest test_idf_diag.py --junitxml=${IDF_PATH}/XUNIT_IDF_DIAG.xml || stat=1
- run_cmd pytest --noconftest test_idf_diag.py --junitxml=${IDF_PATH}/XUNIT_IDF_DIAG.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME} || stat=1
- cd ${IDF_PATH}
- shellcheck -s sh tools/detect_python.sh || stat=1
- shellcheck -s bash tools/detect_python.sh || stat=1
@@ -229,14 +192,7 @@ test_split_path_by_spaces:
extends: .host_test_template
script:
- cd ${IDF_PATH}/tools
- python -m unittest split_paths_by_spaces.py
test_mqtt_on_host:
extends: .host_test_template
script:
- cd ${IDF_PATH}/components/mqtt/esp-mqtt/host_test
- idf.py build
- LSAN_OPTIONS=verbosity=1:log_threads=1 build/host_mqtt_client_test.elf
- pytest_for_ut ./split_paths_by_spaces.py
test_transport_on_host:
extends: .host_test_template
@@ -275,8 +231,78 @@ test_gen_soc_caps_kconfig:
extends: .host_test_template
script:
- cd ${IDF_PATH}/tools/gen_soc_caps_kconfig/
- ./test/test_gen_soc_caps_kconfig.py
- pytest_for_ut ./test/test_gen_soc_caps_kconfig.py
test_idf_build_apps_load_soc_caps:
extends: .host_test_template
script:
- cd tools/ci
- pytest_for_ut ./test_soc_headers_load_in_idf_build_apps.py
test_nvs_gen_check:
extends: .host_test_template
artifacts:
paths:
- XUNIT_RESULT.xml
- components/nvs_flash/nvs_partition_tool
reports:
junit: XUNIT_RESULT.xml
variables:
LC_ALL: C.UTF-8
script:
- cd ${IDF_PATH}/components/nvs_flash/nvs_partition_tool
- pytest_for_ut test_nvs_gen_check.py
test_esp_rom:
extends: .host_test_template
artifacts:
paths:
- XUNIT_RESULT.xml
reports:
junit: XUNIT_RESULT.xml
script:
- cd ${IDF_PATH}/components/esp_rom/
- pytest_for_ut test_esp_rom.py
make_sure_soc_caps_compatible_in_idf_build_apps:
extends:
- .host_test_template
- .rules:dev-push
artifacts:
paths:
- new.json
- base.json
when: always
when: manual
script:
- python tools/ci/idf_build_apps_dump_soc_caps.py new.json
- git fetch --depth=1 origin $CI_MERGE_REQUEST_DIFF_BASE_SHA
- git checkout -f $CI_MERGE_REQUEST_DIFF_BASE_SHA
- git checkout $CI_COMMIT_SHA -- tools/ci/idf_build_apps_dump_soc_caps.py
- python tools/ci/idf_build_apps_dump_soc_caps.py base.json
- diff new.json base.json
build_docker:
extends:
- .before_script:minimal
- .rules:build:docker
stage: host_test
needs: []
image: espressif/docker-builder:1
tags: [shiny, dind]
variables:
DOCKER_TMP_IMAGE_NAME: "idf_tmp_image"
script:
- export DOCKER_BUILD_ARGS="--build-arg IDF_CLONE_URL=${CI_REPOSITORY_URL} --build-arg IDF_CLONE_BRANCH_OR_TAG=${CI_COMMIT_REF_NAME} --build-arg IDF_CHECKOUT_REF=${CI_COMMIT_TAG:-$CI_COMMIT_SHA} --build-arg IDF_CLONE_SHALLOW=1 --build-arg IDF_GITHUB_ASSETS=${INTERNAL_GITHUB_ASSETS}"
- docker build --tag ${DOCKER_TMP_IMAGE_NAME} ${DOCKER_BUILD_ARGS} tools/docker/
# We can't mount $PWD/examples/get-started/blink into the container, see https://gitlab.com/gitlab-org/gitlab-ce/issues/41227.
# The workaround mentioned there works, but leaves around directories which need to be cleaned up manually.
# Therefore, build a copy of the example located inside the container.
- docker run --rm --workdir /opt/esp/idf/examples/get-started/blink ${DOCKER_TMP_IMAGE_NAME} idf.py build
############################
# Host test with test apps #
############################
test_pytest_qemu:
extends:
- .host_test_template
@@ -298,22 +324,18 @@ test_pytest_qemu:
INSTALL_EXTRA_TOOLS: "qemu-riscv32"
IDF_TOOLCHAIN: [gcc, clang]
script:
- run_cmd python tools/ci/ci_build_apps.py . -v
- run_cmd idf-ci build run
--build-system cmake
--target $IDF_TARGET
--pytest-apps
-m qemu
--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 idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- run_cmd pytest
--target $IDF_TARGET
--log-cli-level DEBUG
-m qemu
--embedded-services idf,qemu
--junitxml=XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"
--qemu-extra-args \"-global driver=timer.$IDF_TARGET.timg,property=wdt_disable,value=true\"
test_pytest_linux:
@@ -328,28 +350,23 @@ test_pytest_linux:
reports:
junit: XUNIT_RESULT.xml
script:
- run_cmd python tools/ci/ci_build_apps.py components examples tools/test_apps -v
- run_cmd idf-ci build run
--build-system cmake
-p components -p examples -p tools/test_apps
--target linux
--pytest-apps
-m host_test
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MR_MODIFIED_COMPONENTS}
--only-test-related
--modified-files ${MR_MODIFIED_FILES}
- python tools/ci/get_known_failure_cases_file.py
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- run_cmd pytest
--target linux
-m host_test
--embedded-services idf
--junitxml=XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"
test_pytest_macos:
extends:
- .host_test_template
- .before_script:build:macos
tags:
- macos
- .brew-macos-settings
artifacts:
paths:
- XUNIT_RESULT.xml
@@ -357,88 +374,131 @@ test_pytest_macos:
- "**/build*/build_log.txt"
reports:
junit: XUNIT_RESULT.xml
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
- run_cmd idf-ci build run
-p components -p examples -p tools/test_apps
--build-system cmake
--target linux
--pytest-apps
-m \"host_test and macos\"
--collect-app-info "list_job_${CI_JOB_NAME_SLUG}.txt"
--modified-components ${MR_MODIFIED_COMPONENTS}
--only-test-related
-m macos
--modified-files ${MR_MODIFIED_FILES}
- python tools/ci/get_known_failure_cases_file.py
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- run_cmd pytest
--target linux
-m \"host_test and macos\"
-m macos
--junitxml=XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"
test_idf_pytest_plugin:
######################
# Build System Tests #
######################
.test_build_system_template:
stage: host_test
extends:
- .host_test_template
- .rules:patterns:idf-pytest-plugin
variables:
SUBMODULES_TO_FETCH: "none"
- .build_template
- .rules:build:check
dependencies: # set dependencies to null to avoid missing artifacts issue
needs:
- job: fast_template_app
artifacts: false
optional: true
artifacts:
reports:
junit: XUNIT_RESULT.xml
script:
- cd ${IDF_PATH}/tools/ci/dynamic_pipelines/tests/test_report_generator
- python -m unittest test_report_generator.py
- cd ${IDF_PATH}/tools/ci/idf_pytest
- pytest --junitxml=${CI_PROJECT_DIR}/XUNIT_RESULT.xml
test_idf_build_apps_load_soc_caps:
extends: .host_test_template
script:
- python tools/ci/check_soc_headers_load_in_idf_build_apps.py
test_nvs_gen_check:
extends: .host_test_template
artifacts:
paths:
- XUNIT_RESULT.xml
- components/nvs_flash/nvs_partition_tool
reports:
junit: XUNIT_RESULT.xml
- test_build_system
expire_in: 1 week
when: always
script:
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest
--cleanup-idf-copy
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--work-dir ${CI_PROJECT_DIR}/test_build_system
--junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
.test_build_system_minimal_cmake_template:
extends: .test_build_system_template
variables:
LC_ALL: C.UTF-8
INSTALL_EXTRA_TOOLS: cmake@3.22.1
script:
- cd ${IDF_PATH}/components/nvs_flash/nvs_partition_tool
- pytest --noconftest test_nvs_gen_check.py --junitxml=XUNIT_RESULT.xml
- MINIMAL_SUPPORTED_CMAKE_VERSION=$(echo "${INSTALL_EXTRA_TOOLS}" | sed -n 's/.*cmake@\([0-9.]*\).*/\1/p')
- export PATH=$(echo "$PATH" | sed -E "s|/tools/cmake/[0-9.]+|/tools/cmake/${MINIMAL_SUPPORTED_CMAKE_VERSION}|")
- ACTUAL_CMAKE_VERSION=$(cmake --version | head -n1 | awk '{print $3}')
- |
if [ "${ACTUAL_CMAKE_VERSION}" != "${MINIMAL_SUPPORTED_CMAKE_VERSION}" ]; then
echo "ERROR: Wrong minimal CMake version! Detected: ${ACTUAL_CMAKE_VERSION}, but should be: ${MINIMAL_SUPPORTED_CMAKE_VERSION}"
exit 1
fi
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest
-k cmake
--cleanup-idf-copy
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--work-dir ${CI_PROJECT_DIR}/test_build_system
--junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
test_esp_rom:
extends: .host_test_template
artifacts:
paths:
- XUNIT_RESULT.xml
reports:
junit: XUNIT_RESULT.xml
pytest_build_system:
extends: .test_build_system_template
parallel: 3
pytest_buildv2_system:
extends:
- .test_build_system_template
- .rules:labels:buildv2
parallel: 3
script:
- cd ${IDF_PATH}/components/esp_rom/
- pytest --noconftest test_esp_rom.py --junitxml=XUNIT_RESULT.xml
- ${IDF_PATH}/tools/ci/test_configure_ci_environment.sh
- cd ${IDF_PATH}/tools/test_build_system
- run_cmd idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest
--buildv2
--cleanup-idf-copy
--parallel-count ${CI_NODE_TOTAL:-1}
--parallel-index ${CI_NODE_INDEX:-1}
--work-dir ${CI_PROJECT_DIR}/test_build_system
--junitxml ${CI_PROJECT_DIR}/XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--
test_non_default_target.py
test_component_manager.py
test_build.py
test_bootloader.py
test_git.py
test_kconfig.py
test_partition.py
test_reproducible_build.py
test_sdkconfig.py
test_versions.py
test_common.py
test_components.py
test_cmake.py
test_idf_extension.py
test_rebuild.py
make_sure_soc_caps_compatible_in_idf_build_apps:
extends:
- .host_test_template
- .rules:dev-push
artifacts:
paths:
- new.json
- base.json
when: always
when: manual
script:
- python tools/ci/idf_build_apps_dump_soc_caps.py new.json
- git fetch --depth=1 origin $CI_MERGE_REQUEST_DIFF_BASE_SHA
- git checkout -f $CI_MERGE_REQUEST_DIFF_BASE_SHA
- git checkout $CI_COMMIT_SHA -- tools/ci/idf_build_apps_dump_soc_caps.py
- python tools/ci/idf_build_apps_dump_soc_caps.py base.json
- diff new.json base.json
pytest_build_system_macos:
extends:
- .test_build_system_template
- .brew-macos-settings
- .rules:build:macos
parallel: 3
pytest_build_system_minimal_cmake:
extends: .test_build_system_minimal_cmake_template
pytest_build_system_macos_minimal_cmake:
extends:
- .test_build_system_minimal_cmake_template
- .brew-macos-settings
- .rules:build:macos
variables:
INSTALL_EXTRA_TOOLS: ninja cmake@3.22.1

View File

@@ -60,6 +60,9 @@ child_integration_test_pipeline:
stage: assign_test
needs:
- gen_integration_pipeline
variables:
IDF_S3_SERVER: $IDF_S3_NEW_SERVER
IDF_S3_ACCESS_KEY: $IDF_S3_NEW_ACCESS_KEY
trigger:
include:
- artifact: idf-integration-ci/child_pipeline/pipeline.yml

View File

@@ -7,7 +7,9 @@ generate_failed_jobs_report:
- .post_deploy_template
tags: [build, shiny]
when: always
dependencies: [] # Do not download artifacts from the previous stages
dependencies: # Do not download artifacts from the previous stages
needs:
- pipeline_variables
artifacts:
expire_in: 2 week
when: always

View File

@@ -1,8 +1,7 @@
.pre_check_template:
stage: pre_check
image: $ESP_ENV_IMAGE
tags:
- host_test
tags: [build, shiny]
dependencies: # set dependencies to null to avoid missing artifacts issue
check_version:
@@ -117,22 +116,10 @@ check_test_scripts_build_test_rules:
extends:
- .pre_check_template
- .before_script:build
variables:
PYTEST_IGNORE_COLLECT_IMPORT_ERROR: "1"
script:
# requires basic pytest dependencies
- run_cmd bash install.sh --enable-pytest
- python tools/ci/check_build_test_rules.py check-test-scripts examples/ tools/test_apps components
check_configure_ci_environment_parsing:
extends:
- .pre_check_template
- .before_script:build
- .rules:build
script:
- cd tools/ci
- python -m unittest ci_build_apps.py
pipeline_variables:
extends:
- .pre_check_template
@@ -142,11 +129,10 @@ pipeline_variables:
# MODIFIED_FILES is a list of files that changed, could be used everywhere
- MODIFIED_FILES=$(echo "$GIT_DIFF_OUTPUT" | xargs)
- echo "MODIFIED_FILES=$MODIFIED_FILES" >> pipeline.env
- echo "REPORT_EXIT_CODE=0" >> pipeline.env
# MR_MODIFIED_FILES and MR_MODIFIED_COMPONENTS are semicolon separated lists that is used in MR only
# for non MR pipeline, these are empty lists
- |
if [ $IS_MR_PIPELINE == "0" ]; then
if [ -z "$CI_MERGE_REQUEST_IID" ]; then
echo "MR_MODIFIED_FILES=\"\"" >> pipeline.env
echo "MR_MODIFIED_COMPONENTS=\"\"" >> pipeline.env
else
@@ -157,19 +143,14 @@ pipeline_variables:
echo "MR_MODIFIED_COMPONENTS=\"$MR_MODIFIED_COMPONENTS\"" >> pipeline.env
fi
- |
if echo "$CI_MERGE_REQUEST_LABELS" | egrep "(^|,)BUILD_AND_TEST_ALL_APPS(,|$)"; then
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
fi
# run full pipeline if testing constraint branch
- |
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
if [ -n "$PIPELINE_COMMIT_SHA" ]; then
echo "PIPELINE_COMMIT_SHA=$PIPELINE_COMMIT_SHA" >> 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
- run_cmd idf-ci gitlab pipeline-variables >> pipeline.env
- cat pipeline.env
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
- run_cmd idf-ci gitlab upload-artifacts --type env
artifacts:
reports:
dotenv: pipeline.env
@@ -210,14 +191,24 @@ baseline_manifest_sha:
expire_in: 1 week
when: always
redundant_pass_job:
stage: pre_check
tags: [shiny, fast_run]
image: $ESP_ENV_IMAGE
dependencies: null
before_script: []
cache: []
extends: []
gcc_static_analyzer:
extends:
- .pre_check_template
- .rules:build
variables:
CI_CCACHE_DISABLE: 1
ANALYZING_APP: "examples/get-started/hello_world"
script:
- echo "This job is redundant to ensure the 'retry_failed_jobs' job can exist and not be skipped"
when: always
- echo "CONFIG_COMPILER_STATIC_ANALYZER=y" >> ${ANALYZING_APP}/sdkconfig.defaults
- idf-build-apps build -p ${ANALYZING_APP}
retry_failed_jobs:
extends:
- .pre_check_template
- .rules:dev-push
tags: [shiny, fast_run]
allow_failure: true
script:
- echo "Retrieving and retrying all failed jobs for the pipeline..."
- python tools/ci/python_packages/gitlab_api.py retry_failed_jobs $CI_MERGE_REQUEST_PROJECT_ID --pipeline_id $CI_PIPELINE_ID
when: manual

View File

@@ -2,33 +2,20 @@
extends:
- .before_script:minimal
stage: pre_check
image: $PRE_COMMIT_IMAGE
tags: [cache, shiny]
image: "${CI_DOCKER_REGISTRY}/esp-idf-pre-commit:2"
tags: [pre-commit]
variables:
# Both shiny and brew runners can pick this job
GIT_STRATEGY: fetch
GIT_DEPTH: 1
SUBMODULES_TO_FETCH: "all"
needs:
- pipeline_variables
variables:
# cache pre_commit
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
script:
- fetch_submodules
- pre-commit run --files $MODIFIED_FILES
- pre-commit run --hook-stage post-commit validate-sbom-manifest
check_pre_commit_upload_cache:
extends:
- .check_pre_commit_template
rules:
- if: '($CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_BRANCH =~ /^release\/v/) && $CI_PIPELINE_SOURCE == "push"'
cache:
- key: pre_commit-cache-${LATEST_GIT_TAG}
paths:
- .cache/pre-commit
policy: pull-push
- key: submodule-cache-${LATEST_GIT_TAG}
paths:
- .cache/submodule_archives
policy: pull
check_pre_commit:
extends:
- .check_pre_commit_template
@@ -37,10 +24,6 @@ check_pre_commit:
when: never
- when: on_success
cache:
- key: pre_commit-cache-${LATEST_GIT_TAG}
paths:
- .cache/pre-commit
policy: pull
- key: submodule-cache-${LATEST_GIT_TAG}
paths:
- .cache/submodule_archives
@@ -56,25 +39,20 @@ check_powershell:
tags:
- dind
- amd64
- brew # faster "apk add"
needs:
- pipeline_variables
variables:
# cache pre_commit
PRE_COMMIT_HOME: "$CI_PROJECT_DIR/.cache/pre-commit"
# brew runners always use fetch
GIT_STRATEGY: fetch
GIT_DEPTH: 1
SUBMODULES_TO_FETCH: "none"
rules:
- changes:
- "*.ps1"
- ".gitlab/ci/pre_commit.yml"
script:
- apk add python3
- apk add py3-pip
- pip install pre-commit --break-system-packages
- pre-commit run --hook-stage manual check-powershell-scripts --files $MODIFIED_FILES
cache:
- key: pre_commit-cache-${LATEST_GIT_TAG}
paths:
- .cache/pre-commit
policy: pull
- key: submodule-cache-${LATEST_GIT_TAG}
paths:
- .cache/submodule_archives
policy: pull

View File

@@ -1,15 +0,0 @@
retry_failed_jobs:
stage: retry_failed_jobs
tags: [shiny, fast_run]
allow_failure: true
image: $ESP_ENV_IMAGE
dependencies: null
before_script: []
cache: []
extends: []
script:
- echo "Retrieving and retrying all failed jobs for the pipeline..."
- python tools/ci/python_packages/gitlab_api.py retry_failed_jobs $CI_MERGE_REQUEST_PROJECT_ID --pipeline_id $CI_PIPELINE_ID
when: manual
needs:
- redundant_pass_job

View File

@@ -10,7 +10,7 @@
- "**/*.{c,C,cpp}"
- "**/*.{h,H,hpp}"
- "components/**/Kconfig"
- "components/**/CMakeList.txt"
- "components/**/CMakeLists.txt"
.patterns-python-cache: &patterns-python-cache
- "tools/requirements.json"
@@ -41,11 +41,9 @@
- "tools/idf_tools.py"
- "tools/tools.json"
.patterns-build_template-app: &patterns-build_template-app
- "tools/ci/build_template_app.sh"
.patterns-build_system: &patterns-build_system
- "tools/cmake/**/*"
- "tools/cmakev2/**/*"
- "tools/kconfig_new/**/*"
- "tools/idf.py"
- "tools/idf_py_actions/**/*"
@@ -53,15 +51,12 @@
- "tools/ci/ignore_build_warnings.txt"
- "tools/ci/test_build_system*.sh"
- "tools/ci/test_build_system*.py"
- "tools/ci/ci_build_apps.py"
- "tools/ci/build_template_app.sh"
- "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"
.patterns-build_check: &patterns-build_check
- "tools/test_build_system/**/*"
- "tools/ci/test_configure_ci_environment.sh"
@@ -134,6 +129,8 @@
- "tools/bsasm.py"
- "tools/test_bsasm/**/*"
- "tools/ci/test_soc_headers_load_in_idf_build_apps.py"
.patterns-docker: &patterns-docker
- "tools/docker/**/*"
@@ -148,10 +145,8 @@
- "components/esp_phy/lib"
- "components/esp_wifi/lib"
- "components/esp_coex/lib"
- "components/json/cJSON"
- "components/lwip/lwip"
- "components/mbedtls/mbedtls"
- "components/mqtt/esp-mqtt"
- "components/openthread/lib"
- "components/openthread/openthread"
- "components/protobuf-c/protobuf-c"
@@ -163,10 +158,6 @@
- "components/bt/esp_ble_mesh/lib/lib"
- ".gitmodules"
.patterns-idf-pytest-plugin: &patterns-idf-pytest-plugin
- "tools/ci/idf_pytest/**/*"
- "tools/ci/dynamic_pipelines/tests/**/*"
##############
# if anchors #
##############
@@ -266,12 +257,6 @@
# - <<: *if-dev-push
# changes: *patterns-sonarqube-files
.rules:patterns:idf-pytest-plugin:
rules:
- <<: *if-protected-check
- <<: *if-dev-push
changes: *patterns-idf-pytest-plugin
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# DO NOT place comments or maintain any code from this line
#
@@ -287,6 +272,9 @@
.if-label-build: &if-label-build
if: '$BOT_LABEL_BUILD || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*build(?:,[^,\n\r]+)*$/i'
.if-label-buildv2: &if-label-buildv2
if: '$BOT_LABEL_BUILDV2 || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*buildv2(?:,[^,\n\r]+)*$/i'
.if-label-docker: &if-label-docker
if: '$BOT_LABEL_DOCKER || $CI_MERGE_REQUEST_LABELS =~ /^(?:[^,\n\r]+,)*docker(?:,[^,\n\r]+)*$/i'
@@ -357,30 +345,14 @@
- <<: *if-revert-branch
when: never
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-label-macos
- <<: *if-label-macos_test
- <<: *if-dev-push
changes: *patterns-build_macos
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-downloadable-tools
.rules:build:target_test:
.rules:labels:buildv2:
rules:
- <<: *if-revert-branch
when: never
- <<: *if-protected-check
- <<: *if-label-build
- <<: *if-dev-push
changes: *patterns-build_components
- <<: *if-dev-push
changes: *patterns-build_system
- <<: *if-dev-push
changes: *patterns-build_template-app
- <<: *if-dev-push
changes: *patterns-downloadable-tools
- <<: *if-label-buildv2
.rules:labels:nvs_coverage:
rules:

View File

@@ -3,8 +3,7 @@
extends: .rules:test:host_test
stage: host_test
image: $ESP_ENV_IMAGE
tags:
- windows-build
tags: [windows-build, brew]
dependencies: # set dependencies to null to avoid missing artifacts issue
# run host_test jobs immediately, only after upload cache
needs:
@@ -14,7 +13,12 @@
- job: upload-submodules-cache
optional: true
artifacts: false
before_script: []
variables:
GIT_STRATEGY: fetch # use brew local mirror first
before_script:
- if ($env:IDF_DONT_USE_MIRRORS) {
$env:IDF_MIRROR_PREFIX_MAP = ""
}
after_script: []
test_cli_installer_win:
@@ -36,7 +40,7 @@ test_cli_installer_win:
script:
# Tools must be downloaded for testing
# cmake@version that is supported
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.16.3
- python ${IDF_PATH}\tools\idf_tools.py download required qemu-riscv32 qemu-xtensa cmake cmake@3.22.1
- cd ${IDF_PATH}\tools\test_idf_tools
- python -m pip install jsonschema
- python .\test_idf_tools.py
@@ -46,6 +50,7 @@ test_tools_win:
extends:
- .host_test_win_template
- .rules:labels:windows_pytest_build_system
parallel: 4
artifacts:
paths:
- ${IDF_PATH}/*.out
@@ -59,12 +64,12 @@ test_tools_win:
PYTHONPATH: "$PYTHONPATH;$IDF_PATH\\tools;$IDF_PATH\\tools\\esp_app_trace;$IDF_PATH\\components\\partition_table;$IDF_PATH\\tools\\ci\\python_packages"
script:
- python -m pip install jsonschema
- .\install.ps1 --enable-ci --enable-pytest
- .\install.ps1 --enable-ci
- .\export.ps1
- python "${SUBMODULE_FETCH_TOOL}" -s "all"
- cd ${IDF_PATH}/tools/test_idf_py
- pytest --noconftest test_idf_py.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY.xml
- pytest --noconftest test_hints.py --junitxml=${IDF_PATH}/XUNIT_HINTS.xml
- idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest --parallel-count ${CI_NODE_TOTAL} --parallel-index ${CI_NODE_INDEX} --junitxml=${IDF_PATH}/XUNIT_RESULT.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
# Build tests
.test_build_system_template_win:
@@ -77,20 +82,20 @@ test_tools_win:
after_script: []
timeout: 4 hours
script:
- .\install.ps1 --enable-ci --enable-pytest
- .\install.ps1 --enable-ci
- . .\export.ps1
- python "${SUBMODULE_FETCH_TOOL}" -s "all"
- cd ${IDF_PATH}\tools\test_build_system
- pytest --parallel-count ${CI_NODE_TOTAL} --parallel-index ${CI_NODE_INDEX} --junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml
- idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest --parallel-count ${CI_NODE_TOTAL} --parallel-index ${CI_NODE_INDEX} --junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
pytest_build_system_win:
extends:
- .test_build_system_template_win
- .rules:labels:windows_pytest_build_system
parallel: 2
parallel: 6
needs: []
tags:
- windows-build
tags: [windows-build, brew]
artifacts:
paths:
- XUNIT_RESULT.xml
@@ -99,3 +104,79 @@ pytest_build_system_win:
reports:
junit: XUNIT_RESULT.xml
when: always
pytest_build_system_win_minimal_cmake:
extends:
- .test_build_system_template_win
- .rules:labels:windows_pytest_build_system
needs: []
tags: [windows-build, brew]
artifacts:
paths:
- XUNIT_RESULT.xml
- test_build_system
expire_in: 2 days
reports:
junit: XUNIT_RESULT.xml
when: always
variables:
MINIMAL_CMAKE_VERSION: "3.22.1"
script:
- .\install.ps1 --enable-ci
- . .\export.ps1
- python ${IDF_PATH}\tools\idf_tools.py install cmake@${MINIMAL_CMAKE_VERSION}
- $Env:PATH = "$Env:USERPROFILE\.espressif\tools\cmake\${MINIMAL_CMAKE_VERSION}\bin;$Env:PATH"
- |
$actualVersion = (& cmake --version).Split()[2]
if ($actualVersion -ne $Env:MINIMAL_CMAKE_VERSION) {
Write-Error "ERROR: Wrong CMake version! Detected: $actualVersion, but expected: $Env:MINIMAL_CMAKE_VERSION"
exit 1
}
- python "${SUBMODULE_FETCH_TOOL}" -s "all"
- cd ${IDF_PATH}\tools\test_build_system
- idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest -k cmake --junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml --ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
pytest_buildv2_system_win:
extends:
- .test_build_system_template_win
- .rules:labels:buildv2
parallel: 2
needs: []
tags: [windows-build, brew]
artifacts:
paths:
- XUNIT_RESULT.xml
- test_build_system
expire_in: 2 days
reports:
junit: XUNIT_RESULT.xml
when: always
script:
- .\install.ps1 --enable-ci
- . .\export.ps1
- python "${SUBMODULE_FETCH_TOOL}" -s "all"
- cd ${IDF_PATH}\tools\test_build_system
- idf-ci gitlab download-known-failure-cases-file ${KNOWN_FAILURE_CASES_FILE_NAME}
- pytest
--buildv2
--parallel-count ${CI_NODE_TOTAL}
--parallel-index ${CI_NODE_INDEX}
--junitxml=${CI_PROJECT_DIR}\XUNIT_RESULT.xml
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--
test_non_default_target.py
test_component_manager.py
test_build.py
test_bootloader.py
test_git.py
test_kconfig.py
test_partition.py
test_reproducible_build.py
test_sdkconfig.py
test_versions.py
test_common.py
test_components.py
test_cmake.py
test_idf_extension.py
test_rebuild.py

View File

@@ -21,7 +21,7 @@ upload-pip-cache:
policy: push
script:
- rm -rf .cache/pip # clear old packages
- bash install.sh --enable-ci --enable-pytest
- bash install.sh --enable-ci --enable-test-specific
parallel:
matrix:
- GEO: [ 'shiny', 'brew' ]

View File

@@ -9,11 +9,6 @@
## Related <!-- Optional -->
<!-- Related Jira issues and Github issues or write "No related issues"-->
## Release notes <!-- Mandatory -->
<!-- Either state release notes or write "No release notes" -->
<!-- ## Breaking change notes --><!-- Optional -->
<!-- ## Dynamic Pipeline Configuration
```yaml
Test Case Filters:

View File

@@ -39,27 +39,5 @@ _For other small/non-public changes, which are not expected to be in the release
* Mention submodule MR, if there is
* Mention backport(ed) MR, if there is
_Don't touch the subsection titles below, they will be parsed by scripts._
## Release notes <!-- Mandatory -->
_Changes made in this MR that should go into the **Release Notes** should be listed here. Please use **past tense** and *specify the area (see maintainers page of IDF internal wiki)*. If there is a subscope, include it and separate with slash (`/`). Minor changes can go to the descriptions above without a release notes entry._
_Write all the changes in a **list** (Start at the beginning of the line with `-` or `*`). If multiple changes are made, each of them should take a single line. If there is only one change to list, it should still be the only line of a list. If this MR does not need any release notes, write "No release notes" here without the `-` or `*`. e.g._
* [WiFi] Changed/fixed/updated xxx
* [WiFi] Added support of xxx
* [Peripheral Drivers/I2S] Fixed xxx (https://github.com/espressif/esp-idf/issues/xxxx)
## Breaking change notes
_Remove this subsection if not used._
_If there are any breaking changes, please mention it here. Talking about (1) what is not accepted any more, (2) the alternative solution and (3) the benefits/reason. e.g._
_Please strictly follow the breaking change restriction, which means, if there is a breaking change but you are merging to non-major versions, you have to separate the breaking part out to another MR for a major version. The breaking change subsection is only accepted in MRs merging to major versions._
* [VFS/UART] Now vfs_uart_set_rts_cts accept one more instance argument, to support configuration to different ports.
<!-- Don't remove the next line - assigns the MR author as the assignee -->
/assign me

17
.gitmodules vendored
View File

@@ -46,19 +46,6 @@
sbom-description = Wear-leveled SPI flash file system for embedded devices
sbom-hash = 0dbb3f71c5f6fae3747a9d935372773762baf852
[submodule "components/json/cJSON"]
path = components/json/cJSON
url = ../../DaveGamble/cJSON.git
sbom-version = 1.7.18
sbom-cpe = cpe:2.3:a:cjson_project:cjson:{}:*:*:*:*:*:*:*
sbom-supplier = Person: Dave Gamble
sbom-url = https://github.com/DaveGamble/cJSON
sbom-description = Ultralightweight JSON parser in ANSI C
sbom-hash = 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
url = ../../espressif/mbedtls.git
@@ -67,10 +54,6 @@
path = components/lwip/lwip
url = ../../espressif/esp-lwip.git
[submodule "components/mqtt/esp-mqtt"]
path = components/mqtt/esp-mqtt
url = ../../espressif/esp-mqtt.git
[submodule "components/protobuf-c/protobuf-c"]
path = components/protobuf-c/protobuf-c
url = ../../protobuf-c/protobuf-c.git

68
.idf_build_apps.toml Normal file
View File

@@ -0,0 +1,68 @@
config_rules = [
'sdkconfig.ci=default',
'sdkconfig.ci.*=',
'=default',
]
extra_pythonpaths = [
'$IDF_PATH/tools/ci/python_packages',
'$IDF_PATH/tools/ci',
'$IDF_PATH/tools',
]
build_system = "idf_ci_local.app:IdfCMakeApp"
recursive = true
check_warnings = true
keep_going = true
copy_sdkconfig = true
ignore_warning_files = [
'$IDF_PATH/tools/ci/ignore_build_warnings.txt',
]
build_dir = "build_@t_@w"
build_log_filename = "build_log.txt"
size_json_filename = "size_${CI_JOB_ID}.json"
verbose = 1 # INFO
additional_build_targets = [
'esp32h21',
'esp32h4',
]
# collect
collect_app_info_filename = "app_info_${CI_JOB_NAME_SLUG}.txt"
junitxml = "build_summary_${CI_JOB_NAME_SLUG}.xml"
# manifest
check_manifest_rules = true
manifest_rootpath = "$IDF_PATH"
manifest_filepatterns = [
'**/.build-test-rules.yml',
]
# dependency-driven build
deactivate_dependency_driven_build_by_components = [
'cxx',
'esp_common',
'esp_hw_support',
'esp_rom',
'esp_system',
'esp_timer',
'freertos',
'hal',
'heap',
'log',
'esp_libc',
'riscv',
'soc',
'xtensa',
]
deactivate_dependency_driven_build_by_filepatterns = [
# tools
'tools/cmake/**/*',
'tools/tools.json',
# ci
'tools/ci/ignore_build_warnings.txt',
]

106
.idf_ci.toml Normal file
View File

@@ -0,0 +1,106 @@
preserve_non_test_related_apps = false
exclude_dirs = [
'tools/test_mkdfu',
'tools/test_idf_size',
'tools/test_idf_py',
'tools/test_idf_diag',
'tools/test_bsasm',
'tools/ci/test_autocomplete',
'tools/test_build_system',
]
[local_runtime_envs]
EXTRA_CFLAGS = "-Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function -Wstrict-prototypes"
EXTRA_CXXFLAGS = "-Werror -Werror=deprecated-declarations -Werror=unused-variable -Werror=unused-but-set-variable -Werror=unused-function"
LDGEN_CHECK_MAPPING = "1"
IDF_CI_BUILD = "1"
[gitlab]
[gitlab.build_pipeline]
workflow_name = "build_child_pipeline"
presigned_json_job_name = 'generate_pytest_build_report'
job_tags = ['build', 'shiny']
job_template_name = '.dynamic_build_template'
job_template_jinja = '' # write in tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
pre_yaml_jinja = """
include:
- .gitlab/ci/common.yml
- tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
- tools/ci/dynamic_pipelines/templates/test_child_pipeline.yml
"""
yaml_jinja = """
{{ settings.gitlab.build_pipeline.pre_yaml_jinja }}
workflow:
name: {{ settings.gitlab.build_pipeline.workflow_name }}
rules:
- when: always
{{ jobs }}
""" # simplified since we included the tools/ci/dynamic_pipelines/templates/test_child_pipeline.yml
[gitlab.test_pipeline]
job_template_name = '.dynamic_target_test_template'
job_template_jinja = '' # write in tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
pre_yaml_jinja = """
include:
- .gitlab/ci/common.yml
- tools/ci/dynamic_pipelines/templates/.dynamic_jobs.yml
"""
[gitlab.artifacts.s3.debug]
bucket = "idf-artifacts"
patterns = [
'**/build*/bootloader/*.map',
'**/build*/bootloader/*.elf',
'**/build*/*.map',
'**/build*/*.elf',
# customized
'**/build*/esp_tee/*.map',
'**/build*/esp_tee/*.elf',
'**/build*/gdbinit/*',
]
[gitlab.artifacts.s3.flash]
bucket = "idf-artifacts"
patterns = [
'**/build*/bootloader/*.bin',
'**/build*/*.bin',
'**/build*/partition_table/*.bin',
'**/build*/flasher_args.json',
'**/build*/flash_project_args',
'**/build*/config/sdkconfig.json',
'**/build*/sdkconfig',
'**/build*/project_description.json',
# customized
'**/build*/esp_tee/*.bin',
]
[gitlab.artifacts.s3.log]
bucket = "idf-artifacts"
patterns = [
'**/build*/build_log.txt',
'**/build*/size*.json',
]
[gitlab.artifacts.s3.junit]
bucket = "idf-artifacts"
patterns = [
'**/XUNIT_RESULT_*.xml',
'**/build_summary_*.xml',
]
[gitlab.artifacts.s3.env]
bucket = "idf-artifacts"
patterns = [
'**/pipeline.env',
]
[gitlab.artifacts.s3.longterm]
bucket = "longterm"
if_clause = '"$CI_COMMIT_REF_NAME" == "master"'
patterns = [
'**/build*/size*.json',
]

View File

@@ -1,7 +1,7 @@
[mypy]
# Specifies the Python version used to parse and check the target program
python_version = 3.9
python_version = 3.10
# Disallows defining functions without type annotations or with incomplete type annotations
# True => enforce type annotation in all function definitions

View File

@@ -9,27 +9,7 @@ repos:
hooks:
- id: ruff-format
- id: ruff
args: [ "--fix" ]
- repo: local
hooks:
- id: pytest-linter
name: Pytest Linter Check
entry: tools/ci/check_test_files.py
language: python
files: 'pytest_.*\.py$'
require_serial: true
additional_dependencies:
- pytest-embedded-idf[serial]~=1.16
- pytest-embedded-jtag~=1.16
- pytest-embedded-qemu~=1.16
- pytest-ignore-test-results~=0.3
- pytest-rerunfailures
- pytest-timeout
- idf-build-apps~=2.8
- python-gitlab
- minio
- click
- esp-idf-monitor
args: [ "--fix", "--show-fixes" ]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
@@ -51,6 +31,7 @@ repos:
.*.pb-c.c|
.*.yuv|
.*.rgb|
.*.gray|
.*COPYING.*|
docs/sphinx-known-warnings\.txt
)$
@@ -163,7 +144,7 @@ repos:
require_serial: true
additional_dependencies:
- PyYAML == 5.3.1
- idf-build-apps>=2.8,<3
- idf-build-apps~=2.13
- id: sort-yaml-files
name: sort yaml files
entry: tools/ci/sort_yaml.py
@@ -178,15 +159,6 @@ repos:
files: 'tools/ci/sort_yaml\.py$'
additional_dependencies:
- ruamel.yaml
- id: check-build-test-rules-path-exists
name: check path in .build-test-rules.yml exists
entry: tools/ci/check_build_test_rules.py check-exist
language: python
additional_dependencies:
- PyYAML == 5.3.1
always_run: true
pass_filenames: false
require_serial: true
- id: cleanup-ignore-lists
name: Remove non-existing patterns from ignore lists
entry: tools/ci/cleanup_ignore_lists.py
@@ -205,7 +177,12 @@ repos:
rev: v4.0.1
hooks:
- id: file-contents-sorter
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt|check_copyright_ignore\.txt)'
files: "tools/ci/(\
executable-list\\.txt\
|mypy_ignore_list\\.txt\
|check_copyright_ignore\\.txt\
|exclude_check_tools_files\\.txt\
)"
- repo: https://github.com/espressif/check-copyright/
rev: v1.1.1
hooks:
@@ -250,7 +227,7 @@ repos:
name: Lint rST files in docs folder using Sphinx Lint
files: ^(docs/en|docs/zh_CN)/.*\.(rst|inc)$
- repo: https://github.com/espressif/esp-idf-kconfig.git
rev: v2.5.0
rev: v3.2.0
hooks:
- id: check-kconfig-files
- id: check-deprecated-kconfig-options

View File

@@ -1,21 +0,0 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Optionally build your docs in additional formats such as PDF and ePub
formats:
- pdf
# Optionally set the version of Python and requirements required to build your docs
python:
version: 2.7
install:
- requirements: docs/requirements.txt
# We need to list all the submodules included in documentation build by Doxygen
submodules:
include:
- components/mqtt/esp-mqtt

View File

@@ -1,12 +1,12 @@
cmake_minimum_required(VERSION 3.16)
project(esp-idf C CXX ASM)
cmake_minimum_required(VERSION 3.22)
if(CMAKE_CURRENT_LIST_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "Current directory '${CMAKE_CURRENT_LIST_DIR}' is not buildable. "
"Change directories to one of the example projects in '${CMAKE_CURRENT_LIST_DIR}/examples' and try "
"again.")
"Change directories to one of the example projects in '${CMAKE_CURRENT_LIST_DIR}/examples' and try again.")
endif()
project(esp-idf C CXX ASM)
# Variables compile_options, c_compile_options, cxx_compile_options, compile_definitions, link_options shall
# not be unset as they may already contain flags, set by toolchain-TARGET.cmake files.
@@ -23,14 +23,15 @@ if(BOOTLOADER_BUILD)
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks")
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
list(APPEND compile_options "-mno-target-align")
endif()
endif()
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG)
list(APPEND compile_options "-Og")
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CONFIG_IDF_TARGET_LINUX)
list(APPEND compile_options "-fno-shrink-wrap") # Disable shrink-wrapping to reduce binary size
endif()
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE)
list(APPEND compile_options "-O0")
elseif(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF)
list(APPEND compile_options "-O2")
endif()
@@ -54,6 +55,9 @@ else()
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks")
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
list(APPEND compile_options "-mno-target-align")
endif()
endif()
elseif(CONFIG_COMPILER_OPTIMIZATION_DEBUG)
list(APPEND compile_options "-Og")
@@ -105,8 +109,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Wno-char-subscripts")
# Clang seems to notice format string issues which GCC doesn't.
list(APPEND compile_options "-Wno-format-security")
# Logic bug in essl component
list(APPEND compile_options "-Wno-tautological-overlap-compare")
# Some pointer checks in mDNS component check addresses which can't be NULL
list(APPEND compile_options "-Wno-tautological-pointer-compare")
# Similar to the above, in tcp_transport
@@ -157,6 +159,10 @@ if(CONFIG_COMPILER_NO_MERGE_CONSTANTS)
list(APPEND compile_options "-fno-merge-constants")
endif()
if(CONFIG_COMPILER_ENABLE_TEXT_SECTION_LITERALS)
list(APPEND compile_options "-mtext-section-literals")
endif()
if(CONFIG_COMPILER_STACK_CHECK_MODE_NORM)
list(APPEND compile_options "-fstack-protector")
elseif(CONFIG_COMPILER_STACK_CHECK_MODE_STRONG)
@@ -169,6 +175,18 @@ if(CONFIG_COMPILER_DUMP_RTL_FILES)
list(APPEND compile_options "-fdump-rtl-expand")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 15.0)
list(APPEND c_compile_options "-fzero-init-padding-bits=all" "-fno-malloc-dce")
endif()
if(CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD_CONSTEXPR)
list(APPEND cxx_compile_options "-D_GLIBCXX20_CONSTEXPR=__attribute__((cold)) constexpr")
list(APPEND cxx_compile_options "-D_GLIBCXX23_CONSTEXPR=__attribute__((cold)) constexpr")
elseif(CONFIG_COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD)
list(APPEND cxx_compile_options "-D_GLIBCXX20_CONSTEXPR=__attribute__((cold))")
list(APPEND cxx_compile_options "-D_GLIBCXX23_CONSTEXPR=__attribute__((cold))")
endif()
__generate_prefix_map(prefix_map_compile_options)
list(APPEND compile_options ${prefix_map_compile_options})
@@ -188,6 +206,15 @@ if(CONFIG_COMPILER_DISABLE_GCC14_WARNINGS)
list(APPEND compile_options "-Wno-calloc-transposed-args")
endif()
if(CONFIG_COMPILER_DISABLE_GCC15_WARNINGS)
list(APPEND c_compile_options "-Wno-unterminated-string-initialization")
list(APPEND c_compile_options "-Wno-header-guard")
list(APPEND cxx_compile_options "-Wno-self-move")
list(APPEND cxx_compile_options "-Wno-template-body")
list(APPEND cxx_compile_options "-Wno-dangling-reference")
list(APPEND cxx_compile_options "-Wno-defaulted-function-deleted")
endif()
if(CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS)
if(NOT CMAKE_C_COMPILER_ID MATCHES "Clang")
idf_build_replace_option_from_property(COMPILE_OPTIONS "-Werror" "-Werror=all")
@@ -305,3 +332,12 @@ foreach(component_target ${build_component_targets})
endif()
set(__idf_component_context 0)
endforeach()
# Run component validation checks after all components have been processed
# Only run validation for the main project, not subprojects like bootloader
idf_build_get_property(bootloader_build BOOTLOADER_BUILD)
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
if(NOT bootloader_build AND NOT esp_tee_build)
include("${CMAKE_CURRENT_LIST_DIR}/tools/cmake/component_validation.cmake")
__component_validation_run_checks()
endif()

View File

@@ -10,7 +10,7 @@ NOTE: This document on release branches may be out-of-date. Check the [Compatibi
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/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
@@ -140,6 +140,12 @@ Supported since ESP-IDF v5.1.
| release/v5.4 | v5.4.1+ | v5.4.1 |
| release/v5.5 and above | v5.5+ | v5.5 |
### ESP32-P4
#### v1.0, v1.3
Supported since ESP-IDF v5.3.
## What If the ESP-IDF Version Is Lower than the `Required` Version?
Latest ESP-IDF versions can prevent from downloading to, or even execute binaries on unsupported chips. ESP-IDF of versions v4.4.5+, v5.0.1+, v5.1 and above have both esptool download check and bootloader loading check against the chip revision. While ESP-IDF v4.3.5 has only esptool downloading check.

View File

@@ -10,7 +10,7 @@
有关乐鑫芯片版本的编码方式,请参考 [关于芯片版本 (Chip Revision) 编码方式的兼容性公告](https://www.espressif.com/sites/default/files/advisory_downloads/AR2022-005%20%E5%85%B3%E4%BA%8E%E8%8A%AF%E7%89%87%E7%89%88%E6%9C%AC%E7%BC%96%E7%A0%81%E6%96%B9%E5%BC%8F%20%28Chip%20Revision%29%20%E7%9A%84%E5%85%BC%E5%AE%B9%E6%80%A7%E5%85%AC%E5%91%8A.pdf)。
运行 `esptool chip_id` 可查看芯片系列及其版本。有关区分芯片版本及版本改进内容的更多信息,请参考 [芯片勘误表](https://www.espressif.com.cn/zh-hans/support/documents/technical-documents?keys=%E5%8B%98%E8%AF%AF%E8%A1%A8)。运行 `idf.py --version` 可查看当前的 ESP-IDF 版本。
运行 `esptool chip-id` 可查看芯片系列及其版本。有关区分芯片版本及版本改进内容的更多信息,请参考 [芯片勘误表](https://www.espressif.com.cn/zh-hans/support/documents/technical-documents?keys=%E5%8B%98%E8%AF%AF%E8%A1%A8)。运行 `idf.py --version` 可查看当前的 ESP-IDF 版本。
## ESP-IDF 对各芯片版本的支持
@@ -140,6 +140,11 @@
| release/v5.4 | v5.4.1+ | v5.4.1 |
| release/v5.5 及以上 | v5.5+ | v5.5 |
### ESP32-P4
#### v1.0, v1.3
从 ESP-IDF v5.3 开始支持。
## 如果 ESP-IDF 版本低于 `需求版本` 会出现什么情况?

106
Kconfig
View File

@@ -142,11 +142,19 @@ mainmenu "Espressif IoT Development Framework Configuration"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
select IDF_ENV_BRINGUP
select IDF_ENV_FPGA if ESP32H21_SELECTS_REV_MP
config IDF_TARGET_ESP32H4
bool
default "y" if IDF_TARGET="esp32h4"
select IDF_TARGET_ARCH_RISCV
select IDF_ENV_BRINGUP
select IDF_ENV_FPGA if ESP32H4_SELECTS_REV_MP
config IDF_TARGET_ESP32S31
bool
default "y" if IDF_TARGET="esp32s31"
select IDF_TARGET_ARCH_RISCV
select IDF_ENV_FPGA
select IDF_ENV_BRINGUP
@@ -168,6 +176,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
default 0x0014 if IDF_TARGET_ESP32C61
default 0x0019 if IDF_TARGET_ESP32H21
default 0x001C if IDF_TARGET_ESP32H4
default 0x0020 if IDF_TARGET_ESP32S31
default 0xFFFF
@@ -218,10 +227,10 @@ mainmenu "Espressif IoT Development Framework Configuration"
When loading the BIN with UART, the ROM will jump to ram and run the app after finishing the ROM
startup code, so there's no additional startup initialization required. You can use the
`load_ram` in esptool.py to load the generated .bin file into ram and execute.
`load-ram` in esptool to load the generated .bin file into ram and execute.
Example:
esptool.py --chip {chip} -p {port} -b {baud} --no-stub load_ram {app.bin}
esptool --chip {chip} -p {port} -b {baud} --no-stub load-ram {app.bin}
Recommended sdkconfig.defaults for building loadable ELF files is as follows.
CONFIG_APP_BUILD_TYPE_RAM is required, other options help reduce application
@@ -229,7 +238,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
CONFIG_APP_BUILD_TYPE_RAM=y
CONFIG_VFS_SUPPORT_TERMIOS=
CONFIG_NEWLIB_NANO_FORMAT=y
CONFIG_LIBC_NEWLIB_NANO_FORMAT=y
CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT=y
CONFIG_ESP_DEBUG_STUBS_ENABLE=
CONFIG_ESP_ERR_TO_NAME_LOOKUP=
@@ -369,6 +378,27 @@ mainmenu "Espressif IoT Development Framework Configuration"
endchoice
config COMPILER_ENABLE_RISCV_ZCMP
bool "Enable RISCV ZCMP extension"
depends on SOC_CPU_ZCMP_WORKAROUND
default n
help
Enable the RISC-V ZCMP (Compressed Macro) extension to reduce binary size
by optimizing function prologue and epilogue sequences.
Note: Due to a hardware issue on some ESP32 chips (e.g., ESP32C5, ESP32C61,
ESP32H4), executing "cm.push" may re-enable interrupts even when global
interrupts are disabled (mstatus.mie = 0). This can cause unexpected interrupts
during CPU retention or within critical sections.
Workarounds are implemented in the IDF codebase. However, if user code
directly disables interrupts, additional actions may be required. Refer
to code examples under the SOC_CPU_ZCMP_WORKAROUND macro, or disable
the ZCMP extension for source files that contain functions which may
execute while mstatus.mie = 0.
Even with these workarounds, the issue may still affect dual-core variants.
choice COMPILER_OPTIMIZATION_ASSERTION_LEVEL
prompt "Assertion level"
default COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE
@@ -406,7 +436,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
config COMPILER_ASSERT_NDEBUG_EVALUATE
bool "Enable the evaluation of the expression inside assert(X) when NDEBUG is set"
default y
default n
help
When NDEBUG is set, assert(X) will not cause code to trigger an assertion.
With this option set, assert(X) will still evaluate the expression X, though
@@ -416,9 +446,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
This is not according to the standard, which states that the assert(X) should
be replaced with ((void)0) if NDEBUG is defined.
In ESP-IDF v6.0 the default behavior will change to "no" to be in line with the
standard.
choice COMPILER_FLOAT_LIB_FROM
prompt "Compiler float lib source"
default COMPILER_FLOAT_LIB_FROM_RVFPLIB if ESP_ROM_HAS_RVFPLIB
@@ -549,6 +576,20 @@ mainmenu "Espressif IoT Development Framework Configuration"
distribution is more uniform across libraries. On downside, it may increase
the binary size and hence should be used during development phase only.
config COMPILER_ENABLE_TEXT_SECTION_LITERALS
bool
depends on IDF_TOOLCHAIN_GCC
depends on IDF_TARGET_ARCH_XTENSA
default y if ESPTOOLPY_FAST_REFLASHING
help
Intersperse Xtensa literals within the text section to keep
them as close as possible to their references. This prevents
literals from being placed into a separate section in the
output file and prevents the linker from combining literal
pools from different object files. Enabling this is necessary
for fast reflashing to prevent mixing code from mutable and
immutable libraries.
config COMPILER_WARN_WRITE_STRINGS
bool "Enable -Wwrite-strings warning flag"
default "n"
@@ -577,7 +618,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
config COMPILER_DISABLE_DEFAULT_ERRORS
bool "Disable errors for default warnings"
default "y"
default "n"
help
Enable this option if you do not want default warnings to be considered as errors,
especially when updating IDF.
@@ -610,6 +651,13 @@ mainmenu "Espressif IoT Development Framework Configuration"
Enable this option if use GCC 14 or newer, and want to disable warnings which don't appear with
GCC 13.
config COMPILER_DISABLE_GCC15_WARNINGS
bool "Disable new warnings introduced in GCC 15"
default "n"
help
Enable this option if use GCC 15 or newer, and want to disable warnings which don't appear with
GCC 14.
config COMPILER_DUMP_RTL_FILES
bool "Dump RTL files during compilation"
help
@@ -677,6 +725,34 @@ mainmenu "Espressif IoT Development Framework Configuration"
help
Enable compiler static analyzer. This may produce false-positive results and increases compile time.
choice COMPILER_CXX_GLIBCXX_CONSTEXPR
prompt "Define _GLIBCXX_CONSTEXPR"
default COMPILER_CXX_GLIBCXX_CONSTEXPR_NO_CHANGE
depends on IDF_TOOLCHAIN_GCC && !IDF_TARGET_LINUX
help
Modify libstdc++ _GLIBCXX20_CONSTEXPR and _GLIBCXX23_CONSTEXPR definitions to provide size
optimizations. The total size optimization depends on the application's structure.
There is no robust way to determine which option would be better in a particular case.
Please try all available options to find the best size optimization.
config COMPILER_CXX_GLIBCXX_CONSTEXPR_NO_CHANGE
bool "No change"
help
Use default _GLIBCXX20_CONSTEXPR and _GLIBCXX23_CONSTEXPR defined in libstdc++
config COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD_CONSTEXPR
bool "_GLIBCXX2X_CONSTEXPR=__attribute__((cold)) constexpr"
help
Define _GLIBCXX20_CONSTEXPR=__attribute__((cold)) constexpr
Define _GLIBCXX23_CONSTEXPR=__attribute__((cold)) constexpr
config COMPILER_CXX_GLIBCXX_CONSTEXPR_COLD
bool "_GLIBCXX2X_CONSTEXPR=__attribute__((cold))"
help
Define _GLIBCXX20_CONSTEXPR=__attribute__((cold)).
Define _GLIBCXX23_CONSTEXPR=__attribute__((cold)).
endchoice
endmenu # Compiler Options
menu "Component config"
@@ -688,6 +764,17 @@ mainmenu "Espressif IoT Development Framework Configuration"
depends on "${IDF_MINIMAL_BUILD}"
source "$COMPONENT_KCONFIGS_SOURCE_FILE"
menu "Configuration for components not included in the build"
depends on "${IDF_BUILD_V2}"
osource "$COMPONENT_KCONFIGS_EXCLUDED_SOURCE_FILE"
endmenu
endmenu
menu "Project configuration for components not included in the build"
depends on "${IDF_BUILD_V2}"
osource "$COMPONENT_KCONFIGS_PROJBUILD_EXCLUDED_SOURCE_FILE"
endmenu
config IDF_EXPERIMENTAL_FEATURES
@@ -709,3 +796,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
- CONFIG_USB_HOST_EXT_PORT_RESET_ATTEMPTS
- CONFIG_LIBC_PICOLIBC
- CONFIG_GDMA_ENABLE_WEIGHTED_ARBITRATION
- CONFIG_I3C_MASTER_ENABLED
- CONFIG_MBEDTLS_ESP_IDF_USE_PSA_CRYPTO
- CONFIG_ESPTOOLPY_FAST_REFLASHING

View File

@@ -15,18 +15,19 @@ ESP-IDF is the development framework for Espressif SoCs supported on Windows, Li
The following table shows ESP-IDF support of Espressif SoCs where ![alt text][preview] and ![alt text][supported] denote preview status and support, respectively. The preview support is usually limited in time and intended for beta versions of chips. Please use an ESP-IDF release where the desired SoC is already supported.
|Chip | v5.0 | v5.1 | v5.2 | v5.3 | v5.4 | |
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------: |:------------------------------------------------------------------- |
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|ESP32-P4 | | | | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|ESP32-C61 | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/products/socs/esp32-c61) |
|Chip | v5.1 | v5.2 | v5.3 | v5.4 | v5.5 | v6.0 | |
|:----------- |:---------------------: |:---------------------: |:---------------------: | :---------------------: | :-------------------: | :--------------------: |:------------------------------------------------------------------- |
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|ESP32-C6 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|ESP32-H2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|ESP32-P4 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/news/ESP32-C5) |
|ESP32-C61 | | | | | ![alt text][supported] | ![alt text][supported] |[Announcement](https://www.espressif.com/en/products/socs/esp32-c61) |
|ESP32-H4 | | | | | | ![alt text][preview] |[Announcement](https://www.espressif.com/en/news/ESP32-H4) |
[supported]: https://img.shields.io/badge/-supported-green "supported"
[preview]: https://img.shields.io/badge/-preview-orange "preview"
@@ -82,7 +83,7 @@ See the Getting Started guide links above for a detailed setup guide. This is a
## Flashing the Project
When the build finishes, it will print a command line to use esptool.py to flash the chip. However you can also do this automatically by running:
When the build finishes, it will print a command line to use `esptool` to flash the chip. However you can also do this automatically by running:
`idf.py -p PORT flash`

View File

@@ -15,18 +15,19 @@ ESP-IDF 是乐鑫官方推出的物联网开发框架,支持 Windows、Linux
下表总结了乐鑫芯片在 ESP-IDF 各版本中的支持状态,其中 ![alt text][supported] 代表已支持,![alt text][preview] 代表目前处于预览支持状态。预览支持状态通常有时间限制,而且仅适用于测试版芯片。请确保使用与芯片相匹配的 ESP-IDF 版本。
|芯片 | v5.0 | v5.1 | v5.2 | v5.3 | v5.4 | |
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------: | :------------------------------------------------------------------------ |
|ESP32 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-C3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | |
|ESP32-S3 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|ESP32-C2 | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|ESP32-C6 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|ESP32-P4 | | | | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|ESP32-C61 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/products/socs/esp32-c61) |
|芯片 | v5.1 | v5.2 | v5.3 | v5.4 | v5.5 | v6.0 | |
|:----------- | :-------------------: | :--------------------: | :--------------------: | :--------------------: | :-------------------: | :-------------------: |:------------------------------------------------------------------------- |
|ESP32 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | |
|ESP32-S2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | |
|ESP32-C3 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | |
|ESP32-S3 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|ESP32-C2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|ESP32-C6 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|ESP32-H2 |![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|ESP32-P4 | | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|ESP32-C61 | | | | | ![alt text][supported] |![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/products/socs/esp32-c61) |
|ESP32-H4 | | | | | |![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-H4) |
[supported]: https://img.shields.io/badge/-%E6%94%AF%E6%8C%81-green "supported"
[preview]: https://img.shields.io/badge/-%E9%A2%84%E8%A7%88-orange "preview"
@@ -82,7 +83,7 @@ ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodu
## 烧写项目
当构建结束,终端会打印出一条命令行,告知如何使用 esptool.py 工具烧写项目到芯片中。但你也可以运行下面这条命令来自动烧写:
当构建结束,终端会打印出一条命令行,告知如何使用 `esptool` 工具烧写项目到芯片中。但你也可以运行下面这条命令来自动烧写:
`idf.py -p PORT flash`

View File

@@ -10,7 +10,7 @@ The core components are organized into two groups.
The first group (referred to as `G0`) includes `hal`, `arch` (where `arch` is either `riscv` or `xtensa` depending on the chip), `esp_rom`, `esp_common`, and `soc`. This group contains information about and provides low-level access to the underlying hardware. In the case of `esp_common`, it contains hardware-agnostic code and utilities. These components may have dependencies on each other within the group, but outside dependencies should be minimized. The reason for this approach is that these components are fundamental, and many other components may require them. Ideally, the dependency relationship only goes one way, making it easier for this group to be usable in other projects.
The second group (referred to as `G1`) operates at a higher level than the first group. `G1` includes the components `esp_hw_support`, `esp_system`, `newlib`, `spi_flash`, `freertos`, `log`, and `heap`. Like the first group, circular dependencies within this group are allowed, and these components can have dependencies on the first group. G1 components represent essential software mechanisms for building other components.
The second group (referred to as `G1`) operates at a higher level than the first group. `G1` includes the components `esp_hw_support`, `esp_system`, `esp_libc`, `spi_flash`, `freertos`, `log`, and `heap`. Like the first group, circular dependencies within this group are allowed, and these components can have dependencies on the first group. G1 components represent essential software mechanisms for building other components.
## Descriptions
@@ -40,7 +40,7 @@ Example:
#### `esp_common`
Contains hardware-agnostic definitions, constants, macros, utilities, 'pure' and/or algorithmic functions that is useable by all other components (that is, barring there being a more appropriate component to put them in).
Contains hardware-agnostic definitions, constants, macros, utilities, 'pure' and/or algorithmic functions that is usable by all other components (that is, barring there being a more appropriate component to put them in).
Example:
@@ -85,7 +85,7 @@ Logging library.
Heap implementation.
#### `newlib`
#### `esp_libc`
Some functions n the standard library are implemented here, especially those needing other `G1` components.

View File

@@ -4,120 +4,38 @@ if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
endif()
set(srcs
"app_trace.c"
"app_trace_util.c"
"host_file_io.c")
if(CONFIG_ESP_TRACE_TRANSPORT_APPTRACE)
set(srcs
"app_trace.c"
"app_trace_util.c"
"host_file_io.c"
)
if(CONFIG_ESP_DEBUG_STUBS_ENABLE)
list(APPEND srcs
"debug_stubs.c")
if(NOT CONFIG_APPTRACE_DEST_UART) # JTAG or None
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
list(APPEND srcs "port/xtensa/port_jtag.c")
elseif(CONFIG_IDF_TARGET_ARCH_RISCV)
list(APPEND srcs "port/riscv/port_jtag.c")
endif()
list(APPEND srcs "app_trace_membufs_proto.c")
endif()
if(NOT CONFIG_APPTRACE_DEST_JTAG) # UART or None
list(APPEND srcs "port/port_uart.c")
endif()
endif()
if(CONFIG_APPTRACE_GCOV_ENABLE)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
list(APPEND srcs
"gcov/gcov_rtio.c")
else()
fail_at_build_time(app_trace "Only GNU compiler can link with Gcov library")
endif()
if(CONFIG_ESP_DEBUG_STUBS_ENABLE)
list(APPEND srcs "debug_stubs.c")
endif()
set(include_dirs "include")
set(priv_include_dirs "private_include" "port/include")
if(CONFIG_APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE)
list(APPEND srcs
"app_trace_membufs_proto.c")
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
list(APPEND srcs
"port/xtensa/port.c")
endif()
if(CONFIG_IDF_TARGET_ARCH_RISCV)
list(APPEND srcs
"port/riscv/port.c")
endif()
endif()
list(APPEND srcs
"port/port_uart.c")
if(CONFIG_APPTRACE_SV_ENABLE)
list(APPEND include_dirs
sys_view/Config
sys_view/SEGGER
sys_view/Sample/FreeRTOSV10.4)
list(APPEND srcs
"sys_view/SEGGER/SEGGER_SYSVIEW.c"
"sys_view/Sample/FreeRTOSV10.4/Config/esp/SEGGER_SYSVIEW_Config_FreeRTOS.c"
"sys_view/Sample/FreeRTOSV10.4/SEGGER_SYSVIEW_FreeRTOS.c"
"sys_view/esp/SEGGER_RTT_esp.c"
"sys_view/ext/heap_trace_module.c"
"sys_view/ext/logging.c")
endif()
if(CONFIG_HEAP_TRACING_TOHOST)
list(APPEND srcs "heap_trace_tohost.c")
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
set_source_files_properties(heap_trace_tohost.c PROPERTIES COMPILE_FLAGS -Wno-frame-address)
endif()
endif()
idf_component_register(SRCS "${srcs}"
INCLUDE_DIRS "${include_dirs}"
PRIV_INCLUDE_DIRS "${priv_include_dirs}"
PRIV_REQUIRES esp_driver_gptimer esp_driver_gpio esp_driver_uart
REQUIRES esp_timer
PRIV_REQUIRES esp_driver_gptimer
REQUIRES esp_timer esp_driver_uart
LDFRAGMENTS linker.lf)
# Force app_trace to also appear later than gcov in link line
idf_component_get_property(app_trace app_trace COMPONENT_LIB)
if(CONFIG_APPTRACE_GCOV_ENABLE)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
# Coverage info is not supported when clang is used
# TODO: LLVM-214
message(FATAL_ERROR "Coverage info is not supported when building with Clang!")
endif()
# The original Gcov library from toolchain will be objcopy with symbols redefinitions (see file gcov/io_sym.map).
# This needs because ESP has no file-system onboard, and redefined functions solves this problem and transmits
# output file to host PC.
# Set a name for Gcov library
set(GCOV_LIB libgcov_rtio)
# Set include direcrory of Gcov internal headers
execute_process(COMMAND ${CMAKE_C_COMPILER} -print-file-name=plugin
OUTPUT_VARIABLE gcc_plugin_dir
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
set_source_files_properties(gcov/gcov_rtio.c
PROPERTIES COMPILE_FLAGS "-I${gcc_plugin_dir}/include")
# Copy libgcov.a with symbols redefinition
find_library(GCOV_LIBRARY_PATH gcov ${CMAKE_C_IMPLICIT_LINK_DIRECTORIES})
add_custom_command(OUTPUT ${GCOV_LIB}.a
COMMAND ${_CMAKE_TOOLCHAIN_PREFIX}objcopy
--redefine-syms ${CMAKE_CURRENT_LIST_DIR}/gcov/io_sym.map
${GCOV_LIBRARY_PATH} ${GCOV_LIB}.a
MAIN_DEPENDENCY ${GCOV_LIBRARY_PATH}
VERBATIM)
add_custom_target(${GCOV_LIB}_target DEPENDS ${GCOV_LIB}.a)
add_library(${GCOV_LIB} STATIC IMPORTED)
set_target_properties(${GCOV_LIB}
PROPERTIES
IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${GCOV_LIB}.a)
add_dependencies(${GCOV_LIB} ${GCOV_LIB}_target)
add_dependencies(${COMPONENT_LIB} ${GCOV_LIB})
# disable --coverage for this component, as it is used as transport for gcov
target_compile_options(${COMPONENT_LIB} PRIVATE "-fno-profile-arcs" "-fno-test-coverage")
target_link_options(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=__gcov_init")
target_link_libraries(${COMPONENT_LIB} INTERFACE ${GCOV_LIB} $<TARGET_FILE:${app_trace}> c)
else()
target_link_libraries(${COMPONENT_LIB} INTERFACE $<TARGET_FILE:${app_trace}> c)
endif()

View File

@@ -1,400 +0,0 @@
menu "Application Level Tracing"
choice APPTRACE_DESTINATION1
prompt "Data Destination 1"
default APPTRACE_DEST_NONE
help
Select destination for application trace: JTAG or none (to disable).
config APPTRACE_DEST_JTAG
bool "JTAG"
select APPTRACE_DEST_TRAX if IDF_TARGET_ARCH_XTENSA
select APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE
select APPTRACE_ENABLE
config APPTRACE_DEST_NONE
bool "None"
endchoice
config APPTRACE_DEST_UART
bool
config APPTRACE_DEST_UART_NOUSB
bool
choice APPTRACE_DESTINATION2
prompt "Data Destination 2"
default APPTRACE_DEST_UART_NONE
help
Select destination for application trace: UART(XX) or none (to disable).
config APPTRACE_DEST_UART0
bool "UART0"
select APPTRACE_ENABLE
select APPTRACE_DEST_UART
select APPTRACE_DEST_UART_NOUSB
depends on (ESP_CONSOLE_UART_NUM !=0)
config APPTRACE_DEST_UART1
bool "UART1"
select APPTRACE_ENABLE
select APPTRACE_DEST_UART
select APPTRACE_DEST_UART_NOUSB
depends on (ESP_CONSOLE_UART_NUM !=1)
config APPTRACE_DEST_UART2
bool "UART2"
select APPTRACE_ENABLE
select APPTRACE_DEST_UART
select APPTRACE_DEST_UART_NOUSB
depends on (ESP_CONSOLE_UART_NUM !=2) && (SOC_UART_NUM > 2)
config APPTRACE_DEST_USB_CDC
bool "USB_CDC"
select APPTRACE_ENABLE
select APPTRACE_DEST_UART
depends on !ESP_CONSOLE_USB_CDC && (IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32S3) && !USB_ENABLED
config APPTRACE_DEST_UART_NONE
bool "None"
endchoice
config APPTRACE_UART_TX_GPIO
int "UART TX on GPIO<num>"
depends on APPTRACE_DEST_UART_NOUSB
range 0 46
default 12 if IDF_TARGET_ESP32
default 12 if IDF_TARGET_ESP32C3
default 12
help
This GPIO is used for UART TX pin.
config APPTRACE_UART_RX_GPIO
int "UART RX on GPIO<num>"
depends on APPTRACE_DEST_UART_NOUSB
range 0 46
default 13 if IDF_TARGET_ESP32
default 13 if IDF_TARGET_ESP32C3
default 13
help
This GPIO is used for UART RX pin.
config APPTRACE_UART_BAUDRATE
int
prompt "UART baud rate" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 1000000
range 1200 8000000
range 1200 1000000
help
This baud rate is used for UART.
The app's maximum baud rate depends on the UART clock source. If Power Management is disabled,
the UART clock source is the APB clock and all baud rates in the available range will be sufficiently
accurate. If Power Management is enabled, REF_TICK clock source is used so the baud rate is divided
from 1MHz. Baud rates above 1Mbps are not possible and values between 500Kbps and 1Mbps may not be
accurate.
config APPTRACE_UART_RX_BUFF_SIZE
int
prompt "UART RX ring buffer size" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 128
range 64 32768
help
Size of the UART input ring buffer.
This size related to the baudrate, system tick frequency and amount of data to transfer.
The data placed to this buffer before sent out to the interface.
config APPTRACE_UART_TX_BUFF_SIZE
int
prompt "UART TX ring buffer size" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 4096
range 2048 32768
help
Size of the UART output ring buffer.
This size related to the baudrate, system tick frequency and amount of data to transfer.
config APPTRACE_UART_TX_MSG_SIZE
int
prompt "UART TX message size" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 128
range 64 32768
help
Maximum size of the single message to transfer.
config APPTRACE_UART_TASK_PRIO
int
prompt "UART Task Priority" if APPTRACE_DEST_UART
default 1
range 1 32
help
UART task priority. In case of high events rate,
this parameter could be changed up to (configMAX_PRIORITIES-1).
config APPTRACE_DEST_TRAX
bool
depends on IDF_TARGET_ARCH_XTENSA && !ESP32_TRAX && !ESP32S2_TRAX && !ESP32S3_TRAX
select ESP32_MEMMAP_TRACEMEM
select ESP32S2_MEMMAP_TRACEMEM
select ESP32S3_MEMMAP_TRACEMEM
select ESP32_MEMMAP_TRACEMEM_TWOBANKS
select ESP32S2_MEMMAP_TRACEMEM_TWOBANKS
select ESP32S3_MEMMAP_TRACEMEM_TWOBANKS
default n
help
Enables/disable TRAX tracing HW.
config APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE
bool
default n
help
Enables/disable swapping memory buffers tracing protocol.
config APPTRACE_ENABLE
bool
default n
help
Enables/disable application tracing module.
config APPTRACE_LOCK_ENABLE
bool
default !APPTRACE_SV_ENABLE
help
Enables/disable application tracing module internal sync lock.
config APPTRACE_ONPANIC_HOST_FLUSH_TMO
int "Timeout for flushing last trace data to host on panic"
depends on APPTRACE_ENABLE
range -1 5000
default -1
help
Timeout for flushing last trace data to host in case of panic. In ms.
Use -1 to disable timeout and wait forever.
config APPTRACE_POSTMORTEM_FLUSH_THRESH
int "Threshold for flushing last trace data to host on panic"
depends on APPTRACE_ENABLE
range 0 16384
default 0
help
Threshold for flushing last trace data to host on panic in post-mortem mode.
This is minimal amount of data needed to perform flush. In bytes.
config APPTRACE_BUF_SIZE
int "Size of the apptrace buffer"
depends on APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE && !APPTRACE_DEST_TRAX
default 16384
help
Size of the memory buffer for trace data in bytes.
config APPTRACE_PENDING_DATA_SIZE_MAX
int "Size of the pending data buffer"
depends on APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE
default 0
help
Size of the buffer for events in bytes. It is useful for buffering events from
the time critical code (scheduler, ISRs etc). If this parameter is 0 then
events will be discarded when main HW buffer is full.
menu "FreeRTOS SystemView Tracing"
depends on APPTRACE_ENABLE
config APPTRACE_SV_ENABLE
bool "SystemView Tracing Enable"
depends on APPTRACE_ENABLE
default n
help
Enables support for SEGGER SystemView tracing functionality.
choice APPTRACE_SV_DEST
prompt "SystemView destination"
depends on APPTRACE_SV_ENABLE
default APPTRACE_SV_DEST_JTAG
help
SystemView will transfer data through the defined interface.
config APPTRACE_SV_DEST_JTAG
bool "Data destination JTAG"
depends on !PM_ENABLE && !APPTRACE_DEST_NONE
help
Send SEGGER SystemView events through JTAG interface.
config APPTRACE_SV_DEST_UART
bool "Data destination UART"
depends on APPTRACE_DEST_UART
help
Send SEGGER SystemView events through UART interface.
endchoice
choice APPTRACE_SV_CPU
prompt "CPU to trace"
depends on APPTRACE_SV_DEST_UART && !ESP_SYSTEM_SINGLE_CORE_MODE
default APPTRACE_SV_DEST_CPU_0
help
Define the CPU to trace by SystemView.
config APPTRACE_SV_DEST_CPU_0
bool "CPU0"
help
Send SEGGER SystemView events for Pro CPU.
config APPTRACE_SV_DEST_CPU_1
bool "CPU1"
help
Send SEGGER SystemView events for App CPU.
endchoice
choice APPTRACE_SV_TS_SOURCE
prompt "Timer to use as timestamp source"
depends on APPTRACE_SV_ENABLE
default APPTRACE_SV_TS_SOURCE_CCOUNT if ESP_SYSTEM_SINGLE_CORE_MODE && !PM_ENABLE && !IDF_TARGET_ESP32C3
default APPTRACE_SV_TS_SOURCE_GPTIMER if !ESP_SYSTEM_SINGLE_CORE_MODE && !PM_ENABLE && !IDF_TARGET_ESP32C3
default APPTRACE_SV_TS_SOURCE_ESP_TIMER if PM_ENABLE || IDF_TARGET_ESP32C3
help
SystemView needs to use a hardware timer as the source of timestamps
when tracing. This option selects the timer for it.
config APPTRACE_SV_TS_SOURCE_CCOUNT
bool "CPU cycle counter (CCOUNT)"
depends on ESP_SYSTEM_SINGLE_CORE_MODE && !PM_ENABLE && !IDF_TARGET_ESP32C3
config APPTRACE_SV_TS_SOURCE_GPTIMER
bool "General Purpose Timer (Timer Group)"
depends on !PM_ENABLE && !IDF_TARGET_ESP32C3
config APPTRACE_SV_TS_SOURCE_ESP_TIMER
bool "esp_timer high resolution timer"
endchoice
config APPTRACE_SV_MAX_TASKS
int "Maximum supported tasks"
depends on APPTRACE_SV_ENABLE
range 1 64
default 16
help
Configures maximum supported tasks in sysview debug
config APPTRACE_SV_BUF_WAIT_TMO
int "Trace buffer wait timeout"
depends on APPTRACE_SV_ENABLE
default 500
help
Configures timeout (in us) to wait for free space in trace buffer.
Set to -1 to wait forever and avoid lost events.
config APPTRACE_SV_EVT_OVERFLOW_ENABLE
bool "Trace Buffer Overflow Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Trace Buffer Overflow" event.
config APPTRACE_SV_EVT_ISR_ENTER_ENABLE
bool "ISR Enter Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "ISR Enter" event.
config APPTRACE_SV_EVT_ISR_EXIT_ENABLE
bool "ISR Exit Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "ISR Exit" event.
config APPTRACE_SV_EVT_ISR_TO_SCHED_ENABLE
bool "ISR Exit to Scheduler Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "ISR to Scheduler" event.
config APPTRACE_SV_EVT_TASK_START_EXEC_ENABLE
bool "Task Start Execution Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Task Start Execution" event.
config APPTRACE_SV_EVT_TASK_STOP_EXEC_ENABLE
bool "Task Stop Execution Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Task Stop Execution" event.
config APPTRACE_SV_EVT_TASK_START_READY_ENABLE
bool "Task Start Ready State Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Task Start Ready State" event.
config APPTRACE_SV_EVT_TASK_STOP_READY_ENABLE
bool "Task Stop Ready State Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Task Stop Ready State" event.
config APPTRACE_SV_EVT_TASK_CREATE_ENABLE
bool "Task Create Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Task Create" event.
config APPTRACE_SV_EVT_TASK_TERMINATE_ENABLE
bool "Task Terminate Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Task Terminate" event.
config APPTRACE_SV_EVT_IDLE_ENABLE
bool "System Idle Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "System Idle" event.
config APPTRACE_SV_EVT_TIMER_ENTER_ENABLE
bool "Timer Enter Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Timer Enter" event.
config APPTRACE_SV_EVT_TIMER_EXIT_ENABLE
bool "Timer Exit Event"
depends on APPTRACE_SV_ENABLE
default y
help
Enables "Timer Exit" event.
endmenu
config APPTRACE_GCOV_ENABLE
bool "GCOV to Host Enable"
depends on APPTRACE_ENABLE && !APPTRACE_SV_ENABLE
select ESP_DEBUG_STUBS_ENABLE
default n
help
Enables support for GCOV data transfer to host.
config APPTRACE_GCOV_DUMP_TASK_STACK_SIZE
int "Gcov dump task stack size"
depends on APPTRACE_GCOV_ENABLE
default 2048
help
Configures stack size of Gcov dump task
endmenu

View File

@@ -0,0 +1,134 @@
menu "Application Level Tracing"
depends on ESP_TRACE_TRANSPORT_APPTRACE
choice APPTRACE_DESTINATION
prompt "Data Destination"
default APPTRACE_DEST_JTAG if !PM_ENABLE
default APPTRACE_DEST_UART if PM_ENABLE
help
Select destination for application trace: JTAG, UART, or both.
config APPTRACE_DEST_JTAG
bool "JTAG"
select APPTRACE_TRAX_ENABLE if IDF_TARGET_ARCH_XTENSA
depends on !PM_ENABLE
config APPTRACE_DEST_UART
bool "UART"
config APPTRACE_DEST_ALL
bool "All (runtime selection)"
help
Compile both JTAG and UART interfaces in advance (higher IRAM usage).
Allows runtime switching between JTAG and UART via esp_apptrace_get_user_params().
If esp_apptrace_get_user_params() is not provided by the
application, JTAG is used by default with the default
configuration defined in components/app_trace/include/esp_app_trace_config.h.
endchoice
config APPTRACE_BUF_SIZE
int "Size of the apptrace buffer"
depends on APPTRACE_DEST_JTAG && !APPTRACE_TRAX_ENABLE
default 16384
help
Size of the memory buffer for trace data in bytes.
config APPTRACE_DEST_UART_NUM
int "UART port number"
depends on APPTRACE_DEST_UART
range 0 1 if (SOC_UART_HP_NUM <= 2)
range 0 2 if (SOC_UART_HP_NUM <= 3)
range 0 4 if (SOC_UART_HP_NUM <= 5)
default 1
help
UART communication port number for the apptrace destination.
See UART documentation for available port numbers.
config APPTRACE_UART_TX_GPIO
int "UART TX on GPIO<num>"
depends on APPTRACE_DEST_UART
range 0 46
default 12
help
This GPIO is used for UART TX pin.
config APPTRACE_UART_RX_GPIO
int "UART RX on GPIO<num>"
depends on APPTRACE_DEST_UART
range 0 46
default 13
help
This GPIO is used for UART RX pin.
config APPTRACE_UART_BAUDRATE
int
prompt "UART baud rate" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 1000000
range 1200 8000000
range 1200 1000000
help
This baud rate is used for UART.
The app's maximum baud rate depends on the UART clock source. If Power Management is disabled,
the UART clock source is the APB clock and all baud rates in the available range will be sufficiently
accurate. If Power Management is enabled, REF_TICK clock source is used so the baud rate is divided
from 1MHz. Baud rates above 1Mbps are not possible and values between 500Kbps and 1Mbps may not be
accurate.
config APPTRACE_UART_TX_BUFF_SIZE
int
prompt "UART TX ring buffer size" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 4096
range 2048 32768
help
Size of the UART output ring buffer. Must be power of two.
This size related to the baudrate, system tick frequency and amount of data to transfer.
config APPTRACE_UART_TX_MSG_SIZE
int
prompt "UART TX message size" if APPTRACE_DEST_UART
depends on APPTRACE_DEST_UART
default 128
range 64 32768
help
Maximum size of the single message to transfer.
config APPTRACE_TRAX_ENABLE
bool
depends on IDF_TARGET_ARCH_XTENSA && !ESP32_TRAX && !ESP32S2_TRAX && !ESP32S3_TRAX
select ESP32_MEMMAP_TRACEMEM
select ESP32S2_MEMMAP_TRACEMEM
select ESP32S3_MEMMAP_TRACEMEM
select ESP32_MEMMAP_TRACEMEM_TWOBANKS
select ESP32S2_MEMMAP_TRACEMEM_TWOBANKS
select ESP32S3_MEMMAP_TRACEMEM_TWOBANKS
default n
help
Enables/disable TRAX tracing HW.
config APPTRACE_LOCK_ENABLE
bool "Internal Sync Lock Enable"
default n
help
Enables/disable application tracing module internal sync lock to prevent data corruption
when multiple tasks are writing to the same trace buffer.
Keep in mind this will slow down the trace data transfer to the host.
config APPTRACE_ONPANIC_HOST_FLUSH_TMO
int "Timeout for flushing last trace data to host on panic"
range -1 5000
default -1
help
Timeout for flushing last trace data to host in case of panic. In ms.
Use -1 to disable timeout and wait forever.
config APPTRACE_POSTMORTEM_FLUSH_THRESH
int "Threshold for flushing last trace data to host on panic"
range 0 16384
default 0
help
Threshold for flushing last trace data to host on panic in post-mortem mode.
This is minimal amount of data needed to perform flush. In bytes.
endmenu

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 OR MIT
*/
@@ -7,20 +7,14 @@
#include <string.h>
#include "esp_cpu.h"
#include "esp_log.h"
#include "esp_rom_sys.h"
#include "esp_app_trace.h"
#include "esp_app_trace_port.h"
#include "esp_app_trace_types.h"
#include "esp_private/startup_internal.h"
#ifdef CONFIG_APPTRACE_DEST_UART0
#define ESP_APPTRACE_DEST_UART_NUM 0
#elif CONFIG_APPTRACE_DEST_UART1
#define ESP_APPTRACE_DEST_UART_NUM 1
#elif CONFIG_APPTRACE_DEST_UART2
#define ESP_APPTRACE_DEST_UART_NUM 2
#elif CONFIG_APPTRACE_DEST_USB_CDC
#define ESP_APPTRACE_DEST_UART_NUM 10
#else
#define ESP_APPTRACE_DEST_UART_NUM 0
#if CONFIG_ESP_CONSOLE_UART && CONFIG_APPTRACE_DEST_UART && (CONFIG_APPTRACE_DEST_UART_NUM == CONFIG_ESP_CONSOLE_UART_NUM)
#error "Application trace UART and console UART cannot use the same port number"
#endif
#define ESP_APPTRACE_MAX_VPRINTF_ARGS 256
@@ -32,263 +26,205 @@ const static char *TAG = "esp_apptrace";
typedef struct {
esp_apptrace_hw_t *hw;
void *hw_data;
esp_apptrace_dest_t dest;
} esp_apptrace_channel_t;
static esp_apptrace_channel_t s_trace_channels[ESP_APPTRACE_DEST_MAX];
static bool s_inited;
static esp_apptrace_channel_t s_trace_ch;
static volatile int s_trace_ch_hw_initialized = 0;
esp_err_t esp_apptrace_init(void)
esp_err_t esp_apptrace_init(const esp_apptrace_config_t *config)
{
int res;
esp_apptrace_hw_t *hw = NULL;
void *hw_data = NULL;
__attribute__((unused)) void *hw_data = NULL;
// 'esp_apptrace_init()' is called on every core, so ensure to do main initialization only once
if (esp_cpu_get_core_id() == 0) {
memset(&s_trace_channels, 0, sizeof(s_trace_channels));
hw = esp_apptrace_jtag_hw_get(&hw_data);
ESP_APPTRACE_LOGD("HW interface %p", hw);
if (hw != NULL) {
s_trace_channels[ESP_APPTRACE_DEST_JTAG].hw = hw;
s_trace_channels[ESP_APPTRACE_DEST_JTAG].hw_data = hw_data;
#if CONFIG_APPTRACE_DEST_JTAG
s_trace_ch.hw = esp_apptrace_jtag_hw_get(&hw_data);
s_trace_ch.hw_data = hw_data;
#elif CONFIG_APPTRACE_DEST_UART
const esp_apptrace_uart_config_t *uart_config = &config->dest_cfg.uart;
s_trace_ch.hw = esp_apptrace_uart_hw_get(uart_config->uart_num, &hw_data);
s_trace_ch.hw_data = hw_data;
#else // CONFIG_APPTRACE_DEST_ALL allows runtime selection between destinations
if (config->dest == ESP_APPTRACE_DEST_JTAG) {
s_trace_ch.hw = esp_apptrace_jtag_hw_get(&hw_data);
s_trace_ch.hw_data = hw_data;
} else if (config->dest == ESP_APPTRACE_DEST_UART) {
const esp_apptrace_uart_config_t *uart_config = &config->dest_cfg.uart;
s_trace_ch.hw = esp_apptrace_uart_hw_get(uart_config->uart_num, &hw_data);
s_trace_ch.hw_data = hw_data;
} else {
s_trace_ch.hw = NULL;
s_trace_ch.hw_data = NULL;
ESP_APPTRACE_LOGE("Invalid destination type (%d)!", config->dest);
return ESP_ERR_INVALID_ARG;
}
hw = esp_apptrace_uart_hw_get(ESP_APPTRACE_DEST_UART_NUM, &hw_data);
if (hw != NULL) {
s_trace_channels[ESP_APPTRACE_DEST_UART].hw = hw;
s_trace_channels[ESP_APPTRACE_DEST_UART].hw_data = hw_data;
#endif
s_trace_ch.dest = config->dest;
s_trace_ch_hw_initialized = 1;
} else {
// There is NO guarantee that system init functions will execute on core 0 first
// So we need to wait for core 0 to set up the hardware interface
while (!s_trace_ch_hw_initialized) {
esp_rom_delay_us(10);
}
s_inited = true;
}
// esp_apptrace_init() is called on every core, so initialize trace channel on every core
for (int i = 0; i < sizeof(s_trace_channels) / sizeof(s_trace_channels[0]); i++) {
esp_apptrace_channel_t *ch = &s_trace_channels[i];
if (ch->hw) {
res = ch->hw->init(ch->hw_data);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to init trace channel HW interface (%d)!", res);
return res;
}
if (s_trace_ch.hw) {
int res = s_trace_ch.hw->init(s_trace_ch.hw_data, config);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to init trace channel HW interface (%d)!", res);
return res;
}
}
return ESP_OK;
}
ESP_SYSTEM_INIT_FN(esp_apptrace_init, SECONDARY, ESP_SYSTEM_INIT_ALL_CORES, 115)
esp_err_t esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size)
{
return esp_apptrace_init();
}
void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size)
{
esp_apptrace_channel_t *ch;
if (!s_inited) {
return;
}
// currently down buffer is supported for JTAG interface only
// TODO: one more argument should be added to this function to specify HW interface: JTAG, UART0 etc
ch = &s_trace_channels[ESP_APPTRACE_DEST_JTAG];
if (ch->hw != NULL) {
if (ch->hw->down_buffer_config != NULL) {
ch->hw->down_buffer_config(ch->hw_data, buf, size);
}
} else {
ESP_APPTRACE_LOGD("Trace destination for JTAG not supported!");
}
ch = &s_trace_channels[ESP_APPTRACE_DEST_UART];
if (ch->hw != NULL) {
if (ch->hw->down_buffer_config != NULL) {
ch->hw->down_buffer_config(ch->hw_data, buf, size);
}
} else {
ESP_APPTRACE_LOGD("Trace destination for UART not supported!");
}
}
uint8_t *esp_apptrace_down_buffer_get(esp_apptrace_dest_t dest, uint32_t *size, uint32_t user_tmo)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
return NULL;
}
if (size == NULL || *size == 0) {
return NULL;
}
if (!s_inited) {
return NULL;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return NULL;
}
if (ch->hw->get_down_buffer == NULL) {
return NULL;
}
esp_apptrace_tmo_init(&tmo, user_tmo);
return ch->hw->get_down_buffer(ch->hw_data, size, &tmo);
}
esp_err_t esp_apptrace_down_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32_t user_tmo)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
if (!buf || size == 0) {
return ESP_ERR_INVALID_ARG;
}
if (ptr == NULL) {
return ESP_ERR_INVALID_ARG;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return ESP_ERR_NOT_SUPPORTED;
}
if (ch->hw->get_down_buffer == NULL) {
return ESP_ERR_NOT_SUPPORTED;
if (s_trace_ch.hw->down_buffer_config) {
s_trace_ch.hw->down_buffer_config(s_trace_ch.hw_data, buf, size);
}
esp_apptrace_tmo_init(&tmo, user_tmo);
return ch->hw->put_down_buffer(ch->hw_data, ptr, &tmo);
return ESP_OK;
}
esp_err_t esp_apptrace_read(esp_apptrace_dest_t dest, void *buf, uint32_t *size, uint32_t user_tmo)
uint8_t *esp_apptrace_down_buffer_get(uint32_t *size, uint32_t user_tmo)
{
int res = ESP_OK;
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
if (!size || *size == 0) {
return NULL;
}
if (!s_trace_ch.hw) {
return NULL;
}
if (!s_trace_ch.hw->get_down_buffer) {
return NULL;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
return s_trace_ch.hw->get_down_buffer(s_trace_ch.hw_data, size, &tmo);
}
esp_err_t esp_apptrace_down_buffer_put(uint8_t *ptr, uint32_t user_tmo)
{
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (!ptr) {
return ESP_ERR_INVALID_ARG;
}
if (buf == NULL || size == NULL || *size == 0) {
return ESP_ERR_INVALID_ARG;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
if (!s_trace_ch.hw->get_down_buffer) {
return ESP_ERR_NOT_SUPPORTED;
}
if (ch->hw->get_down_buffer == NULL || ch->hw->put_down_buffer == NULL) {
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
return s_trace_ch.hw->put_down_buffer(s_trace_ch.hw_data, ptr, &tmo);
}
esp_err_t esp_apptrace_read(void *buf, uint32_t *size, uint32_t user_tmo)
{
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (!buf || !size || *size == 0) {
return ESP_ERR_INVALID_ARG;
}
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
if (!s_trace_ch.hw->get_down_buffer || !s_trace_ch.hw->put_down_buffer) {
return ESP_ERR_NOT_SUPPORTED;
}
//TODO: callback system
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
uint32_t act_sz = *size;
*size = 0;
uint8_t *ptr = ch->hw->get_down_buffer(ch->hw_data, &act_sz, &tmo);
uint8_t *ptr = s_trace_ch.hw->get_down_buffer(s_trace_ch.hw_data, &act_sz, &tmo);
if (ptr && act_sz > 0) {
ESP_APPTRACE_LOGD("Read %" PRIu32 " bytes from host", act_sz);
memcpy(buf, ptr, act_sz);
res = ch->hw->put_down_buffer(ch->hw_data, ptr, &tmo);
*size = act_sz;
} else {
res = ESP_ERR_TIMEOUT;
return s_trace_ch.hw->put_down_buffer(s_trace_ch.hw_data, ptr, &tmo);
}
return res;
return ESP_ERR_TIMEOUT;
}
uint8_t *esp_apptrace_buffer_get(esp_apptrace_dest_t dest, uint32_t size, uint32_t user_tmo)
uint8_t *esp_apptrace_buffer_get(uint32_t size, uint32_t user_tmo)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
return NULL;
}
if (size == 0) {
return NULL;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return NULL;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return NULL;
}
if (ch->hw->get_up_buffer == NULL) {
if (!s_trace_ch.hw->get_up_buffer) {
return NULL;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
return ch->hw->get_up_buffer(ch->hw_data, size, &tmo);
return s_trace_ch.hw->get_up_buffer(s_trace_ch.hw_data, size, &tmo);
}
esp_err_t esp_apptrace_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32_t user_tmo)
esp_err_t esp_apptrace_buffer_put(uint8_t *ptr, uint32_t user_tmo)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
if (!ptr) {
return ESP_ERR_INVALID_ARG;
}
if (ptr == NULL) {
return ESP_ERR_INVALID_ARG;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return ESP_ERR_NOT_SUPPORTED;
}
if (ch->hw->put_up_buffer == NULL) {
if (!s_trace_ch.hw->put_up_buffer) {
return ESP_ERR_NOT_SUPPORTED;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
return ch->hw->put_up_buffer(ch->hw_data, ptr, &tmo);
return s_trace_ch.hw->put_up_buffer(s_trace_ch.hw_data, ptr, &tmo);
}
esp_err_t esp_apptrace_write(esp_apptrace_dest_t dest, const void *data, uint32_t size, uint32_t user_tmo)
esp_err_t esp_apptrace_write(const void *data, uint32_t size, uint32_t user_tmo)
{
uint8_t *ptr = NULL;
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
if (!data || size == 0) {
return ESP_ERR_INVALID_ARG;
}
if (data == NULL || size == 0) {
return ESP_ERR_INVALID_ARG;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return ESP_ERR_NOT_SUPPORTED;
}
if (ch->hw->get_up_buffer == NULL || ch->hw->put_up_buffer == NULL) {
if (!s_trace_ch.hw->get_up_buffer || !s_trace_ch.hw->put_up_buffer) {
return ESP_ERR_NOT_SUPPORTED;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
ptr = ch->hw->get_up_buffer(ch->hw_data, size, &tmo);
if (ptr == NULL) {
uint8_t *ptr = s_trace_ch.hw->get_up_buffer(s_trace_ch.hw_data, size, &tmo);
if (!ptr) {
return ESP_ERR_NO_MEM;
}
@@ -297,36 +233,29 @@ esp_err_t esp_apptrace_write(esp_apptrace_dest_t dest, const void *data, uint32_
memcpy(ptr, data, size);
// now indicate that this buffer is ready to be sent off to host
return ch->hw->put_up_buffer(ch->hw_data, ptr, &tmo);
return s_trace_ch.hw->put_up_buffer(s_trace_ch.hw_data, ptr, &tmo);
}
int esp_apptrace_vprintf_to(esp_apptrace_dest_t dest, uint32_t user_tmo, const char *fmt, va_list ap)
int esp_apptrace_vprintf_to(uint32_t user_tmo, const char *fmt, va_list ap)
{
uint16_t nargs = 0;
uint8_t *pout, *p = (uint8_t *)fmt;
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
if (!fmt) {
return -1;
}
if (fmt == NULL) {
if (!s_trace_ch.hw) {
return -1;
}
if (!s_inited) {
return -1;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return -1;
}
if (ch->hw->get_up_buffer == NULL || ch->hw->put_up_buffer == NULL) {
if (!s_trace_ch.hw->get_up_buffer || !s_trace_ch.hw->put_up_buffer) {
return -1;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, user_tmo);
ESP_APPTRACE_LOGD("fmt %p", fmt);
while ((p = (uint8_t *)strchr((char *)p, '%')) && nargs < ESP_APPTRACE_MAX_VPRINTF_ARGS) {
p++;
@@ -339,8 +268,8 @@ int esp_apptrace_vprintf_to(esp_apptrace_dest_t dest, uint32_t user_tmo, const c
ESP_APPTRACE_LOGE("Failed to store all printf args!");
}
pout = ch->hw->get_up_buffer(ch->hw_data, 1 + sizeof(char *) + nargs * sizeof(uint32_t), &tmo);
if (pout == NULL) {
pout = s_trace_ch.hw->get_up_buffer(s_trace_ch.hw_data, 1 + sizeof(char *) + nargs * sizeof(uint32_t), &tmo);
if (!pout) {
ESP_APPTRACE_LOGE("Failed to get buffer!");
return -1;
}
@@ -356,7 +285,7 @@ int esp_apptrace_vprintf_to(esp_apptrace_dest_t dest, uint32_t user_tmo, const c
ESP_APPTRACE_LOGD("arg %" PRIx32, arg);
}
int ret = ch->hw->put_up_buffer(ch->hw_data, p, &tmo);
int ret = s_trace_ch.hw->put_up_buffer(s_trace_ch.hw_data, p, &tmo);
if (ret != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to put printf buf (%d)!", ret);
return -1;
@@ -367,85 +296,87 @@ int esp_apptrace_vprintf_to(esp_apptrace_dest_t dest, uint32_t user_tmo, const c
int esp_apptrace_vprintf(const char *fmt, va_list ap)
{
return esp_apptrace_vprintf_to(ESP_APPTRACE_DEST_JTAG, 0, fmt, ap);
return esp_apptrace_vprintf_to(0, fmt, ap);
}
esp_err_t esp_apptrace_flush_nolock(esp_apptrace_dest_t dest, uint32_t min_sz, uint32_t usr_tmo)
esp_err_t esp_apptrace_flush_nolock(uint32_t min_sz, uint32_t usr_tmo)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
return ESP_ERR_INVALID_ARG;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return ESP_ERR_NOT_SUPPORTED;
}
if (ch->hw->flush_up_buffer_nolock == NULL) {
if (!s_trace_ch.hw->flush_up_buffer_nolock) {
return ESP_ERR_NOT_SUPPORTED;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, usr_tmo);
return ch->hw->flush_up_buffer_nolock(ch->hw_data, min_sz, &tmo);
return s_trace_ch.hw->flush_up_buffer_nolock(s_trace_ch.hw_data, min_sz, &tmo);
}
esp_err_t esp_apptrace_flush(esp_apptrace_dest_t dest, uint32_t usr_tmo)
esp_err_t esp_apptrace_flush(uint32_t usr_tmo)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
return ESP_ERR_INVALID_ARG;
}
if (!s_inited) {
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return ESP_ERR_NOT_SUPPORTED;
}
if (ch->hw->flush_up_buffer == NULL) {
if (!s_trace_ch.hw->flush_up_buffer) {
return ESP_ERR_NOT_SUPPORTED;
}
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, usr_tmo);
return ch->hw->flush_up_buffer(ch->hw_data, &tmo);
return s_trace_ch.hw->flush_up_buffer(s_trace_ch.hw_data, &tmo);
}
bool esp_apptrace_host_is_connected(esp_apptrace_dest_t dest)
bool esp_apptrace_host_is_connected(void)
{
esp_apptrace_channel_t *ch;
ESP_APPTRACE_LOGV("%s(): enter", __func__);
if (dest >= ESP_APPTRACE_DEST_MAX) {
if (!s_trace_ch.hw) {
return false;
}
if (!s_inited) {
return false;
}
ch = &s_trace_channels[dest];
if (ch->hw == NULL) {
ESP_APPTRACE_LOGE("Trace destination %d not supported!", dest);
return false;
}
if (ch->hw->host_is_connected == NULL) {
if (!s_trace_ch.hw->host_is_connected) {
return false;
}
return ch->hw->host_is_connected(ch->hw_data);
return s_trace_ch.hw->host_is_connected(s_trace_ch.hw_data);
}
#if !CONFIG_APPTRACE_DEST_JTAG
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
esp_apptrace_dest_t esp_apptrace_get_destination(void)
{
return NULL;
return s_trace_ch.dest;
}
esp_err_t esp_apptrace_set_header_size(esp_apptrace_header_size_t header_size)
{
if (!s_trace_ch.hw) {
return ESP_ERR_INVALID_STATE;
}
if (s_trace_ch.hw->set_header_size) {
s_trace_ch.hw->set_header_size(s_trace_ch.hw_data, header_size);
}
return ESP_OK;
}
/* If any trace library (sysview or external) is selected with the apptrace transport,
* initialization will be handled by the esp_trace component
*/
#if CONFIG_ESP_TRACE_LIB_NONE && CONFIG_ESP_TRACE_TRANSPORT_APPTRACE
esp_apptrace_config_t __attribute__((weak)) esp_apptrace_get_user_params(void)
{
esp_apptrace_config_t default_config = APPTRACE_CONFIG_DEFAULT();
return default_config;
}
ESP_SYSTEM_INIT_FN(apptrace_early_init, SECONDARY, ESP_SYSTEM_INIT_ALL_CORES, 115)
{
esp_apptrace_config_t config = esp_apptrace_get_user_params();
return esp_apptrace_init(&config);
}
#endif

View File

@@ -18,13 +18,16 @@
* In this case host SW will see that wr_sz < block_sz and will report error.
*/
typedef struct {
#if CONFIG_APPTRACE_SV_ENABLE
uint8_t block_sz; // size of allocated block for user data
uint8_t wr_sz; // size of actually written data
#else
uint16_t block_sz; // size of allocated block for user data
uint16_t wr_sz; // size of actually written data
#endif
union {
struct {
uint8_t block_sz_8;
uint8_t wr_sz_8;
};
struct {
uint16_t block_sz_16;
uint16_t wr_sz_16;
};
};
} esp_tracedata_hdr_t;
/** TODO: docs
@@ -33,41 +36,29 @@ typedef struct {
uint16_t block_sz; // size of allocated block for user data
} esp_hostdata_hdr_t;
#if CONFIG_APPTRACE_SV_ENABLE
#define ESP_APPTRACE_USR_BLOCK_CORE(_cid_) (0)
#define ESP_APPTRACE_USR_BLOCK_LEN(_v_) (_v_)
#define ESP_APPTRACE_USR_DATA_LEN_MAX(_hw_data_) 255UL
#else
#define ESP_APPTRACE_USR_BLOCK_CORE(_cid_) ((_cid_) << 15)
#define ESP_APPTRACE_USR_BLOCK_LEN(_v_) (~(1 << 15) & (_v_))
#define ESP_APPTRACE_USR_DATA_LEN_MAX(_hw_data_) (ESP_APPTRACE_INBLOCK(_hw_data_)->sz - sizeof(esp_tracedata_hdr_t))
#endif
#define ESP_APPTRACE_USR_BLOCK_RAW_SZ(_s_) ((_s_) + sizeof(esp_tracedata_hdr_t))
#define ESP_APPTRACE_INBLOCK_MARKER(_hw_data_) \
((_hw_data_)->state.markers[(_hw_data_)->state.in_block % 2])
#define ESP_APPTRACE_INBLOCK_MARKER(_hw_data_) ((_hw_data_)->state.markers[(_hw_data_)->state.in_block % 2])
#define ESP_APPTRACE_INBLOCK_MARKER_UPD(_hw_data_, _v_) do {(_hw_data_)->state.markers[(_hw_data_)->state.in_block % 2] += (_v_);}while(0)
#define ESP_APPTRACE_INBLOCK(_hw_data_) (&(_hw_data_)->blocks[(_hw_data_)->state.in_block % 2])
#define ESP_APPTRACE_INBLOCK(_hw_data_) \
(&(_hw_data_)->blocks[(_hw_data_)->state.in_block % 2])
const static char *TAG = "esp_apptrace";
static uint32_t esp_apptrace_membufs_down_buffer_write_nolock(esp_apptrace_membufs_proto_data_t *proto, uint8_t *data, uint32_t size);
static uint32_t esp_apptrace_membufs_down_buffer_write_nolock(esp_apptrace_membufs_proto_data_t *proto,
uint8_t *data, uint32_t size);
esp_err_t esp_apptrace_membufs_init(esp_apptrace_membufs_proto_data_t *proto, const esp_apptrace_mem_block_t blocks_cfg[2])
esp_err_t esp_apptrace_membufs_init(esp_apptrace_membufs_proto_data_t *proto,
const esp_apptrace_mem_block_t blocks_cfg[2])
{
// disabled by default
esp_apptrace_rb_init(&proto->rb_down, NULL, 0);
// membufs proto init
for (unsigned i = 0; i < 2; i++) {
for (unsigned int i = 0; i < 2; i++) {
proto->blocks[i].start = blocks_cfg[i].start;
proto->blocks[i].sz = blocks_cfg[i].sz;
proto->state.markers[i] = 0;
}
proto->state.in_block = 0;
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
esp_apptrace_rb_init(&proto->rb_pend, proto->pending_data,
sizeof(proto->pending_data));
#endif
return ESP_OK;
}
@@ -81,10 +72,10 @@ static esp_err_t esp_apptrace_membufs_swap(esp_apptrace_membufs_proto_data_t *pr
{
int prev_block_num = proto->state.in_block % 2;
int new_block_num = prev_block_num ? (0) : (1);
esp_err_t res = ESP_OK;
res = proto->hw->swap_start(proto->state.in_block);
esp_err_t res = proto->hw->swap_start(proto->state.in_block);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to swap to new block: %d", res);
return res;
}
@@ -101,40 +92,19 @@ static esp_err_t esp_apptrace_membufs_swap(esp_apptrace_membufs_proto_data_t *pr
// TODO: add support for multiple blocks from host, currently there is no need for that
uint8_t *p = proto->blocks[new_block_num].start + proto->blocks[new_block_num].sz;
ESP_APPTRACE_LOGD("Recvd %" PRIu16 " bytes from host (@ %p) [%x %x %x %x %x %x %x %x .. %x %x %x %x %x %x %x %x]",
hdr->block_sz, proto->blocks[new_block_num].start,
*(proto->blocks[new_block_num].start+0), *(proto->blocks[new_block_num].start+1),
*(proto->blocks[new_block_num].start+2), *(proto->blocks[new_block_num].start+3),
*(proto->blocks[new_block_num].start+4), *(proto->blocks[new_block_num].start+5),
*(proto->blocks[new_block_num].start+6), *(proto->blocks[new_block_num].start+7),
*(p-8), *(p-7), *(p-6), *(p-5), *(p-4), *(p-3), *(p-2), *(p-1));
uint32_t sz = esp_apptrace_membufs_down_buffer_write_nolock(proto, (uint8_t *)(hdr+1), hdr->block_sz);
hdr->block_sz, proto->blocks[new_block_num].start,
*(proto->blocks[new_block_num].start + 0), *(proto->blocks[new_block_num].start + 1),
*(proto->blocks[new_block_num].start + 2), *(proto->blocks[new_block_num].start + 3),
*(proto->blocks[new_block_num].start + 4), *(proto->blocks[new_block_num].start + 5),
*(proto->blocks[new_block_num].start + 6), *(proto->blocks[new_block_num].start + 7),
*(p - 8), *(p - 7), *(p - 6), *(p - 5), *(p - 4), *(p - 3), *(p - 2), *(p - 1));
uint32_t sz = esp_apptrace_membufs_down_buffer_write_nolock(proto, (uint8_t *)(hdr + 1), hdr->block_sz);
if (sz != hdr->block_sz) {
ESP_APPTRACE_LOGE("Failed to write %" PRIu32 " bytes to down buffer (%" PRIu16 " %" PRIu32 ")!", hdr->block_sz - sz, hdr->block_sz, sz);
ESP_APPTRACE_LOGE("Failed to write %" PRIu32 " bytes to down buffer (%" PRIu16 " %" PRIu32 ")!",
hdr->block_sz - sz, hdr->block_sz, sz);
}
hdr->block_sz = 0;
}
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
// copy pending data to block if any
while (proto->state.markers[new_block_num] < proto->blocks[new_block_num].sz) {
uint32_t read_sz = esp_apptrace_rb_read_size_get(&proto->rb_pend);
if (read_sz == 0) {
break; // no more data in pending buffer
}
if (read_sz > proto->blocks[new_block_num].sz - proto->state.markers[new_block_num]) {
read_sz = proto->blocks[new_block_num].sz - proto->state.markers[new_block_num];
}
uint8_t *ptr = esp_apptrace_rb_consume(&proto->rb_pend, read_sz);
if (!ptr) {
assert(false && "Failed to consume pended bytes!!");
break;
}
ESP_APPTRACE_LOGD("Pump %d pend bytes [%x %x %x %x : %x %x %x %x : %x %x %x %x : %x %x...%x %x]",
read_sz, *(ptr+0), *(ptr+1), *(ptr+2), *(ptr+3), *(ptr+4),
*(ptr+5), *(ptr+6), *(ptr+7), *(ptr+8), *(ptr+9), *(ptr+10), *(ptr+11), *(ptr+12), *(ptr+13), *(ptr+read_sz-2), *(ptr+read_sz-1));
memcpy(proto->blocks[new_block_num].start + proto->state.markers[new_block_num], ptr, read_sz);
proto->state.markers[new_block_num] += read_sz;
}
#endif
proto->hw->swap_end(proto->state.in_block, proto->state.markers[prev_block_num]);
return res;
}
@@ -164,7 +134,8 @@ static esp_err_t esp_apptrace_membufs_swap_waitus(esp_apptrace_membufs_proto_dat
return res;
}
uint8_t *esp_apptrace_membufs_down_buffer_get(esp_apptrace_membufs_proto_data_t *proto, uint32_t *size, esp_apptrace_tmo_t *tmo)
uint8_t *esp_apptrace_membufs_down_buffer_get(esp_apptrace_membufs_proto_data_t *proto,
uint32_t *size, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr = NULL;
@@ -197,19 +168,21 @@ uint8_t *esp_apptrace_membufs_down_buffer_get(esp_apptrace_membufs_proto_data_t
return ptr;
}
esp_err_t esp_apptrace_membufs_down_buffer_put(esp_apptrace_membufs_proto_data_t *proto, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
esp_err_t esp_apptrace_membufs_down_buffer_put(esp_apptrace_membufs_proto_data_t *proto,
uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
/* nothing todo */
return ESP_OK;
}
static uint32_t esp_apptrace_membufs_down_buffer_write_nolock(esp_apptrace_membufs_proto_data_t *proto, uint8_t *data, uint32_t size)
static uint32_t esp_apptrace_membufs_down_buffer_write_nolock(esp_apptrace_membufs_proto_data_t *proto,
uint8_t *data, uint32_t size)
{
uint32_t total_sz = 0;
while (total_sz < size) {
ESP_APPTRACE_LOGD("esp_apptrace_trax_down_buffer_write_nolock WRS %" PRIu32 "-%" PRIu32 "-%" PRIu32 " %" PRIu32, proto->rb_down.wr, proto->rb_down.rd,
proto->rb_down.cur_size, size);
proto->rb_down.cur_size, size);
uint32_t wr_sz = esp_apptrace_rb_write_size_get(&proto->rb_down);
if (wr_sz == 0) {
break;
@@ -231,126 +204,55 @@ static uint32_t esp_apptrace_membufs_down_buffer_write_nolock(esp_apptrace_membu
return total_sz;
}
static inline uint8_t *esp_apptrace_membufs_wait4buf(esp_apptrace_membufs_proto_data_t *proto, uint16_t size, esp_apptrace_tmo_t *tmo, int *pended)
static inline uint32_t esp_apptrace_membufs_usr_data_len_max(esp_apptrace_membufs_proto_data_t *proto)
{
uint8_t *ptr = NULL;
int res = esp_apptrace_membufs_swap_waitus(proto, tmo);
if (res != ESP_OK) {
return NULL;
}
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
// check if we still have pending data
if (esp_apptrace_rb_read_size_get(&proto->rb_pend) > 0) {
// if after block switch we still have pending data (not all pending data have been pumped to block)
// alloc new pending buffer
*pended = 1;
ptr = esp_apptrace_rb_produce(&proto->rb_pend, size);
if (!ptr) {
ESP_APPTRACE_LOGE("Failed to alloc pend buf 1: w-r-s %d-%d-%d!", proto->rb_pend.wr, proto->rb_pend.rd, proto->rb_pend.cur_size);
}
} else
#endif
{
// update block pointers
if (ESP_APPTRACE_INBLOCK_MARKER(proto) + size > ESP_APPTRACE_INBLOCK(proto)->sz) {
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
*pended = 1;
ptr = esp_apptrace_rb_produce(&proto->rb_pend, size);
if (ptr == NULL) {
ESP_APPTRACE_LOGE("Failed to alloc pend buf 2: w-r-s %d-%d-%d!", proto->rb_pend.wr, proto->rb_pend.rd, proto->rb_pend.cur_size);
}
#endif
} else {
*pended = 0;
ptr = ESP_APPTRACE_INBLOCK(proto)->start + ESP_APPTRACE_INBLOCK_MARKER(proto);
}
}
return ptr;
return proto->header_size == ESP_APPTRACE_HEADER_SIZE_32 ?
ESP_APPTRACE_INBLOCK(proto)->sz - ESP_APPTRACE_HEADER_SIZE_32 : 255;
}
static inline uint8_t *esp_apptrace_membufs_pkt_start(uint8_t *ptr, uint16_t size)
uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *proto,
uint32_t size, esp_apptrace_tmo_t *tmo)
{
// it is safe to use esp_cpu_get_core_id() in macro call because arg is used only once inside it
((esp_tracedata_hdr_t *)ptr)->block_sz = ESP_APPTRACE_USR_BLOCK_CORE(esp_cpu_get_core_id()) | size;
((esp_tracedata_hdr_t *)ptr)->wr_sz = 0;
return ptr + sizeof(esp_tracedata_hdr_t);
}
static inline void esp_apptrace_membufs_pkt_end(uint8_t *ptr)
{
esp_tracedata_hdr_t *hdr = (esp_tracedata_hdr_t *)(ptr - sizeof(esp_tracedata_hdr_t));
// update written size
hdr->wr_sz = hdr->block_sz;
}
uint8_t *esp_apptrace_membufs_up_buffer_get(esp_apptrace_membufs_proto_data_t *proto, uint32_t size, esp_apptrace_tmo_t *tmo)
{
uint8_t *buf_ptr = NULL;
if (size > ESP_APPTRACE_USR_DATA_LEN_MAX(proto)) {
if (size > esp_apptrace_membufs_usr_data_len_max(proto)) {
ESP_APPTRACE_LOGE("Too large user data size %" PRIu32 "!", size);
return NULL;
}
// check for data in the pending buffer
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
if (esp_apptrace_rb_read_size_get(&proto->rb_pend) > 0) {
// if we have buffered data try to switch block
esp_apptrace_membufs_swap(proto);
// if switch was successful, part or all pended data have been copied to block
}
if (esp_apptrace_rb_read_size_get(&proto->rb_pend) > 0) {
// if we have buffered data alloc new pending buffer
ESP_APPTRACE_LOGD("Get %d bytes from PEND buffer", size);
buf_ptr = esp_apptrace_rb_produce(&proto->rb_pend, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size));
if (buf_ptr == NULL) {
int pended_buf;
buf_ptr = esp_apptrace_membufs_wait4buf(proto, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size), tmo, &pended_buf);
if (buf_ptr && !pended_buf) {
ESP_APPTRACE_LOGD("Get %d bytes from block", size);
// update cur block marker
ESP_APPTRACE_INBLOCK_MARKER_UPD(proto, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size));
}
if (ESP_APPTRACE_INBLOCK_MARKER(proto) + size + proto->header_size > ESP_APPTRACE_INBLOCK(proto)->sz) {
int res = esp_apptrace_membufs_swap_waitus(proto, tmo);
if (res != ESP_OK) {
return NULL;
}
} else {
#else
if (1) {
#endif
if (ESP_APPTRACE_INBLOCK_MARKER(proto) + ESP_APPTRACE_USR_BLOCK_RAW_SZ(size) > ESP_APPTRACE_INBLOCK(proto)->sz) {
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
ESP_APPTRACE_LOGD("Block full. Get %" PRIu32 " bytes from PEND buffer", size);
buf_ptr = esp_apptrace_rb_produce(&proto->rb_pend, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size));
#endif
if (buf_ptr == NULL) {
int pended_buf;
ESP_APPTRACE_LOGD(" full. Get %" PRIu32 " bytes from pend buffer", size);
buf_ptr = esp_apptrace_membufs_wait4buf(proto, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size), tmo, &pended_buf);
if (buf_ptr && !pended_buf) {
ESP_APPTRACE_LOGD("Got %" PRIu32 " bytes from block", size);
// update cur block marker
ESP_APPTRACE_INBLOCK_MARKER_UPD(proto, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size));
}
}
} else {
ESP_APPTRACE_LOGD("Get %" PRIu32 " bytes from buffer", size);
// fit to curr nlock
buf_ptr = ESP_APPTRACE_INBLOCK(proto)->start + ESP_APPTRACE_INBLOCK_MARKER(proto);
// update cur block marker
ESP_APPTRACE_INBLOCK_MARKER_UPD(proto, ESP_APPTRACE_USR_BLOCK_RAW_SZ(size));
}
}
if (buf_ptr) {
buf_ptr = esp_apptrace_membufs_pkt_start(buf_ptr, size);
}
return buf_ptr;
uint8_t *buf_ptr = ESP_APPTRACE_INBLOCK(proto)->start + ESP_APPTRACE_INBLOCK_MARKER(proto);
// update cur block marker
proto->state.markers[proto->state.in_block % 2] += size + proto->header_size;
// update header
esp_tracedata_hdr_t *hdr = (esp_tracedata_hdr_t *)buf_ptr;
if (proto->header_size == ESP_APPTRACE_HEADER_SIZE_32) {
hdr->block_sz_16 = (esp_cpu_get_core_id() << 15) | size;
hdr->wr_sz_16 = 0;
} else {
hdr->block_sz_8 = size;
hdr->wr_sz_8 = 0;
}
ESP_APPTRACE_LOGD("Got %" PRIu32 " bytes from block", size);
return buf_ptr + proto->header_size;
}
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_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);
// update header
esp_tracedata_hdr_t *hdr = (esp_tracedata_hdr_t *)(ptr - proto->header_size);
if (proto->header_size == ESP_APPTRACE_HEADER_SIZE_32) {
hdr->wr_sz_16 = hdr->block_sz_16;
} else {
hdr->wr_sz_8 = hdr->block_sz_8;
}
// 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
@@ -359,7 +261,8 @@ esp_err_t esp_apptrace_membufs_up_buffer_put(esp_apptrace_membufs_proto_data_t *
return ESP_OK;
}
esp_err_t esp_apptrace_membufs_flush_nolock(esp_apptrace_membufs_proto_data_t *proto, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
esp_err_t esp_apptrace_membufs_flush_nolock(esp_apptrace_membufs_proto_data_t *proto,
uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
int res = ESP_OK;
@@ -367,15 +270,16 @@ esp_err_t esp_apptrace_membufs_flush_nolock(esp_apptrace_membufs_proto_data_t *p
ESP_APPTRACE_LOGI("Ignore flush request for min %" PRIu32 " bytes. Bytes in block: %" PRIu32, min_sz, ESP_APPTRACE_INBLOCK_MARKER(proto));
return ESP_OK;
}
// switch block while size of data (including that in pending buffer) is more than min size
// switch block while size of data is more than min size
while (ESP_APPTRACE_INBLOCK_MARKER(proto) > min_sz) {
ESP_APPTRACE_LOGD("Try to flush %" PRIu32 " bytes. Wait until block switch for %" PRIi64 " us", ESP_APPTRACE_INBLOCK_MARKER(proto), tmo->tmo);
ESP_APPTRACE_LOGD("Try to flush %" PRIu32 " bytes", ESP_APPTRACE_INBLOCK_MARKER(proto));
res = esp_apptrace_membufs_swap_waitus(proto, tmo);
if (res != ESP_OK) {
if (tmo->tmo != ESP_APPTRACE_TMO_INFINITE)
ESP_APPTRACE_LOGW("Failed to switch to another block in %lld us!", tmo->tmo);
else
ESP_APPTRACE_LOGE("Failed to switch to another block in %lld us!", tmo->tmo);
if (res == ESP_ERR_TIMEOUT) {
ESP_APPTRACE_LOGW("Failed to switch to another block in %" PRId32 " us!", (int32_t)tmo->elapsed);
} else {
ESP_APPTRACE_LOGE("Failed to switch to another block, res: %d", res);
}
return res;
}
}

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 OR MIT
*/
@@ -44,7 +44,7 @@ void esp_apptrace_log_unlock(void)
esp_err_t esp_apptrace_tmo_check(esp_apptrace_tmo_t *tmo)
{
if (tmo->tmo != (int64_t)-1) {
if (tmo->tmo != (int64_t) -1) {
tmo->elapsed = esp_timer_get_time() - tmo->start;
if (tmo->elapsed >= tmo->tmo) {
return ESP_ERR_TIMEOUT;
@@ -57,6 +57,12 @@ esp_err_t esp_apptrace_tmo_check(esp_apptrace_tmo_t *tmo)
///////////////////////////////// LOCK ////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
void esp_apptrace_lock_init(esp_apptrace_lock_t *lock)
{
portMUX_INITIALIZE(&lock->mux);
lock->int_state = 0;
}
esp_err_t esp_apptrace_lock_take(esp_apptrace_lock_t *lock, esp_apptrace_tmo_t *tmo)
{
esp_err_t ret;

View File

@@ -9,11 +9,11 @@
//
#include "esp_private/startup_internal.h"
#include "dbg_stubs.h"
#include "esp_dbg_stubs.h"
#include "esp_attr.h"
/*
Debug stubs is actually a table of 4-byte entries. Every entry is equal to zero or must contain meaningfull data.
Debug stubs is actually a table of 4-byte entries. Every entry is equal to zero or must contain meaningful data.
The first entry is a service one and has the followinf format:
- tramp_addr, 4 bytes; Address of buffer for trampoline/code. Max size is ESP_DBG_STUBS_CODE_BUF_SIZE.
- min_stack_addr, 4 bytes; Start of the buffer for minimal onboard stack or data. Max size is ESP_DBG_STUBS_STACK_MIN_SIZE.

View File

@@ -1,197 +0,0 @@
/*
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
// This module implements runtime file I/O API for GCOV.
#include <string.h>
#include "esp_task_wdt.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "soc/timer_periph.h"
#include "esp_app_trace.h"
#include "esp_freertos_hooks.h"
#include "dbg_stubs.h"
#include "esp_private/esp_ipc.h"
#include "esp_attr.h"
#include "hal/wdt_hal.h"
#if CONFIG_APPTRACE_GCOV_ENABLE
#define ESP_GCOV_DOWN_BUF_SIZE 4200
#include "esp_log.h"
const static char *TAG = "esp_gcov_rtio";
static volatile bool s_create_gcov_task = false;
static volatile bool s_gcov_task_running = false;
extern void __gcov_dump(void);
extern void __gcov_reset(void);
void gcov_dump_task(void *pvParameter)
{
int dump_result = 0;
bool *running = (bool *)pvParameter;
ESP_EARLY_LOGV(TAG, "%s stack use in %d", __FUNCTION__, uxTaskGetStackHighWaterMark(NULL));
ESP_EARLY_LOGV(TAG, "Alloc apptrace down buf %d bytes", ESP_GCOV_DOWN_BUF_SIZE);
void *down_buf = malloc(ESP_GCOV_DOWN_BUF_SIZE);
if (down_buf == NULL) {
ESP_EARLY_LOGE(TAG, "Could not allocate memory for the buffer");
dump_result = ESP_ERR_NO_MEM;
goto gcov_exit;
}
ESP_EARLY_LOGV(TAG, "Config apptrace down buf");
esp_apptrace_down_buffer_config(down_buf, ESP_GCOV_DOWN_BUF_SIZE);
ESP_EARLY_LOGV(TAG, "Dump data...");
__gcov_dump();
// reset dump status to allow incremental data accumulation
__gcov_reset();
free(down_buf);
ESP_EARLY_LOGV(TAG, "Finish file transfer session");
dump_result = esp_apptrace_fstop(ESP_APPTRACE_DEST_TRAX);
if (dump_result != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send files transfer stop cmd (%d)!", dump_result);
}
gcov_exit:
ESP_EARLY_LOGV(TAG, "dump_result %d", dump_result);
if (running) {
*running = false;
}
ESP_EARLY_LOGV(TAG, "%s stack use out %d", __FUNCTION__, uxTaskGetStackHighWaterMark(NULL));
vTaskDelete(NULL);
}
void gcov_create_task(void *arg)
{
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
xTaskCreatePinnedToCore(&gcov_dump_task, "gcov_dump_task", CONFIG_APPTRACE_GCOV_DUMP_TASK_STACK_SIZE,
(void *)&s_gcov_task_running, configMAX_PRIORITIES - 1, NULL, 0);
}
static IRAM_ATTR
void gcov_create_task_tick_hook(void)
{
if (s_create_gcov_task) {
if (esp_ipc_call_nonblocking(xPortGetCoreID(), &gcov_create_task, NULL) == ESP_OK) {
s_create_gcov_task = false;
}
}
}
/**
* @brief Triggers gcov info dump task
* This function is to be called by OpenOCD, not by normal user code.
* TODO: what about interrupted flash access (when cache disabled)
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
static int esp_dbg_stub_gcov_entry(void)
{
/* we are in isr context here */
s_create_gcov_task = true;
return ESP_OK;
}
void gcov_rtio_init(void)
{
uint32_t stub_entry = 0;
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
assert(esp_dbg_stub_entry_get(ESP_DBG_STUB_ENTRY_GCOV, &stub_entry) == ESP_OK);
if (stub_entry != 0) {
/* "__gcov_init()" can be called several times. We must avoid multiple tick hook registration */
return;
}
esp_dbg_stub_entry_set(ESP_DBG_STUB_ENTRY_GCOV, (uint32_t)&esp_dbg_stub_gcov_entry);
assert(esp_dbg_stub_entry_get(ESP_DBG_STUB_ENTRY_CAPABILITIES, &stub_entry) == ESP_OK);
esp_dbg_stub_entry_set(ESP_DBG_STUB_ENTRY_CAPABILITIES, stub_entry | ESP_DBG_STUB_CAP_GCOV_TASK);
esp_register_freertos_tick_hook(gcov_create_task_tick_hook);
}
void esp_gcov_dump(void)
{
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
while (!esp_apptrace_host_is_connected(ESP_APPTRACE_DEST_TRAX)) {
vTaskDelay(pdMS_TO_TICKS(10));
}
/* We are not in isr context here. Waiting for the completion is safe */
s_gcov_task_running = true;
s_create_gcov_task = true;
while (s_gcov_task_running) {
vTaskDelay(pdMS_TO_TICKS(10));
}
}
void *gcov_rtio_fopen(const char *path, const char *mode)
{
ESP_EARLY_LOGV(TAG, "%s '%s' '%s'", __FUNCTION__, path, mode);
void *f = esp_apptrace_fopen(ESP_APPTRACE_DEST_TRAX, path, mode);
ESP_EARLY_LOGV(TAG, "%s ret %p", __FUNCTION__, f);
return f;
}
int gcov_rtio_fclose(void *stream)
{
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
return esp_apptrace_fclose(ESP_APPTRACE_DEST_TRAX, stream);
}
size_t gcov_rtio_fread(void *ptr, size_t size, size_t nmemb, void *stream)
{
ESP_EARLY_LOGV(TAG, "%s read %u", __FUNCTION__, size * nmemb);
size_t sz = esp_apptrace_fread(ESP_APPTRACE_DEST_TRAX, ptr, size, nmemb, stream);
ESP_EARLY_LOGV(TAG, "%s actually read %u", __FUNCTION__, sz);
return sz;
}
size_t gcov_rtio_fwrite(const void *ptr, size_t size, size_t nmemb, void *stream)
{
ESP_EARLY_LOGV(TAG, "%s", __FUNCTION__);
return esp_apptrace_fwrite(ESP_APPTRACE_DEST_TRAX, ptr, size, nmemb, stream);
}
int gcov_rtio_fseek(void *stream, long offset, int whence)
{
int ret = esp_apptrace_fseek(ESP_APPTRACE_DEST_TRAX, stream, offset, whence);
ESP_EARLY_LOGV(TAG, "%s(%p %ld %d) = %d", __FUNCTION__, stream, offset, whence, ret);
return ret;
}
long gcov_rtio_ftell(void *stream)
{
long ret = esp_apptrace_ftell(ESP_APPTRACE_DEST_TRAX, stream);
ESP_EARLY_LOGV(TAG, "%s(%p) = %ld", __FUNCTION__, stream, ret);
return ret;
}
int gcov_rtio_feof(void *stream)
{
int ret = esp_apptrace_feof(ESP_APPTRACE_DEST_TRAX, stream);
ESP_EARLY_LOGV(TAG, "%s(%p) = %d", __FUNCTION__, stream, ret);
return ret;
}
void gcov_rtio_setbuf(void *arg1 __attribute__ ((unused)), void *arg2 __attribute__ ((unused)))
{
return;
}
/* Wrappers for Gcov functions */
extern void __real___gcov_init(void *info);
void __wrap___gcov_init(void *info)
{
__real___gcov_init(info);
gcov_rtio_init();
}
#endif

View File

@@ -1,8 +0,0 @@
fopen gcov_rtio_fopen
fclose gcov_rtio_fclose
fwrite gcov_rtio_fwrite
fread gcov_rtio_fread
fseek gcov_rtio_fseek
ftell gcov_rtio_ftell
setbuf gcov_rtio_setbuf
feof gcov_rtio_feof

View File

@@ -1,113 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "esp_heap_trace.h"
#include "esp_heap_caps.h"
#if CONFIG_APPTRACE_SV_ENABLE
#include "esp_app_trace.h"
#include "esp_sysview_trace.h"
#endif
#define STACK_DEPTH CONFIG_HEAP_TRACING_STACK_DEPTH
#if CONFIG_HEAP_TRACING_TOHOST
#if !CONFIG_APPTRACE_SV_ENABLE
#error None of the heap tracing backends is enabled! You must enable SystemView compatible tracing to use this feature.
#endif
static bool s_tracing;
esp_err_t heap_trace_init_tohost(void)
{
if (s_tracing) {
return ESP_ERR_INVALID_STATE;
}
return ESP_OK;
}
esp_err_t heap_trace_start(heap_trace_mode_t mode_param)
{
#if CONFIG_APPTRACE_SV_ENABLE
esp_err_t ret = esp_sysview_heap_trace_start((uint32_t)-1);
if (ret != ESP_OK) {
return ret;
}
#endif
s_tracing = true;
return ESP_OK;
}
esp_err_t heap_trace_stop(void)
{
esp_err_t ret = ESP_ERR_NOT_SUPPORTED;
#if CONFIG_APPTRACE_SV_ENABLE
ret = esp_sysview_heap_trace_stop();
#endif
s_tracing = false;
return ret;
}
esp_err_t heap_trace_resume(void)
{
return heap_trace_start(HEAP_TRACE_ALL);
}
size_t heap_trace_get_count(void)
{
return 0;
}
esp_err_t heap_trace_get(size_t index, heap_trace_record_t *record)
{
return ESP_ERR_NOT_SUPPORTED;
}
esp_err_t heap_trace_summary(heap_trace_summary_t *summary)
{
return ESP_ERR_NOT_SUPPORTED;
}
void heap_trace_dump(void)
{
return;
}
void heap_trace_dump_caps(__attribute__((unused)) const uint32_t caps)
{
return;
}
/* Add a new allocation to the heap trace records */
static HEAP_IRAM_ATTR void record_allocation(const heap_trace_record_t *record)
{
if (!s_tracing) {
return;
}
#if CONFIG_APPTRACE_SV_ENABLE
esp_sysview_heap_trace_alloc(record->address, record->size, record->alloced_by);
#endif
}
/* record a free event in the heap trace log
For HEAP_TRACE_ALL, this means filling in the freed_by pointer.
For HEAP_TRACE_LEAKS, this means removing the record from the log.
*/
static HEAP_IRAM_ATTR void record_free(void *p, void **callers)
{
if (!s_tracing) {
return;
}
#if CONFIG_APPTRACE_SV_ENABLE
esp_sysview_heap_trace_free(p, callers);
#endif
}
#include "heap_trace.inc"
#endif /*CONFIG_HEAP_TRACING_TOHOST*/

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -17,8 +17,6 @@
#include <string.h>
#include "esp_app_trace.h"
#if CONFIG_APPTRACE_ENABLE
#include "esp_log.h"
const static char *TAG = "esp_host_file_io";
@@ -79,13 +77,13 @@ typedef struct {
void *file;
} esp_apptrace_ftell_args_t;
static esp_err_t esp_apptrace_file_cmd_send(esp_apptrace_dest_t dest, uint8_t cmd, void (*prep_args)(uint8_t *, void *), void *args, uint32_t args_len)
static esp_err_t esp_apptrace_file_cmd_send(uint8_t cmd, void (*prep_args)(uint8_t *, void *), void *args, uint32_t args_len)
{
esp_err_t ret;
esp_apptrace_fcmd_hdr_t *hdr;
ESP_EARLY_LOGV(TAG, "%s %d", __func__, cmd);
uint8_t *ptr = esp_apptrace_buffer_get(dest, sizeof(*hdr) + args_len, ESP_APPTRACE_TMO_INFINITE); //TODO: finite tmo
uint8_t *ptr = esp_apptrace_buffer_get(sizeof(*hdr) + args_len, ESP_APPTRACE_TMO_INFINITE); //TODO: finite tmo
if (ptr == NULL) {
return ESP_ERR_NO_MEM;
}
@@ -97,13 +95,13 @@ static esp_err_t esp_apptrace_file_cmd_send(esp_apptrace_dest_t dest, uint8_t cm
}
// now indicate that this buffer is ready to be sent off to host
ret = esp_apptrace_buffer_put(dest, ptr, ESP_APPTRACE_TMO_INFINITE);//TODO: finite tmo
ret = esp_apptrace_buffer_put(ptr, ESP_APPTRACE_TMO_INFINITE);//TODO: finite tmo
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to put apptrace buffer (%d)!", ret);
return ret;
}
ret = esp_apptrace_flush(dest, ESP_APPTRACE_TMO_INFINITE);//TODO: finite tmo
ret = esp_apptrace_flush(ESP_APPTRACE_TMO_INFINITE);//TODO: finite tmo
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to flush apptrace buffer (%d)!", ret);
return ret;
@@ -112,12 +110,12 @@ static esp_err_t esp_apptrace_file_cmd_send(esp_apptrace_dest_t dest, uint8_t cm
return ESP_OK;
}
static esp_err_t esp_apptrace_file_rsp_recv(esp_apptrace_dest_t dest, uint8_t *buf, uint32_t buf_len)
static esp_err_t esp_apptrace_file_rsp_recv(uint8_t *buf, uint32_t buf_len)
{
uint32_t tot_rd = 0;
while (tot_rd < buf_len) {
uint32_t rd_size = buf_len - tot_rd;
esp_err_t ret = esp_apptrace_read(dest, buf + tot_rd, &rd_size, ESP_APPTRACE_TMO_INFINITE); //TODO: finite tmo
esp_err_t ret = esp_apptrace_read(buf + tot_rd, &rd_size, ESP_APPTRACE_TMO_INFINITE); //TODO: finite tmo
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read (%d)!", ret);
return ret;
@@ -137,7 +135,7 @@ static void esp_apptrace_fopen_args_prepare(uint8_t *buf, void *priv)
memcpy(buf + args->path_len, args->mode, args->mode_len);
}
void *esp_apptrace_fopen(esp_apptrace_dest_t dest, const char *path, const char *mode)
void *esp_apptrace_fopen(const char *path, const char *mode)
{
esp_apptrace_fopen_args_t cmd_args;
@@ -151,8 +149,8 @@ void *esp_apptrace_fopen(esp_apptrace_dest_t dest, const char *path, const char
cmd_args.mode = mode;
cmd_args.mode_len = strlen(mode) + 1;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FOPEN, esp_apptrace_fopen_args_prepare,
&cmd_args, cmd_args.path_len+cmd_args.mode_len);
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FOPEN, esp_apptrace_fopen_args_prepare,
&cmd_args, cmd_args.path_len + cmd_args.mode_len);
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return NULL;
@@ -160,7 +158,7 @@ void *esp_apptrace_fopen(esp_apptrace_dest_t dest, const char *path, const char
// now read the answer
void *resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return NULL;
@@ -176,13 +174,13 @@ static void esp_apptrace_fclose_args_prepare(uint8_t *buf, void *priv)
memcpy(buf, &args->file, sizeof(args->file));
}
int esp_apptrace_fclose(esp_apptrace_dest_t dest, void *stream)
int esp_apptrace_fclose(void *stream)
{
esp_apptrace_fclose_args_t cmd_args;
cmd_args.file = stream;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FCLOSE, esp_apptrace_fclose_args_prepare,
&cmd_args, sizeof(cmd_args));
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FCLOSE, esp_apptrace_fclose_args_prepare,
&cmd_args, sizeof(cmd_args));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return EOF;
@@ -190,7 +188,7 @@ int esp_apptrace_fclose(esp_apptrace_dest_t dest, void *stream)
// now read the answer
int resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return EOF;
@@ -207,11 +205,11 @@ static void esp_apptrace_fwrite_args_prepare(uint8_t *buf, void *priv)
memcpy(buf + sizeof(args->file), args->buf, args->size);
}
size_t esp_apptrace_fwrite(esp_apptrace_dest_t dest, const void *ptr, size_t size, size_t nmemb, void *stream)
size_t esp_apptrace_fwrite(const void *ptr, size_t size, size_t nmemb, void *stream)
{
esp_apptrace_fwrite_args_t cmd_args;
ESP_EARLY_LOGV(TAG, "esp_apptrace_fwrite f %p l %d", stream, size*nmemb);
ESP_EARLY_LOGV(TAG, "esp_apptrace_fwrite f %p l %d", stream, size * nmemb);
if (ptr == NULL) {
return 0;
@@ -220,8 +218,8 @@ size_t esp_apptrace_fwrite(esp_apptrace_dest_t dest, const void *ptr, size_t siz
cmd_args.buf = (void *)ptr;
cmd_args.size = size * nmemb;
cmd_args.file = stream;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FWRITE, esp_apptrace_fwrite_args_prepare,
&cmd_args, sizeof(cmd_args.file)+cmd_args.size);
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FWRITE, esp_apptrace_fwrite_args_prepare,
&cmd_args, sizeof(cmd_args.file) + cmd_args.size);
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return 0;
@@ -229,7 +227,7 @@ size_t esp_apptrace_fwrite(esp_apptrace_dest_t dest, const void *ptr, size_t siz
// now read the answer
size_t resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return 0;
@@ -249,11 +247,11 @@ static void esp_apptrace_fread_args_prepare(uint8_t *buf, void *priv)
memcpy(buf + sizeof(args->file), &args->size, sizeof(args->size));
}
size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size_t nmemb, void *stream)
size_t esp_apptrace_fread(void *ptr, size_t size, size_t nmemb, void *stream)
{
esp_apptrace_fread_args_t cmd_args;
ESP_EARLY_LOGV(TAG, "esp_apptrace_fread f %p l %d", stream, size*nmemb);
ESP_EARLY_LOGV(TAG, "esp_apptrace_fread f %p l %d", stream, size * nmemb);
if (ptr == NULL) {
return 0;
@@ -261,8 +259,8 @@ size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size
cmd_args.size = size * nmemb;
cmd_args.file = stream;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FREAD, esp_apptrace_fread_args_prepare,
&cmd_args, sizeof(cmd_args));
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FREAD, esp_apptrace_fread_args_prepare,
&cmd_args, sizeof(cmd_args));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return 0;
@@ -270,7 +268,7 @@ size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size
// now read the answer
size_t resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return 0;
@@ -279,7 +277,7 @@ size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size
return 0;
}
ret = esp_apptrace_file_rsp_recv(dest, ptr, resp);
ret = esp_apptrace_file_rsp_recv(ptr, resp);
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read file data (%d)!", ret);
return 0;
@@ -288,7 +286,7 @@ size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size
* fread(buf, 1 ,size, file);
* So, total read bytes count returns
*/
return resp/size; // return the number of items read
return resp / size; // return the number of items read
}
static void esp_apptrace_fseek_args_prepare(uint8_t *buf, void *priv)
@@ -300,7 +298,7 @@ static void esp_apptrace_fseek_args_prepare(uint8_t *buf, void *priv)
memcpy(buf + sizeof(args->file) + sizeof(args->offset), &args->whence, sizeof(args->whence));
}
int esp_apptrace_fseek(esp_apptrace_dest_t dest, void *stream, long offset, int whence)
int esp_apptrace_fseek(void *stream, long offset, int whence)
{
esp_apptrace_fseek_args_t cmd_args;
@@ -309,8 +307,8 @@ int esp_apptrace_fseek(esp_apptrace_dest_t dest, void *stream, long offset, int
cmd_args.file = stream;
cmd_args.offset = offset;
cmd_args.whence = whence;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FSEEK, esp_apptrace_fseek_args_prepare,
&cmd_args, sizeof(cmd_args));
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FSEEK, esp_apptrace_fseek_args_prepare,
&cmd_args, sizeof(cmd_args));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return -1;
@@ -318,7 +316,7 @@ int esp_apptrace_fseek(esp_apptrace_dest_t dest, void *stream, long offset, int
// now read the answer
int resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return -1;
@@ -334,13 +332,13 @@ static void esp_apptrace_ftell_args_prepare(uint8_t *buf, void *priv)
memcpy(buf, &args->file, sizeof(args->file));
}
int esp_apptrace_ftell(esp_apptrace_dest_t dest, void *stream)
int esp_apptrace_ftell(void *stream)
{
esp_apptrace_ftell_args_t cmd_args;
cmd_args.file = stream;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FTELL, esp_apptrace_ftell_args_prepare,
&cmd_args, sizeof(cmd_args));
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FTELL, esp_apptrace_ftell_args_prepare,
&cmd_args, sizeof(cmd_args));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return -1;
@@ -348,7 +346,7 @@ int esp_apptrace_ftell(esp_apptrace_dest_t dest, void *stream)
// now read the answer
int resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return -1;
@@ -357,10 +355,10 @@ int esp_apptrace_ftell(esp_apptrace_dest_t dest, void *stream)
return resp;
}
int esp_apptrace_fstop(esp_apptrace_dest_t dest)
int esp_apptrace_fstop(void)
{
ESP_EARLY_LOGV(TAG, "%s", __func__);
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_STOP, NULL, NULL, 0);
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_STOP, NULL, NULL, 0);
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send files transfer stop cmd (%d)!", ret);
}
@@ -374,13 +372,13 @@ static void esp_apptrace_feof_args_prepare(uint8_t *buf, void *priv)
memcpy(buf, &args->file, sizeof(args->file));
}
int esp_apptrace_feof(esp_apptrace_dest_t dest, void *stream)
int esp_apptrace_feof(void *stream)
{
esp_apptrace_feof_args_t cmd_args;
cmd_args.file = stream;
esp_err_t ret = esp_apptrace_file_cmd_send(dest, ESP_APPTRACE_FILE_CMD_FEOF, esp_apptrace_feof_args_prepare,
&cmd_args, sizeof(cmd_args));
esp_err_t ret = esp_apptrace_file_cmd_send(ESP_APPTRACE_FILE_CMD_FEOF, esp_apptrace_feof_args_prepare,
&cmd_args, sizeof(cmd_args));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to send file cmd (%d)!", ret);
return EOF;
@@ -388,7 +386,7 @@ int esp_apptrace_feof(esp_apptrace_dest_t dest, void *stream)
// now read the answer
int resp;
ret = esp_apptrace_file_rsp_recv(dest, (uint8_t *)&resp, sizeof(resp));
ret = esp_apptrace_file_rsp_recv((uint8_t *)&resp, sizeof(resp));
if (ret != ESP_OK) {
ESP_EARLY_LOGE(TAG, "Failed to read response (%d)!", ret);
return EOF;
@@ -396,5 +394,3 @@ int esp_apptrace_feof(esp_apptrace_dest_t dest, void *stream)
return resp;
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -8,6 +8,7 @@
#include <stdarg.h>
#include "esp_err.h"
#include "esp_app_trace_config.h"
#include "esp_app_trace_util.h" // ESP_APPTRACE_TMO_INFINITE
#ifdef __cplusplus
@@ -15,82 +16,70 @@ extern "C" {
#endif
/**
* Application trace data destinations bits.
*/
typedef enum {
ESP_APPTRACE_DEST_JTAG = 1, ///< JTAG destination
ESP_APPTRACE_DEST_TRAX = ESP_APPTRACE_DEST_JTAG, ///< xxx_TRAX name is obsolete, use more common xxx_JTAG
ESP_APPTRACE_DEST_UART, ///< UART destination
ESP_APPTRACE_DEST_MAX = ESP_APPTRACE_DEST_UART+1,
ESP_APPTRACE_DEST_NUM
} esp_apptrace_dest_t;
/**
* @brief Initializes application tracing module.
* @brief Initializes application tracing module for the selected destination and configuration.
*
* @note Should be called before any esp_apptrace_xxx call.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_init(void);
esp_err_t esp_apptrace_init(const esp_apptrace_config_t *config);
/**
* @brief Configures down buffer.
* @note Needs to be called before attempting to receive any data using esp_apptrace_down_buffer_get and esp_apptrace_read.
* This function does not protect internal data by lock.
*
* @note Needs to be called before attempting to receive any data using esp_apptrace_down_buffer_get and
* esp_apptrace_read. This function does not protect internal data by lock.
*
* @param buf Address of buffer to use for down channel (host to target) data.
* @param size Size of the buffer.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size);
esp_err_t esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size);
/**
* @brief Allocates buffer for trace data.
* Once the data in the buffer is ready to be sent, esp_apptrace_buffer_put must be called to indicate it.
*
* @param dest Indicates HW interface to send data.
* @param size Size of data to write to trace buffer.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return non-NULL on success, otherwise NULL.
*/
uint8_t *esp_apptrace_buffer_get(esp_apptrace_dest_t dest, uint32_t size, uint32_t tmo);
uint8_t *esp_apptrace_buffer_get(uint32_t size, uint32_t tmo);
/**
* @brief Indicates that the data in the buffer is ready to be sent.
* This function is a counterpart of and must be preceded by esp_apptrace_buffer_get.
*
* @param dest Indicates HW interface to send data. Should be identical to the same parameter in call to esp_apptrace_buffer_get.
* @param ptr Address of trace buffer to release. Should be the value returned by call to esp_apptrace_buffer_get.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32_t tmo);
esp_err_t esp_apptrace_buffer_put(uint8_t *ptr, uint32_t tmo);
/**
* @brief Writes data to trace buffer.
*
* @param dest Indicates HW interface to send data.
* @param data Address of data to write to trace buffer.
* @param size Size of data to write to trace buffer.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_write(esp_apptrace_dest_t dest, const void *data, uint32_t size, uint32_t tmo);
esp_err_t esp_apptrace_write(const void *data, uint32_t size, uint32_t tmo);
/**
* @brief vprintf-like function to send log messages to host via specified HW interface.
*
* @param dest Indicates HW interface to send data.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
* @param fmt Address of format string.
* @param ap List of arguments.
*
* @return Number of bytes written.
*/
int esp_apptrace_vprintf_to(esp_apptrace_dest_t dest, uint32_t tmo, const char *fmt, va_list ap);
int esp_apptrace_vprintf_to(uint32_t tmo, const char *fmt, va_list ap);
/**
* @brief vprintf-like function to send log messages to host.
@@ -105,172 +94,198 @@ int esp_apptrace_vprintf(const char *fmt, va_list ap);
/**
* @brief Flushes remaining data in trace buffer to host.
*
* @param dest Indicates HW interface to flush data on.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_flush(esp_apptrace_dest_t dest, uint32_t tmo);
esp_err_t esp_apptrace_flush(uint32_t tmo);
/**
* @brief Flushes remaining data in trace buffer to host without locking internal data.
* This is a special version of esp_apptrace_flush which should be called from panic handler.
*
* @param dest Indicates HW interface to flush data on.
* @param min_sz Threshold for flushing data. If current filling level is above this value, data will be flushed. TRAX destinations only.
* @param min_sz Threshold for flushing data. If current filling level is above this value, data will be flushed. JTAG destinations only.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_flush_nolock(esp_apptrace_dest_t dest, uint32_t min_sz, uint32_t tmo);
esp_err_t esp_apptrace_flush_nolock(uint32_t min_sz, uint32_t tmo);
/**
* @brief Reads host data from trace buffer.
*
* @param dest Indicates HW interface to read the data on.
* @param data Address of buffer to put data from trace buffer.
* @param size Pointer to store size of read data. Before call to this function pointed memory must hold requested size of data
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_read(esp_apptrace_dest_t dest, void *data, uint32_t *size, uint32_t tmo);
esp_err_t esp_apptrace_read(void *data, uint32_t *size, uint32_t tmo);
/**
* @brief Retrieves incoming data buffer if any.
* Once data in the buffer is processed, esp_apptrace_down_buffer_put must be called to indicate it.
*
* @param dest Indicates HW interface to receive data.
* @param size Address to store size of available data in down buffer. Must be initialized with requested value.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return non-NULL on success, otherwise NULL.
*/
uint8_t *esp_apptrace_down_buffer_get(esp_apptrace_dest_t dest, uint32_t *size, uint32_t tmo);
uint8_t *esp_apptrace_down_buffer_get(uint32_t *size, uint32_t tmo);
/**
* @brief Indicates that the data in the down buffer is processed.
* This function is a counterpart of and must be preceded by esp_apptrace_down_buffer_get.
*
* @param dest Indicates HW interface to receive data. Should be identical to the same parameter in call to esp_apptrace_down_buffer_get.
* @param ptr Address of trace buffer to release. Should be the value returned by call to esp_apptrace_down_buffer_get.
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_down_buffer_put(esp_apptrace_dest_t dest, uint8_t *ptr, uint32_t tmo);
esp_err_t esp_apptrace_down_buffer_put(uint8_t *ptr, uint32_t tmo);
/**
* @brief Checks whether host is connected.
*
* @param dest Indicates HW interface to use.
*
* @return true if host is connected, otherwise false
*/
bool esp_apptrace_host_is_connected(esp_apptrace_dest_t dest);
bool esp_apptrace_host_is_connected(void);
/**
* @brief Gets the destination of the application trace.
*
* @return The destination of the application trace.
*/
esp_apptrace_dest_t esp_apptrace_get_destination(void);
/**
* @brief Sets the header size of the application trace packet.
*
* @param header_size The header size to set.
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_apptrace_set_header_size(esp_apptrace_header_size_t header_size);
/**
* @brief Opens file on host.
* This function has the same semantic as 'fopen' except for the first argument.
* This function has the same semantic as 'fopen' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param path Path to file.
* @param mode Mode string. See fopen for details.
*
* @return non zero file handle on success, otherwise 0
*/
void *esp_apptrace_fopen(esp_apptrace_dest_t dest, const char *path, const char *mode);
void *esp_apptrace_fopen(const char *path, const char *mode);
/**
* @brief Closes file on host.
* This function has the same semantic as 'fclose' except for the first argument.
* This function has the same semantic as 'fclose' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param stream File handle returned by esp_apptrace_fopen.
*
* @return Zero on success, otherwise non-zero. See fclose for details.
*/
int esp_apptrace_fclose(esp_apptrace_dest_t dest, void *stream);
int esp_apptrace_fclose(void *stream);
/**
* @brief Writes to file on host.
* This function has the same semantic as 'fwrite' except for the first argument.
* This function has the same semantic as 'fwrite' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param ptr Address of data to write.
* @param size Size of an item.
* @param ptr Address of data to write.
* @param size Size of an item.
* @param nmemb Number of items to write.
* @param stream File handle returned by esp_apptrace_fopen.
*
* @return Number of written items. See fwrite for details.
*/
size_t esp_apptrace_fwrite(esp_apptrace_dest_t dest, const void *ptr, size_t size, size_t nmemb, void *stream);
size_t esp_apptrace_fwrite(const void *ptr, size_t size, size_t nmemb, void *stream);
/**
* @brief Read file on host.
* This function has the same semantic as 'fread' except for the first argument.
* This function has the same semantic as 'fread' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param ptr Address to store read data.
* @param size Size of an item.
* @param ptr Address to store read data.
* @param size Size of an item.
* @param nmemb Number of items to read.
* @param stream File handle returned by esp_apptrace_fopen.
*
* @return Number of read items. See fread for details.
*/
size_t esp_apptrace_fread(esp_apptrace_dest_t dest, void *ptr, size_t size, size_t nmemb, void *stream);
size_t esp_apptrace_fread(void *ptr, size_t size, size_t nmemb, void *stream);
/**
* @brief Set position indicator in file on host.
* This function has the same semantic as 'fseek' except for the first argument.
* This function has the same semantic as 'fseek' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param stream File handle returned by esp_apptrace_fopen.
* @param offset Offset. See fseek for details.
* @param whence Position in file. See fseek for details.
*
* @return Zero on success, otherwise non-zero. See fseek for details.
*/
int esp_apptrace_fseek(esp_apptrace_dest_t dest, void *stream, long offset, int whence);
int esp_apptrace_fseek(void *stream, long offset, int whence);
/**
* @brief Get current position indicator for file on host.
* This function has the same semantic as 'ftell' except for the first argument.
* This function has the same semantic as 'ftell' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param stream File handle returned by esp_apptrace_fopen.
*
* @return Current position in file. See ftell for details.
*/
int esp_apptrace_ftell(esp_apptrace_dest_t dest, void *stream);
int esp_apptrace_ftell(void *stream);
/**
* @brief Indicates to the host that all file operations are complete.
* This function should be called after all file operations are finished and
* indicate to the host that it can perform cleanup operations (close open files etc.).
*
* @param dest Indicates HW interface to use.
* This function should be called after all file operations are finished and
* indicate to the host that it can perform cleanup operations (close open files etc.).
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
int esp_apptrace_fstop(esp_apptrace_dest_t dest);
int esp_apptrace_fstop(void);
/**
* @brief Test end-of-file indicator on a stream.
* This function has the same semantic as 'feof' except for the first argument.
* This function has the same semantic as 'feof' except for the first argument.
*
* @param dest Indicates HW interface to use.
* @param stream File handle returned by esp_apptrace_fopen.
*
* @return Non-Zero if end-of-file indicator is set for stream. See feof for details.
*/
int esp_apptrace_feof(esp_apptrace_dest_t dest, void *stream);
int esp_apptrace_feof(void *stream);
/**
* @brief Triggers gcov info dump.
* This function waits for the host to connect to target before dumping data.
*/
void esp_gcov_dump(void);
#if !CONFIG_APPTRACE_DEST_UART // JTAG or NONE
#define APPTRACE_JTAG_CONFIG_DEFAULT() { \
.dest = ESP_APPTRACE_DEST_JTAG, \
.dest_cfg.jtag = {0}, \
.flush_tmo = CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO, \
.flush_thresh = CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH, \
}
#endif
#if !CONFIG_APPTRACE_DEST_JTAG // UART or NONE
#define APPTRACE_UART_CONFIG_DEFAULT() { \
.dest = ESP_APPTRACE_DEST_UART, \
.dest_cfg.uart = { \
.uart_num = CONFIG_APPTRACE_DEST_UART_NUM, \
.tx_pin_num = CONFIG_APPTRACE_UART_TX_GPIO, \
.rx_pin_num = CONFIG_APPTRACE_UART_RX_GPIO, \
.baud_rate = CONFIG_APPTRACE_UART_BAUDRATE, \
.tx_buff_size = CONFIG_APPTRACE_UART_TX_BUFF_SIZE, \
.tx_msg_size = CONFIG_APPTRACE_UART_TX_MSG_SIZE, \
}, \
.flush_tmo = CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO, \
.flush_thresh = CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH, \
}
#endif
// Default picks JTAG if available, otherwise UART
#if !CONFIG_APPTRACE_DEST_UART
#define APPTRACE_CONFIG_DEFAULT() APPTRACE_JTAG_CONFIG_DEFAULT()
#else
#define APPTRACE_CONFIG_DEFAULT() APPTRACE_UART_CONFIG_DEFAULT()
#endif
#ifdef __cplusplus
}

View File

@@ -0,0 +1,51 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ESP_APP_TRACE_CONFIG_H_
#define ESP_APP_TRACE_CONFIG_H_
#include "sdkconfig.h"
/* Default configurations for runtime selection (APPTRACE_DEST_ALL)
* These values are used when building with both JTAG and UART enabled
* to allow runtime selection. You can switch between destinations
* via esp_apptrace_get_user_params(). If this function is
* not provided by the application, JTAG is used by default with the
* configuration defined below. See esp_app_trace.h for details.
*/
#if !defined(CONFIG_APPTRACE_UART_TX_GPIO) || !defined(CONFIG_APPTRACE_UART_RX_GPIO)
#include "soc/uart_pins.h"
#endif
#ifndef CONFIG_APPTRACE_BUF_SIZE
#define CONFIG_APPTRACE_BUF_SIZE 16384
#endif
#ifndef CONFIG_APPTRACE_UART_TX_BUFF_SIZE
#define CONFIG_APPTRACE_UART_TX_BUFF_SIZE 4096
#endif
#ifndef CONFIG_APPTRACE_UART_TX_MSG_SIZE
#define CONFIG_APPTRACE_UART_TX_MSG_SIZE 128
#endif
#ifndef CONFIG_APPTRACE_UART_BAUDRATE
#define CONFIG_APPTRACE_UART_BAUDRATE 1000000
#endif
#ifndef CONFIG_APPTRACE_UART_TX_GPIO
#define CONFIG_APPTRACE_UART_TX_GPIO U1TXD_GPIO_NUM
#endif
#ifndef CONFIG_APPTRACE_UART_RX_GPIO
#define CONFIG_APPTRACE_UART_RX_GPIO U1RXD_GPIO_NUM
#endif
#ifndef CONFIG_APPTRACE_DEST_UART_NUM
#define CONFIG_APPTRACE_DEST_UART_NUM 1
#endif
#endif /* ESP_APP_TRACE_CONFIG_H_ */

View File

@@ -0,0 +1,95 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ESP_APP_TRACE_TYPES_H_
#define ESP_APP_TRACE_TYPES_H_
#include <stdint.h>
#include "spinlock.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Structure which holds data necessary for measuring time intervals.
*
* After initialization via esp_apptrace_tmo_init() user needs to call esp_apptrace_tmo_check()
* periodically to check timeout for expiration.
*/
typedef struct {
int64_t start; ///< time interval start (in us)
int64_t tmo; ///< timeout value (in us)
int64_t elapsed; ///< elapsed time (in us)
} esp_apptrace_tmo_t;
/** Tracing module synchronization lock */
typedef struct {
spinlock_t mux;
unsigned int int_state;
} esp_apptrace_lock_t;
/** Ring buffer control structure.
*
* @note For purposes of application tracing module if there is no enough space for user data and write pointer can be wrapped
* current ring buffer size can be temporarily shrunk in order to provide buffer with requested size.
*/
typedef struct {
uint8_t *data; ///< pointer to data storage
volatile uint32_t size; ///< size of data storage
volatile uint32_t cur_size; ///< current size of data storage
volatile uint32_t rd; ///< read pointer
volatile uint32_t wr; ///< write pointer
} esp_apptrace_rb_t;
/**
* Application trace data destinations
*/
typedef enum {
ESP_APPTRACE_DEST_JTAG,
ESP_APPTRACE_DEST_UART,
} esp_apptrace_dest_t;
/**
* Application trace configuration for UART destination
*/
typedef struct {
int uart_num; ///< Port number
int tx_pin_num; ///< TX pin number
int rx_pin_num; ///< RX pin number
int baud_rate; ///< Baud rate
uint32_t tx_buff_size; ///< TX ring buffer size
uint32_t tx_msg_size; ///< Maximum size of the single message to transfer.
} esp_apptrace_uart_config_t;
/**
* Application trace trace header size in bytes. It is 2 bytes for SEGGER SystemView
*/
typedef enum {
ESP_APPTRACE_HEADER_SIZE_16 = 2,
ESP_APPTRACE_HEADER_SIZE_32 = 4,
} esp_apptrace_header_size_t;
/**
* Application trace configuration
*/
typedef struct {
esp_apptrace_dest_t dest; ///< Destination type (JTAG or UART)
union {
esp_apptrace_uart_config_t uart; ///< UART configuration (when dest is ESP_APPTRACE_DEST_UART)
struct { ///< Reserved for JTAG (when dest is ESP_APPTRACE_DEST_JTAG)
uint8_t _unused;
} jtag;
} dest_cfg; ///< Destination-specific configuration
uint32_t flush_tmo; ///< Flush timeout in milliseconds
uint32_t flush_thresh; ///< Flush threshold in bytes
} esp_apptrace_config_t;
#ifdef __cplusplus
}
#endif
#endif /* ESP_APP_TRACE_TYPES_H_ */

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -10,34 +10,23 @@
extern "C" {
#endif
#include "freertos/FreeRTOS.h"
#include "esp_err.h"
#include "esp_timer.h"
#include "esp_app_trace_types.h"
/** Infinite waiting timeout */
#define ESP_APPTRACE_TMO_INFINITE ((uint32_t)-1)
/** Structure which holds data necessary for measuring time intervals.
*
* After initialization via esp_apptrace_tmo_init() user needs to call esp_apptrace_tmo_check()
* periodically to check timeout for expiration.
*/
typedef struct {
int64_t start; ///< time interval start (in us)
int64_t tmo; ///< timeout value (in us)
int64_t elapsed; ///< elapsed time (in us)
} esp_apptrace_tmo_t;
/**
* @brief Initializes timeout structure.
*
* @param tmo Pointer to timeout structure to be initialized.
* @param user_tmo Timeout value (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly.
* @param user_tmo Timeout value (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinitely.
*/
static inline void esp_apptrace_tmo_init(esp_apptrace_tmo_t *tmo, uint32_t user_tmo)
{
tmo->start = esp_timer_get_time();
tmo->tmo = user_tmo == ESP_APPTRACE_TMO_INFINITE ? (int64_t)-1 : (int64_t)user_tmo;
tmo->tmo = user_tmo == ESP_APPTRACE_TMO_INFINITE ? (int64_t) -1 : (int64_t)user_tmo;
tmo->elapsed = 0;
}
@@ -52,25 +41,15 @@ esp_err_t esp_apptrace_tmo_check(esp_apptrace_tmo_t *tmo);
static inline uint32_t esp_apptrace_tmo_remaining_us(esp_apptrace_tmo_t *tmo)
{
return tmo->tmo != (int64_t)-1 ? (tmo->elapsed - tmo->tmo) : ESP_APPTRACE_TMO_INFINITE;
return tmo->tmo != (int64_t) -1 ? (tmo->elapsed - tmo->tmo) : ESP_APPTRACE_TMO_INFINITE;
}
/** Tracing module synchronization lock */
typedef struct {
spinlock_t mux;
unsigned int_state;
} esp_apptrace_lock_t;
/**
* @brief Initializes lock structure.
*
* @param lock Pointer to lock structure to be initialized.
*/
static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock)
{
portMUX_INITIALIZE(&lock->mux);
lock->int_state = 0;
}
void esp_apptrace_lock_init(esp_apptrace_lock_t *lock);
/**
* @brief Tries to acquire lock in specified time period.
@@ -91,19 +70,6 @@ esp_err_t esp_apptrace_lock_take(esp_apptrace_lock_t *lock, esp_apptrace_tmo_t *
*/
esp_err_t esp_apptrace_lock_give(esp_apptrace_lock_t *lock);
/** Ring buffer control structure.
*
* @note For purposes of application tracing module if there is no enough space for user data and write pointer can be wrapped
* current ring buffer size can be temporarily shrinked in order to provide buffer with requested size.
*/
typedef struct {
uint8_t *data; ///< pointer to data storage
volatile uint32_t size; ///< size of data storage
volatile uint32_t cur_size; ///< current size of data storage
volatile uint32_t rd; ///< read pointer
volatile uint32_t wr; ///< write pointer
} esp_apptrace_rb_t;
/**
* @brief Initializes ring buffer control structure.
*

View File

@@ -0,0 +1,69 @@
/*
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ESP_DBG_STUBS_H_
#define ESP_DBG_STUBS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
/**
* Debug stubs entries IDs
*/
typedef enum {
ESP_DBG_STUB_MAGIC_NUM,
ESP_DBG_STUB_TABLE_SIZE,
ESP_DBG_STUB_CONTROL_DATA, ///< stubs descriptor entry
ESP_DBG_STUB_ENTRY_FIRST,
ESP_DBG_STUB_ENTRY_GCOV ///< GCOV entry
= ESP_DBG_STUB_ENTRY_FIRST,
ESP_DBG_STUB_ENTRY_CAPABILITIES,
ESP_DBG_STUB_ENTRY_MAX
} esp_dbg_stub_id_t;
#define ESP_DBG_STUB_MAGIC_NUM_VAL 0xFEEDBEEF
#define ESP_DBG_STUB_CAP_GCOV_TASK (1 << 0)
/**
* @brief Initializes debug stubs.
*
* @note Must be called after esp_apptrace_init() if app tracing is enabled.
*/
void esp_dbg_stubs_init(void);
/**
* @brief Initializes application tracing module.
*
* @note Should be called before any esp_apptrace_xxx call.
*
* @param id Stub ID.
* @param entry Stub entry. Usually it is stub entry function address,
* but can be any value meaningful for OpenOCD command/code
* such as capabilities
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_dbg_stub_entry_set(esp_dbg_stub_id_t id, uint32_t entry);
/**
* @brief Retrieves the corresponding stub entry
*
* @param id Stub ID.
* @param entry Stub entry. Usually it is stub entry function address,
* but can be any value meaningful for OpenOCD command/code
* such as capabilities
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_dbg_stub_entry_get(esp_dbg_stub_id_t id, uint32_t *entry);
#ifdef __cplusplus
}
#endif
#endif // ESP_DBG_STUBS_H_

View File

@@ -1,80 +0,0 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ESP_SYSVIEW_TRACE_H_
#define ESP_SYSVIEW_TRACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
#include "esp_err.h"
#include "SEGGER_RTT.h" // SEGGER_RTT_ESP_Flush
#include "esp_app_trace_util.h" // ESP_APPTRACE_TMO_INFINITE
/**
* @brief Flushes remaining data in SystemView trace buffer to host.
*
* @param tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly.
*
* @return ESP_OK.
*/
static inline esp_err_t esp_sysview_flush(uint32_t tmo)
{
SEGGER_RTT_ESP_Flush(0, tmo);
return ESP_OK;
}
/**
* @brief vprintf-like function to sent log messages to the host.
*
* @param format Address of format string.
* @param args List of arguments.
*
* @return Number of bytes written.
*/
int esp_sysview_vprintf(const char * format, va_list args);
/**
* @brief Starts SystemView heap tracing.
*
* @param tmo Timeout (in us) to wait for the host to be connected. Use -1 to wait forever.
*
* @return ESP_OK on success, ESP_ERR_TIMEOUT if operation has been timed out.
*/
esp_err_t esp_sysview_heap_trace_start(uint32_t tmo);
/**
* @brief Stops SystemView heap tracing.
*
* @return ESP_OK.
*/
esp_err_t esp_sysview_heap_trace_stop(void);
/**
* @brief Sends heap allocation event to the host.
*
* @param addr Address of allocated block.
* @param size Size of allocated block.
* @param callers Pointer to array with callstack addresses.
* Array size must be CONFIG_HEAP_TRACING_STACK_DEPTH.
*/
void esp_sysview_heap_trace_alloc(void *addr, uint32_t size, const void *callers);
/**
* @brief Sends heap de-allocation event to the host.
*
* @param addr Address of de-allocated block.
* @param callers Pointer to array with callstack addresses.
* Array size must be CONFIG_HEAP_TRACING_STACK_DEPTH.
*/
void esp_sysview_heap_trace_free(void *addr, const void *callers);
#ifdef __cplusplus
}
#endif
#endif //ESP_SYSVIEW_TRACE_H_

View File

@@ -1,23 +1,11 @@
[mapping:app_trace]
archive: libapp_trace.a
entries:
app_trace (noflash)
port_uart (noflash)
app_trace_util (noflash)
if APPTRACE_MEMBUFS_APPTRACE_PROTO_ENABLE:
app_trace_membufs_proto (noflash)
if APPTRACE_DEST_JTAG = y:
port (noflash)
if APPTRACE_SV_ENABLE = y:
SEGGER_SYSVIEW (noflash)
SEGGER_RTT_esp (noflash)
SEGGER_SYSVIEW_Config_FreeRTOS (noflash)
SEGGER_SYSVIEW_FreeRTOS (noflash)
[mapping:app_trace_driver]
archive: libesp_driver_gptimer.a
entries:
if APPTRACE_SV_TS_SOURCE_GPTIMER = y:
gptimer: gptimer_get_raw_count (noflash)
else:
* (default)
if ESP_TRACE_TRANSPORT_APPTRACE = y:
app_trace (noflash)
app_trace_util (noflash)
if APPTRACE_DEST_JTAG = y || APPTRACE_DEST_ALL = y:
port_jtag (noflash)
app_trace_membufs_proto (noflash)
if APPTRACE_DEST_UART = y || APPTRACE_DEST_ALL = y:
port_uart (noflash)

View File

@@ -15,7 +15,7 @@ extern "C" {
/** Apptrace HW interface. */
typedef struct {
esp_err_t (*init)(void *hw_data);
esp_err_t (*init)(void *hw_data, const esp_apptrace_config_t *config);
uint8_t *(*get_up_buffer)(void *hw_data, uint32_t, esp_apptrace_tmo_t *);
esp_err_t (*put_up_buffer)(void *hw_data, uint8_t *, esp_apptrace_tmo_t *);
esp_err_t (*flush_up_buffer_nolock)(void *hw_data, uint32_t, esp_apptrace_tmo_t *);
@@ -24,6 +24,7 @@ typedef struct {
uint8_t *(*get_down_buffer)(void *hw_data, uint32_t *, esp_apptrace_tmo_t *);
esp_err_t (*put_down_buffer)(void *hw_data, uint8_t *, esp_apptrace_tmo_t *);
bool (*host_is_connected)(void *hw_data);
void (*set_header_size)(void *hw_data, esp_apptrace_header_size_t header_size);
} esp_apptrace_hw_t;
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data);

View File

@@ -1,93 +1,126 @@
/*
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "soc/soc.h"
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include <inttypes.h>
#include "esp_err.h"
#include "esp_log.h"
#include "esp_cpu.h"
#include "esp_app_trace_port.h"
#include "esp_attr.h"
#include "esp_private/uart_share_hw_ctrl.h"
#include "hal/uart_hal.h"
#include "hal/gpio_hal.h"
#include "driver/uart.h"
#include "soc/uart_periph.h"
#include "esp_clk_tree.h"
#include "esp_private/esp_clk_tree_common.h"
#include "soc/gpio_periph.h"
#include "esp_rom_gpio.h"
#include "hal/uart_ll.h"
#include "string.h"
#include "driver/gpio.h"
#include "esp_intr_alloc.h"
#include "esp_heap_caps.h"
#include "esp_private/esp_gpio_reserve.h"
#include "esp_app_trace_port.h"
#include "esp_app_trace_util.h"
#include "esp_app_trace_types.h"
#define APPTRACE_DEST_UART (CONFIG_APPTRACE_DEST_UART0 | CONFIG_APPTRACE_DEST_UART1 | CONFIG_APPTRACE_DEST_UART2)
static const char *TAG = "esp_apptrace_uart";
#define APP_TRACE_MAX_TX_BUFF_UART CONFIG_APPTRACE_UART_TX_BUFF_SIZE
#define APP_TRACE_MAX_TX_MSG_UART CONFIG_APPTRACE_UART_TX_MSG_SIZE
/** UART HW transport data */
typedef struct {
uint8_t inited;
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_t lock; // sync lock
#ifndef MIN
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif
typedef struct {
uint8_t *buffer; ///< Ring buffer data
uint32_t max_size; ///< Ring buffer maximum size (must be power of 2)
volatile uint32_t count; ///< Number of bytes currently in the buffer
volatile uint32_t head; ///< Write pointer index
volatile uint32_t tail; ///< Read pointer index
} esp_apptrace_uart_rb_t;
typedef struct {
int inited;
volatile bool tx_busy; ///< TX busy flag
uart_hal_context_t hal_ctx; ///< UART HAL context
esp_apptrace_uart_rb_t tx_ring; ///< TX ring buffer
intr_handle_t intr_handle; ///< Interrupt handle
/* TX message buffer */
uint8_t *tx_msg_buff; ///< TX message buffer to provide with get_up_buffer
uint32_t tx_msg_buff_size; ///< TX message buffer size & maximum size of the single message to transfer.
uint32_t tx_pending_msg_size; ///< Pending message size to send with put_up_buffer
/* RX message buffer */
uint8_t *rx_msg_buff; ///< RX message buffer provided with down_buffer_config function
uint32_t rx_msg_buff_size; ///< RX message buffer size provided with down_buffer_config function
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_t lock; ///< Sync lock
#endif
uart_port_t port_num;
// TX data ring buffer
uint8_t *tx_data_buff;
int32_t tx_data_buff_in;
int32_t tx_data_buff_out;
// TX message buffer
uint8_t *tx_msg_buff;
uint32_t tx_msg_buff_size;
// RX message buffer
uint8_t *down_buffer;
uint32_t down_buffer_size;
// Buffer overflow flags
bool message_buff_overflow;
bool circular_buff_overflow;
} esp_apptrace_uart_data_t;
#if APPTRACE_DEST_UART
static esp_err_t esp_apptrace_uart_init(esp_apptrace_uart_data_t *hw_data);
static esp_err_t esp_apptrace_uart_flush(esp_apptrace_uart_data_t *hw_data, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_uart_flush_nolock(esp_apptrace_uart_data_t *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo);
static uint8_t *esp_apptrace_uart_up_buffer_get(esp_apptrace_uart_data_t *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_uart_up_buffer_put(esp_apptrace_uart_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static void esp_apptrace_uart_down_buffer_config(esp_apptrace_uart_data_t *hw_data, uint8_t *buf, uint32_t size);
static uint8_t *esp_apptrace_uart_down_buffer_get(esp_apptrace_uart_data_t *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_uart_down_buffer_put(esp_apptrace_uart_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static bool esp_apptrace_uart_host_is_connected(esp_apptrace_uart_data_t *hw_data);
#endif // APPTRACE_DEST_UART
const static char *TAG = "esp_apptrace_uart";
esp_apptrace_hw_t *esp_apptrace_uart_hw_get(int num, void **data)
static inline bool is_power_of_two(uint32_t n)
{
ESP_LOGD(TAG,"esp_apptrace_uart_hw_get - %i", num);
#if APPTRACE_DEST_UART
static esp_apptrace_uart_data_t s_uart_hw_data = {
};
static esp_apptrace_hw_t s_uart_hw = {
.init = (esp_err_t (*)(void *))esp_apptrace_uart_init,
.get_up_buffer = (uint8_t *(*)(void *, uint32_t, esp_apptrace_tmo_t *))esp_apptrace_uart_up_buffer_get,
.put_up_buffer = (esp_err_t (*)(void *, uint8_t *, esp_apptrace_tmo_t *))esp_apptrace_uart_up_buffer_put,
.flush_up_buffer_nolock = (esp_err_t (*)(void *, uint32_t, esp_apptrace_tmo_t *))esp_apptrace_uart_flush_nolock,
.flush_up_buffer = (esp_err_t (*)(void *, esp_apptrace_tmo_t *))esp_apptrace_uart_flush,
.down_buffer_config = (void (*)(void *, uint8_t *, uint32_t ))esp_apptrace_uart_down_buffer_config,
.get_down_buffer = (uint8_t *(*)(void *, uint32_t *, esp_apptrace_tmo_t *))esp_apptrace_uart_down_buffer_get,
.put_down_buffer = (esp_err_t (*)(void *, uint8_t *, esp_apptrace_tmo_t *))esp_apptrace_uart_down_buffer_put,
.host_is_connected = (bool (*)(void *))esp_apptrace_uart_host_is_connected,
};
s_uart_hw_data.port_num = num;
*data = &s_uart_hw_data;
return &s_uart_hw;
#else
return NULL;
#endif
return n != 0 && (n & (n - 1)) == 0;
}
#if APPTRACE_DEST_UART
static inline uint32_t ring_buffer_mask(const esp_apptrace_uart_rb_t *rb)
{
return rb->max_size - 1;
}
static esp_err_t esp_apptrace_uart_lock(esp_apptrace_uart_data_t *hw_data, esp_apptrace_tmo_t *tmo)
/* Get the length of the data in the ring buffer */
static inline uint32_t ring_buffer_data_len(const esp_apptrace_uart_rb_t *rb)
{
return rb->count;
}
/* Get the length of the free space in the ring buffer */
static inline uint32_t ring_buffer_free_len(const esp_apptrace_uart_rb_t *rb)
{
return rb->max_size - rb->count;
}
static inline void ring_buffer_advance_tail(esp_apptrace_uart_rb_t *rb, uint32_t count)
{
rb->tail = (rb->tail + count) & ring_buffer_mask(rb);
rb->count -= count;
}
static inline void ring_buffer_advance_head(esp_apptrace_uart_rb_t *rb, uint32_t count)
{
rb->head = (rb->head + count) & ring_buffer_mask(rb);
rb->count += count;
}
static inline uint32_t ring_buffer_calc_to_send(const esp_apptrace_uart_rb_t *rb, uint32_t tx_msg_size)
{
uint32_t used = ring_buffer_data_len(rb);
if (used == 0) {
return 0;
}
uint32_t cont = rb->max_size - rb->tail;
uint32_t n = MIN(used, cont);
/* Apply message size limit if specified */
if (tx_msg_size && tx_msg_size < n) {
return tx_msg_size;
}
return n;
}
static esp_err_t esp_apptrace_uart_lock(void *hw_data, esp_apptrace_tmo_t *tmo)
{
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_err_t ret = esp_apptrace_lock_take(&hw_data->lock, tmo);
esp_apptrace_uart_data_t *uart_data = hw_data;
esp_err_t ret = esp_apptrace_lock_take(&uart_data->lock, tmo);
if (ret != ESP_OK) {
return ESP_FAIL;
}
@@ -95,261 +128,395 @@ static esp_err_t esp_apptrace_uart_lock(esp_apptrace_uart_data_t *hw_data, esp_a
return ESP_OK;
}
static esp_err_t esp_apptrace_uart_unlock(esp_apptrace_uart_data_t *hw_data)
static esp_err_t esp_apptrace_uart_unlock(void *hw_data)
{
esp_err_t ret = ESP_OK;
#if CONFIG_APPTRACE_LOCK_ENABLE
ret = esp_apptrace_lock_give(&hw_data->lock);
esp_apptrace_uart_data_t *uart_data = hw_data;
ret = esp_apptrace_lock_give(&uart_data->lock);
assert(ret == ESP_OK && "Failed to unlock apptrace uart lock!");
#endif
return ret;
}
static inline void esp_apptrace_uart_hw_init(void)
static esp_err_t ring_buffer_put(esp_apptrace_uart_rb_t *rb, const uint8_t *data, uint32_t len)
{
ESP_APPTRACE_LOGI("Initialized UART on CPU%d", esp_cpu_get_core_id());
/* Drop oldest. Make available space if needed */
uint32_t free_len = ring_buffer_free_len(rb);
if (len > free_len) {
uint32_t need = len - free_len;
ring_buffer_advance_tail(rb, need);
}
uint32_t head = rb->head;
uint32_t space_to_end = rb->max_size - head;
if (len <= space_to_end) {
memcpy(&rb->buffer[head], data, len);
} else {
memcpy(&rb->buffer[head], data, space_to_end);
memcpy(&rb->buffer[0], &data[space_to_end], len - space_to_end);
}
ring_buffer_advance_head(rb, len);
return ESP_OK;
}
/*****************************************************************************************/
/***************************** Apptrace HW iface *****************************************/
/*****************************************************************************************/
static esp_err_t esp_apptrace_send_uart_data(esp_apptrace_uart_data_t *hw_data, const char *data, uint32_t size, esp_apptrace_tmo_t *tmo)
static esp_err_t ring_buffer_init(esp_apptrace_uart_rb_t *rb, uint32_t size)
{
esp_err_t res = esp_apptrace_uart_lock(hw_data, tmo);
rb->buffer = heap_caps_malloc(size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
if (!rb->buffer) {
return ESP_ERR_NO_MEM;
}
rb->max_size = size;
rb->count = 0;
rb->head = 0;
rb->tail = 0;
return ESP_OK;
}
static void IRAM_ATTR esp_apptrace_uart_isr_handler(void *arg)
{
esp_apptrace_uart_data_t *uart_data = arg;
esp_apptrace_uart_rb_t *rb = &uart_data->tx_ring;
uint32_t intr_status = uart_hal_get_intsts_mask(&uart_data->hal_ctx);
if (intr_status & UART_INTR_TXFIFO_EMPTY) {
uart_hal_clr_intsts_mask(&uart_data->hal_ctx, UART_INTR_TXFIFO_EMPTY);
uint32_t to_send = ring_buffer_calc_to_send(rb, uart_data->tx_msg_buff_size);
if (to_send > 0) {
uint32_t written = 0;
uart_hal_write_txfifo(&uart_data->hal_ctx, &rb->buffer[rb->tail], to_send, &written);
ring_buffer_advance_tail(rb, written);
}
/* If ring buffer is empty, disable TX interrupt */
if (ring_buffer_data_len(rb) == 0) {
uart_ll_disable_intr_mask(uart_data->hal_ctx.dev, UART_INTR_TXFIFO_EMPTY);
uart_data->tx_busy = false;
}
}
}
static esp_err_t esp_apptrace_uart_init(void *hw_data, const esp_apptrace_config_t *config)
{
esp_err_t ret = ESP_ERR_INVALID_ARG;
uint64_t gpio_mask = 0;
esp_apptrace_uart_data_t *uart_data = hw_data;
const esp_apptrace_uart_config_t *uart_config = &config->dest_cfg.uart;
/* Init function is called on every core, so ensure to do main setup only once */
int core_id = esp_cpu_get_core_id();
if (core_id == 0) {
if (uart_config->uart_num == CONFIG_ESP_CONSOLE_UART_NUM) {
ESP_APPTRACE_LOGE("Application trace UART and console UART cannot use the same port number");
return ESP_ERR_INVALID_ARG;
}
if (uart_config->uart_num >= SOC_UART_HP_NUM) {
ESP_APPTRACE_LOGE("UART port number %d is not supported!", uart_config->uart_num);
return ESP_ERR_NOT_SUPPORTED;
}
if (GPIO_IS_VALID_GPIO(uart_config->tx_pin_num)) {
gpio_mask |= BIT64(uart_config->tx_pin_num);
}
if (GPIO_IS_VALID_GPIO(uart_config->rx_pin_num)) {
gpio_mask |= BIT64(uart_config->rx_pin_num);
}
if (gpio_mask == 0) {
ESP_LOGE(TAG, "No valid GPIOs to reserve");
return ESP_ERR_INVALID_STATE;
}
uint64_t r = esp_gpio_reserve(gpio_mask);
if (r & gpio_mask) {
ESP_LOGE(TAG, "GPIO(s) are already reserved: 0x%"PRIx64, r & gpio_mask);
return ESP_ERR_INVALID_STATE;
}
uart_data->hal_ctx.dev = UART_LL_GET_HW(uart_config->uart_num);
HP_UART_BUS_CLK_ATOMIC() {
uart_ll_enable_bus_clock(uart_config->uart_num, true);
uart_ll_reset_register(uart_config->uart_num);
}
HP_UART_SRC_CLK_ATOMIC() {
uart_ll_sclk_enable(uart_data->hal_ctx.dev);
}
uint32_t sclk_hz;
esp_clk_tree_src_get_freq_hz(UART_SCLK_DEFAULT, ESP_CLK_TREE_SRC_FREQ_PRECISION_CACHED, &sclk_hz);
/* Enable the default clock source */
esp_clk_tree_enable_src(UART_SCLK_DEFAULT, true);
/* Initialize UART HAL (sets default 8N1 mode) */
uart_hal_init(&uart_data->hal_ctx, uart_config->uart_num);
ESP_LOGI(TAG, "uart_hal_init: %d", uart_config->uart_num);
HP_UART_SRC_CLK_ATOMIC() {
uart_hal_set_sclk(&uart_data->hal_ctx, UART_SCLK_DEFAULT);
uart_hal_set_baudrate(&uart_data->hal_ctx, uart_config->baud_rate, sclk_hz);
}
/* Configure FIFO thresholds */
uart_hal_set_txfifo_empty_thr(&uart_data->hal_ctx, 16); /* Slow down IRQ rate */
uart_hal_set_rxfifo_full_thr(&uart_data->hal_ctx, 1);
/* Initialize TX ring buffer */
if (uart_config->tx_buff_size == 0 || !is_power_of_two(uart_config->tx_buff_size)) {
ESP_APPTRACE_LOGE("TX ring buffer size (%u) must be a power of two and greater than 0",
uart_config->tx_buff_size);
goto err_init_ring_buff;
}
ret = ring_buffer_init(&uart_data->tx_ring, uart_config->tx_buff_size);
if (ret != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to initialize TX ring buffer");
goto err_init_ring_buff;
}
/* Initialize TX message buffer for providing with get_up_buffer */
uart_data->tx_msg_buff_size = uart_config->tx_msg_size;
uart_data->tx_msg_buff = heap_caps_malloc(uart_data->tx_msg_buff_size, MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
if (uart_data->tx_msg_buff == NULL) {
ESP_APPTRACE_LOGE("Failed to initialize TX message buffer");
ret = ESP_ERR_NO_MEM;
goto err_alloc_msg_buff;
}
/* Disable all interrupts and clear status */
uart_ll_disable_intr_mask(uart_data->hal_ctx.dev, UART_LL_INTR_MASK);
uart_ll_clr_intsts_mask(uart_data->hal_ctx.dev, UART_LL_INTR_MASK);
/* Install interrupt handler */
int intr_alloc_flags = 0;
ret = esp_intr_alloc(uart_periph_signal[uart_config->uart_num].irq, intr_alloc_flags,
esp_apptrace_uart_isr_handler, uart_data, &uart_data->intr_handle);
if (ret != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to allocate interrupt: %s", esp_err_to_name(ret));
goto err_alloc_intr;
}
/* Reset FIFOs */
uart_hal_rxfifo_rst(&uart_data->hal_ctx);
uart_hal_txfifo_rst(&uart_data->hal_ctx);
/* Configure GPIO pins for RX and TX */
const uint32_t tx_idx = UART_PERIPH_SIGNAL(uart_config->uart_num, SOC_UART_PERIPH_SIGNAL_TX);
const uint32_t rx_idx = UART_PERIPH_SIGNAL(uart_config->uart_num, SOC_UART_PERIPH_SIGNAL_RX);
/* Configure TX pin */
gpio_ll_func_sel(&GPIO, uart_config->tx_pin_num, PIN_FUNC_GPIO);
esp_rom_gpio_pad_pullup_only(uart_config->tx_pin_num);
esp_rom_gpio_connect_out_signal(uart_config->tx_pin_num, tx_idx, 0, 0);
/* Configure RX pin */
gpio_ll_input_enable(&GPIO, uart_config->rx_pin_num);
esp_rom_gpio_pad_pullup_only(uart_config->rx_pin_num);
esp_rom_gpio_connect_in_signal(uart_config->rx_pin_num, rx_idx, 0);
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_init(&uart_data->lock);
#endif
}
uart_data->inited |= 1 << core_id;
uart_data->tx_busy = false;
return ESP_OK;
err_alloc_intr:
heap_caps_free(uart_data->tx_msg_buff);
err_alloc_msg_buff:
heap_caps_free(uart_data->tx_ring.buffer);
err_init_ring_buff:
esp_clk_tree_enable_src(UART_SCLK_DEFAULT, false);
HP_UART_SRC_CLK_ATOMIC() {
uart_ll_sclk_disable(uart_data->hal_ctx.dev);
}
HP_UART_BUS_CLK_ATOMIC() {
uart_ll_enable_bus_clock(uart_config->uart_num, false);
}
esp_gpio_revoke(gpio_mask);
return ret;
}
static uint8_t *esp_apptrace_uart_up_buffer_get(void *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_uart_data_t *uart_data = hw_data;
if (size == 0 || size > uart_data->tx_msg_buff_size) {
return NULL;
}
if (esp_apptrace_uart_lock(uart_data, tmo) != ESP_OK) {
return NULL;
}
if (uart_data->tx_pending_msg_size != 0) {
// A previous message was not sent.
esp_apptrace_uart_unlock(uart_data);
return NULL;
}
uart_data->tx_pending_msg_size = size;
esp_apptrace_uart_unlock(uart_data);
return uart_data->tx_msg_buff;
}
static esp_err_t esp_apptrace_uart_up_buffer_put(void *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_uart_data_t *uart_data = hw_data;
esp_apptrace_uart_rb_t *rb = &uart_data->tx_ring;
esp_err_t res = esp_apptrace_uart_lock(uart_data, tmo);
if (res != ESP_OK) {
return res;
}
// We store current out position to handle it without lock
volatile int32_t out_position = hw_data->tx_data_buff_out;
int len_free = APP_TRACE_MAX_TX_BUFF_UART - (hw_data->tx_data_buff_in - out_position);
if (out_position > hw_data->tx_data_buff_in) {
len_free = out_position - hw_data->tx_data_buff_in;
}
int check_len = APP_TRACE_MAX_TX_BUFF_UART - hw_data->tx_data_buff_in;
if (size <= len_free)
{
if ( check_len >= size) {
memcpy(&hw_data->tx_data_buff[hw_data->tx_data_buff_in], data, size);
hw_data->tx_data_buff_in += size;
} else {
memcpy(&hw_data->tx_data_buff[hw_data->tx_data_buff_in], data, APP_TRACE_MAX_TX_BUFF_UART - hw_data->tx_data_buff_in);
memcpy(&hw_data->tx_data_buff[0], &data[APP_TRACE_MAX_TX_BUFF_UART - hw_data->tx_data_buff_in], size - (APP_TRACE_MAX_TX_BUFF_UART - hw_data->tx_data_buff_in));
hw_data->tx_data_buff_in = size - (APP_TRACE_MAX_TX_BUFF_UART - hw_data->tx_data_buff_in);
}
if (hw_data->tx_data_buff_in >= APP_TRACE_MAX_TX_BUFF_UART) {
hw_data->tx_data_buff_in = 0;
}
} else {
hw_data->circular_buff_overflow = true;
}
/* Add data to ring buffer */
ring_buffer_put(rb, ptr, uart_data->tx_pending_msg_size);
uart_data->tx_pending_msg_size = 0;
if (esp_apptrace_uart_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
esp_apptrace_uart_unlock(uart_data);
// Trigger transmission if not already in progress
if (!uart_data->tx_busy) {
uart_data->tx_busy = true;
/* Enable TX interrupt */
uart_ll_clr_intsts_mask(uart_data->hal_ctx.dev, UART_INTR_TXFIFO_EMPTY);
uart_ll_ena_intr_mask(uart_data->hal_ctx.dev, UART_INTR_TXFIFO_EMPTY);
}
return ESP_OK;
}
static void send_buff_data(esp_apptrace_uart_data_t *hw_data, esp_apptrace_tmo_t *tmo)
static void esp_apptrace_uart_down_buffer_config(void *hw_data, uint8_t *buf, uint32_t size)
{
if (hw_data->tx_data_buff_in == hw_data->tx_data_buff_out) {
return;
}
// We store current in position to handle it without lock
volatile int32_t in_position = hw_data->tx_data_buff_in;
if (in_position > hw_data->tx_data_buff_out) {
int bytes_sent = uart_write_bytes(hw_data->port_num, &hw_data->tx_data_buff[hw_data->tx_data_buff_out], in_position - hw_data->tx_data_buff_out);
hw_data->tx_data_buff_out += bytes_sent;
} else {
int bytes_sent = uart_write_bytes(hw_data->port_num, &hw_data->tx_data_buff[hw_data->tx_data_buff_out], APP_TRACE_MAX_TX_BUFF_UART - hw_data->tx_data_buff_out);
hw_data->tx_data_buff_out += bytes_sent;
if (hw_data->tx_data_buff_out >= APP_TRACE_MAX_TX_BUFF_UART) {
hw_data->tx_data_buff_out = 0;
}
}
esp_apptrace_uart_data_t *uart_data = hw_data;
assert(buf != NULL && "Down buffer cannot be NULL");
assert(size > 0 && "Down buffer size must be greater than 0");
uart_data->rx_msg_buff = buf;
uart_data->rx_msg_buff_size = size;
}
#define APP_TRACE_UART_STOP_WAIT_TMO 1000000 //us
static void esp_apptrace_send_uart_tx_task(void *arg)
static uint8_t *esp_apptrace_uart_down_buffer_get(void *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_uart_data_t *hw_data = (esp_apptrace_uart_data_t *)arg;
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, APP_TRACE_UART_STOP_WAIT_TMO);
vTaskDelay(10);
while (1) {
send_buff_data(hw_data, &tmo);
vTaskDelay(10);
if (hw_data->circular_buff_overflow == true)
{
hw_data->circular_buff_overflow = false;
ESP_LOGE(TAG, "Buffer overflow. Please increase UART baudrate, or increase UART TX ring buffer size in menuconfig.");
}
if (hw_data->message_buff_overflow == true)
{
hw_data->message_buff_overflow = false;
ESP_LOGE(TAG, "Message size more then message buffer!");
}
esp_apptrace_uart_data_t *uart_data = hw_data;
if (!size || *size == 0) {
return NULL;
}
if (!uart_data->rx_msg_buff) {
ESP_APPTRACE_LOGE("RX message buffer is not configured. Call down_buffer_config() first.");
return NULL;
}
if (esp_apptrace_uart_lock(uart_data, tmo) != ESP_OK) {
return NULL;
}
uint32_t rx_len = uart_ll_get_rxfifo_len(uart_data->hal_ctx.dev);
int to_read = MIN(rx_len, MIN(uart_data->rx_msg_buff_size, *size));
if (to_read) {
uart_hal_read_rxfifo(&uart_data->hal_ctx, uart_data->rx_msg_buff, &to_read);
}
*size = to_read;
esp_apptrace_uart_unlock(uart_data);
return (*size > 0) ? uart_data->rx_msg_buff : NULL;
}
static const int APP_TRACE_UART_RX_BUF_SIZE = 4024;
static esp_err_t esp_apptrace_uart_init(esp_apptrace_uart_data_t *hw_data)
static esp_err_t esp_apptrace_uart_down_buffer_put(void *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
int core_id = esp_cpu_get_core_id();
if (core_id == 0) {
hw_data->tx_data_buff = (uint8_t *)heap_caps_malloc(APP_TRACE_MAX_TX_BUFF_UART, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
if (hw_data->tx_data_buff == NULL){
return ESP_ERR_NO_MEM;
}
hw_data->tx_data_buff_in = 0;
hw_data->tx_data_buff_out = 0;
hw_data->tx_msg_buff = (uint8_t *)heap_caps_malloc(APP_TRACE_MAX_TX_MSG_UART, MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT);
if (hw_data->tx_msg_buff == NULL)
{
return ESP_ERR_NO_MEM;
}
hw_data->tx_msg_buff_size = 0;
hw_data->down_buffer_size = 0;
hw_data->message_buff_overflow = false;
hw_data->circular_buff_overflow = false;
(void)hw_data;
(void)ptr;
(void)tmo;
assert((hw_data->port_num <= SOC_UART_NUM) && "Not possible to configure UART. Please check selected UART port");
/* No action needed - data was already read in get function */
return ESP_OK;
}
int source_clk = UART_SCLK_DEFAULT;
#if SOC_UART_LP_NUM > 0
if (hw_data->port_num >= SOC_UART_HP_NUM)
source_clk = LP_UART_SCLK_DEFAULT;
#endif
static bool esp_apptrace_uart_host_is_connected(void *hw_data)
{
esp_apptrace_uart_data_t *uart_data = hw_data;
const uart_config_t uart_config = {
.baud_rate = CONFIG_APPTRACE_UART_BAUDRATE,
.data_bits = UART_DATA_8_BITS,
.parity = UART_PARITY_DISABLE,
.stop_bits = UART_STOP_BITS_1,
.flow_ctrl = UART_HW_FLOWCTRL_DISABLE,
.source_clk = source_clk,
};
ESP_LOGI(TAG, "UART baud rate: %i", CONFIG_APPTRACE_UART_BAUDRATE);
// We won't use a buffer for sending data.
esp_err_t err = uart_driver_install(hw_data->port_num, APP_TRACE_UART_RX_BUF_SIZE, APP_TRACE_UART_RX_BUF_SIZE, 0, NULL, 0);
assert((err == ESP_OK) && "Not possible to install UART. Please check and change menuconfig parameters!");
err = uart_param_config(hw_data->port_num, &uart_config);
assert((err == ESP_OK) && "Not possible to configure UART. Please check and change menuconfig parameters!");
err = uart_set_pin(hw_data->port_num, CONFIG_APPTRACE_UART_TX_GPIO, CONFIG_APPTRACE_UART_RX_GPIO, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
assert((err == ESP_OK) && "Not possible to configure UART RX/TX pins. Please check and change menuconfig parameters!");
return uart_data->inited & 1;
}
int uart_prio = CONFIG_APPTRACE_UART_TASK_PRIO;
if (uart_prio >= (configMAX_PRIORITIES-1)) uart_prio = configMAX_PRIORITIES - 1;
err = xTaskCreate(esp_apptrace_send_uart_tx_task, "app_trace_uart_tx_task", 2500, hw_data, uart_prio, NULL);
assert((err == pdPASS) && "Not possible to configure UART. Not possible to create task!");
static esp_err_t esp_apptrace_uart_flush_nolock(void *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_uart_data_t *uart_data = hw_data;
esp_apptrace_uart_rb_t *rb = &uart_data->tx_ring;
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_init(&hw_data->lock);
#endif
uint32_t pending = ring_buffer_data_len(rb);
if (pending < min_sz) {
ESP_APPTRACE_LOGD("Ignore UART flush request for min %" PRIu32 " bytes. Pending bytes: %" PRIu32, min_sz, pending);
return ESP_OK;
}
/* Trigger transmission if there's data but not busy */
if (pending > 0 && !uart_data->tx_busy) {
uart_data->tx_busy = true;
uart_ll_clr_intsts_mask(uart_data->hal_ctx.dev, UART_INTR_TXFIFO_EMPTY);
uart_ll_ena_intr_mask(uart_data->hal_ctx.dev, UART_INTR_TXFIFO_EMPTY);
}
while (uart_data->tx_busy || ring_buffer_data_len(rb) > 0) {
if (esp_apptrace_tmo_check(tmo) != ESP_OK) {
return ESP_ERR_TIMEOUT;
}
esp_rom_delay_us(100);
}
// init UART on this CPU
esp_apptrace_uart_hw_init();
hw_data->inited |= 1 << core_id;
return ESP_OK;
}
static uint8_t *esp_apptrace_uart_up_buffer_get(esp_apptrace_uart_data_t *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo)
static esp_err_t esp_apptrace_uart_flush(void *hw_data, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr;
if (size > APP_TRACE_MAX_TX_MSG_UART) {
hw_data->message_buff_overflow = true;
return NULL;
}
if (hw_data->tx_msg_buff_size != 0)
{
// A previous message was not sent.
return NULL;
}
esp_err_t res = esp_apptrace_uart_lock(hw_data, tmo);
esp_apptrace_uart_data_t *uart_data = hw_data;
esp_err_t res = esp_apptrace_uart_lock(uart_data, tmo);
if (res != ESP_OK) {
return NULL;
}
ptr = hw_data->tx_msg_buff;
hw_data->tx_msg_buff_size = size;
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_uart_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_uart_up_buffer_put(esp_apptrace_uart_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_err_t res = esp_apptrace_send_uart_data(hw_data, (const char *)ptr, hw_data->tx_msg_buff_size, tmo);
// Clear size to indicate that we've sent data
hw_data->tx_msg_buff_size = 0;
return res;
}
static void esp_apptrace_uart_down_buffer_config(esp_apptrace_uart_data_t *hw_data, uint8_t *buf, uint32_t size)
{
hw_data->down_buffer = (uint8_t *)malloc(size);
if (hw_data->down_buffer == NULL){
assert(false && "Failed to allocate apptrace uart down buffer!");
}
hw_data->down_buffer_size = size;
}
static uint8_t *esp_apptrace_uart_down_buffer_get(esp_apptrace_uart_data_t *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr = NULL;
if (*size > hw_data->down_buffer_size) {
return NULL;
return res;
}
esp_err_t res = esp_apptrace_uart_lock(hw_data, tmo);
if (res != ESP_OK) {
return NULL;
}
esp_err_t ret = esp_apptrace_uart_flush_nolock(hw_data, 0, tmo);
size_t uart_fifolen = 0;
uart_get_buffered_data_len(hw_data->port_num, &uart_fifolen);
if (uart_fifolen > 0) {
if (*size < uart_fifolen) {
uart_fifolen = *size;
}
*size = uart_fifolen;
ptr = hw_data->down_buffer;
*size =uart_read_bytes(hw_data->port_num, ptr, uart_fifolen, 0);
}
esp_apptrace_uart_unlock(uart_data);
if (esp_apptrace_uart_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
return ret;
}
static esp_err_t esp_apptrace_uart_down_buffer_put(esp_apptrace_uart_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
esp_apptrace_hw_t *esp_apptrace_uart_hw_get(int num, void **data)
{
return ESP_OK;
}
ESP_APPTRACE_LOGD("esp_apptrace_uart_hw_get - %i", num);
static bool esp_apptrace_uart_host_is_connected(esp_apptrace_uart_data_t *hw_data)
{
return hw_data->inited & 1;
static esp_apptrace_uart_data_t s_uart_hw_data;
static esp_apptrace_hw_t s_uart_hw = {
.init = esp_apptrace_uart_init,
.get_up_buffer = esp_apptrace_uart_up_buffer_get,
.put_up_buffer = esp_apptrace_uart_up_buffer_put,
.flush_up_buffer_nolock = esp_apptrace_uart_flush_nolock,
.flush_up_buffer = esp_apptrace_uart_flush,
.down_buffer_config = esp_apptrace_uart_down_buffer_config,
.get_down_buffer = esp_apptrace_uart_down_buffer_get,
.put_down_buffer = esp_apptrace_uart_down_buffer_put,
.host_is_connected = esp_apptrace_uart_host_is_connected,
};
*data = &s_uart_hw_data;
return &s_uart_hw;
}
static esp_err_t esp_apptrace_uart_flush_nolock(esp_apptrace_uart_data_t *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
return ESP_OK;
}
static esp_err_t esp_apptrace_uart_flush(esp_apptrace_uart_data_t *hw_data, esp_apptrace_tmo_t *tmo)
{
return ESP_OK;
}
#endif // APPTRACE_DEST_UART

View File

@@ -1,367 +0,0 @@
/*
* SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
#include "sdkconfig.h"
#include "esp_cpu.h"
#include "esp_log.h"
#include "esp_app_trace_membufs_proto.h"
#include "esp_app_trace_port.h"
#include "riscv/semihosting.h"
/** RISCV HW transport data */
typedef struct {
uint8_t inited; // initialization state flags for every core
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_t lock; // sync lock
#endif
esp_apptrace_membufs_proto_data_t membufs;
} esp_apptrace_riscv_data_t;
/** RISCV memory host iface control block */
typedef struct {
uint32_t ctrl;
// - Guard field. If this register is not zero then CPU is changing this struct and
// this guard field holds address of the instruction which application will execute when CPU finishes with those modifications.
uint32_t stat;
esp_apptrace_mem_block_t * mem_blocks;
} esp_apptrace_riscv_ctrl_block_t;
#define ESP_APPTRACE_RISCV_BLOCK_LEN_MSK 0x7FFFUL
#define ESP_APPTRACE_RISCV_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_RISCV_BLOCK_LEN_MSK)
#define ESP_APPTRACE_RISCV_BLOCK_LEN_GET(_v_) ((_v_) & ESP_APPTRACE_RISCV_BLOCK_LEN_MSK)
#define ESP_APPTRACE_RISCV_BLOCK_ID_MSK 0x7FUL
#define ESP_APPTRACE_RISCV_BLOCK_ID(_id_) (((_id_) & ESP_APPTRACE_RISCV_BLOCK_ID_MSK) << 15)
#define ESP_APPTRACE_RISCV_BLOCK_ID_GET(_v_) (((_v_) >> 15) & ESP_APPTRACE_RISCV_BLOCK_ID_MSK)
#define ESP_APPTRACE_RISCV_HOST_DATA (1 << 22)
#define ESP_APPTRACE_RISCV_HOST_CONNECT (1 << 23)
#define ESP_APPTRACE_RISCV_INITED(_hw_) ((_hw_)->inited & (1 << 0/*esp_cpu_get_core_id()*/))
static esp_err_t esp_apptrace_riscv_init(esp_apptrace_riscv_data_t *hw_data);
static esp_err_t esp_apptrace_riscv_flush(esp_apptrace_riscv_data_t *hw_data, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_riscv_flush_nolock(esp_apptrace_riscv_data_t *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo);
static uint8_t *esp_apptrace_riscv_up_buffer_get(esp_apptrace_riscv_data_t *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_riscv_up_buffer_put(esp_apptrace_riscv_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static void esp_apptrace_riscv_down_buffer_config(esp_apptrace_riscv_data_t *hw_data, uint8_t *buf, uint32_t size);
static uint8_t *esp_apptrace_riscv_down_buffer_get(esp_apptrace_riscv_data_t *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo);
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, 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);
const static char *TAG = "esp_apptrace";
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
#define APPTRACE_DRAM_ATTR TCM_DRAM_ATTR
#else
#define APPTRACE_DRAM_ATTR
#endif
static APPTRACE_DRAM_ATTR esp_apptrace_riscv_ctrl_block_t s_tracing_ctrl[CONFIG_FREERTOS_NUMBER_OF_CORES];
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
{
#if CONFIG_APPTRACE_DEST_JTAG
static esp_apptrace_membufs_proto_hw_t s_trace_proto_hw = {
.swap_start = esp_apptrace_riscv_buffer_swap_start,
.swap = esp_apptrace_riscv_buffer_swap,
.swap_end = esp_apptrace_riscv_buffer_swap_end,
.host_data_pending = esp_apptrace_riscv_host_data_pending,
};
static esp_apptrace_riscv_data_t s_trace_hw_data = {
.membufs = {
.hw = &s_trace_proto_hw,
},
};
static esp_apptrace_hw_t s_trace_hw = {
.init = (esp_err_t (*)(void *))esp_apptrace_riscv_init,
.get_up_buffer = (uint8_t *(*)(void *, uint32_t, esp_apptrace_tmo_t *))esp_apptrace_riscv_up_buffer_get,
.put_up_buffer = (esp_err_t (*)(void *, uint8_t *, esp_apptrace_tmo_t *))esp_apptrace_riscv_up_buffer_put,
.flush_up_buffer_nolock = (esp_err_t (*)(void *, uint32_t, esp_apptrace_tmo_t *))esp_apptrace_riscv_flush_nolock,
.flush_up_buffer = (esp_err_t (*)(void *, esp_apptrace_tmo_t *))esp_apptrace_riscv_flush,
.down_buffer_config = (void (*)(void *, uint8_t *, uint32_t ))esp_apptrace_riscv_down_buffer_config,
.get_down_buffer = (uint8_t *(*)(void *, uint32_t *, esp_apptrace_tmo_t *))esp_apptrace_riscv_down_buffer_get,
.put_down_buffer = (esp_err_t (*)(void *, uint8_t *, esp_apptrace_tmo_t *))esp_apptrace_riscv_down_buffer_put,
.host_is_connected = (bool (*)(void *))esp_apptrace_riscv_host_is_connected,
};
*data = &s_trace_hw_data;
return &s_trace_hw;
#else
return NULL;
#endif
}
/* Advertises apptrace control block address to host.
This function can be overridden with custom implementation,
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) int esp_apptrace_advertise_ctrl_block(void *ctrl_block_addr)
{
if (!esp_cpu_dbgr_is_attached()) {
return 0;
}
return (int) semihosting_call_noerrno(ESP_SEMIHOSTING_SYS_APPTRACE_INIT, (long*)ctrl_block_addr);
}
/* Returns up buffers config.
This function can be overridden with custom implementation,
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) void esp_apptrace_get_up_buffers(esp_apptrace_mem_block_t mem_blocks_cfg[2])
{
static uint8_t s_mem_blocks[2][CONFIG_APPTRACE_BUF_SIZE];
mem_blocks_cfg[0].start = s_mem_blocks[0];
mem_blocks_cfg[0].sz = CONFIG_APPTRACE_BUF_SIZE;
mem_blocks_cfg[1].start = s_mem_blocks[1];
mem_blocks_cfg[1].sz = CONFIG_APPTRACE_BUF_SIZE;
}
static esp_err_t esp_apptrace_riscv_lock(esp_apptrace_riscv_data_t *hw_data, esp_apptrace_tmo_t *tmo)
{
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_err_t ret = esp_apptrace_lock_take(&hw_data->lock, tmo);
if (ret != ESP_OK) {
return ESP_FAIL;
}
#endif
return ESP_OK;
}
static esp_err_t esp_apptrace_riscv_unlock(esp_apptrace_riscv_data_t *hw_data)
{
esp_err_t ret = ESP_OK;
#if CONFIG_APPTRACE_LOCK_ENABLE
ret = esp_apptrace_lock_give(&hw_data->lock);
#endif
return ret;
}
/*****************************************************************************************/
/***************************** Apptrace HW iface *****************************************/
/*****************************************************************************************/
static esp_err_t esp_apptrace_riscv_init(esp_apptrace_riscv_data_t *hw_data)
{
int core_id = esp_cpu_get_core_id();
if (hw_data->inited == 0) {
esp_apptrace_mem_block_t mem_blocks_cfg[2];
esp_apptrace_get_up_buffers(mem_blocks_cfg);
esp_err_t res = esp_apptrace_membufs_init(&hw_data->membufs, mem_blocks_cfg);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to init membufs proto (%d)!", res);
return res;
}
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_init(&hw_data->lock);
#endif
}
hw_data->inited |= 1 << core_id;
ESP_APPTRACE_LOGI("Apptrace initialized on CPU%d. Tracing control block @ %p.", core_id, &s_tracing_ctrl[core_id]);
s_tracing_ctrl[core_id].mem_blocks = hw_data->membufs.blocks;
for (int i = 0; i < 2; i++) {
ESP_APPTRACE_LOGD("Mem buf[%d] %" PRIu32 " bytes @ %p (%p/%p)", i,
s_tracing_ctrl[core_id].mem_blocks[i].sz, s_tracing_ctrl[core_id].mem_blocks[i].start,
&(s_tracing_ctrl[core_id].mem_blocks[i].start), &(s_tracing_ctrl[core_id].mem_blocks[i].sz));
}
// notify host about control block address
int res = esp_apptrace_advertise_ctrl_block(&s_tracing_ctrl[core_id]);
assert(res == 0 && "Failed to send config to host!");
return ESP_OK;
}
static uint8_t *esp_apptrace_riscv_up_buffer_get(esp_apptrace_riscv_data_t *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr;
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_riscv_lock(hw_data, tmo);
if (res != ESP_OK) {
return NULL;
}
ptr = esp_apptrace_membufs_up_buffer_get(&hw_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_riscv_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_riscv_up_buffer_put(esp_apptrace_riscv_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_up_buffer_put() just modifies buffer's header
esp_err_t res = esp_apptrace_membufs_up_buffer_put(&hw_data->membufs, ptr, tmo);
return res;
}
static void esp_apptrace_riscv_down_buffer_config(esp_apptrace_riscv_data_t *hw_data, uint8_t *buf, uint32_t size)
{
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return;
}
esp_apptrace_membufs_down_buffer_config(&hw_data->membufs, buf, size);
}
static uint8_t *esp_apptrace_riscv_down_buffer_get(esp_apptrace_riscv_data_t *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr;
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_riscv_lock(hw_data, tmo);
if (res != ESP_OK) {
return NULL;
}
ptr = esp_apptrace_membufs_down_buffer_get(&hw_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_riscv_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
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)
{
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_down_buffer_put() does nothing
/*esp_err_t res = esp_apptrace_riscv_lock(hw_data, tmo);
if (res != ESP_OK) {
return res;
}*/
esp_err_t res = esp_apptrace_membufs_down_buffer_put(&hw_data->membufs, ptr, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
/*if (esp_apptrace_riscv_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}*/
return res;
}
static bool esp_apptrace_riscv_host_is_connected(esp_apptrace_riscv_data_t *hw_data)
{
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return false;
}
return s_tracing_ctrl[esp_cpu_get_core_id()].ctrl & ESP_APPTRACE_RISCV_HOST_CONNECT ? true : false;
}
static esp_err_t esp_apptrace_riscv_flush_nolock(esp_apptrace_riscv_data_t *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
return esp_apptrace_membufs_flush_nolock(&hw_data->membufs, min_sz, tmo);
}
static esp_err_t esp_apptrace_riscv_flush(esp_apptrace_riscv_data_t *hw_data, esp_apptrace_tmo_t *tmo)
{
if (!ESP_APPTRACE_RISCV_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t res = esp_apptrace_riscv_lock(hw_data, tmo);
if (res != ESP_OK) {
return res;
}
res = esp_apptrace_membufs_flush_nolock(&hw_data->membufs, 0, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_riscv_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return res;
}
/*****************************************************************************************/
/************************** Membufs proto HW iface ***************************************/
/*****************************************************************************************/
static inline void esp_apptrace_riscv_buffer_swap_lock(void)
{
extern uint32_t __esp_apptrace_riscv_updated;
// indicate to host that we are about to update.
// this is used only to place CPU into streaming mode at tracing startup
// before starting streaming host can halt us after we read ESP_APPTRACE_RISCV_CTRL_REG and before we updated it
// HACK: in this case host will set breakpoint just after ESP_APPTRACE_RISCV_CTRL_REG update,
// here we set address to set bp at
// enter ERI update critical section
s_tracing_ctrl[esp_cpu_get_core_id()].stat = (uint32_t)&__esp_apptrace_riscv_updated;
}
static __attribute__((noinline)) void esp_apptrace_riscv_buffer_swap_unlock(void)
{
// exit ERI update critical section
s_tracing_ctrl[esp_cpu_get_core_id()].stat = 0;
// TODO: currently host sets breakpoint, use break instruction to stop;
// it will allow to use ESP_APPTRACE_RISCV_STAT_REG for other purposes
asm volatile (
" .global __esp_apptrace_riscv_updated\n"
"__esp_apptrace_riscv_updated:\n"); // host will set bp here to resolve collision at streaming start
}
static esp_err_t esp_apptrace_riscv_buffer_swap_start(uint32_t curr_block_id)
{
esp_err_t res = ESP_OK;
esp_apptrace_riscv_buffer_swap_lock();
uint32_t ctrl_reg = s_tracing_ctrl[esp_cpu_get_core_id()].ctrl;
uint32_t host_connected = ESP_APPTRACE_RISCV_HOST_CONNECT & ctrl_reg;
if (host_connected) {
uint32_t acked_block = ESP_APPTRACE_RISCV_BLOCK_ID_GET(ctrl_reg);
uint32_t host_to_read = ESP_APPTRACE_RISCV_BLOCK_LEN_GET(ctrl_reg);
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_RISCV_BLOCK_ID_MSK)) {
ESP_APPTRACE_LOGD("[%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_RISCV_BLOCK_ID_MSK, curr_block_id);
res = ESP_ERR_NO_MEM;
goto _on_err;
}
}
return ESP_OK;
_on_err:
esp_apptrace_riscv_buffer_swap_unlock();
return res;
}
static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len)
{
uint32_t ctrl_reg = s_tracing_ctrl[esp_cpu_get_core_id()].ctrl;
uint32_t host_connected = ESP_APPTRACE_RISCV_HOST_CONNECT & ctrl_reg;
s_tracing_ctrl[esp_cpu_get_core_id()].ctrl = ESP_APPTRACE_RISCV_BLOCK_ID(new_block_id) |
host_connected | ESP_APPTRACE_RISCV_BLOCK_LEN(prev_block_len);
esp_apptrace_riscv_buffer_swap_unlock();
return ESP_OK;
}
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
{
/* do nothing */
return ESP_OK;
}
static bool esp_apptrace_riscv_host_data_pending(void)
{
uint32_t ctrl_reg = s_tracing_ctrl[esp_cpu_get_core_id()].ctrl;
// ESP_APPTRACE_LOGV("%s() 0x%x", __func__, ctrl_reg);
return (ctrl_reg & ESP_APPTRACE_RISCV_HOST_DATA) ? true : false;
}

View File

@@ -0,0 +1,373 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
#include "sdkconfig.h"
#include "esp_cpu.h"
#include "esp_log.h"
#include "esp_app_trace_config.h"
#include "esp_app_trace_membufs_proto.h"
#include "esp_app_trace_port.h"
#include "riscv/semihosting.h"
/** RISCV HW transport data */
typedef struct {
uint8_t inited; // initialization state flags for every core
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_t lock; // sync lock
#endif
esp_apptrace_membufs_proto_data_t membufs;
} esp_apptrace_riscv_data_t;
/** RISCV memory host iface control block */
typedef struct {
uint32_t ctrl;
// - Guard field. If this register is not zero then CPU is changing this struct and
// this guard field holds address of the instruction which application will execute when CPU finishes with those modifications.
uint32_t stat;
esp_apptrace_mem_block_t * mem_blocks;
} esp_apptrace_riscv_ctrl_block_t;
#define ESP_APPTRACE_RISCV_BLOCK_LEN_MSK 0x7FFFUL
#define ESP_APPTRACE_RISCV_BLOCK_LEN(_l_) ((_l_) & ESP_APPTRACE_RISCV_BLOCK_LEN_MSK)
#define ESP_APPTRACE_RISCV_BLOCK_LEN_GET(_v_) ((_v_) & ESP_APPTRACE_RISCV_BLOCK_LEN_MSK)
#define ESP_APPTRACE_RISCV_BLOCK_ID_MSK 0x7FUL
#define ESP_APPTRACE_RISCV_BLOCK_ID(_id_) (((_id_) & ESP_APPTRACE_RISCV_BLOCK_ID_MSK) << 15)
#define ESP_APPTRACE_RISCV_BLOCK_ID_GET(_v_) (((_v_) >> 15) & ESP_APPTRACE_RISCV_BLOCK_ID_MSK)
#define ESP_APPTRACE_RISCV_HOST_DATA (1 << 22)
#define ESP_APPTRACE_RISCV_HOST_CONNECT (1 << 23)
#define ESP_APPTRACE_RISCV_INITED(_hw_) ((_hw_)->inited & (1 << 0/*esp_cpu_get_core_id()*/))
const static char *TAG = "esp_apptrace";
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
#define APPTRACE_DRAM_ATTR TCM_DRAM_ATTR
#else
#define APPTRACE_DRAM_ATTR
#endif
static APPTRACE_DRAM_ATTR esp_apptrace_riscv_ctrl_block_t s_tracing_ctrl[CONFIG_FREERTOS_NUMBER_OF_CORES];
/* Advertises apptrace control block address to host.
This function can be overridden with custom implementation,
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) int esp_apptrace_advertise_ctrl_block(void *ctrl_block_addr)
{
if (!esp_cpu_dbgr_is_attached()) {
return 0;
}
return (int) semihosting_call_noerrno(ESP_SEMIHOSTING_SYS_APPTRACE_INIT, (long*)ctrl_block_addr);
}
/* Returns up buffers config.
This function can be overridden with custom implementation,
e.g. OpenOCD flasher stub use own implementation of it. */
__attribute__((weak)) void esp_apptrace_get_up_buffers(esp_apptrace_mem_block_t mem_blocks_cfg[2])
{
static uint8_t s_mem_blocks[2][CONFIG_APPTRACE_BUF_SIZE];
mem_blocks_cfg[0].start = s_mem_blocks[0];
mem_blocks_cfg[0].sz = CONFIG_APPTRACE_BUF_SIZE;
mem_blocks_cfg[1].start = s_mem_blocks[1];
mem_blocks_cfg[1].sz = CONFIG_APPTRACE_BUF_SIZE;
}
static esp_err_t esp_apptrace_riscv_lock(void *hw_data, esp_apptrace_tmo_t *tmo)
{
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_riscv_data_t *riscv_data = hw_data;
esp_err_t ret = esp_apptrace_lock_take(&riscv_data->lock, tmo);
if (ret != ESP_OK) {
return ESP_FAIL;
}
#endif
return ESP_OK;
}
static esp_err_t esp_apptrace_riscv_unlock(void *hw_data)
{
esp_err_t ret = ESP_OK;
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_riscv_data_t *riscv_data = hw_data;
ret = esp_apptrace_lock_give(&riscv_data->lock);
#endif
return ret;
}
/*****************************************************************************************/
/***************************** Apptrace HW iface *****************************************/
/*****************************************************************************************/
static esp_err_t esp_apptrace_riscv_init(void *hw_data, const esp_apptrace_config_t *config)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
/* esp_apptrace_riscv_init() is called on every core, so ensure to do main initialization only once */
int core_id = esp_cpu_get_core_id();
if (core_id == 0) {
esp_apptrace_mem_block_t mem_blocks_cfg[2];
esp_apptrace_get_up_buffers(mem_blocks_cfg);
riscv_data->membufs.header_size = ESP_APPTRACE_HEADER_SIZE_32;
esp_err_t res = esp_apptrace_membufs_init(&riscv_data->membufs, mem_blocks_cfg);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to init membufs proto (%d)!", res);
return res;
}
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_init(&riscv_data->lock);
#endif
}
riscv_data->inited |= 1 << core_id;
ESP_APPTRACE_LOGI("Apptrace initialized on CPU%d. Tracing control block @ %p.", core_id, &s_tracing_ctrl[core_id]);
s_tracing_ctrl[core_id].mem_blocks = riscv_data->membufs.blocks;
for (int i = 0; i < 2; i++) {
ESP_APPTRACE_LOGD("Mem buf[%d] %" PRIu32 " bytes @ %p (%p/%p)", i,
s_tracing_ctrl[core_id].mem_blocks[i].sz, s_tracing_ctrl[core_id].mem_blocks[i].start,
&(s_tracing_ctrl[core_id].mem_blocks[i].start), &(s_tracing_ctrl[core_id].mem_blocks[i].sz));
}
// notify host about control block address
int __attribute__((unused)) res = esp_apptrace_advertise_ctrl_block(&s_tracing_ctrl[core_id]);
assert(res == 0 && "Failed to send config to host!");
return ESP_OK;
}
static uint8_t *esp_apptrace_riscv_up_buffer_get(void *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_riscv_lock(riscv_data, tmo);
if (res != ESP_OK) {
return NULL;
}
uint8_t *ptr = esp_apptrace_membufs_up_buffer_get(&riscv_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_riscv_unlock(riscv_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_riscv_up_buffer_put(void *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_up_buffer_put() just modifies buffer's header
esp_err_t res = esp_apptrace_membufs_up_buffer_put(&riscv_data->membufs, ptr, tmo);
return res;
}
static void esp_apptrace_riscv_down_buffer_config(void *hw_data, uint8_t *buf, uint32_t size)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return;
}
esp_apptrace_membufs_down_buffer_config(&riscv_data->membufs, buf, size);
}
static uint8_t *esp_apptrace_riscv_down_buffer_get(void *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_riscv_lock(riscv_data, tmo);
if (res != ESP_OK) {
return NULL;
}
uint8_t *ptr = esp_apptrace_membufs_down_buffer_get(&riscv_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_riscv_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_riscv_down_buffer_put(void *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_down_buffer_put() does nothing
/*esp_err_t res = esp_apptrace_riscv_lock(hw_data, tmo);
if (res != ESP_OK) {
return res;
}*/
esp_err_t res = esp_apptrace_membufs_down_buffer_put(&riscv_data->membufs, ptr, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
/*if (esp_apptrace_riscv_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}*/
return res;
}
static bool esp_apptrace_riscv_host_is_connected(void *hw_data)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return false;
}
return s_tracing_ctrl[esp_cpu_get_core_id()].ctrl & ESP_APPTRACE_RISCV_HOST_CONNECT ? true : false;
}
static esp_err_t esp_apptrace_riscv_flush_nolock(void *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return ESP_ERR_INVALID_STATE;
}
return esp_apptrace_membufs_flush_nolock(&riscv_data->membufs, min_sz, tmo);
}
static esp_err_t esp_apptrace_riscv_flush(void *hw_data, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
if (!ESP_APPTRACE_RISCV_INITED(riscv_data)) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t res = esp_apptrace_riscv_lock(riscv_data, tmo);
if (res != ESP_OK) {
return res;
}
res = esp_apptrace_membufs_flush_nolock(&riscv_data->membufs, 0, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_riscv_unlock(riscv_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return res;
}
/*****************************************************************************************/
/************************** Membufs proto HW iface ***************************************/
/*****************************************************************************************/
static inline void esp_apptrace_riscv_buffer_swap_lock(void)
{
extern uint32_t __esp_apptrace_riscv_updated;
// indicate to host that we are about to update.
// this is used only to place CPU into streaming mode at tracing startup
// before starting streaming host can halt us after we read ESP_APPTRACE_RISCV_CTRL_REG and before we updated it
// HACK: in this case host will set breakpoint just after ESP_APPTRACE_RISCV_CTRL_REG update,
// here we set address to set bp at
// enter ERI update critical section
s_tracing_ctrl[esp_cpu_get_core_id()].stat = (uint32_t)&__esp_apptrace_riscv_updated;
}
static __attribute__((noinline)) void esp_apptrace_riscv_buffer_swap_unlock(void)
{
// exit ERI update critical section
s_tracing_ctrl[esp_cpu_get_core_id()].stat = 0;
// TODO: currently host sets breakpoint, use break instruction to stop;
// it will allow to use ESP_APPTRACE_RISCV_STAT_REG for other purposes
asm volatile(
" .global __esp_apptrace_riscv_updated\n"
"__esp_apptrace_riscv_updated:\n"); // host will set bp here to resolve collision at streaming start
}
static esp_err_t esp_apptrace_riscv_buffer_swap_start(uint32_t curr_block_id)
{
esp_err_t res = ESP_OK;
esp_apptrace_riscv_buffer_swap_lock();
uint32_t ctrl_reg = s_tracing_ctrl[esp_cpu_get_core_id()].ctrl;
uint32_t host_connected = ESP_APPTRACE_RISCV_HOST_CONNECT & ctrl_reg;
if (host_connected) {
uint32_t acked_block = ESP_APPTRACE_RISCV_BLOCK_ID_GET(ctrl_reg);
uint32_t host_to_read = ESP_APPTRACE_RISCV_BLOCK_LEN_GET(ctrl_reg);
if (host_to_read != 0 || acked_block != (curr_block_id & ESP_APPTRACE_RISCV_BLOCK_ID_MSK)) {
ESP_APPTRACE_LOGD("[%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_RISCV_BLOCK_ID_MSK, curr_block_id);
res = ESP_ERR_NO_MEM;
goto _on_err;
}
}
return ESP_OK;
_on_err:
esp_apptrace_riscv_buffer_swap_unlock();
return res;
}
static esp_err_t esp_apptrace_riscv_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len)
{
uint32_t ctrl_reg = s_tracing_ctrl[esp_cpu_get_core_id()].ctrl;
uint32_t host_connected = ESP_APPTRACE_RISCV_HOST_CONNECT & ctrl_reg;
s_tracing_ctrl[esp_cpu_get_core_id()].ctrl = ESP_APPTRACE_RISCV_BLOCK_ID(new_block_id) |
host_connected | ESP_APPTRACE_RISCV_BLOCK_LEN(prev_block_len);
esp_apptrace_riscv_buffer_swap_unlock();
return ESP_OK;
}
static esp_err_t esp_apptrace_riscv_buffer_swap(uint32_t new_block_id, uint32_t prev_block_len)
{
/* do nothing */
return ESP_OK;
}
static bool esp_apptrace_riscv_host_data_pending(void)
{
uint32_t ctrl_reg = s_tracing_ctrl[esp_cpu_get_core_id()].ctrl;
// ESP_APPTRACE_LOGV("%s() 0x%x", __func__, ctrl_reg);
return (ctrl_reg & ESP_APPTRACE_RISCV_HOST_DATA) ? true : false;
}
static void esp_apptrace_riscv_set_header_size(void *hw_data, esp_apptrace_header_size_t header_size)
{
esp_apptrace_riscv_data_t *riscv_data = hw_data;
riscv_data->membufs.header_size = header_size;
}
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
{
static esp_apptrace_membufs_proto_hw_t s_trace_proto_hw = {
.swap_start = esp_apptrace_riscv_buffer_swap_start,
.swap = esp_apptrace_riscv_buffer_swap,
.swap_end = esp_apptrace_riscv_buffer_swap_end,
.host_data_pending = esp_apptrace_riscv_host_data_pending,
};
static esp_apptrace_riscv_data_t s_trace_hw_data = {
.membufs = {
.hw = &s_trace_proto_hw,
},
};
static esp_apptrace_hw_t s_trace_hw = {
.init = esp_apptrace_riscv_init,
.get_up_buffer = esp_apptrace_riscv_up_buffer_get,
.put_up_buffer = esp_apptrace_riscv_up_buffer_put,
.flush_up_buffer_nolock = esp_apptrace_riscv_flush_nolock,
.flush_up_buffer = esp_apptrace_riscv_flush,
.down_buffer_config = esp_apptrace_riscv_down_buffer_config,
.get_down_buffer = esp_apptrace_riscv_down_buffer_get,
.put_down_buffer = esp_apptrace_riscv_down_buffer_put,
.host_is_connected = esp_apptrace_riscv_host_is_connected,
.set_header_size = esp_apptrace_riscv_set_header_size,
};
*data = &s_trace_hw_data;
return &s_trace_hw;
}

View File

@@ -1,552 +0,0 @@
/*
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
//
// How It Works
// ************
// 1. Components Overview
// ======================
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
// 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
// by means of reading/writing TRAX registers via JTAG. Blocks muxing is configurable at run-time and allows switching trace memory blocks between
// accessors in round-robin fashion so they can read/write separate memory blocks without disturbing each other.
// This module implements application tracing feature based on above mechanisms. It allows to transfer arbitrary user data to/from
// host via JTAG with minimal impact on system performance. This module is implied to be used in the following tracing scheme.
// ------>------ ----- (host components) -----
// | | | |
// ------------------- ----------------------- ----------------------- ---------------- ------ --------- -----------------
// |trace data source|-->|target tracing module|<--->|TRAX_MEM0 | TRAX_MEM1|---->|TRAX_DATA_REGS|<-->|JTAG|<--->|OpenOCD|-->|trace data sink|
// ------------------- ----------------------- ----------------------- ---------------- ------ --------- -----------------
// | | | |
// | ------<------ ---------------- |
// |<------------------------------------------->|TRAX_CTRL_REGS|<---->|
// ----------------
// In general tracing goes in the following way. User application requests tracing module to send some data by calling esp_apptrace_buffer_get(),
// module allocates necessary buffer in current input trace block. Then user fills received buffer with data and calls esp_apptrace_buffer_put().
// When current input trace block is filled with app data it is exposed to host and the second block becomes input one and buffer filling restarts.
// While target application fills one TRAX block host reads another one via JTAG.
// This module also allows communication in the opposite direction: from host to target. As it was said ESP32 and host can access different TRAX blocks
// simultaneously, so while target writes trace data to one block host can write its own data (e.g. tracing commands) to another one then when
// blocks are switched host receives trace data and target receives data written by host application. Target user application can read host data
// by calling esp_apptrace_read() API.
// To control buffer switching and for other communication purposes this implementation uses some TRAX registers. It is safe since HW TRAX tracing
// can not be used along with application tracing feature so these registers are freely readable/writeable via JTAG from host and via ERI from ESP32 cores.
// Overhead of this implementation on target CPU is produced only by allocating/managing buffers and copying of data.
// On the host side special OpenOCD command must be used to read trace data.
// 2. TRAX Registers layout
// ========================
// 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.
// Host writes zero to this field when it finishes reading exposed block;
// 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' 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
// =====================
// This module supports two modes of operation:
// - Post-mortem mode. This is the default mode. In this mode application tracing module does not check whether host has read all the data from block
// exposed to it and switches block in any case. The mode does not need host interaction for operation and so can be useful when only the latest
// trace data are necessary, e.g. for analyzing crashes. On panic the latest data from current input block are exposed to host and host can read them.
// It can happen that system panic occurs when there are very small amount of data which are not exposed to host yet (e.g. crash just after the
// TRAX block switch). In this case the previous 16KB of collected data will be dropped and host will see the latest, but very small piece of trace.
// It can be insufficient to diagnose the problem. To avoid such situations there is menuconfig option
// CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH
// which controls the threshold for flushing data in case of panic.
// - Streaming mode. Tracing module enters this mode when host connects to target and sets respective bits in control registers (per core).
// In this mode before switching the block tracing module waits for the host to read all the data from the previously exposed block.
// On panic tracing module also waits (timeout is configured via menuconfig via CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO) for the host to read all data.
// 4. Communication Protocol
// =========================
// 4.1 Trace Memory Blocks
// -----------------------
// Communication is controlled via special register. Host periodically polls control register on each core to find out if there are any data available.
// When current input memory block is filled it is exposed to host and 'block_len' and 'block_id' fields are updated in the control register.
// Host reads new register value and according to it's value starts reading data from exposed block. Meanwhile target starts filling another trace block.
// When host finishes reading the block it clears 'block_len' field in control register indicating to the target that it is ready to accept the next one.
// If the host has some data to transfer to the target it writes them to trace memory block before clearing 'block_len' field. Then it sets
// 'host_data_present' bit and clears 'block_len' field in control register. Upon every block switch target checks 'host_data_present' bit and if it is set
// reads them to down buffer before writing any trace data to switched TRAX block.
// 4.2 User Data Chunks Level
// --------------------------
// Since trace memory block is shared between user data chunks and data copying is performed on behalf of the API user (in its normal context) in
// multithreading environment it can happen that task/ISR which copies data is preempted by another high prio task/ISR. So it is possible situation
// that task/ISR will fail to complete filling its data chunk before the whole trace block is exposed to the host. To handle such conditions tracing
// module prepends all user data chunks with header which contains allocated buffer size and actual data length within it. OpenOCD command
// which reads application traces reports error when it reads incomplete user data block.
// Data which are transffered from host to target are also prepended with a header. Down channel data header is simple and consists of one two bytes field
// containing length of host data following the header.
// 4.3 Data Buffering
// ------------------
// It takes some time for the host to read TRAX memory block via JTAG. In streaming mode it can happen that target has filled its TRAX block, but host
// has not completed reading of the previous one yet. So in this case time critical tracing calls (which can not be delayed for too long time due to
// the lack of free memory in TRAX block) can be dropped. To avoid such scenarios tracing module implements data buffering. Buffered data will be sent
// to the host later when TRAX block switch occurs. The maximum size of the buffered data is controlled by menuconfig option
// CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX.
// 4.4 Target Connection/Disconnection
// -----------------------------------
// When host is going to start tracing in streaming mode it needs to put both ESP32 cores into initial state when 'host connected' bit is set
// on both cores. To accomplish this host halts both cores and sets this bit in TRAX registers. But target code can be halted in state when it has read control
// register but has not updated its value. To handle such situations target code indicates to the host that it is updating control register by writing
// non-zero value to status register. Actually it writes address of the instruction which it will execute when it finishes with
// the registers update. When target is halted during control register update host sets breakpoint at the address from status register and resumes CPU.
// After target code finishes with register update it is halted on breakpoint, host detects it and safely sets 'host connected' bit. When both cores
// are set up they are resumed. Tracing starts without further intrusion into CPUs work.
// When host is going to stop tracing in streaming mode it needs to disconnect targets. Disconnection process is done using the same algorithm
// as for connecting, but 'host connected' bits are cleared on ESP32 cores.
// 5. Module Access Synchronization
// ================================
// 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 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.
// When low prio task takes mutex and enables local IRQs gets preempted by high prio task which in its turn can try to acquire mutex using infinite timeout.
// So no local task switch occurs when mutex is locked. But this does not apply to tasks on another CPU.
// WARNING: Priority inversion can happen when low prio task works on one CPU and medium and high prio tasks work on another.
// WARNING: Care must be taken when selecting timeout values for trace calls from ISRs. Tracing module does not care about watchdogs when waiting
// on internal locks and for host to complete previous block reading, so if timeout value exceeds watchdog's one it can lead to the system reboot.
// 6. Timeouts
// ===========
// 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 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 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"
#include "soc/dport_reg.h"
#include "soc/tracemem_config.h"
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#include "soc/sensitive_reg.h"
#endif
#include "eri.h"
#include "esp_private/trax.h"
#include "esp_cpu.h"
#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)
#define ESP_APPTRACE_TRAX_BLOCK_LEN_GET(_v_) ((_v_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
#define ESP_APPTRACE_TRAX_BLOCK_ID_MSK 0x7FUL
#define ESP_APPTRACE_TRAX_BLOCK_ID(_id_) (((_id_) & ESP_APPTRACE_TRAX_BLOCK_ID_MSK) << 15)
#define ESP_APPTRACE_TRAX_BLOCK_ID_GET(_v_) (((_v_) >> 15) & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)
#define ESP_APPTRACE_TRAX_HOST_DATA (1 << 22)
#define ESP_APPTRACE_TRAX_HOST_CONNECT (1 << 23)
#define ESP_APPTRACE_TRAX_INITED(_hw_) ((_hw_)->inited & (1 << esp_cpu_get_core_id()))
#define ESP_APPTRACE_TRAX_BLOCK_SIZE (0x4000UL)
/** TRAX HW transport data */
typedef struct {
uint8_t inited;
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_t lock; // sync lock
#endif
esp_apptrace_membufs_proto_data_t membufs;
} esp_apptrace_trax_data_t;
static esp_err_t esp_apptrace_trax_init(esp_apptrace_trax_data_t *hw_data);
static esp_err_t esp_apptrace_trax_flush(esp_apptrace_trax_data_t *hw_data, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_trax_flush_nolock(esp_apptrace_trax_data_t *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo);
static uint8_t *esp_apptrace_trax_up_buffer_get(esp_apptrace_trax_data_t *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo);
static esp_err_t esp_apptrace_trax_up_buffer_put(esp_apptrace_trax_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo);
static void esp_apptrace_trax_down_buffer_config(esp_apptrace_trax_data_t *hw_data, uint8_t *buf, uint32_t size);
static uint8_t *esp_apptrace_trax_down_buffer_get(esp_apptrace_trax_data_t *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo);
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, 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);
const static char *TAG = "esp_apptrace";
static uint8_t * const s_trax_blocks[] = {
(uint8_t *)TRACEMEM_BLK0_ADDR,
(uint8_t *)TRACEMEM_BLK1_ADDR
};
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
{
#if CONFIG_APPTRACE_DEST_JTAG
static esp_apptrace_membufs_proto_hw_t s_trax_proto_hw = {
.swap_start = esp_apptrace_trax_buffer_swap_start,
.swap = esp_apptrace_trax_buffer_swap,
.swap_end = esp_apptrace_trax_buffer_swap_end,
.host_data_pending = esp_apptrace_trax_host_data_pending,
};
static esp_apptrace_trax_data_t s_trax_hw_data = {
.membufs = {
.hw = &s_trax_proto_hw,
},
};
static esp_apptrace_hw_t s_trax_hw = {
.init = (esp_err_t (*)(void *))esp_apptrace_trax_init,
.get_up_buffer = (uint8_t *(*)(void *, uint32_t, esp_apptrace_tmo_t *))esp_apptrace_trax_up_buffer_get,
.put_up_buffer = (esp_err_t (*)(void *, uint8_t *, esp_apptrace_tmo_t *))esp_apptrace_trax_up_buffer_put,
.flush_up_buffer_nolock = (esp_err_t (*)(void *, uint32_t, esp_apptrace_tmo_t *))esp_apptrace_trax_flush_nolock,
.flush_up_buffer = (esp_err_t (*)(void *, esp_apptrace_tmo_t *))esp_apptrace_trax_flush,
.down_buffer_config = (void (*)(void *, uint8_t *, uint32_t ))esp_apptrace_trax_down_buffer_config,
.get_down_buffer = (uint8_t *(*)(void *, uint32_t *, esp_apptrace_tmo_t *))esp_apptrace_trax_down_buffer_get,
.put_down_buffer = (esp_err_t (*)(void *, uint8_t *, esp_apptrace_tmo_t *))esp_apptrace_trax_down_buffer_put,
.host_is_connected = (bool (*)(void *))esp_apptrace_trax_host_is_connected,
};
*data = &s_trax_hw_data;
return &s_trax_hw;
#else
return NULL;
#endif
}
static esp_err_t esp_apptrace_trax_lock(esp_apptrace_trax_data_t *hw_data, esp_apptrace_tmo_t *tmo)
{
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_err_t ret = esp_apptrace_lock_take(&hw_data->lock, tmo);
if (ret != ESP_OK) {
return ESP_FAIL;
}
#endif
return ESP_OK;
}
static esp_err_t esp_apptrace_trax_unlock(esp_apptrace_trax_data_t *hw_data)
{
esp_err_t ret = ESP_OK;
#if CONFIG_APPTRACE_LOCK_ENABLE
ret = esp_apptrace_lock_give(&hw_data->lock);
#endif
return ret;
}
static inline void esp_apptrace_trax_hw_init(void)
{
// Stop trace, if any (on the current CPU)
eri_write(ERI_TRAX_TRAXCTRL, TRAXCTRL_TRSTP);
eri_write(ERI_TRAX_TRAXCTRL, TRAXCTRL_TMEN);
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(0));
// this is for OpenOCD to let him know where stub entries vector is resided
// must be read by host before any transfer using TRAX
eri_write(ESP_APPTRACE_TRAX_STAT_REG, 0);
ESP_APPTRACE_LOGI("Initialized TRAX on CPU%d", esp_cpu_get_core_id());
}
static inline void esp_apptrace_trax_select_memory_block(int block_num)
{
// select memory block to be exposed to the TRAX module (accessed by host)
#if CONFIG_IDF_TARGET_ESP32
DPORT_WRITE_PERI_REG(DPORT_TRACEMEM_MUX_MODE_REG, block_num ? TRACEMEM_MUX_BLK0_ONLY : TRACEMEM_MUX_BLK1_ONLY);
#elif CONFIG_IDF_TARGET_ESP32S2
WRITE_PERI_REG(DPORT_PMS_OCCUPY_3_REG, block_num ? BIT(TRACEMEM_MUX_BLK0_NUM-4) : BIT(TRACEMEM_MUX_BLK1_NUM-4));
#elif CONFIG_IDF_TARGET_ESP32S3
// select memory block to be exposed to the TRAX module (accessed by host)
uint32_t block_bits = block_num ? TRACEMEM_CORE0_MUX_BLK_BITS(TRACEMEM_MUX_BLK0_NUM)
: TRACEMEM_CORE0_MUX_BLK_BITS(TRACEMEM_MUX_BLK1_NUM);
block_bits |= block_num ? TRACEMEM_CORE1_MUX_BLK_BITS(TRACEMEM_MUX_BLK0_NUM)
: TRACEMEM_CORE1_MUX_BLK_BITS(TRACEMEM_MUX_BLK1_NUM);
ESP_EARLY_LOGV(TAG, "Select block %d @ %p (bits 0x%" PRIx32 ")", block_num, s_trax_blocks[block_num], block_bits);
DPORT_WRITE_PERI_REG(SENSITIVE_INTERNAL_SRAM_USAGE_2_REG, block_bits);
#endif
}
static inline void esp_apptrace_trax_memory_enable(void)
{
#if CONFIG_IDF_TARGET_ESP32
/* Enable trace memory on PRO CPU */
DPORT_WRITE_PERI_REG(DPORT_PRO_TRACEMEM_ENA_REG, DPORT_PRO_TRACEMEM_ENA_M);
#if CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE == 0
/* Enable trace memory on APP CPU */
DPORT_WRITE_PERI_REG(DPORT_APP_TRACEMEM_ENA_REG, DPORT_APP_TRACEMEM_ENA_M);
#endif
#endif
}
/*****************************************************************************************/
/***************************** Apptrace HW iface *****************************************/
/*****************************************************************************************/
static esp_err_t esp_apptrace_trax_init(esp_apptrace_trax_data_t *hw_data)
{
int core_id = esp_cpu_get_core_id();
// 'esp_apptrace_trax_init()' is called on every core, so ensure to do main initialization only once
if (core_id == 0) {
esp_apptrace_mem_block_t mem_blocks_cfg[2] = {
{
.start = s_trax_blocks[0],
.sz = ESP_APPTRACE_TRAX_BLOCK_SIZE
},
{
.start = s_trax_blocks[1],
.sz = ESP_APPTRACE_TRAX_BLOCK_SIZE
},
};
esp_err_t res = esp_apptrace_membufs_init(&hw_data->membufs, mem_blocks_cfg);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to init membufs proto (%d)!", res);
return res;
}
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_init(&hw_data->lock);
#endif
esp_apptrace_trax_memory_enable();
esp_apptrace_trax_select_memory_block(0);
}
// init TRAX on this CPU
esp_apptrace_trax_hw_init();
hw_data->inited |= 1 << core_id;
return ESP_OK;
}
static uint8_t *esp_apptrace_trax_up_buffer_get(esp_apptrace_trax_data_t *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr;
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_trax_lock(hw_data, tmo);
if (res != ESP_OK) {
return NULL;
}
ptr = esp_apptrace_membufs_up_buffer_get(&hw_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_trax_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_trax_up_buffer_put(esp_apptrace_trax_data_t *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_up_buffer_put() just modifies buffer's header
esp_err_t res = esp_apptrace_membufs_up_buffer_put(&hw_data->membufs, ptr, tmo);
return res;
}
static void esp_apptrace_trax_down_buffer_config(esp_apptrace_trax_data_t *hw_data, uint8_t *buf, uint32_t size)
{
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return;
}
esp_apptrace_membufs_down_buffer_config(&hw_data->membufs, buf, size);
}
static uint8_t *esp_apptrace_trax_down_buffer_get(esp_apptrace_trax_data_t *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo)
{
uint8_t *ptr;
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_trax_lock(hw_data, tmo);
if (res != ESP_OK) {
return NULL;
}
ptr = esp_apptrace_membufs_down_buffer_get(&hw_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_trax_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
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)
{
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_down_buffer_put() does nothing
/*esp_err_t res = esp_apptrace_trax_lock(hw_data, tmo);
if (res != ESP_OK) {
return res;
}*/
esp_err_t res = esp_apptrace_membufs_down_buffer_put(&hw_data->membufs, ptr, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
/*if (esp_apptrace_trax_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}*/
return res;
}
static bool esp_apptrace_trax_host_is_connected(esp_apptrace_trax_data_t *hw_data)
{
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return false;
}
return eri_read(ESP_APPTRACE_TRAX_CTRL_REG) & ESP_APPTRACE_TRAX_HOST_CONNECT ? true : false;
}
static esp_err_t esp_apptrace_trax_flush_nolock(esp_apptrace_trax_data_t *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
return esp_apptrace_membufs_flush_nolock(&hw_data->membufs, min_sz, tmo);
}
static esp_err_t esp_apptrace_trax_flush(esp_apptrace_trax_data_t *hw_data, esp_apptrace_tmo_t *tmo)
{
if (!ESP_APPTRACE_TRAX_INITED(hw_data)) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t res = esp_apptrace_trax_lock(hw_data, tmo);
if (res != ESP_OK) {
return res;
}
res = esp_apptrace_membufs_flush_nolock(&hw_data->membufs, 0, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_trax_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return res;
}
/*****************************************************************************************/
/************************** Membufs proto HW iface ***************************************/
/*****************************************************************************************/
static inline void esp_apptrace_trax_buffer_swap_lock(void)
{
extern uint32_t __esp_apptrace_trax_eri_updated;
// indicate to host that we are about to update.
// this is used only to place CPU into streaming mode at tracing startup
// before starting streaming host can halt us after we read ESP_APPTRACE_TRAX_CTRL_REG and before we updated it
// HACK: in this case host will set breakpoint just after ESP_APPTRACE_TRAX_CTRL_REG update,
// here we set address to set bp at
// enter ERI update critical section
eri_write(ESP_APPTRACE_TRAX_STAT_REG, (uint32_t)&__esp_apptrace_trax_eri_updated);
}
static __attribute__((noinline)) void esp_apptrace_trax_buffer_swap_unlock(void)
{
// exit ERI update critical section
eri_write(ESP_APPTRACE_TRAX_STAT_REG, 0x0);
// TODO: currently host sets breakpoint, use break instruction to stop;
// it will allow to use ESP_APPTRACE_TRAX_STAT_REG for other purposes
asm volatile (
" .global __esp_apptrace_trax_eri_updated\n"
"__esp_apptrace_trax_eri_updated:\n"); // host will set bp here to resolve collision at streaming start
}
static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
{
esp_err_t res = ESP_OK;
esp_apptrace_trax_buffer_swap_lock();
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
if (host_connected) {
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,
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
res = ESP_ERR_NO_MEM;
goto _on_err;
}
}
return ESP_OK;
_on_err:
esp_apptrace_trax_buffer_swap_unlock();
return res;
}
static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len)
{
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, 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;
}
static bool esp_apptrace_trax_host_data_pending(void)
{
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
return (ctrl_reg & ESP_APPTRACE_TRAX_HOST_DATA) ? true : false;
}

View File

@@ -0,0 +1,546 @@
/*
* SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*/
//
// How It Works
// ************
// 1. Components Overview
// ======================
// Xtensa has useful feature: TRAX debug module. It allows recording program execution flow at run-time without disturbing CPU.
// 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
// by means of reading/writing TRAX registers via JTAG. Blocks muxing is configurable at run-time and allows switching trace memory blocks between
// accessors in round-robin fashion so they can read/write separate memory blocks without disturbing each other.
// This module implements application tracing feature based on above mechanisms. It allows to transfer arbitrary user data to/from
// host via JTAG with minimal impact on system performance. This module is implied to be used in the following tracing scheme.
// ------>------ ----- (host components) -----
// | | | |
// ------------------- ----------------------- ----------------------- ---------------- ------ --------- -----------------
// |trace data source|-->|target tracing module|<--->|TRAX_MEM0 | TRAX_MEM1|---->|TRAX_DATA_REGS|<-->|JTAG|<--->|OpenOCD|-->|trace data sink|
// ------------------- ----------------------- ----------------------- ---------------- ------ --------- -----------------
// | | | |
// | ------<------ ---------------- |
// |<------------------------------------------->|TRAX_CTRL_REGS|<---->|
// ----------------
// In general tracing goes in the following way. User application requests tracing module to send some data by calling esp_apptrace_buffer_get(),
// module allocates necessary buffer in current input trace block. Then user fills received buffer with data and calls esp_apptrace_buffer_put().
// When current input trace block is filled with app data it is exposed to host and the second block becomes input one and buffer filling restarts.
// While target application fills one TRAX block host reads another one via JTAG.
// This module also allows communication in the opposite direction: from host to target. As it was said ESP32 and host can access different TRAX blocks
// simultaneously, so while target writes trace data to one block host can write its own data (e.g. tracing commands) to another one then when
// blocks are switched host receives trace data and target receives data written by host application. Target user application can read host data
// by calling esp_apptrace_read() API.
// To control buffer switching and for other communication purposes this implementation uses some TRAX registers. It is safe since HW TRAX tracing
// can not be used along with application tracing feature so these registers are freely readable/writeable via JTAG from host and via ERI from ESP32 cores.
// Overhead of this implementation on target CPU is produced only by allocating/managing buffers and copying of data.
// On the host side special OpenOCD command must be used to read trace data.
// 2. TRAX Registers layout
// ========================
// 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.
// Host writes zero to this field when it finishes reading exposed block;
// 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' 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
// =====================
// This module supports two modes of operation:
// - Post-mortem mode. This is the default mode. In this mode application tracing module does not check whether host has read all the data from block
// exposed to it and switches block in any case. The mode does not need host interaction for operation and so can be useful when only the latest
// trace data are necessary, e.g. for analyzing crashes. On panic the latest data from current input block are exposed to host and host can read them.
// It can happen that system panic occurs when there are very small amount of data which are not exposed to host yet (e.g. crash just after the
// TRAX block switch). In this case the previous 16KB of collected data will be dropped and host will see the latest, but very small piece of trace.
// It can be insufficient to diagnose the problem. To avoid such situations there is menuconfig option
// CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH
// which controls the threshold for flushing data in case of panic.
// - Streaming mode. Tracing module enters this mode when host connects to target and sets respective bits in control registers (per core).
// In this mode before switching the block tracing module waits for the host to read all the data from the previously exposed block.
// On panic tracing module also waits (timeout is configured via menuconfig via CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO) for the host to read all data.
// 4. Communication Protocol
// =========================
// 4.1 Trace Memory Blocks
// -----------------------
// Communication is controlled via special register. Host periodically polls control register on each core to find out if there are any data available.
// When current input memory block is filled it is exposed to host and 'block_len' and 'block_id' fields are updated in the control register.
// Host reads new register value and according to it's value starts reading data from exposed block. Meanwhile target starts filling another trace block.
// When host finishes reading the block it clears 'block_len' field in control register indicating to the target that it is ready to accept the next one.
// If the host has some data to transfer to the target it writes them to trace memory block before clearing 'block_len' field. Then it sets
// 'host_data_present' bit and clears 'block_len' field in control register. Upon every block switch target checks 'host_data_present' bit and if it is set
// reads them to down buffer before writing any trace data to switched TRAX block.
// 4.2 User Data Chunks Level
// --------------------------
// Since trace memory block is shared between user data chunks and data copying is performed on behalf of the API user (in its normal context) in
// multithreading environment it can happen that task/ISR which copies data is preempted by another high prio task/ISR. So it is possible situation
// that task/ISR will fail to complete filling its data chunk before the whole trace block is exposed to the host. To handle such conditions tracing
// module prepends all user data chunks with header which contains allocated buffer size and actual data length within it. OpenOCD command
// which reads application traces reports error when it reads incomplete user data block.
// Data which are transffered from host to target are also prepended with a header. Down channel data header is simple and consists of one two bytes field
// containing length of host data following the header.
// 4.3 Target Connection/Disconnection
// -----------------------------------
// When host is going to start tracing in streaming mode it needs to put both ESP32 cores into initial state when 'host connected' bit is set
// on both cores. To accomplish this host halts both cores and sets this bit in TRAX registers. But target code can be halted in state when it has read control
// register but has not updated its value. To handle such situations target code indicates to the host that it is updating control register by writing
// non-zero value to status register. Actually it writes address of the instruction which it will execute when it finishes with
// the registers update. When target is halted during control register update host sets breakpoint at the address from status register and resumes CPU.
// After target code finishes with register update it is halted on breakpoint, host detects it and safely sets 'host connected' bit. When both cores
// are set up they are resumed. Tracing starts without further intrusion into CPUs work.
// When host is going to stop tracing in streaming mode it needs to disconnect targets. Disconnection process is done using the same algorithm
// as for connecting, but 'host connected' bits are cleared on ESP32 cores.
// 5. Module Access Synchronization
// ================================
// 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 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.
// When low prio task takes mutex and enables local IRQs gets preempted by high prio task which in its turn can try to acquire mutex using infinite timeout.
// So no local task switch occurs when mutex is locked. But this does not apply to tasks on another CPU.
// WARNING: Priority inversion can happen when low prio task works on one CPU and medium and high prio tasks work on another.
// WARNING: Care must be taken when selecting timeout values for trace calls from ISRs. Tracing module does not care about watchdogs when waiting
// on internal locks and for host to complete previous block reading, so if timeout value exceeds watchdog's one it can lead to the system reboot.
// 6. Timeouts
// ===========
// 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 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 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"
#include "soc/dport_reg.h"
#include "soc/tracemem_config.h"
#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32S3
#include "soc/sensitive_reg.h"
#endif
#include "eri.h"
#include "esp_private/trax.h"
#include "esp_cpu.h"
#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)
#define ESP_APPTRACE_TRAX_BLOCK_LEN_GET(_v_) ((_v_) & ESP_APPTRACE_TRAX_BLOCK_LEN_MSK)
#define ESP_APPTRACE_TRAX_BLOCK_ID_MSK 0x7FUL
#define ESP_APPTRACE_TRAX_BLOCK_ID(_id_) (((_id_) & ESP_APPTRACE_TRAX_BLOCK_ID_MSK) << 15)
#define ESP_APPTRACE_TRAX_BLOCK_ID_GET(_v_) (((_v_) >> 15) & ESP_APPTRACE_TRAX_BLOCK_ID_MSK)
#define ESP_APPTRACE_TRAX_HOST_DATA (1 << 22)
#define ESP_APPTRACE_TRAX_HOST_CONNECT (1 << 23)
#define ESP_APPTRACE_TRAX_INITED(_hw_) ((_hw_)->inited & (1 << esp_cpu_get_core_id()))
#define ESP_APPTRACE_TRAX_BLOCK_SIZE (0x4000UL)
/** TRAX HW transport data */
typedef struct {
uint8_t inited;
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_t lock; // sync lock
#endif
esp_apptrace_membufs_proto_data_t membufs;
} esp_apptrace_trax_data_t;
const static char *TAG = "esp_apptrace";
static uint8_t * const s_trax_blocks[] = {
(uint8_t *)TRACEMEM_BLK0_ADDR,
(uint8_t *)TRACEMEM_BLK1_ADDR
};
static esp_err_t esp_apptrace_trax_lock(void *hw_data, esp_apptrace_tmo_t *tmo)
{
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_trax_data_t *trax_data = hw_data;
esp_err_t ret = esp_apptrace_lock_take(&trax_data->lock, tmo);
if (ret != ESP_OK) {
return ESP_FAIL;
}
#endif
return ESP_OK;
}
static esp_err_t esp_apptrace_trax_unlock(void *hw_data)
{
esp_err_t ret = ESP_OK;
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_trax_data_t *trax_data = hw_data;
ret = esp_apptrace_lock_give(&trax_data->lock);
#endif
return ret;
}
static inline void esp_apptrace_trax_hw_init(void)
{
// Stop trace, if any (on the current CPU)
eri_write(ERI_TRAX_TRAXCTRL, TRAXCTRL_TRSTP);
eri_write(ERI_TRAX_TRAXCTRL, TRAXCTRL_TMEN);
eri_write(ESP_APPTRACE_TRAX_CTRL_REG, ESP_APPTRACE_TRAX_BLOCK_ID(0));
// this is for OpenOCD to let him know where stub entries vector is resided
// must be read by host before any transfer using TRAX
eri_write(ESP_APPTRACE_TRAX_STAT_REG, 0);
ESP_APPTRACE_LOGI("Initialized TRAX on CPU%d", esp_cpu_get_core_id());
}
static inline void esp_apptrace_trax_select_memory_block(int block_num)
{
// select memory block to be exposed to the TRAX module (accessed by host)
#if CONFIG_IDF_TARGET_ESP32
DPORT_WRITE_PERI_REG(DPORT_TRACEMEM_MUX_MODE_REG, block_num ? TRACEMEM_MUX_BLK0_ONLY : TRACEMEM_MUX_BLK1_ONLY);
#elif CONFIG_IDF_TARGET_ESP32S2
WRITE_PERI_REG(DPORT_PMS_OCCUPY_3_REG, block_num ? BIT(TRACEMEM_MUX_BLK0_NUM - 4) : BIT(TRACEMEM_MUX_BLK1_NUM - 4));
#elif CONFIG_IDF_TARGET_ESP32S3
// select memory block to be exposed to the TRAX module (accessed by host)
uint32_t block_bits = block_num ? TRACEMEM_CORE0_MUX_BLK_BITS(TRACEMEM_MUX_BLK0_NUM)
: TRACEMEM_CORE0_MUX_BLK_BITS(TRACEMEM_MUX_BLK1_NUM);
block_bits |= block_num ? TRACEMEM_CORE1_MUX_BLK_BITS(TRACEMEM_MUX_BLK0_NUM)
: TRACEMEM_CORE1_MUX_BLK_BITS(TRACEMEM_MUX_BLK1_NUM);
ESP_EARLY_LOGV(TAG, "Select block %d @ %p (bits 0x%" PRIx32 ")", block_num, s_trax_blocks[block_num], block_bits);
DPORT_WRITE_PERI_REG(SENSITIVE_INTERNAL_SRAM_USAGE_2_REG, block_bits);
#endif
}
static inline void esp_apptrace_trax_memory_enable(void)
{
#if CONFIG_IDF_TARGET_ESP32
/* Enable trace memory on PRO CPU */
DPORT_WRITE_PERI_REG(DPORT_PRO_TRACEMEM_ENA_REG, DPORT_PRO_TRACEMEM_ENA_M);
#if CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE == 0
/* Enable trace memory on APP CPU */
DPORT_WRITE_PERI_REG(DPORT_APP_TRACEMEM_ENA_REG, DPORT_APP_TRACEMEM_ENA_M);
#endif
#endif
}
/*****************************************************************************************/
/***************************** Apptrace HW iface *****************************************/
/*****************************************************************************************/
static esp_err_t esp_apptrace_trax_init(void *hw_data, const esp_apptrace_config_t *config)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
// 'esp_apptrace_trax_init()' is called on every core, so ensure to do main initialization only once
int core_id = esp_cpu_get_core_id();
if (core_id == 0) {
esp_apptrace_mem_block_t mem_blocks_cfg[2] = {
{
.start = s_trax_blocks[0],
.sz = ESP_APPTRACE_TRAX_BLOCK_SIZE
},
{
.start = s_trax_blocks[1],
.sz = ESP_APPTRACE_TRAX_BLOCK_SIZE
},
};
trax_data->membufs.header_size = ESP_APPTRACE_HEADER_SIZE_32;
esp_err_t res = esp_apptrace_membufs_init(&trax_data->membufs, mem_blocks_cfg);
if (res != ESP_OK) {
ESP_APPTRACE_LOGE("Failed to init membufs proto (%d)!", res);
return res;
}
#if CONFIG_APPTRACE_LOCK_ENABLE
esp_apptrace_lock_init(&trax_data->lock);
#endif
esp_apptrace_trax_memory_enable();
esp_apptrace_trax_select_memory_block(0);
}
// init TRAX on this CPU
esp_apptrace_trax_hw_init();
trax_data->inited |= 1 << core_id;
return ESP_OK;
}
static uint8_t *esp_apptrace_trax_up_buffer_get(void *hw_data, uint32_t size, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_trax_lock(trax_data, tmo);
if (res != ESP_OK) {
return NULL;
}
uint8_t *ptr = esp_apptrace_membufs_up_buffer_get(&trax_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_trax_unlock(trax_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_trax_up_buffer_put(void *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_up_buffer_put() just modifies buffer's header
esp_err_t res = esp_apptrace_membufs_up_buffer_put(&trax_data->membufs, ptr, tmo);
return res;
}
static void esp_apptrace_trax_down_buffer_config(void *hw_data, uint8_t *buf, uint32_t size)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return;
}
esp_apptrace_membufs_down_buffer_config(&trax_data->membufs, buf, size);
}
static uint8_t *esp_apptrace_trax_down_buffer_get(void *hw_data, uint32_t *size, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return NULL;
}
esp_err_t res = esp_apptrace_trax_lock(trax_data, tmo);
if (res != ESP_OK) {
return NULL;
}
uint8_t *ptr = esp_apptrace_membufs_down_buffer_get(&trax_data->membufs, size, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_trax_unlock(trax_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return ptr;
}
static esp_err_t esp_apptrace_trax_down_buffer_put(void *hw_data, uint8_t *ptr, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return ESP_ERR_INVALID_STATE;
}
// Can avoid locking because esp_apptrace_membufs_down_buffer_put() does nothing
/*esp_err_t res = esp_apptrace_trax_lock(hw_data, tmo);
if (res != ESP_OK) {
return res;
}*/
esp_err_t res = esp_apptrace_membufs_down_buffer_put(&trax_data->membufs, ptr, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
/*if (esp_apptrace_trax_unlock(hw_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}*/
return res;
}
static bool esp_apptrace_trax_host_is_connected(void *hw_data)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return false;
}
return eri_read(ESP_APPTRACE_TRAX_CTRL_REG) & ESP_APPTRACE_TRAX_HOST_CONNECT ? true : false;
}
static esp_err_t esp_apptrace_trax_flush_nolock(void *hw_data, uint32_t min_sz, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return ESP_ERR_INVALID_STATE;
}
return esp_apptrace_membufs_flush_nolock(&trax_data->membufs, min_sz, tmo);
}
static esp_err_t esp_apptrace_trax_flush(void *hw_data, esp_apptrace_tmo_t *tmo)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
if (!ESP_APPTRACE_TRAX_INITED(trax_data)) {
return ESP_ERR_INVALID_STATE;
}
esp_err_t res = esp_apptrace_trax_lock(trax_data, tmo);
if (res != ESP_OK) {
return res;
}
res = esp_apptrace_membufs_flush_nolock(&trax_data->membufs, 0, tmo);
// now we can safely unlock apptrace to allow other tasks/ISRs to get other buffers and write their data
if (esp_apptrace_trax_unlock(trax_data) != ESP_OK) {
assert(false && "Failed to unlock apptrace data!");
}
return res;
}
/*****************************************************************************************/
/************************** Membufs proto HW iface ***************************************/
/*****************************************************************************************/
static inline void esp_apptrace_trax_buffer_swap_lock(void)
{
extern uint32_t __esp_apptrace_trax_eri_updated;
// indicate to host that we are about to update.
// this is used only to place CPU into streaming mode at tracing startup
// before starting streaming host can halt us after we read ESP_APPTRACE_TRAX_CTRL_REG and before we updated it
// HACK: in this case host will set breakpoint just after ESP_APPTRACE_TRAX_CTRL_REG update,
// here we set address to set bp at
// enter ERI update critical section
eri_write(ESP_APPTRACE_TRAX_STAT_REG, (uint32_t)&__esp_apptrace_trax_eri_updated);
}
static __attribute__((noinline)) void esp_apptrace_trax_buffer_swap_unlock(void)
{
// exit ERI update critical section
eri_write(ESP_APPTRACE_TRAX_STAT_REG, 0x0);
// TODO: currently host sets breakpoint, use break instruction to stop;
// it will allow to use ESP_APPTRACE_TRAX_STAT_REG for other purposes
asm volatile(
" .global __esp_apptrace_trax_eri_updated\n"
"__esp_apptrace_trax_eri_updated:\n"); // host will set bp here to resolve collision at streaming start
}
static esp_err_t esp_apptrace_trax_buffer_swap_start(uint32_t curr_block_id)
{
esp_err_t res = ESP_OK;
esp_apptrace_trax_buffer_swap_lock();
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
uint32_t host_connected = ESP_APPTRACE_TRAX_HOST_CONNECT & ctrl_reg;
if (host_connected) {
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,
curr_block_id & ESP_APPTRACE_TRAX_BLOCK_ID_MSK, curr_block_id);
res = ESP_ERR_NO_MEM;
goto _on_err;
}
}
return ESP_OK;
_on_err:
esp_apptrace_trax_buffer_swap_unlock();
return res;
}
static esp_err_t esp_apptrace_trax_buffer_swap_end(uint32_t new_block_id, uint32_t prev_block_len)
{
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, 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;
}
static bool esp_apptrace_trax_host_data_pending(void)
{
uint32_t ctrl_reg = eri_read(ESP_APPTRACE_TRAX_CTRL_REG);
return (ctrl_reg & ESP_APPTRACE_TRAX_HOST_DATA) ? true : false;
}
static void esp_apptrace_trax_set_header_size(void *hw_data, esp_apptrace_header_size_t header_size)
{
esp_apptrace_trax_data_t *trax_data = hw_data;
trax_data->membufs.header_size = header_size;
}
esp_apptrace_hw_t *esp_apptrace_jtag_hw_get(void **data)
{
static esp_apptrace_membufs_proto_hw_t s_trax_proto_hw = {
.swap_start = esp_apptrace_trax_buffer_swap_start,
.swap = esp_apptrace_trax_buffer_swap,
.swap_end = esp_apptrace_trax_buffer_swap_end,
.host_data_pending = esp_apptrace_trax_host_data_pending,
};
static esp_apptrace_trax_data_t s_trax_hw_data = {
.membufs = {
.hw = &s_trax_proto_hw,
},
};
static esp_apptrace_hw_t s_trax_hw = {
.init = esp_apptrace_trax_init,
.get_up_buffer = esp_apptrace_trax_up_buffer_get,
.put_up_buffer = esp_apptrace_trax_up_buffer_put,
.flush_up_buffer_nolock = esp_apptrace_trax_flush_nolock,
.flush_up_buffer = esp_apptrace_trax_flush,
.down_buffer_config = esp_apptrace_trax_down_buffer_config,
.get_down_buffer = esp_apptrace_trax_down_buffer_get,
.put_down_buffer = esp_apptrace_trax_down_buffer_put,
.host_is_connected = esp_apptrace_trax_host_is_connected,
.set_header_size = esp_apptrace_trax_set_header_size,
};
*data = &s_trax_hw_data;
return &s_trax_hw;
}

View File

@@ -1,69 +0,0 @@
/*
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ESP_DBG_STUBS_H_
#define ESP_DBG_STUBS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "esp_err.h"
/**
* Debug stubs entries IDs
*/
typedef enum {
ESP_DBG_STUB_MAGIC_NUM,
ESP_DBG_STUB_TABLE_SIZE,
ESP_DBG_STUB_CONTROL_DATA, ///< stubs descriptor entry
ESP_DBG_STUB_ENTRY_FIRST,
ESP_DBG_STUB_ENTRY_GCOV ///< GCOV entry
= ESP_DBG_STUB_ENTRY_FIRST,
ESP_DBG_STUB_ENTRY_CAPABILITIES,
ESP_DBG_STUB_ENTRY_MAX
} esp_dbg_stub_id_t;
#define ESP_DBG_STUB_MAGIC_NUM_VAL 0xFEEDBEEF
#define ESP_DBG_STUB_CAP_GCOV_TASK (1 << 0)
/**
* @brief Initializes debug stubs.
*
* @note Must be called after esp_apptrace_init() if app tracing is enabled.
*/
void esp_dbg_stubs_init(void);
/**
* @brief Initializes application tracing module.
*
* @note Should be called before any esp_apptrace_xxx call.
*
* @param id Stub ID.
* @param entry Stub entry. Usually it is stub entry function address,
* but can be any value meaningfull for OpenOCD command/code
* such as capabilities
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_dbg_stub_entry_set(esp_dbg_stub_id_t id, uint32_t entry);
/**
* @brief Retrives the corresponding stub entry
*
* @param id Stub ID.
* @param entry Stub entry. Usually it is stub entry function address,
* but can be any value meaningfull for OpenOCD command/code
* such as capabilities
*
* @return ESP_OK on success, otherwise see esp_err_t
*/
esp_err_t esp_dbg_stub_entry_get(esp_dbg_stub_id_t id, uint32_t *entry);
#ifdef __cplusplus
}
#endif
#endif // ESP_DBG_STUBS_H_

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2025 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -38,14 +38,9 @@ typedef struct {
esp_apptrace_membufs_proto_hw_t * hw;
volatile esp_apptrace_membufs_state_t state; // state
esp_apptrace_mem_block_t blocks[2]; // memory blocks
#if CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX > 0
// ring buffer control struct for pending user blocks
esp_apptrace_rb_t rb_pend;
// storage for pending user blocks
uint8_t pending_data[CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX + 1];
#endif
// ring buffer control struct for data from host (down buffer)
esp_apptrace_rb_t rb_down;
int header_size; ///< Size of the trace header (2 or 4 bytes)
} esp_apptrace_membufs_proto_data_t;
esp_err_t esp_apptrace_membufs_init(esp_apptrace_membufs_proto_data_t *proto, const esp_apptrace_mem_block_t blocks_cfg[2]);

View File

@@ -1,41 +0,0 @@
# idf_create_lcov_report
#
# Create coverage report.
function(idf_create_coverage_report report_dir)
set(gcov_tool ${_CMAKE_TOOLCHAIN_PREFIX}gcov)
idf_build_get_property(project_name PROJECT_NAME)
file(TO_NATIVE_PATH "${report_dir}" _report_dir)
file(TO_NATIVE_PATH "${project_dir}" _project_dir)
file(TO_NATIVE_PATH "${report_dir}/html/index.html" _index_path)
add_custom_target(pre-cov-report
COMMENT "Generating coverage report in: ${_report_dir}"
COMMAND ${CMAKE_COMMAND} -E echo "Using gcov: ${gcov_tool}"
COMMAND ${CMAKE_COMMAND} -E make_directory ${_report_dir}/html
)
add_custom_target(lcov-report
COMMENT "WARNING: lcov-report is deprecated. Please use gcovr-report instead."
COMMAND lcov --gcov-tool ${gcov_tool} -c -d ${CMAKE_CURRENT_BINARY_DIR} -o ${_report_dir}/${project_name}.info
COMMAND genhtml -o ${_report_dir}/html ${_report_dir}/${project_name}.info
DEPENDS pre-cov-report
)
add_custom_target(gcovr-report
COMMAND gcovr -r ${_project_dir} --gcov-executable ${gcov_tool} -s --html-details ${_index_path}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS pre-cov-report
)
endfunction()
# idf_clean_coverage_report
#
# Clean coverage report.
function(idf_clean_coverage_report report_dir)
file(TO_CMAKE_PATH "${report_dir}" _report_dir)
add_custom_target(cov-data-clean
COMMENT "Clean coverage report in: ${_report_dir}"
COMMAND ${CMAKE_COMMAND} -E remove_directory ${_report_dir})
endfunction()

View File

@@ -2,31 +2,11 @@
# CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION
CONFIG_ESP32_APPTRACE_DESTINATION CONFIG_APPTRACE_DESTINATION
CONFIG_ESP32_APPTRACE_DEST_NONE CONFIG_APPTRACE_DEST_NONE
CONFIG_ESP32_APPTRACE_DEST_TRAX CONFIG_APPTRACE_DEST_JTAG
CONFIG_ESP32_APPTRACE_ENABLE CONFIG_APPTRACE_ENABLE
CONFIG_ESP32_APPTRACE_ENABLE CONFIG_ESP_TRACE_TRANSPORT_APPTRACE
CONFIG_ESP32_APPTRACE_LOCK_ENABLE CONFIG_APPTRACE_LOCK_ENABLE
CONFIG_ESP32_APPTRACE_ONPANIC_HOST_FLUSH_TMO CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO
CONFIG_ESP32_APPTRACE_POSTMORTEM_FLUSH_TRAX_THRESH CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH
CONFIG_ESP32_APPTRACE_PENDING_DATA_SIZE_MAX CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX
CONFIG_ESP32_GCOV_ENABLE CONFIG_APPTRACE_GCOV_ENABLE
CONFIG_SYSVIEW_ENABLE CONFIG_APPTRACE_SV_ENABLE
CONFIG_SYSVIEW_TS_SOURCE CONFIG_APPTRACE_SV_TS_SOURCE
CONFIG_SYSVIEW_TS_SOURCE_CCOUNT CONFIG_APPTRACE_SV_TS_SOURCE_CCOUNT
CONFIG_SYSVIEW_TS_SOURCE_ESP_TIMER CONFIG_APPTRACE_SV_TS_SOURCE_ESP_TIMER
CONFIG_SYSVIEW_MAX_TASKS CONFIG_APPTRACE_SV_MAX_TASKS
CONFIG_SYSVIEW_BUF_WAIT_TMO CONFIG_APPTRACE_SV_BUF_WAIT_TMO
CONFIG_SYSVIEW_EVT_OVERFLOW_ENABLE CONFIG_APPTRACE_SV_EVT_OVERFLOW_ENABLE
CONFIG_SYSVIEW_EVT_ISR_ENTER_ENABLE CONFIG_APPTRACE_SV_EVT_ISR_ENTER_ENABLE
CONFIG_SYSVIEW_EVT_ISR_EXIT_ENABLE CONFIG_APPTRACE_SV_EVT_ISR_EXIT_ENABLE
CONFIG_SYSVIEW_EVT_ISR_TO_SCHEDULER_ENABLE CONFIG_APPTRACE_SV_EVT_ISR_TO_SCHED_ENABLE
CONFIG_SYSVIEW_EVT_TASK_START_EXEC_ENABLE CONFIG_APPTRACE_SV_EVT_TASK_START_EXEC_ENABLE
CONFIG_SYSVIEW_EVT_TASK_STOP_EXEC_ENABLE CONFIG_APPTRACE_SV_EVT_TASK_STOP_EXEC_ENABLE
CONFIG_SYSVIEW_EVT_TASK_START_READY_ENABLE CONFIG_APPTRACE_SV_EVT_TASK_START_READY_ENABLE
CONFIG_SYSVIEW_EVT_TASK_STOP_READY_ENABLE CONFIG_APPTRACE_SV_EVT_TASK_STOP_READY_ENABLE
CONFIG_SYSVIEW_EVT_TASK_CREATE_ENABLE CONFIG_APPTRACE_SV_EVT_TASK_CREATE_ENABLE
CONFIG_SYSVIEW_EVT_TASK_TERMINATE_ENABLE CONFIG_APPTRACE_SV_EVT_TASK_TERMINATE_ENABLE
CONFIG_SYSVIEW_EVT_IDLE_ENABLE CONFIG_APPTRACE_SV_EVT_IDLE_ENABLE
CONFIG_SYSVIEW_EVT_TIMER_ENTER_ENABLE CONFIG_APPTRACE_SV_EVT_TIMER_ENTER_ENABLE
CONFIG_SYSVIEW_EVT_TIMER_EXIT_ENABLE CONFIG_APPTRACE_SV_EVT_TIMER_EXIT_ENABLE
CONFIG_SYSVIEW_TS_SOURCE_CCOUNT CONFIG_ESP_TRACE_TS_SOURCE_CCOUNT
CONFIG_SYSVIEW_TS_SOURCE_ESP_TIMER CONFIG_ESP_TRACE_TS_SOURCE_ESP_TIMER

View File

@@ -1,118 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.42 *
* *
**********************************************************************
----------------------------------------------------------------------
File : Global.h
Purpose : Global types
In case your application already has a Global.h, you should
merge the files. In order to use Segger code, the types
U8, U16, U32, I8, I16, I32 need to be defined in Global.h;
additional definitions do not hurt.
Revision: $Rev: 12501 $
---------------------------END-OF-HEADER------------------------------
*/
#ifndef GLOBAL_H // Guard against multiple inclusion
#define GLOBAL_H
#define U8 unsigned char
#define I8 signed char
#define U16 unsigned short
#define I16 signed short
#ifdef __x86_64__
#define U32 unsigned
#define I32 int
#else
#define U32 unsigned long
#define I32 signed long
#endif
//
// CC_NO_LONG_SUPPORT can be defined to compile test
// without long support for compilers that do not
// support C99 and its long type.
//
#ifdef CC_NO_LONG_SUPPORT
#define PTR_ADDR U32
#else // Supports long type.
#if defined(_WIN32) && !defined(__clang__) && !defined(__MINGW32__)
//
// Microsoft VC6 compiler related
//
#define U64 unsigned __int64
#define U128 unsigned __int128
#define I64 __int64
#define I128 __int128
#if _MSC_VER <= 1200
#define U64_C(x) x##UI64
#else
#define U64_C(x) x##ULL
#endif
#else
//
// C99 compliant compiler
//
#define U64 unsigned long long
#define I64 signed long long
#define U64_C(x) x##ULL
#endif
#if (defined(_WIN64) || defined(__LP64__)) // 64-bit symbols used by Visual Studio and GCC, maybe others as well.
#define PTR_ADDR U64
#else
#define PTR_ADDR U32
#endif
#endif // Supports long type.
#endif // Avoid multiple inclusion
/*************************** End of file ****************************/

View File

@@ -1,433 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.42 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
File : SEGGER_RTT_Conf.h
Purpose : Implementation of SEGGER real-time transfer (RTT) which
allows real-time communication on targets which support
debugger memory accesses while the CPU is running.
Revision: $Rev: 24316 $
*/
#ifndef SEGGER_RTT_CONF_H
#define SEGGER_RTT_CONF_H
#ifdef __IAR_SYSTEMS_ICC__
#include <intrinsics.h>
#endif
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
//
// Take in and set to correct values for Cortex-A systems with CPU cache
//
//#define SEGGER_RTT_CPU_CACHE_LINE_SIZE (32) // Largest cache line size (in bytes) in the current system
//#define SEGGER_RTT_UNCACHED_OFF (0xFB000000) // Address alias where RTT CB and buffers can be accessed uncached
//
// Most common case:
// Up-channel 0: RTT
// Up-channel 1: SystemView
//
#ifndef SEGGER_RTT_MAX_NUM_UP_BUFFERS
#define SEGGER_RTT_MAX_NUM_UP_BUFFERS (3) // Max. number of up-buffers (T->H) available on this target (Default: 3)
#endif
//
// Most common case:
// Down-channel 0: RTT
// Down-channel 1: SystemView
//
#ifndef SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (3) // Max. number of down-buffers (H->T) available on this target (Default: 3)
#endif
#ifndef BUFFER_SIZE_UP
#define BUFFER_SIZE_UP (1024) // Size of the buffer for terminal output of target, up to host (Default: 1k)
#endif
#ifndef BUFFER_SIZE_DOWN
#define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
#endif
#ifndef SEGGER_RTT_PRINTF_BUFFER_SIZE
#define SEGGER_RTT_PRINTF_BUFFER_SIZE (64u) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)
#endif
#ifndef SEGGER_RTT_MODE_DEFAULT
#define SEGGER_RTT_MODE_DEFAULT SEGGER_RTT_MODE_NO_BLOCK_SKIP // Mode for pre-initialized terminal channel (buffer 0)
#endif
/*********************************************************************
*
* RTT memcpy configuration
*
* memcpy() is good for large amounts of data,
* but the overhead is big for small amounts, which are usually stored via RTT.
* With SEGGER_RTT_MEMCPY_USE_BYTELOOP a simple byte loop can be used instead.
*
* SEGGER_RTT_MEMCPY() can be used to replace standard memcpy() in RTT functions.
* This is may be required with memory access restrictions,
* such as on Cortex-A devices with MMU.
*/
#ifndef SEGGER_RTT_MEMCPY_USE_BYTELOOP
#define SEGGER_RTT_MEMCPY_USE_BYTELOOP 0 // 0: Use memcpy/SEGGER_RTT_MEMCPY, 1: Use a simple byte-loop
#endif
//
// Example definition of SEGGER_RTT_MEMCPY to external memcpy with GCC toolchains and Cortex-A targets
//
//#if ((defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)) && (defined (__ARM_ARCH_7A__))
// #define SEGGER_RTT_MEMCPY(pDest, pSrc, NumBytes) SEGGER_memcpy((pDest), (pSrc), (NumBytes))
//#endif
//
// Target is not allowed to perform other RTT operations while string still has not been stored completely.
// Otherwise we would probably end up with a mixed string in the buffer.
// If using RTT from within interrupts, multiple tasks or multi processors, define the SEGGER_RTT_LOCK() and SEGGER_RTT_UNLOCK() function here.
//
// SEGGER_RTT_MAX_INTERRUPT_PRIORITY can be used in the sample lock routines on Cortex-M3/4.
// Make sure to mask all interrupts which can send RTT data, i.e. generate SystemView events, or cause task switches.
// When high-priority interrupts must not be masked while sending RTT data, SEGGER_RTT_MAX_INTERRUPT_PRIORITY needs to be adjusted accordingly.
// (Higher priority = lower priority number)
// Default value for embOS: 128u
// Default configuration in FreeRTOS: configMAX_SYSCALL_INTERRUPT_PRIORITY: ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
// In case of doubt mask all interrupts: 1 << (8 - BASEPRI_PRIO_BITS) i.e. 1 << 5 when 3 bits are implemented in NVIC
// or define SEGGER_RTT_LOCK() to completely disable interrupts.
//
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20) // Interrupt priority to lock on SEGGER_RTT_LOCK on Cortex-M3/4 (Default: 0x20)
#endif
/*********************************************************************
*
* RTT lock configuration for SEGGER Embedded Studio,
* Rowley CrossStudio and GCC
*/
#if ((defined(__SES_ARM) || defined(__SES_RISCV) || defined(__CROSSWORKS_ARM) || defined(__GNUC__) || defined(__clang__)) && !defined (__CC_ARM) && !defined(WIN32))
#if (defined(__ARM_ARCH_6M__) || defined(__ARM_ARCH_8M_BASE__))
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("mrs %0, primask \n\t" \
"movs r1, #1 \n\t" \
"msr primask, r1 \n\t" \
: "=r" (_SEGGER_RTT__LockState) \
: \
: "r1", "cc" \
);
#define SEGGER_RTT_UNLOCK() __asm volatile ("msr primask, %0 \n\t" \
: \
: "r" (_SEGGER_RTT__LockState) \
: \
); \
}
#elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__))
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
#endif
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("mrs %0, basepri \n\t" \
"mov r1, %1 \n\t" \
"msr basepri, r1 \n\t" \
: "=r" (_SEGGER_RTT__LockState) \
: "i"(SEGGER_RTT_MAX_INTERRUPT_PRIORITY) \
: "r1", "cc" \
);
#define SEGGER_RTT_UNLOCK() __asm volatile ("msr basepri, %0 \n\t" \
: \
: "r" (_SEGGER_RTT__LockState) \
: \
); \
}
#elif (defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__))
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("mrs r1, CPSR \n\t" \
"mov %0, r1 \n\t" \
"orr r1, r1, #0xC0 \n\t" \
"msr CPSR_c, r1 \n\t" \
: "=r" (_SEGGER_RTT__LockState) \
: \
: "r1", "cc" \
);
#define SEGGER_RTT_UNLOCK() __asm volatile ("mov r0, %0 \n\t" \
"mrs r1, CPSR \n\t" \
"bic r1, r1, #0xC0 \n\t" \
"and r0, r0, #0xC0 \n\t" \
"orr r1, r1, r0 \n\t" \
"msr CPSR_c, r1 \n\t" \
: \
: "r" (_SEGGER_RTT__LockState) \
: "r0", "r1", "cc" \
); \
}
#elif defined(__riscv) || defined(__riscv_xlen)
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("csrr %0, mstatus \n\t" \
"csrci mstatus, 8 \n\t" \
"andi %0, %0, 8 \n\t" \
: "=r" (_SEGGER_RTT__LockState) \
: \
: \
);
#define SEGGER_RTT_UNLOCK() __asm volatile ("csrr a1, mstatus \n\t" \
"or %0, %0, a1 \n\t" \
"csrs mstatus, %0 \n\t" \
: \
: "r" (_SEGGER_RTT__LockState) \
: "a1" \
); \
}
#else
#define SEGGER_RTT_LOCK()
#define SEGGER_RTT_UNLOCK()
#endif
#endif
/*********************************************************************
*
* RTT lock configuration for IAR EWARM
*/
#ifdef __ICCARM__
#if (defined (__ARM6M__) && (__CORE__ == __ARM6M__)) || \
(defined (__ARM8M_BASELINE__) && (__CORE__ == __ARM8M_BASELINE__))
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = __get_PRIMASK(); \
__set_PRIMASK(1);
#define SEGGER_RTT_UNLOCK() __set_PRIMASK(_SEGGER_RTT__LockState); \
}
#elif (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)) || \
(defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || \
(defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__)) || \
(defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__))
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
#endif
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = __get_BASEPRI(); \
__set_BASEPRI(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
#define SEGGER_RTT_UNLOCK() __set_BASEPRI(_SEGGER_RTT__LockState); \
}
#elif (defined (__ARM7A__) && (__CORE__ == __ARM7A__)) || \
(defined (__ARM7R__) && (__CORE__ == __ARM7R__))
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
__asm volatile ("mrs r1, CPSR \n\t" \
"mov %0, r1 \n\t" \
"orr r1, r1, #0xC0 \n\t" \
"msr CPSR_c, r1 \n\t" \
: "=r" (_SEGGER_RTT__LockState) \
: \
: "r1", "cc" \
);
#define SEGGER_RTT_UNLOCK() __asm volatile ("mov r0, %0 \n\t" \
"mrs r1, CPSR \n\t" \
"bic r1, r1, #0xC0 \n\t" \
"and r0, r0, #0xC0 \n\t" \
"orr r1, r1, r0 \n\t" \
"msr CPSR_c, r1 \n\t" \
: \
: "r" (_SEGGER_RTT__LockState) \
: "r0", "r1", "cc" \
); \
}
#endif
#endif
/*********************************************************************
*
* RTT lock configuration for IAR RX
*/
#ifdef __ICCRX__
#define SEGGER_RTT_LOCK() { \
unsigned long _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = __get_interrupt_state(); \
__disable_interrupt();
#define SEGGER_RTT_UNLOCK() __set_interrupt_state(_SEGGER_RTT__LockState); \
}
#endif
/*********************************************************************
*
* RTT lock configuration for IAR RL78
*/
#ifdef __ICCRL78__
#define SEGGER_RTT_LOCK() { \
__istate_t _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = __get_interrupt_state(); \
__disable_interrupt();
#define SEGGER_RTT_UNLOCK() __set_interrupt_state(_SEGGER_RTT__LockState); \
}
#endif
/*********************************************************************
*
* RTT lock configuration for KEIL ARM
*/
#ifdef __CC_ARM
#if (defined __TARGET_ARCH_6S_M)
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
register unsigned char _SEGGER_RTT__PRIMASK __asm( "primask"); \
_SEGGER_RTT__LockState = _SEGGER_RTT__PRIMASK; \
_SEGGER_RTT__PRIMASK = 1u; \
__schedule_barrier();
#define SEGGER_RTT_UNLOCK() _SEGGER_RTT__PRIMASK = _SEGGER_RTT__LockState; \
__schedule_barrier(); \
}
#elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
#endif
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
register unsigned char BASEPRI __asm( "basepri"); \
_SEGGER_RTT__LockState = BASEPRI; \
BASEPRI = SEGGER_RTT_MAX_INTERRUPT_PRIORITY; \
__schedule_barrier();
#define SEGGER_RTT_UNLOCK() BASEPRI = _SEGGER_RTT__LockState; \
__schedule_barrier(); \
}
#endif
#endif
/*********************************************************************
*
* RTT lock configuration for TI ARM
*/
#ifdef __TI_ARM__
#if defined (__TI_ARM_V6M0__)
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = __get_PRIMASK(); \
__set_PRIMASK(1);
#define SEGGER_RTT_UNLOCK() __set_PRIMASK(_SEGGER_RTT__LockState); \
}
#elif (defined (__TI_ARM_V7M3__) || defined (__TI_ARM_V7M4__))
#ifndef SEGGER_RTT_MAX_INTERRUPT_PRIORITY
#define SEGGER_RTT_MAX_INTERRUPT_PRIORITY (0x20)
#endif
#define SEGGER_RTT_LOCK() { \
unsigned int _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = _set_interrupt_priority(SEGGER_RTT_MAX_INTERRUPT_PRIORITY);
#define SEGGER_RTT_UNLOCK() _set_interrupt_priority(_SEGGER_RTT__LockState); \
}
#endif
#endif
/*********************************************************************
*
* RTT lock configuration for CCRX
*/
#ifdef __RX
#include <machine.h>
#define SEGGER_RTT_LOCK() { \
unsigned long _SEGGER_RTT__LockState; \
_SEGGER_RTT__LockState = get_psw() & 0x010000; \
clrpsw_i();
#define SEGGER_RTT_UNLOCK() set_psw(get_psw() | _SEGGER_RTT__LockState); \
}
#endif
/*********************************************************************
*
* RTT lock configuration for embOS Simulation on Windows
* (Can also be used for generic RTT locking with embOS)
*/
#if defined(WIN32) || defined(SEGGER_RTT_LOCK_EMBOS)
void OS_SIM_EnterCriticalSection(void);
void OS_SIM_LeaveCriticalSection(void);
#define SEGGER_RTT_LOCK() { \
OS_SIM_EnterCriticalSection();
#define SEGGER_RTT_UNLOCK() OS_SIM_LeaveCriticalSection(); \
}
#endif
/*********************************************************************
*
* RTT lock configuration fallback
*/
#ifndef SEGGER_RTT_LOCK
#define SEGGER_RTT_LOCK() // Lock RTT (nestable) (i.e. disable interrupts)
#endif
#ifndef SEGGER_RTT_UNLOCK
#define SEGGER_RTT_UNLOCK() // Unlock RTT (nestable) (i.e. enable previous interrupt lock state)
#endif
#endif
/*************************** End of file ****************************/

View File

@@ -1,90 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.42 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_Conf.h
Purpose : SEGGER SystemView configuration file.
Set defines which deviate from the defaults (see SEGGER_SYSVIEW_ConfDefaults.h) here.
Revision: $Rev: 21292 $
Additional information:
Required defines which must be set are:
SEGGER_SYSVIEW_GET_TIMESTAMP
SEGGER_SYSVIEW_GET_INTERRUPT_ID
For known compilers and cores, these might be set to good defaults
in SEGGER_SYSVIEW_ConfDefaults.h.
SystemView needs a (nestable) locking mechanism.
If not defined, the RTT locking mechanism is used,
which then needs to be properly configured.
*/
#ifndef SEGGER_SYSVIEW_CONF_H
#define SEGGER_SYSVIEW_CONF_H
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
/*********************************************************************
* TODO: Add your defines here. *
**********************************************************************
*/
#endif // SEGGER_SYSVIEW_CONF_H
/*************************** End of file ****************************/

View File

@@ -1,255 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.56 *
* *
**********************************************************************
----------------------------------------------------------------------
File : SEGGER.h
Purpose : Global types etc & general purpose utility functions
Revision: $Rev: 18102 $
---------------------------END-OF-HEADER------------------------------
*/
#ifndef SEGGER_H // Guard against multiple inclusion
#define SEGGER_H
#include <stdarg.h> // For va_list.
#include "Global.h" // Type definitions: U8, U16, U32, I8, I16, I32
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Keywords/specifiers
*
**********************************************************************
*/
#ifndef INLINE
#if (defined(__ICCARM__) || defined(__RX) || defined(__ICCRX__))
//
// Other known compilers.
//
#define INLINE inline
#else
#if (defined(_WIN32) && !defined(__clang__))
//
// Microsoft VC6 and newer.
// Force inlining without cost checking.
//
#define INLINE __forceinline
#elif defined(__GNUC__) || defined(__clang__)
//
// Force inlining with GCC + clang
//
#define INLINE inline __attribute__((always_inline))
#elif (defined(__CC_ARM))
//
// Force inlining with ARMCC (Keil)
//
#define INLINE __inline
#else
//
// Unknown compilers.
//
#define INLINE
#endif
#endif
#endif
/*********************************************************************
*
* Function-like macros
*
**********************************************************************
*/
#define SEGGER_COUNTOF(a) (sizeof((a))/sizeof((a)[0]))
#define SEGGER_MIN(a,b) (((a) < (b)) ? (a) : (b))
#define SEGGER_MAX(a,b) (((a) > (b)) ? (a) : (b))
#ifndef SEGGER_USE_PARA // Some compiler complain about unused parameters.
#define SEGGER_USE_PARA(Para) (void)Para // This works for most compilers.
#endif
#define SEGGER_ADDR2PTR(Type, Addr) (/*lint -e(923) -e(9078)*/((Type*)((PTR_ADDR)(Addr)))) // Allow cast from address to pointer.
#define SEGGER_PTR2ADDR(p) (/*lint -e(923) -e(9078)*/((PTR_ADDR)(p))) // Allow cast from pointer to address.
#define SEGGER_PTR2PTR(Type, p) (/*lint -e(740) -e(826) -e(9079) -e(9087)*/((Type*)(p))) // Allow cast from one pointer type to another (ignore different size).
#define SEGGER_PTR_DISTANCE(p0, p1) (SEGGER_PTR2ADDR(p0) - SEGGER_PTR2ADDR(p1))
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define SEGGER_PRINTF_FLAG_ADJLEFT (1 << 0)
#define SEGGER_PRINTF_FLAG_SIGNFORCE (1 << 1)
#define SEGGER_PRINTF_FLAG_SIGNSPACE (1 << 2)
#define SEGGER_PRINTF_FLAG_PRECEED (1 << 3)
#define SEGGER_PRINTF_FLAG_ZEROPAD (1 << 4)
#define SEGGER_PRINTF_FLAG_NEGATIVE (1 << 5)
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct {
char* pBuffer;
int BufferSize;
int Cnt;
} SEGGER_BUFFER_DESC;
typedef struct {
unsigned int CacheLineSize; // 0: No Cache. Most Systems such as ARM9 use a 32 bytes cache line size.
void (*pfDMB) (void); // Optional DMB function for Data Memory Barrier to make sure all memory operations are completed.
void (*pfClean) (void *p, unsigned long NumBytes); // Optional clean function for cached memory.
void (*pfInvalidate)(void *p, unsigned long NumBytes); // Optional invalidate function for cached memory.
} SEGGER_CACHE_CONFIG;
typedef struct SEGGER_SNPRINTF_CONTEXT_struct SEGGER_SNPRINTF_CONTEXT;
struct SEGGER_SNPRINTF_CONTEXT_struct {
void* pContext; // Application specific context.
SEGGER_BUFFER_DESC* pBufferDesc; // Buffer descriptor to use for output.
void (*pfFlush)(SEGGER_SNPRINTF_CONTEXT* pContext); // Callback executed once the buffer is full. Callback decides if the buffer gets cleared to store more or not.
};
typedef struct {
void (*pfStoreChar) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, char c);
int (*pfPrintUnsigned) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, U32 v, unsigned Base, char Flags, int Width, int Precision);
int (*pfPrintInt) (SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, I32 v, unsigned Base, char Flags, int Width, int Precision);
} SEGGER_PRINTF_API;
typedef void (*SEGGER_pFormatter)(SEGGER_BUFFER_DESC* pBufferDesc, SEGGER_SNPRINTF_CONTEXT* pContext, const SEGGER_PRINTF_API* pApi, va_list* pParamList, char Lead, int Width, int Precision);
typedef struct SEGGER_PRINTF_FORMATTER {
struct SEGGER_PRINTF_FORMATTER* pNext; // Pointer to next formatter.
SEGGER_pFormatter pfFormatter; // Formatter function.
char Specifier; // Format specifier.
} SEGGER_PRINTF_FORMATTER;
typedef struct {
U32 (*pfGetHPTimestamp)(void); // Mandatory, pfGetHPTimestamp
int (*pfGetUID) (U8 abUID[16]); // Optional, pfGetUID
} SEGGER_BSP_API;
/*********************************************************************
*
* Utility functions
*
**********************************************************************
*/
//
// Memory operations.
//
void SEGGER_ARM_memcpy(void* pDest, const void* pSrc, int NumBytes);
void SEGGER_memcpy (void* pDest, const void* pSrc, unsigned NumBytes);
void SEGGER_memxor (void* pDest, const void* pSrc, unsigned NumBytes);
//
// String functions.
//
int SEGGER_atoi (const char* s);
int SEGGER_isalnum (int c);
int SEGGER_isalpha (int c);
unsigned SEGGER_strlen (const char* s);
int SEGGER_tolower (int c);
int SEGGER_strcasecmp (const char* sText1, const char* sText2);
int SEGGER_strncasecmp(const char *sText1, const char *sText2, unsigned Count);
//
// Buffer/printf related.
//
void SEGGER_StoreChar (SEGGER_BUFFER_DESC* pBufferDesc, char c);
void SEGGER_PrintUnsigned(SEGGER_BUFFER_DESC* pBufferDesc, U32 v, unsigned Base, int Precision);
void SEGGER_PrintInt (SEGGER_BUFFER_DESC* pBufferDesc, I32 v, unsigned Base, int Precision);
int SEGGER_snprintf (char* pBuffer, int BufferSize, const char* sFormat, ...);
int SEGGER_vsnprintf (char* pBuffer, int BufferSize, const char* sFormat, va_list ParamList);
int SEGGER_vsnprintfEx (SEGGER_SNPRINTF_CONTEXT* pContext, const char* sFormat, va_list ParamList);
int SEGGER_PRINTF_AddFormatter (SEGGER_PRINTF_FORMATTER* pFormatter, SEGGER_pFormatter pfFormatter, char c);
void SEGGER_PRINTF_AddDoubleFormatter (void);
void SEGGER_PRINTF_AddIPFormatter (void);
void SEGGER_PRINTF_AddBLUEFormatter (void);
void SEGGER_PRINTF_AddCONNECTFormatter(void);
void SEGGER_PRINTF_AddSSLFormatter (void);
void SEGGER_PRINTF_AddSSHFormatter (void);
void SEGGER_PRINTF_AddHTMLFormatter (void);
//
// BSP abstraction API.
//
int SEGGER_BSP_GetUID (U8 abUID[16]);
int SEGGER_BSP_GetUID32(U32* pUID);
void SEGGER_BSP_SetAPI (const SEGGER_BSP_API* pAPI);
void SEGGER_BSP_SeedUID (void);
//
// Other API.
//
void SEGGER_VERSION_GetString(char acText[8], unsigned Version);
#if defined(__cplusplus)
} /* Make sure we have C-declarations in C++ programs */
#endif
#endif // Avoid multiple inclusion
/*************************** End of file ****************************/

View File

@@ -1,515 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.56 *
* *
**********************************************************************
---------------------------END-OF-HEADER------------------------------
File : SEGGER_RTT.h
Purpose : Implementation of SEGGER real-time transfer which allows
real-time communication on targets which support debugger
memory accesses while the CPU is running.
Revision: $Rev: 25842 $
----------------------------------------------------------------------
*/
#ifndef SEGGER_RTT_H
#define SEGGER_RTT_H
#include "../Config/SEGGER_RTT_Conf.h"
/*********************************************************************
*
* Defines, defaults
*
**********************************************************************
*/
#ifndef RTT_USE_ASM
//
// Some cores support out-of-order memory accesses (reordering of memory accesses in the core)
// For such cores, we need to define a memory barrier to guarantee the order of certain accesses to the RTT ring buffers.
// Needed for:
// Cortex-M7 (ARMv7-M)
// Cortex-M23 (ARM-v8M)
// Cortex-M33 (ARM-v8M)
// Cortex-A/R (ARM-v7A/R)
//
// We do not explicitly check for "Embedded Studio" as the compiler in use determines what we support.
// You can use an external toolchain like IAR inside ES. So there is no point in checking for "Embedded Studio"
//
#if (defined __CROSSWORKS_ARM) // Rowley Crossworks
#define _CC_HAS_RTT_ASM_SUPPORT 1
#if (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined(__ARM_ARCH_8_1M_MAIN__)) // Cortex-M85
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#elif (defined __ARMCC_VERSION)
//
// ARM compiler
// ARM compiler V6.0 and later is clang based.
// Our ASM part is compatible to clang.
//
#if (__ARMCC_VERSION >= 6000000)
#define _CC_HAS_RTT_ASM_SUPPORT 1
#else
#define _CC_HAS_RTT_ASM_SUPPORT 0
#endif
#if (defined __ARM_ARCH_6M__) // Cortex-M0 / M1
#define _CORE_HAS_RTT_ASM_SUPPORT 0 // No ASM support for this architecture
#elif (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8_1M_MAIN__) // Cortex-M85
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#elif ((defined __GNUC__) || (defined __clang__))
//
// GCC / Clang
//
#define _CC_HAS_RTT_ASM_SUPPORT 1
// ARM 7/9: __ARM_ARCH_5__ / __ARM_ARCH_5E__ / __ARM_ARCH_5T__ / __ARM_ARCH_5T__ / __ARM_ARCH_5TE__
#if (defined __ARM_ARCH_7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#elif (defined __ARM_ARCH_7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1 // Only Cortex-M7 needs a DMB but we cannot distinguish M4 and M7 here...
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_BASE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8M_MAIN__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif (defined __ARM_ARCH_8_1M_MAIN__) // Cortex-M85
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#elif ((defined __ARM_ARCH_7A__) || (defined __ARM_ARCH_7R__)) // Cortex-A/R 32-bit ARMv7-A/R
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() __asm volatile ("dmb\n" : : :);
#else
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
#elif ((defined __IASMARM__) || (defined __ICCARM__))
//
// IAR assembler/compiler
//
#define _CC_HAS_RTT_ASM_SUPPORT 1
#if (__VER__ < 6300000)
#define VOLATILE
#else
#define VOLATILE volatile
#endif
#if (defined __ARM7M__) // Needed for old versions that do not know the define yet
#if (__CORE__ == __ARM7M__) // Cortex-M3
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#endif
#endif
#if (defined __ARM7EM__)
#if (__CORE__ == __ARM7EM__) // Cortex-M4/M7
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM8M_BASELINE__)
#if (__CORE__ == __ARM8M_BASELINE__) // Cortex-M23
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM8M_MAINLINE__)
#if (__CORE__ == __ARM8M_MAINLINE__) // Cortex-M33
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM8EM_MAINLINE__)
#if (__CORE__ == __ARM8EM_MAINLINE__) // Cortex-???
#define _CORE_HAS_RTT_ASM_SUPPORT 1
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM7A__)
#if (__CORE__ == __ARM7A__) // Cortex-A 32-bit ARMv7-A
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
#if (defined __ARM7R__)
#if (__CORE__ == __ARM7R__) // Cortex-R 32-bit ARMv7-R
#define _CORE_NEEDS_DMB 1
#define RTT__DMB() asm VOLATILE ("DMB");
#endif
#endif
// TBD: __ARM8A__ => Cortex-A 64-bit ARMv8-A
// TBD: __ARM8R__ => Cortex-R 64-bit ARMv8-R
#else
//
// Other compilers
//
#define _CC_HAS_RTT_ASM_SUPPORT 0
#define _CORE_HAS_RTT_ASM_SUPPORT 0
#endif
//
// If IDE and core support the ASM version, enable ASM version by default
//
#ifndef _CORE_HAS_RTT_ASM_SUPPORT
#define _CORE_HAS_RTT_ASM_SUPPORT 0 // Default for unknown cores
#endif
#if (_CC_HAS_RTT_ASM_SUPPORT && _CORE_HAS_RTT_ASM_SUPPORT)
#define RTT_USE_ASM (1)
#else
#define RTT_USE_ASM (0)
#endif
#endif
#ifndef _CORE_NEEDS_DMB
#define _CORE_NEEDS_DMB 0
#endif
#ifndef RTT__DMB
#if _CORE_NEEDS_DMB
#error "Don't know how to place inline assembly for DMB"
#else
#define RTT__DMB()
#endif
#endif
#ifndef SEGGER_RTT_CPU_CACHE_LINE_SIZE
#define SEGGER_RTT_CPU_CACHE_LINE_SIZE (0) // On most target systems where RTT is used, we do not have a CPU cache, therefore 0 is a good default here
#endif
#ifndef SEGGER_RTT_UNCACHED_OFF
#if SEGGER_RTT_CPU_CACHE_LINE_SIZE
#error "SEGGER_RTT_UNCACHED_OFF must be defined when setting SEGGER_RTT_CPU_CACHE_LINE_SIZE != 0"
#else
#define SEGGER_RTT_UNCACHED_OFF (0)
#endif
#endif
#if RTT_USE_ASM
#if SEGGER_RTT_CPU_CACHE_LINE_SIZE
#error "RTT_USE_ASM is not available if SEGGER_RTT_CPU_CACHE_LINE_SIZE != 0"
#endif
#endif
#ifndef SEGGER_RTT_ASM // defined when SEGGER_RTT.h is included from assembly file
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
/*********************************************************************
*
* Defines, fixed
*
**********************************************************************
*/
//
// Determine how much we must pad the control block to make it a multiple of a cache line in size
// Assuming: U8 = 1B
// U16 = 2B
// U32 = 4B
// U8/U16/U32* = 4B
//
#if SEGGER_RTT_CPU_CACHE_LINE_SIZE // Avoid division by zero in case we do not have any cache
#define SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(NumBytes) (((NumBytes + SEGGER_RTT_CPU_CACHE_LINE_SIZE - 1) / SEGGER_RTT_CPU_CACHE_LINE_SIZE) * SEGGER_RTT_CPU_CACHE_LINE_SIZE)
#else
#define SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(NumBytes) (NumBytes)
#endif
#define SEGGER_RTT__CB_SIZE (16 + 4 + 4 + (SEGGER_RTT_MAX_NUM_UP_BUFFERS * 24) + (SEGGER_RTT_MAX_NUM_DOWN_BUFFERS * 24))
#define SEGGER_RTT__CB_PADDING (SEGGER_RTT__ROUND_UP_2_CACHE_LINE_SIZE(SEGGER_RTT__CB_SIZE) - SEGGER_RTT__CB_SIZE)
/*********************************************************************
*
* Types
*
**********************************************************************
*/
//
// Description for a circular buffer (also called "ring buffer")
// which is used as up-buffer (T->H)
//
typedef struct {
const char* sName; // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
char* pBuffer; // Pointer to start of buffer
unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
unsigned WrOff; // Position of next item to be written by either target.
volatile unsigned RdOff; // Position of next item to be read by host. Must be volatile since it may be modified by host.
unsigned Flags; // Contains configuration flags. Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
} SEGGER_RTT_BUFFER_UP;
//
// Description for a circular buffer (also called "ring buffer")
// which is used as down-buffer (H->T)
//
typedef struct {
const char* sName; // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
char* pBuffer; // Pointer to start of buffer
unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
volatile unsigned WrOff; // Position of next item to be written by host. Must be volatile since it may be modified by host.
unsigned RdOff; // Position of next item to be read by target (down-buffer).
unsigned Flags; // Contains configuration flags. Flags[31:24] are used for validity check and must be zero. Flags[23:2] are reserved for future use. Flags[1:0] = RTT operating mode.
} SEGGER_RTT_BUFFER_DOWN;
//
// RTT control block which describes the number of buffers available
// as well as the configuration for each buffer
//
//
typedef struct {
char acID[16]; // Initialized to "SEGGER RTT"
int MaxNumUpBuffers; // Initialized to SEGGER_RTT_MAX_NUM_UP_BUFFERS (type. 2)
int MaxNumDownBuffers; // Initialized to SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (type. 2)
SEGGER_RTT_BUFFER_UP aUp[SEGGER_RTT_MAX_NUM_UP_BUFFERS]; // Up buffers, transferring information up from target via debug probe to host
SEGGER_RTT_BUFFER_DOWN aDown[SEGGER_RTT_MAX_NUM_DOWN_BUFFERS]; // Down buffers, transferring information down from host via debug probe to target
#if SEGGER_RTT__CB_PADDING
unsigned char aDummy[SEGGER_RTT__CB_PADDING];
#endif
} SEGGER_RTT_CB;
/*********************************************************************
*
* Global data
*
**********************************************************************
*/
extern SEGGER_RTT_CB _SEGGER_RTT;
/*********************************************************************
*
* RTT API functions
*
**********************************************************************
*/
#ifdef __cplusplus
extern "C" {
#endif
int SEGGER_RTT_AllocDownBuffer (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
int SEGGER_RTT_AllocUpBuffer (const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
int SEGGER_RTT_ConfigUpBuffer (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
int SEGGER_RTT_ConfigDownBuffer (unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags);
int SEGGER_RTT_GetKey (void);
unsigned SEGGER_RTT_HasData (unsigned BufferIndex);
int SEGGER_RTT_HasKey (void);
unsigned SEGGER_RTT_HasDataUp (unsigned BufferIndex);
void SEGGER_RTT_Init (void);
unsigned SEGGER_RTT_Read (unsigned BufferIndex, void* pBuffer, unsigned BufferSize);
unsigned SEGGER_RTT_ReadNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize);
int SEGGER_RTT_SetNameDownBuffer (unsigned BufferIndex, const char* sName);
int SEGGER_RTT_SetNameUpBuffer (unsigned BufferIndex, const char* sName);
int SEGGER_RTT_SetFlagsDownBuffer (unsigned BufferIndex, unsigned Flags);
int SEGGER_RTT_SetFlagsUpBuffer (unsigned BufferIndex, unsigned Flags);
int SEGGER_RTT_WaitKey (void);
unsigned SEGGER_RTT_Write (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
unsigned SEGGER_RTT_WriteNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
unsigned SEGGER_RTT_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
unsigned SEGGER_RTT_ASM_WriteSkipNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
unsigned SEGGER_RTT_WriteString (unsigned BufferIndex, const char* s);
void SEGGER_RTT_WriteWithOverwriteNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
unsigned SEGGER_RTT_PutChar (unsigned BufferIndex, char c);
unsigned SEGGER_RTT_PutCharSkip (unsigned BufferIndex, char c);
unsigned SEGGER_RTT_PutCharSkipNoLock (unsigned BufferIndex, char c);
unsigned SEGGER_RTT_GetAvailWriteSpace (unsigned BufferIndex);
unsigned SEGGER_RTT_GetBytesInBuffer (unsigned BufferIndex);
void SEGGER_RTT_ESP_FlushNoLock (unsigned long min_sz, unsigned long tmo);
void SEGGER_RTT_ESP_Flush (unsigned long min_sz, unsigned long tmo);
//
// Function macro for performance optimization
//
// @AGv: This macro is used inside SEGGER SystemView code.
// For ESP32 we use our own implementation of RTT, so this macro should not check SEGGER's RTT buffer state.
#define SEGGER_RTT_HASDATA(n) (1)
#if RTT_USE_ASM
#define SEGGER_RTT_WriteSkipNoLock SEGGER_RTT_ASM_WriteSkipNoLock
#endif
/*********************************************************************
*
* RTT transfer functions to send RTT data via other channels.
*
**********************************************************************
*/
unsigned SEGGER_RTT_ReadUpBuffer (unsigned BufferIndex, void* pBuffer, unsigned BufferSize);
unsigned SEGGER_RTT_ReadUpBufferNoLock (unsigned BufferIndex, void* pData, unsigned BufferSize);
unsigned SEGGER_RTT_WriteDownBuffer (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
unsigned SEGGER_RTT_WriteDownBufferNoLock (unsigned BufferIndex, const void* pBuffer, unsigned NumBytes);
#define SEGGER_RTT_HASDATA_UP(n) (((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->WrOff - ((SEGGER_RTT_BUFFER_UP*)((uintptr_t)&_SEGGER_RTT.aUp[n] + SEGGER_RTT_UNCACHED_OFF))->RdOff) // Access uncached to make sure we see changes made by the J-Link side and all of our changes go into HW directly
/*********************************************************************
*
* RTT "Terminal" API functions
*
**********************************************************************
*/
int SEGGER_RTT_SetTerminal (unsigned char TerminalId);
int SEGGER_RTT_TerminalOut (unsigned char TerminalId, const char* s);
/*********************************************************************
*
* RTT printf functions (require SEGGER_RTT_printf.c)
*
**********************************************************************
*/
int SEGGER_RTT_printf(unsigned BufferIndex, const char * sFormat, ...);
int SEGGER_RTT_vprintf(unsigned BufferIndex, const char * sFormat, va_list * pParamList);
#ifdef __cplusplus
}
#endif
#endif // ifndef(SEGGER_RTT_ASM)
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Operating modes. Define behavior if buffer is full (not enough space for entire message)
//
#define SEGGER_RTT_MODE_NO_BLOCK_SKIP (0) // Skip. Do not block, output nothing. (Default)
#define SEGGER_RTT_MODE_NO_BLOCK_TRIM (1) // Trim: Do not block, output as much as fits.
#define SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL (2) // Block: Wait until there is space in the buffer.
#define SEGGER_RTT_MODE_MASK (3)
//
// Control sequences, based on ANSI.
// Can be used to control color, and clear the screen
//
#define RTT_CTRL_RESET "\x1B[0m" // Reset to default colors
#define RTT_CTRL_CLEAR "\x1B[2J" // Clear screen, reposition cursor to top left
#define RTT_CTRL_TEXT_BLACK "\x1B[2;30m"
#define RTT_CTRL_TEXT_RED "\x1B[2;31m"
#define RTT_CTRL_TEXT_GREEN "\x1B[2;32m"
#define RTT_CTRL_TEXT_YELLOW "\x1B[2;33m"
#define RTT_CTRL_TEXT_BLUE "\x1B[2;34m"
#define RTT_CTRL_TEXT_MAGENTA "\x1B[2;35m"
#define RTT_CTRL_TEXT_CYAN "\x1B[2;36m"
#define RTT_CTRL_TEXT_WHITE "\x1B[2;37m"
#define RTT_CTRL_TEXT_BRIGHT_BLACK "\x1B[1;30m"
#define RTT_CTRL_TEXT_BRIGHT_RED "\x1B[1;31m"
#define RTT_CTRL_TEXT_BRIGHT_GREEN "\x1B[1;32m"
#define RTT_CTRL_TEXT_BRIGHT_YELLOW "\x1B[1;33m"
#define RTT_CTRL_TEXT_BRIGHT_BLUE "\x1B[1;34m"
#define RTT_CTRL_TEXT_BRIGHT_MAGENTA "\x1B[1;35m"
#define RTT_CTRL_TEXT_BRIGHT_CYAN "\x1B[1;36m"
#define RTT_CTRL_TEXT_BRIGHT_WHITE "\x1B[1;37m"
#define RTT_CTRL_BG_BLACK "\x1B[24;40m"
#define RTT_CTRL_BG_RED "\x1B[24;41m"
#define RTT_CTRL_BG_GREEN "\x1B[24;42m"
#define RTT_CTRL_BG_YELLOW "\x1B[24;43m"
#define RTT_CTRL_BG_BLUE "\x1B[24;44m"
#define RTT_CTRL_BG_MAGENTA "\x1B[24;45m"
#define RTT_CTRL_BG_CYAN "\x1B[24;46m"
#define RTT_CTRL_BG_WHITE "\x1B[24;47m"
#define RTT_CTRL_BG_BRIGHT_BLACK "\x1B[4;40m"
#define RTT_CTRL_BG_BRIGHT_RED "\x1B[4;41m"
#define RTT_CTRL_BG_BRIGHT_GREEN "\x1B[4;42m"
#define RTT_CTRL_BG_BRIGHT_YELLOW "\x1B[4;43m"
#define RTT_CTRL_BG_BRIGHT_BLUE "\x1B[4;44m"
#define RTT_CTRL_BG_BRIGHT_MAGENTA "\x1B[4;45m"
#define RTT_CTRL_BG_BRIGHT_CYAN "\x1B[4;46m"
#define RTT_CTRL_BG_BRIGHT_WHITE "\x1B[4;47m"
#endif
/*************************** End of file ****************************/

File diff suppressed because it is too large Load Diff

View File

@@ -1,436 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.56 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW.h
Purpose : System visualization API.
Revision: $Rev: 28768 $
*/
#ifndef SEGGER_SYSVIEW_H
#define SEGGER_SYSVIEW_H
/*********************************************************************
*
* #include Section
*
**********************************************************************
*/
#include "SEGGER.h"
#include "SEGGER_SYSVIEW_ConfDefaults.h"
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
*
* Defines, fixed
*
**********************************************************************
*/
#define SEGGER_SYSVIEW_MAJOR 3
#define SEGGER_SYSVIEW_MINOR 32
#define SEGGER_SYSVIEW_REV 0
#define SEGGER_SYSVIEW_VERSION ((SEGGER_SYSVIEW_MAJOR * 10000) + (SEGGER_SYSVIEW_MINOR * 100) + SEGGER_SYSVIEW_REV)
#define SEGGER_SYSVIEW_INFO_SIZE 9 // Minimum size, which has to be reserved for a packet. 1-2 byte of message type, 0-2 byte of payload length, 1-5 bytes of timestamp.
#define SEGGER_SYSVIEW_QUANTA_U32 5 // Maximum number of bytes to encode a U32, should be reserved for each 32-bit value in a packet.
#define SEGGER_SYSVIEW_LOG (0u)
#define SEGGER_SYSVIEW_WARNING (1u)
#define SEGGER_SYSVIEW_ERROR (2u)
#define SEGGER_SYSVIEW_FLAG_APPEND (1u << 6)
#define SEGGER_SYSVIEW_PREPARE_PACKET(p) (p) + 4
//
// SystemView events. First 32 IDs from 0 .. 31 are reserved for these
//
#define SYSVIEW_EVTID_NOP 0 // Dummy packet.
#define SYSVIEW_EVTID_OVERFLOW 1
#define SYSVIEW_EVTID_ISR_ENTER 2
#define SYSVIEW_EVTID_ISR_EXIT 3
#define SYSVIEW_EVTID_TASK_START_EXEC 4
#define SYSVIEW_EVTID_TASK_STOP_EXEC 5
#define SYSVIEW_EVTID_TASK_START_READY 6
#define SYSVIEW_EVTID_TASK_STOP_READY 7
#define SYSVIEW_EVTID_TASK_CREATE 8
#define SYSVIEW_EVTID_TASK_INFO 9
#define SYSVIEW_EVTID_TRACE_START 10
#define SYSVIEW_EVTID_TRACE_STOP 11
#define SYSVIEW_EVTID_SYSTIME_CYCLES 12
#define SYSVIEW_EVTID_SYSTIME_US 13
#define SYSVIEW_EVTID_SYSDESC 14
#define SYSVIEW_EVTID_MARK_START 15
#define SYSVIEW_EVTID_MARK_STOP 16
#define SYSVIEW_EVTID_IDLE 17
#define SYSVIEW_EVTID_ISR_TO_SCHEDULER 18
#define SYSVIEW_EVTID_TIMER_ENTER 19
#define SYSVIEW_EVTID_TIMER_EXIT 20
#define SYSVIEW_EVTID_STACK_INFO 21
#define SYSVIEW_EVTID_MODULEDESC 22
#define SYSVIEW_EVTID_DATA_SAMPLE 23
#define SYSVIEW_EVTID_INIT 24
#define SYSVIEW_EVTID_NAME_RESOURCE 25
#define SYSVIEW_EVTID_PRINT_FORMATTED 26
#define SYSVIEW_EVTID_NUMMODULES 27
#define SYSVIEW_EVTID_END_CALL 28
#define SYSVIEW_EVTID_TASK_TERMINATE 29
#define SYSVIEW_EVTID_EX 31
//
// SystemView extended events. Sent with ID 31.
//
#define SYSVIEW_EVTID_EX_MARK 0
#define SYSVIEW_EVTID_EX_NAME_MARKER 1
#define SYSVIEW_EVTID_EX_HEAP_DEFINE 2
#define SYSVIEW_EVTID_EX_HEAP_ALLOC 3
#define SYSVIEW_EVTID_EX_HEAP_ALLOC_EX 4
#define SYSVIEW_EVTID_EX_HEAP_FREE 5
#define SYSVIEW_EVTID_EX_REGISTER_DATA 6
//
// Event masks to disable/enable events
//
#define SYSVIEW_EVTMASK_NOP (1 << SYSVIEW_EVTID_NOP)
#define SYSVIEW_EVTMASK_OVERFLOW (1 << SYSVIEW_EVTID_OVERFLOW)
#define SYSVIEW_EVTMASK_ISR_ENTER (1 << SYSVIEW_EVTID_ISR_ENTER)
#define SYSVIEW_EVTMASK_ISR_EXIT (1 << SYSVIEW_EVTID_ISR_EXIT)
#define SYSVIEW_EVTMASK_TASK_START_EXEC (1 << SYSVIEW_EVTID_TASK_START_EXEC)
#define SYSVIEW_EVTMASK_TASK_STOP_EXEC (1 << SYSVIEW_EVTID_TASK_STOP_EXEC)
#define SYSVIEW_EVTMASK_TASK_START_READY (1 << SYSVIEW_EVTID_TASK_START_READY)
#define SYSVIEW_EVTMASK_TASK_STOP_READY (1 << SYSVIEW_EVTID_TASK_STOP_READY)
#define SYSVIEW_EVTMASK_TASK_CREATE (1 << SYSVIEW_EVTID_TASK_CREATE)
#define SYSVIEW_EVTMASK_TASK_INFO (1 << SYSVIEW_EVTID_TASK_INFO)
#define SYSVIEW_EVTMASK_TRACE_START (1 << SYSVIEW_EVTID_TRACE_START)
#define SYSVIEW_EVTMASK_TRACE_STOP (1 << SYSVIEW_EVTID_TRACE_STOP)
#define SYSVIEW_EVTMASK_SYSTIME_CYCLES (1 << SYSVIEW_EVTID_SYSTIME_CYCLES)
#define SYSVIEW_EVTMASK_SYSTIME_US (1 << SYSVIEW_EVTID_SYSTIME_US)
#define SYSVIEW_EVTMASK_SYSDESC (1 << SYSVIEW_EVTID_SYSDESC)
#define SYSVIEW_EVTMASK_USER_START (1 << SYSVIEW_EVTID_USER_START)
#define SYSVIEW_EVTMASK_USER_STOP (1 << SYSVIEW_EVTID_USER_STOP)
#define SYSVIEW_EVTMASK_IDLE (1 << SYSVIEW_EVTID_IDLE)
#define SYSVIEW_EVTMASK_ISR_TO_SCHEDULER (1 << SYSVIEW_EVTID_ISR_TO_SCHEDULER)
#define SYSVIEW_EVTMASK_TIMER_ENTER (1 << SYSVIEW_EVTID_TIMER_ENTER)
#define SYSVIEW_EVTMASK_TIMER_EXIT (1 << SYSVIEW_EVTID_TIMER_EXIT)
#define SYSVIEW_EVTMASK_STACK_INFO (1 << SYSVIEW_EVTID_STACK_INFO)
#define SYSVIEW_EVTMASK_MODULEDESC (1 << SYSVIEW_EVTID_MODULEDESC)
#define SYSVIEW_EVTMASK_DATA_SAMPLE (1 << SYSVIEW_EVTID_DATA_SAMPLE)
#define SYSVIEW_EVTMASK_INIT (1 << SYSVIEW_EVTID_INIT)
#define SYSVIEW_EVTMASK_NAME_RESOURCE (1 << SYSVIEW_EVTID_NAME_RESOURCE)
#define SYSVIEW_EVTMASK_PRINT_FORMATTED (1 << SYSVIEW_EVTID_PRINT_FORMATTED)
#define SYSVIEW_EVTMASK_NUMMODULES (1 << SYSVIEW_EVTID_NUMMODULES)
#define SYSVIEW_EVTMASK_END_CALL (1 << SYSVIEW_EVTID_END_CALL)
#define SYSVIEW_EVTMASK_TASK_TERMINATE (1 << SYSVIEW_EVTID_TASK_TERMINATE)
#define SYSVIEW_EVTMASK_EX (1 << SYSVIEW_EVTID_EX)
#define SYSVIEW_EVTMASK_ALL_INTERRUPTS ( SYSVIEW_EVTMASK_ISR_ENTER \
| SYSVIEW_EVTMASK_ISR_EXIT \
| SYSVIEW_EVTMASK_ISR_TO_SCHEDULER)
#define SYSVIEW_EVTMASK_ALL_TASKS ( SYSVIEW_EVTMASK_TASK_START_EXEC \
| SYSVIEW_EVTMASK_TASK_STOP_EXEC \
| SYSVIEW_EVTMASK_TASK_START_READY \
| SYSVIEW_EVTMASK_TASK_STOP_READY \
| SYSVIEW_EVTMASK_TASK_CREATE \
| SYSVIEW_EVTMASK_TASK_INFO \
| SYSVIEW_EVTMASK_STACK_INFO \
| SYSVIEW_EVTMASK_TASK_TERMINATE)
/*********************************************************************
*
* Structures
*
**********************************************************************
*/
typedef struct {
U32 TaskID;
const char* sName;
U32 Prio;
U32 StackBase;
U32 StackSize;
U32 StackUsage;
} SEGGER_SYSVIEW_TASKINFO;
typedef struct {
U32 TaskID;
U32 StackBase;
U32 StackSize;
U32 StackUsage;
} SEGGER_SYSVIEW_STACKINFO;
typedef struct {
U32 ID;
union {
U32* pU32_Value;
I32* pI32_Value;
float* pFloat_Value;
};
} SEGGER_SYSVIEW_DATA_SAMPLE;
typedef enum {
SEGGER_SYSVIEW_TYPE_U32 = 0,
SEGGER_SYSVIEW_TYPE_I32 = 1,
SEGGER_SYSVIEW_TYPE_FLOAT = 2
} SEGGER_SYSVIEW_DATA_TYPE;
typedef struct {
U32 ID;
SEGGER_SYSVIEW_DATA_TYPE DataType;
I32 Offset;
I32 RangeMin;
I32 RangeMax;
float ScalingFactor;
const char* sName;
const char* sUnit;
} SEGGER_SYSVIEW_DATA_REGISTER;
typedef struct SEGGER_SYSVIEW_MODULE_STRUCT SEGGER_SYSVIEW_MODULE;
struct SEGGER_SYSVIEW_MODULE_STRUCT {
const char* sModule;
U32 NumEvents;
U32 EventOffset;
void (*pfSendModuleDesc)(void);
SEGGER_SYSVIEW_MODULE* pNext;
};
typedef void (SEGGER_SYSVIEW_SEND_SYS_DESC_FUNC)(void);
/*********************************************************************
*
* Global data
*
**********************************************************************
*/
#ifdef EXTERN
#undef EXTERN
#endif
#ifndef SEGGER_SYSVIEW_C // Defined in SEGGER_SYSVIEW.c which includes this header beside other C-files
#define EXTERN extern
#else
#define EXTERN
#endif
EXTERN unsigned int SEGGER_SYSVIEW_TickCnt;
EXTERN unsigned int SEGGER_SYSVIEW_InterruptId;
#undef EXTERN
/*********************************************************************
*
* API functions
*
**********************************************************************
*/
typedef struct {
U64 (*pfGetTime) (void);
void (*pfSendTaskList) (void);
} SEGGER_SYSVIEW_OS_API;
/*********************************************************************
*
* Control and initialization functions
*/
void SEGGER_SYSVIEW_Init (U32 SysFreq, U32 CPUFreq, const SEGGER_SYSVIEW_OS_API *pOSAPI, SEGGER_SYSVIEW_SEND_SYS_DESC_FUNC pfSendSysDesc);
void SEGGER_SYSVIEW_SetRAMBase (U32 RAMBaseAddress);
void SEGGER_SYSVIEW_Start (void);
void SEGGER_SYSVIEW_Stop (void);
void SEGGER_SYSVIEW_GetSysDesc (void);
void SEGGER_SYSVIEW_SendTaskList (void);
void SEGGER_SYSVIEW_SendTaskInfo (const SEGGER_SYSVIEW_TASKINFO* pInfo);
void SEGGER_SYSVIEW_SendStackInfo (const SEGGER_SYSVIEW_STACKINFO* pInfo);
void SEGGER_SYSVIEW_SendSysDesc (const char* sSysDesc);
int SEGGER_SYSVIEW_IsStarted (void);
int SEGGER_SYSVIEW_GetChannelID (void);
void SEGGER_SYSVIEW_SampleData (const SEGGER_SYSVIEW_DATA_SAMPLE *pInfo);
// Checks whether tracing has been started
U8 SEGGER_SYSVIEW_Started(void);
/*********************************************************************
*
* Event recording functions
*/
void SEGGER_SYSVIEW_RecordVoid (unsigned int EventId);
void SEGGER_SYSVIEW_RecordU32 (unsigned int EventId, U32 Para0);
void SEGGER_SYSVIEW_RecordU32x2 (unsigned int EventId, U32 Para0, U32 Para1);
void SEGGER_SYSVIEW_RecordU32x3 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2);
void SEGGER_SYSVIEW_RecordU32x4 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3);
void SEGGER_SYSVIEW_RecordU32x5 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3, U32 Para4);
void SEGGER_SYSVIEW_RecordU32x6 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3, U32 Para4, U32 Para5);
void SEGGER_SYSVIEW_RecordU32x7 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3, U32 Para4, U32 Para5, U32 Para6);
void SEGGER_SYSVIEW_RecordU32x8 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3, U32 Para4, U32 Para5, U32 Para6, U32 Para7);
void SEGGER_SYSVIEW_RecordU32x9 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3, U32 Para4, U32 Para5, U32 Para6, U32 Para7, U32 Para8);
void SEGGER_SYSVIEW_RecordU32x10 (unsigned int EventId, U32 Para0, U32 Para1, U32 Para2, U32 Para3, U32 Para4, U32 Para5, U32 Para6, U32 Para7, U32 Para8, U32 Para9);
void SEGGER_SYSVIEW_RecordString (unsigned int EventId, const char* pString);
void SEGGER_SYSVIEW_RecordSystime (void);
void SEGGER_SYSVIEW_RecordEnterISR (U32 IrqId);
void SEGGER_SYSVIEW_RecordExitISR (void);
void SEGGER_SYSVIEW_RecordExitISRToScheduler (void);
void SEGGER_SYSVIEW_RecordEnterTimer (U32 TimerId);
void SEGGER_SYSVIEW_RecordExitTimer (void);
void SEGGER_SYSVIEW_RecordEndCall (unsigned int EventID);
void SEGGER_SYSVIEW_RecordEndCallU32 (unsigned int EventID, U32 Para0);
void SEGGER_SYSVIEW_OnIdle (void);
void SEGGER_SYSVIEW_OnTaskCreate (U32 TaskId);
void SEGGER_SYSVIEW_OnTaskTerminate (U32 TaskId);
void SEGGER_SYSVIEW_OnTaskStartExec (U32 TaskId);
void SEGGER_SYSVIEW_OnTaskStopExec (void);
void SEGGER_SYSVIEW_OnTaskStartReady (U32 TaskId);
void SEGGER_SYSVIEW_OnTaskStopReady (U32 TaskId, unsigned int Cause);
void SEGGER_SYSVIEW_MarkStart (unsigned int MarkerId);
void SEGGER_SYSVIEW_MarkStop (unsigned int MarkerId);
void SEGGER_SYSVIEW_Mark (unsigned int MarkerId);
void SEGGER_SYSVIEW_NameMarker (unsigned int MarkerId, const char* sName);
void SEGGER_SYSVIEW_HeapDefine (void* pHeap, void* pBase, unsigned int HeapSize, unsigned int MetadataSize);
void SEGGER_SYSVIEW_HeapAlloc (void* pHeap, void* pUserData, unsigned int UserDataLen);
void SEGGER_SYSVIEW_HeapAllocEx (void* pHeap, void* pUserData, unsigned int UserDataLen, unsigned int Tag);
void SEGGER_SYSVIEW_HeapFree (void* pHeap, void* pUserData);
void SEGGER_SYSVIEW_NameResource (U32 ResourceId, const char* sName);
void SEGGER_SYSVIEW_RegisterData ( SEGGER_SYSVIEW_DATA_REGISTER* pInfo);
int SEGGER_SYSVIEW_SendPacket (U8* pPacket, U8* pPayloadEnd, unsigned int EventId);
/*********************************************************************
*
* Event parameter encoding functions
*/
U8* SEGGER_SYSVIEW_EncodeU32 (U8* pPayload, U32 Value);
U8* SEGGER_SYSVIEW_EncodeData (U8* pPayload, const char* pSrc, unsigned int Len);
U8* SEGGER_SYSVIEW_EncodeString (U8* pPayload, const char* s, unsigned int MaxLen);
U8* SEGGER_SYSVIEW_EncodeId (U8* pPayload, U32 Id);
U32 SEGGER_SYSVIEW_ShrinkId (U32 Id);
/*********************************************************************
*
* Middleware module registration
*/
void SEGGER_SYSVIEW_RegisterModule (SEGGER_SYSVIEW_MODULE* pModule);
void SEGGER_SYSVIEW_RecordModuleDescription (const SEGGER_SYSVIEW_MODULE* pModule, const char* sDescription);
void SEGGER_SYSVIEW_SendModule (U8 ModuleId);
void SEGGER_SYSVIEW_SendModuleDescription (void);
void SEGGER_SYSVIEW_SendNumModules (void);
/*********************************************************************
*
* printf-Style functions
*/
#ifndef SEGGER_SYSVIEW_EXCLUDE_PRINTF // Define in project to avoid warnings about variable parameter list
void SEGGER_SYSVIEW_PrintfHostEx (const char* s, U32 Options, ...);
void SEGGER_SYSVIEW_VPrintfHostEx (const char* s, U32 Options, va_list* pParamList);
void SEGGER_SYSVIEW_PrintfTargetEx (const char* s, U32 Options, ...);
void SEGGER_SYSVIEW_VPrintfTargetEx (const char* s, U32 Options, va_list* pParamList);
void SEGGER_SYSVIEW_PrintfHost (const char* s, ...);
void SEGGER_SYSVIEW_VPrintfHost (const char* s, va_list* pParamList);
void SEGGER_SYSVIEW_PrintfTarget (const char* s, ...);
void SEGGER_SYSVIEW_VPrintfTarget (const char* s, va_list* pParamList);
void SEGGER_SYSVIEW_WarnfHost (const char* s, ...);
void SEGGER_SYSVIEW_VWarnfHost (const char* s, va_list* pParamList);
void SEGGER_SYSVIEW_WarnfTarget (const char* s, ...);
void SEGGER_SYSVIEW_VWarnfTarget (const char* s, va_list* pParamList);
void SEGGER_SYSVIEW_ErrorfHost (const char* s, ...);
void SEGGER_SYSVIEW_VErrorfHost (const char* s, va_list* pParamList);
void SEGGER_SYSVIEW_ErrorfTarget (const char* s, ...);
void SEGGER_SYSVIEW_VErrorfTarget (const char* s, va_list* pParamList);
#endif
void SEGGER_SYSVIEW_Print (const char* s);
void SEGGER_SYSVIEW_Warn (const char* s);
void SEGGER_SYSVIEW_Error (const char* s);
/*********************************************************************
*
* Run-time configuration functions
*/
void SEGGER_SYSVIEW_EnableEvents (U32 EnableMask);
void SEGGER_SYSVIEW_DisableEvents (U32 DisableMask);
/*********************************************************************
*
* Application-provided functions
*/
void SEGGER_SYSVIEW_Conf (void);
U32 SEGGER_SYSVIEW_X_GetTimestamp (void);
U32 SEGGER_SYSVIEW_X_GetInterruptId (void);
void SEGGER_SYSVIEW_X_StartComm (void);
void SEGGER_SYSVIEW_X_OnEventRecorded (unsigned NumBytes);
#ifdef __cplusplus
}
#endif
/*********************************************************************
*
* Compatibility API defines
*/
#define SEGGER_SYSVIEW_OnUserStart SEGGER_SYSVIEW_MarkStart
#define SEGGER_SYSVIEW_OnUserStop SEGGER_SYSVIEW_MarkStop
#endif
/*************************** End of file ****************************/

View File

@@ -1,592 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2023-2024 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.56 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_ConfDefaults.h
Purpose : Defines defaults for configurable defines used in
SEGGER SystemView.
Revision: $Rev: 26230 $
*/
#ifndef SEGGER_SYSVIEW_CONFDEFAULTS_H
#define SEGGER_SYSVIEW_CONFDEFAULTS_H
/*********************************************************************
*
* #include Section
*
**********************************************************************
*/
#include "SEGGER_SYSVIEW_Conf.h"
#include "SEGGER_RTT_Conf.h"
#include "esp_assert.h"
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
*
* Defines, fixed
*
**********************************************************************
*/
//
// Use auto-detection for SEGGER_SYSVIEW_CORE define
// based on compiler-/toolchain-specific defines
// to define SEGGER_SYSVIEW_GET_INTERRUPT_ID and SEGGER_SYSVIEW_GET_TIMESTAMP
//
#define SEGGER_SYSVIEW_CORE_OTHER 0
#define SEGGER_SYSVIEW_CORE_CM0 1 // Cortex-M0/M0+/M1
#define SEGGER_SYSVIEW_CORE_CM3 2 // Cortex-M3/M4/M7
#define SEGGER_SYSVIEW_CORE_RX 3 // Renesas RX
#ifndef SEGGER_SYSVIEW_CORE
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __SEGGER_CC__) || (defined __GNUC__) || (defined __clang__)
#if (defined __ARM_ARCH_6M__) || (defined __ARM_ARCH_8M_BASE__)
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
#elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__))
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
#endif
#elif defined(__ICCARM__)
#if (defined (__ARM6M__) && (__CORE__ == __ARM6M__)) \
|| (defined (__ARM8M_BASELINE__) && (__CORE__ == __ARM8M_BASELINE__))
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
#elif (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)) \
|| (defined (__ARM7M__) && (__CORE__ == __ARM7M__)) \
|| (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__)) \
|| (defined (__ARM8M_MAINLINE__) && (__CORE__ == __ARM8M_MAINLINE__))
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
#endif
#elif defined(__CC_ARM)
#if (defined(__TARGET_ARCH_6S_M))
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
#elif (defined(__TARGET_ARCH_7_M) || defined(__TARGET_ARCH_7E_M))
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
#endif
#elif defined(__TI_ARM__)
#ifdef __TI_ARM_V6M0__
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM0
#elif (defined(__TI_ARM_V7M3__) || defined(__TI_ARM_V7M4__))
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_CM3
#endif
#elif defined(__ICCRX__)
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
#elif defined(__RX)
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_RX
#endif
#ifndef SEGGER_SYSVIEW_CORE
#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_OTHER
#endif
#endif
/*********************************************************************
*
* Defines, defaults
*
**********************************************************************
*/
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_APP_NAME
*
* Description
* The application name to be displayed in SystemView.
* Default
* "SystemView-enabled Application"
* Notes
* Convenience define to be used for SEGGER_SYSVIEW_SendSysDesc().
*/
#ifndef SEGGER_SYSVIEW_APP_NAME
#define SEGGER_SYSVIEW_APP_NAME "SystemView-enabled Application"
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_DEVICE_NAME
*
* Description
* The target device name to be displayed in SystemView.
* Default
* "undefined device"
* Notes
* Convenience define to be used for SEGGER_SYSVIEW_SendSysDesc().
*/
#ifndef SEGGER_SYSVIEW_DEVICE_NAME
#define SEGGER_SYSVIEW_DEVICE_NAME "undefined device"
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_GET_INTERRUPT_ID()
*
* Description
* Function macro to retrieve the Id of the currently active
* interrupt.
* Default
* Call user-supplied function SEGGER_SYSVIEW_X_GetInterruptId().
* Notes
* For some known compilers and cores, a ready-to-use, core-specific
* default is set.
* ARMv7M: Read ICSR[8:0] (active vector)
* ARMv6M: Read ICSR[5:0] (active vector)
*/
#ifndef SEGGER_SYSVIEW_GET_INTERRUPT_ID
#if SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32*)(0xE000ED04)) & 0x1FF) // Get the currently active interrupt Id. (i.e. read Cortex-M ICSR[8:0] = active vector)
#elif SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM0
#if defined(__ICCARM__)
#if (__VER__ > 6010000)
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() (__get_IPSR()) // Workaround for IAR, which might do a byte-access to 0xE000ED04. Read IPSR instead.
#else
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32*)(0xE000ED04)) & 0x3F) // Older versions of IAR do not include __get_IPSR, but might also not optimize to byte-access.
#endif
#else
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() ((*(U32*)(0xE000ED04)) & 0x3F) // Get the currently active interrupt Id. (i.e. read Cortex-M ICSR[5:0] = active vector)
#endif
#else
#define SEGGER_SYSVIEW_GET_INTERRUPT_ID() SEGGER_SYSVIEW_X_GetInterruptId() // Get the currently active interrupt Id from the user-provided function.
#endif
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_GET_TIMESTAMP()
*
* Description
* Function macro to retrieve a system timestamp for SYSVIEW events.
* Default
* Call user-supplied function SEGGER_SYSVIEW_X_GetTimestamp().
* Notes
* For some known compilers and cores, a ready-to-use, core-specific
* default is set.
* ARMv7M: Read Cortex-M Cycle Count register.
*
* The system timestamp clock frequency has to be passed in
* SEGGER_SYSVIEW_Init().
*/
#ifndef SEGGER_SYSVIEW_GET_TIMESTAMP
#if defined (SEGGER_SYSVIEW_CORE) && (SEGGER_SYSVIEW_CORE == SEGGER_SYSVIEW_CORE_CM3)
#define SEGGER_SYSVIEW_GET_TIMESTAMP() (*(U32 *)(0xE0001004)) // Retrieve a system timestamp. Cortex-M cycle counter.
#else
#define SEGGER_SYSVIEW_GET_TIMESTAMP() SEGGER_SYSVIEW_X_GetTimestamp() // Retrieve a system timestamp via user-defined function
#endif
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_TIMESTAMP_BITS
*
* Description
* Number of valid (low-order) bits delivered in system timestamp.
* Default
* 32
* Notes
* Value has to match system timestamp clock source.
*/
// Define number of valid bits low-order delivered by clock source.
#ifndef SEGGER_SYSVIEW_TIMESTAMP_BITS
#define SEGGER_SYSVIEW_TIMESTAMP_BITS 32
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_RTT_CHANNEL
*
* Description
* The RTT channel that SystemView will use.
* Default
* 0: Auto selection.
* Notes
* Value has to be lower than SEGGER_RTT_MAX_NUM_UP_BUFFERS.
*/
#ifndef SEGGER_SYSVIEW_RTT_CHANNEL
#define SEGGER_SYSVIEW_RTT_CHANNEL 1
#endif
// Sanity check of RTT channel
#if (SEGGER_SYSVIEW_RTT_CHANNEL == 0) && (SEGGER_RTT_MAX_NUM_UP_BUFFERS < 2)
#error "SEGGER_RTT_MAX_NUM_UP_BUFFERS in SEGGER_RTT_Conf.h has to be > 1!"
#elif (SEGGER_SYSVIEW_RTT_CHANNEL >= SEGGER_RTT_MAX_NUM_UP_BUFFERS)
#error "SEGGER_RTT_MAX_NUM_UP_BUFFERS in SEGGER_RTT_Conf.h has to be > SEGGER_SYSVIEW_RTT_CHANNEL!"
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_RTT_BUFFER_SIZE
*
* Description
* Number of bytes that SystemView uses for the RTT buffer.
* Default
* 1024
*/
#ifndef SEGGER_SYSVIEW_RTT_BUFFER_SIZE
#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE 1024
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_SECTION
*
* Description
* Section to place the SystemView RTT Buffer into.
* Default
* undefined: Do not place into a specific section.
* Notes
* If SEGGER_RTT_SECTION is defined, the default changes to use
* this section for the SystemView RTT Buffer, too.
*/
#if !(defined SEGGER_SYSVIEW_SECTION) && (defined SEGGER_RTT_SECTION)
#define SEGGER_SYSVIEW_SECTION SEGGER_RTT_SECTION
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE
*
* Description
* Largest cache line size (in bytes) in the target system.
* Default
* 0
* Notes
* Required in systems with caches to make sure that the SystemView
* RTT buffer can be aligned accordingly.
*/
#ifndef SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE
#define SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_ID_BASE
*
* Description
* Lowest Id reported by the application.
* Default
* 0
* Notes
* Value is usually subtracted from mailboxes, semaphores, tasks,
* .... addresses, to compress event parameters.
* Should be the lowest RAM address of the system.
*/
#ifndef SEGGER_SYSVIEW_ID_BASE
#define SEGGER_SYSVIEW_ID_BASE 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_ID_SHIFT
*
* Description
* Number of bits to shift Ids.
* Default
* 0
* Notes
* Ids are shifted to compress event parameters.
* Should match the alignment of Ids (addresses),
* e.g. 2 when Ids are 4 byte aligned.
*/
#ifndef SEGGER_SYSVIEW_ID_SHIFT
#define SEGGER_SYSVIEW_ID_SHIFT 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_MAX_ARGUMENTS
*
* Description
* Maximum number of arguments which are handled with SystemView
* print routines or may be encoded in one recording function.
* routines.
* Default
* 16
*/
#ifndef SEGGER_SYSVIEW_MAX_ARGUMENTS
#define SEGGER_SYSVIEW_MAX_ARGUMENTS 16
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_MAX_STRING_LEN
*
* Description
* Maximum string length which can be used in SystemView print and
* system description routines.
* Default
* 128
*/
#ifndef SEGGER_SYSVIEW_MAX_STRING_LEN
#define SEGGER_SYSVIEW_MAX_STRING_LEN 128
#endif
ESP_STATIC_ASSERT(SEGGER_SYSVIEW_MAX_STRING_LEN < 255, "SEGGER Sysview string length must be less than 255.");
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_ID
*
* Description
* It set, support encoding Evend Ids longer than 14 bit.
* Default
* 1
*/
#ifndef SEGGER_SYSVIEW_SUPPORT_LONG_ID
#define SEGGER_SYSVIEW_SUPPORT_LONG_ID 1
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_SUPPORT_LONG_DATA
*
* Description
* It set, support encoding event data longer than 14 bit.
* Default
* 0
*/
#ifndef SEGGER_SYSVIEW_SUPPORT_LONG_DATA
#define SEGGER_SYSVIEW_SUPPORT_LONG_DATA 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
*
* Description
* If enabled, on SEGGER_SYSVIEW_PrintHost, check the format string
* and if it includes unsupported formatters, use formatting on the
* target instead.
* Default
* 0: Disabled.
*/
#ifndef SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT
#define SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_USE_INTERNAL_RECORDER
*
* Description
* If set, an internal recorder, such as UART or IP is used.
* Default
* 0: Disabled.
* Notes
* Convenience define to be used by SEGGER_SYSVIEW_Conf(),
* such as in embOS configuration to enable Cortex-M cycle counter.
*/
#ifndef SEGGER_SYSVIEW_USE_INTERNAL_RECORDER
#define SEGGER_SYSVIEW_USE_INTERNAL_RECORDER 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_CAN_RESTART
*
* Description
* If enabled, send the SystemView start sequence on every start
* command, not just on the first one.
* Enables restart when SystemView disconnected unexpectedly.
* Default
* 1: Enabled
*/
#ifndef SEGGER_SYSVIEW_CAN_RESTART
#define SEGGER_SYSVIEW_CAN_RESTART 1
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_START_ON_INIT
*
* Description
* Enable calling SEGGER_SYSVIEW_Start() after initialization.
* Default
* 0: Disabled.
* Notes
* Convenience define to be used by SEGGER_SYSVIEW_Conf(),
* such as in embOS configuration.
*/
#ifndef SEGGER_SYSVIEW_START_ON_INIT
#define SEGGER_SYSVIEW_START_ON_INIT 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_USE_STATIC_BUFFER
*
* Description
* If enabled, use a static buffer instead of a buffer on the stack
* for SystemView event packets.
* Default
* 1: Enabled.
* Notes
* If enabled, the static memory use by SystemView is increased by
* the maximum packet size. SystemView is locked on entry of a
* recording function.
* If disabled, the stack usage by SystemView recording functions
* might be increased by up to the maximum packet size. SystemView
* is locked when writing the packet to the RTT buffer.
*/
#ifndef SEGGER_SYSVIEW_USE_STATIC_BUFFER
#define SEGGER_SYSVIEW_USE_STATIC_BUFFER 1
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_MAX_PACKET_SIZE
*
* Description
* Maximum packet size for a SystemView event.
* Default
* Automatically calculated.
* Notes
* The maximum packet size is mainly defined by the maximum string
* length and the maximum number of arguments.
*/
#ifndef SEGGER_SYSVIEW_MAX_PACKET_SIZE
#define SEGGER_SYSVIEW_MAX_PACKET_SIZE (SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_MAX_STRING_LEN + 2 * SEGGER_SYSVIEW_QUANTA_U32 + SEGGER_SYSVIEW_MAX_ARGUMENTS * SEGGER_SYSVIEW_QUANTA_U32)
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_POST_MORTEM_MODE
*
* Description
* If enabled, SystemView records for post-mortem analysis instead
* of real-time analysis.
* Default
* 0: Disabled.
* Notes
* For more information refer to
* https://www.segger.com/products/development-tools/systemview/technology/post-mortem-mode
*/
#ifndef SEGGER_SYSVIEW_POST_MORTEM_MODE
#define SEGGER_SYSVIEW_POST_MORTEM_MODE 0
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
*
* Description
* Configure how frequently synchronization is sent in post-mortem
* mode.
* Default
* 8: (1 << 8) = Every 256 Events.
* Notes
* In post-mortem mode, at least one sync has to be in the RTT buffer.
* Recommended sync frequency: Buffer Size / 16
* For more information refer to
* https://www.segger.com/products/development-tools/systemview/technology/post-mortem-mode
*/
#ifndef SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT
#define SEGGER_SYSVIEW_SYNC_PERIOD_SHIFT 8
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_ON_EVENT_RECORDED()
*
* Description
* Function macro to notify recorder about a new event in buffer.
* Default
* undefined: Do not notify recorder.
* Notes
* Used for non-J-Link recorder,
* such as to enable transmission via UART or notify IP task.
*/
#ifndef SEGGER_SYSVIEW_ON_EVENT_RECORDED
#define SEGGER_SYSVIEW_ON_EVENT_RECORDED(NumBytes)
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_LOCK()
*
* Description
* Function macro to (nestable) lock SystemView recording.
* Default
* Use RTT Locking mechanism (defined by SEGGER_RTT_LOCK()).
* Notes
* If SystemView recording is not locked, recording events from
* interrupts and tasks may lead to unpredictable, undefined, event
* data.
*/
#ifndef SEGGER_SYSVIEW_LOCK
unsigned SEGGER_SYSVIEW_X_SysView_Lock(void);
#define SEGGER_SYSVIEW_LOCK() unsigned _SYSVIEW_int_state = SEGGER_SYSVIEW_X_SysView_Lock()
#endif
/*********************************************************************
*
* Define: SEGGER_SYSVIEW_UNLOCK
*
* Description
* Function macro to unlock SystemView recording.
* Default
* Use RTT Unlocking mechanism (defined by SEGGER_RTT_UNLOCK()).
*/
#ifndef SEGGER_SYSVIEW_UNLOCK
void SEGGER_SYSVIEW_X_SysView_Unlock(unsigned int_state);
#define SEGGER_SYSVIEW_UNLOCK() SEGGER_SYSVIEW_X_SysView_Unlock(_SYSVIEW_int_state)
#endif
#ifdef __cplusplus
}
#endif
#endif
/*************************** End of file ****************************/

View File

@@ -1,104 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2024 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.56 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_Int.h
Purpose : SEGGER SystemView internal header.
Revision: $Rev: 21281 $
*/
#ifndef SEGGER_SYSVIEW_INT_H
#define SEGGER_SYSVIEW_INT_H
/*********************************************************************
*
* #include Section
*
**********************************************************************
*/
#include "SEGGER_SYSVIEW.h"
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************
*
* Private data types
*
**********************************************************************
*/
//
// Commands that Host can send to target
//
typedef enum {
SEGGER_SYSVIEW_COMMAND_ID_START = 1,
SEGGER_SYSVIEW_COMMAND_ID_STOP,
SEGGER_SYSVIEW_COMMAND_ID_GET_SYSTIME,
SEGGER_SYSVIEW_COMMAND_ID_GET_TASKLIST,
SEGGER_SYSVIEW_COMMAND_ID_GET_SYSDESC,
SEGGER_SYSVIEW_COMMAND_ID_GET_NUMMODULES,
SEGGER_SYSVIEW_COMMAND_ID_GET_MODULEDESC,
SEGGER_SYSVIEW_COMMAND_ID_HEARTBEAT = 127,
// Extended commands: Commands >= 128 have a second parameter
SEGGER_SYSVIEW_COMMAND_ID_GET_MODULE = 128
} SEGGER_SYSVIEW_COMMAND_ID;
#ifdef __cplusplus
}
#endif
#endif
/*************************** End of file ****************************/

View File

@@ -1,6 +0,0 @@
name: 'SystemView'
version: '3.56'
cpe: cpe:2.3:a:segger:systemview:{}:*:*:*:*:*:*:*
supplier: 'Organization: Espressif Systems (Shanghai) CO LTD'
originator: 'Organization: SEGGER Microcontroller GmbH'
description: Real-time recording and visualization tool for embedded systems.

View File

@@ -1,285 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2017-2024 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.42 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_Config_FreeRTOS.c
Purpose : Sample setup configuration of SystemView with FreeRTOS.
Revision: $Rev: 7745 $
*/
#include <string.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "SEGGER_SYSVIEW.h"
#include "esp_app_trace.h"
#include "esp_app_trace_util.h"
#include "esp_intr_alloc.h"
#include "esp_cpu.h"
#include "soc/soc.h"
#include "soc/interrupts.h"
#include "esp_private/esp_clk.h"
extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
// The application name to be displayed in SystemViewer
#define SYSVIEW_APP_NAME "FreeRTOS Application"
// The target device name
#define SYSVIEW_DEVICE_NAME CONFIG_IDF_TARGET
// The target core name
#if CONFIG_IDF_TARGET_ARCH_XTENSA
#define SYSVIEW_CORE_NAME "xtensa"
#elif CONFIG_IDF_TARGET_ARCH_RISCV
#define SYSVIEW_CORE_NAME "riscv"
#endif
// Determine which timer to use as timestamp source
#if CONFIG_APPTRACE_SV_TS_SOURCE_CCOUNT
#define TS_USE_CCOUNT 1
#elif CONFIG_APPTRACE_SV_TS_SOURCE_ESP_TIMER
#define TS_USE_ESP_TIMER 1
#else
#define TS_USE_TIMERGROUP 1
#endif
#if TS_USE_TIMERGROUP
#include "driver/gptimer.h"
// Timer group timer divisor
#define SYSVIEW_TIMER_DIV 2
// Frequency of the timestamp, using APB as GPTimer source clock
#define SYSVIEW_TIMESTAMP_FREQ (esp_clk_apb_freq() / SYSVIEW_TIMER_DIV)
// GPTimer handle
gptimer_handle_t s_sv_gptimer;
#endif // TS_USE_TIMERGROUP
#if TS_USE_ESP_TIMER
// esp_timer provides 1us resolution
#define SYSVIEW_TIMESTAMP_FREQ (1000000)
#endif // TS_USE_ESP_TIMER
#if TS_USE_CCOUNT
// CCOUNT is incremented at CPU frequency
#define SYSVIEW_TIMESTAMP_FREQ (CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ * 1000000)
#endif // TS_USE_CCOUNT
// System Frequency.
#define SYSVIEW_CPU_FREQ (esp_clk_cpu_freq())
// The lowest RAM address used for IDs (pointers)
#define SYSVIEW_RAM_BASE (SOC_DROM_LOW)
#ifdef CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER
#if CONFIG_FREERTOS_CORETIMER_0
#define SYSTICK_INTR_ID (ETS_INTERNAL_TIMER0_INTR_SOURCE+ETS_INTERNAL_INTR_SOURCE_OFF)
#endif
#if CONFIG_FREERTOS_CORETIMER_1
#define SYSTICK_INTR_ID (ETS_INTERNAL_TIMER1_INTR_SOURCE+ETS_INTERNAL_INTR_SOURCE_OFF)
#endif
#elif CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER
#define SYSTICK_INTR_ID (ETS_SYSTIMER_TARGET0_INTR_SOURCE)
#endif // CONFIG_FREERTOS_TICK_SUPPORT_CORETIMER
// SystemView is single core specific: it implies that SEGGER_SYSVIEW_LOCK()
// disables IRQs (disables rescheduling globally). So we can not use finite timeouts for locks and return error
// in case of expiration, because error will not be handled and SEGGER's code will go further implying that
// everything is fine, so for multi-core env we have to wait on underlying lock forever
#define SEGGER_LOCK_WAIT_TMO ESP_APPTRACE_TMO_INFINITE
static esp_apptrace_lock_t s_sys_view_lock = {.mux = portMUX_INITIALIZER_UNLOCKED, .int_state = 0};
/*********************************************************************
*
* _cbSendSystemDesc()
*
* Function description
* Sends SystemView description strings.
*/
static void _cbSendSystemDesc(void) {
char irq_str[32] = "I#";
SEGGER_SYSVIEW_SendSysDesc("N="SYSVIEW_APP_NAME",D="SYSVIEW_DEVICE_NAME",C="SYSVIEW_CORE_NAME",O=FreeRTOS");
strcat(itoa(SYSTICK_INTR_ID, irq_str + 2, 10), "=SysTick");
SEGGER_SYSVIEW_SendSysDesc(irq_str);
size_t isr_count = sizeof(esp_isr_names)/sizeof(esp_isr_names[0]);
for (size_t i = 0; i < isr_count; ++i) {
if (esp_isr_names[i] == NULL || (ETS_INTERNAL_INTR_SOURCE_OFF + i) == SYSTICK_INTR_ID)
continue;
strcat(itoa(ETS_INTERNAL_INTR_SOURCE_OFF + i, irq_str + 2, 10), "=");
strncat(irq_str, esp_isr_names[i], sizeof(irq_str) - strlen(irq_str) - 1);
SEGGER_SYSVIEW_SendSysDesc(irq_str);
}
}
/*********************************************************************
*
* Global functions
*
**********************************************************************
*/
static void SEGGER_SYSVIEW_TS_Init(void)
{
/* We only need to initialize something if we use Timer Group.
* esp_timer and ccount can be used as is.
*/
#if TS_USE_TIMERGROUP
gptimer_config_t config = {
.clk_src = GPTIMER_CLK_SRC_DEFAULT,
.direction = GPTIMER_COUNT_UP,
.resolution_hz = SYSVIEW_TIMESTAMP_FREQ,
};
// pick any free GPTimer instance
ESP_ERROR_CHECK(gptimer_new_timer(&config, &s_sv_gptimer));
/* Start counting */
gptimer_enable(s_sv_gptimer);
gptimer_start(s_sv_gptimer);
#endif // TS_USE_TIMERGROUP
}
void SEGGER_SYSVIEW_Conf(void) {
U32 disable_evts = 0;
SEGGER_SYSVIEW_TS_Init();
SEGGER_SYSVIEW_Init(SYSVIEW_TIMESTAMP_FREQ, SYSVIEW_CPU_FREQ,
&SYSVIEW_X_OS_TraceAPI, _cbSendSystemDesc);
SEGGER_SYSVIEW_SetRAMBase(SYSVIEW_RAM_BASE);
#if !CONFIG_APPTRACE_SV_EVT_OVERFLOW_ENABLE
disable_evts |= SYSVIEW_EVTMASK_OVERFLOW;
#endif
#if !CONFIG_APPTRACE_SV_EVT_ISR_ENTER_ENABLE
disable_evts |= SYSVIEW_EVTMASK_ISR_ENTER;
#endif
#if !CONFIG_APPTRACE_SV_EVT_ISR_EXIT_ENABLE
disable_evts |= SYSVIEW_EVTMASK_ISR_EXIT;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TASK_START_EXEC_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TASK_START_EXEC;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TASK_STOP_EXEC_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TASK_STOP_EXEC;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TASK_START_READY_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TASK_START_READY;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TASK_STOP_READY_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TASK_STOP_READY;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TASK_CREATE_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TASK_CREATE;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TASK_TERMINATE_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TASK_TERMINATE;
#endif
#if !CONFIG_APPTRACE_SV_EVT_IDLE_ENABLE
disable_evts |= SYSVIEW_EVTMASK_IDLE;
#endif
#if !CONFIG_APPTRACE_SV_EVT_ISR_TO_SCHED_ENABLE
disable_evts |= SYSVIEW_EVTMASK_ISR_TO_SCHEDULER;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TIMER_ENTER_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TIMER_ENTER;
#endif
#if !CONFIG_APPTRACE_SV_EVT_TIMER_EXIT_ENABLE
disable_evts |= SYSVIEW_EVTMASK_TIMER_EXIT;
#endif
SEGGER_SYSVIEW_DisableEvents(disable_evts);
}
U32 SEGGER_SYSVIEW_X_GetTimestamp(void)
{
#if TS_USE_TIMERGROUP
uint64_t ts = 0;
gptimer_get_raw_count(s_sv_gptimer, &ts);
return (U32) ts; // return lower part of counter value
#elif TS_USE_CCOUNT
return esp_cpu_get_cycle_count();
#elif TS_USE_ESP_TIMER
return (U32) esp_timer_get_time(); // return lower part of counter value
#endif
}
void SEGGER_SYSVIEW_X_RTT_Lock(void)
{
}
void SEGGER_SYSVIEW_X_RTT_Unlock(void)
{
}
unsigned SEGGER_SYSVIEW_X_SysView_Lock(void)
{
esp_apptrace_tmo_t tmo;
esp_apptrace_tmo_init(&tmo, SEGGER_LOCK_WAIT_TMO);
esp_apptrace_lock_take(&s_sys_view_lock, &tmo);
// to be recursive save IRQ status on the stack of the caller to keep it from overwriting
return s_sys_view_lock.int_state;
}
void SEGGER_SYSVIEW_X_SysView_Unlock(unsigned int_state)
{
s_sys_view_lock.int_state = int_state;
esp_apptrace_lock_give(&s_sys_view_lock);
}
/*************************** End of file ****************************/

View File

@@ -1,270 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.42 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_FreeRTOS.c
Purpose : Interface between FreeRTOS and SystemView.
Revision: $Rev: 7947 $
*/
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "SEGGER_SYSVIEW.h"
#include "SEGGER_SYSVIEW_FreeRTOS.h"
#include "string.h" // Required for memset
typedef struct SYSVIEW_FREERTOS_TASK_STATUS SYSVIEW_FREERTOS_TASK_STATUS;
struct SYSVIEW_FREERTOS_TASK_STATUS {
U32 xHandle;
const char* pcTaskName;
unsigned uxCurrentPriority;
U32 pxStack;
unsigned uStackHighWaterMark;
};
static SYSVIEW_FREERTOS_TASK_STATUS _aTasks[SYSVIEW_FREERTOS_MAX_NOF_TASKS];
static unsigned _NumTasks;
/*********************************************************************
*
* _cbSendTaskList()
*
* Function description
* This function is part of the link between FreeRTOS and SYSVIEW.
* Called from SystemView when asked by the host, it uses SYSVIEW
* functions to send the entire task list to the host.
*/
static void _cbSendTaskList(void) {
unsigned n;
for (n = 0; n < _NumTasks; n++) {
#if INCLUDE_uxTaskGetStackHighWaterMark // Report Task Stack High Watermark
_aTasks[n].uStackHighWaterMark = uxTaskGetStackHighWaterMark((TaskHandle_t)_aTasks[n].xHandle);
#endif
SYSVIEW_SendTaskInfo((U32)_aTasks[n].xHandle, _aTasks[n].pcTaskName, (unsigned)_aTasks[n].uxCurrentPriority, (U32)_aTasks[n].pxStack, (unsigned)_aTasks[n].uStackHighWaterMark);
}
}
/*********************************************************************
*
* _cbGetTime()
*
* Function description
* This function is part of the link between FreeRTOS and SYSVIEW.
* Called from SystemView when asked by the host, returns the
* current system time in micro seconds.
*/
__attribute__((unused)) static U64 _cbGetTime(void) {
U64 Time;
Time = xTaskGetTickCountFromISR();
Time *= portTICK_PERIOD_MS;
Time *= 1000;
return Time;
}
/*********************************************************************
*
* Global functions
*
**********************************************************************
*/
/*********************************************************************
*
* SYSVIEW_AddTask()
*
* Function description
* Add a task to the internal list and record its information.
*/
void SYSVIEW_AddTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
/* On multi-core we have several idle tasks with 'IDLEx' names
Not best solution, because we can filter out user tasks starting with 'IDLE'.
But we can not use 'xTaskGetIdleTaskHandle' because at the moment when this
function is called array of idle tasks handles are not initialized yet. */
if (memcmp(pcTaskName, "IDLE", 4) == 0) {
return;
}
if (_NumTasks >= SYSVIEW_FREERTOS_MAX_NOF_TASKS) {
SEGGER_SYSVIEW_Warn("SYSTEMVIEW: Could not record task information. Maximum number of tasks reached.");
return;
}
_aTasks[_NumTasks].xHandle = xHandle;
_aTasks[_NumTasks].pcTaskName = pcTaskName;
_aTasks[_NumTasks].uxCurrentPriority = uxCurrentPriority;
_aTasks[_NumTasks].pxStack = pxStack;
_aTasks[_NumTasks].uStackHighWaterMark = uStackHighWaterMark;
_NumTasks++;
SYSVIEW_SendTaskInfo(xHandle, pcTaskName,uxCurrentPriority, pxStack, uStackHighWaterMark);
}
/*********************************************************************
*
* SYSVIEW_UpdateTask()
*
* Function description
* Update a task in the internal list and record its information.
*/
void SYSVIEW_UpdateTask(U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark) {
unsigned n;
/* On multi-core we have several idle tasks with 'IDLEx' names
Not best solution, because we can filter out user tasks starting with 'IDLE'.
But we can not use 'xTaskGetIdleTaskHandle' because at the moment when this
function is called array of idle tasks handles are not initialized yet. */
if (memcmp(pcTaskName, "IDLE", 4) == 0) {
return;
}
for (n = 0; n < _NumTasks; n++) {
if (_aTasks[n].xHandle == xHandle) {
break;
}
}
if (n < _NumTasks) {
_aTasks[n].pcTaskName = pcTaskName;
_aTasks[n].uxCurrentPriority = uxCurrentPriority;
_aTasks[n].pxStack = pxStack;
_aTasks[n].uStackHighWaterMark = uStackHighWaterMark;
SYSVIEW_SendTaskInfo(xHandle, pcTaskName, uxCurrentPriority, pxStack, uStackHighWaterMark);
} else {
SYSVIEW_AddTask(xHandle, pcTaskName, uxCurrentPriority, pxStack, uStackHighWaterMark);
}
}
/*********************************************************************
*
* SYSVIEW_DeleteTask()
*
* Function description
* Delete a task from the internal list.
*/
void SYSVIEW_DeleteTask(U32 xHandle) {
unsigned n;
if (_NumTasks == 0) {
return; // Early out
}
for (n = 0; n < _NumTasks; n++) {
if (_aTasks[n].xHandle == xHandle) {
break;
}
}
if (n == (_NumTasks - 1)) {
//
// Task is last item in list.
// Simply zero the item and decrement number of tasks.
//
memset(&_aTasks[n], 0, sizeof(_aTasks[n]));
_NumTasks--;
} else if (n < _NumTasks) {
//
// Task is in the middle of the list.
// Move last item to current position and decrement number of tasks.
// Order of tasks does not really matter, so no need to move all following items.
//
_aTasks[n].xHandle = _aTasks[_NumTasks - 1].xHandle;
_aTasks[n].pcTaskName = _aTasks[_NumTasks - 1].pcTaskName;
_aTasks[n].uxCurrentPriority = _aTasks[_NumTasks - 1].uxCurrentPriority;
_aTasks[n].pxStack = _aTasks[_NumTasks - 1].pxStack;
_aTasks[n].uStackHighWaterMark = _aTasks[_NumTasks - 1].uStackHighWaterMark;
memset(&_aTasks[_NumTasks - 1], 0, sizeof(_aTasks[_NumTasks - 1]));
_NumTasks--;
}
}
/*********************************************************************
*
* SYSVIEW_SendTaskInfo()
*
* Function description
* Record task information.
*/
void SYSVIEW_SendTaskInfo(U32 TaskID, const char* sName, unsigned Prio, U32 StackBase, unsigned StackSize) {
SEGGER_SYSVIEW_TASKINFO TaskInfo;
memset(&TaskInfo, 0, sizeof(TaskInfo)); // Fill all elements with 0 to allow extending the structure in future version without breaking the code
TaskInfo.TaskID = TaskID;
TaskInfo.sName = sName;
TaskInfo.Prio = Prio;
TaskInfo.StackBase = StackBase;
TaskInfo.StackSize = StackSize;
SEGGER_SYSVIEW_SendTaskInfo(&TaskInfo);
}
/*********************************************************************
*
* Public API structures
*
**********************************************************************
*/
// Callbacks provided to SYSTEMVIEW by FreeRTOS
const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI = {
/* 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,
};
/*************************** End of file ****************************/

View File

@@ -1,367 +0,0 @@
/*
* SPDX-FileCopyrightText: 1995-2021 SEGGER Microcontroller GmbH
*
* SPDX-License-Identifier: BSD-1-Clause
*
* SPDX-FileContributor: 2023 Espressif Systems (Shanghai) CO LTD
*/
/*********************************************************************
* SEGGER Microcontroller GmbH *
* The Embedded Experts *
**********************************************************************
* *
* (c) 1995 - 2021 SEGGER Microcontroller GmbH *
* *
* www.segger.com Support: support@segger.com *
* *
**********************************************************************
* *
* SEGGER SystemView * Real-time application analysis *
* *
**********************************************************************
* *
* All rights reserved. *
* *
* SEGGER strongly recommends to not make any changes *
* to or modify the source code of this software in order to stay *
* compatible with the SystemView and RTT protocol, and J-Link. *
* *
* Redistribution and use in source and binary forms, with or *
* without modification, are permitted provided that the following *
* condition is met: *
* *
* o Redistributions of source code must retain the above copyright *
* notice, this condition and the following disclaimer. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
* DISCLAIMED. IN NO EVENT SHALL SEGGER Microcontroller BE LIABLE FOR *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH *
* DAMAGE. *
* *
**********************************************************************
* *
* SystemView version: 3.42 *
* *
**********************************************************************
-------------------------- END-OF-HEADER -----------------------------
File : SEGGER_SYSVIEW_FreeRTOS.h
Purpose : Interface between FreeRTOS and SystemView.
Tested with FreeRTOS V10.4.3
Revision: $Rev: 7745 $
Notes:
(1) Include this file at the end of FreeRTOSConfig.h
*/
#ifndef SYSVIEW_FREERTOS_H
#define SYSVIEW_FREERTOS_H
#include "SEGGER_SYSVIEW.h"
/*********************************************************************
*
* Defines, configurable
*
**********************************************************************
*/
#define SYSVIEW_FREERTOS_MAX_NOF_TASKS CONFIG_APPTRACE_SV_MAX_TASKS
/*********************************************************************
*
* Defines, fixed
*
**********************************************************************
*/
// for dual-core targets we use event ID to keep core ID bit (0 or 1)
// use the highest - 1 bit of event ID to indicate core ID
// the highest bit can not be used due to event ID encoding method
// this reduces supported ID range to [0..63] (for 1 byte IDs) plus [128..16383] (for 2 bytes IDs)
// so original continuous event IDs range is split into two sub-ranges for 1-bytes IDs and 2-bytes ones
// events which use apiFastID_OFFSET will have 1 byte ID,
// so for the sake of bandwidth economy events which are generated more frequently should use this ID offset
// currently all used events fall into this range
#define apiFastID_OFFSET (32u)
#define apiID_VTASKDELETE (1u)
#define apiID_VTASKDELAY (2u)
#define apiID_VTASKDELAYUNTIL (3u)
#define apiID_VTASKSUSPEND (4u)
#define apiID_ULTASKNOTIFYTAKE (5u)
#define apiID_VTASKNOTIFYGIVEFROMISR (6u)
#define apiID_VTASKPRIORITYINHERIT (7u)
#define apiID_VTASKRESUME (8u)
#define apiID_VTASKSTEPTICK (9u)
#define apiID_XTASKPRIORITYDISINHERIT (10u)
#define apiID_XTASKRESUMEFROMISR (11u)
#define apiID_XTASKGENERICNOTIFY (12u)
#define apiID_XTASKGENERICNOTIFYFROMISR (13u)
#define apiID_XTASKNOTIFYWAIT (14u)
#define apiID_XQUEUEGENERICCREATE (15u)
#define apiID_VQUEUEDELETE (16u)
#define apiID_XQUEUEGENERICRECEIVE (17u)
#define apiID_XQUEUEPEEKFROMISR (18u)
#define apiID_XQUEUERECEIVEFROMISR (19u)
#define apiID_VQUEUEADDTOREGISTRY (20u)
#define apiID_XQUEUEGENERICSEND (21u)
#define apiID_XQUEUEGENERICSENDFROMISR (22u)
#define apiID_VTASKPRIORITYSET (23u)
#define apiID_UXTASKPRIORITYGETFROMISR (24u)
#define apiID_XTASKGETTICKCOUNTFROMISR (25u)
#define apiID_XEVENTGROUPCLEARBITSFROMISR (26u)
#define apiID_XEVENTGROUPSETBITSFROMISR (27u)
#define apiID_XEVENTGROUPGETBITSFROMISR (28u)
#define apiID_XQUEUEGIVEFROMISR (29u)
#define apiID_XQUEUEISQUEUEEMPTYFROMISR (30u)
#define apiID_XQUEUEISQUEUEFULLFROMISR (31u) // the maximum allowed apiID for the first ID range
// events which use apiSlowID_OFFSET will have 2-bytes ID
#define apiSlowID_OFFSET (127u)
#define apiID_VTASKALLOCATEMPUREGIONS (1u)
#define apiID_UXTASKPRIORITYGET (2u)
#define apiID_ETASKGETSTATE (3u)
#define apiID_VTASKSTARTSCHEDULER (4u)
#define apiID_VTASKENDSCHEDULER (5u)
#define apiID_VTASKSUSPENDALL (6u)
#define apiID_XTASKRESUMEALL (7u)
#define apiID_XTASKGETTICKCOUNT (8u)
#define apiID_UXTASKGETNUMBEROFTASKS (9u)
#define apiID_PCTASKGETTASKNAME (10u)
#define apiID_UXTASKGETSTACKHIGHWATERMARK (11u)
#define apiID_VTASKSETAPPLICATIONTASKTAG (12u)
#define apiID_XTASKGETAPPLICATIONTASKTAG (13u)
#define apiID_VTASKSETTHREADLOCALSTORAGEPOINTER (14u)
#define apiID_PVTASKGETTHREADLOCALSTORAGEPOINTER (15u)
#define apiID_XTASKCALLAPPLICATIONTASKHOOK (16u)
#define apiID_XTASKGETIDLETASKHANDLE (17u)
#define apiID_UXTASKGETSYSTEMSTATE (18u)
#define apiID_VTASKLIST (19u)
#define apiID_VTASKGETRUNTIMESTATS (20u)
#define apiID_XTASKNOTIFYSTATECLEAR (21u)
#define apiID_XTASKGETCURRENTTASKHANDLE (22u)
#define apiID_VTASKSETTIMEOUTSTATE (23u)
#define apiID_XTASKCHECKFORTIMEOUT (24u)
#define apiID_VTASKMISSEDYIELD (25u)
#define apiID_XTASKGETSCHEDULERSTATE (26u)
#define apiID_XTASKGENERICCREATE (27u)
#define apiID_UXTASKGETTASKNUMBER (28u)
#define apiID_VTASKSETTASKNUMBER (29u)
#define apiID_ETASKCONFIRMSLEEPMODESTATUS (30u)
#define apiID_XTIMERCREATE (31u)
#define apiID_PVTIMERGETTIMERID (32u)
#define apiID_VTIMERSETTIMERID (33u)
#define apiID_XTIMERISTIMERACTIVE (34u)
#define apiID_XTIMERGETTIMERDAEMONTASKHANDLE (35u)
#define apiID_XTIMERPENDFUNCTIONCALLFROMISR (36u)
#define apiID_XTIMERPENDFUNCTIONCALL (37u)
#define apiID_PCTIMERGETTIMERNAME (38u)
#define apiID_XTIMERCREATETIMERTASK (39u)
#define apiID_XTIMERGENERICCOMMAND (40u)
#define apiID_UXQUEUEMESSAGESWAITING (41u)
#define apiID_UXQUEUESPACESAVAILABLE (42u)
#define apiID_UXQUEUEMESSAGESWAITINGFROMISR (43u)
#define apiID_XQUEUEALTGENERICSEND (44u)
#define apiID_XQUEUEALTGENERICRECEIVE (45u)
#define apiID_XQUEUECRSENDFROMISR (46u)
#define apiID_XQUEUECRRECEIVEFROMISR (47u)
#define apiID_XQUEUECRSEND (48u)
#define apiID_XQUEUECRRECEIVE (49u)
#define apiID_XQUEUECREATEMUTEX (50u)
#define apiID_XQUEUECREATECOUNTINGSEMAPHORE (51u)
#define apiID_XQUEUEGETMUTEXHOLDER (52u)
#define apiID_XQUEUETAKEMUTEXRECURSIVE (53u)
#define apiID_XQUEUEGIVEMUTEXRECURSIVE (54u)
#define apiID_VQUEUEUNREGISTERQUEUE (55u)
#define apiID_XQUEUECREATESET (56u)
#define apiID_XQUEUEADDTOSET (57u)
#define apiID_XQUEUEREMOVEFROMSET (58u)
#define apiID_XQUEUESELECTFROMSET (59u)
#define apiID_XQUEUESELECTFROMSETFROMISR (60u)
#define apiID_XQUEUEGENERICRESET (61u)
#define apiID_VLISTINITIALISE (62u)
#define apiID_VLISTINITIALISEITEM (63u)
#define apiID_VLISTINSERT (64u)
#define apiID_VLISTINSERTEND (65u)
#define apiID_UXLISTREMOVE (66u)
#define apiID_XEVENTGROUPCREATE (67u)
#define apiID_XEVENTGROUPWAITBITS (68u)
#define apiID_XEVENTGROUPCLEARBITS (69u)
#define apiID_XEVENTGROUPSETBITS (70u)
#define apiID_XEVENTGROUPSYNC (71u)
#define apiID_VEVENTGROUPDELETE (72u)
#define apiID_UXEVENTGROUPGETNUMBER (73u)
#define apiID_XSTREAMBUFFERCREATE (74u)
#define apiID_VSTREAMBUFFERDELETE (75u)
#define apiID_XSTREAMBUFFERRESET (76u)
#define apiID_XSTREAMBUFFERSEND (77u)
#define apiID_XSTREAMBUFFERSENDFROMISR (78u)
#define apiID_XSTREAMBUFFERRECEIVE (79u)
#define apiID_XSTREAMBUFFERRECEIVEFROMISR (80u)
#ifdef CONFIG_FREERTOS_SMP
#define traceQUEUE_SEND( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), 0u, 0u, 0u)
#else // CONFIG_FREERTOS_SMP
#if ( configUSE_QUEUE_SETS != 1 )
#define traceQUEUE_SEND( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)
#else
#define traceQUEUE_SEND( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), 0u, 0u, 0u)
#endif
#endif // CONFIG_FREERTOS_SMP
#define traceSTART() SEGGER_SYSVIEW_Conf()
#define traceTASK_NOTIFY_TAKE(uxIndexToWait) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_ULTASKNOTIFYTAKE, xClearCountOnExit, xTicksToWait)
#define traceTASK_DELAY() SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_VTASKDELAY, xTicksToDelay)
#define traceTASK_DELAY_UNTIL(xTimeToWake) SEGGER_SYSVIEW_RecordVoid (apiFastID_OFFSET + apiID_VTASKDELAYUNTIL)
#define traceTASK_NOTIFY_GIVE_FROM_ISR(uxIndexToNotify) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_VTASKNOTIFYGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), (U32)pxHigherPriorityTaskWoken)
#define traceTASK_PRIORITY_INHERIT( pxTCB, uxPriority ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_VTASKPRIORITYINHERIT, (U32)pxMutexHolder)
#define traceTASK_RESUME( pxTCB ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_VTASKRESUME, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
#define traceINCREASE_TICK_COUNT( xTicksToJump ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_VTASKSTEPTICK, xTicksToJump)
#define traceTASK_SUSPEND( pxTCB ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_VTASKSUSPEND, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
#define traceTASK_PRIORITY_DISINHERIT( pxTCB, uxBasePriority ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_XTASKPRIORITYDISINHERIT, (U32)pxMutexHolder)
#define traceTASK_RESUME_FROM_ISR( pxTCB ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_XTASKRESUMEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB))
#define traceTASK_NOTIFY(uxIndexToNotify) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XTASKGENERICNOTIFY, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue)
#define traceTASK_NOTIFY_FROM_ISR(uxIndexToWait) SEGGER_SYSVIEW_RecordU32x5(apiFastID_OFFSET + apiID_XTASKGENERICNOTIFYFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), ulValue, eAction, (U32)pulPreviousNotificationValue, (U32)pxHigherPriorityTaskWoken)
#define traceTASK_NOTIFY_WAIT(uxIndexToWait) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XTASKNOTIFYWAIT, ulBitsToClearOnEntry, ulBitsToClearOnExit, (U32)pulNotificationValue, xTicksToWait)
#define traceQUEUE_CREATE( pxNewQueue ) SEGGER_SYSVIEW_RecordU32x3(apiFastID_OFFSET + apiID_XQUEUEGENERICCREATE, uxQueueLength, uxItemSize, ucQueueType)
#define traceQUEUE_DELETE( pxQueue ) SEGGER_SYSVIEW_RecordU32 (apiFastID_OFFSET + apiID_VQUEUEDELETE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue))
#define traceQUEUE_PEEK( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICRECEIVE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer), xTicksToWait, 1)
#define traceQUEUE_PEEK_FROM_ISR( pxQueue ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_XQUEUEPEEKFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer))
#define traceQUEUE_PEEK_FROM_ISR_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_XQUEUEPEEKFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer))
#define traceQUEUE_RECEIVE( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICRECEIVE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)0), xTicksToWait, 1)
#define traceQUEUE_RECEIVE_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICRECEIVE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)0), xTicksToWait, 1)
#define traceQUEUE_SEMAPHORE_RECEIVE( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICRECEIVE, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)0), xTicksToWait, 0)
#define traceQUEUE_RECEIVE_FROM_ISR( pxQueue ) SEGGER_SYSVIEW_RecordU32x3(apiFastID_OFFSET + apiID_XQUEUERECEIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer), (U32)pxHigherPriorityTaskWoken)
#define traceQUEUE_RECEIVE_FROM_ISR_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x3(apiFastID_OFFSET + apiID_XQUEUERECEIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), SEGGER_SYSVIEW_ShrinkId((U32)pvBuffer), (U32)pxHigherPriorityTaskWoken)
#define traceQUEUE_REGISTRY_ADD( xQueue, pcQueueName ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_VQUEUEADDTOREGISTRY, SEGGER_SYSVIEW_ShrinkId((U32)xQueue), (U32)pcQueueName)
#define traceQUEUE_SEND_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSEND, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, xTicksToWait, xCopyPosition)
#define traceQUEUE_SEND_FROM_ISR( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSENDFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, (U32)pxHigherPriorityTaskWoken, xCopyPosition)
#define traceQUEUE_SEND_FROM_ISR_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x4(apiFastID_OFFSET + apiID_XQUEUEGENERICSENDFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pvItemToQueue, (U32)pxHigherPriorityTaskWoken, xCopyPosition)
#define traceQUEUE_GIVE_FROM_ISR( pxQueue ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_XQUEUEGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pxHigherPriorityTaskWoken)
#define traceQUEUE_GIVE_FROM_ISR_FAILED( pxQueue ) SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET + apiID_XQUEUEGIVEFROMISR, SEGGER_SYSVIEW_ShrinkId((U32)pxQueue), (U32)pxHigherPriorityTaskWoken)
#define traceSTREAM_BUFFER_CREATE( pxStreamBuffer, xIsMessageBuffer ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERCREATE, (U32)xIsMessageBuffer, (U32)pxStreamBuffer)
#define traceSTREAM_BUFFER_CREATE_FAILED( xIsMessageBuffer ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERCREATE, (U32)xIsMessageBuffer, 0u)
#define traceSTREAM_BUFFER_DELETE( xStreamBuffer ) SEGGER_SYSVIEW_RecordU32 (apiSlowID_OFFSET + apiID_VSTREAMBUFFERDELETE, (U32)xStreamBuffer)
#define traceSTREAM_BUFFER_RESET( xStreamBuffer ) SEGGER_SYSVIEW_RecordU32 (apiSlowID_OFFSET + apiID_XSTREAMBUFFERRESET, (U32)xStreamBuffer)
#define traceSTREAM_BUFFER_SEND( xStreamBuffer, xBytesSent ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERSEND, (U32)xStreamBuffer, (U32)xBytesSent)
#define traceSTREAM_BUFFER_SEND_FAILED( xStreamBuffer ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERSEND, (U32)xStreamBuffer, 0u)
#define traceSTREAM_BUFFER_SEND_FROM_ISR( xStreamBuffer, xBytesSent ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERSENDFROMISR, (U32)xStreamBuffer, (U32)xBytesSent)
#define traceSTREAM_BUFFER_RECEIVE( xStreamBuffer, xReceivedLength ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERRECEIVE, (U32)xStreamBuffer, (U32)xReceivedLength)
#define traceSTREAM_BUFFER_RECEIVE_FAILED( xStreamBuffer ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERRECEIVE, (U32)xStreamBuffer, 0u)
#define traceSTREAM_BUFFER_RECEIVE_FROM_ISR( xStreamBuffer, xReceivedLength ) SEGGER_SYSVIEW_RecordU32x2(apiSlowID_OFFSET + apiID_XSTREAMBUFFERRECEIVEFROMISR, (U32)xStreamBuffer, (U32)xReceivedLength)
#define traceTASK_DELETE( pxTCB ) do { \
SEGGER_SYSVIEW_RecordU32(apiFastID_OFFSET + apiID_VTASKDELETE, SEGGER_SYSVIEW_ShrinkId((U32)pxTCB)); \
SYSVIEW_DeleteTask((U32)pxTCB); \
} while(0)
#if( portSTACK_GROWTH < 0 )
#define traceTASK_CREATE(pxNewTCB) if (pxNewTCB != NULL) { \
SEGGER_SYSVIEW_OnTaskCreate((U32)pxNewTCB); \
SYSVIEW_AddTask((U32)pxNewTCB, \
&(pxNewTCB->pcTaskName[0]), \
pxNewTCB->uxPriority, \
(U32)pxNewTCB->pxStack, \
((U32)pxNewTCB->pxTopOfStack - (U32)pxNewTCB->pxStack) \
); \
}
#else
#define traceTASK_CREATE(pxNewTCB) if (pxNewTCB != NULL) { \
SEGGER_SYSVIEW_OnTaskCreate((U32)pxNewTCB); \
SYSVIEW_AddTask((U32)pxNewTCB, \
&(pxNewTCB->pcTaskName[0]), \
pxNewTCB->uxPriority, \
(U32)pxNewTCB->pxStack, \
(U32)(pxNewTCB->pxStack-pxNewTCB->pxTopOfStack) \
); \
}
#endif
#define traceTASK_PRIORITY_SET(pxTask, uxNewPriority) { \
SEGGER_SYSVIEW_RecordU32x2(apiFastID_OFFSET+apiID_VTASKPRIORITYSET, \
SEGGER_SYSVIEW_ShrinkId((U32)pxTCB), \
uxNewPriority \
); \
SYSVIEW_UpdateTask((U32)pxTask, \
&(pxTask->pcTaskName[0]), \
uxNewPriority, \
(U32)pxTask->pxStack, \
0 \
); \
}
//
// Define INCLUDE_xTaskGetIdleTaskHandle as 1 in FreeRTOSConfig.h to allow identification of Idle state.
//
// SMP FreeRTOS uses unpinned IDLE tasks, so sometimes IDEL0 runs on CPU1, IDLE1 runs on CPU0 and so on.
// So IDLE state detection based on 'xTaskGetIdleTaskHandle' does not work for SMP kernel.
// We could compare current task handle with every element of the array returned by 'xTaskGetIdleTaskHandle',
// but it deos not seem to be efficient enough to be worth of making code more complex and less readabl.
// So always use task name comparison mechanism for SMP kernel.
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 && !defined(CONFIG_FREERTOS_SMP))
#define traceTASK_SWITCHED_IN() if(prvGetTCBFromHandle(NULL) == xTaskGetIdleTaskHandle()) { \
SEGGER_SYSVIEW_OnIdle(); \
} else { \
SEGGER_SYSVIEW_OnTaskStartExec((U32)prvGetTCBFromHandle(NULL)); \
}
#else
#define traceTASK_SWITCHED_IN() { \
if (memcmp(prvGetTCBFromHandle(NULL)->pcTaskName, "IDLE", 4) != 0) { \
SEGGER_SYSVIEW_OnTaskStartExec((U32)prvGetTCBFromHandle(NULL)); \
} else { \
SEGGER_SYSVIEW_OnIdle(); \
} \
}
#endif
#define traceMOVED_TASK_TO_READY_STATE(pxTCB) SEGGER_SYSVIEW_OnTaskStartReady((U32)pxTCB)
#define traceREADDED_TASK_TO_READY_STATE(pxTCB)
#define traceMOVED_TASK_TO_DELAYED_LIST() SEGGER_SYSVIEW_OnTaskStopReady((U32)prvGetTCBFromHandle(NULL), (1u << 2))
#define traceMOVED_TASK_TO_OVERFLOW_DELAYED_LIST() SEGGER_SYSVIEW_OnTaskStopReady((U32)prvGetTCBFromHandle(NULL), (1u << 2))
#define traceMOVED_TASK_TO_SUSPENDED_LIST(pxTCB) SEGGER_SYSVIEW_OnTaskStopReady((U32)pxTCB, ((3u << 3) | 3))
#define traceISR_EXIT_TO_SCHEDULER() SEGGER_SYSVIEW_RecordExitISRToScheduler()
#define traceISR_EXIT() SEGGER_SYSVIEW_RecordExitISR()
#define traceISR_ENTER(n) SEGGER_SYSVIEW_RecordEnterISR(n)
/*********************************************************************
*
* API functions
*
**********************************************************************
*/
#ifdef __cplusplus
extern "C" {
#endif
void SYSVIEW_AddTask (U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark);
void SYSVIEW_UpdateTask (U32 xHandle, const char* pcTaskName, unsigned uxCurrentPriority, U32 pxStack, unsigned uStackHighWaterMark);
void SYSVIEW_DeleteTask (U32 xHandle);
void SYSVIEW_SendTaskInfo (U32 TaskID, const char* sName, unsigned Prio, U32 StackBase, unsigned StackSize);
#ifdef __cplusplus
}
#endif
#endif
/*************************** End of file ****************************/

View File

@@ -1,306 +0,0 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "string.h"
#include "freertos/FreeRTOS.h"
#include "SEGGER_RTT.h"
#include "SEGGER_SYSVIEW.h"
#include "SEGGER_SYSVIEW_Conf.h"
#include "esp_app_trace.h"
#include "esp_log.h"
#include "esp_cpu.h"
#include "esp_private/startup_internal.h"
const static char *TAG = "segger_rtt";
#define SYSVIEW_EVENTS_BUF_SZ 255U
// size of down channel data buf
#define SYSVIEW_DOWN_BUF_SIZE 32
#define SEGGER_STOP_WAIT_TMO 1000000 //us
#if CONFIG_APPTRACE_SV_BUF_WAIT_TMO == -1
#define SEGGER_HOST_WAIT_TMO ESP_APPTRACE_TMO_INFINITE
#else
#define SEGGER_HOST_WAIT_TMO CONFIG_APPTRACE_SV_BUF_WAIT_TMO
#endif
static uint8_t s_events_buf[SYSVIEW_EVENTS_BUF_SZ];
static uint16_t s_events_buf_filled;
static uint8_t s_down_buf[SYSVIEW_DOWN_BUF_SIZE];
#if CONFIG_APPTRACE_SV_DEST_UART
#define ESP_APPTRACE_DEST_SYSVIEW ESP_APPTRACE_DEST_UART
#if CONFIG_APPTRACE_SV_DEST_CPU_0 || CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE
#define APPTRACE_SV_DEST_CPU 0
#else
#define APPTRACE_SV_DEST_CPU 1
#endif // CONFIG_APPTRACE_SV_DEST_CPU_0
#elif CONFIG_APPTRACE_SV_DEST_JTAG || (CONFIG_APPTRACE_ENABLE && CONFIG_APPTRACE_DEST_UART_NONE)
#define ESP_APPTRACE_DEST_SYSVIEW ESP_APPTRACE_DEST_TRAX
#endif
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* SEGGER_RTT_ESP_FlushNoLock()
*
* Function description
* Flushes buffered events.
*
* Parameters
* min_sz Threshold for flushing data. If current filling level is above this value, data will be flushed. TRAX destinations only.
* tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly.
*
* Return value
* None.
*/
void SEGGER_RTT_ESP_FlushNoLock(unsigned long min_sz, unsigned long tmo)
{
esp_err_t res;
if (s_events_buf_filled > 0) {
res = esp_apptrace_write(ESP_APPTRACE_DEST_SYSVIEW, s_events_buf, s_events_buf_filled, tmo);
if (res != ESP_OK) {
ESP_LOGE(TAG, "Failed to flush buffered events (%d)!", res);
}
}
// flush even if we failed to write buffered events, because no new events will be sent after STOP
res = esp_apptrace_flush_nolock(ESP_APPTRACE_DEST_SYSVIEW, min_sz, tmo);
if (res != ESP_OK) {
ESP_LOGE(TAG, "Failed to flush apptrace data (%d)!", res);
}
s_events_buf_filled = 0;
}
/*********************************************************************
*
* SEGGER_RTT_ESP_Flush()
*
* Function description
* Flushes buffered events.
*
* Parameters
* min_sz Threshold for flushing data. If current filling level is above this value, data will be flushed. TRAX destinations only.
* tmo Timeout for operation (in us). Use ESP_APPTRACE_TMO_INFINITE to wait indefinetly.
*
* Return value
* None.
*/
void SEGGER_RTT_ESP_Flush(unsigned long min_sz, unsigned long tmo)
{
SEGGER_SYSVIEW_LOCK();
SEGGER_RTT_ESP_FlushNoLock(min_sz, tmo);
SEGGER_SYSVIEW_UNLOCK();
}
/*********************************************************************
*
* SEGGER_RTT_ReadNoLock()
*
* Function description
* Reads characters from SEGGER real-time-terminal control block
* which have been previously stored by the host.
* Do not lock against interrupts and multiple access.
*
* Parameters
* BufferIndex Index of Down-buffer to be used (e.g. 0 for "Terminal").
* pBuffer Pointer to buffer provided by target application, to copy characters from RTT-down-buffer to.
* BufferSize Size of the target application buffer.
*
* Return value
* Number of bytes that have been read.
*/
unsigned SEGGER_RTT_ReadNoLock(unsigned BufferIndex, void* pData, unsigned BufferSize) {
uint32_t size = BufferSize;
esp_err_t res = esp_apptrace_read(ESP_APPTRACE_DEST_SYSVIEW, pData, &size, 0);
if (res != ESP_OK) {
return 0;
}
return size;
}
/*********************************************************************
*
* SEGGER_RTT_WriteSkipNoLock
*
* Function description
* Stores a specified number of characters in SEGGER RTT
* control block which is then read by the host.
* SEGGER_RTT_WriteSkipNoLock does not lock the application and
* skips all data, if the data does not fit into the buffer.
*
* Parameters
* BufferIndex Index of "Up"-buffer to be used (e.g. 0 for "Terminal").
* pBuffer Pointer to character array. Does not need to point to a \0 terminated string.
* NumBytes Number of bytes to be stored in the SEGGER RTT control block.
*
* Return value
* Number of bytes which have been stored in the "Up"-buffer.
*
* Notes
* (1) If there is not enough space in the "Up"-buffer, all data is dropped.
* (2) For performance reasons this function does not call Init()
* and may only be called after RTT has been initialized.
* Either by calling SEGGER_RTT_Init() or calling another RTT API function first.
*/
unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, unsigned NumBytes) {
uint8_t *pbuf = (uint8_t *)pBuffer;
uint8_t event_id = *pbuf;
#if CONFIG_APPTRACE_SV_DEST_UART
if (
(APPTRACE_SV_DEST_CPU != esp_cpu_get_core_id()) &&
(
(event_id == SYSVIEW_EVTID_ISR_ENTER) ||
(event_id == SYSVIEW_EVTID_ISR_EXIT) ||
(event_id == SYSVIEW_EVTID_TASK_START_EXEC) ||
(event_id == SYSVIEW_EVTID_TASK_STOP_EXEC) ||
(event_id == SYSVIEW_EVTID_TASK_START_READY) ||
(event_id == SYSVIEW_EVTID_TASK_STOP_READY) ||
(event_id == SYSVIEW_EVTID_MARK_START) ||
(event_id == SYSVIEW_EVTID_MARK_STOP) ||
(event_id == SYSVIEW_EVTID_TIMER_ENTER) ||
(event_id == SYSVIEW_EVTID_TIMER_EXIT) ||
(event_id == SYSVIEW_EVTID_STACK_INFO) ||
(event_id == SYSVIEW_EVTID_MODULEDESC)
)
){
return NumBytes;
}
// This is workaround for SystemView!
// Without this line SystemView will hangs on when heap tracing enabled.
if(event_id == SYSVIEW_EVTID_MODULEDESC){
return NumBytes;
}
#endif // CONFIG_APPTRACE_SV_DEST_UART
if (NumBytes > SYSVIEW_EVENTS_BUF_SZ) {
ESP_LOGE(TAG, "Too large event %u bytes!", NumBytes);
return 0;
}
#if CONFIG_APPTRACE_SV_DEST_JTAG
if (esp_cpu_get_core_id()) { // dual core specific code
// use the highest - 1 bit of event ID to indicate core ID
// the highest bit can not be used due to event ID encoding method
// this reduces supported ID range to [0..63] (for 1 byte IDs) plus [128..16383] (for 2 bytes IDs)
if (*pbuf & 0x80) { // 2 bytes ID
*(pbuf + 1) |= (1 << 6);
} else if (NumBytes != 10 || *pbuf != 0) { // ignore sync sequence
*pbuf |= (1 << 6);
}
}
#endif // CONFIG_APPTRACE_SV_DEST_JTAG
#if CONFIG_APPTRACE_SV_DEST_JTAG
if (s_events_buf_filled + NumBytes > SYSVIEW_EVENTS_BUF_SZ) {
esp_err_t res = esp_apptrace_write(ESP_APPTRACE_DEST_SYSVIEW, s_events_buf, s_events_buf_filled, SEGGER_HOST_WAIT_TMO);
if (res != ESP_OK) {
return 0; // skip current data buffer only, accumulated events are kept
}
s_events_buf_filled = 0;
}
#endif
memcpy(&s_events_buf[s_events_buf_filled], pBuffer, NumBytes);
s_events_buf_filled += NumBytes;
#if CONFIG_APPTRACE_SV_DEST_UART
esp_err_t res = esp_apptrace_write(ESP_APPTRACE_DEST_SYSVIEW, pBuffer, NumBytes, SEGGER_HOST_WAIT_TMO);
if (res != ESP_OK)
{
return 0; // skip current data buffer only, accumulated events are kept
}
s_events_buf_filled = 0;
#endif
if (event_id == SYSVIEW_EVTID_TRACE_STOP)
{
SEGGER_RTT_ESP_FlushNoLock(0, SEGGER_STOP_WAIT_TMO);
}
return NumBytes;
}
/*********************************************************************
*
* SEGGER_RTT_ConfigUpBuffer
*
* Function description
* Run-time configuration of a specific up-buffer (T->H).
* Buffer to be configured is specified by index.
* This includes: Buffer address, size, name, flags, ...
*
* Parameters
* BufferIndex Index of the buffer to configure.
* sName Pointer to a constant name string.
* pBuffer Pointer to a buffer to be used.
* BufferSize Size of the buffer.
* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
*
* Return value
* >= 0 - O.K.
* < 0 - Error
*
* Additional information
* Buffer 0 is configured on compile-time.
* May only be called once per buffer.
* Buffer name and flags can be reconfigured using the appropriate functions.
*/
int SEGGER_RTT_ConfigUpBuffer(unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags) {
s_events_buf_filled = 0;
return 0;
}
/*********************************************************************
*
* SEGGER_RTT_ConfigDownBuffer
*
* Function description
* Run-time configuration of a specific down-buffer (H->T).
* Buffer to be configured is specified by index.
* This includes: Buffer address, size, name, flags, ...
*
* Parameters
* BufferIndex Index of the buffer to configure.
* sName Pointer to a constant name string.
* pBuffer Pointer to a buffer to be used.
* BufferSize Size of the buffer.
* Flags Operating modes. Define behavior if buffer is full (not enough space for entire message).
*
* Return value
* >= 0 O.K.
* < 0 Error
*
* Additional information
* Buffer 0 is configured on compile-time.
* May only be called once per buffer.
* Buffer name and flags can be reconfigured using the appropriate functions.
*/
int SEGGER_RTT_ConfigDownBuffer(unsigned BufferIndex, const char* sName, void* pBuffer, unsigned BufferSize, unsigned Flags) {
esp_apptrace_down_buffer_config(s_down_buf, sizeof(s_down_buf));
return 0;
}
/*************************** Init hook ****************************
*
* This init function is placed here because this port file will be
* linked whenever SystemView is used.
*/
ESP_SYSTEM_INIT_FN(sysview_init, SECONDARY, BIT(0), 120)
{
SEGGER_SYSVIEW_Conf();
return ESP_OK;
}
/*************************** End of file ****************************/

View File

@@ -1,92 +0,0 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdint.h>
#include <sdkconfig.h>
#include "SEGGER_SYSVIEW.h"
#include "SEGGER_RTT.h"
#include "esp_app_trace.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
const static char *TAG = "sysview_heap_trace";
#ifdef CONFIG_HEAP_TRACING_STACK_DEPTH
#define CALLSTACK_SIZE CONFIG_HEAP_TRACING_STACK_DEPTH
#else
#define CALLSTACK_SIZE 0
#endif
static SEGGER_SYSVIEW_MODULE s_esp_sysview_heap_module = {
.sModule = "M=ESP32 SystemView Heap Tracing Module",
.NumEvents = 2,
};
static bool s_mod_registered;
esp_err_t esp_sysview_heap_trace_start(uint32_t tmo)
{
uint32_t tmo_ticks = tmo/(1000*portTICK_PERIOD_MS);
ESP_EARLY_LOGV(TAG, "%s", __func__);
do {
if (tmo != (uint32_t)-1) {
// Currently timeout implementation is simple and has granularity of 1 OS tick,
// so just count down the number of times to call vTaskDelay
if (tmo_ticks-- == 0) {
return ESP_ERR_TIMEOUT;
}
}
vTaskDelay(1);
} while(!SEGGER_SYSVIEW_Started());
SEGGER_SYSVIEW_RegisterModule(&s_esp_sysview_heap_module);
s_mod_registered = true;
return ESP_OK;
}
esp_err_t esp_sysview_heap_trace_stop(void)
{
ESP_EARLY_LOGV(TAG, "%s", __func__);
SEGGER_RTT_ESP_Flush(0, ESP_APPTRACE_TMO_INFINITE);
return ESP_OK;
}
void esp_sysview_heap_trace_alloc(const void *addr, uint32_t size, const void *callers)
{
U8 aPacket[SEGGER_SYSVIEW_INFO_SIZE + (2+CALLSTACK_SIZE)*SEGGER_SYSVIEW_QUANTA_U32];
U8* pPayload = SEGGER_SYSVIEW_PREPARE_PACKET(aPacket);
U32 *calls = (U32 *)callers;
if (!s_mod_registered) {
return;
}
ESP_EARLY_LOGV(TAG, "%s %p %lu", __func__, addr, size);
pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, (U32)addr);
pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, size);
for (int i = 0; i < CALLSTACK_SIZE; i++) {
pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, calls[i]);
}
SEGGER_SYSVIEW_SendPacket(&aPacket[0], pPayload, s_esp_sysview_heap_module.EventOffset + 0);
}
void esp_sysview_heap_trace_free(const void *addr, const void *callers)
{
U8 aPacket[SEGGER_SYSVIEW_INFO_SIZE + (1+CALLSTACK_SIZE)*SEGGER_SYSVIEW_QUANTA_U32];
U8* pPayload = SEGGER_SYSVIEW_PREPARE_PACKET(aPacket);
U32 *calls = (U32 *)callers;
if (!s_mod_registered) {
return;
}
ESP_EARLY_LOGV(TAG, "%s %p", __func__, addr);
pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, (U32)addr);
for (int i = 0; i < CALLSTACK_SIZE; i++) {
pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, calls[i]);
}
SEGGER_SYSVIEW_SendPacket(&aPacket[0], pPayload, s_esp_sysview_heap_module.EventOffset + 1);
}

View File

@@ -1,26 +0,0 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <stdarg.h>
#include <sdkconfig.h>
#include "SEGGER_SYSVIEW_Int.h"
#include "freertos/FreeRTOS.h"
static portMUX_TYPE s_log_mutex = portMUX_INITIALIZER_UNLOCKED;
int esp_sysview_vprintf(const char * format, va_list args)
{
static char log_buffer[SEGGER_SYSVIEW_MAX_STRING_LEN];
portENTER_CRITICAL(&s_log_mutex);
size_t len = vsnprintf(log_buffer, sizeof(log_buffer), format, args);
if (len > sizeof(log_buffer) - 1) {
log_buffer[sizeof(log_buffer) - 1] = 0;
}
SEGGER_SYSVIEW_Print(log_buffer);
portEXIT_CRITICAL(&s_log_mutex);
return len;
}

View File

@@ -2,12 +2,9 @@
components/app_trace/test_apps:
depends_components:
- app_trace
- esp_timer
- soc
- driver
- esp_hw_support
- esp_trace
- esp_driver_gptimer
disable:
- if: IDF_TARGET in ["esp32c5", "esp32c61", "esp32h21", "esp32h4"]
- if: IDF_TARGET in ["esp32h21", "esp32h4"]
temporary: true
reason: not support yet # TODO: [ESP32C5] IDF-8705, [ESP32C61] IDF-9306, [ESP32H21] IDF-11539 [ESP32H4] IDF-12325
reason: not support yet # TODO: [ESP32H21] IDF-11539 [ESP32H4] IDF-12325

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.22)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(COMPONENTS main)

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- |
# app_trace test
@@ -8,9 +8,4 @@ To build and run this test app for app_trace related tests:
IDF_TARGET=esp32 idf.py @app_trace build flash monitor
```
To build and run this test app for SystemView related tests:
```bash
IDF_TARGET=esp32 idf.py @sysview build flash monitor
```
`@app_trace` and `@sysview` arguments apply additional `idf.py` options, from [app_trace](app_trace) and [sysview](sysview) files.
`@app_trace` argument apply additional `idf.py` options, from [app_trace](app_trace) and file.

View File

@@ -1,4 +1,4 @@
idf_component_register(SRCS "test_app_trace_main.c" "test_trace.c"
INCLUDE_DIRS "."
PRIV_REQUIRES app_trace unity esp_driver_gptimer
PRIV_REQUIRES esp_trace unity esp_driver_gptimer
WHOLE_ARCHIVE)

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
*/
@@ -16,17 +16,16 @@
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "freertos/task.h"
#include "esp_app_trace.h"
#include "esp_app_trace_util.h"
#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
#include "esp_log.h"
#define ESP_APPTRACE_TEST_USE_PRINT_LOCK 0
#define ESP_APPTRACE_TEST_PRN_WRERR_MAX 5
#define ESP_APPTRACE_TEST_BLOCKS_BEFORE_CRASH 100
#define ESP_APPTRACE_TEST_BLOCK_SIZE 1024
#define LOG_LOCAL_LEVEL ESP_LOG_VERBOSE
#include "esp_log.h"
const static char *TAG = "esp_apptrace_test";
#if ESP_APPTRACE_TEST_USE_PRINT_LOCK == 1
@@ -66,10 +65,9 @@ const static char *TAG = "esp_apptrace_test";
#define ESP_APPTRACE_TEST_LOGV( format, ... ) ESP_APPTRACE_TEST_LOG_LEVEL(V, ESP_LOG_VERBOSE, format, ##__VA_ARGS__)
#define ESP_APPTRACE_TEST_LOGO( format, ... ) ESP_APPTRACE_TEST_LOG_LEVEL(E, ESP_LOG_NONE, format, ##__VA_ARGS__)
#if CONFIG_APPTRACE_SV_ENABLE == 0
#define ESP_APPTRACE_TEST_WRITE(_b_, _s_) esp_apptrace_write(ESP_APPTRACE_DEST_TRAX, _b_, _s_, ESP_APPTRACE_TMO_INFINITE)
#define ESP_APPTRACE_TEST_WRITE_FROM_ISR(_b_, _s_) esp_apptrace_write(ESP_APPTRACE_DEST_TRAX, _b_, _s_, 0UL)
#define ESP_APPTRACE_TEST_WRITE_NOWAIT(_b_, _s_) esp_apptrace_write(ESP_APPTRACE_DEST_TRAX, _b_, _s_, 0)
#define ESP_APPTRACE_TEST_WRITE(_b_, _s_) esp_apptrace_write(_b_, _s_, ESP_APPTRACE_TMO_INFINITE)
#define ESP_APPTRACE_TEST_WRITE_FROM_ISR(_b_, _s_) esp_apptrace_write(_b_, _s_, 0UL)
#define ESP_APPTRACE_TEST_WRITE_NOWAIT(_b_, _s_) esp_apptrace_write(_b_, _s_, 0)
typedef struct {
uint8_t *buf;
@@ -625,7 +623,7 @@ static int esp_logtrace_printf(const char *fmt, ...)
va_start(ap, fmt);
int ret = esp_apptrace_vprintf_to(ESP_APPTRACE_DEST_TRAX, ESP_APPTRACE_TMO_INFINITE, fmt, ap);
int ret = esp_apptrace_vprintf_to(ESP_APPTRACE_TMO_INFINITE, fmt, ap);
va_end(ap);
@@ -657,7 +655,7 @@ static void esp_logtrace_task(void *p)
break;
}
}
esp_err_t ret = esp_apptrace_flush(ESP_APPTRACE_DEST_TRAX, ESP_APPTRACE_TMO_INFINITE);
esp_err_t ret = esp_apptrace_flush(ESP_APPTRACE_TMO_INFINITE);
if (ret != ESP_OK) {
ESP_APPTRACE_TEST_LOGE("Failed to flush printf buf (%d)!", ret);
}
@@ -694,233 +692,3 @@ TEST_CASE("Log trace test (2 tasks)", "[trace][ignore]")
xSemaphoreTake(arg2.done, portMAX_DELAY);
vSemaphoreDelete(arg2.done);
}
#else // #if CONFIG_APPTRACE_SV_ENABLE == 0
typedef struct {
gptimer_handle_t gptimer;
uint32_t period;
int flags;
uint32_t id;
} esp_sysviewtrace_timer_arg_t;
typedef struct {
SemaphoreHandle_t done;
SemaphoreHandle_t *sync;
esp_sysviewtrace_timer_arg_t *timer;
uint32_t work_count;
uint32_t sleep_tmo;
uint32_t id;
} esp_sysviewtrace_task_arg_t;
static bool esp_sysview_test_timer_isr(gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata, void *user_ctx)
{
esp_sysviewtrace_timer_arg_t *tim_arg = (esp_sysviewtrace_timer_arg_t *)user_ctx;
(void) tim_arg;
return false;
}
static void esp_sysviewtrace_test_task(void *p)
{
esp_sysviewtrace_task_arg_t *arg = (esp_sysviewtrace_task_arg_t *) p;
volatile uint32_t tmp = 0;
printf("%p: run sysview task\n", xTaskGetCurrentTaskHandle());
if (arg->timer) {
gptimer_alarm_config_t alarm_config = {
.reload_count = 0,
.alarm_count = arg->timer->period,
.flags.auto_reload_on_alarm = true,
};
gptimer_event_callbacks_t cbs = {
.on_alarm = esp_sysview_test_timer_isr,
};
TEST_ESP_OK(gptimer_register_event_callbacks(arg->timer->gptimer, &cbs, arg->timer));
TEST_ESP_OK(gptimer_enable(arg->timer->gptimer));
TEST_ESP_OK(gptimer_set_alarm_action(arg->timer->gptimer, &alarm_config));
TEST_ESP_OK(gptimer_start(arg->timer->gptimer));
}
int i = 0;
while (1) {
static uint32_t count;
printf("%" PRIu32, arg->id);
if ((++count % 80) == 0) {
printf("\n");
}
if (arg->sync) {
xSemaphoreTake(*arg->sync, portMAX_DELAY);
}
for (uint32_t k = 0; k < arg->work_count; k++) {
tmp++;
}
vTaskDelay(arg->sleep_tmo / portTICK_PERIOD_MS);
i++;
if (arg->sync) {
xSemaphoreGive(*arg->sync);
}
}
ESP_APPTRACE_TEST_LOGI("%p: finished", xTaskGetCurrentTaskHandle());
xSemaphoreGive(arg->done);
vTaskDelay(1);
vTaskDelete(NULL);
}
TEST_CASE("SysView trace test 1", "[trace][ignore]")
{
TaskHandle_t thnd;
esp_sysviewtrace_timer_arg_t tim_arg1 = {
.flags = ESP_INTR_FLAG_SHARED,
.id = 0,
.period = 500,
};
esp_sysviewtrace_task_arg_t arg1 = {
.done = xSemaphoreCreateBinary(),
.sync = NULL,
.work_count = 10000,
.sleep_tmo = 1,
.timer = &tim_arg1,
.id = 0,
};
esp_sysviewtrace_timer_arg_t tim_arg2 = {
.flags = 0,
.id = 1,
.period = 100,
};
esp_sysviewtrace_task_arg_t arg2 = {
.done = xSemaphoreCreateBinary(),
.sync = NULL,
.work_count = 10000,
.sleep_tmo = 1,
.timer = &tim_arg2,
.id = 1,
};
gptimer_config_t timer_config = {
.clk_src = GPTIMER_CLK_SRC_DEFAULT,
.direction = GPTIMER_COUNT_UP,
.resolution_hz = 1000000,
};
timer_config.flags.intr_shared = (tim_arg1.flags & ESP_INTR_FLAG_SHARED) == ESP_INTR_FLAG_SHARED;
TEST_ESP_OK(gptimer_new_timer(&timer_config, &tim_arg1.gptimer));
timer_config.flags.intr_shared = (tim_arg2.flags & ESP_INTR_FLAG_SHARED) == ESP_INTR_FLAG_SHARED;
TEST_ESP_OK(gptimer_new_timer(&timer_config, &tim_arg2.gptimer));
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svtrace0", 2048, &arg1, 3, &thnd, 0);
ESP_APPTRACE_TEST_LOGI("Created task %p", thnd);
#if CONFIG_FREERTOS_UNICORE == 0
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svtrace1", 2048, &arg2, 5, &thnd, 1);
#else
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svtrace1", 2048, &arg2, 5, &thnd, 0);
#endif
ESP_APPTRACE_TEST_LOGI("Created task %p", thnd);
xSemaphoreTake(arg1.done, portMAX_DELAY);
vSemaphoreDelete(arg1.done);
xSemaphoreTake(arg2.done, portMAX_DELAY);
vSemaphoreDelete(arg2.done);
TEST_ESP_OK(gptimer_stop(tim_arg1.gptimer));
TEST_ESP_OK(gptimer_disable(tim_arg1.gptimer));
TEST_ESP_OK(gptimer_del_timer(tim_arg1.gptimer));
TEST_ESP_OK(gptimer_stop(tim_arg2.gptimer));
TEST_ESP_OK(gptimer_disable(tim_arg2.gptimer));
TEST_ESP_OK(gptimer_del_timer(tim_arg2.gptimer));
}
TEST_CASE("SysView trace test 2", "[trace][ignore]")
{
TaskHandle_t thnd;
esp_sysviewtrace_timer_arg_t tim_arg1 = {
.flags = ESP_INTR_FLAG_SHARED,
.id = 0,
.period = 500,
};
esp_sysviewtrace_task_arg_t arg1 = {
.done = xSemaphoreCreateBinary(),
.sync = NULL,
.work_count = 10000,
.sleep_tmo = 1,
.timer = &tim_arg1,
.id = 0,
};
esp_sysviewtrace_timer_arg_t tim_arg2 = {
.flags = 0,
.id = 1,
.period = 100,
};
esp_sysviewtrace_task_arg_t arg2 = {
.done = xSemaphoreCreateBinary(),
.sync = NULL,
.work_count = 10000,
.sleep_tmo = 1,
.timer = &tim_arg2,
.id = 1,
};
SemaphoreHandle_t test_sync = xSemaphoreCreateBinary();
xSemaphoreGive(test_sync);
esp_sysviewtrace_task_arg_t arg3 = {
.done = xSemaphoreCreateBinary(),
.sync = &test_sync,
.work_count = 1000,
.sleep_tmo = 1,
.timer = NULL,
.id = 2,
};
esp_sysviewtrace_task_arg_t arg4 = {
.done = xSemaphoreCreateBinary(),
.sync = &test_sync,
.work_count = 10000,
.sleep_tmo = 1,
.timer = NULL,
.id = 3,
};
gptimer_config_t timer_config = {
.clk_src = GPTIMER_CLK_SRC_DEFAULT,
.direction = GPTIMER_COUNT_UP,
.resolution_hz = 1000000,
};
timer_config.flags.intr_shared = (tim_arg1.flags & ESP_INTR_FLAG_SHARED) == ESP_INTR_FLAG_SHARED;
TEST_ESP_OK(gptimer_new_timer(&timer_config, &tim_arg1.gptimer));
timer_config.flags.intr_shared = (tim_arg2.flags & ESP_INTR_FLAG_SHARED) == ESP_INTR_FLAG_SHARED;
TEST_ESP_OK(gptimer_new_timer(&timer_config, &tim_arg2.gptimer));
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svtrace0", 2048, &arg1, 3, &thnd, 0);
printf("Created task %p\n", thnd);
#if CONFIG_FREERTOS_UNICORE == 0
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svtrace1", 2048, &arg2, 4, &thnd, 1);
#else
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svtrace1", 2048, &arg2, 4, &thnd, 0);
#endif
printf("Created task %p\n", thnd);
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svsync0", 2048, &arg3, 3, &thnd, 0);
printf("Created task %p\n", thnd);
#if CONFIG_FREERTOS_UNICORE == 0
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svsync1", 2048, &arg4, 5, &thnd, 1);
#else
xTaskCreatePinnedToCore(esp_sysviewtrace_test_task, "svsync1", 2048, &arg4, 5, &thnd, 0);
#endif
printf("Created task %p\n", thnd);
xSemaphoreTake(arg1.done, portMAX_DELAY);
vSemaphoreDelete(arg1.done);
xSemaphoreTake(arg2.done, portMAX_DELAY);
vSemaphoreDelete(arg2.done);
xSemaphoreTake(arg3.done, portMAX_DELAY);
vSemaphoreDelete(arg3.done);
xSemaphoreTake(arg4.done, portMAX_DELAY);
vSemaphoreDelete(arg4.done);
vSemaphoreDelete(test_sync);
TEST_ESP_OK(gptimer_stop(tim_arg1.gptimer));
TEST_ESP_OK(gptimer_disable(tim_arg1.gptimer));
TEST_ESP_OK(gptimer_del_timer(tim_arg1.gptimer));
TEST_ESP_OK(gptimer_stop(tim_arg2.gptimer));
TEST_ESP_OK(gptimer_disable(tim_arg2.gptimer));
TEST_ESP_OK(gptimer_del_timer(tim_arg2.gptimer));
}
#endif // #if CONFIG_APPTRACE_SV_ENABLE == 0

View File

@@ -1 +1,3 @@
# app_trace is already enabled by sdkconfig.defaults, so no options are needed here
CONFIG_ESP_TRACE_LIB_NONE=y
CONFIG_ESP_TRACE_TRANSPORT_APPTRACE=y
CONFIG_APPTRACE_DEST_JTAG=y

View File

@@ -1 +0,0 @@
CONFIG_APPTRACE_SV_ENABLE=y

View File

@@ -1,2 +1,2 @@
CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=n
CONFIG_APPTRACE_DEST_JTAG=y
CONFIG_ESP_TRACE_ENABLE=y

View File

@@ -1 +0,0 @@
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.ci.sysview" -B build/sysview -DSDKCONFIG=build/sysview/sdkconfig

View File

@@ -4,7 +4,7 @@ if(${target} STREQUAL "linux")
return() # This component is not supported by the POSIX/Linux simulator
endif()
idf_component_register(SRCS "esp_ota_ops.c" "esp_ota_app_desc.c"
idf_component_register(SRCS "esp_ota_ops.c"
INCLUDE_DIRS "include"
REQUIRES partition_table bootloader_support esp_app_format esp_bootloader_format esp_partition
PRIV_REQUIRES esptool_py efuse spi_flash)
@@ -29,7 +29,9 @@ if(NOT BOOTLOADER_BUILD)
add_custom_target(blank_ota_data ALL DEPENDS ${blank_otadata_file})
add_dependencies(flash blank_ota_data)
add_dependencies(encrypted-flash blank_ota_data)
if(CONFIG_SECURE_FLASH_ENCRYPTION_MODE_DEVELOPMENT)
add_dependencies(encrypted-flash blank_ota_data)
endif()
set(otatool_py "${python}" "${COMPONENT_DIR}/otatool.py")

View File

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

View File

@@ -42,30 +42,6 @@ extern "C"
*/
typedef uint32_t esp_ota_handle_t;
/**
* @brief Return esp_app_desc structure. This structure includes app version.
*
* @note This API is present for backward compatibility reasons. Alternative function
* with the same functionality is `esp_app_get_description`
*
* Return description for running app.
* @return Pointer to esp_app_desc structure.
*/
const esp_app_desc_t *esp_ota_get_app_description(void) __attribute__((deprecated("Please use esp_app_get_description instead")));
/**
* @brief Fill the provided buffer with SHA256 of the ELF file, formatted as hexadecimal, null-terminated.
* If the buffer size is not sufficient to fit the entire SHA256 in hex plus a null terminator,
* the largest possible number of bytes will be written followed by a null.
*
* @note This API is present for backward compatibility reasons. Alternative function
* with the same functionality is `esp_app_get_elf_sha256`
*
* @param dst Destination buffer
* @param size Size of the buffer
* @return Number of bytes written to dst (including null terminator)
*/
int esp_ota_get_app_elf_sha256(char* dst, size_t size) __attribute__((deprecated("Please use esp_app_get_elf_sha256 instead")));
/**
* @brief Commence an OTA update writing to the specified partition.
@@ -113,6 +89,10 @@ esp_err_t esp_ota_begin(const esp_partition_t* partition, size_t image_size, esp
* Unlike esp_ota_begin(), this function does not erase the partition which receives the OTA update, but rather expects that part of the image
* has already been written correctly, and it resumes writing from the given offset.
*
* @note When flash encryption is enabled, data writes must be 16-byte aligned.
* Any leftover (non-aligned) data is temporarily cached and may be lost after reboot.
* Therefore, during resumption, ensure that image offset is always 16-byte aligned.
*
* @param partition Pointer to info for the partition which is receiving the OTA update. Required.
* @param erase_size Specifies how much flash memory to erase before resuming OTA, depending on whether a sequential write or a bulk erase is being used.
* @param image_offset Offset from where to resume the OTA process. Should be set to the number of bytes already written.

View File

@@ -3,10 +3,8 @@
# otatool is used to perform ota-level operations - flashing ota partition
# erasing ota partition and switching ota partition
#
# SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import division, print_function
import argparse
import binascii
import collections
@@ -16,12 +14,18 @@ import sys
import tempfile
try:
from parttool import PARTITION_TABLE_OFFSET, PartitionName, PartitionType, ParttoolTarget
from parttool import PARTITION_TABLE_OFFSET
from parttool import PartitionName
from parttool import PartitionType
from parttool import ParttoolTarget
except ImportError:
COMPONENTS_PATH = os.path.expandvars(os.path.join('$IDF_PATH', 'components'))
PARTTOOL_DIR = os.path.join(COMPONENTS_PATH, 'partition_table')
sys.path.append(PARTTOOL_DIR)
from parttool import PARTITION_TABLE_OFFSET, PartitionName, PartitionType, ParttoolTarget
from parttool import PARTITION_TABLE_OFFSET
from parttool import PartitionName
from parttool import PartitionType
from parttool import ParttoolTarget
__version__ = '2.0'
@@ -35,15 +39,31 @@ def status(msg):
print(msg)
class OtatoolTarget():
class OtatoolTarget:
OTADATA_PARTITION = PartitionType('data', 'ota')
def __init__(self, port=None, baud=None, partition_table_offset=PARTITION_TABLE_OFFSET, partition_table_file=None,
spi_flash_sec_size=SPI_FLASH_SEC_SIZE, esptool_args=[], esptool_write_args=[],
esptool_read_args=[], esptool_erase_args=[]):
self.target = ParttoolTarget(port, baud, partition_table_offset, partition_table_file, esptool_args,
esptool_write_args, esptool_read_args, esptool_erase_args)
def __init__(
self,
port=None,
baud=None,
partition_table_offset=PARTITION_TABLE_OFFSET,
partition_table_file=None,
spi_flash_sec_size=SPI_FLASH_SEC_SIZE,
esptool_args=[],
esptool_write_args=[],
esptool_read_args=[],
esptool_erase_args=[],
):
self.target = ParttoolTarget(
port,
baud,
partition_table_offset,
partition_table_file,
esptool_args,
esptool_write_args,
esptool_read_args,
esptool_erase_args,
)
self.spi_flash_sec_size = spi_flash_sec_size
temp_file = tempfile.NamedTemporaryFile(delete=False)
@@ -71,8 +91,8 @@ class OtatoolTarget():
for i in range(2):
start = i * (self.spi_flash_sec_size >> 1)
seq = bytearray(self.otadata[start:start + 4])
crc = bytearray(self.otadata[start + 28:start + 32])
seq = bytearray(self.otadata[start : start + 4])
crc = bytearray(self.otadata[start + 28 : start + 32])
seq = struct.unpack('I', seq)
crc = struct.unpack('I', crc)
@@ -118,7 +138,9 @@ class OtatoolTarget():
try:
if isinstance(ota_id, int):
ota_partition_next = filter(lambda p: p.subtype - gen.MIN_PARTITION_SUBTYPE_APP_OTA == ota_id, ota_partitions)
ota_partition_next = filter(
lambda p: p.subtype - gen.MIN_PARTITION_SUBTYPE_APP_OTA == ota_id, ota_partitions
)
else:
ota_partition_next = filter(lambda p: p.name == ota_id, ota_partitions)
@@ -192,8 +214,8 @@ class OtatoolTarget():
def read_ota_partition(self, ota_id, output):
self.target.read_partition(self._get_partition_id_from_ota_id(ota_id), output)
def write_ota_partition(self, ota_id, input):
self.target.write_partition(self._get_partition_id_from_ota_id(ota_id), input)
def write_ota_partition(self, ota_id, input_file):
self.target.write_partition(self._get_partition_id_from_ota_id(ota_id), input_file)
def erase_ota_partition(self, ota_id):
self.target.erase_partition(self._get_partition_id_from_ota_id(ota_id))
@@ -205,8 +227,10 @@ def _read_otadata(target):
otadata_info = target._get_otadata_info()
print(' {:8s} \t {:8s} | \t {:8s} \t {:8s}'.format('OTA_SEQ', 'CRC', 'OTA_SEQ', 'CRC'))
print('Firmware: 0x{:08x} \t0x{:08x} | \t0x{:08x} \t 0x{:08x}'.format(otadata_info[0].seq, otadata_info[0].crc,
otadata_info[1].seq, otadata_info[1].crc))
print(
f'Firmware: {otadata_info[0].seq:#08x} \t{otadata_info[0].crc:#08x} | '
f'\t{otadata_info[1].seq:#08x} \t {otadata_info[1].crc:#08x}'
)
def _erase_otadata(target):
@@ -220,12 +244,12 @@ def _switch_ota_partition(target, ota_id):
def _read_ota_partition(target, ota_id, output):
target.read_ota_partition(ota_id, output)
status('Read ota partition contents to file {}'.format(output))
status(f'Read ota partition contents to file {output}')
def _write_ota_partition(target, ota_id, input):
target.write_ota_partition(ota_id, input)
status('Written contents of file {} to ota partition'.format(input))
def _write_ota_partition(target, ota_id, input_file):
target.write_ota_partition(ota_id, input_file)
status(f'Written contents of file {input_file} to ota partition')
def _erase_ota_partition(target, ota_id):
@@ -240,9 +264,13 @@ def main():
parser.add_argument('--quiet', '-q', help='suppress stderr messages', action='store_true')
parser.add_argument('--esptool-args', help='additional main arguments for esptool', nargs='+')
parser.add_argument('--esptool-write-args', help='additional subcommand arguments for esptool write_flash', nargs='+')
parser.add_argument('--esptool-read-args', help='additional subcommand arguments for esptool read_flash', nargs='+')
parser.add_argument('--esptool-erase-args', help='additional subcommand arguments for esptool erase_region', nargs='+')
parser.add_argument(
'--esptool-write-args', help='additional subcommand arguments for esptool write-flash', nargs='+'
)
parser.add_argument('--esptool-read-args', help='additional subcommand arguments for esptool read-flash', nargs='+')
parser.add_argument(
'--esptool-erase-args', help='additional subcommand arguments for esptool erase-region', nargs='+'
)
# There are two possible sources for the partition table: a device attached to the host
# or a partition table CSV/binary file. These sources are mutually exclusive.
@@ -250,10 +278,14 @@ def main():
parser.add_argument('--baud', '-b', help='baudrate to use', type=int)
parser.add_argument('--partition-table-offset', '-o', help='offset to read the partition table from', type=str)
parser.add_argument('--partition-table-offset', '-o', help='offset to read the partition table from', type=str)
parser.add_argument('--partition-table-file', '-f', help='file (CSV/binary) to read the partition table from; \
overrides device attached to specified port as the partition table source when defined')
parser.add_argument(
'--partition-table-file',
'-f',
help='file (CSV/binary) to read the partition table from; '
'overrides device attached to specified port as the partition table source when defined',
)
subparsers = parser.add_subparsers(dest='operation', help='run otatool -h for additional help')
@@ -269,15 +301,25 @@ def main():
slot_or_name_parser_args.add_argument('--slot', help='slot number of the ota partition', type=int)
slot_or_name_parser_args.add_argument('--name', help='name of the ota partition')
subparsers.add_parser('switch_ota_partition', help='switch otadata partition', parents=[slot_or_name_parser, spi_flash_sec_size])
subparsers.add_parser(
'switch_ota_partition', help='switch otadata partition', parents=[slot_or_name_parser, spi_flash_sec_size]
)
read_ota_partition_subparser = subparsers.add_parser('read_ota_partition', help='read contents of an ota partition', parents=[slot_or_name_parser])
read_ota_partition_subparser.add_argument('--output', help='file to write the contents of the ota partition to', required=True)
read_ota_partition_subparser = subparsers.add_parser(
'read_ota_partition', help='read contents of an ota partition', parents=[slot_or_name_parser]
)
read_ota_partition_subparser.add_argument(
'--output', help='file to write the contents of the ota partition to', required=True
)
write_ota_partition_subparser = subparsers.add_parser('write_ota_partition', help='write contents to an ota partition', parents=[slot_or_name_parser])
write_ota_partition_subparser = subparsers.add_parser(
'write_ota_partition', help='write contents to an ota partition', parents=[slot_or_name_parser]
)
write_ota_partition_subparser.add_argument('--input', help='file whose contents to write to the ota partition')
subparsers.add_parser('erase_ota_partition', help='erase contents of an ota partition', parents=[slot_or_name_parser])
subparsers.add_parser(
'erase_ota_partition', help='erase contents of an ota partition', parents=[slot_or_name_parser]
)
args = parser.parse_args()
@@ -324,7 +366,7 @@ def main():
target = OtatoolTarget(**target_args)
# Create the operation table and execute the operation
common_args = {'target':target}
common_args = {'target': target}
ota_id = []
@@ -338,18 +380,18 @@ def main():
pass
otatool_ops = {
'read_otadata':(_read_otadata, []),
'erase_otadata':(_erase_otadata, []),
'switch_ota_partition':(_switch_ota_partition, ota_id),
'read_ota_partition':(_read_ota_partition, ['output'] + ota_id),
'write_ota_partition':(_write_ota_partition, ['input'] + ota_id),
'erase_ota_partition':(_erase_ota_partition, ota_id)
'read_otadata': (_read_otadata, []),
'erase_otadata': (_erase_otadata, []),
'switch_ota_partition': (_switch_ota_partition, ota_id),
'read_ota_partition': (_read_ota_partition, ['output'] + ota_id),
'write_ota_partition': (_write_ota_partition, ['input'] + ota_id),
'erase_ota_partition': (_erase_ota_partition, ota_id),
}
(op, op_args) = otatool_ops[args.operation]
for op_arg in op_args:
common_args.update({op_arg:vars(args)[op_arg]})
common_args.update({op_arg: vars(args)[op_arg]})
try:
common_args['ota_id'] = common_args.pop('name')

View File

@@ -15,6 +15,9 @@ 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
- if: IDF_TARGET == "esp32p4"
temporary: true
reason: p4 rev3 migration # TODO: IDF-14401
disable_test:
- if: CONFIG_NAME == "recovery_bootloader" and SOC_RECOVERY_BOOTLOADER_SUPPORTED == 1 and IDF_TARGET == "esp32c61"
temporary: true

View File

@@ -1,7 +1,7 @@
#This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.22)
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/unit-test-app/components")
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/tools/test_apps/components")
set(COMPONENTS main)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

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