Compare commits

...

873 Commits

Author SHA1 Message Date
Dave Legg
fe7d0b8a80
Merge a8b4627705 into 59e1838270 2024-09-11 15:22:10 +01:00
C.S.M
59e1838270 Merge branch 'feat/gpspi_flash_support_c61' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
test(esp_flash): Enable test for spi_flash component for c61/c5/p4

Closes IDF-10313, IDF-8715, IDF-9314, IDF-10991, and IDF-8985

See merge request espressif/esp-idf!33238
2024-09-05 18:13:55 +08:00
Peter Marcisovsky
0c388cf576 Merge branch 'refactor/usb_host_add_func_ret_values_description' into 'master'
Refactor: USB Host add function return values description

Closes IDF-10455

See merge request espressif/esp-idf!32106
2024-09-05 15:20:04 +08:00
Peter Marcisovsky
ee41fc8a4c Merge branch 'fix/usb_device_composite_pytest_exception' into 'master'
ci(usb_device): Fix exception for ACM port in USB composite device pytest

See merge request espressif/esp-idf!33288
2024-09-05 15:12:37 +08:00
David Čermák
5ef55584c1 Merge branch 'feat/lwip_dns_external_resolve_hook' into 'master'
feat(lwip): Add DNS external resolve hook

See merge request espressif/esp-idf!32595
2024-09-05 15:00:17 +08:00
Island
1d8f1a584c Merge branch 'bugfix/fix_some_ble_bugs_240826' into 'master'
Fixed some BLE bugs 240826 on ESP32C3 (8ce789b)

Closes BLERP-1002, BLERP-1003, BLERP-1005, and BLERP-1004

See merge request espressif/esp-idf!33253
2024-09-05 11:34:36 +08:00
Island
c4d1c046a0 Merge branch 'feat/support_ble_scan_and_init_coex_on_esp32' into 'master'
Support BLE scanning and initiating coexist on ESP32

Closes BLERP-930, BLERP-931, BLERP-1003, and BLERP-1002

See merge request espressif/esp-idf!32791
2024-09-05 11:34:30 +08:00
Jiang Jiang Jian
e813b32a3a Merge branch 'fix/fix_esp32c2_eco4_build_issue' into 'master'
fix(wifi): fix esp32c2 eco4 build issue

See merge request espressif/esp-idf!33326
2024-09-05 10:34:58 +08:00
WanqQixiang
9c4ae855bb feat(lwip): Add DNS external hook 2024-09-05 10:09:15 +08:00
Jiang Jiang Jian
93454579ef Merge branch 'bugfix/psram_fallback_in_wifi_osi' into 'master'
fix(wifi): Add PSRAM failure fallback in WiFi OSI API's

Closes WIFIBUG-700, WIFIBUG-705, WIFIBUG-713, WIFIBUG-736, and WIFI-6592

See merge request espressif/esp-idf!32713
2024-09-04 23:07:42 +08:00
Alexey Gerenkov
a07eed67ef Merge branch 'feat/ulp_debug' into 'master'
feat(ulp): Add LP core debugging support

See merge request espressif/esp-idf!31802
2024-09-04 22:56:16 +08:00
morris
e163941205 Merge branch 'refactor/use_gdma_link_list_in_parlio_tx' into 'master'
refactor(parlio_tx): use gdma link list driver to mount buffer

See merge request espressif/esp-idf!33254
2024-09-04 20:16:09 +08:00
Erhan Kurubas
1e3c3b8738 Merge branch 'feature/esp32c5_coredump' into 'master'
ESP32-C5 enable core dump tests

Closes IDF-8661

See merge request espressif/esp-idf!30151
2024-09-04 20:08:48 +08:00
wangtao@espressif.com
5d66e8f729 fix(wifi): fix esp32c2 eco4 build issue 2024-09-04 19:56:57 +08:00
Aditya Patwardhan
1337828a0b Merge branch 'bugfix/security_guide_redirect_link' into 'master'
docs(security): add redirect link for host based workflow guide

See merge request espressif/esp-idf!33271
2024-09-04 18:30:50 +08:00
Shu Chen
f1008faa1a Merge branch 'feat/update_component_for_ot_examples' into 'master'
feat(openthread): update extension commands component for examples

See merge request espressif/esp-idf!33243
2024-09-04 17:59:54 +08:00
Jiang Jiang Jian
e963bff523 Merge branch 'bugfix/wps_pbc_overlap' into 'master'
fix(wpa_supplicant): Fix for WPS-PBC overlap detection in dual band

Closes WIFIBUG-680

See merge request espressif/esp-idf!32690
2024-09-04 17:42:45 +08:00
Shen Meng Jing
5ec3bebf00 Merge branch 'docs/translate_esp_timer' into 'master'
docs: Provide Chinese translation for esp_timer

Closes DOC-8234

See merge request espressif/esp-idf!31814
2024-09-04 16:50:37 +08:00
chenjianhua
83ea37bcfc feat(bt): Update esp32 bt-lib(bc393dd)
- Fixed BLE vendor HCI set scan perfer address command
- Support BLE vendor HCI get controller compile version command
- Support BLE scanning and initiating coexist
2024-09-04 16:45:26 +08:00
Wang Tao
e43ded7ed5 Merge branch 'feat/support_esp32c2_eco4' into 'master'
feat(wifi):support esp32c2 chip version 2.0 wifi

Closes WIFI-6637、IDF-10216、WIFI-6669

See merge request espressif/esp-idf!32511
2024-09-04 16:28:25 +08:00
Wang Meng Yang
89712154a8 Merge branch 'bugfix/fix_hid_cod_setting' into 'master'
Bugfix/fix hid cod setting

Closes IDFGH-12624 and IDFGH-13305

See merge request espressif/esp-idf!33219
2024-09-04 15:16:19 +08:00
shenmengjing
26c8cae4dd docs: Provide Chinese translation for esp_timer 2024-09-04 14:51:36 +08:00
Nachiket Kukade
94a915fd5c fix(wifi): Add PSRAM failure fallback in WiFi Queue API's 2024-09-04 11:02:06 +05:30
Zhu Li Qun
b9c58c550c Merge branch 'bugfix/fix_s3c3_wrong_ext32k_config_bug' into 'master'
fix(ext_32k): fix the external 32K issue on C3&S3

See merge request espressif/esp-idf!33150
2024-09-04 11:30:55 +08:00
Adam Múdry
98cf50d140 Merge branch 'fix/nvs_tool_false_duplicate_warning' into 'master'
fix(nvs): nvs_tool.py refactor, reduce false duplicate warnings, add a test

Closes IDF-10684

See merge request espressif/esp-idf!32449
2024-09-04 11:05:44 +08:00
Armando (Dou Yiwen)
85bc5acfc7 Merge branch 'change/sdmmc_ll_layer' into 'master'
sdmmc: full ll layer

Closes IDF-10544 and IDF-10251

See merge request espressif/esp-idf!33156
2024-09-04 10:54:37 +08:00
Xu Si Yu
7f0a140f46 feat(openthread): update extension commands component for examples 2024-09-04 10:40:14 +08:00
Wan Lei
3606d9ebf7 Merge branch 'fix/soc_and_iomux_macro_refactor' into 'master'
fix(driver_spi): move spi related macros out from soc.h and iomux_reg.h

See merge request espressif/esp-idf!32953
2024-09-04 10:35:11 +08:00
wangtao@espressif.com
82a951447a feat(wifi): update esp32c2 eco4 wifi lib 2024-09-04 10:31:33 +08:00
Chen Jichang
35c6e44181 refactor(parlio_tx): use gdma link list driver to mount buffer 2024-09-04 10:20:01 +08:00
Alexey Gerenkov
625c437412 feat(ulp): Add LP core debugging support 2024-09-03 18:28:14 +03:00
Peter Marcisovsky
db6e37c975 ci(usb_device): Fix exception for ACM port in USB composite dev pytest 2024-09-03 17:05:34 +02:00
Shen Meng Jing
6bfa408c7b Merge branch 'docs/update_ulp_lp_core_ulp_risc_v_cn' into 'master'
docs: Update the CN translation for ulp-lp-core.rst and ulp-risv-v.rst

See merge request espressif/esp-idf!32692
2024-09-03 21:50:59 +08:00
Shen Meng Jing
1611d1344f Merge branch 'docs/translate_style_guide' into 'master'
docs: Provide CN translation for style-guide

Closes DOC-8255

See merge request espressif/esp-idf!31886
2024-09-03 21:11:01 +08:00
Jiang Jiang Jian
2726023db4 Merge branch 'bugfix/support_c5mp_phy_sleep' into 'master'
fix(phy): update c5 libphy to support sleep, fix wifi coex scan no app issue, fix ble rx crc err

Closes WIFIBUG-682

See merge request espressif/esp-idf!33263
2024-09-03 19:37:59 +08:00
shenmengjing
5214656421 docs: Update the CN translation for ulp-lp-core.rst and ulp-risv-v.rst 2024-09-03 19:29:55 +08:00
shenmengjing
07c3be3398 docs: Provide CN translation for style-guide 2024-09-03 19:21:50 +08:00
Roman Leonov
6ee1c300c2 Merge branch 'refactor/usb_host_ext_port_prereq' into 'master'
refactor(ext_hub): Prerequisites for the Ext Port Driver

See merge request espressif/esp-idf!32213
2024-09-03 19:17:22 +08:00
Mahavir Jain
2b806c9772 Merge branch 'feature/update_security_docs_for_c61' into 'master'
feat: update security documents for ESP32C61

Closes IDF-10154, IDF-10155, IDF-10156, IDF-10157, and IDF-10158

See merge request espressif/esp-idf!31959
2024-09-03 19:11:09 +08:00
Gao Xu
c83bf0c3df Merge branch 'feature/support_isp_color' into 'master'
feat(isp): support color on P4

Closes IDF-10495

See merge request espressif/esp-idf!32901
2024-09-03 18:42:26 +08:00
Aleksei Apaseev
4f399061e7 Merge branch 'ci/print_retry_job_message_optionally' into 'master'
ci: add condition to print retry job message in dynamic pipeline report if any job has failed

See merge request espressif/esp-idf!33211
2024-09-03 18:35:22 +08:00
Fu Hanxi
5df76105d6 Merge branch 'ci/fix_test_freertos_markers' into 'master'
ci: fix test_freertos markers

Closes IDFCI-2358

See merge request espressif/esp-idf!33273
2024-09-03 18:20:49 +08:00
Zhang Xiao Yan
c8de3754df Merge branch 'docs/add_application_examples_bluetooth' into 'master'
docs: update application examples for bluedroid and blufi

See merge request espressif/esp-idf!32185
2024-09-03 18:07:05 +08:00
wangtao@espressif.com
f82c7ee4d1 fix(rom):fix esp32c2 eco4 ld comments 2024-09-03 17:50:40 +08:00
wangtao@espressif.com
ef1c62b67d fix(wifi): fix esp32c2 eco4 ld 2024-09-03 17:50:40 +08:00
wangtao@espressif.com
fef76de1ce feat(wifi): support esp32c2 eco4 wifi bringup 2024-09-03 17:50:39 +08:00
Jiang Guang Ming
53272f7d11 feat(esp_rom): Add esp32c2.rom.eco4.ld 2024-09-03 17:50:39 +08:00
Jiang Guang Ming
7d2752dacd feat(esp_hw_support): Support esp32c2 rev2.0 chip 2024-09-03 17:50:39 +08:00
Armando
a1da4f8a01 feat(sdmmc): sdmmc full ll layer 2024-09-03 17:03:42 +08:00
Linda
1650681d64 docs: update application examples for bluedroid and blufi 2024-09-03 16:11:33 +08:00
aditi
e145e04fca fix(wpa_supplicant): Fix for WPS-PBC overlap detection in dual band
When WPS is running on dual band(e.g. a separate 2.4 GHz and 5 GHz band
    radios in an AP device), detect pbc overlap only if UUID differs.
2024-09-03 13:07:36 +05:30
Fu Hanxi
3c30341cfd
ci: fix test_freertos markers 2024-09-03 09:34:09 +02:00
C.S.M
0878ff90d6 test(esp_flash): Enable test for spi_flash component for c61/c5 2024-09-03 15:22:45 +08:00
Mahavir Jain
6a29e01a9e
docs(security): add redirect link for host based workflow guide 2024-09-03 12:36:26 +05:30
gaoxu
7b71d7aaac feat(isp_color): support ISP color on P4 2024-09-03 14:52:46 +08:00
Aleksei Apaseev
5a88c4d1ab ci: add condition to print retry job message in dynamic pipeline report if any job has failed
- Updated `generate_jobs_report` function to check if any job in the list has `is_failed = True`.
- Improved code readability and maintainability by reducing complexity in the `post_report` method.
2024-09-03 14:51:13 +08:00
C.S.M
ec3029ebb3 Merge branch 'test/p4_lp_i2c' into 'master'
feature(i2c): Support esp32p4 lp i2c instance

Closes IDF-7490

See merge request espressif/esp-idf!33249
2024-09-03 14:47:54 +08:00
Mahavir Jain
5be4aca831 Merge branch 'feature/update_security_docs_for_c5' into 'master'
feat: updated security docs for ESP32C5

Closes IDF-9476, IDF-9501, and IDF-9499

See merge request espressif/esp-idf!32928
2024-09-03 14:22:25 +08:00
Mahavir Jain
60890e9093 Merge branch 'ci/enable_mbedtls_psram_tests_for_p4_c5' into 'master'
Enable mbedtls' PSRAM-related tests for ESP32-P4 and ESP32-C5

See merge request espressif/esp-idf!33228
2024-09-03 14:21:01 +08:00
Tomas Rezucha
19d488370f Merge branch 'feat/usb_ls_p4' into 'master'
Fix USB Low-Speed devices on ESP32-P4

Closes IDF-9565

See merge request espressif/esp-idf!33201
2024-09-03 13:59:59 +08:00
wanckl
19c6e77a31 fix(mspi): collect mspi iomux pin macro from iomux_reg.h to spi_pins.h 2024-09-03 13:55:00 +08:00
wanckl
473f39c31f fix(driver_spi): move macro GPIO_MATRIX_DELAY_NS out from soc.h 2024-09-03 13:55:00 +08:00
Rahul Tank
259b7009e9 Merge branch 'bugfix/correct_per_adv_sync_enable' into 'master'
fix(nimble): Corrected parameters assignment in per_adv_transfer_enable

Closes BLERP-891

See merge request espressif/esp-idf!32317
2024-09-03 13:47:53 +08:00
Wan Lei
ae5c7d46d1 Merge branch 'ci/enable_c61_target_test' into 'master'
ci(esp32c61): enable c61 generic target test

Closes IDF-9285 and IDF-9288

See merge request espressif/esp-idf!33088
2024-09-03 11:53:02 +08:00
C.S.M
f3eec83421 test(i2c): Support test for esp32p4 lp i2c 2024-09-03 11:23:02 +08:00
liuning
0833cc9bcb fix(phy): update c5 libphy to support sleep, fix wifi coex scan no app issue, fix ble rx crc err
phy_version: 102, 91c24e2, Sep  2 2024
2024-09-03 09:53:03 +08:00
Peter Marcisovsky
f7b31defc9 refactor(usb_host): Fixed function return values in usb_host stack:
- updated doxygen for the whole usb_host stack
    - doxygen for test_apps is not updated
    - fixed error codes propagation problems in the usb_host stack
2024-09-02 16:41:38 +02:00
Song Ruo Jing
b6916ca304 Merge branch 'bugfix/custom_console_uart_pins_c5_c61' into 'master'
fix(uart): make custom console uart TX/RX pins same to the default console uart pins

See merge request espressif/esp-idf!33110
2024-09-02 21:26:56 +08:00
Peter Marcisovsky
81ad0eb544 Merge branch 'ci/add_advanced_usb_cdc_ci' into 'master'
Refactor(console): merge console advanced and advanced_usb_cdc examples

Closes IDF-9676 and DOC-8784

See merge request espressif/esp-idf!29626
2024-09-02 21:15:19 +08:00
Tomas Rezucha
ba16f50560 refactor(usb/host): Move P4 HS PHY function to correct LL file
Moved usb_wrap_ll_enable_precise_detection() in usb_wrap_ll.h
to usb_utmi_ll_enable_precise_detection() in usb_utmi_ll.h

Fixes commit 97d30e7c48
2024-09-02 14:39:28 +02:00
Tomas Rezucha
21c6c62087 fix(usb/host): Fix USB Low Speed devices connection on P4
P4 USB UTMI PHY was updated to specification v2.0
2024-09-02 14:39:22 +02:00
Roman Leonov
a971ddf17a refactor(ext_hub): Added port creation and freeing, cleaned up members 2024-09-02 14:25:21 +02:00
chenjianhua
832e728ac3 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(8ce789b)
- Fixed BLE vendor HCI set scan perfer address command
- Support BLE vendor HCI get controller compile version command
- Fixed BLE util buffer free after controller reset
- Fixed assert when connection already exist and be connected again
2024-09-02 20:08:31 +08:00
zlq
f567341168 fix(ext_32k): fix the external 32K issue on C3&S3 2024-09-02 19:33:30 +08:00
wanckl
4e095f4b9f ci(esp32c61): enable c61 generic target test 2024-09-02 19:26:12 +08:00
morris
a82b8565b7 Merge branch 'feat/add_ek79007_mipi_dsi' into 'master'
feat(lcd): adapt the mipi_dsi example for the EK79007 LCD IC

See merge request espressif/esp-idf!32499
2024-09-02 17:42:42 +08:00
Mahavir Jain
cd8009dc5b Merge branch 'fix/flash_encryption_for_esp32p4' into 'master'
fix(security): Fixed flash encryption for esp32p4

See merge request espressif/esp-idf!33018
2024-09-02 17:28:39 +08:00
Ondrej Kosta
b9f4822dcb Merge branch 'bugfix/eth_plus_wifi_doc' into 'master'
docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi

Closes DOC-8459

See merge request espressif/esp-idf!32736
2024-09-02 16:15:28 +08:00
Zhang Xiao Yan
360bbd62b8 Merge branch 'docs/update_application_examples_esp_nan_wifi_security' into 'master'
docs: update application examples for esp_nan.rst, esp_dpp.rst and wifi-security.rst

See merge request espressif/esp-idf!32209
2024-09-02 16:00:20 +08:00
Kevin (Lao Kaiyao)
9a5a94e75d Merge branch 'bugfix/fix_some_minor_issue_in_i2s_and_isp' into 'master'
fix: fix minor issues in isp and i2s

See merge request espressif/esp-idf!33224
2024-09-02 15:29:34 +08:00
morris
fe09637123 feat(lcd): support EK79007 LCD in the mipi dsi example 2024-09-02 15:24:53 +08:00
Song Ruo Jing
e1f27d04ed fix(uart): enable ci target test for uart for c5 2024-09-02 15:24:29 +08:00
Song Ruo Jing
8e53e91ec9 fix(uart): make custom console uart pins same to the default console uart pins 2024-09-02 15:24:29 +08:00
Peter Marcisovsky
82a4c12817 refactor(console/advanced): Merge console advanced and advanced_usb_cdc examples
- removed examples/system/console/advanced_usb_cdc
    - refactor resulting console/advanced example
    - enabled advanced console for all peripherals (UART, USB_OTG, USB_JTAG)
    - added pytest to check UART console output
    - update docs
2024-09-02 09:14:42 +02:00
Sudeep Mohanty
d3631b3afa Merge branch 'fix/adc_channel_num_caps' into 'master'
fix(adc): Corrected the ADC channel number caps for esp32p4

See merge request espressif/esp-idf!33141
2024-09-02 14:37:17 +08:00
nilesh.kale
3550e36a68 feat: updated security docs for ESP32C5
This commit modified document files for ESP32C5.
This revised chnages for security components, RNG, provisioning and
some minor changes in sample output for flash encryption example.
2024-09-02 11:50:07 +05:30
laokaiyao
7ac567df96 fix: fix minor issues in isp and i2s 2024-09-02 14:07:05 +08:00
Mahavir Jain
02da65314b Merge branch 'feat/adding_test_case_anti_rollback_and_flash_encryption' into 'master'
feat(ota): Added test for checking flash encryption and anti-rollback enabled

Closes IDF-9200

See merge request espressif/esp-idf!32951
2024-09-02 14:04:45 +08:00
Zhang Shu Xian
ff3e93af28 Merge branch 'docs/update_application_examples_of_uart' into 'master'
docs: Update the application examples in uart.rst

See merge request espressif/esp-idf!32653
2024-09-02 14:03:26 +08:00
Zhang Xiao Yan
8c8e9ae546 Merge branch 'docs/update_aplication_wifi' into 'master'
docs: update application examples for wifi.rst

See merge request espressif/esp-idf!32214
2024-09-02 14:02:51 +08:00
Aditya Patwardhan
d1c47835a2 fix(security): Fixed flash encryption for esp32p4
The flash encryption on esp32p4 was broken due to some code related
    to key manager not being executed when key manager support was
    disabled on esp32p4 target.
    This commit fixes that behaviour
    Additionally, the atomic env enablement for
    key_mgr_ll_enable_peripheral_clock was fixed.
2024-09-02 14:00:55 +08:00
nilesh.kale
1011cee7a7 feat: udpate security docs for c61 and c5
This commit update security documents for ESP32C61.
2024-09-02 11:04:38 +05:30
Island
53b7d63ba5 Merge branch 'fix/fix_length_ble_get_started_example' into 'master'
fix(ble): Increased the length of addr_str in ble_get_started nimble examples

Closes BLERP-979

See merge request espressif/esp-idf!33203
2024-09-02 12:13:39 +08:00
Xu Xiao
a3274e502e Merge branch 'chip/esp32c61_mp_support_wifi' into 'master'
esp32c61 mp support wifi

See merge request espressif/esp-idf!32960
2024-09-02 12:06:53 +08:00
Marius Vikhammer
7cf872e610 Merge branch 'bugfix/eh_frame_backtrace' into 'master'
fix(system): fixed eh-frame backtrace issue from WDT

See merge request espressif/esp-idf!33112
2024-09-02 11:48:58 +08:00
Omar Chebib
c68c404cdc Merge branch 'fix/xtensa_nmi' into 'master'
fix(esp_hw_support): make the NMI interrupts available for the main application

Closes IDF-1891 and IDFGH-12631

See merge request espressif/esp-idf!32767
2024-09-02 11:18:32 +08:00
Wan Lei
8410392567 Merge branch 'change/c61_twai_removal' into 'master'
change(twai): removal c61 twai due to not exist

Closes IDF-9336

See merge request espressif/esp-idf!33202
2024-09-02 10:40:18 +08:00
Linda
74ec959b38 docs: update application examples for wifi.rst 2024-09-02 10:36:11 +08:00
Island
9c25d54cb8 Merge branch 'bugfix/fixed_assert_on_esp32c2' into 'master'
fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2

See merge request espressif/esp-idf!33204
2024-09-02 10:08:10 +08:00
Zhang Shuxian
a79159f5e1 docs: Update the application examples in uart.rst 2024-09-02 09:49:38 +08:00
Wang Tao
6673376297 Merge branch 'change/improve_some_wifi_releated_introduction' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
change(wifi):improve some wifi releated introduction

Closes IDFGH-8937 and IDFGH-8908

See merge request espressif/esp-idf!32409
2024-08-31 14:58:48 +08:00
Linda
09b53af171 docs: update application examples for esp_nan.rst, esp_dpp.rst and wifi-security.rst 2024-08-31 09:57:21 +08:00
Adam Múdry
347800bcda Merge branch 'fix/sdmmc_host_init_slot_possible_bad_shift_op' into 'master'
Some checks are pending
docker / docker (push) Waiting to run
fix(sdmmc): Fix possible bad bit shift operation

Closes IDF-10759

See merge request espressif/esp-idf!32885
2024-08-30 23:55:14 +08:00
Adam Múdry
05b356f87f feat(nvs): Test nvs_partition_gen.py and nvs_check.py with pytest
Little fixes in nvs_check.py
2024-08-30 16:21:42 +02:00
xuxiao
7c9109d9e1 fix(wifi): fix code comments 2024-08-30 21:02:02 +08:00
Adam Múdry
24c1f084d0 fix(sdmmc): Fix possible bad bit shift operation and check if GPIO pins are valid 2024-08-30 15:01:10 +02:00
xuxiao
506bff240b feat(wifi): add SPIRAM wifi support for esp32c5 and esp32c61 2024-08-30 20:43:06 +08:00
liuning
418c856db0 feat(coex): support esp32c61 coex support 2024-08-30 20:43:06 +08:00
xuxiao
8780375859 feat(wifi): add wifi support for esp32c61 2024-08-30 20:43:06 +08:00
Jiang Jiang Jian
bf0eeb633f Merge branch 'bugfix/gcmp_reason_code' into 'master'
fix(esp_wifi): Fix reason code for sta not supporting GCMP

Closes WIFIBUG-721

See merge request espressif/esp-idf!32902
2024-08-30 20:42:14 +08:00
harshal.patil
945ad6ea5d
ci(mbedtls): Enable PSRAM-related tests for ESP32-P4 and ESP32-C5 2024-08-30 17:19:12 +05:30
Erhan Kurubas
23bc6eac43 test(coredump): enable esp32c5 coredump tests 2024-08-30 13:17:44 +03:00
Erhan Kurubas
e9f4fa08d6 docs(coredump): update esp32c5 docs_not_updated 2024-08-30 13:17:44 +03:00
Jiang Jiang Jian
d0be11adfc Merge branch 'bugfix/esp32_rx_sense' into 'master'
fix(phy): fix esp32 rx sense issue

See merge request espressif/esp-idf!32979
2024-08-30 17:38:13 +08:00
Erhan Kurubas
d91ac9a261 Merge branch 'fix/coredump_tests' into 'master'
test(coredump): fix failed core dump tests

Closes IDFCI-2202 and IDFCI-2349

See merge request espressif/esp-idf!32796
2024-08-30 17:08:05 +08:00
Zhang Xiao Yan
e25e164241 Merge branch 'docs/format_establish_serial_connection' into 'master'
docs: format establish-serial-connection.rst

See merge request espressif/esp-idf!32636
2024-08-30 17:08:04 +08:00
hrushikesh.bhosale
99f0e1b526 feat(ota): Added test for checking flash encryption and anti-rollback enabled
Added test to check if flash encryption and anti-rollback enbaled
together. Added marked pytest.mark.flash_encryption to advanced OTA
test.
2024-08-30 14:11:33 +05:30
aditi
b175f84a47 fix(esp_wifi): Fix reason code for sta not supporting GCMP
Add fix for returning correct reason code when sta doesn't
     support GCMP to ensure consistent behaviour for all chips.
2024-08-30 13:30:56 +05:30
Kevin (Lao Kaiyao)
1d0d121861 Merge branch 'bugfix/i2s_dma_buf_saturation_on_p4' into 'master'
fix(i2s): fixed alignment of max DMA buffer length on P4

Closes IDFGH-13559

See merge request espressif/esp-idf!33134
2024-08-30 15:42:16 +08:00
liqigan
976066d537 fix(esp_hid): Fixed protocol mode mapping bug
Closes https://github.com/espressif/esp-idf/issues/14232
2024-08-30 15:37:14 +08:00
liqigan
53bb819e88 feat(bt/bluedroid): Added definition of minor class of COD for peripheral major class
Closes https://github.com/espressif/esp-idf/issues/13622
2024-08-30 15:37:17 +08:00
Kevin (Lao Kaiyao)
b71768b742 Merge branch 'feature/support_apll_on_p4' into 'master'
feat(clock): support apll clock on p4

Closes IDF-8884

See merge request espressif/esp-idf!33101
2024-08-30 14:45:57 +08:00
Sudeep Mohanty
dfe20e46a1 Merge branch 'task/add_ldgen_exception_for_freertos' into 'master'
fix(freertos): Added freertos and ringbuf fragments to the exception list of ldgen mapping checks

Closes IDF-10489

See merge request espressif/esp-idf!32702
2024-08-30 14:43:44 +08:00
zwl
951d6e44eb fix(ble): fixed crash issue during deinit host after deinit controller on ESP32-C2 2024-08-30 11:46:13 +08:00
Yuhan Wei
3a1c212b41 fix(ble): Increased the length of addr_str in README.md 2024-08-30 11:45:36 +08:00
Yuhan Wei
77c17de379 fix(ble): Increased the length of addr_str in ble_get_started nimble examples 2024-08-30 11:38:25 +08:00
Omar Chebib
1157a27964 Merge branch 'bugfix/intr_alloc_rom_handler' into 'master'
fix(esp_hw_support): allow allocating interrupts with handlers in ROM with IRAM attribute

Closes IDF-7971

See merge request espressif/esp-idf!32561
2024-08-30 10:50:49 +08:00
Zhang Shu Xian
42e852a165 Merge branch 'docs/update_application_examples_of_lcd' into 'master'
Draft: docs: Update the application examples in lcd/index.rst

See merge request espressif/esp-idf!32648
2024-08-30 09:40:39 +08:00
Zhang Shu Xian
87859c5629 Draft: docs: Update the application examples in lcd/index.rst 2024-08-30 09:40:38 +08:00
wanckl
e9d4e99a2a change(twai): removal c61 twai due to not exist 2024-08-29 21:23:50 +08:00
Mahavir Jain
6e5414b6c4 Merge branch 'bugfix/add_bluedroid_support_for_esp_ip' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
fix(wifi_prov): Add support for ESP IP controller chips in bluedroid

Closes MEGH-5841

See merge request espressif/esp-idf!32465
2024-08-29 20:30:05 +08:00
Li Shuai
1fa27cbb0d Merge branch 'feature/esp32c5mp_light_sleep_support_stage_2' into 'master'
feat(esp_hw_support): esp32c5mp sleep support (system part)

Closes IDF-8643, PM-195, PM-169, IDF-8641, IDF-8640, IDF-8639, IDF-8638, CV-259, IDF-10308, IDF-10317, IDF-10310, PM-202, IDF-10918, PM-207, PM-208, PM-210, and PM-214

See merge request espressif/esp-idf!31645
2024-08-29 19:32:05 +08:00
laokaiyao
462698f2de change(i2s): add warning for inaccurate sample rate 2024-08-29 19:03:19 +08:00
laokaiyao
fe80989a17 fix(i2s): fixed alignment of max DMA buffer length on P4
Closes https://github.com/espressif/esp-idf/issues/14448
2024-08-29 19:03:06 +08:00
laokaiyao
3937e225ec feat(clock): support apll clock on p4 2024-08-29 18:44:05 +08:00
Mahavir Jain
2526ebdaa9 Merge branch 'feat/support_memory_protection_for_esp32c61' into 'master'
Support memory protection for esp32c61

Closes IDF-9580

See merge request espressif/esp-idf!33103
2024-08-29 18:40:38 +08:00
C.S.M
89c808c26c Merge branch 'bugfix/i2c_master_stretch_to' into 'master'
fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout seems not work

Closes IDFGH-13191 and IDFGH-13508

See merge request espressif/esp-idf!33014
2024-08-29 17:29:30 +08:00
Rahul Tank
338d9f40d9 fix(wifi_prov): Add support for ESP IP controller chips in bluedroid 2024-08-29 14:56:46 +05:30
morris
796d40a6a7 Merge branch 'change/deprecate_gdma_new_channel_api' into 'master'
change(gdma): deprecate legacy API

See merge request espressif/esp-idf!33148
2024-08-29 16:39:24 +08:00
Armando (Dou Yiwen)
d7b701bfa0 Merge branch 'feat/isp_demosaic' into 'master'
isp: demosaic

Closes IDF-10519

See merge request espressif/esp-idf!33111
2024-08-29 16:13:27 +08:00
Zhang Wen Xu
7c47596ead Merge branch 'fix/oob_issue_found_by_cid' into 'master'
fix(802.15.4): fix oob issue for pending table

Closes IDF-10936, IDF-10937, IDF-10938, IDF-10939, IDF-10940, and IDF-10941

See merge request espressif/esp-idf!33160
2024-08-29 14:49:20 +08:00
Island
bb5f95fcc3 Merge branch 'refactor/ble_example_print_on_bluedroid' into 'master'
refactor(bt/bluedroid): Refactor the print for CI example test

Closes BLERP-904 and BLERP-910

See merge request espressif/esp-idf!32513
2024-08-29 14:43:30 +08:00
Omar Chebib
18d545708a fix(esp_hw_support): allow allocating interrupts with handlers in ROM with IRAM attribute
The interrupt allocator now allows allocating an interrupt with a handler in ROM
and flags set to ESP_INTR_FLAG_IRAM
2024-08-29 14:21:43 +08:00
Lou Tianhao
4393343ac9 fix(ci): some actions taken to pass ci 2024-08-29 14:15:41 +08:00
Armando (Dou Yiwen)
7a5c05e7c0 Merge branch 'feat/sdspi_c5' into 'master'
sdspi: support on c5

Closes IDF-8704

See merge request espressif/esp-idf!32635
2024-08-29 14:03:44 +08:00
Omar Chebib
928859307f fix(esp_hw_support): make the NMI interrupts available for the main application
Closes https://github.com/espressif/esp-idf/issues/13629

NMI interrupt level has been freed for all the Xtensa targets, making it possible
for the main application to use it. An example has been added to show how to
proceed.
2024-08-29 13:55:47 +08:00
Mahavir Jain
966f2c6a5b Merge branch 'docs/secure_boot_rsa_pss' into 'master'
docs(secure_boot_v2): OpenSSL command for generating and verifying signatures

Closes ESPTOOL-787

See merge request espressif/esp-idf!31204
2024-08-29 11:40:49 +08:00
Armando
87d8a5154e feat(isp): added demosaic programming guide 2024-08-29 10:46:37 +08:00
Armando
2133ca9522 test(sd): added .cpp build test 2024-08-29 09:06:02 +08:00
Armando
af4315a2b1 test(sdspi): enabled sdspi test on s3 2024-08-29 09:06:02 +08:00
Armando
29bf116021 fix(sdspi): fixed sdspi on p4 2024-08-29 09:06:02 +08:00
Armando
c13f35a7cf feat(sdspi): support sdspi on c5 2024-08-29 09:06:02 +08:00
Armando
d215fa6cdb feat(sdspi): supported tuning clock duty cycle 2024-08-29 09:05:43 +08:00
wanckl
ab53d300d0 feat(esp_driver_spi): add config for data io default level 2024-08-29 09:05:43 +08:00
Marius Vikhammer
8fcc57b12f Merge branch 'contrib/github_pr_12449' into 'master'
Use correct clang flag for size optimization (GitHub PR)

Closes IDFGH-11295

See merge request espressif/esp-idf!33083
2024-08-29 08:40:40 +08:00
Wan Lei
bde735fe3f Merge branch 'fix/p4_spi_dma_cache_conflict_issue' into 'master'
fix(driver_spi): fix p4 cache auto writeback issue during spi(dma) rx

Closes IDF-10433

See merge request espressif/esp-idf!33125
2024-08-28 20:15:42 +08:00
Island
66cb82a446 Merge branch 'docs/optimized_ble_gattc_multi_connect_example' into 'master'
docs(ble/bluedroid): Optimize BLE example documentation for getting characteristic

Closes IDFGH-13526 and IDFGH-13463

See merge request espressif/esp-idf!33063
2024-08-28 18:02:27 +08:00
zwx
1c319ce9c2 fix(802.15.4): fix oob issue for pending table 2024-08-28 17:36:44 +08:00
wangtao@espressif.com
6eb6f9b363 change(wifi):improve some wifi releated introduction 2024-08-28 16:53:13 +08:00
Erhan Kurubas
99b89b726d Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20240821' into 'master'
feat(tools): update openocd version to v0.12.0-esp32-20240821

See merge request espressif/esp-idf!33094
2024-08-28 16:52:47 +08:00
Erhan Kurubas
3ef9750005 test(coredump): fix failed core dump tests 2024-08-28 11:12:39 +03:00
morris
39cbba3685 change(gdma): deprecate legacy API
gdma_new_channel() is replaced by gdma_new_ahb_channel() and
gdma_new_axi_channel()
2024-08-28 15:27:35 +08:00
Shu Chen
51cd6e9291 Merge branch 'feat/support_config_to_reply_ns_without_ll_opt' into 'master'
feat(lwip): reply the NS without LL opt

See merge request espressif/esp-idf!32671
2024-08-28 15:19:39 +08:00
Island
6c59cda5b1 Merge branch 'debug/fix_deep_sleep_wake_up_by_ble' into 'master'
fix(ble): fix BLE immediately  wakeup deep sleep

Closes BLERP-846 and BLERP-943

See merge request espressif/esp-idf!31916
2024-08-28 15:13:10 +08:00
chenjianhua
a56d18383b refactor(bt/bluedroid): Refactor the print for gatt_server and gatt_client example 2024-08-28 14:51:12 +08:00
Wang Meng Yang
59066e3edf Merge branch 'contrib/github_pr_14286' into 'master'
fix(bt): Enable use of RESERVED bits in COD (GitHub PR)

Closes IDFGH-13374

See merge request espressif/esp-idf!32549
2024-08-28 14:03:57 +08:00
Wang Meng Yang
17f422cc33 Merge branch 'fix/hfp_pcm_codec' into 'master'
fix(bt/bluedroid): Fix default codec type on PCM datapath for hfp_hf

See merge request espressif/esp-idf!32878
2024-08-28 14:03:06 +08:00
Jiang Jiang Jian
b2a3e49635 Merge branch 'fix/fix_esp32s2_get_ack_rssi_issue' into 'master'
fix(wifi): fix esp32s2 get ack rssi issue

See merge request espressif/esp-idf!33127
2024-08-28 14:00:36 +08:00
harshal.patil
eec9197d47
feat(cpu_region_protect): Support memory protection in ESP32-C61 2024-08-28 11:16:28 +05:30
harshal.patil
dc61456ad8
feat(cpu_region_protect): Protect I/D-ROM memory split 2024-08-28 11:16:27 +05:30
harshal.patil
95f286555a
fix(esp_hw_support): Use _iram_text_end instead of _iram_end for I/D-RAM split 2024-08-28 11:16:27 +05:30
Wan Lei
dbcff0e941 Merge branch 'feat/c61_spi_support' into 'master'
feat(driver_spi): c61 spi support

Closes IDF-9299, IDF-9300, IDF-9301, and IDF-10002

See merge request espressif/esp-idf!32918
2024-08-28 12:37:10 +08:00
Song Ruo Jing
315796f96c Merge branch 'contrib/github_pr_14392' into 'master'
Update uart_select_example_main.c (GitHub PR)

Closes IDFGH-13497

See merge request espressif/esp-idf!32913
2024-08-28 12:15:41 +08:00
Liu Xiao Yu
17ddda01a8 Merge branch 'bugfix/rm_redefined_gpio_num' into 'master'
fix(ulp): remove redefinition and unify gpio enum in ulp

Closes IDFGH-13547

See merge request espressif/esp-idf!33076
2024-08-28 12:06:05 +08:00
Mahavir Jain
e93e09de3f Merge branch 'fix/https_request_mbedtls_config_build_failure' into 'master'
Fix https_request example build failure for mbedtls_config

Closes IDFCI-2336

See merge request espressif/esp-idf!33016
2024-08-28 12:04:34 +08:00
Zhang Xiao Yan
1cf4becc5f Merge branch 'docs/update_application_example_esp_now_mesh' into 'master'
docs: update application examples for esp_now.rst and esp-wifi-mesh.rst

See merge request espressif/esp-idf!32215
2024-08-28 10:50:18 +08:00
Lou Tianhao
02f5e0f98c change(pm): remove rc32k for esp32c5 2024-08-28 10:44:09 +08:00
Li Shuai
debb6ab6a1 change(hal): add hal interface to configure pau regdma wait timeout parameter 2024-08-28 10:44:09 +08:00
Lou Tianhao
d6737c3207 refactor(esp_hw_support): refactor sleep clock, split it to support multiple targets 2024-08-28 10:44:08 +08:00
Li Shuai
5e82899305 fix(esp_hw_support): fix the issue of regdma wait node to immediately return to done caused by regdma wait mode comparator 2024-08-28 10:44:08 +08:00
Lou Tianhao
5e5fb89c10 change(esp_hw_support): modify the root clock source of pmu modem state to pll for esp32c5 2024-08-28 10:44:08 +08:00
Lou Tianhao
bfba80b778 fix(pm): write back cache for psram and hold psram cs1
squash! fix(pm): write back cache for psram and hold psram cs1
2024-08-28 10:44:08 +08:00
Lou Tianhao
47a0677525 feat(pm): support ext1_wakeup/esp_deep_sleep_enable_gpio_wakeup for esp32c5mp deepsleep 2024-08-28 10:44:08 +08:00
Lou Tianhao
04485a655f change(esp_hw_support): set cpu clk 80m by selecting source pll240m and divider 3
squash! change(esp_hw_support): set cpu clk 80m by selecting source pll240m and divider 3

squash! change(esp_hw_support): set cpu clk 80m by selecting source pll240m and divider 3

squash! change(esp_hw_support): set cpu clk 80m by selecting source pll240m and divider 3
2024-08-28 10:44:08 +08:00
Li Shuai
538e3a767b fix(esp_hw_support): fix regdma timeout when restore soc register context
squash! fix(esp_hw_support): fix regdma timeout when restore soc register context

squash! fix(esp_hw_support): fix regdma timeout when restore soc register context
2024-08-28 10:44:08 +08:00
Li Shuai
86e384b563 fix(esp_hw_support): fix mmu memory powered down issue by software backup and restore mmu table content 2024-08-28 10:44:08 +08:00
Lou Tianhao
4a124913c4 fix(pm): mspi cannot access flash when pd pll source 2024-08-28 10:44:08 +08:00
Lou Tianhao
d891995a7a feat(pm): support sleep_gpio for esp32c5 2024-08-28 10:44:08 +08:00
Lou Tianhao
ef8ff691aa change(esp_hw_support): update pmu sleep analog parameter
change(pm): update pmu analog param for pu xtal or pu rc_fast during sleep

change(pm): update pmu analog param for reducing the impact of temperature on chip voltage
2024-08-28 10:44:08 +08:00
Lou Tianhao
24aa547c80 change(esp_hw_support): change regdma link entry num 2024-08-28 10:44:08 +08:00
Lou Tianhao
a0da9ade35 feat(esp_hw_support): support top domain powered down during sleep for esp32c5 2024-08-28 10:44:08 +08:00
Lou Tianhao
50791931a1 feat(esp_hw_support): support the new version regdma driver for esp32c5mp 2024-08-28 10:44:08 +08:00
Lou Tianhao
6c9ed891ee feat(esp_hw_support): support cpu domain powered down during sleep for esp32c5 2024-08-28 10:44:08 +08:00
Li Shuai
8d9b3cfb2f change(esp_hw_support): pmu reset and isolate contorl signal waiting time configuration 2024-08-28 10:44:08 +08:00
Lou Tianhao
980ec70d0a feat(esp_hw_support): support pmu init and sleep for esp32c5
fix(ci): add efuse header in pmu_sleep
2024-08-28 10:44:08 +08:00
Lou Tianhao
3e70dafa0b change(soc): update pmu register context structure and driver for esp32c5 2024-08-28 10:44:08 +08:00
Armando
4a72739840 feat(isp): added demosaic config to isp example 2024-08-28 10:03:22 +08:00
Armando
02b2f9a4c4 feat(isp): added isp demosaic driver 2024-08-28 10:03:22 +08:00
Marius Vikhammer
7f5496de53 test(system): add more eh-frame tests 2024-08-28 10:01:18 +08:00
Linda
2136c072b5 docs: update application examples for esp_now.rst and esp-wifi-mesh.rst 2024-08-28 09:57:24 +08:00
Marius Vikhammer
14a2be6eed Merge branch 'feature/remove_phtread_not_used' into 'master'
change(pthread): changed pthread to not pull in init functions if not used

Closes IDFGH-13283

See merge request espressif/esp-idf!32712
2024-08-28 09:54:37 +08:00
Marius Vikhammer
079df0282a Merge branch 'feature/c61_remove_lp_core' into 'master'
feat(ulp): remove ulp related C61 code

Closes IDF-9331 and IDF-9330

See merge request espressif/esp-idf!33116
2024-08-28 09:51:48 +08:00
Gao Xu
0e4464c363 Merge branch 'feature/support_isp_hisp_p4' into 'master'
feature(isp): Add ISP histogram support for esp32p4

Closes IDF-10192

See merge request espressif/esp-idf!31342
2024-08-28 09:13:43 +08:00
Armando (Dou Yiwen)
005844421d Merge branch 'fix/fix_wrong_ap3204_id_check' into 'master'
psram: fixed ap3204 id check

See merge request espressif/esp-idf!33044
2024-08-28 09:04:41 +08:00
Sudeep Mohanty
c92dfc0f3f fix(adc): Corrected the ADC channel number caps for esp32p4
This commit fixes the incorrect soc_caps for the ADC channel numbers on
the esp32p4.
2024-08-27 16:08:56 +02:00
wangtao@espressif.com
b50c2bf195 fix(wifi): fix esp32s2 get ack rssi issue 2024-08-27 21:53:31 +08:00
Fu Hanxi
fc6b33bf3c Merge branch 'ci/checkout_to_merged_result_again' into 'master'
ci: checkout back to merged result commit again to get the latest files

See merge request espressif/esp-idf!32698
2024-08-27 21:20:25 +08:00
Xu Xiao
52059ae507 Merge branch 'bugfix/check_tx_conn_traffic_fail' into 'master'
fix(wifi): add bar check for connection traffic and check ap_eb in txq

Closes WIFIBUG-591

See merge request espressif/esp-idf!32677
2024-08-27 21:12:09 +08:00
wanckl
e6e7b23917 feat(driver_spi): add esp32c61 spi master, slave, slave_hd support 2024-08-27 20:49:13 +08:00
wanckl
b70f41ca7a fix(gdma): fix c61 ahb dma for spi periph triggr number 2024-08-27 20:49:13 +08:00
Fu Hanxi
350f1410d3
ci: checkout back to merged result commit again to get the latest files 2024-08-27 14:39:10 +02:00
wanckl
6b6065de50 fix(driver_spi): fix p4 cache auto writeback during spi(dma) rx 2024-08-27 20:01:56 +08:00
renpeiying
f49b072ac7 docs: Update zh_CN translation for MR32736 2024-08-27 20:01:23 +08:00
Ondrej Kosta
50704ffa70 docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi 2024-08-27 20:01:23 +08:00
harshal.patil
e5f22521da
docs(secure_boot_v2): Mention idf.py and openssl commands to generate and verify signatures
- Adds support for verify_signature command in idf.py

Closes https://github.com/espressif/esptool/issues/942
2024-08-27 15:44:05 +05:30
zwx
fc9175d494 feat(lwip): reply the NS without LL opt 2024-08-27 18:10:23 +08:00
Marius Vikhammer
c91d481dc9 feat(ulp): remove ulp related C61 code 2024-08-27 17:23:19 +08:00
zhanghaipeng
dbca12721e fix(ble/bluedroid): Optimize BLE function 'esp_ble_resolve_adv_data_by_type' 2024-08-27 16:56:39 +08:00
gaoxu
c3155c39d1 feat(isp_hist): change coeff and weight of HIST to integer/decimal struct 2024-08-27 16:56:18 +08:00
Marius Vikhammer
da3b28c29d fix(system): fixed broken backtrace from wdt when using eh-frame 2024-08-27 16:56:17 +08:00
harshal.patil
ba49442683
Revert "ci(https_request): disable example for P4"
This reverts commit 4b8a2b4a6e.
2024-08-27 14:09:21 +05:30
harshal.patil
c94986d793
fix(mbedtls): Fix https_request example build failure for mbedtls_config
- This was caused due to some mbedtls confisg being defined but their all prerequisites were not
2024-08-27 14:09:21 +05:30
Zhang Wen Xu
997512ace2 Merge branch 'feat/add_get_all_preferred_ip6_addr' into 'master'
feat(esp_netif): add an API to get all preferred ip6 addresses

See merge request espressif/esp-idf!32417
2024-08-27 16:00:16 +08:00
Alex Lisitsyn
bd95e6955b Merge branch 'bugfix/fix_stack_rs485_echo_example' into 'master'
fix(uart/example): Fixed the stack size allocation in uart echo examples

Closes IDFGH-13483

See merge request espressif/esp-idf!33079
2024-08-27 15:54:45 +08:00
Nachiket Kukade
e220f1fec6 Merge branch 'bugfix/fix_wrong_typecast_spp' into 'master'
fix(wifi): Fix wrong typecasting of sta_info while getting SPP Caps

Closes WIFIBUG-737

See merge request espressif/esp-idf!33040
2024-08-27 15:53:28 +08:00
Song Ruo Jing
76102f3b0c Merge branch 'bugfix/esp_ringbuf_32_bit_alignment' into 'master'
fix(ringbuf): allow xRingbufferCreateWithCaps to pass in non-32-bit aligned size

Closes DOC-7446

See merge request espressif/esp-idf!33081
2024-08-27 15:46:28 +08:00
aleks
5145174858 fix(uart/example): Fixed minimal stack size in uart_echo example 2024-08-27 09:32:30 +02:00
aleks
5d4e5e99c1 fix(uart/example): Fixed the stack size allocation in uart_echo_rs485 example 2024-08-27 09:32:30 +02:00
franzhoepfinger
1380c0e9ff Update rs485_example.c
Signed-off-by: aleks <aleks@espressif.com>
Merges https://github.com/espressif/esp-idf/pull/14382
2024-08-27 09:32:30 +02:00
chenqingqing
cd05eea685 fix(bt/bluedroid): Fix default codec type on PCM datapath for hfp_hf 2024-08-27 14:24:23 +08:00
chenqingqing
b456865c4a fix(bt): Add a parameter in the two least significant bits of Class of Device 2024-08-27 14:23:49 +08:00
WebDust21
913eca40ef fix(bt): Enable use of RESERVED bits in COD (GitHub PR) 2024-08-27 14:23:49 +08:00
sibeibei
f1aa4a5a1c fix(wifi): add bar check for connection traffic and check ap_eb in txq 2024-08-27 14:13:23 +08:00
Marius Vikhammer
289ceff0e0 docs(build): update comments regarding -Os/Oz for kconfig compiler option 2024-08-27 13:41:34 +08:00
Alexey Storozhev
2d463ad18b Use correct clang flag for size optimization
See https://clang.llvm.org/docs/CommandGuide/clang.html:
>> Code Generation Options
>>   -Oz Like -Os (and thus -O2), but reduces code size further.

Without -Oz enabled clang produced binaries that were too large.
2024-08-27 13:41:34 +08:00
cjin
3aac7d2a58 feat(ble): add internal api to change ble slow clock source 2024-08-27 12:49:32 +08:00
cjin
8b1e4d8437 fix(ble): remove ble wakeup before entering light sleep 2024-08-27 12:49:32 +08:00
Zhang Xiao Yan
a1e45ac2cc Merge branch 'docs/delete_not_available_p4_documents' into 'master'
docs: delete unavailable document links for ESP32-P4

See merge request espressif/esp-idf!32933
2024-08-27 12:23:43 +08:00
Shu Chen
8437262c13 Merge branch 'feat/support_config_for_prefix_table_size' into 'master'
feat(lwip): add a config to set prefix table size

See merge request espressif/esp-idf!32670
2024-08-27 12:20:18 +08:00
Shu Chen
8aacb78ae4 Merge branch 'fix/ieee802154_pending_table_size' into 'master'
feat(802.15.4): support large scale pending table size

See merge request espressif/esp-idf!33041
2024-08-27 11:43:10 +08:00
Shu Chen
2ca453dab1 Merge branch 'pr_14060' into 'master'
feat(openthread): support time sync feature on border router

See merge request espressif/esp-idf!32299
2024-08-27 11:42:55 +08:00
gaoxu
8c31479fe5 docs(isp): Add ISP histogram in the programming guide 2024-08-27 11:26:04 +08:00
gaoxu
fb5df708a1 feat(isp_hist): Add ISP histogram support and add test for esp32p4(part 2) 2024-08-27 11:26:03 +08:00
Xiaoyu Liu
b853ed7aff fix(ulp): remove redefinition and unify gpio enum in ulp 2024-08-27 10:56:37 +08:00
Marius Vikhammer
9960cdd313 Merge branch 'docs/cpu_lockup' into 'master'
Docs/cpu lockup

See merge request espressif/esp-idf!33072
2024-08-27 10:36:11 +08:00
Omar Chebib
6f968394bd Merge branch 'bugfix/ldgen_file_single_entry' into 'master'
fix(ldgen): fix linker script generation from a single-entry fragment file

See merge request espressif/esp-idf!33033
2024-08-27 10:10:30 +08:00
Marius Vikhammer
385439213a change(pthread): changed pthread to not pull in init functions if not used
The pthread_init function would always get included in the binary,
even when no pthread functions were used.

This happens due to us using -u linker flags to force the linker to
consider the pthread library, to ensure the weak pthread functions in
the toolchain are overridden.

By restructing the code to rely on lazy inits instead we can avoid using
a init function, and therefor save some space.

Closes https://github.com/espressif/esp-idf/issues/14213
2024-08-27 10:00:04 +08:00
Armando
5e50b11232 fix(psram): fixed ap3204 id check 2024-08-27 09:51:27 +08:00
Wei Yu Han
a11aa9ce10 Merge branch 'docs/add_ble_get_started_docs' into 'master'
[BT-3811] Added BLE Get Started

See merge request espressif/esp-idf!32195
2024-08-27 09:41:50 +08:00
Zhou Xiao
f62f21dafb [BT-3811] Added BLE Get Started 2024-08-27 09:41:50 +08:00
Alexey Gerenkov
f429790e34 feat(tools): update openocd version to v0.12.0-esp32-20240821 2024-08-26 17:36:53 +00:00
Kevin (Lao Kaiyao)
c9df77efbf Merge branch 'feature/check_efuse_blk_after_ota' into 'master'
Some checks are pending
docker / docker (push) Waiting to run
feat(bootloader): support to check efuse block revision

Closes IDF-10718

See merge request espressif/esp-idf!30772
2024-08-26 23:26:58 +08:00
Island
18e8e18fa9 Merge branch 'bugfix/fixed_c6_c2_issues_master' into 'master'
Bugfix/fixed c6 c2 issues master

Closes BLERP-946, BLERP-940, BLERP-939, BLERP-937, BLERP-934, BLERP-906, BLERP-932, and BLERP-959

See merge request espressif/esp-idf!32977
2024-08-26 19:28:46 +08:00
zhanghaipeng
86713a6946 docs(ble/bluedroid): Optimize BLE example documentation for getting characteristic 2024-08-26 19:24:56 +08:00
Rahul Tank
4d7489a8ff fix(nimble): Corrected parameters assignment in per_adv_transfer_enable 2024-08-26 16:54:20 +05:30
Nebojša Cvetković
e03fd702ae fix(bt/bluedroid): Resolve warning: unused variable 'pp' 2024-08-26 19:19:48 +08:00
Jiang Jiang Jian
7e6cc5d3ff Merge branch 'fix/fix_wifi_rssi_to_snr_issue' into 'master'
fix(wifi): fix wifi rssi to snr issue

Closes WIFI-6624

See merge request espressif/esp-idf!33045
2024-08-26 18:02:50 +08:00
C.S.M
97acf99867 feat(isp_hist): Add ISP histogram support for esp32p4 (part1) 2024-08-26 17:58:37 +08:00
zwx
f1ea8ca5f0 feat(802.15.4): support large scale pending table size 2024-08-26 17:52:28 +08:00
zwx
9c9ae155ba feat(lwip): add a config to set the size of ND6 table cache 2024-08-26 17:48:51 +08:00
Marius Vikhammer
bdb36f133a Merge branch 'docs/freertos_stack_size' into 'master'
docs(freertos): update freertos comments to reflect that stack size is in bytes

Closes IDFGH-10342

See merge request espressif/esp-idf!32946
2024-08-26 16:19:01 +08:00
Tomas Rezucha
c990e1007d Merge branch 'docs/usb_docs_p4' into 'master'
Update USB host & device documentation for P4

Closes IDF-7724

See merge request espressif/esp-idf!32855
2024-08-26 15:47:05 +08:00
Song Ruo Jing
1e6d843e65 fix(ringbuf): allow xRingbufferCreateWithCaps to pass in non-32-bit aligned size 2024-08-26 15:45:14 +08:00
Aditya Patwardhan
7421889967 Merge branch 'contrib/github_pr_14410' into 'master'
fix(http_server): Don't require LWIP_NETIF_LOOPBACK for Linux target (GitHub PR)

Closes IDFGH-13519

See merge request espressif/esp-idf!33073
2024-08-26 15:42:44 +08:00
Marius Vikhammer
a04bedc4ce Merge branch 'bugfix/assert_ndebug' into 'master'
feat(newlib): add option to disable eval of expression in assert() when NDEBUG set

Closes IDFGH-479 and IDFGH-8692

See merge request espressif/esp-idf!32887
2024-08-26 15:42:31 +08:00
Erhan Kurubas
7d2e2676e5 Merge branch 'fix/sysview_example_tests' into 'master'
fix(test): Fix sysview example tests

Closes IDFCI-2282

See merge request espressif/esp-idf!32376
2024-08-26 15:23:29 +08:00
Nachiket Kukade
1bedadcc17 fix(wifi): Fix wrong typecasting of sta_info while getting SPP Caps 2024-08-26 14:53:31 +08:00
Jiang Jiang Jian
f54e1a8f09 Merge branch 'bugfix/fix_work_queue_delete_on_bluedroid' into 'master'
fix(bt/bluedroid): Fixed work queue delete when create thread failed

See merge request espressif/esp-idf!33037
2024-08-26 14:47:48 +08:00
Tomas Rezucha
c48d1641b4 docs(usb/host): Update USB host docs for ESP32-P4 2024-08-26 08:26:45 +02:00
Tomas Rezucha
d0220bd3e8 docs(usb/device): Update USB device docs for ESP32-P4 2024-08-26 08:26:39 +02:00
C.S.M
08fbc01178 Merge branch 'test/enable_i2c_test' into 'master'
test(i2c): Enable all i2c test on esp32p4, esp32c5

Closes IDF-8960 and IDF-10307

See merge request espressif/esp-idf!33043
2024-08-26 14:13:09 +08:00
Marius Vikhammer
baf026dcf8 docs(system): add cpu lock up description 2024-08-26 11:59:51 +08:00
morris
227e35ae58 Merge branch 'docs/update_application_examples_of_gpio' into 'master'
docs: Update the application examples in gpio.rst

See merge request espressif/esp-idf!32652
2024-08-26 11:52:20 +08:00
morris
c144052e25 Merge branch 'docs/update_application_examples_of_ledc' into 'master'
docs: Update the application examples in ledc.rst

See merge request espressif/esp-idf!32643
2024-08-26 11:49:56 +08:00
Rahul Tank
41d1b687a5 Merge branch 'fix/change_bt_hci_log_to_nimble_nomenclature' into 'master'
Added BT_HCI_LOG_INCLUDED macro into esp nimble configuration according to nimble nomenclature

See merge request espressif/esp-idf!32868
2024-08-26 11:47:29 +08:00
wangtao@espressif.com
285301a967 fix(wifi): fix wifi rssi to snr issue 2024-08-26 10:45:13 +08:00
C.S.M
acda9ad8bf test(i2c): Enable all i2c test on esp32p4, esp32c5 2024-08-26 10:43:22 +08:00
Marius Vikhammer
766f1f2308 Merge branch 'bugfix/riscv_task_wdt_cleanup' into 'master'
fix(wdt): changed register dump on task WDT to be more descriptive

Closes IDFGH-13506

See merge request espressif/esp-idf!32947
2024-08-26 10:28:59 +08:00
Marius Vikhammer
0d140f38ea fix(system): fixed warnings related to ununsed var if asserts disabled 2024-08-26 10:25:04 +08:00
laokaiyao
da4a7f7407 refactor(bootloader): lower down the log level to reduce the bootloader size 2024-08-26 10:02:31 +08:00
laokaiyao
1c2f8b8ce0 feat(bootloader): support to check efuse block revision
change(bootloader): remove ignore efuse check flag (temp)

change(bootloader): use int for the minimum efuse blk rev (temp)
2024-08-26 10:02:31 +08:00
laokaiyao
f3879f7615 docs(chip_revision): update eFuse block revision info 2024-08-26 10:02:31 +08:00
Astha Verma
ef6f7ef528 fix(nimble): Added BT_HCI_LOG_INCLUDED macro according to nimble nomenclature 2024-08-24 11:02:32 +05:30
David Čermák
f71f0fc627 Merge branch 'feat/esp_netif_custom_impl' into 'master'
feat(esp_netif): Add support for esp_netif with custom TCP/IP stack

Closes IDF-6375

See merge request espressif/esp-idf!31593
2024-08-23 21:52:56 +08:00
Sudeep Mohanty
a110f09d5e Merge branch 'task/enable_fpu_in_isr_for_esp32s3' into 'master'
feat(freertos): Enabled Kconfig option to allow FPU usage in ISR for esp32s3

Closes IDFGH-13365

See merge request espressif/esp-idf!32746
2024-08-23 20:18:18 +08:00
Mahavir Jain
a5f249bae2 Merge branch 'fix/esp_tls_excessive_parameter_check' into 'master'
fix(esp-tls): Reduce parameter check for esp_tls_conn_read

Closes IDF-10912

See merge request espressif/esp-idf!33036
2024-08-23 19:32:33 +08:00
David Cermak
921b2a6331 fix(esp_netif): Add unit test for loopback configuration
Split tests into common and lwip/loopback specific and adds loopback
tests as separate configuration.
2024-08-23 18:13:47 +08:00
David Cermak
c6748a636d fix(esp_netif): Prepare for more tests moving esp_netif_test to .._lwip 2024-08-23 18:13:47 +08:00
David Cermak
049f6f6bdc feat(esp_netif): Add support for esp_netif with custom TCP/IP stack
Added a new Kconfig option ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION which
uses only esp_netif headers, no implementation is provided and expected
to be supplied by application layer.
2024-08-23 18:13:47 +08:00
Omar Chebib
a8bb279dff fix(ldgen): fix linker script generation from a single-entry fragment file 2024-08-23 17:25:19 +08:00
Jiang Jiang Jian
74dc204b59 Merge branch 'bugfix/pm-165' into 'master'
fix the issue of station fail to connect to softap caused by abnormal rf flag signal

Closes PM-165

See merge request espressif/esp-idf!32359
2024-08-23 17:02:58 +08:00
C.S.M
207a757af1 Merge branch 'test/serial_jtag_rom' into 'master'
test(usb_serial): Add a test for printf/rom_printf after driver is installed

See merge request espressif/esp-idf!32057
2024-08-23 16:47:31 +08:00
chenjianhua
ec0277d833 fix(bt/bluedroid): Fixed work queue delete when create thread failed 2024-08-23 16:31:12 +08:00
Linda
14cdd8ba2b docs: format establish-serial-connection.rst 2024-08-23 16:29:37 +08:00
Li Shuai
5a604d3e18 fix(esp_wifi): fix the issue of station fail to connect to softap caused by abnormal rf flag signal 2024-08-23 15:42:34 +08:00
C.S.M
35251a69eb test(usb_serial): Add a test for printf/rom_printf after driver is installed 2024-08-23 14:59:57 +08:00
Radim Karniš
a263f833c9 Merge branch 'ci/efuse_tests' into 'master'
ci(espefuse_test): Comply with esptool v4.8

See merge request espressif/esp-idf!33021
2024-08-23 14:58:56 +08:00
Aditya Patwardhan
e957b50e50
fix(esp-tls): Reduce parameter check for esp_tls_conn_read
Previously the *data parameters of esp_tls_conn_read
    was required to be non-NULL after espressif/esp-idf!28358.
    This prevents users from using a functionality in esp_tls_conn_read
    where calling `esp_tls_conn_read(ctx, NULL, 0);` triggers the
    transfer of contents from tcp layer to mbedtls (ssl) layer.
    After this the user can read the contents from
    esp_tls_get_bytes_avail().
    This commit removes the additional NULL check on the data field
    to keep this functionality enabled.
2024-08-23 12:08:42 +05:30
Rahul Tank
ac8f354458 Merge branch 'bugfix/blesmp_getlist_bond_fail' into 'master'
fix(nimble): Fixed blesmp getbondlist issue

Closes BLERP-921

See merge request espressif/esp-idf!32697
2024-08-23 12:36:27 +08:00
Island
35235257d7 Merge branch 'docs/add_nimble_get_started' into 'master'
[BT-3812] NimBLE Get started examples added

Closes BT-3812

See merge request espressif/esp-idf!32150
2024-08-23 12:13:05 +08:00
Ren Peiying
60984ca1fc Merge branch 'docs/remove_pico-kit-related-diagram' into 'master'
docs: remove pico-kit related images after migration

See merge request espressif/esp-idf!32877
2024-08-23 11:58:56 +08:00
Zhang Shuxian
0eb9d052d0 docs: Update the application examples in ledc.rst 2024-08-23 10:16:11 +08:00
Zhang Shuxian
2cee7899d5 docs: Update the application examples in gpio.rst 2024-08-23 10:10:35 +08:00
Island
db1f207d64 Merge branch 'feat/get_free_heap_size_for_ble' into 'master'
feat(ble/controller): Support get BLE controller free heap size

Closes BLERP-938

See merge request espressif/esp-idf!32874
2024-08-23 10:09:44 +08:00
Tomas Rezucha
73e0948332 Merge branch 'docs/usb_maintainer_docs_p4' into 'master'
docs(usb/host): Update maintainer docs for ESP32-P4

See merge request espressif/esp-idf!32831
2024-08-22 22:21:31 +08:00
Radim Karniš
4ccdc51b07 ci(espefuse_test): Comply with esptool v4.8 2024-08-22 16:12:16 +02:00
Konstantin Kondrashov
d27cf6d00c Merge branch 'feature/efuse_update' into 'master'
feat(efuse): Updates efuse tables for p4 and c5

See merge request espressif/esp-idf!32904
2024-08-22 20:40:28 +08:00
Wu Zheng Hui
789b9ad5a9 Merge branch 'feat/support_xtal_as_rtc_fast_sleep' into 'master'
feat(esp_hw_support): support PMU parameters when XTAL is used as fast clock source

Closes PM-197

See merge request espressif/esp-idf!32811
2024-08-22 19:37:13 +08:00
Gao Xu
bf7f146cc8 Merge branch 'feat/support_hysteresis_filter_on_c61' into 'master'
feat(gpio): support hysteresis filter on C61

See merge request espressif/esp-idf!32881
2024-08-22 19:30:16 +08:00
C.S.M
8aee667873 fix(i2c_master): Fix an I2C issue that slave streth happen but master timeout set seems doesn't work
Closes https://github.com/espressif/esp-idf/issues/14129
Closes https://github.com/espressif/esp-idf/issues/14401
2024-08-22 18:28:57 +08:00
Armando (Dou Yiwen)
6f704a47e8 Merge branch 'doc/isp_sharpen_doc' into 'master'
doc(isp): isp sharpen programming guide

Closes IDF-10854

See merge request espressif/esp-idf!32920
2024-08-22 18:07:54 +08:00
C.S.M
64c185d39b Merge branch 'feat/psram_bringup_c61' into 'master'
feature(spiram): Bringup spiram for esp32c61, also flash, also .bss .noinit

Closes IDF-9293 and IDF-9294

See merge request espressif/esp-idf!32709
2024-08-22 17:10:05 +08:00
Island
6a2bc24f7f Merge branch 'bugfix/fix_ble_resolve_adv_data' into 'master'
fix(ble/bluedroid): Fixed memory out-of-bounds issue when parsing adv data

Closes BLERP-941

See merge request espressif/esp-idf!32894
2024-08-22 16:54:49 +08:00
Island
43adf04da6 Merge branch 'docs/optimized_blufi_example' into 'master'
docs(blufi): Optimize documentation for Blufi example

Closes BLERP-892

See merge request espressif/esp-idf!32954
2024-08-22 16:54:43 +08:00
Armando
212aef3b63 doc(isp): isp sharpen programming guide 2024-08-22 16:28:01 +08:00
C.S.M
4632bf2f8b Merge branch 'feat/bod_bringup_c5' into 'master'
feat(brownout): Add brownout detector support on esp32c5, esp32c61

Closes IDF-8647 and IDF-9254

See merge request espressif/esp-idf!32930
2024-08-22 16:24:34 +08:00
zhanghaipeng
946f484861 feat(ble/controller): Support get BLE controller free heap size 2024-08-22 14:42:52 +08:00
shreeyash
1ff60d5336 fix(nimble): Fixed blesmp getbondlist issue 2024-08-22 10:40:45 +05:30
Kirill Chalov
0d79e41ebc Merge branch 'fix/update_instructions_building_docs' into 'master'
fix: update instructions for building docs

See merge request espressif/esp-idf!32986
2024-08-22 12:47:58 +08:00
Song Ruo Jing
c607544126 Merge branch 'feature/isp_gamma_correction_support' into 'master'
feat(isp): add gamma correction driver to ISP

Closes IDF-9988

See merge request espressif/esp-idf!32274
2024-08-22 12:09:31 +08:00
C.S.M
2cbf859f6f fix(intr_dump): Fix the interrupt dump expected output 2024-08-22 11:26:30 +08:00
C.S.M
8078ad7840 feat(brownout): Add brownout detector support on esp32c61 2024-08-22 11:26:30 +08:00
C.S.M
e76c2c4b53 feat(brownout): Add brownout detector support on esp32c5 2024-08-22 11:26:30 +08:00
gaoxu
004f27efda feat(gpio): support hysteresis filter on C61 2024-08-22 11:24:03 +08:00
Marius Vikhammer
fab065848d Merge branch 'fix/clang_linker_fix_for_linux_target' into 'master'
fix(cmake): Fixed linker not supporting -warn_commons for linux target on MacOS

Closes IDFGH-12129

See merge request espressif/esp-idf!32870
2024-08-22 11:18:58 +08:00
C.S.M
271ca9f85a feat(spiram): Add .noinit and .bss segement support on esp32c61 2024-08-22 10:58:50 +08:00
C.S.M
fad2c740b1 feature(spi_flash): Promote the c61 mspi clock frequency from 40 to 80M 2024-08-22 10:58:50 +08:00
Marius Vikhammer
c7df9db237 Merge branch 'bugfix/ulp_build_windows' into 'master'
fix(ulp): fixed ulp apps not compiling on windows

Closes IDF-10856

See merge request espressif/esp-idf!32949
2024-08-22 10:51:25 +08:00
Marius Vikhammer
6e51c0525d fix(wdt): changed register dump on non panic task WDT to be more descriptive
Closes https://github.com/espressif/esp-idf/issues/14400
2024-08-22 10:48:26 +08:00
kirill.chalov
7a19f65f58 fix: update instructions for building docs 2024-08-22 10:44:31 +08:00
C.S.M
b676f6080d feature(spiram): Add spiram support on esp32c61 2024-08-22 10:38:43 +08:00
Island
66b8c33308 Merge branch 'bugfix/fix_c5_ble_crash_issue' into 'master'
fix(ble): fix esp32c5 crash issue when enable the ble controller

See merge request espressif/esp-idf!32890
2024-08-22 10:28:43 +08:00
Marius Vikhammer
66462fe09b Merge branch 'ci/disable_http_request_p4' into 'master'
ci(https_request): disable example for P4

See merge request espressif/esp-idf!33000
2024-08-22 09:55:37 +08:00
Zhou Xiao
c44b5c228f docs(ble): Replace advertising interval hex value with BLE_GAP_ADV_ITVL_MS 2024-08-22 09:55:22 +08:00
Zhou Xiao
46e2507c28 docs(ble): Improved as Weilong and Shenhang requested 2024-08-22 09:55:22 +08:00
zhouxiao
8a9c64cdb7 docs(ble): Added BLE Get Started 2024-08-22 09:55:22 +08:00
Marius Vikhammer
a6517676c9 Merge branch 'bugfix/usleep_overflow' into 'master'
fix(newlib): fixed potential overflow in usleep

Closes IDFGH-13493

See merge request espressif/esp-idf!32917
2024-08-22 09:55:08 +08:00
zwl
8c3e2c9d5a fix(ble): fixed ble controller issues on ESP32-C2 2024-08-22 09:53:11 +08:00
zwl
e8c80d4809 fix(ble): fixed ble controller issues on ESP32-H2 2024-08-22 09:53:11 +08:00
zwl
c038e38c24 fix(ble): fixed ble controller issues on ESP32-C6 2024-08-22 09:53:11 +08:00
Marius Vikhammer
4b8a2b4a6e ci(https_request): disable example for P4 2024-08-22 09:38:28 +08:00
Zhang Xiao Yan
83e0eeec79 Merge branch 'docs/fix_typo_adc_oneshot' into 'master'
docs: fix a typo in adc_oneshot

See merge request espressif/esp-idf!32893
2024-08-22 09:24:42 +08:00
Marek Fiala
46efcd09c7 Merge branch 'fix/ci_win_kconfig' into 'master'
fix(Tools): failing Win CI tests

Closes IDF-10514 and IDF-10764

See merge request espressif/esp-idf!32446
2024-08-22 00:28:48 +08:00
Jakob Hasse
efa25eaecb Merge branch 'doc/improve_iram_safe_intr_handlers_section' into 'master'
docs(interrupts): improved interrupt handler placement documentation

Closes IDF-8576

See merge request espressif/esp-idf!32883
2024-08-22 00:03:32 +08:00
Jiang Jiang Jian
b6f67b36fb Merge branch 'bugfix/fix_clkn_lost_after_modem_sleep' into 'master'
fix(bt/controller): Fixed bluetooth disconnect issue after modem sleep on ESP32

Closes BT-3831

See merge request espressif/esp-idf!32959
2024-08-21 23:19:50 +08:00
Rahul Tank
c480d92a59 Merge branch 'feat/ble_link_estab_event' into 'master'
feat(nimble): BLE_GAP_EVENT_LINK_ESTAB event to ensure link is established

Closes BLEQABR24-977, BLERP-851, BLERP-854, BLERP-878, IDFCI-2291, IDFCI-2289, BLERP-933, and BLERP-947

See merge request espressif/esp-idf!31968
2024-08-21 23:17:28 +08:00
Harshal Patil
a00d22197c Merge branch 'change/secure_boot_config_description' into 'master'
Improve description of the config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS

Closes IDF-9161

See merge request espressif/esp-idf!32651
2024-08-21 22:08:23 +08:00
Marek Fiala
364f777f96 feat(tools): Allow test_spaces_bundle4 to fail on Win 2024-08-21 14:37:06 +02:00
Marek Fiala
e95aff7ca9 feat(tools): sanitize all fixtures using test names
The parametrization include `[` and `]` in names. This is not
possible to use within path. Expand the sanitization into all
fixtures using request.node.name.
2024-08-21 14:37:06 +02:00
Marek Fiala
ccbb415be8 feat(tools): add pytest mark idf_copy_with_space 2024-08-21 14:37:05 +02:00
Marek Fiala
f0e8966ca5 feat(tools): Use custom directory in failing pytest 2024-08-21 14:37:05 +02:00
Adam Múdry
3f13adadab Merge branch 'fix/sdmmc_probe_timing_retry' into 'master'
fix(sdmmc): Fix SDMMC slot switch timing related issue on ESP32-P4

Closes IDFCI-2328

See merge request espressif/esp-idf!32900
2024-08-21 20:01:23 +08:00
Chen Ji Chang
b8b845a96a Merge branch 'change/remove_sdm_and_glitch_filter_on_c61' into 'master'
Change(sdm,glitch_filter): remove sdm and glitch filter on c61

Closes IDF-9340 and IDF-9335

See merge request espressif/esp-idf!32691
2024-08-21 19:28:05 +08:00
zhanghaipeng
c1fb888cc1 fix(ble/bluedroid): Fixed memory out-of-bounds issue when parsing adv data 2024-08-21 19:27:36 +08:00
Adam Múdry
6cb2080076 fix(nvs): nvs_tool.py reduce false duplicate warnings 2024-08-21 19:06:27 +08:00
Adam Múdry
4e7d2ec241 refactor(nvs): nvs_tool.py integrity check refactor 2024-08-21 19:06:27 +08:00
harshal.patil
03a15664ee
change(bootloader_support/secure_boot): Improve description of the config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
Co-authored-by: Zhang Shuxian <zhangshuxian@espressif.com>
2024-08-21 16:32:54 +05:30
Wei Yu Han
d60eb862c2 Merge branch 'docs/update_ble_feature_status' into 'master'
docs(ble): Updated the support status of Encrypted Advertising Data

See merge request espressif/esp-idf!32892
2024-08-21 18:39:23 +08:00
Wei Yu Han
607c0bdb2f docs(ble): Updated the support status of Encrypted Advertising Data and LE Power Controll 2024-08-21 18:39:23 +08:00
morris
fdd90d4894 Merge branch 'feat/i80_lcd_esp32p4' into 'master'
Add i80 LCD support on ESP32P4

See merge request espressif/esp-idf!32829
2024-08-21 18:04:39 +08:00
linruihao
fd46936033 fix(bt/controller): Fixed bluetooth disconnect issue after modem sleep on ESP32 2024-08-21 17:53:25 +08:00
Mahavir Jain
7489258160 Merge branch 'feat/enable_protocol_examples_for_c5' into 'master'
feat(protocols): Added and Tested eps32c5 with protocols examples

See merge request espressif/esp-idf!32778
2024-08-21 17:32:34 +08:00
Song Ruo Jing
f2d131aae4 feat(isp): add gamma correction driver to ISP 2024-08-21 17:27:16 +08:00
Island
3929afdb5f Merge branch 'fix/ble_mesh_gh_pr_13135' into 'master'
fix(ble_mesh): Fix OP_TIME_SET and OP_TIME_STATUS

See merge request espressif/esp-idf!32768
2024-08-21 16:54:40 +08:00
Jakob Hasse
db067f3bda docs(interrupts): improved interrupt handler placement documentation 2024-08-21 10:35:04 +02:00
Ivan Grokhotkov
0773caf283 Merge branch 'feature/idf_py_efuse_qemu' into 'master'
feat(idf.py): support efuse-related commands in QEMU

Closes QEMU-193

See merge request espressif/esp-idf!29809
2024-08-21 16:13:54 +08:00
wuzhenghui
2659607d13
feat(esp_hw_support): support PMU parameters when XTAL is used as fast clock source 2024-08-21 15:44:01 +08:00
Rahul Tank
61aae40313 feat(nimble): BLE_GAP_EVENT_LINK_ESTAB event to ensure link established 2024-08-21 13:07:46 +05:30
C.S.M
6730203c1d Merge branch 'support_psram_noinit_segment_on_s3' into 'master'
feat(psram): add psram noinit  segment support on s2/s3/p4/c5 and bss segment on c5

Closes IDF-4811, IDF-8689, IDF-10311, and IDFGH-13336

See merge request espressif/esp-idf!32503
2024-08-21 15:25:07 +08:00
Mahavir Jain
44327e6887 Merge branch 'feat/enable_ota_example_for_c5' into 'master'
feat(ota): Checked the support of OTA for esp32c5

See merge request espressif/esp-idf!32673
2024-08-21 15:24:16 +08:00
Mahavir Jain
2884ce0eac Merge branch 'contrib/github_pr_14398' into 'master'
fix esp_secure_boot not compiling in C++ (GitHub PR)

Closes IDFGH-13503

See merge request espressif/esp-idf!32948
2024-08-21 14:51:02 +08:00
hrushikesh.bhosale
ed4166a64c feat(ota): Checked the support of OTA for esp32c5
Checked the support of OTA features for esp32c5, tested
examples and added the support in README.md file. Even
added the support in systems .build-test-rules.yml
2024-08-21 11:45:41 +05:30
Rahul Tank
5b56ff6f8b Merge branch 'bugfix/changes_in_wifi_prov_mgr' into 'master'
fix(wifi_prov_mgr): Api to keep BLE on after provisioning

Closes IDF-8295

See merge request espressif/esp-idf!32764
2024-08-21 13:58:13 +08:00
Chen Jichang
1c1f536235 feat(psram): add psram noinit segment support on S2/S3/P4/C5
Closes https://github.com/espressif/esp-idf/issues/14253
2024-08-21 12:13:16 +08:00
Mahavir Jain
ad3a257390 Merge branch 'contrib/github_pr_14314' into 'master'
perf(gcm): shrink Shoup table and tune GCM loop (GitHub PR)

Closes IDFGH-13409

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

See merge request espressif/esp-idf!32908
2024-08-21 12:12:10 +08:00
Armando (Dou Yiwen)
79a4419956 Merge branch 'feat/isp_yuvrgb' into 'master'
isp: support more yuv / rgb configurations

Closes IDF-10734

See merge request espressif/esp-idf!32932
2024-08-21 12:02:53 +08:00
Jiang Jiang Jian
f12cdd7b2a Merge branch 'fix/fix_esp32c5_connect_issues_1' into 'master'
fix(wifi): fix esp32c5 connect issues cause by change band mode to 5G only

Closes WIFIBUG-682 and WIFIBUG-494

See merge request espressif/esp-idf!32554
2024-08-21 11:56:27 +08:00
alanmaxwell
f73612d616 fix(phy): fix esp32 rx sense issue
improve esp32 rx sense from -94 to -97 which was introduced by 4dfeb9c26
2024-08-21 10:43:56 +08:00
Jiang Jiang Jian
cf12c384d5 Merge branch 'support/esp32c5_br_lib' into 'master'
feat(openthread): support br lib for esp32c5

Closes TZ-957

See merge request espressif/esp-idf!32854
2024-08-21 10:38:59 +08:00
snake-4
8bade3bf2c
fix(http_server): Don't require LWIP_NETIF_LOOPBACK for Linux target 2024-08-21 04:25:10 +02:00
Tomas Rezucha
6457d3942d Merge branch 'fix/usb_dma_api' into 'master'
fix(usb/host): Use new cache aligned DMA alloc functions

Closes IDF-10048

See merge request espressif/esp-idf!32891
2024-08-20 23:45:45 +08:00
Mahavir Jain
71b56bd3f3 Merge branch 'feature/introduce_security_component' into 'master'
Introduce a new security component

Closes IDF-9359

See merge request espressif/esp-idf!31969
2024-08-20 22:18:07 +08:00
Jiang Jiang Jian
ff0bc815a2 Merge branch 'bugfix/fixed_c2_blufi_issue_when_use_only_4.2_adv' into 'master'
fix(ble): fixed blufi issue on ESP32-C2

Closes BLERP-944

See merge request espressif/esp-idf!32941
2024-08-20 22:04:51 +08:00
Radek Tandler
f75db5caf4 Merge branch 'bugfix/nvs_entry_sanity_check' into 'master'
Bugfix/added nvs entry header sanity checks

See merge request espressif/esp-idf!32529
2024-08-20 20:46:27 +08:00
hrushikesh.bhosale
7d2253288f feat(protocols): Added and Tested eps32c5 with protocols examples
Tested examples from the protocols, added the support of esp32c5
into the README.md and .build-test-rules.yml file
2024-08-20 17:18:54 +05:30
Adam Múdry
b263b9dff9 fix(sdmmc): Fix SDMMC slot switch timing related issue on ESP32-P4 2024-08-20 19:17:08 +08:00
morris
565235d7af change(lcd): simplify the i80 lcd example
removed the lcd touch panel initialization code.

For those touch panel driver usage, please check the esp_bsp repo.
2024-08-20 18:47:22 +08:00
morris
23c41fc772 feat(lcd): support i80 lcd driver on esp32p4 2024-08-20 18:47:22 +08:00
Shen Weilong
36c0bf9331 fix(ble): fix esp32c5 crash issue when enable the ble controller 2024-08-20 18:04:12 +08:00
Wang Meng Yang
884caed878 Merge branch 'fix/test_script_error_in_bt_example' into 'master'
fix(bt): remove redundant space in hid example path

See merge request espressif/esp-idf!32839
2024-08-20 18:03:52 +08:00
Wu Zheng Hui
5929eed30d Merge branch 'feat/support_software_trigger_retention' into 'master'
feat(esp_hw_support): support software trigger regdma retention

Closes PM-199

See merge request espressif/esp-idf!32789
2024-08-20 18:02:07 +08:00
C.S.M
ead16f1dcb Merge branch 'bugfix/fix_c61_msmspi_soc' into 'master'
fix(memspi): Correct the wrong c61 memspi soc file

See merge request espressif/esp-idf!32921
2024-08-20 17:20:55 +08:00
Rahul Tank
dbce23f8a4 Merge branch 'feat/allow_connect_during_scan' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
feat(nimble): Add support to allow connection during scanning

Closes BLERP-903

See merge request espressif/esp-idf!32509
2024-08-20 17:10:30 +08:00
radek.tandler
b937cb7549 fix(storage/nvs): Fixed hadling of inconsistent values in NVS entry header
feat(storage/nvs): Added test cases for damaged entries with correct CRC
2024-08-20 10:57:24 +02:00
Konstantin Kondrashov
545e26a0f2 feat(efuse): Updates efuse table for esp32c5 2024-08-20 16:51:56 +08:00
Konstantin Kondrashov
9923ecfaba feat(efuse): Updates efuse table for esp32p4 2024-08-20 16:51:56 +08:00
Jakob Hasse
d2cfb78d31 Merge branch 'refactor/spi_ram_stack_with_heap_caps_config' into 'master'
refactor(esp_psram): allow PSRAM as stack when PSRAM is only available via esp_heap_caps

Closes IDFGH-11604

See merge request espressif/esp-idf!32832
2024-08-20 16:48:44 +08:00
Ren Pei Ying
6ab490194c Merge branch 'docs/optimize_translation_for_api_reference_system_inc_files' into 'master'
docs: Optimize translation for api-reference/system/inc files

Closes DOC-8087

See merge request espressif/esp-idf!32033
2024-08-20 16:47:30 +08:00
Richard Allen
0b51c24238 change(mbedtls/port): optimize gcm_mult()
1) pre-shift GCM last4 to use 32-bit shift

On 32-bit architectures like Aarch32, RV32, Xtensa,
shifting a 64-bit variable by 32-bits is free,
since it changes the register representing half of the 64-bit var.
Pre-shift the last4 array to take advantage of this.

2) unroll first GCM iteration

The first loop of gcm_mult() is different from
the others. By unrolling it separately from the
others, the other iterations may take advantage
of the zero-overhead loop construct, in addition
to saving a conditional branch in the loop.
2024-08-20 16:44:56 +08:00
zwl
0611a04250 fix(ble): fixed blufi issue on ESP32-C2 2024-08-20 16:42:42 +08:00
Zhang Xiao Yan
357e28826d Merge branch 'docs/update_application_examples_build_system' into 'master'
docs: update application examples for build_system

See merge request espressif/esp-idf!32319
2024-08-20 15:51:24 +08:00
Jiang Jiang Jian
a871f54339 Merge branch 'bugfix/fix_bleqabr24_1152' into 'master'
Fixed BLE vendor HCI get controller status command on ESP32

Closes BLERP-936

See merge request espressif/esp-idf!32851
2024-08-20 15:17:24 +08:00
zhanghaipeng
0d2929358f docs(blufi): Optimize documentation for Blufi example 2024-08-20 14:29:16 +08:00
Tomas Rezucha
512df697f0 docs(usb/host): Update maintainer docs for ESP32-P4 2024-08-20 08:14:21 +02:00
Tomas Rezucha
660319ecaf fix(usb/host): Use new cache aligned DMA alloc functions 2024-08-20 08:13:32 +02:00
xuxiao
280a38130f fix(wifi): fix esp32c5 connect issues cause by change band mode to 5G only 2024-08-20 14:06:15 +08:00
Mahavir Jain
cdee290a5d Merge branch 'ci/enable_memprot_tests_for_esp32c5' into 'master'
Some checks are pending
docker / docker (push) Waiting to run
Enable memory protection tests for ESP32-C5

Closes IDF-10099

See merge request espressif/esp-idf!32766
2024-08-20 13:35:29 +08:00
Marius Vikhammer
5b85871151 fix(ulp): fixed ulp apps not compiling on windows 2024-08-20 13:04:46 +08:00
Mahavir Jain
c338fec13c feat(esp_security): add component ownership entry 2024-08-20 12:35:22 +08:00
Mahavir Jain
1e8391f5fe fix(esp_security): keep esp_security as private dependency for esp_hw_support
- Only esp_hw_support -> esp_security as new private dependency
- In next major IDF release, the public interface can be moved
  esp_security component
2024-08-20 12:35:22 +08:00
Mahavir Jain
79f9c7d157 feat(esp_security): Move DS, HMAC, DPA and crypto lock implementation 2024-08-20 12:35:22 +08:00
Mahavir Jain
262f27290b feat(esp_security): move the crypto test app to new esp_security component 2024-08-20 12:35:22 +08:00
harshal.patil
57db17bec2 feat(esp_security/crypto): Create a generic crypto locking layer across targets 2024-08-20 12:35:22 +08:00
harshal.patil
488b2a741d change(esp_security): Move the crypto locking layer into the security component 2024-08-20 12:35:22 +08:00
harshal.patil
c125d21c71 change(esp_security): Move anti-DPA configuration into the security component 2024-08-20 12:35:22 +08:00
harshal.patil
b729a0a732 change(esp_security): Move crypto clk configuration into the security component 2024-08-20 12:35:22 +08:00
harshal.patil
239734e3d5 feat(esp_security): Register a bare-metal security component 2024-08-20 12:35:22 +08:00
Rahul Tank
f03c3ed43e feat(nimble): Add support to allow connection during scanning 2024-08-20 10:05:14 +05:30
Pat Erley
5daee45f6e fix(ble_mesh): Fix OP_TIME_SET and OP_TIME_STATUS
When a user app is handling these messages, the tai_utc_delta and
time_zone_offset fields are not correctly populated.  Resolve by
properly setting the fields.
2024-08-20 12:01:35 +08:00
Chen Jichang
a1fc225aaa feat(glitch_filter): remove glitch filter on c61 2024-08-20 10:57:01 +08:00
Chen Jichang
b947ff99da feat(sdm): remove sigma delta gpio on c61 2024-08-20 10:57:01 +08:00
C.S.M
6290fed472 fix(memspi): Correct the wrong c61 memspi soc file 2024-08-20 10:54:08 +08:00
wuzhenghui
56aefbe845
driver(gptimer): support software triggered GPTimer retention test 2024-08-20 10:52:17 +08:00
wuzhenghui
05504d5f68
feat(esp_hw_support): support extra link software trigger for all targets 2024-08-20 10:52:16 +08:00
Zhang Shu Xian
15825dc531 Merge branch 'docs/update_application_examples_of_gptimer' into 'master'
docs: Update the application examples in gptimer.rst

See merge request espressif/esp-idf!32646
2024-08-20 10:13:00 +08:00
Zhang Shu Xian
a41c5c9dee Merge branch 'docs/update_application_examples_of_rmt' into 'master'
docs: Update the application examples in rmt.rst

See merge request espressif/esp-idf!32654
2024-08-20 10:10:42 +08:00
Marius Vikhammer
ff8265b6b3 feat(newlib): add option to disable eval of expression in assert() when NDEBUG set
According to the standard assert(X) should be replaced by a void expression when
NDEBUG is set. IDF's behavior was to not trigger an assertion, but we would still
evaluate X, e.g. if X was a function it would be ran.

This MR adds a kconfig option CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE which allows us
revert the behavior to be inline with the standard.

With IDF v6.0 the plan is to make CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=n the default
behavior.

Closes https://github.com/espressif/esp-idf/issues/10136
Closes https://github.com/espressif/esp-idf/issues/2758
2024-08-20 09:26:54 +08:00
Marius Vikhammer
596f635b28 fix(newlib): fixed potential overflow in usleep
If trying to usleep for 0xFFFF FFFF us the calculation of delay ticks would overflow
resulting in the system not sleeping at all.

Closes https://github.com/espressif/esp-idf/issues/14390
2024-08-20 09:26:27 +08:00
Marius Vikhammer
9bff8ad50e docs(freertos): update freertos comments to reflect that stack size is in bytes
Closes https://github.com/espressif/esp-idf/issues/11600
2024-08-20 09:26:09 +08:00
Armando
e9f65051e7 feat(isp): added isp yuv2rgb / rgb2yuv configs 2024-08-20 09:20:59 +08:00
Armando (Dou Yiwen)
c01ccd1f62 Merge branch 'ci/fix_esp32_exceed_bootloader_size' into 'master'
fix(ci): esp32 build failure due to bootloader size too large

Closes IDFCI-2331

See merge request espressif/esp-idf!32926
2024-08-20 09:20:18 +08:00
0xFEEDC0DE64
82f0477dfd fix(esp32) esp_secure_boot not compiling in C++ 2024-08-19 13:27:49 +02:00
Song Ruo Jing
7b510049fb fix(ci): esp32 build failure due to bootloader size too large 2024-08-19 19:08:10 +08:00
Linda
03611c121b docs: delete unavailable document links for ESP32-P4 2024-08-19 18:11:32 +08:00
Mahavir Jain
3ee092c9ac Merge branch 'bugfix/update_ota_readme' into 'master'
fix: update https server starting instructions in ota README

See merge request espressif/esp-idf!32862
2024-08-19 16:49:19 +08:00
Konstantin Kondrashov
bc5d324f73 Merge branch 'feature/p4_efuse_get_pkg_ver' into 'master'
feat(efuse): Updates esp_efuse_get_pkg_ver

Closes IDFCI-2324

See merge request espressif/esp-idf!32882
2024-08-19 15:44:31 +08:00
Jakob Hasse
d626bcac35 Merge branch 'refactor/nvs_coverage_gcovr' into 'master'
refactor(nvs_flash): Use gcovr instead of lcov for host-based page test

See merge request espressif/esp-idf!31734
2024-08-19 15:24:24 +08:00
Ren Pei Ying
afce238ca2 Merge branch 'docs/provide_cn_trans_for_partition-table_and_nvs_encryption' into 'master'
docs: Update CN translation for partition-table and nvs-encryption

Closes DOC-8184

See merge request espressif/esp-idf!32879
2024-08-19 15:22:28 +08:00
renpeiying
20379aeffb docs: Optimize translation for api-reference/system/inc files 2024-08-19 13:09:34 +08:00
renpeiying
98655d4ad3 docs: Update CN translation for partition-table and nvs-encryption 2024-08-19 12:58:37 +08:00
Marius Vikhammer
ae71b5984b Merge branch 'ci/timer_perf_c5' into 'master'
ci(timer): increase IDF_PERFORMANCE_MAX_ESP_TIMER_GET_TIME_PER_CALL for C5/C61

Closes IDFCI-2327

See merge request espressif/esp-idf!32888
2024-08-19 11:03:23 +08:00
Jiang Jiang Jian
87eaf18eb6 Merge branch 'feature/esp32c61_light_sleep_support_stage_1' into 'master'
feat(esp_hw_support): esp32c61 sleep support (Stage 1: support modem clock)

Closes IDF-9513

See merge request espressif/esp-idf!32518
2024-08-19 10:38:57 +08:00
Zhang Shuxian
ab7c3a5dc6 docs: Update the application examples in gptimer.rst 2024-08-19 10:14:59 +08:00
Zhang Shuxian
9f577f8005 docs: Update the application examples in rmt.rst 2024-08-19 10:01:31 +08:00
diplfranzhoepfinger
18e69cab01
Update uart_select_example_main.c 2024-08-18 20:19:49 +02:00
Aditya Patwardhan
4bd07892d2 Merge branch 'bugfix/sb_v2_docs_c3_rev' into 'master'
docs(security): fix ESP32-C3 minimum supported revision for secure boot v2

Closes IDFGH-13478

See merge request espressif/esp-idf!32896
2024-08-18 19:37:38 +08:00
Martin Vychodil
1b7bca6f13 Merge branch 'fix/bootloader_size_increase_perf_benchmark_fails_to_build' into 'master'
fix: Bootloader size increase broke perf_benchmark example compilation

Closes IDF-10861

See merge request espressif/esp-idf!32906
2024-08-18 18:05:27 +08:00
Adam Múdry
4a21b0e332 fix: Bootloader size increase broke perf_benchmark example compilation 2024-08-17 23:02:11 +02:00
Ivan Grokhotkov
5ef75d5073 Merge branch 'bugfix/reproducible_builds_improvements' into 'master'
build system: reproducible build improvements

Closes IDFGH-12690

See merge request espressif/esp-idf!32734
2024-08-16 19:02:40 +08:00
Linda
4fc4f7053b docs: update application examples for build_system 2024-08-16 17:59:11 +08:00
Chen Ji Chang
5b0c63b2cd Merge branch 'feat/add_ledc_support_on_c61' into 'master'
feat(ledc): add ledc support on c61

Closes IDF-9291

See merge request espressif/esp-idf!32705
2024-08-16 17:35:19 +08:00
Mahavir Jain
3ec400b332
docs(security): fix ESP32-C3 minimum supported revision for secure boot v2
Closes https://github.com/espressif/esp-idf/issues/14377
2024-08-16 15:04:28 +05:30
Song Ruo Jing
15e20f0dfb Merge branch 'ci/enable_esp32p4_gpio_uart_target_test' into 'master'
fix(gpio): esp32p4 IOs cannot keep being held in the entire deep sleep process

Closes IDF-8968, IDF-8971, and IDF-9877

See merge request espressif/esp-idf!32510
2024-08-16 17:31:59 +08:00
gongyantao
9a2e2f95e9 fix(ci): disable ci test when target is not support classic bluetooth 2024-08-16 17:26:36 +08:00
Zhang Xiao Yan
d7db82fecf Merge branch 'docs/update_application_examples_related_system' into 'master'
docs: update application examples related to system

See merge request espressif/esp-idf!32414
2024-08-16 17:24:20 +08:00
Abhik Roy
4873a94b01 Merge branch 'example/ping_invalid_ip6_fix' into 'master'
fix(example): Fixed updating recv addr for invalid packets

Closes IDFGH-13264

See merge request espressif/esp-idf!32275
2024-08-16 17:01:37 +08:00
Abhik Roy
36dfa367d1 Merge branch 'lwip/multi_dns_ip_fix' into 'master'
fix(lwip): Fixed incorrect handling of 0.0.0.0 in dns

Closes IDFGH-13115 and IDF-10035

See merge request espressif/esp-idf!32223
2024-08-16 16:59:43 +08:00
Linda
e5019c9da0 docs: update application examples related to system 2024-08-16 16:16:58 +08:00
Linda
a2d64723c2 docs: fix a typo in adc_oneshot 2024-08-16 16:04:53 +08:00
Jeroen Domburg
9dc00a4fb4 Merge branch 'fix/char_skip_using_usj_proper_fix' into 'master'
fix(usb-serial-jtag): Call driver-specific fsync function for usb-serial-jtag rather than poking the hardware directly

Closes IDFGH-12988

See merge request espressif/esp-idf!32473
2024-08-16 14:43:29 +08:00
Armando (Dou Yiwen)
b432ded957 Merge branch 'feat/isp_sharp' into 'master'
isp: sharp driver

Closes IDF-10494 and IDF-10673

See merge request espressif/esp-idf!32316
2024-08-16 13:07:15 +08:00
Song Ruo Jing
860453df47 Merge branch 'bugfix/esp_rom_gpio_connect_out_signal_patch' into 'master'
fix(gpio): patched esp_rom_gpio_connect_out_signal for esp32 and esp32s2

Closes IDFGH-11731 and IDFGH-13373

See merge request espressif/esp-idf!32816
2024-08-16 12:03:25 +08:00
Michael (XIAO Xufeng)
742a4838d6 Merge branch 'fix/mmu_multicore_app_bl' into 'master'
fix(MMU): fixed mmap deadlock when using multicore app with unicore bootloader

Closes IDFGH-10359

See merge request espressif/esp-idf!32745
2024-08-16 11:49:32 +08:00
Marius Vikhammer
f9ed33857d ci(timer): increase IDF_PERFORMANCE_MAX_ESP_TIMER_GET_TIME_PER_CALL for C5/C61 2024-08-16 11:12:46 +08:00
Jiang Jiang Jian
465545703f Merge branch 'bugfix/fix_wifi_example_itwt_build_fail_issue' into 'master'
fix(wifi): fix wifi example itwt build fail issue

See merge request espressif/esp-idf!32602
2024-08-16 11:01:15 +08:00
Wei Yu Han
782b8f0567 Merge branch 'docs/add_ble_feature_status_table' into 'master'
docs(ble): Added BLE feature support status

See merge request espressif/esp-idf!32873
2024-08-16 10:47:52 +08:00
Wei Yu Han
93fe12f54c docs(ble): Added BLE feature support status 2024-08-16 10:47:52 +08:00
C.S.M
f40380c472 Merge branch 'refactor/mspi_soc_c5_c61' into 'master'
fix(mspi): Refactor mspi ll/soc for c5 and c61

Closes IDF-5157

See merge request espressif/esp-idf!32151
2024-08-16 10:34:21 +08:00
Armando (Dou Yiwen)
f6ec756b8e Merge branch 'fix/fix_c5_p4_c6_cache_disable_with_brc_predict_issue' into 'master'
cache: fixed double exception after cache disabled caused by branch predictor

Closes IDFCI-2318 and IDF-10783

See merge request espressif/esp-idf!32828
2024-08-16 10:24:05 +08:00
Konstantin Kondrashov
e55ae515e2 feat(efuse): Updates esp_efuse_get_pkg_ver 2024-08-15 18:26:44 +03:00
Ivan Grokhotkov
7b228ce8ab
feat(idf.py): allow running idf.py efuse-* commands with QEMU 2024-08-15 16:57:08 +02:00
Ivan Grokhotkov
cbc52e7d30
test(build_system): check reproducible builds with spaces in paths 2024-08-15 16:41:32 +02:00
Ivan Grokhotkov
bef4cb05ff
fix(build_system): fix toolchain sysroot directory affecting builds
Closes https://github.com/espressif/esp-idf/issues/13680
2024-08-15 16:41:31 +02:00
Jakob Hasse
0d32deb4c4 refactor(test_apps): increased timeout of panic tests 2024-08-15 16:16:54 +02:00
Song Ruo Jing
706935f468 fix(gpio): esp32p4 IOs cannot keep being held in the entire deep sleep process 2024-08-15 21:54:21 +08:00
Song Ruo Jing
1171c3c281 fix(ci): enable gpio, uart target tests on esp32p4 2024-08-15 21:54:21 +08:00
Jakob Hasse
deb18eb487 Merge branch 'refactor/esp_ringbuf_linux' into 'master'
refactor(esp_ringbuf): Adjusted unit tests so some of them run on Linux

Closes IDF-9369

See merge request espressif/esp-idf!32683
2024-08-15 18:29:11 +08:00
Aleksei Apaseev
73ac0bcdff Merge branch 'ci/fix-retry-failed-jobs-stage' into 'master'
ci: add redundant job to ensure 'retry_failed_jobs' job is not skipped

See merge request espressif/esp-idf!32754
2024-08-15 18:08:10 +08:00
Wu Zheng Hui
561c0a8b82 Merge branch 'fix/always_writeback_l1dcache_before_sleep' into 'master'
fix(esp_hw_support): always writeback L1DCache before sleep to keep cpu/regdma data consistency

See merge request espressif/esp-idf!32875
2024-08-15 18:06:40 +08:00
Ondrej Kosta
a6b559db79 Merge branch 'feature/spi_eth_c5' into 'master'
feat(esp_eth): Added SPI Ethernet support of ESP32C5 in examples

Closes IDF-8697

See merge request espressif/esp-idf!31394
2024-08-15 18:06:26 +08:00
Armando
43ba57e704 change(isp): rename isp_af example to isp example 2024-08-15 18:06:23 +08:00
Armando
f1b5846a55 feat(isp): added isp sharp driver 2024-08-15 18:06:23 +08:00
renpeiying
513bf853b6 docs: remove pico-kit related images after migration 2024-08-15 17:17:59 +08:00
Abhik Roy
322f22d169 fix(lwip): Fixed incorrect handling of 0.0.0.0 in dns 2024-08-15 19:00:47 +10:00
Song Ruo Jing
2f92d863d8 fix(uart): eliminated potential glitch on TX at setup if TX signal is inversed
Closes https://github.com/espressif/esp-idf/issues/14285
2024-08-15 16:36:18 +08:00
Song Ruo Jing
ab4157b6cf fix(gpio): patched esp_rom_gpio_connect_out_signal for esp32 and esp32s2
The original ROM function enabled output for the pad first, and then connected the signal
This could result in an undesired level change at the pad

Closes https://github.com/espressif/esp-idf/issues/12826
2024-08-15 16:36:18 +08:00
Aleksei Apaseev
c30d22630f ci: update the logic to use the gitlab API to fetch failed jobs 2024-08-15 16:04:35 +08:00
Aleksei Apaseev
a0c3fb4d4a ci: add name for child pipelines 2024-08-15 16:04:35 +08:00
Aleksei Apaseev
4e44310ff1 ci: update authorization from Bearer token to CI_JOB_TOKEN while making requests to CI_DASHBOARD_API service 2024-08-15 16:04:35 +08:00
Aleksei Apaseev
f154151e14 ci: retry jobs for parent and child pipelines 2024-08-15 16:04:35 +08:00
Aleksei Apaseev
ae4687e43e ci: add redundant job to ensure 'retry_failed_jobs' job is not skipped 2024-08-15 16:01:23 +08:00
Jeroen Domburg
1cdf579b7a fix(usb-serial-jtag): Call driver-specific fsync function for usb-serial-jtag
The VFS driver used to switch to the interrupt-driven driver for rx and tx functions, but
still called its own fsync function, which poked the hardware directly. This interfered
with the driver interrupt, causing spurious bytes to disappear. This adds a driver-specific
sync function and support for that in the vfs layer.

Closes https://github.com/espressif/esp-idf/issues/13939
2024-08-15 15:35:41 +08:00
Chen Jichang
2e2cbd9aa8 feat(ledc): add ledc support on c61 2024-08-15 15:21:06 +08:00
C.S.M
bc80476411 fix(mspi): Refactor mspi ll/soc for c5 and c61 2024-08-15 15:08:56 +08:00
wuzhenghui
fb84c24bae
fix(esp_hw_support): always writeback L1D$ before sleep to keep cpu/regdma data consistency 2024-08-15 12:18:16 +08:00
Xiao Xufeng
00c144aa99 ci(mmu): add unicore test 2024-08-15 12:00:08 +08:00
Xiao Xufeng
55dccc4bba fix(MMU): fixed mmap deadlock when using multicore app with unicore bootloader
Closes https://github.com/espressif/esp-idf/issues/11617
2024-08-15 12:00:08 +08:00
Kevin (Lao Kaiyao)
eff2e4eddd Merge branch 'feature/support_i2c_on_c61' into 'master'
feat(i2c): support i2c on esp32-c61

Closes IDF-9296 and IDF-9297

See merge request espressif/esp-idf!32596
2024-08-15 09:07:01 +08:00
Sudeep Mohanty
78a42a82d5 fix(cmake): Fixed linker not supporting -warn_commons for linux target on MacOS
This commit updates the ld linker flags to conditionally include the
-warn_commons flag when the linux target is built on MacOS. This is
because, not all versions of ld support the -warn_commons option.

Closes https://github.com/espressif/esp-idf/issues/13185
2024-08-14 15:06:08 +02:00
Jakob Hasse
4c492cc85f refactor(esp_psram): allow external stack also when PSRAM is only available via esp_heap_caps
Closes https://github.com/espressif/esp-idf/issues/12722
2024-08-14 14:47:12 +02:00
Mahavir Jain
e5e146365b Merge branch 'bugfix/build_failure_cryptoauthlib' into 'master'
fix(mbedtls): link esp-cryptoauthlib to mbedcrypto library

See merge request espressif/esp-idf!32728
2024-08-14 18:45:54 +08:00
Armando
873068d3fe fix(cache): disable branch predictor before disable cache
branch predictor will start cache request
2024-08-14 18:39:18 +08:00
Wan Lei
8e0824d8aa Merge branch 'test/add_spi_master_clock_reg_validity_test' into 'master'
fix(spi): add clock src and divider config validation test

See merge request espressif/esp-idf!22276
2024-08-14 18:35:54 +08:00
nilesh.kale
214974b038 fix: update https server starting instructions in ota README
This commit updates sequence for methods of starting HTTPS servers
in ota README file.
2024-08-14 15:45:23 +05:30
Zhang Shu Xian
9b3728f8ac Merge branch 'docs/update_application_examples_of_mcpwm' into 'master'
docs: Update the application examples in mcpwm.rst

See merge request espressif/esp-idf!32650
2024-08-14 16:30:30 +08:00
zwx
47f730645c feat(esp_netif): add an API to get all preferred ip6 addresses 2024-08-14 16:25:41 +08:00
zwx
26d8350c19 feat(openthread): support br lib for esp32c5 2024-08-14 16:08:56 +08:00
Ondrej Kosta
dd81b56fb6 feat(esp_eth): removed disable of C5 and P4 from examples .build-test-rules
Updated examples to be able to build for C5 and P4.

Added Ethernet support for static_ip example.
2024-08-14 10:07:48 +02:00
Ondrej Kosta
43066f2e37 feat(esp_eth): Added SPI Ethernet support of ESP32C5 in examples 2024-08-14 10:05:26 +02:00
chenjianhua
ee0bd91364 fix(bt): Update bt lib for ESP32(241c96c)
- Fixed BLE vendor HCI get controller status command
2024-08-14 15:29:11 +08:00
Mahavir Jain
f1492a97a2 Merge branch 'bugfix/s3_memprot_exec_test' into 'master'
Fix(Security): Fixed ESP32S3 Memprot RTCFAST code-execution tests

Closes IDF-10719

See merge request espressif/esp-idf!32649
2024-08-14 14:56:40 +08:00
Armando
893c04702f feat(riscv): added api to disable branch predictor 2024-08-14 14:34:34 +08:00
Song Ruo Jing
a6e8a9df17 Merge branch 'bugfix/uart_events_example_stask_overflow_s3' into 'master'
fix(uart): increased stack size for the task in uart_events example

See merge request espressif/esp-idf!32779
2024-08-14 12:12:59 +08:00
wanlei
e24067295b feat(spi_master): add test clock src and config validation 2024-08-14 11:35:58 +08:00
laokaiyao
1397e5421e feat(i2c): support i2c on esp32-c61 2024-08-14 11:25:31 +08:00
Island
cd1178298f Merge branch 'docs/optimized_ble_adv_data_type' into 'master'
docs(ble/bluedroid): Optimize BLE example for setting advertising data

Closes BLERP-919

See merge request espressif/esp-idf!32735
2024-08-14 11:14:28 +08:00
gongyantao
30dddabb6b fix(bt): remove redundant space in hid example path 2024-08-14 11:06:35 +08:00
C.S.M
fbab3bc874 Merge branch 'feat/temperature_sensor_bringup' into 'master'
feature(temperature_sensor): Add temperature sensor support on esp32c5

Closes IDF-8727

See merge request espressif/esp-idf!32665
2024-08-14 10:53:26 +08:00
morris
34813ecd6c Merge branch 'bugfix/dma2d_transacrion_config_lifecycle' into 'master'
fix(lcd): prolonged the lifecycle of dma2d transaction config structure

Closes IDF-10763

See merge request espressif/esp-idf!32788
2024-08-14 10:18:07 +08:00
morris
0ca1c61af2 Merge branch 'feat/ldo_channel_reserve' into 'master'
feat(ldo): reserve the LDO1 and LDO2

Closes IDF-10712 and PM-137

See merge request espressif/esp-idf!32693
2024-08-14 10:06:11 +08:00
Chen Ji Chang
8e956dab87 Merge branch 'feat/dma_cache_align' into 'master'
feat(dma): Add helper functions to align buffer

Closes IDF-10462

See merge request espressif/esp-idf!32343
2024-08-14 10:00:55 +08:00
Sudeep Mohanty
cbb2c4be60 Merge branch 'contrib/github_pr_14329' into 'master'
fix(ulp): Add the missing extern "C" guard to ulp_lp_core_print.h (GitHub PR)

Closes IDFGH-13423

See merge request espressif/esp-idf!32689
2024-08-14 05:06:02 +08:00
Sudeep Mohanty
2f145230b9 test(freertos): Added build test for function in flash with -Os optimation
This commit adds a build test for when FreeRTOS and esp_ringbuf functions
are placed in flash and the compiler optimizes for code size.
2024-08-13 20:54:14 +02:00
Sudeep Mohanty
891c4d5264 fix(freertos): Added freertos fragments to the exception list of ldgen mapping checks
This commit adds freertos and esp_ringbuf linker fragment sections
to the exception list of the ldgen mappings checker script.
2024-08-13 20:54:14 +02:00
Rahul Tank
5c3e63712d Merge branch 'bugfix/handle_linked_om_blufi' into 'master'
fix(nimble) Added change to handle linked om data at blufi layer

Closes FCS-1433

See merge request espressif/esp-idf!30320
2024-08-14 00:55:41 +08:00
Jakob Hasse
d7ca8b94c8 Merge branch 'contrib/github_pr_14339' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
Fix(pthread): Added linux port with empty functions to make pthread cxx example build. (GitHub PR)

Closes IDFGH-13424 and IDFGH-13433

See merge request espressif/esp-idf!32785
2024-08-14 00:05:12 +08:00
Abhik Roy
53ba6e97cd fix(example): Fixed updating recv addr for invalid packets for ping
Closes https://github.com/espressif/esp-idf/issues/14197
2024-08-13 21:51:58 +10:00
Ivan Grokhotkov
50244f4c79 Merge branch 'bugfix/sdio_intr_coex' into 'master'
fix(sdmmc): don't disable SDIO interrupts when switching slots

See merge request espressif/esp-idf!32790
2024-08-13 19:24:32 +08:00
Nilesh Kale
6028332164 Merge branch 'feature/enable_secure_boot_in_esp32c61' into 'master'
feat: enable secure boot feature for esp32c61

Closes IDF-9233

See merge request espressif/esp-idf!31420
2024-08-13 19:23:53 +08:00
Rahul Tank
a02a2a2d34 fix(nimble) Added change to handle linked om data at blufi layer 2024-08-13 16:39:18 +05:30
Roland Dobai
b093e32b07 Merge branch 'fix/fix_secure_boot_key_hint' into 'master'
fix: Fix condition checking if secure boot signing key exists

See merge request espressif/esp-idf!32718
2024-08-13 18:48:44 +08:00
Armando (Dou Yiwen)
b79f001764 Merge branch 'fix/move_xip_doc_out_from_non_updated_list' into 'master'
doc(psram): move xip psram doc out from non updated list

See merge request espressif/esp-idf!32818
2024-08-13 17:23:53 +08:00
Armando (Dou Yiwen)
f705c1c7bc doc(psram): move xip psram doc out from non updated list 2024-08-13 17:23:53 +08:00
Cristian Funes
d3ab90ba24 fix(pthread): Fix cxx pthread example build for linux platform
Closes https://github.com/espressif/esp-idf/pull/14339
2024-08-13 10:48:17 +02:00
Ivan Grokhotkov
6db8c98e90 Merge branch 'bugfix/missing_component_check' into 'master'
fix(cmake): report correct error on unknown component name

See merge request espressif/esp-idf!32062
2024-08-13 16:06:50 +08:00
Marius Vikhammer
5d285c15e4 Merge branch 'revert/docs/add-ble-feature-support-status' into 'master'
Revert "docs(ble): Added BLE feature support status"

See merge request espressif/esp-idf!32813
2024-08-13 15:16:55 +08:00
shreeyash
6e6fd2f6a3 fix(wifi_prov_mgr): Api to keep BLE on after provisioning 2024-08-13 12:42:35 +05:30
morris
631e15c6eb feat(ldo): add config to let hardware control the ldo output
If LDO1 is used by spi flash, then we recommend to give the ownership to
the hardware. Software just read the parameters from the efuse and set
to PMU.
2024-08-13 14:50:38 +08:00
Armando (Dou Yiwen)
11831cc0db Merge branch 'fix/fix_cache_panic_c61_on_psram_board' into 'master'
cache: fixed cache panic init flow on psram board

See merge request espressif/esp-idf!32701
2024-08-13 14:08:17 +08:00
Marius Vikhammer
db1461f45d Revert "docs(ble): Added BLE feature support status"
This reverts commit 3bd599eb13.
2024-08-13 12:49:36 +08:00
Marius Vikhammer
85e570b8ee Merge branch 'bugfix/console_no_vfs' into 'master'
test(console): add tests for console with vfs disabled

Closes IDF-9367 and IDF-9578

See merge request espressif/esp-idf!31455
2024-08-13 12:20:44 +08:00
morris
001527e63b Merge branch 'feat/adding_esp32c61_gdma' into 'master'
feat: c61 add gdma support

Closes IDF-9310, IDF-9311, and IDF-9315

See merge request espressif/esp-idf!32145
2024-08-13 12:14:47 +08:00
Zhang Shuxian
2105adc19c docs: Update the application examples in mcpwm.rst 2024-08-13 12:04:43 +08:00
morris
ec2a8a9c81 fix(drivers): rename the nested extra_flags structure 2024-08-13 11:57:08 +08:00
morris
34b1f2da24 fix(lcd): prelonged the lifecycle of dma2d transaction config structure
The context must exit at least until on_job_pixked callback is called
2024-08-13 11:57:08 +08:00
C.S.M
5d4275fb75 feature(temperature_sensor): Add temperature sensor support on esp32c5 2024-08-13 11:55:39 +08:00
Zhang Shu Xian
b5bfd3919e Merge branch 'docs/update_application_examples_of_pcnt' into 'master'
docs: Update the application examples in pcnt.rst

See merge request espressif/esp-idf!32638
2024-08-13 11:19:55 +08:00
Lou Tianhao
6274040f38 feat(pm): support modem clock for esp32c61 2024-08-13 11:03:21 +08:00
Marius Vikhammer
590e9bbe1d Merge branch 'contrib/github_pr_14350' into 'master'
docs: Fix typo: shard→shared (GitHub PR)

Closes IDFGH-13444

See merge request espressif/esp-idf!32747
2024-08-13 10:08:39 +08:00
Marius Vikhammer
6cbee5c7f6 Merge branch 'contrib/github_pr_13578' into 'master'
Make FreeRTOS configUSE_TIMERS optional in KConfig (GitHub PR)

Closes IDFGH-12576

See merge request espressif/esp-idf!32576
2024-08-13 10:06:51 +08:00
Marius Vikhammer
e2183d53f1 Merge branch 'bugfix/ulp_always_set_elf_ext' into 'master'
fix(ulp): fixed that the .elf ext was not set by default for custom cmake proj

See merge request espressif/esp-idf!32752
2024-08-13 10:03:40 +08:00
Armando
e58d608034 fix(cache): fixed cache panic init flow on psram board 2024-08-13 09:30:46 +08:00
Wang Meng Yang
62a1194512 Merge branch 'fix/change_bt_example_sdkconfig_name' into 'master'
fix(bt): change example sdkconfig name to sdkconfig.ci.test

See merge request espressif/esp-idf!32780
2024-08-13 06:57:23 +08:00
Roman Leonov
184eeccc71 Merge branch 'fix/usb_host_enum_cancellation' into 'master'
fix(usb_host): The Enumeration Driver, cancellation on error

See merge request espressif/esp-idf!32212
2024-08-13 00:42:00 +08:00
Ivan Grokhotkov
c521fcb6fd
fix(cmake): report correct error on unknown component name
Previously the error message was

CMake Error at /home/user/esp-idf/tools/cmake/build.cmake:296 (__component_get_property):
  __component_get_property Function invoked with incorrect arguments for
  function named: __component_get_property
Call Stack (most recent call first):
  /home/user/esp-idf/tools/cmake/build.cmake:341 (__build_resolve_and_add_req)
  /home/user/esp-idf/tools/cmake/build.cmake:638 (__build_expand_requirements)
  /home/user/esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:6 (project)

Now it will be:

CMake Error at /home/user/esp-idf/tools/cmake/build.cmake:298 (message):
  Failed to resolve component 'whatever' required by component 'main'.
Call Stack (most recent call first):
  /home/user/esp-idf/tools/cmake/build.cmake:345 (__build_resolve_and_add_req)
  /home/user/esp-idf/tools/cmake/build.cmake:642 (__build_expand_requirements)
  /home/user/esp-idf/tools/cmake/project.cmake:710 (idf_build_process)
  CMakeLists.txt:6 (project)

Also improved the hint to show the component name in quotes.
2024-08-12 17:54:44 +02:00
Jakob Hasse
dfbed83426 refactor(esp_ringbuf): Adjusted unit tests so some of them run on Linux 2024-08-12 15:29:41 +02:00
Erhan Kurubas
ecda835da6 test(sysview): fix gdb no response error in sysview_heap_log tests 2024-08-12 15:20:45 +02:00
Ivan Grokhotkov
8a9d3076d7
fix(sdmmc): don't disable SDIO interrupts when switching slots 2024-08-12 14:18:29 +02:00
Island
75eb7fe379 Merge branch 'feat/print_the_ble_mac_when_init' into 'master'
feat(ble): Print out the BT mac when the controller is initialized

Closes BLERP-914

See merge request espressif/esp-idf!32674
2024-08-12 20:16:51 +08:00
Ivan Grokhotkov
1c343d8923
change(build_system): refactor reproducible build handling
- remove generate_debug_prefix_map.py, move its logic into CMake
- move all reproducible builds logic into a new file, prefix_map.cmake
2024-08-12 13:26:33 +02:00
Ondrej Kosta
ad9cdcd11a Merge branch 'contrib/github_pr_14276' into 'master'
fix(esp_eth): fix C++ invalid type conversion error (GitHub PR)

Closes IDFGH-13363

See merge request espressif/esp-idf!32706
2024-08-12 18:48:08 +08:00
gongyantao
fe9cd152fe fix(bt): change example sdkconfig name to sdkconfig.ci.test 2024-08-12 17:49:53 +08:00
Ren Pei Ying
c60126ecef Merge branch 'docs/remove_user_guide_for_esp32_pico_kit_related_migration' into 'master'
docs: remove user guide for esp32-pico-kit related docs after migration

Closes DOC-6915

See merge request espressif/esp-idf!32422
2024-08-12 17:17:14 +08:00
Ren Pei Ying
f0bce4303e docs: remove user guide for esp32-pico-kit related docs after migration 2024-08-12 17:17:14 +08:00
Ondrej Kosta
7baf9f8396 Merge branch 'bugfix/mdio_default_p4' into 'master'
fix(esp_eth): fixed default GPIO to match new ver. of P4 devboard

Closes IDFGH-13385

See merge request espressif/esp-idf!32708
2024-08-12 16:42:08 +08:00
Song Ruo Jing
96a8265084 fix(uart): increased stack size for the task in uart_events example
The example cannot run successfully on ESP32S3 due to task stack overflow
Introduced in a4e6f57a40
2024-08-12 16:14:47 +08:00
Zhang Xiao Yan
b7c8caf764 Merge branch 'docs/update_application_examples_cxx' into 'master'
docs: update application examples for cplusplus.rst

See merge request espressif/esp-idf!32443
2024-08-12 15:42:40 +08:00
Roman Leonov
0a9bd7aa50 fix(enum): Added cancellation stage to process, second reset stage, remove dynamic members 2024-08-12 09:11:02 +02:00
Linda
8d2eab13ed docs: update application examples for cplusplus.rst 2024-08-12 14:15:32 +08:00
C.S.M
82ebce39f3 Merge branch 'feat/psram_refacotr' into 'master'
feat(spiram): Refactor psram quad device driver

Closes IDF-10357

See merge request espressif/esp-idf!31995
2024-08-12 13:41:17 +08:00
harshal.patil
14cbd837b3
ci(memprot): enable memory protection tests for ESP32-C5 2024-08-12 11:08:33 +05:30
Alexey Lapshin
1ddd2f42b5 Merge branch 'fix/nullfs-open' into 'master'
fix(vfs): fix nullfs open syscall

See merge request espressif/esp-idf!32725
2024-08-12 12:57:44 +08:00
Mahavir Jain
c3b58b9476 Merge branch 'fix/esp32c5_rng_random_disable' into 'master'
fix(bootloader): update random disable api for ESP32-C5/C6

Closes IDFGH-13185 and IDFGH-13368

See merge request espressif/esp-idf!32700
2024-08-12 12:28:13 +08:00
morris
3e30e302c7 Merge branch 'feature/modbus_add_support_esp32c5' into 'master'
feat(esp_modbus): examples add support of esp32c5 target

Closes IDF-10050

See merge request espressif/esp-idf!32006
2024-08-12 11:36:15 +08:00
Alex Lisitsyn
2fa78094ef feat(esp_modbus): examples add support of esp32c5 target 2024-08-12 11:36:15 +08:00
Kevin (Lao Kaiyao)
7005d2cee5 Merge branch 'bugfix/fix_es8311_example_no_sound_on_p4' into 'master'
fix(i2s): fix the es8311 example on P4 EV board

See merge request espressif/esp-idf!32667
2024-08-12 11:06:11 +08:00
Mahavir Jain
f38f77a7fc
fix(rng): avoid clearing PMU_PERIF_I2C_RSTB in random disable API for C6
This configuration bit is required for ADC operation as well and hence
should not be cleared in the RNG API sequence.

Ideally, the ADC driver should take care of initializing this bit but
still the RNG layer change is required because of interleaved API usage
scenario described in following linked issue.

Closes https://github.com/espressif/esp-idf/issues/14124
Closes https://github.com/espressif/esp-idf/issues/14280
2024-08-12 08:26:05 +05:30
Zhao Wei Liang
915e1238f0 Merge branch 'bugfix/fixed_c6_h2_vendor_hci_master' into 'master'
Bugfix/fixed c6 h2 vendor hci master

See merge request espressif/esp-idf!32739
2024-08-12 10:54:53 +08:00
Mahavir Jain
cff436cf57 Merge branch 'docs/rng_update_outdated' into 'master'
docs(esp_hw_support): corrected outdated RNG docs

See merge request espressif/esp-idf!32737
2024-08-12 10:49:35 +08:00
zhanghaipeng
f9e45f9807 docs(ble/bluedroid): Optimize BLE example for setting advertising data 2024-08-12 10:40:00 +08:00
Marius Vikhammer
fe5b8bb445 fix(ulp): fixed that the .elf ext was not set by default for custom cmake proj 2024-08-12 10:31:24 +08:00
Zhang Hai Peng
8971902e1c Merge branch 'feat/get_ble_addr_tpye_in_bond_list' into 'master'
feat(ble/bluedroid): Support getting BLE address type in bond list

Closes IDFGH-13287

See merge request espressif/esp-idf!32680
2024-08-12 10:26:11 +08:00
Island
368cfdac26 Merge branch 'docs/optimized_ble_connect_param_update' into 'master'
docs(ble/bluedroid): Optimize documentation for BLE connection parameter updates

Closes BLERP-892

See merge request espressif/esp-idf!32351
2024-08-12 10:25:37 +08:00
Island
f90d23565b Merge branch 'feature/ble_5_1_direction_finding_support_host' into 'master'
feature : Bluetooth LE 5.1 direction finding host support

See merge request espressif/esp-idf!32704
2024-08-12 10:20:36 +08:00
Marius Vikhammer
69ca6e49a7 test(console): add tests for console with vfs disabled 2024-08-12 10:01:04 +08:00
Aleksei Apaseev
9862ae280f Merge branch 'ci/add-retry-job-func-to-report' into 'master'
ci: add retry job functionality to dynamic pipeline report

Closes IDFCI-2211

See merge request espressif/esp-idf!32147
2024-08-12 09:46:02 +08:00
Chris Mumford
41f1b60b65 Typo fix: shard→shared 2024-08-12 09:03:52 +08:00
Ivan Grokhotkov
1c1b7db361 Merge branch 'bugfix/check_system_init_priorities_sorting' into 'master'
fix(esp_system): sort system init priorities also by filename

See merge request espressif/esp-idf!32678
2024-08-12 05:02:20 +08:00
Ivan Grokhotkov
fc4c445643
test(build_system): move reproducible build test to pytest 2024-08-11 20:24:03 +02:00
Ivan Grokhotkov
d6edcba3b6
test(build_system): extract file helpers, add 'bin_files_differ'
- Move file-related functions bin_file_contains and file_contains
  from idf_utils.py and existing functions from editing.py into a new
  file file_utils.py
- Add a function 'bin_files_differ' to compare binary files
2024-08-11 20:23:27 +02:00
Ivan Grokhotkov
3577900915
fix(esp_system): sort system init priorities also by filename 2024-08-11 20:21:35 +02:00
hongshuqing
0c817d9238
fix(bootloader): update random disable api for ESP32-C5 2024-08-11 22:02:27 +05:30
Martin Vychodil
7eaa185e07 Merge branch 'contrib/github_pr_14341' into 'master'
fix(sdmmc): typo in docs (GitHub PR)

Closes IDFGH-13435

See merge request espressif/esp-idf!32711
2024-08-11 22:00:13 +08:00
Sudeep Mohanty
bfa3c55250 feat(freertos): Enabled Kconfig option to allow FPU usage in ISR for esp32s3
This commit enables the Kconfig option to allow FPU usage in an ISR
context for the esp32s3.
2024-08-10 13:20:02 +02:00
Sudeep Mohanty
354ffb4534 Merge branch 'fix/incorrect_critical_nesting_count_in_linux_port' into 'master'
fix(freertos): Fixed critical section macro in vTaskPlaceOnEventListRestricted()

See merge request espressif/esp-idf!32695
2024-08-10 15:22:14 +08:00
zwl
a9ae1162aa fix(bluetooth/controller): fixed get controller status vendor hci command error on ESP32C5 2024-08-10 12:34:01 +08:00
zwl
0de0ab46fe fix(bluetooth/controller): fixed get controller status vendor hci command error on ESP32C6 2024-08-10 12:28:32 +08:00
Marius Vikhammer
eb6b8957a2 Merge branch 'revert-6c0b4c90' into 'master'
Revert "Merge branch 'add_openocd_stub_bins' into 'master'"

See merge request espressif/esp-idf!32738
2024-08-10 11:26:58 +08:00
Erhan Kurubas
9b38f87781
Revert "Merge branch 'add_openocd_stub_bins' into 'master'"
This reverts merge request !31504
2024-08-09 22:49:43 +02:00
Jakob Hasse
965f52a45a docs(esp_hw_support): corrected outdated RNG docs 2024-08-09 16:20:02 +02:00
zhanghaipeng
9fcb712539 feat(ble/bluedroid): Support getting BLE address type in bond list 2024-08-09 19:53:16 +08:00
Aditya Patwardhan
efe62d4a7f Merge branch 'docs/translate_host-based-security-workflows' into 'master'
docs: Provide translation for host-based-security-workflows

Closes DOC-6018

See merge request espressif/esp-idf!31459
2024-08-09 19:52:40 +08:00
Steffen Beyer
93c67f16ab fix(sdmmc): typo in docs
Closes https://github.com/espressif/esp-idf/pull/14341
2024-08-09 13:45:27 +02:00
Ondrej Kosta
127306fee6 Merge branch 'feature/dm9051_throughput_optimization' into 'master'
esp_eth: DM9051: Fix abnormal operation when SPI clock is too high, optimize throughput rate

See merge request espressif/esp-idf!30769
2024-08-09 19:34:22 +08:00
Erhan Kurubas
6c0b4c90b4 Merge branch 'add_openocd_stub_bins' into 'master'
Preload openocd stub binaries and reserve memory for debugging

See merge request espressif/esp-idf!31504
2024-08-09 19:22:28 +08:00
Aleksei Apaseev
a6b84b5ccc feat(ci): add retry job functionality to dynamic pipeline report
Introduced changes:

- add a manual ci job to retry failed jobs.
- refactor js scripts in report template
- extract the CI ENV vars related to the report generation script to the predefined constants.py module
- introduce a new action "retry_failed_jobs" in helper script "gitlab_api.py"
2024-08-09 19:05:53 +08:00
Zhang Shuxian
9733a89c18 docs: Update the application examples in pcnt.rst 2024-08-09 19:04:22 +08:00
David Roman
b9924df4be fix(esp_eth): fix C++ invalid type conversion error
Closes https://github.com/espressif/esp-idf/issues/14265
2024-08-09 18:54:43 +08:00
Jakob Hasse
90cc261916 Merge branch 'feature/bootloader_support_mock' into 'master'
feat(bootloader_support): added bootloader_support mocks

See merge request espressif/esp-idf!32603
2024-08-09 18:07:58 +08:00
Mahavir Jain
a2de1ca576
fix(mbedtls): link esp-cryptoauthlib to mbedcrypto library
If the certificate bundle feature is disabled then the mbedtls
component library becomes interface only component and hence
adding esp-cryptoauthlib as its PRIVATE dependency does not work.

Instead the esp-cryptoauthlib should be added as PRIVATE dependency
for mbedcrypto library (for alternate ECDSA implementation).
2024-08-09 15:30:35 +05:30
Wang Meng Yang
d4b2da21eb Merge branch 'bugfix/heap_corrupt_in_bt_mem_release_on_esp32' into 'master'
fix(bt): Fix heap corruption in the call of esp_bt_mem_release on ESP32

Closes IDFGH-13349

See merge request espressif/esp-idf!32436
2024-08-09 17:58:45 +08:00
Island
8072d96cd6 Merge branch 'bugfix/fix_ble_channel_map_update' into 'master'
fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(f583012)

Closes BCI-436, BLERP-908, and BLERP-909

See merge request espressif/esp-idf!32571
2024-08-09 17:26:59 +08:00
Island
9dba81849e Merge branch 'docs/add-ble-feature-support-status' into 'master'
docs(ble): Added BLE feature support status

See merge request espressif/esp-idf!32408
2024-08-09 17:13:12 +08:00
Wei Yu Han
3bd599eb13 docs(ble): Added BLE feature support status 2024-08-09 17:13:12 +08:00
Alexey Lapshin
561587c11c fix(vfs): fix nullfs open syscall 2024-08-09 16:05:52 +07:00
Fu Hanxi
f08926be0e Merge branch 'ci/fix-artifacts-for-generate-job' into 'master'
fix: save artifacts for generate job

See merge request espressif/esp-idf!32710
2024-08-09 16:12:36 +08:00
Wang Meng Yang
b95a9c5c63 Merge branch 'bugfix/fix_hidh_integrity_check_bug' into 'master'
fix(esp_hid): Loose the check of input report length to be more compatible

Closes IDFGH-13344

See merge request espressif/esp-idf!32663
2024-08-09 15:27:34 +08:00
Fu Hanxi
4d93ef0fe3 Merge branch 'ci/fix_single_dut_with_param' into 'master'
ci: fix test case markers when put targets as params

See merge request espressif/esp-idf!32703
2024-08-09 15:11:33 +08:00
igor.udot
a21247eada fix: save artifacts for generate job 2024-08-09 15:06:00 +08:00
Fu Hanxi
952b0e349e ci: fix .build-test-rules.yml since esp32s2 tests unabled 2024-08-09 14:56:52 +08:00
Fu Hanxi
9201cfc4cd ci: fix test case markers when put targets as params 2024-08-09 14:56:52 +08:00
Geng Yuchao
4a70ba9e7b feat: update nimble submodule to support Bluetooth LE 5.1 Direction Finding featrue 2024-08-09 14:51:37 +08:00
Geng Yuchao
25a12ef95e feat: Add direction finding relate defines and kconfig and CMakeLists 2024-08-09 14:51:37 +08:00
Sudeep Mohanty
0db5d725ef fix(freertos): Fixed critical section macro in vTaskPlaceOnEventListRestricted()
The vTaskPlaceOnEventListRestricted() did not use the correct macro when
exiting a kernel cirtical section. This does not affect the HW targets
but on the Linux port, this caused an issue as the critical nesting
count became negative, leading to deadlocks. This commit fixes the bug
and updates the linux port to prevent the nesting count from going
negative.
2024-08-09 08:45:23 +02:00
Jan Beran
a7141f75d7 fix: Fix condition checking if secure boot signing key exists 2024-08-09 08:38:38 +02:00
Shen Meng Jing
2db9096df3 Merge branch 'docs/fix_a_typo' into 'master'
docs: Fix a small typo in adc_calibration.rst

Closes DOC-8542

See merge request espressif/esp-idf!32542
2024-08-09 14:35:30 +08:00
C.S.M
c431e9b830 feat(spiram): refactor for spiram device driver for s3/c5 2024-08-09 11:43:04 +08:00
Zhang Xiao Yan
5f00f0d994 Merge branch 'docs/delete_user_guides_three_esp32_dev_boards' into 'master'
docs: delete user guides of ESP32-DevKitC, ESP-WROVER-KIT and ESP32-PICO-DevKitM-2

See merge request espressif/esp-idf!32587
2024-08-09 11:42:31 +08:00
Chen Ji Chang
1b0fb462b6 Merge branch 'feat/add_dedic_gpio_support_on_c61' into 'master'
feat(dedic_gpio): support dedic gpio on esp32c61

Closes IDF-9321

See merge request espressif/esp-idf!32688
2024-08-09 11:37:44 +08:00
Marius Vikhammer
0bcee8518b fix(freertos): split idf_additions.c event groups to separate file 2024-08-09 11:19:40 +08:00
dvosully
025b336916 Make FreeRTOS configUSE_TIMERS optional in KConfig 2024-08-09 11:19:40 +08:00
Island
be4278fc47 Merge branch 'fix/ble_mesh_github_pr_14140' into 'master'
fix(ble-mesh): don't use dangling pointer in nimble gatt service

See merge request espressif/esp-idf!32597
2024-08-09 10:33:08 +08:00
wanlei
4313f22a1e change(soc): re-generate ahb_dma header file for esp32c61 2024-08-09 10:13:43 +08:00
igor.udot
a262df7c31 feat: c61 add gdma support 2024-08-09 10:12:40 +08:00
Erhan Kurubas
c7931b0782 feat(esp_system): preload openocd stub binaries and reserve memory for debugging 2024-08-08 23:25:26 +02:00
Adam Múdry
d1571c144b Merge branch 'feat/sdmmc_support_concurrent_use' into 'master'
feat(sdmmc): Concurrent use of SDMMC peripheral

Closes IDF-9152

See merge request espressif/esp-idf!31150
2024-08-09 01:08:16 +08:00
Martin Vychodil
a5871f8fa8 Merge branch 'feature/fs_considerations' into 'master'
[Storage/Docs]: File system considerations

Closes IDF-8430 and IDF-8436

See merge request espressif/esp-idf!29972
2024-08-09 00:23:54 +08:00
Ondrej Kosta
9e10cca102 fix(esp_eth): fixed default GPIO to match new ver. of P4 devboard 2024-08-08 18:11:38 +02:00
andylinpersonal
0dbb6d94ec fix(ulp): Add the missing extern "C" guard to ulp_lp_core_print.h
This commit adds the missing extern `C` guards the ulp_lp_core_print.h
header file.

Closes https://github.com/espressif/esp-idf/pull/14329
2024-08-08 23:23:08 +08:00
Martin Vychodil
e60f6d024e docs(storage): added File system considerations document into the API Guides 2024-08-08 15:57:35 +02:00
zhanghaipeng
b261ee37e4 fix(bt): Update bt lib for ESP32-C3 and ESP32-S3(f583012)
- Fix BLE channel map update when latency is not zero
2024-08-08 21:33:52 +08:00
Tian Sen Wen
61e05bddc9 fix(esp_eth): Fix DM9051 abnormal operation when SPI clock is too high
Simplified buffer allocation for DM9051
2024-08-08 20:53:48 +08:00
Mario Schlegel
9c98a8584b fix(ble-mesh): don't use dangling pointer in nimble gatt service 2024-08-08 17:39:51 +08:00
Mahavir Jain
f477682938 Merge branch 'feature/remove_aes_rsa_ds_hmac_spport_for_c61' into 'master'
feat: remove suppport for AES, RSA, DS and HMAC in esp32c61

Closes IDF-9326, IDF-9328, IDF-9323, and IDF-9325

See merge request espressif/esp-idf!31798
2024-08-08 17:15:06 +08:00
Mahavir Jain
0aeb9653e7 Merge branch 'fix/avoid_extra_c2m_msync_in_aes_driver' into 'master'
fix(mbedtls/aes): Avoid extra C2M sync of memory

See merge request espressif/esp-idf!32599
2024-08-08 17:04:14 +08:00
C.S.M
3a8c8849b2 Merge branch 'feat/usb_serial_jtag_c61' into 'master'
feature(usb_serial_jtag): Add usb serial jtag support on esp32c61

Closes IDF-9319

See merge request espressif/esp-idf!32676
2024-08-08 15:03:59 +08:00
Armando (Dou Yiwen)
4b77ecdb45 Merge branch 'feat/cache_panic_c5_c61' into 'master'
cache panic: support on c5 and c61

Closes IDF-8645 and IDF-9252

See merge request espressif/esp-idf!32586
2024-08-08 14:09:07 +08:00
Chen Jichang
2fafecdc2e feat(dedic_gpio): support dedic gpio on esp32c61 2024-08-08 14:00:19 +08:00
Mahavir Jain
3f797278fc Merge branch 'contrib/github_pr_14317' into 'master'
fix(mbedtls/port): fix codespell issues (GitHub PR)

Closes IDFGH-13410

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

See merge request espressif/esp-idf!32668
2024-08-08 12:31:49 +08:00
Shen Meng Jing
77c7ec97c6 Merge branch 'docs/translate_spi_flash_optional_feature' into 'master'
Docs/Provide Chinese translation for spi-flash-optional-feature

Closes DOC-8198

See merge request espressif/esp-idf!31743
2024-08-08 11:47:20 +08:00
harshal.patil
b9dc847ee2
fix(mbedtls/aes): Avoid extra C2M sync of memory 2024-08-08 09:12:31 +05:30
Richard Allen
bc56b4fc2e fix(mbedtls/port): fix codespell issues
Fix a few comments codespell identified.
2024-08-08 11:29:53 +08:00
Hong Shu Qing
50df8480b4 Merge branch 'feature/esp32c61_rng_func_support' into 'master'
feat(esp32c61): support rng api

See merge request espressif/esp-idf!32534
2024-08-08 11:16:10 +08:00
C.S.M
bf31a8e781 feat(usb_serial_jtag): Add usb serial jtag support on esp32c61 2024-08-08 11:11:24 +08:00
renpeiying
afd3179ae8 docs: Provide Chinese translation for host-based-security-workflows.rst 2024-08-08 11:03:24 +08:00
shenmengjing
33af6856cf docs: Provide CN translation for spi-flash-optional-feature 2024-08-08 11:00:50 +08:00
Armando
36f601b459 test(cache): cache panic test app 2024-08-08 10:38:02 +08:00
Armando
7231a6388b feat(cache): supported cache panic on c61 2024-08-08 10:38:02 +08:00
Armando
190ea15839 feat(cache): supported cache panic on c5 2024-08-08 10:38:02 +08:00
morris
199b7e9b9c Merge branch 'refactor/brownout_ll_function' into 'master'
refactor(brownout): correct names comments in the LL driver

See merge request espressif/esp-idf!32634
2024-08-08 10:09:19 +08:00
Chen Jichang
f919336448 feat(dma): Add helper functions to split aligned buffer
In some cases we will need the dma's buffer to be aligned with specific
requirements. This MR add two helper function to split the unaligned
buffer and merge to the origin buffer. The cost is that each unaligned
buffer requires two stash buffers of spilt alignment size. And this
memory should be managed by callers.
2024-08-07 19:48:19 +08:00
Chen Jian Xing
56816c1ff4 Merge branch 'bugfix/fix_some_esp32_host_issues' into 'master'
Bugfix/fix some esp32 host issues

Closes IDFCI-2286

See merge request espressif/esp-idf!31618
2024-08-07 19:29:08 +08:00
Shu Chen
4025f1fc61 feat(openthread): support time sync feature on border router 2024-08-07 18:52:27 +08:00
Michael Wei
c33c8a27c4 fix(openthread): fix RCP build to pass time sync and CSL options
Closes https://github.com/espressif/esp-idf/pull/14060
2024-08-07 18:50:37 +08:00
Rahul Tank
313f016eaf Merge branch 'bugfix/fix_proxy_example_assert' into 'master'
fix(nimble): Fixed assert issue in proximity_sensor example

Closes BLERP-907

See merge request espressif/esp-idf!32559
2024-08-07 18:03:29 +08:00
Armando (Dou Yiwen)
3a0c25124e Merge branch 'fix/fix_lp_i2s_coverity_issue' into 'master'
lp_i2s: fixed coverity issue

Closes IDF-10715, IDF-10713, IDF-10716, IDF-10714, and IDF-10717

See merge request espressif/esp-idf!32617
2024-08-07 17:29:06 +08:00
Shen Weilong
a5551179ac feat(ble): Print out the BT mac when the controller is initialized 2024-08-07 16:40:27 +08:00
Shen Meng Jing
327683185c Merge branch 'docs/update_cn_ulp_lp_core' into 'master'
docs: Update the CN translation for ulp-lp-core.rst

Closes DOC-8463

See merge request espressif/esp-idf!32321
2024-08-07 16:09:42 +08:00
Laukik Hase
6a47d2c9f6 Merge branch 'feat/mbedtls_esp_sha_224_support' into 'master'
feat(mbedtls): Extend the `esp_sha` API to support SHA224 operations

See merge request espressif/esp-idf!32637
2024-08-07 14:31:55 +08:00
Kevin (Lao Kaiyao)
a500f3d3c0 Merge branch 'refactor/i2s_refactor_for_etm' into 'master'
refactor(i2s): refactor to use i2s etm controlling

Closes IDF-10508

See merge request espressif/esp-idf!32315
2024-08-07 14:22:38 +08:00
Rahul Tank
a547ebb383 Merge branch 'feat/set_data_length_enhancement' into 'master'
feat(nimble): Add extra handling for set data len packet event

Closes BLERP-905

See merge request espressif/esp-idf!32515
2024-08-07 13:06:42 +08:00
laokaiyao
ac2d980df3 fix(i2s): fix the es8311 example on P4
Closes https://github.com/espressif/esp-idf/issues/14297
2024-08-07 12:44:25 +08:00
Laukik Hase
e8477fb894
feat(mbedtls): Extend the esp_sha API to support SHA224 operations 2024-08-07 10:03:11 +05:30
morris
aaa338ab8d Merge branch 'contrib/github_pr_14310' into 'master'
fix(gptimer): remove incorrect param from example (GitHub PR)

Closes IDFGH-13403

See merge request espressif/esp-idf!32664
2024-08-07 12:24:50 +08:00
Igor Udot
b40ac839cc Merge branch 'ci/test_correct_exit_code' into 'master'
Add support for Dynamic Pipeline Configuration

Closes IDFCI-2035 and IDFCI-1936

See merge request espressif/esp-idf!29115
2024-08-07 11:04:07 +08:00
LonerDan
08fa1131ca docs(gptimer): remove incorrect param from example
Fixes call to `gptimer_start` in one of the examples
which includes extra second parameter `&alarm_config`,
when the function takes only one.

Mreges https://github.com/espressif/esp-idf/pull/14310
2024-08-07 10:52:37 +08:00
Linda
8d09486eea docs: delete user guides of ESP32-DevKitC, ESP-WROVER-KIT and ESP32-PICO-DevKitM-2 2024-08-07 10:49:26 +08:00
morris
9716d9e5ca refactor(brownout): correct names comments in the LL driver 2024-08-07 10:46:57 +08:00
liqigan
06b2276b7f fix(esp_hid): Loose the check of input report length to be more compatible
Closes https://github.com/espressif/esp-idf/issues/14259
2024-08-07 10:28:35 +08:00
Armando
257fda87c0 change(adc): updated adc programming guide atten link 2024-08-07 09:59:02 +08:00
Armando
6219d5e7d4 fix(lp_i2s): fixed coverity issue 2024-08-07 09:59:02 +08:00
Martin Vychodil
22be262fca fix(security): Fixed ESP32S3 Memprot RTCFAST code-execution test 2024-08-06 20:54:35 +02:00
hongshuqing
e036a7b745 feat(bootloader): add rng support for ESP32-C61 2024-08-06 20:21:07 +08:00
Shen Meng Jing
e62133ad8e Merge branch 'docs/update_examples_in_touch_element' into 'master'
docs: Update the application examples in touch_element.rst

Closes DOC-8327

See merge request espressif/esp-idf!32002
2024-08-06 19:13:44 +08:00
Shen Meng Jing
cf0925e383 Merge branch 'docs/update_examples_in_i2s' into 'master'
docs: Update the application examples in i2s

Closes DOC-8322

See merge request espressif/esp-idf!31997
2024-08-06 18:45:35 +08:00
Shen Meng Jing
ad84e5b9d0 Merge branch 'docs/update_the_example_in_adc_continuous' into 'master'
docs: Update the application example in adc_continuous

Closes DOC-8317

See merge request espressif/esp-idf!31988
2024-08-06 18:34:08 +08:00
nilesh.kale
e74dcb1fab feat: remove support for aes and rsa peripherals in esp32c61 2024-08-06 15:06:16 +05:30
nilesh.kale
bedfe0fe3b feat: remove suppport for ds and hmac in esp32c61
This commit remove support for DS and HMAC peripheral
in ESP32C61.
2024-08-06 15:06:08 +05:30
Island
f305b74d43 Merge branch 'feat/ble_mesh_support_esp32c5' into 'master'
Feat/ble mesh support esp32c5

Closes BLERP-893 and IDF-9165

See merge request espressif/esp-idf!32479
2024-08-06 17:34:02 +08:00
Mahavir Jain
afaa7c4fe9 Merge branch 'change/exclude_cves' into 'master'
change: exclude CVEs that do not impact ESP-IDF components

See merge request espressif/esp-idf!32521
2024-08-06 17:19:00 +08:00
shenmengjing
1132a4ed51 docs: Update the application examples in touch_element.rst 2024-08-06 17:05:26 +08:00
Jakob Hasse
e565224149 feat(bootloader_support): added bootloader_support mocks 2024-08-06 11:03:55 +02:00
shenmengjing
255a39dd2d docs: Update the application examples in i2s 2024-08-06 17:01:31 +08:00
shenmengjing
b0450e013c docs: Update the application example in adc_continuous 2024-08-06 16:52:59 +08:00
Adam Múdry
014dddad1f feat(sdmmc): Concurrent use of SDMMC peripheral
Host and device (card, etc.) initialization is not thread-safe.
After initialization transactions are serialized and guarded by mutex.
Changed `SDMMC_HOST_DEFAULT()` default deinit function to `sdmmc_host_deinit_slot`
which has a slot number as argument.
2024-08-06 10:34:13 +02:00
Island
ff4f1a24ce Merge branch 'bugfix/fixed_ble_issues_on_c6_h2_c2_0731' into 'master'
Bugfix/fixed ble issues on c6 h2 c2 0731

Closes BLERP-858, BLERP-856, BLERP-772, BLERP-888, BLERP-886, BLERP-884, BLERP-883, BLERP-879, BLERP-877, and BLERP-899

See merge request espressif/esp-idf!32457
2024-08-06 16:00:49 +08:00
Shen Meng Jing
524d6b143f Merge branch 'docs/update_examples_in_cap_touch_sens' into 'master'
docs: Update the application examples in cap_touch_sens.rst

Closes DOC-8328

See merge request espressif/esp-idf!32005
2024-08-06 15:21:57 +08:00
shenmengjing
5cc184a25e docs: Update the application examples in cap_touch_sens.rst 2024-08-06 14:09:56 +08:00
Mahavir Jain
a6b6851f75 Merge branch 'feat/enable_ecdsa_support_in_esp32c61' into 'master'
feat: enabled support for ecdsa in esp32c61

Closes IDF-9231

See merge request espressif/esp-idf!31366
2024-08-06 13:55:08 +08:00
Shen Meng Jing
e9590a2d59 Merge branch 'docs/translate_ppa' into 'master'
docs: Provide CN translation for ppa.rst

Closes DOC-8476

See merge request espressif/esp-idf!32318
2024-08-06 12:49:45 +08:00
Armando (Dou Yiwen)
88c45ecf13 Merge branch 'fix/pr_14304' into 'master'
adc: fixed attributes order in example to match the declaration in oneshot example (PR 14304)

Closes IDFGH-13395 and IDFGH-13396

See merge request espressif/esp-idf!32611
2024-08-06 12:04:42 +08:00
shenmengjing
bb2b955bd7 docs: Provide CN translation for ppa.rst 2024-08-06 11:33:07 +08:00
zhanghaipeng
3e98408b92 docs(ble/bluedroid): Optimize documentation for BLE connection parameter updates 2024-08-06 11:17:46 +08:00
Ludovic BOUÉ
e1ef3f7451 adc_oneshot_chan_cfg_t config: Fix attributes order in example to match the declaration
Closes https://github.com/espressif/esp-idf/pull/14304
Closes https://github.com/espressif/esp-idf/issues/14303
2024-08-06 11:06:54 +08:00
Wu Zheng Hui
82e76abaa8 Merge branch 'bugfix/fix_esp32p4_sleep_psram_access_failure' into 'master'
fix(esp_hw_support): support esp32p4  psram  sleep retention

Closes PM-138, PM-177, PM-187, PM-189, and PM-190

See merge request espressif/esp-idf!32190
2024-08-06 10:49:03 +08:00
Island
707dd9b599 Merge branch 'bugfix/fix_cble50y24_81' into 'master'
feat(bt/bluedroid): Add print and assert when failed to alloc memory

Closes BLERP-809

See merge request espressif/esp-idf!31634
2024-08-06 10:46:49 +08:00
Gao Xu
e094c927e9 Merge branch 'feature/esp32c61_uart_support' into 'master'
feat(uart): support uart on ESP32C61

Closes IDF-9320, IDF-9341, and IDF-9329

See merge request espressif/esp-idf!32254
2024-08-06 10:39:06 +08:00
Shu Chen
8e4454b285 Merge branch 'feature/support_ieee802154_for_esp32c5_base_master' into 'master'
Some checks failed
docker / docker (push) Has been cancelled
feat(802.15.4): support 802.15.4 on esp32c5

Closes TZ-959 and TZ-956

See merge request espressif/esp-idf!32240
2024-08-06 10:34:48 +08:00
laokaiyao
1c52462a4d docs(i2s): update programming guide for I2S ETM feature 2024-08-06 10:16:34 +08:00
laokaiyao
a51b5dbe78 refactor(i2s): refactor to use i2s etm controlling 2024-08-06 10:16:34 +08:00
laokaiyao
b6de55b634 feat(i2s): support i2s etm event and task 2024-08-06 10:16:34 +08:00
muhaidong
c0c8280ec1 fix(wifi): fix wifi example itwt build fail issue 2024-08-05 21:43:57 +08:00
Alexey Gerenkov
13bcf6ba33 Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20240726' into 'master'
feat(tools): update openocd version to v0.12.0-esp32-20240726

See merge request espressif/esp-idf!32492
2024-08-05 21:35:02 +08:00
Fu Hanxi
b879b5c219 Merge branch 'docs/rstfmt' into 'master'
docs: fix found warnings and errors by rstfmt

See merge request espressif/esp-idf!32524
2024-08-05 20:06:27 +08:00
Island
ba4e111e87 Merge branch 'bugfix/fix_blecrt_196' into 'master'
feat(bt/bluedroid): Report HCI error code to app when command fails

Closes BLERP-897

See merge request espressif/esp-idf!32411
2024-08-05 19:51:54 +08:00
Wang Meng Yang
ef3d0633e3 Merge branch 'feat/add_sdkconfig_for_ci_in_bt_example' into 'master'
Feat/add sdkconfig for ci in bt example

See merge request espressif/esp-idf!32474
2024-08-05 17:57:08 +08:00
Armando (Dou Yiwen)
d16bb64005 Merge branch 'feature/lp_i2s' into 'master'
lp_i2s: support lp_i2s driver

Closes IDF-10355

See merge request espressif/esp-idf!31494
2024-08-05 17:55:35 +08:00
Fu Hanxi
1d40eb8ce3
docs: fix found warnings and errors by rstfmt 2024-08-05 11:50:07 +02:00
Marius Vikhammer
41b7b55cb6 Merge branch 'bugfix/hints_spelling' into 'master'
fix(tools): fixed spelling mistakes in idf.py hints

See merge request espressif/esp-idf!32590
2024-08-05 17:33:38 +08:00
Ivan Grokhotkov
c5f4eb7442 Merge branch 'ci/disable_dangerjs_releasenote_check' into 'master'
change(ci): disable dangerjs checker for release notes

See merge request espressif/esp-idf!32557
2024-08-05 17:30:02 +08:00
Liu Xiao Yu
4d03f63de0 Merge branch 'change/bu_lp_i2c_c5' into 'master'
change(ulp): bring up lp i2c on esp32c5

Closes IDF-8634

See merge request espressif/esp-idf!32142
2024-08-05 16:58:20 +08:00
Mahavir Jain
03e9b1a44b Merge branch 'fix/docs_nvs_encryption_update' into 'master'
docs(nvs_encryption): Updated the docs of nvs_encryption

See merge request espressif/esp-idf!32346
2024-08-05 16:51:46 +08:00
Tomas Rezucha
b71bf5f014 Merge branch 'docs/remove_c5_usb' into 'master'
docs(esp32c5): Remove USB docs from the 'docs_not_updated' list

Closes IDF-9456

See merge request espressif/esp-idf!32566
2024-08-05 16:31:49 +08:00
chenjianhua
800f360cc3 feat(bt/bluedroid): Add print and assert when failed to alloc memory 2024-08-05 16:18:41 +08:00
igor.udot
e669c7ab5b ci: fast_pipeline yml branch 2024-08-05 16:07:36 +08:00
Marius Vikhammer
837f2cd48a fix(tools): fixed spelling mistakes in idf.py hints 2024-08-05 15:44:48 +08:00
Mahavir Jain
9b5137347d Merge branch 'fix/incorrect_config_name' into 'master'
Fix encrypt image instead of the partition optimisation not being enabled

See merge request espressif/esp-idf!32517
2024-08-05 15:37:25 +08:00
gaoxu
cd9d8bf2e9 feat(uart): support uart on ESP32C61 2024-08-05 15:06:51 +08:00
C.S.M
6b94f0766f Merge branch 'fix/mmu_func_force_inline' into 'master'
fix(mmu_map): make a static function force inline in order not be put in flash

See merge request espressif/esp-idf!32550
2024-08-05 14:02:31 +08:00
Rahul Tank
15dbfa8a5b feat(nimble): Add extra handling for set data len packet event 2024-08-05 11:05:27 +05:30
Rahul Tank
737d8f8455 Merge branch 'bugfix/adjust_tx_power_lvl_boundary' into 'master'
fix(nimble): Modify Advertising Tx power levels

Closes BLERP-901

See merge request espressif/esp-idf!32484
2024-08-05 13:24:29 +08:00
wuzhenghui
55219ba7f4
change(esp_hw_support): add case to test PSRAM survives after lightsleep 2024-08-05 13:21:09 +08:00
wuzhenghui
819680ff9b
change(esp_hw_support): reorder light/deep sleep test cases and wrapper with corresponding support macros 2024-08-05 13:21:08 +08:00
wuzhenghui
d7eb829fd0
feat(esp_hw_support): support esp32p4 psram retention 2024-08-05 13:21:05 +08:00
nilesh.kale
5cc0110958 feat: enabled support for ecdsa in esp32c61
This commit add ECDSA peripheral support in ESP32C61.
2024-08-05 09:29:31 +05:30
nilesh.kale
849726a3b7 feat: enable secure boot feature for esp32c61 2024-08-05 09:23:27 +05:30
morris
7e2bc478d7 Merge branch 'docs/remove_user_guide_for_esp32_ethernet_migration' into 'master'
docs: remove user guide for esp32-ethernet-kit migration

Closes DOC-6911

See merge request espressif/esp-idf!32365
2024-08-05 11:35:14 +08:00
Shen Meng Jing
5700b2a2ad Merge branch 'docs/update_examples_in_touch_pad' into 'master'
docs: Update the application examples in touch_pad.rst

Closes DOC-8325

See merge request espressif/esp-idf!32001
2024-08-05 11:02:12 +08:00
C.S.M
20183e0770 Merge branch 'feat/gpspi_flash_support' into 'master'
feat(spi_flash): Add external flash support on esp32c6,esp32h2,esp32p4,esp32c5

See merge request espressif/esp-idf!32337
2024-08-05 11:00:15 +08:00
Shen Meng Jing
8bfc1fa2f1 Merge branch 'docs/update_examples_in_dac' into 'master'
docs: Update the application examples in dac.rst

Closes DOC-8318

See merge request espressif/esp-idf!31989
2024-08-05 10:59:20 +08:00
morris
89cf4479b0 Merge branch 'change/pin_ili9881c_version' into 'master'
change(examples): set the ili9881c version to 0.2.x

See merge request espressif/esp-idf!32552
2024-08-05 10:59:18 +08:00
Zhang Yan Jiao
d2197be1ee Merge branch 'bugfix/fix_mesh_ie_issue_from_leaf_to_root' into 'master'
fix(wifi/mesh): clear the rootless state in mesh ie when changing from leaf to root

Closes IDFGH-13117 and IDFCI-1116

See merge request espressif/esp-idf!32220
2024-08-05 10:41:41 +08:00
Gao Xu
ff4620a51d Merge branch 'feature/manage_isp_continuous_oneshot_conflict' into 'master'
ISP: AE/AF/AWB continuous concurrent manage

Closes IDF-10579 and IDF-10672

See merge request espressif/esp-idf!32519
2024-08-05 09:28:12 +08:00
Armando (Dou Yiwen)
5dbf2aea2a Merge branch 'fix/pr_14288' into 'master'
sdspi: add dma_aligned_buffer and pwr_ctrl_handle fields (pr_14288)

Closes IDFGH-13376

See merge request espressif/esp-idf!32532
2024-08-05 09:18:46 +08:00
Mahavir Jain
3efe0853fb Merge branch 'bugfix/null_assign_variable' into 'master'
fix(wifi_prov): Use calloc instead of malloc to zero initialize variable

See merge request espressif/esp-idf!32525
2024-08-02 22:03:39 +08:00
Tomas Rezucha
b0a308bdc0 docs(esp32c5): Remove USB docs from the 'docs_not_updated' list 2024-08-02 15:41:03 +02:00
Rahul Tank
108a38d7a5 fix(nimble): Fixed assert issue in proximity_sensor example 2024-08-02 15:29:51 +05:30
Ivan Grokhotkov
0ca8567bb6
change(ci): disable dangerjs checker for release notes 2024-08-02 11:56:38 +02:00
Roland Dobai
1939258ded Merge branch 'change/update-kconfcheck-pre-commit' into 'master'
ci(pre-commit): bump kconfig checker pre-commit version to 2.3.0

See merge request espressif/esp-idf!32445
2024-08-02 17:22:34 +08:00
gaoxu
e3a717fd15 feat(isp): fix potentiual AF/AE/AWB continuous and oneshot conflict and add test 2024-08-02 16:52:35 +08:00
Atsunori Saito
5518e5639c fix(sdspi): add dma_aligned_buffer and pwr_ctrl_handle fields
Closes https://github.com/espressif/esp-idf/pull/14288
2024-08-02 16:51:52 +08:00
zwl
ca5cb23095 fix: fixed directed adv can't be conneted when adv filter is 0x2 on ESP32C2 2024-08-02 16:34:21 +08:00
morris
9419dbfe68 change(examples): set the ili9881c version to 0.2.x 2024-08-02 16:34:21 +08:00
zwl
556264dcad fix: fixed occasional wdt issue in multi-connection scenarios on ESP32H2 2024-08-02 16:34:21 +08:00
C.S.M
7c08d417d2 fix(mmu_map): make a static function force inline in order not be put in flash 2024-08-02 15:51:22 +08:00
Roland Dobai
608642e090 Merge branch 'fix/setuptools_constraint' into 'master'
fix: ensure the constraint file is followed also for setuptools

Closes IDF-10681

See merge request espressif/esp-idf!32489
2024-08-02 15:20:53 +08:00
shenmengjing
7e15d1893d docs: Fix a small typo in adc_calibration.rst 2024-08-02 15:12:12 +08:00
zhangyanjiao
d7e03943d4 fix(wifi/mesh): clear the rootless state in mesh ie when changing from leaf to root
Closes https://github.com/espressif/esp-idf/issues/14063
2024-08-02 14:44:56 +08:00
zwx
3d46e6ed1d feat(802.15.4): support 802.15.4 on esp32c5 2024-08-02 14:34:07 +08:00
gongyantao
6e2804c907 change(ci): remove device name check in bt example 2024-08-02 14:28:44 +08:00
gongyantao
4882feaed8 fix(bt): get remote device name from eir data 2024-08-02 14:28:44 +08:00
gongyantao
9044b81452 feat(bt/example): add ci sdkconfig for bt examples 2024-08-02 14:28:33 +08:00
Xu Xiao
cf05fa303f Merge branch 'fix/fix_esp32c5_crash_issues' into 'master'
fix(wifi): fix esp32c5 crash issues when connect with full channel scan

Closes WIFIBUG-686 and WIFI-6620

See merge request espressif/esp-idf!32486
2024-08-02 14:22:41 +08:00
Rahul Tank
a6f90b5a02 fix(nimble): Modify Advertising Tx power levels 2024-08-02 11:24:56 +05:30
Rahul Tank
35e88684db fix(wifi_prov): Use calloc instead of malloc to zero initialize variable 2024-08-02 10:33:28 +05:30
Armando
20e665022f test(lp_i2s): added lp i2s read tests 2024-08-02 12:02:05 +08:00
Armando
ee8933f651 feat(lp_i2s): lp_i2s driver 2024-08-02 12:02:05 +08:00
renpeiying
6e0579c766 docs: remove user guide for esp32-ethernet-kit migration 2024-08-02 12:01:16 +08:00
Chen Yu Dong
7c92d98c04 fix(ci): update iperf build ci condition
Co-authored-by: Chen Yu Dong <chenyudong@espressif.com>
2024-08-02 11:43:44 +08:00
muhaidong
79575e4232 fix(wifi): enable p4 and esp8689 build iperf in ci 2024-08-02 11:42:44 +08:00
muhaidong
971d9b8762 fix(wifi): support esp32_host ext_connect in iper 2024-08-02 11:42:44 +08:00
alanmaxwell
42074a3f36 fix(wifi_host): support esp32p4 host get mac addr from target 2024-08-02 11:42:44 +08:00
muhaidong
4a2395c488 fix(iperf): add esp_extconn idf component ymy 2024-08-02 11:42:44 +08:00
Alexey Lapshin
b5261aec9b Merge branch 'fix/absent-component-error-message' into 'master'
fix(build): fix error message for absent component

See merge request espressif/esp-idf!32498
2024-08-02 11:36:28 +08:00
morris
6c7560a7fc Merge branch 'change/disable_eot_in_lp_mode' into 'master'
change(dsi): don't send eot packet in lp mode

See merge request espressif/esp-idf!32480
2024-08-02 11:31:11 +08:00
Armando (Dou Yiwen)
0dd91afb09 Merge branch 'feat/c61_cache' into 'master'
cache: supported cache on c61

Closes IDF-9253 and DOC-8436

See merge request espressif/esp-idf!32407
2024-08-02 03:37:43 +08:00
Frantisek Hrbata
1679ed83ea fix: ensure the constraint file is followed also for setuptools
Currently, when the venv is installed or updated, we attempt to
automatically update pip and setuptools within the venv. Unfortunately,
the setuptools package is installed or updated without adhering to the
constraints file, which restricts the setuptools version due to
https://github.com/pypa/setuptools/issues/4480. Resolve this issue by
applying the constraints file to the installation and update of both pip
and setuptools.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-08-01 15:48:31 +02:00
Song Ruo Jing
ac8295fd19 Merge branch 'feature/esp32c61_clock_support' into 'master'
feat(clk): Add basic clock support for esp32c61

Closes IDF-9249

See merge request espressif/esp-idf!32244
2024-08-01 21:31:32 +08:00
Rahul Tank
d663a27053 Merge branch 'bugfix/add_return_value_to_rpa_to_api' into 'master'
fix(nimble): Add return value to RPA Timeout API

See merge request espressif/esp-idf!32312
2024-08-01 20:21:50 +08:00
xuxiao
4268d911cf fix(wifi): fix esp32c5 crash issues when connect with full channel scan 2024-08-01 20:21:12 +08:00
Jiang Jiang Jian
22c9566641 Merge branch 'bugfix/avoid_offchan_ftm_retries' into 'master'
fix(wifi): Avoid internal retries for offchannel FTM Requests

Closes WIFIBUG-661

See merge request espressif/esp-idf!32488
2024-08-01 19:32:40 +08:00
Alexey Lapshin
cd0e34ed87 Merge branch 'fix/fix-gcc13-dirent-breaking' into 'master'
fix(newlib): fix include sys/dirent.h breaking change

See merge request espressif/esp-idf!32469
2024-08-01 19:27:24 +08:00
Wu Zheng Hui
f2cf9a961b Merge branch 'doc/update_esp32p4_pm_programming_guide_docs' into 'master'
docs(pm): update power management related docs for esp32p4

Closes IDF-7672

See merge request espressif/esp-idf!31328
2024-08-01 19:05:15 +08:00
Shen Meng Jing
85ca4c625f Merge branch 'docs/delete_user_guide_esp32s2_kaluga_1_kit' into 'master'
docs: Delete ESP32-S2-Kaluga-Kit related user guide files

Closes DOC-6924

See merge request espressif/esp-idf!32355
2024-08-01 18:36:51 +08:00
Frantisek Hrbata
0fdb309d1e change: exclude CVEs that do not impact ESP-IDF components
cJSON:    CVE-2024-31755 - Resolved in cJSON v1.7.18
FreeRTOS: CVE-2024-28115 - Affects only ARMv7-M MPU ports, and ARMv8-M ports

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-08-01 12:24:47 +02:00
morris
85cbe538aa Merge branch 'doc/gptimer_include_etm_contents_conditionally' into 'master'
docs(gptimer): include etm content conditionally

Closes DOC-8437

See merge request espressif/esp-idf!32442
2024-08-01 17:49:58 +08:00
Island
c1e875fd38 Merge branch 'feat/support_enhanced_tx_power_on_esp32c3' into 'master'
Support enhanced BLE TX power setting and getting on ESP32C3

Closes BLERP-881 and BLERP-882

See merge request espressif/esp-idf!32289
2024-08-01 17:32:19 +08:00
shenmengjing
837221e2f2 docs: Delete ESP32-S2-Kaluga-Kit related user guide files 2024-08-01 17:01:37 +08:00
Wu Zheng Hui
9ef5712f35 Merge branch 'doc/update_gpio_deep_sleep_hold_en_api_guide' into 'master'
docs(gpio): update gpio_deep_sleep_hold_en API usage notes

Closes ESPCS-952

See merge request espressif/esp-idf!31962
2024-08-01 16:58:34 +08:00
harshal.patil
470ad32f2c
fix(bootloader_support): Fix encrypt image instead of the partition feature not being enabled 2024-08-01 14:10:06 +05:30
Gao Xu
3e974bd8a3 Merge branch 'feature/support_isp_ae' into 'master'
feat(isp): Support ISP Auto Exposure (AE)

Closes IDF-9592, IDF-10193, and IDF-10580

See merge request espressif/esp-idf!31671
2024-08-01 16:21:34 +08:00
wuzhenghui
172402528d
docs(pm): update power management related docs for esp32p4 2024-08-01 15:50:46 +08:00
Fu Hanxi
33b4d64918 Merge branch 'ci/add_soc_caps_test' into 'master'
ci: add idf-build-apps load soc caps test case

Closes IDFCI-2200

See merge request espressif/esp-idf!31543
2024-08-01 14:55:19 +08:00
Xiaoyu Liu
1216dd1abd change(ulp): bu lp i2c on esp32c5 2024-08-01 14:48:31 +08:00
wuzhenghui
5880defc25
fix(esp_hw_support): flash/psram SPI io is not controlled by hp iomux on esp32p4 2024-08-01 14:33:32 +08:00
wuzhenghui
29b51468e1
fix(esp_hw_support): fix bad power parameter if PSRAM is enabled during sleep 2024-08-01 14:33:31 +08:00
luoxu
5100917b5a feat(ble_mesh): Support BLE Mesh Example for esp32c5 2024-08-01 14:28:36 +08:00
luoxu
a16d90ac02 feat(ble_mesh): Support BLE Mesh lib for esp32c5 2024-08-01 14:28:36 +08:00
luoxu
bacae23734 feat(ble_mesh): Support BLE Mesh for esp32c5 2024-08-01 14:28:36 +08:00
luoxu
62e3f414a1 feat(ble_mesh): mesh lib update to aff87bf33a 2024-08-01 14:28:36 +08:00
Shen Meng Jing
5092ff51fd Merge branch 'docs/update_examples_in_sdm' into 'master'
docs: Update the application examples in sdm.rst

Closes DOC-8324

See merge request espressif/esp-idf!31998
2024-08-01 14:16:38 +08:00
Shen Meng Jing
20dd99761b Merge branch 'docs/translate_camera_driver' into 'master'
docs: Provide CN translation for camera_driver.rst

Closes DOC-8498

See merge request espressif/esp-idf!32364
2024-08-01 13:59:26 +08:00
Alexey Lapshin
1608b4cde4 fix(build): fix error message for absent component 2024-08-01 12:34:13 +07:00
Konstantin Kondrashov
e21fca42ef Merge branch 'fix/efuse_compiler_static_analizer_warns' into 'master'
fix(efuse): Fix GNU static analyzer warnings

Closes IDF-10086

See merge request espressif/esp-idf!31775
2024-08-01 13:29:25 +08:00
morris
b2a62ca860 change(dsi): don't send eot packet in lp mode
because some LCD doesn't respond to that
2024-08-01 12:48:22 +08:00
shenmengjing
cd3a43576a docs: Update the application examples in sdm 2024-08-01 12:04:23 +08:00
shenmengjing
f7232871b4 docs: Provide CN translation for camera_driver.rst 2024-08-01 11:52:29 +08:00
shenmengjing
0b420f4baa docs: Update the application examples in touch_pad.rst 2024-08-01 11:32:12 +08:00
shenmengjing
3770fadfc2 docs: Update the application examples in dac.rst 2024-08-01 11:26:04 +08:00
wuzhenghui
66fa61f353
docs(gpio): update gpio_deep_sleep_hold_en API usage notes 2024-08-01 10:37:23 +08:00
Jiang Jiang Jian
d321c0603e Merge branch 'bugfix/update_wifi_mesh_example' into 'master'
fix(wifi/mesh): fixed the netif issue when root restart multiple times

See merge request espressif/esp-idf!32200
2024-08-01 10:33:49 +08:00
morris
b2c5481343 Merge branch 'change/eol_v4_4_8' into 'master'
docs(readme): remove v4.4 support info

See merge request espressif/esp-idf!31799
2024-08-01 10:13:43 +08:00
morris
937ed7cbce docs(readme): remove v4.4 support info 2024-08-01 10:11:06 +08:00
Armando
81cee9db8a fix(psram): fixed typo in esp32 quad psram device driver comment 2024-08-01 09:34:18 +08:00
Armando
67b8dbb5e5 feat(cache): supported cache on c61 2024-08-01 09:34:18 +08:00
Alexey Gerenkov
56a234c2a4 feat(tools): update openocd version to v0.12.0-esp32-20240726 2024-07-31 17:29:38 +00:00
Martin Vychodil
381be3ba15 Merge branch 'bugfix/sdmmc_test_app_usj_console' into 'master'
ci(sdmmc): switch to usb_serial_jtag in the test app for P4

Closes IDFCI-2299

See merge request espressif/esp-idf!32487
2024-07-31 23:05:29 +08:00
Song Ruo Jing
6db52ffe12 remove(clk): rc32k is removed as a clk source option for lp_slow_clk on C5/C61 2024-07-31 22:41:23 +08:00
Song Ruo Jing
335d39b869 feat(clk): Add basic clock support for esp32c61
- Support SOC ROOT clock source switch
- Support CPU frequency change
- Support RTC SLOW clock source switch
- Support RTC SLOW clock + RC FAST calibration
- Remove FPGA build
2024-07-31 22:41:22 +08:00
Nachiket Kukade
8b0a69d2a7 fix(wifi): Avoid internal retries for offchannel FTM Requests 2024-07-31 19:14:30 +05:30
Ivan Grokhotkov
ec66ecb176
ci(sdmmc): switch to usb_serial_jtag in the test app for P4
New CI runners use usb_serial_jtag, update configuration to match this.
2024-07-31 15:37:11 +02:00
Wang Meng Yang
d92c09a0ad Merge branch 'bugfix/baidu_sniff_disc_esp32' into 'master'
fix(bt/controller):  Fixed the issue of disconnection caused by updating the channel map in sniff mode

Closes AUD-5479

See merge request espressif/esp-idf!32007
2024-07-31 19:04:43 +08:00
Alexey Lapshin
24e2426b9e fix(newlib): fix include sys/dirent.h breaking change 2024-07-31 17:12:23 +07:00
Igor Udot
b5ab82ce3c Merge branch 'fix/replace_pytest_function' into 'master'
ci: replace pytest function

Closes IDFCI-1693

See merge request espressif/esp-idf!30531
2024-07-31 17:23:56 +08:00
Michael (XIAO Xufeng)
3cb3b5b61e Merge branch 'feat/unity_runner_print_stage_number' into 'master'
feat(unity_test): print stage number when unity test run

See merge request espressif/esp-idf!28344
2024-07-31 17:15:24 +08:00
Rahul Tank
7c2d3a9e3b fix(nimble): Add return value to RPA Timeout API 2024-07-31 14:41:45 +05:30
Konstantin Kondrashov
0bdf675992 fix(linux): Fix warnings for Linux target when COMPILER_STATIC_ANALYZER=y 2024-07-31 11:23:54 +03:00
Mo Fei Fei
fad3d5aae0 Merge branch 'docs/update_cn_trans_storage_api_index' into 'master'
docs: update cn trans for storage api reference index

Closes DOC-8137

See merge request espressif/esp-idf!32011
2024-07-31 15:47:00 +08:00
Konstantin Kondrashov
97f26e99d1 fix(efuse): Fix warnings when COMPILER_STATIC_ANALYZER=y
- fixed a false-positive warning in esp_efuse_utility
- refactored an efuse function
2024-07-31 10:31:43 +03:00
C.S.M
f4ca7bfc48 Merge branch 'fix/flash_idle_judge' into 'master'
fix(spi_flash): Fix issue that bit_length is wrong on suspend chip because not judge idle correctly

See merge request espressif/esp-idf!32282
2024-07-31 15:12:30 +08:00
gaoxu
51a7de23b8 feat(isp_ae): add thread safe lock for ISP AE 2024-07-31 15:08:48 +08:00
gaoxu
0b8269ee96 docs(isp_ae): add isp auto exposure programming guide 2024-07-31 15:08:48 +08:00
gaoxu
c88ba68cb0 feat(isp): ISP dispatched ISRs together 2024-07-31 15:08:47 +08:00
Zhang Shu Xian
2667b31d0a Merge branch 'docs/update_cn_trans_for_peripherals' into 'master'
docs: Update cn trans and fix format issues for api-reference

Closes DOC-8374

See merge request espressif/esp-idf!32086
2024-07-31 14:50:49 +08:00
Jakob Hasse
1ced23330b Merge branch 'refactor/deprecate_esp_linux_helper_h' into 'master'
refactor(linux): deprecated esp_linux_helper.h

Closes IDF-9391

See merge request espressif/esp-idf!32448
2024-07-31 14:36:25 +08:00
mofeifei
c5f1fda388 docs: update cn trans for storage api reference index 2024-07-31 14:35:36 +08:00
Wu Zheng Hui
40a910bfa8 Merge branch 'fix/disable_timer_wakeup_source_with_auto_sleep_off' into 'master'
fix(esp_pm): disable timer wakeup source with auto light-sleep off

Closes PM-170

See merge request espressif/esp-idf!32116
2024-07-31 13:17:15 +08:00
Island
24e49de66c Merge branch 'feat/save_ble_log_to_flash_0605' into 'master'
ble: save ble log to flash on ESP32C6

Closes BLERP-796, BLERP-885, BLERP-889, and BLERP-894

See merge request espressif/esp-idf!31352
2024-07-31 11:51:00 +08:00
Hong Shu Qing
90ea731fe1 Merge branch 'feature/esp32c5_rng_support' into 'master'
feat(esp32c5mp): support for rng api and test example

Closes IDF-8626

See merge request espressif/esp-idf!31902
2024-07-31 11:49:59 +08:00
gaoxu
cb6ecc470c feat(isp_ae): add isp auto exposure driver test 2024-07-31 11:18:53 +08:00
gaoxu
3c0fe579b6 feat(isp_ae): support isp auto exposure 2024-07-31 11:18:51 +08:00
Jiang Jiang Jian
f201d49565 Merge branch 'fix/fix_wrong_protocol_element_in_probe_response' into 'master'
fix(wifi): fix softAP fill protocol element in 2G prob-response with 5G configuration

Closes WIFIBUG-683 and WIFIBUG-533

See merge request espressif/esp-idf!32447
2024-07-31 11:12:40 +08:00
xiongweichao
e50547f664 fix(bt/controller): Fixed disconnection issue
- Fixed the issue of disconnection caused by updating the channel map in sniff mode
2024-07-31 10:33:33 +08:00
Jakob Hasse
ae15f1c4f9 refactor(linux): deprecated esp_linux_helper.h 2024-07-30 16:41:28 +02:00
wuzhenghui
dee3e19599
fix(esp_pm): configure timer wakeup source with auto light-sleep congiguration 2024-07-30 21:28:07 +08:00
xuxiao
b6aee39c13 fix(wifi): fix softAP fill protocol element in 2G prob-response with 5G configuration 2024-07-30 20:10:49 +08:00
Jan Beran
852bf714a7 ci(pre-commit): bump kconfig checker pre-commit version to 2.3.0 2024-07-30 14:00:25 +02:00
Wang Mengyang
fd4f4a2fa0 fix(bt): Fix heap corruption in the call of esp_bt_mem_release on ESP32
Closes https://github.com/espressif/esp-idf/issues/14263
2024-07-30 19:29:03 +08:00
Wang Mengyang
ced444e49c change(bt): Perform comprehensive heap check in test_app for memory release 2024-07-30 19:29:03 +08:00
morris
53e3df2e03 docs(gptimer): include etm content conditionally
https://www.esp32.com/viewtopic.php?f=12&t=40991&p=135107#p135098
2024-07-30 18:25:01 +08:00
C.S.M
17f814acf3 fix(spi_flash): Add external flash support on esp32c6,esp32h2,esp32p4,esp32c5 2024-07-30 11:10:29 +08:00
Fu Hanxi
b5bdc1ac9b
ci: add idf-build-apps load soc caps test case 2024-07-29 15:34:26 +02:00
chenjianhua
1ba831b0e2 feat(bt/bluedroid): Report HCI error code to app when command fails 2024-07-29 15:23:14 +08:00
C.S.M
69950910cb fix(spi_flash): Fix issue that bit_length is wrong on suspend chip because not judge idle correctly 2024-07-29 14:35:30 +08:00
hrushikesh.bhosale
74b5033284 docs(nvs_encryption): Updated the docs of nvs_encryption
Updated the documentation by changing subtype from key to
nvs_keys in nvs_encryption.rst
2024-07-26 12:21:47 +05:30
zwl
e4922b9629 fix(ble): fixed tx memory leak issue when controller disable 2024-07-26 14:29:39 +08:00
zwl
d62f1d3d43 fix(ble): fixed wdt issue when print key controller info on ESP32-C6 and ESP32-H2 2024-07-26 14:26:42 +08:00
zwl
959d649126 feat(bluetooth/controller): support switching log output mode on ESP32-C2 2024-07-26 14:26:42 +08:00
zwl
3e13e70290 feat(bluetooth/controller): support switching log output mode on ESP32-C6 and ESP32-H2 2024-07-26 14:26:42 +08:00
zwl
ca6bb9e60b feat(bluetooth/controller): storage ble controller log to flash on ESP32C2 2024-07-26 14:26:42 +08:00
zwl
60e6a6116f feat(bluetooth/controller): storage ble controller log to flash on ESP32C6 and ESP32H2 2024-07-26 14:26:42 +08:00
shenmengjing
c59699b364 docs: Update the CN translation for ulp-lp-core.rst 2024-07-24 19:01:48 +08:00
Adam Múdry
caa4f7fd20 refactor(sdmmc): Allow sdmmc_host_init to be called multiple times
Along with slight refactor for sdmmc_host.c
2024-07-23 12:35:19 +02:00
chenjianhua
6c2fc9da53 feat(bt): Update bt lib for ESP32-C3 and ESP32-S3(4e58df9)
- Support enhanced BLE TX power setting and getting
2024-07-23 16:22:26 +08:00
igor.udot
b0e8ce0111 ci: replace pytest function for linux target 2024-07-23 14:07:31 +08:00
igor.udot
8691672f03 ci: replace pytest function 2024-07-23 14:07:31 +08:00
Zhang Shuxian
a99d6a9e6f docs: Update cn trans and fix format issues for api-reference 2024-07-19 14:31:00 +08:00
zhangyanjiao
5ca25c81ff fix(wifi/mesh): update the mesh ip_internal_network example 2024-07-18 14:13:55 +08:00
zhangyanjiao
751b103ddc fix(wifi/mesh): fixed the dhcp offer send error issue when root restart multiple times
Closes https://github.com/espressif/esp-idf/issues/13212
2024-07-18 11:28:44 +08:00
hongshuqing
1454be7d4e feat(esp32c5): add rng support for bootloader and app 2024-07-18 11:04:44 +08:00
Jakob Hasse
eb0e894d94 refactor(nvs_flash): Use gcovr instead of lcov for host-based page test 2024-06-25 19:21:54 +02:00
Dave Legg
a8b4627705 fix(esp32s3): Add config value for RTC_XTAL_CAL_RETRY for S3 hardware variant 2024-02-05 22:22:23 +00:00
igor.udot
93166f8756 feat(unity_test): print stage number when unity test run 2024-01-09 10:08:54 +08:00
2147 changed files with 74706 additions and 42363 deletions

View File

@ -31,4 +31,5 @@ include:
- '.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'

View File

@ -108,6 +108,7 @@
/components/esp_psram/ @esp-idf-codeowners/peripherals @esp-idf-codeowners/system
/components/esp_ringbuf/ @esp-idf-codeowners/system
/components/esp_rom/ @esp-idf-codeowners/system @esp-idf-codeowners/bluetooth @esp-idf-codeowners/wifi
/components/esp_security/ @esp-idf-codeowners/security
/components/esp_system/ @esp-idf-codeowners/system
/components/esp_timer/ @esp-idf-codeowners/system
/components/esp-tls/ @esp-idf-codeowners/app-utilities

View File

@ -323,6 +323,7 @@ build_child_pipeline:
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

View File

@ -12,6 +12,7 @@ stages:
- test_deploy
- deploy
- post_deploy
- retry_failed_jobs
variables:
# System environment
@ -102,6 +103,8 @@ variables:
CCACHE_DIR: "/cache/idf_ccache"
CCACHE_MAXSIZE: "50G"
FF_USE_NEW_BASH_EVAL_STRATEGY: "true"
################################################
# `before_script` and `after_script` Templates #
################################################
@ -285,8 +288,8 @@ variables:
git remote add origin "${CI_REPOSITORY_URL}"
fi
.git_checkout_fetch_head: &git_checkout_fetch_head |
git checkout FETCH_HEAD
.git_checkout_ci_commit_sha: &git_checkout_ci_commit_sha |
git checkout $CI_COMMIT_SHA
git clean ${GIT_CLEAN_FLAGS}
# git diff requires two commits, with different CI env var
@ -310,6 +313,7 @@ variables:
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}
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA)
git fetch origin $CI_COMMIT_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
# merge request pipelines, when the mr got conflicts
elif [[ -n $CI_MERGE_REQUEST_DIFF_BASE_SHA ]]; then
git fetch origin $CI_MERGE_REQUEST_DIFF_BASE_SHA --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
@ -325,7 +329,7 @@ variables:
git fetch origin $CI_COMMIT_SHA --depth=2 ${GIT_FETCH_EXTRA_FLAGS}
export GIT_DIFF_OUTPUT=$(git diff --name-only $CI_COMMIT_SHA~1 $CI_COMMIT_SHA)
fi
- *git_checkout_fetch_head
- *git_checkout_ci_commit_sha
- *common-before_scripts
- *setup_tools_and_idf_python_venv
- add_gitlab_ssh_keys
@ -339,7 +343,7 @@ variables:
- *git_init
- *git_fetch_from_mirror_url_if_exists
- git fetch origin "${CI_COMMIT_SHA}" --depth=1 ${GIT_FETCH_EXTRA_FLAGS}
- *git_checkout_fetch_head
- *git_checkout_ci_commit_sha
- *common-before_scripts
- *setup_tools_and_idf_python_venv
- add_gitlab_ssh_keys

View File

@ -1,4 +1,4 @@
# Extenal DangerJS
# External DangerJS
include:
- project: espressif/shared-ci-dangerjs
ref: master
@ -10,7 +10,6 @@ run-danger-mr-linter:
GIT_STRATEGY: none # no repo checkout
ENABLE_CHECK_AREA_LABELS: 'true'
ENABLE_CHECK_DOCS_TRANSLATION: 'true'
ENABLE_CHECK_RELEASE_NOTES_DESCRIPTION: 'true'
ENABLE_CHECK_UPDATED_CHANGELOG: 'false'
before_script: []
cache: []

View File

@ -11,7 +11,7 @@ extra_default_build_targets:
- esp32c61
bypass_check_test_targets:
- esp32c61
#
# These lines would
# - enable the README.md check for esp32c6. Don't forget to add the build jobs in .gitlab/ci/build.yml

View File

@ -68,22 +68,6 @@ test_ldgen_on_host:
variables:
LC_ALL: C.UTF-8
test_reproducible_build:
extends: .host_test_template
script:
- ./tools/ci/test_reproducible_build.sh
artifacts:
when: on_failure
paths:
- "**/sdkconfig"
- "**/build*/*.bin"
- "**/build*/*.elf"
- "**/build*/*.map"
- "**/build*/flasher_args.json"
- "**/build*/*.bin"
- "**/build*/bootloader/*.bin"
- "**/build*/partition_table/*.bin"
test_spiffs_on_host:
extends: .host_test_template
script:
@ -385,7 +369,6 @@ test_pytest_macos:
--ignore-result-files ${KNOWN_FAILURE_CASES_FILE_NAME}
--app-info-filepattern \"list_job_*.txt\"
test_idf_pytest_plugin:
extends:
- .host_test_template
@ -400,3 +383,22 @@ test_idf_pytest_plugin:
- 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
variables:
LC_ALL: C.UTF-8
script:
- cd ${IDF_PATH}/components/nvs_flash/nvs_partition_tool
- pytest --noconftest test_nvs_gen_check.py --junitxml=XUNIT_RESULT.xml

View File

@ -135,6 +135,7 @@ 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
- |
@ -157,6 +158,7 @@ pipeline_variables:
if [ -n "$CI_PYTHON_CONSTRAINT_BRANCH" ]; then
echo "BUILD_AND_TEST_ALL_APPS=1" >> pipeline.env
fi
- python tools/ci/ci_process_description.py
- cat pipeline.env
- python tools/ci/artifacts_handler.py upload --type modified_files_and_components_report
artifacts:
@ -166,3 +168,15 @@ pipeline_variables:
- pipeline.env
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: []
script:
- echo "This job is redundant to ensure the 'retry_failed_jobs' job can exist and not be skipped"
when: always

View File

@ -0,0 +1,15 @@
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

@ -108,8 +108,6 @@
- "tools/detect_python.sh"
- "tools/detect_python.fish"
- "tools/ci/test_reproducible_build.sh"
- "tools/gen_soc_caps_kconfig/*"
- "tools/gen_soc_caps_kconfig/test/test_gen_soc_caps_kconfig.py"

View File

@ -13,3 +13,17 @@
<!-- Either state release notes or write "No release notes" -->
<!-- ## Breaking change notes --><!-- Optional -->
<!-- ## Dynamic Pipeline Configuration
```yaml
Test Case Filters:
# Only run tests that match the given substring expression (modified files/components will be ignored):
# Please use a list of strings.
# This will run the test cases filtered like `pytest -k "(<list_item_1>) or (<list_item_2>) or ...`
# The fast pipeline will fail at the final stage.
# For example:
- test_sdm and not sdmmc
- test_hello_world
# This example will include all tests containing 'test_hello_world' in the name,
# and include all tests containing 'test_sdm' but not 'sdmmc' in the name.
``` --><!-- Optional -->

1
.gitmodules vendored
View File

@ -55,6 +55,7 @@
sbom-url = https://github.com/DaveGamble/cJSON
sbom-description = Ultralightweight JSON parser in ANSI C
sbom-hash = acc76239bee01d8e9c858ae2cab296704e52d916
sbom-cve-exclude-list = CVE-2024-31755 Resolved in v1.7.18
[submodule "components/mbedtls/mbedtls"]
path = components/mbedtls/mbedtls

View File

@ -241,6 +241,6 @@ 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.1.0
rev: v2.3.0
hooks:
- id: check-kconfig-files

View File

@ -16,7 +16,11 @@ endif()
if(NOT BOOTLOADER_BUILD)
if(CONFIG_COMPILER_OPTIMIZATION_SIZE)
list(APPEND compile_options "-Os")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Oz")
else()
list(APPEND compile_options "-Os")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks")
endif()
@ -34,7 +38,11 @@ if(NOT BOOTLOADER_BUILD)
else() # BOOTLOADER_BUILD
if(CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE)
list(APPEND compile_options "-Os")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
list(APPEND compile_options "-Oz")
else()
list(APPEND compile_options "-Os")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
list(APPEND compile_options "-freorder-blocks")
endif()
@ -152,46 +160,8 @@ if(CONFIG_COMPILER_DUMP_RTL_FILES)
list(APPEND compile_options "-fdump-rtl-expand")
endif()
if(NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS 8.0.0)
if(CONFIG_COMPILER_HIDE_PATHS_MACROS)
list(APPEND compile_options "-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=.")
list(APPEND compile_options "-fmacro-prefix-map=${IDF_PATH}=/IDF")
endif()
if(CONFIG_APP_REPRODUCIBLE_BUILD)
idf_build_set_property(DEBUG_PREFIX_MAP_GDBINIT "${BUILD_DIR}/prefix_map_gdbinit")
list(APPEND compile_options "-fdebug-prefix-map=${IDF_PATH}=/IDF")
list(APPEND compile_options "-fdebug-prefix-map=${PROJECT_DIR}=/IDF_PROJECT")
list(APPEND compile_options "-fdebug-prefix-map=${BUILD_DIR}=/IDF_BUILD")
# component dirs
idf_build_get_property(python PYTHON)
idf_build_get_property(idf_path IDF_PATH)
idf_build_get_property(component_dirs BUILD_COMPONENT_DIRS)
execute_process(
COMMAND ${python}
"${idf_path}/tools/generate_debug_prefix_map.py"
"${BUILD_DIR}"
"${component_dirs}"
OUTPUT_VARIABLE result
RESULT_VARIABLE ret
)
if(NOT ret EQUAL 0)
message(FATAL_ERROR "This is a bug. Please report to https://github.com/espressif/esp-idf/issues")
endif()
spaces2list(result)
list(LENGTH component_dirs length)
math(EXPR max_index "${length} - 1")
foreach(index RANGE ${max_index})
list(GET component_dirs ${index} folder)
list(GET result ${index} after)
list(APPEND compile_options "-fdebug-prefix-map=${folder}=${after}")
endforeach()
endif()
endif()
__generate_prefix_map(prefix_map_compile_options)
list(APPEND compile_options ${prefix_map_compile_options})
if(CONFIG_COMPILER_DISABLE_GCC12_WARNINGS)
list(APPEND compile_options "-Wno-address"
@ -227,8 +197,35 @@ endif()
list(APPEND link_options "-fno-lto")
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
# Not all versions of the MacOS linker support the -warn_commons flag.
# ld version 1053.12 (and above) have been tested to support it.
# Hence, we extract the version string from the linker output
# before including the flag.
# Get the ld version, capturing both stdout and stderr
execute_process(
COMMAND ${CMAKE_LINKER} -v
OUTPUT_VARIABLE LD_VERSION_OUTPUT
ERROR_VARIABLE LD_VERSION_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
# Combine stdout and stderr
set(LD_VERSION_OUTPUT "${LD_VERSION_OUTPUT}\n${LD_VERSION_ERROR}")
# Extract the version string
string(REGEX MATCH "PROJECT:(ld|dyld)-([0-9]+)\\.([0-9]+)" LD_VERSION_MATCH "${LD_VERSION_OUTPUT}")
set(LD_VERSION_MAJOR_MINOR "${CMAKE_MATCH_2}.${CMAKE_MATCH_3}")
message(STATUS "Linker Version: ${LD_VERSION_MAJOR_MINOR}")
# Compare the version with 1053.12
if(LD_VERSION_MAJOR_MINOR VERSION_GREATER_EQUAL "1053.12")
list(APPEND link_options "-Wl,-warn_commons")
endif()
list(APPEND link_options "-Wl,-dead_strip")
list(APPEND link_options "-Wl,-warn_commons")
else()
list(APPEND link_options "-Wl,--gc-sections")
list(APPEND link_options "-Wl,--warn-common")

22
Kconfig
View File

@ -135,7 +135,6 @@ mainmenu "Espressif IoT Development Framework Configuration"
default "y" if IDF_TARGET="esp32c61"
select FREERTOS_UNICORE
select IDF_TARGET_ARCH_RISCV
select IDF_ENV_FPGA
config IDF_TARGET_LINUX
bool
@ -324,8 +323,8 @@ mainmenu "Espressif IoT Development Framework Configuration"
help
This option sets compiler optimization level (gcc -O argument) for the app.
- The "Debug" setting will add the -0g flag to CFLAGS.
- The "Size" setting will add the -0s flag to CFLAGS.
- The "Debug" setting will add the -Og flag to CFLAGS.
- The "Size" setting will add the -Os flag to CFLAGS (-Oz with Clang).
- The "Performance" setting will add the -O2 flag to CFLAGS.
- The "None" setting will add the -O0 flag to CFLAGS.
@ -346,7 +345,7 @@ mainmenu "Espressif IoT Development Framework Configuration"
config COMPILER_OPTIMIZATION_DEBUG
bool "Debug (-Og)"
config COMPILER_OPTIMIZATION_SIZE
bool "Optimize for size (-Os)"
bool "Optimize for size (-Os with GCC, -Oz with Clang)"
config COMPILER_OPTIMIZATION_PERF
bool "Optimize for performance (-O2)"
config COMPILER_OPTIMIZATION_NONE
@ -389,6 +388,21 @@ mainmenu "Espressif IoT Development Framework Configuration"
endchoice # assertions
config COMPILER_ASSERT_NDEBUG_EVALUATE
bool "Enable the evaluation of the expression inside assert(X) when NDEBUG is set"
default y
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
the result will never cause an assertion. This means that if X is a function
then the function will be called.
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

View File

@ -15,17 +15,17 @@ 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 | v4.4 | v5.0 | v5.1 | v5.2 | v5.3 | |
|:----------- | :---------------------:| :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------------------------------------------- |
|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] | [Announcement](https://www.espressif.com/en/news/ESP32-C2) |
|ESP32-C6 | | | ![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] | [Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|ESP32-P4 | | | | | ![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) |
|Chip | v5.0 | v5.1 | v5.2 | v5.3 | |
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :--------------------------------------------------------- |
|ESP32 | ![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] | |
|ESP32-C3 | ![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] | [Announcement](https://www.espressif.com/en/news/ESP32_S3) |
|ESP32-C2 | ![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] | [Announcement](https://www.espressif.com/en/news/ESP32_C6) |
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [Announcement](https://www.espressif.com/en/news/ESP32_H2) |
|ESP32-P4 | | | | ![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) |
[supported]: https://img.shields.io/badge/-supported-green "supported"
[preview]: https://img.shields.io/badge/-preview-orange "preview"

View File

@ -15,17 +15,17 @@ ESP-IDF 是乐鑫官方推出的物联网开发框架,支持 Windows、Linux
下表总结了乐鑫芯片在 ESP-IDF 各版本中的支持状态,其中 ![alt text][supported] 代表已支持,![alt text][preview] 代表目前处于预览支持状态。预览支持状态通常有时间限制,而且仅适用于测试版芯片。请确保使用与芯片相匹配的 ESP-IDF 版本。
|芯片 | v4.4 | v5.0 | v5.1 | v5.2 | v5.3 | |
|:----------- | :---------------------:| :---------------------:| :--------------------: | :--------------------: | :--------------------: | :-------------------------------------------------------------- |
|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] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C2) |
|ESP32-C6 | | | ![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] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|ESP32-P4 | | | | | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/en/news/ESP32-P4) |
|ESP32-C5 | | | | | ![alt text][preview] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32-C5) |
|芯片 | v5.0 | v5.1 | v5.2 | v5.3 | |
|:----------- | :---------------------:| :--------------------: | :--------------------: | :--------------------: | :-------------------------------------------------------------- |
|ESP32 | ![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] | |
|ESP32-C3 | ![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] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_S3) |
|ESP32-C2 | ![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] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_C6) |
|ESP32-H2 | | ![alt text][supported] | ![alt text][supported] | ![alt text][supported] | [芯片发布公告](https://www.espressif.com/zh-hans/news/ESP32_H2) |
|ESP32-P4 | | | | ![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) |
[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"
@ -122,7 +122,7 @@ ESP-IDF 中的子模块采用相对路径([详见 .gitmodules 文件](.gitmodu
* 最新版的文档https://docs.espressif.com/projects/esp-idf/ ,该文档是由本仓库 [docs 目录](docs) 构建得到。
* [初学者指南:主要概念和资源](https://www.bilibili.com/video/BV1114y1r7du/)
* [初学者指南:主要概念和资源](https://www.bilibili.com/video/BV1114y1r7du/)
* 可以前往 [esp32.com 论坛](https://esp32.com/) 提问,挖掘社区资源。

View File

@ -2,6 +2,6 @@
components/app_update/test_apps:
disable:
- if: IDF_TARGET in ["esp32c5", "esp32c61"]
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: target esp32c5 is not supported yet # TODO: [ESP32C5] IDF-8640, IDF-10317, [ESP32C61] IDF-9245
reason: target esp32c61 is not supported yet # TODO: [ESP32C61] IDF-9245

View File

@ -1,2 +1,2 @@
| 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-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
@ -19,14 +19,8 @@ def run_multiple_stages(dut: Dut, test_case_num: int, stages: int) -> None:
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported deep sleep') # TODO: [ESP32C5] IDF-8640, IDF-10317
# TODO: [ESP32C61] IDF-9245, IDF-9247, IDF-10983
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='C61 has not supported deep sleep')
@pytest.mark.generic
def test_app_update(dut: Dut) -> None:
extra_data = dut.parse_test_menu()
for test_case in extra_data:
if test_case.type != 'multi_stage':
dut.write(str(test_case.index))
else:
run_multiple_stages(dut, test_case.index, len(test_case.subcases))
dut.expect_unity_test_output(timeout=90)
dut.expect_exact("Enter next test, or 'enter' to see menu")
dut.run_all_single_board_cases(timeout=90)

View File

@ -20,14 +20,14 @@ menu "Bootloader config"
This option sets compiler optimization level (gcc -O argument)
for the bootloader.
- The default "Size" setting will add the -0s flag to CFLAGS.
- The default "Size" setting will add the -Os (-Oz with clang) flag to CFLAGS.
- The "Debug" setting will add the -Og flag to CFLAGS.
- The "Performance" setting will add the -O2 flag to CFLAGS.
Note that custom optimization levels may be unsupported.
config BOOTLOADER_COMPILER_OPTIMIZATION_SIZE
bool "Size (-Os)"
bool "Size (-Os with GCC, -Oz with Clang)"
config BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG
bool "Debug (-Og)"
config BOOTLOADER_COMPILER_OPTIMIZATION_PERF
@ -776,6 +776,33 @@ menu "Security features"
This can lead to permanent bricking of the device, in case all keys are revoked
because of signature verification failure.
config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool "Do not disable the ability to further read protect eFuses"
depends on SECURE_BOOT_V2_ENABLED
default n
help
If not set (default, recommended), on first boot the bootloader will burn the WR_DIS_RD_DIS
efuse when Secure Boot is enabled. This prevents any more efuses from being read protected.
If this option is set, it will remain possible to write the EFUSE_RD_DIS efuse field after Secure
Boot is enabled. This may allow an attacker to read-protect the BLK2 efuse (for ESP32) and
BLOCK4-BLOCK10 (i.e. BLOCK_KEY0-BLOCK_KEY5)(for other chips) holding the secure boot public key digest,
causing an immediate denial of service and possibly allowing an additional fault injection attack to
bypass the signature protection.
The option must be set when you need to program any read-protected key type into the efuses,
e.g., HMAC, ECDSA etc. after secure boot has already been enabled on the device.
Please refer to secure boot V2 documentation guide for more details.
NOTE: Once a BLOCK is read-protected, the application will read all zeros from that block
NOTE: If "UART ROM download mode (Permanently disabled (recommended))" or
"UART ROM download mode (Permanently switch to Secure mode (recommended))" is set,
then it is __NOT__ possible to read/write efuses using espefuse.py utility.
However, efuse can be read/written from the application
Please refer to the Secure Boot V2 documentation guide for more information.
config SECURE_BOOT_FLASH_BOOTLOADER_DEFAULT
bool "Flash bootloader along with other artifacts when using the default flash command"
depends on SECURE_BOOT_V2_ENABLED && SECURE_BOOT_BUILD_SIGNED_BINARIES
@ -956,26 +983,6 @@ menu "Security features"
image to this length. It is generally not recommended to set this option, unless you have a legacy
partitioning scheme which doesn't support 64KB aligned partition lengths.
config SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool "Allow additional read protecting of efuses"
depends on SECURE_BOOT_INSECURE && SECURE_BOOT_V2_ENABLED
help
If not set (default, recommended), on first boot the bootloader will burn the WR_DIS_RD_DIS
efuse when Secure Boot is enabled. This prevents any more efuses from being read protected.
If this option is set, it will remain possible to write the EFUSE_RD_DIS efuse field after Secure
Boot is enabled. This may allow an attacker to read-protect the BLK2 efuse (for ESP32) and
BLOCK4-BLOCK10 (i.e. BLOCK_KEY0-BLOCK_KEY5)(for other chips) holding the public key digest, causing an
immediate denial of service and possibly allowing an additional fault injection attack to
bypass the signature protection.
NOTE: Once a BLOCK is read-protected, the application will read all zeros from that block
NOTE: If "UART ROM download mode (Permanently disabled (recommended))" or
"UART ROM download mode (Permanently switch to Secure mode (recommended))" is set,
then it is __NOT__ possible to read/write efuses using espefuse.py utility.
However, efuse can be read/written from the application
config SECURE_BOOT_ALLOW_UNUSED_DIGEST_SLOTS
bool "Leave unused digest slots available (not revoke)"
depends on SECURE_BOOT_INSECURE && SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS

View File

@ -59,7 +59,7 @@ if(CONFIG_SECURE_SIGNED_APPS)
# If the signing key is not found, create a phony gen_secure_boot_signing_key target that
# fails the build. fail_at_build_time causes a cmake run next time
# (to pick up a new signing key if one exists, etc.)
if(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME)
if(CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME OR CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME)
fail_at_build_time(gen_secure_boot_signing_key
"Secure Boot Signing Key ${CONFIG_SECURE_BOOT_SIGNING_KEY} does not exist. Generate using:"
"\tidf.py secure-generate-signing-key ${CONFIG_SECURE_BOOT_SIGNING_KEY}")

View File

@ -15,7 +15,7 @@ set(srcs
"src/secure_boot.c"
)
if(NOT CONFIG_IDF_ENV_FPGA)
if(NOT CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING)
# For FPGA ENV, bootloader_random implementation is implemented in `bootloader_random.c`
list(APPEND srcs "src/bootloader_random_${IDF_TARGET}.c")
endif()

View File

@ -18,19 +18,8 @@
#endif
#include "hal/spi_flash_ll.h"
#include "rom/spi_flash.h"
#if CONFIG_IDF_TARGET_ESP32
# include "soc/spi_struct.h"
# include "soc/spi_reg.h"
/* SPI flash controller */
# define SPIFLASH SPI1
# define SPI0 SPI0
#else
# include "hal/spimem_flash_ll.h"
# include "soc/spi_mem_struct.h"
# include "soc/spi_mem_reg.h"
/* SPI flash controller */
# define SPIFLASH SPIMEM1
# define SPI0 SPIMEM0
#if !CONFIG_IDF_TARGET_ESP32
#include "hal/spimem_flash_ll.h"
#endif
// This dependency will be removed in the future. IDF-5025
@ -334,7 +323,8 @@ static esp_err_t bootloader_flash_read_allow_decrypt(size_t src_addr, void *dest
ESP_EARLY_LOGD(TAG, "mmu set block paddr=0x%08" PRIx32 " (was 0x%08" PRIx32 ")", map_at, current_read_mapping);
#if CONFIG_IDF_TARGET_ESP32
//Should never fail if we only map a SPI_FLASH_MMU_PAGE_SIZE to the vaddr starting from FLASH_READ_VADDR
int e = cache_flash_mmu_set(0, 0, FLASH_READ_VADDR, map_at, 64, 1);
// Return value unused if asserts are disabled
int e __attribute__((unused)) = cache_flash_mmu_set(0, 0, FLASH_READ_VADDR, map_at, 64, 1);
assert(e == 0);
#else
uint32_t actual_mapped_len = 0;
@ -587,61 +577,43 @@ IRAM_ATTR uint32_t bootloader_flash_execute_command_common(
{
assert(mosi_len <= 32);
assert(miso_len <= 32);
uint32_t old_ctrl_reg = SPIFLASH.ctrl.val;
uint32_t old_user_reg = SPIFLASH.user.val;
uint32_t old_user1_reg = SPIFLASH.user1.val;
uint32_t old_user2_reg = SPIFLASH.user2.val;
// Clear ctrl regs.
SPIFLASH.ctrl.val = 0;
uint32_t old_ctrl_reg = 0;
uint32_t old_user_reg = 0;
uint32_t old_user1_reg = 0;
uint32_t old_user2_reg = 0;
spi_flash_ll_get_common_command_register_info(&SPIMEM_LL_APB, &old_ctrl_reg, &old_user_reg, &old_user1_reg, &old_user2_reg);
SPIMEM_LL_APB.ctrl.val = 0;
#if CONFIG_IDF_TARGET_ESP32
spi_flash_ll_set_wp_level(&SPIFLASH, true);
spi_flash_ll_set_wp_level(&SPIMEM_LL_APB, true);
#else
spimem_flash_ll_set_wp_level(&SPIFLASH, true);
spimem_flash_ll_set_wp_level(&SPIMEM_LL_APB, true);
#endif
//command phase
SPIFLASH.user.usr_command = 1;
SPIFLASH.user2.usr_command_bitlen = 7;
SPIFLASH.user2.usr_command_value = command;
spi_flash_ll_set_command(&SPIMEM_LL_APB, command, 8);
//addr phase
SPIFLASH.user.usr_addr = addr_len > 0;
SPIFLASH.user1.usr_addr_bitlen = addr_len - 1;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.addr = (addr_len > 0)? (address << (32-addr_len)) : 0;
#else
SPIFLASH.addr = address;
#endif
spi_flash_ll_set_addr_bitlen(&SPIMEM_LL_APB, addr_len);
spi_flash_ll_set_usr_address(&SPIMEM_LL_APB, address, addr_len);
//dummy phase
uint32_t total_dummy = dummy_len;
if (miso_len > 0) {
total_dummy += g_rom_spiflash_dummy_len_plus[1];
}
SPIFLASH.user.usr_dummy = total_dummy > 0;
SPIFLASH.user1.usr_dummy_cyclelen = total_dummy - 1;
spi_flash_ll_set_dummy(&SPIMEM_LL_APB, total_dummy);
//output data
SPIFLASH.user.usr_mosi = mosi_len > 0;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.mosi_dlen.usr_mosi_dbitlen = mosi_len ? (mosi_len - 1) : 0;
#else
SPIFLASH.mosi_dlen.usr_mosi_bit_len = mosi_len ? (mosi_len - 1) : 0;
#endif
SPIFLASH.data_buf[0] = mosi_data;
spi_flash_ll_set_mosi_bitlen(&SPIMEM_LL_APB, mosi_len);
spi_flash_ll_set_buffer_data(&SPIMEM_LL_APB, &mosi_data, mosi_len / 8);
//input data
SPIFLASH.user.usr_miso = miso_len > 0;
#if CONFIG_IDF_TARGET_ESP32
SPIFLASH.miso_dlen.usr_miso_dbitlen = miso_len ? (miso_len - 1) : 0;
#else
SPIFLASH.miso_dlen.usr_miso_bit_len = miso_len ? (miso_len - 1) : 0;
#endif
spi_flash_ll_set_miso_bitlen(&SPIMEM_LL_APB, miso_len);
SPIFLASH.cmd.usr = 1;
while (SPIFLASH.cmd.usr != 0) {
spi_flash_ll_user_start(&SPIMEM_LL_APB, false);
while(!spi_flash_ll_cmd_is_done(&SPIMEM_LL_APB)) {
}
SPIFLASH.ctrl.val = old_ctrl_reg;
SPIFLASH.user.val = old_user_reg;
SPIFLASH.user1.val = old_user1_reg;
SPIFLASH.user2.val = old_user2_reg;
spi_flash_ll_set_common_command_register_info(&SPIMEM_LL_APB, old_ctrl_reg, old_user_reg, old_user1_reg, old_user2_reg);
uint32_t ret = SPIFLASH.data_buf[0];
uint32_t output_data = 0;
spi_flash_ll_get_buffer_data(&SPIMEM_LL_APB, &output_data, miso_len / 8);
uint32_t ret = output_data;
if (miso_len < 32) {
//set unused bits to 0
ret &= ~(UINT32_MAX << miso_len);
@ -793,28 +765,9 @@ esp_err_t IRAM_ATTR bootloader_flash_xmc_startup(void)
#endif //XMC_SUPPORT
FORCE_INLINE_ATTR void bootloader_mspi_reset(void)
{
#if CONFIG_IDF_TARGET_ESP32
SPI1.slave.sync_reset = 0;
SPI0.slave.sync_reset = 0;
SPI1.slave.sync_reset = 1;
SPI0.slave.sync_reset = 1;
SPI1.slave.sync_reset = 0;
SPI0.slave.sync_reset = 0;
#else
SPIMEM1.ctrl2.sync_reset = 0;
SPIMEM0.ctrl2.sync_reset = 0;
SPIMEM1.ctrl2.sync_reset = 1;
SPIMEM0.ctrl2.sync_reset = 1;
SPIMEM1.ctrl2.sync_reset = 0;
SPIMEM0.ctrl2.sync_reset = 0;
#endif
}
esp_err_t IRAM_ATTR bootloader_flash_reset_chip(void)
{
bootloader_mspi_reset();
spi_flash_ll_sync_reset();
// Seems that sync_reset cannot make host totally idle.'
// Sending an extra(useless) command to make the host idle in order to send reset command.
bootloader_execute_flash_command(0x05, 0, 0, 0);
@ -844,7 +797,7 @@ bool IRAM_ATTR bootloader_flash_is_octal_mode_enabled(void)
esp_rom_spiflash_read_mode_t bootloader_flash_get_spi_mode(void)
{
esp_rom_spiflash_read_mode_t spi_mode = ESP_ROM_SPIFLASH_FASTRD_MODE;
uint32_t spi_ctrl = spi_flash_ll_get_ctrl_val(&SPI0);
uint32_t spi_ctrl = spi_flash_ll_get_ctrl_val(&SPIMEM_LL_CACHE);
#if CONFIG_IDF_TARGET_ESP32
if (spi_ctrl & SPI_FREAD_QIO) {
spi_mode = ESP_ROM_SPIFLASH_QIO_MODE;

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -28,12 +28,12 @@
#include "bootloader_flash_priv.h"
#include "bootloader_init.h"
#define FLASH_CLK_IO SPI_CLK_GPIO_NUM
#define FLASH_CS_IO SPI_CS0_GPIO_NUM
#define FLASH_SPIQ_IO SPI_Q_GPIO_NUM
#define FLASH_SPID_IO SPI_D_GPIO_NUM
#define FLASH_SPIWP_IO SPI_WP_GPIO_NUM
#define FLASH_SPIHD_IO SPI_HD_GPIO_NUM
#define FLASH_CLK_IO MSPI_IOMUX_PIN_NUM_CLK
#define FLASH_CS_IO MSPI_IOMUX_PIN_NUM_CS0
#define FLASH_SPIQ_IO MSPI_IOMUX_PIN_NUM_MISO
#define FLASH_SPID_IO MSPI_IOMUX_PIN_NUM_MOSI
#define FLASH_SPIWP_IO MSPI_IOMUX_PIN_NUM_WP
#define FLASH_SPIHD_IO MSPI_IOMUX_PIN_NUM_HD
void bootloader_flash_update_id(void)
{
@ -98,15 +98,15 @@ void IRAM_ATTR bootloader_flash_gpio_config(const esp_image_header_t* pfhdr)
} else {
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
if (spiconfig == ESP_ROM_EFUSE_FLASH_DEFAULT_SPI) {
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_CS, SPICS0_OUT_IDX, 0, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_MISO, SPIQ_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_MISO, SPIQ_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_MOSI, SPID_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_MOSI, SPID_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_WP, SPIWP_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_WP, SPIWP_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(SPI_IOMUX_PIN_NUM_HD, SPIHD_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(SPI_IOMUX_PIN_NUM_HD, SPIHD_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_CS_IO, SPICS0_OUT_IDX, 0, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPIQ_IO, SPIQ_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPIQ_IO, SPIQ_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPID_IO, SPID_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPID_IO, SPID_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPIWP_IO, SPIWP_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPIWP_IO, SPIWP_IN_IDX, 0);
esp_rom_gpio_connect_out_signal(FLASH_SPIHD_IO, SPIHD_OUT_IDX, 0, 0);
esp_rom_gpio_connect_in_signal(FLASH_SPIHD_IO, SPIHD_IN_IDX, 0);
//select pin function gpio
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA0_U, PIN_FUNC_GPIO);
gpio_hal_iomux_func_sel(PERIPHS_IO_MUX_SD_DATA1_U, PIN_FUNC_GPIO);
@ -190,7 +190,7 @@ int bootloader_flash_get_wp_pin(void)
case EFUSE_RD_CHIP_VER_PKG_ESP32PICOV302:
return ESP32_PICO_V3_GPIO;
default:
return SPI_WP_GPIO_NUM;
return MSPI_IOMUX_PIN_NUM_WP;
}
#endif
}

View File

@ -88,12 +88,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
// IDF-4066
const uint32_t spiconfig = 0;
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
}

View File

@ -92,12 +92,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
} else {

View File

@ -74,12 +74,12 @@ static const char *TAG = "boot.esp32c5";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -69,12 +69,12 @@ static const char *TAG = "boot.esp32c6";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -24,6 +24,7 @@
#include "hal/mmu_ll.h"
#include "hal/cache_hal.h"
#include "hal/cache_ll.h"
#include "hal/mspi_timing_tuning_ll.h"
static const char *TAG __attribute__((unused)) = "boot.esp32c61";
@ -69,12 +70,12 @@ void IRAM_ATTR bootloader_flash_clock_config(const esp_image_header_t *pfhdr)
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);
@ -197,6 +198,13 @@ static void bootloader_spi_flash_resume(void)
esp_err_t bootloader_init_spi_flash(void)
{
// Set source mspi pll clock as 80M in bootloader stage.
// SPLL clock on C61 is 480MHz , and mspi_pll needs 80MHz
// in this stage, set divider as 6
mspi_ll_clock_src_sel(MSPI_CLK_SRC_SPLL);
mspi_ll_fast_set_hs_divider(6);
bootloader_init_flash_configure();
bootloader_spi_flash_resume();
bootloader_flash_unlock();

View File

@ -70,12 +70,12 @@ static const char *TAG = "boot.esp32h2";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -66,12 +66,12 @@ static const char *TAG = "boot.esp32p4";
void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
esp_rom_gpio_pad_set_drv(clk_gpio_num, drv);
esp_rom_gpio_pad_set_drv(q_gpio_num, drv);
esp_rom_gpio_pad_set_drv(d_gpio_num, drv);

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -94,12 +94,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
} else {

View File

@ -105,12 +105,12 @@ void IRAM_ATTR bootloader_configure_spi_pins(int drv)
{
const uint32_t spiconfig = esp_rom_efuse_get_flash_gpio_info();
uint8_t wp_pin = esp_rom_efuse_get_flash_wp_gpio();
uint8_t clk_gpio_num = SPI_CLK_GPIO_NUM;
uint8_t q_gpio_num = SPI_Q_GPIO_NUM;
uint8_t d_gpio_num = SPI_D_GPIO_NUM;
uint8_t cs0_gpio_num = SPI_CS0_GPIO_NUM;
uint8_t hd_gpio_num = SPI_HD_GPIO_NUM;
uint8_t wp_gpio_num = SPI_WP_GPIO_NUM;
uint8_t clk_gpio_num = MSPI_IOMUX_PIN_NUM_CLK;
uint8_t q_gpio_num = MSPI_IOMUX_PIN_NUM_MISO;
uint8_t d_gpio_num = MSPI_IOMUX_PIN_NUM_MOSI;
uint8_t cs0_gpio_num = MSPI_IOMUX_PIN_NUM_CS0;
uint8_t hd_gpio_num = MSPI_IOMUX_PIN_NUM_HD;
uint8_t wp_gpio_num = MSPI_IOMUX_PIN_NUM_WP;
if (spiconfig == 0) {
} else {

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -181,6 +181,20 @@ uint32_t bootloader_common_get_chip_ver_pkg(void);
*/
esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type);
#if !CONFIG_IDF_TARGET_ESP32
/**
* @brief Check the eFuse block revision
*
* @param[in] min_rev_full The required minimum revision of the eFuse block
* @param[in] max_rev_full The required maximum revision of the eFuse block
* @return
* - ESP_OK: The eFuse block revision is in the required range.
* - ESP_OK: DISABLE_BLK_VERSION_MAJOR has been set in the eFuse of the SoC. No requirements shall be checked at this time.
* - ESP_FAIL: The eFuse block revision of this chip does not match the requirement of the current image.
*/
esp_err_t bootloader_common_check_efuse_blk_validity(uint32_t min_rev_full, uint32_t max_rev_full);
#endif // !CONFIG_IDF_TARGET_ESP32
/**
* @brief Configure VDDSDIO, call this API to rise VDDSDIO to 1.9V when VDDSDIO regulator is enabled as 1.8V mode.
*/

View File

@ -33,6 +33,8 @@
#include "esp32p4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C5
#include "esp32c5/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C61
#include "esp32c61/rom/secure_boot.h"
#endif
#ifdef CONFIG_SECURE_BOOT_V1_ENABLED
@ -85,7 +87,7 @@ typedef enum {
*
* @return key type for the selected secure boot scheme
*/
static inline char* esp_secure_boot_get_scheme_name(esp_secure_boot_sig_scheme_t scheme)
static inline const char* esp_secure_boot_get_scheme_name(esp_secure_boot_sig_scheme_t scheme)
{
switch (scheme) {
case ESP_SECURE_BOOT_V2_RSA:

View File

@ -27,6 +27,8 @@
#include "esp32p4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C5
#include "esp32c5/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C61
#include "esp32c61/rom/secure_boot.h"
#endif
#ifdef __cplusplus

View File

@ -17,13 +17,6 @@ extern "C"
*/
void bootloader_ana_super_wdt_reset_config(bool enable);
/**
* @brief Configure analog brownout reset
*
* @param enable Boolean to enable or disable brownout reset
*/
void bootloader_ana_bod_reset_config(bool enable);
/**
* @brief Configure analog clock glitch reset
*

View File

@ -27,7 +27,7 @@
#include "esp_rom_caps.h"
#define ESP_PARTITION_HASH_LEN 32 /* SHA-256 digest length */
#define IS_MAX_REV_SET(max_chip_rev_full) (((max_chip_rev_full) != 65535) && ((max_chip_rev_full) != 0))
#define IS_FIELD_SET(rev_full) (((rev_full) != 65535) && ((rev_full) != 0))
static const char* TAG = "boot_comm";
@ -57,6 +57,31 @@ int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata)
return bootloader_common_select_otadata(two_otadata, valid_two_otadata, true);
}
#if !CONFIG_IDF_TARGET_ESP32
esp_err_t bootloader_common_check_efuse_blk_validity(uint32_t min_rev_full, uint32_t max_rev_full)
{
esp_err_t err = ESP_OK;
#ifndef CONFIG_IDF_ENV_FPGA
// Check whether the efuse block version satisfy the requirements of current image.
uint32_t revision = efuse_hal_blk_version();
uint32_t major_rev = revision / 100;
uint32_t minor_rev = revision % 100;
if (IS_FIELD_SET(min_rev_full) && !ESP_EFUSE_BLK_REV_ABOVE(revision, min_rev_full)) {
ESP_LOGE(TAG, "Image requires efuse blk rev >= v%"PRIu32".%"PRIu32", but chip is v%"PRIu32".%"PRIu32,
min_rev_full / 100, min_rev_full % 100, major_rev, minor_rev);
err = ESP_FAIL;
}
// If burnt `disable_blk_version_major` bit, skip the max version check
if ((IS_FIELD_SET(max_rev_full) && (revision > max_rev_full) && !efuse_hal_get_disable_blk_version_major())) {
ESP_LOGE(TAG, "Image requires efuse blk rev <= v%"PRIu32".%"PRIu32", but chip is v%"PRIu32".%"PRIu32,
max_rev_full / 100, max_rev_full % 100, major_rev, minor_rev);
err = ESP_FAIL;
}
#endif
return err;
}
#endif // !CONFIG_IDF_TARGET_ESP32
esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hdr, esp_image_type type)
{
esp_err_t err = ESP_OK;
@ -80,7 +105,7 @@ esp_err_t bootloader_common_check_chip_validity(const esp_image_header_t* img_hd
}
if (type == ESP_IMAGE_APPLICATION) {
unsigned max_rev = img_hdr->max_chip_rev_full;
if ((IS_MAX_REV_SET(max_rev) && (revision > max_rev) && !efuse_hal_get_disable_wafer_version_major())) {
if ((IS_FIELD_SET(max_rev) && (revision > max_rev) && !efuse_hal_get_disable_wafer_version_major())) {
ESP_LOGE(TAG, "Image requires chip rev <= v%d.%d, but chip is v%d.%d",
max_rev / 100, max_rev % 100,
major_rev, minor_rev);

View File

@ -48,8 +48,8 @@ void bootloader_console_init(void)
#if CONFIG_ESP_CONSOLE_UART_CUSTOM
// Some constants to make the following code less upper-case
const int uart_tx_gpio = CONFIG_ESP_CONSOLE_UART_TX_GPIO;
const int uart_rx_gpio = CONFIG_ESP_CONSOLE_UART_RX_GPIO;
const int uart_tx_gpio = (CONFIG_ESP_CONSOLE_UART_TX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_TX_GPIO : UART_NUM_0_TXD_DIRECT_GPIO_NUM;
const int uart_rx_gpio = (CONFIG_ESP_CONSOLE_UART_RX_GPIO >= 0) ? CONFIG_ESP_CONSOLE_UART_RX_GPIO : UART_NUM_0_RXD_DIRECT_GPIO_NUM;
// Switch to the new UART (this just changes UART number used for esp_rom_printf in ROM code).
esp_rom_output_set_as_console(uart_num);

View File

@ -43,10 +43,17 @@ esp_err_t bootloader_read_bootloader_header(void)
esp_err_t bootloader_check_bootloader_validity(void)
{
unsigned int revision = efuse_hal_chip_revision();
unsigned int major = revision / 100;
unsigned int minor = revision % 100;
ESP_EARLY_LOGI(TAG, "chip revision: v%d.%d", major, minor);
unsigned int chip_revision = efuse_hal_chip_revision();
unsigned int chip_major_rev = chip_revision / 100;
unsigned int chip_minor_rev = chip_revision % 100;
ESP_EARLY_LOGI(TAG, "chip revision: v%d.%d", chip_major_rev, chip_minor_rev);
/* ESP32 doesn't have more memory and more efuse bits for block major version. */
#if !CONFIG_IDF_TARGET_ESP32
unsigned int efuse_revision = efuse_hal_blk_version();
unsigned int efuse_major_rev = efuse_revision / 100;
unsigned int efuse_minor_rev = efuse_revision % 100;
ESP_EARLY_LOGI(TAG, "efuse block revision: v%d.%d", efuse_major_rev, efuse_minor_rev);
#endif // !CONFIG_IDF_TARGET_ESP32
/* compare with the one set in bootloader image header */
if (bootloader_common_check_chip_validity(&bootloader_image_hdr, ESP_IMAGE_BOOTLOADER) != ESP_OK) {
return ESP_FAIL;

View File

@ -16,6 +16,12 @@
#include "hal/apm_hal.h"
#endif
#if CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9230 Remove the workaround when APM supported on C61!
#include "soc/hp_apm_reg.h"
#include "soc/lp_apm_reg.h"
#endif
void bootloader_init_mem(void)
{
@ -32,6 +38,13 @@ void bootloader_init_mem(void)
#endif
#endif
#if CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9230 Remove the workaround when APM supported on C61!
// disable apm filter
REG_WRITE(LP_APM_FUNC_CTRL_REG, 0);
REG_WRITE(HP_APM_FUNC_CTRL_REG, 0);
#endif
#ifdef CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE
// protect memory region
esp_cpu_configure_region_protection();

View File

@ -83,10 +83,10 @@
}
#endif // BOOTLOADER_BUILD
#if CONFIG_IDF_ENV_FPGA
#if CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING
static void s_non_functional(const char *func)
{
ESP_EARLY_LOGW("rand", "%s non-functional for FPGA builds", func);
ESP_EARLY_LOGW("rand", "%s non-functional as RNG has not been supported yet", func);
}
void bootloader_random_enable()
@ -98,4 +98,4 @@ void bootloader_random_disable()
{
s_non_functional(__func__);
}
#endif // CONFIG_IDF_ENV_FPGA
#endif // CONFIG_ESP_BRINGUP_BYPASS_RANDOM_SETTING

View File

@ -3,20 +3,100 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/soc.h"
#include "soc/pcr_reg.h"
#include "soc/apb_saradc_reg.h"
#include "soc/pmu_reg.h"
#include "hal/regi2c_ctrl.h"
#include "soc/lpperi_reg.h"
#include "soc/regi2c_saradc.h"
#include "esp_log.h"
static const uint32_t SAR2_CHANNEL = 9;
static const uint32_t SAR1_CHANNEL = 7;
static const uint32_t PATTERN_BIT_WIDTH = 6;
static const uint32_t SAR1_ATTEN = 3;
static const uint32_t SAR2_ATTEN = 3;
void bootloader_random_enable(void)
{
// TODO: [ESP32C5] IDF-8626
ESP_EARLY_LOGW("bootloader_random", "bootloader_random_enable() has not been implemented on C5 yet");
// pull SAR ADC out of reset
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
// enable SAR ADC APB clock
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_CLK_EN);
// pull APB register out of reset
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
// enable ADC_CTRL_CLK (SAR ADC function clock)
REG_SET_BIT(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_EN);
// select XTAL clock (40 MHz) source for ADC_CTRL_CLK
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_SEL, 0); // 0: XTAL; 1: 80M(from bbpll); 2. FOSC
// set the clock divider for ADC_CTRL_CLK to default value (in case it has been changed)
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_DIV_NUM, 0);
// some magic register poke from the digital team
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
// Config ADC circuit (Analog part) with I2C (HOST ID 0X69) and choose internal voltage as sampling source
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_PERIF_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_EN_TOUT_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_EN_TOUT_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x66);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_MSB, 0x08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_LSB, 0x66);
// create patterns and set them in pattern table
uint32_t pattern_one = (SAR2_CHANNEL << 2) | SAR2_ATTEN; // we want channel 9 with max attenuation
uint32_t pattern_two = (SAR1_CHANNEL << 2) | SAR1_ATTEN; // we want channel 7 with max attenuation
uint32_t pattern_table = 0 | (pattern_two << 3 * PATTERN_BIT_WIDTH) | pattern_one << 2 * PATTERN_BIT_WIDTH;
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, pattern_table);
// set pattern length (APB_SARADC_SARADC_SAR_PATT_LEN counts from 0)
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_PATT_LEN, 1);
REG_SET_FIELD(APB_SARADC_CTRL_REG, APB_SARADC_SARADC_SAR_CLK_DIV, 15);
// set timer expiry (timer is ADC_CTRL_CLK)
REG_SET_FIELD(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_TARGET, 200);
// enable timer
REG_SET_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
CLEAR_PERI_REG_MASK(LPPERI_RNG_CFG_REG, LPPERI_RNG_TIMER_EN);
}
void bootloader_random_disable(void)
{
// TODO: [ESP32C5] IDF-8626
ESP_EARLY_LOGW("bootloader_random", "bootloader_random_disable() has not been implemented on C5 yet");
// disable timer
REG_CLR_BIT(APB_SARADC_CTRL2_REG, APB_SARADC_SARADC_TIMER_EN);
// Write reset value of this register
REG_WRITE(APB_SARADC_SAR_PATT_TAB1_REG, 0xFFFFFF);
// Revert ADC I2C configuration and initial voltage source setting
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_MSB, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, I2C_SAR_ADC_SAR1_INIT_CODE_LSB, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_PERIF_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_EN_TOUT_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_EN_TOUT_ADDR, 0);
// disable ADC_CTRL_CLK (SAR ADC function clock)
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);
// Set PCR_SARADC_CONF_REG to initial state
REG_WRITE(PCR_SARADC_CONF_REG, 0x5);
}

View File

@ -88,9 +88,6 @@ void bootloader_random_disable(void)
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 0);
// Revert PMU_RF_PWC_REG to it's initial value
CLEAR_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
// disable ADC_CTRL_CLK (SAR ADC function clock)
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);

View File

@ -0,0 +1,101 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "sdkconfig.h"
#include "bootloader_random.h"
#include "soc/soc.h"
#include "soc/pcr_reg.h"
#include "soc/apb_saradc_reg.h"
#include "soc/pmu_reg.h"
#include "hal/regi2c_ctrl.h"
#include "soc/regi2c_saradc.h"
#include "esp_log.h"
static const uint32_t SAR2_CHANNEL = 9;
static const uint32_t SAR1_CHANNEL = 7;
static const uint32_t PATTERN_BIT_WIDTH = 6;
static const uint32_t SAR1_ATTEN = 3;
static const uint32_t SAR2_ATTEN = 3;
void bootloader_random_enable(void)
{
// pull SAR ADC out of reset
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_RST_EN);
// enable SAR ADC APB clock
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_CLK_EN);
// pull APB register out of reset
REG_SET_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
REG_CLR_BIT(PCR_SARADC_CONF_REG, PCR_SARADC_REG_RST_EN);
// enable ADC_CTRL_CLK (SAR ADC function clock)
REG_SET_BIT(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_EN);
// select XTAL clock (40 MHz) source for ADC_CTRL_CLK
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_SEL, 0);
// set the clock divider for ADC_CTRL_CLK to default value (in case it has been changed)
REG_SET_FIELD(PCR_SARADC_CLKM_CONF_REG, PCR_SARADC_CLKM_DIV_NUM, 0);
// some ADC sensor registers are in power group PERIF_I2C and need to be enabled via PMU
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_PERIF_I2C_RSTB);
SET_PERI_REG_MASK(PMU_RF_PWC_REG, PMU_XPD_PERIF_I2C);
// Config ADC circuit (Analog part) with I2C(HOST ID 0x69) and chose internal voltage as sampling source
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR , 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR , 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 1);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x66);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0x08);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0x66);
// create patterns and set them in pattern table
uint32_t pattern_one = (SAR2_CHANNEL << 2) | SAR2_ATTEN; // we want channel 9 with max attenuation
uint32_t pattern_two = (SAR1_CHANNEL << 2) | SAR1_ATTEN; // we want channel 7 with max attenuation
uint32_t pattern_table = 0 | (pattern_two << 3 * PATTERN_BIT_WIDTH) | pattern_one << 2 * PATTERN_BIT_WIDTH;
REG_WRITE(SARADC_SAR_PATT_TAB1_REG, pattern_table);
// set pattern length to 2 (APB_SARADC_SAR_PATT_LEN counts from 0)
REG_SET_FIELD(SARADC_CTRL_REG, SARADC_SAR_PATT_LEN, 1);
// Same as in C3
REG_SET_FIELD(SARADC_CTRL_REG, SARADC_SAR_CLK_DIV, 15);
// set timer expiry (timer is ADC_CTRL_CLK)
REG_SET_FIELD(SARADC_CTRL2_REG, SARADC_TIMER_TARGET, 200);
// enable timer
REG_SET_BIT(SARADC_CTRL2_REG, SARADC_TIMER_EN);
}
void bootloader_random_disable(void)
{
// disable timer
REG_CLR_BIT(SARADC_CTRL2_REG, SARADC_TIMER_EN);
// Write reset value of this register
REG_WRITE(SARADC_SAR_PATT_TAB1_REG, 0xFFFFFF);
// Revert ADC I2C configuration and initial voltage source setting
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_HIGH_ADDR, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR2_INITIAL_CODE_LOW_ADDR, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_HIGH_ADDR, 0x60);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SAR1_INITIAL_CODE_LOW_ADDR, 0x0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_DTEST_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC_ENT_RTC_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC1_ENCAL_REF_ADDR, 0);
REGI2C_WRITE_MASK(I2C_SAR_ADC, ADC_SARADC2_ENCAL_REF_ADDR, 0);
// disable ADC_CTRL_CLK (SAR ADC function clock)
REG_WRITE(PCR_SARADC_CLKM_CONF_REG, 0x00404000);
// Set PCR_SARADC_CONF_REG to initial state
REG_WRITE(PCR_SARADC_CONF_REG, 0x5);
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -69,11 +69,11 @@ static void bootloader_reset_mmu(void)
}
#endif //#if !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP
static esp_err_t bootloader_check_rated_cpu_clock(void)
static inline esp_err_t bootloader_check_rated_cpu_clock(void)
{
int rated_freq = bootloader_clock_get_rated_freq_mhz();
if (rated_freq < CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ) {
ESP_LOGE(TAG, "Chip CPU frequency rated for %dMHz, configured for %dMHz. Modify CPU frequency in menuconfig",
ESP_LOGE(TAG, "Chip CPU freq rated for %dMHz, configured for %dMHz. Modify CPU freq in menuconfig",
rated_freq, CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ);
return ESP_FAIL;
}
@ -119,19 +119,19 @@ static void wdt_reset_info_dump(int cpu)
if (DPORT_RECORD_PDEBUGINST_SZ(inst) == 0 &&
DPORT_RECORD_PDEBUGSTATUS_BBCAUSE(dstat) == DPORT_RECORD_PDEBUGSTATUS_BBCAUSE_WAITI) {
ESP_LOGW(TAG, "WDT reset info: %s CPU PC=0x%"PRIx32" (waiti mode)", cpu_name, pc);
ESP_LOGW(TAG, "WDT rst info: %s CPU PC=0x%"PRIx32" (waiti mode)", cpu_name, pc);
} else {
ESP_LOGW(TAG, "WDT reset info: %s CPU PC=0x%"PRIx32, cpu_name, pc);
ESP_LOGW(TAG, "WDT rst info: %s CPU PC=0x%"PRIx32, cpu_name, pc);
}
ESP_LOGD(TAG, "WDT reset info: %s CPU STATUS 0x%08"PRIx32, cpu_name, stat);
ESP_LOGD(TAG, "WDT reset info: %s CPU PID 0x%08"PRIx32, cpu_name, pid);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGINST 0x%08"PRIx32, cpu_name, inst);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGSTATUS 0x%08"PRIx32, cpu_name, dstat);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGDATA 0x%08"PRIx32, cpu_name, data);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGPC 0x%08"PRIx32, cpu_name, pc);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGLS0STAT 0x%08"PRIx32, cpu_name, lsstat);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGLS0ADDR 0x%08"PRIx32, cpu_name, lsaddr);
ESP_LOGD(TAG, "WDT reset info: %s CPU PDEBUGLS0DATA 0x%08"PRIx32, cpu_name, lsdata);
ESP_LOGD(TAG, "WDT rst info: %s CPU STATUS 0x%08"PRIx32, cpu_name, stat);
ESP_LOGD(TAG, "WDT rst info: %s CPU PID 0x%08"PRIx32, cpu_name, pid);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGINST 0x%08"PRIx32, cpu_name, inst);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGSTATUS 0x%08"PRIx32, cpu_name, dstat);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGDATA 0x%08"PRIx32, cpu_name, data);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGPC 0x%08"PRIx32, cpu_name, pc);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGLS0STAT 0x%08"PRIx32, cpu_name, lsstat);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGLS0ADDR 0x%08"PRIx32, cpu_name, lsaddr);
ESP_LOGD(TAG, "WDT rst info: %s CPU PDEBUGLS0DATA 0x%08"PRIx32, cpu_name, lsdata);
}
static void bootloader_check_wdt_reset(void)
@ -143,12 +143,12 @@ static void bootloader_check_wdt_reset(void)
rst_reas[1] = esp_rom_get_reset_reason(1);
if (rst_reas[0] == RESET_REASON_CORE_RTC_WDT || rst_reas[0] == RESET_REASON_CORE_MWDT0 || rst_reas[0] == RESET_REASON_CORE_MWDT1 ||
rst_reas[0] == RESET_REASON_CPU0_MWDT0 || rst_reas[0] == RESET_REASON_CPU0_RTC_WDT) {
ESP_LOGW(TAG, "PRO CPU has been reset by WDT.");
ESP_LOGW(TAG, "PRO CPU has been reset by WDT");
wdt_rst = 1;
}
if (rst_reas[1] == RESET_REASON_CORE_RTC_WDT || rst_reas[1] == RESET_REASON_CORE_MWDT0 || rst_reas[1] == RESET_REASON_CORE_MWDT1 ||
rst_reas[1] == RESET_REASON_CPU1_MWDT1 || rst_reas[1] == RESET_REASON_CPU1_RTC_WDT) {
ESP_LOGW(TAG, "APP CPU has been reset by WDT.");
ESP_LOGW(TAG, "APP CPU has been reset by WDT");
wdt_rst = 1;
}
if (wdt_rst) {
@ -215,7 +215,7 @@ esp_err_t bootloader_init(void)
bootloader_flash_update_id();
// Check and run XMC startup flow
if ((ret = bootloader_flash_xmc_startup()) != ESP_OK) {
ESP_LOGE(TAG, "failed when running XMC startup flow, reboot!");
ESP_LOGE(TAG, "XMC startup flow failed, reboot!");
return ret;
}
// read bootloader header
@ -232,7 +232,7 @@ esp_err_t bootloader_init(void)
}
#endif // #if !CONFIG_APP_BUILD_TYPE_RAM
// check whether a WDT reset happend
// check whether a WDT reset happened
bootloader_check_wdt_reset();
// config WDT
bootloader_config_wdt();

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -37,6 +37,7 @@
#include "hal/mmu_hal.h"
#include "hal/cache_hal.h"
#include "hal/rwdt_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32c2";
@ -81,8 +82,8 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
}
esp_err_t bootloader_init(void)
@ -138,7 +139,7 @@ esp_err_t bootloader_init(void)
}
#endif // !CONFIG_APP_BUILD_TYPE_RAM
// check whether a WDT reset happend
// check whether a WDT reset happened
bootloader_check_wdt_reset();
// config WDT
bootloader_config_wdt();

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -18,17 +18,6 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
} else {
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -42,6 +42,7 @@
#include "hal/cache_hal.h"
#include "hal/efuse_hal.h"
#include "hal/rwdt_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32c3";
@ -106,18 +107,18 @@ static inline void bootloader_ana_reset_config(void)
case 0:
case 1:
//Disable BOD and GLITCH reset
bootloader_ana_bod_reset_config(false);
brownout_ll_ana_reset_enable(false);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 2:
//Enable BOD reset. Disable GLITCH reset
bootloader_ana_bod_reset_config(true);
brownout_ll_ana_reset_enable(true);
bootloader_ana_clock_glitch_reset_config(false);
break;
case 3:
default:
//Enable BOD, and GLITCH reset
bootloader_ana_bod_reset_config(true);
brownout_ll_ana_reset_enable(true);
bootloader_ana_clock_glitch_reset_config(true);
break;
}
@ -182,7 +183,7 @@ esp_err_t bootloader_init(void)
}
#endif //#if !CONFIG_APP_BUILD_TYPE_RAM
// check whether a WDT reset happend
// check whether a WDT reset happened
bootloader_check_wdt_reset();
// config WDT
bootloader_config_wdt();

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -18,17 +18,6 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
} else {
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
}
}
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_GLITCH_RST);

View File

@ -42,6 +42,7 @@
#include "hal/efuse_hal.h"
#include "hal/lpwdt_ll.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32c5";
@ -94,9 +95,8 @@ static inline void bootloader_ana_reset_config(void)
// TODO: [ESP32C5] IDF-8650
//Enable super WDT reset.
// bootloader_ana_super_wdt_reset_config(true);
// TODO: [ESP32C5] IDF-8647
//Enable BOD reset
// bootloader_ana_bod_reset_config(true);
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
}
esp_err_t bootloader_init(void)

View File

@ -16,15 +16,9 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
ESP_EARLY_LOGW("bootloader", "bootloader_ana_super_wdt_reset_config() has not been implemented on C5 yet");
}
void bootloader_ana_bod_reset_config(bool enable)
{
// TODO: [ESP32C5] IDF-8667
ESP_EARLY_LOGW("bootloader", "bootloader_ana_bod_reset_config() has not been implemented on C5 yet");
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
// TODO: [ESP32C5] IDF-8667
// TODO: [ESP32C5] IDF-8667, PM-207
(void)enable;
}

View File

@ -44,6 +44,7 @@
#include "hal/efuse_hal.h"
#include "hal/lpwdt_ll.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32c6";
@ -103,8 +104,8 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
//Enable BOD mode1 hardware reset
brownout_ll_ana_reset_enable(true);
}
esp_err_t bootloader_init(void)

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -15,17 +15,6 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
} else {
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{

View File

@ -39,11 +39,11 @@
#include "esp_efuse.h"
#include "hal/mmu_hal.h"
#include "hal/cache_hal.h"
#include "hal/clk_tree_ll.h"
#include "soc/lp_wdt_reg.h"
#include "hal/efuse_hal.h"
#include "hal/lpwdt_ll.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32c61";
@ -86,15 +86,6 @@ static void bootloader_super_wdt_auto_feed(void)
static inline void bootloader_hardware_init(void)
{
// In 80MHz flash mode, ROM sets the mspi module clk divider to 2, fix it here
#if CONFIG_ESPTOOLPY_FLASHFREQ_80M && !CONFIG_APP_BUILD_TYPE_RAM
clk_ll_mspi_fast_set_hs_divider(6);
esp_rom_spiflash_config_clk(1, 0);
esp_rom_spiflash_config_clk(1, 1);
esp_rom_spiflash_fix_dummylen(0, 1);
esp_rom_spiflash_fix_dummylen(1, 1);
#endif
regi2c_ctrl_ll_master_enable_clock(true);
regi2c_ctrl_ll_master_force_enable_clock(true); // TODO: IDF-9274 Remove this?
regi2c_ctrl_ll_master_configure_clock();
@ -104,8 +95,8 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
}
esp_err_t bootloader_init(void)

View File

@ -18,18 +18,6 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
// REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
}
void bootloader_ana_bod_reset_config(bool enable)
{
// lp_analog_peri_reg.h updated, now following registers
// REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(LP_ANA_BOD_MODE1_CNTL_REG, LP_ANA_BOD_MODE1_RESET_ENA);
} else {
REG_CLR_BIT(LP_ANA_BOD_MODE1_CNTL_REG, LP_ANA_BOD_MODE1_RESET_ENA);
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{

View File

@ -0,0 +1,71 @@
/*
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <strings.h>
#include "esp_flash_encrypt.h"
#include "esp_secure_boot.h"
#include "esp_efuse.h"
#include "esp_efuse_table.h"
#include "esp_log.h"
#include "sdkconfig.h"
static __attribute__((unused)) const char *TAG = "secure_boot";
esp_err_t esp_secure_boot_enable_secure_features(void)
{
esp_efuse_write_field_bit(ESP_EFUSE_DIS_DIRECT_BOOT);
#ifdef CONFIG_SECURE_ENABLE_SECURE_ROM_DL_MODE
ESP_LOGI(TAG, "Enabling Security download mode...");
esp_err_t err = esp_efuse_enable_rom_secure_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not enable Security download mode...");
return err;
}
#elif CONFIG_SECURE_DISABLE_ROM_DL_MODE
ESP_LOGI(TAG, "Disable ROM Download mode...");
esp_err_t err = esp_efuse_disable_rom_download_mode();
if (err != ESP_OK) {
ESP_LOGE(TAG, "Could not disable ROM Download mode...");
return err;
}
#else
ESP_LOGW(TAG, "UART ROM Download mode kept enabled - SECURITY COMPROMISED");
#endif
#ifndef CONFIG_SECURE_BOOT_ALLOW_JTAG
ESP_LOGI(TAG, "Disable hardware & software JTAG...");
esp_efuse_write_field_bit(ESP_EFUSE_DIS_PAD_JTAG);
esp_efuse_write_field_bit(ESP_EFUSE_DIS_USB_JTAG);
// TODO in IDF-10694
// esp_efuse_write_field_cnt(ESP_EFUSE_SOFT_DIS_JTAG, ESP_EFUSE_SOFT_DIS_JTAG[0]->bit_count);
#else
ESP_LOGW(TAG, "Not disabling JTAG - SECURITY COMPROMISED");
#endif
#ifdef CONFIG_SECURE_BOOT_ENABLE_AGGRESSIVE_KEY_REVOKE
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_AGGRESSIVE_REVOKE);
#endif
esp_efuse_write_field_bit(ESP_EFUSE_SECURE_BOOT_EN);
#ifndef CONFIG_SECURE_BOOT_V2_ALLOW_EFUSE_RD_DIS
bool rd_dis_now = true;
#ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
/* If flash encryption is not enabled yet then don't read-disable efuses yet, do it later in the boot
when Flash Encryption is being enabled */
rd_dis_now = esp_flash_encryption_enabled();
#endif
if (rd_dis_now) {
ESP_LOGI(TAG, "Prevent read disabling of additional efuses...");
esp_efuse_write_field_bit(ESP_EFUSE_WR_DIS_RD_DIS);
}
#else
ESP_LOGW(TAG, "Allowing read disabling of additional efuses - SECURITY COMPROMISED");
#endif
return ESP_OK;
}

View File

@ -43,6 +43,7 @@
#include "soc/pmu_reg.h"
#include "hal/efuse_hal.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32h2";
@ -97,8 +98,8 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
}
esp_err_t bootloader_init(void)

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -13,17 +13,6 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_SUPER_WDT_RST);
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
} else {
REG_CLR_BIT(LP_ANALOG_PERI_LP_ANA_BOD_MODE1_CNTL_REG, LP_ANALOG_PERI_LP_ANA_BOD_MODE1_RESET_ENA);
}
}
//Not supported but common bootloader calls the function. Do nothing
void bootloader_ana_clock_glitch_reset_config(bool enable)
{

View File

@ -49,6 +49,7 @@
#include "soc/regi2c_bias.h"
#include "esp_private/periph_ctrl.h"
#include "hal/regi2c_ctrl_ll.h"
#include "hal/brownout_ll.h"
static const char *TAG = "boot.esp32p4";
@ -120,8 +121,8 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable super WDT reset.
bootloader_ana_super_wdt_reset_config(true);
//Enable BOD reset
bootloader_ana_bod_reset_config(true);
//Enable BOD reset (mode1)
brownout_ll_ana_reset_enable(true);
}
esp_err_t bootloader_init(void)

View File

@ -5,21 +5,12 @@
*/
#include <stdbool.h>
#include "soc/lp_analog_peri_reg.h"
#include "soc/soc.h"
#include "hal/brownout_ll.h"
void bootloader_ana_super_wdt_reset_config(bool enable)
{
//TODO: IDF-7514
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(LP_ANALOG_PERI_FIB_ENABLE_REG, LP_ANALOG_PERI_LP_ANA_FIB_BOD_RST);
brownout_ll_ana_reset_enable(enable);
}
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
//TODO: IDF-7514

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -39,6 +39,7 @@
#include "hal/mmu_hal.h"
#include "hal/cache_hal.h"
#include "hal/rwdt_ll.h"
#include "hal/brownout_ll.h"
#include "xtensa/config/core.h"
#include "xt_instr_macros.h"
@ -133,7 +134,7 @@ static inline void bootloader_ana_reset_config(void)
{
//Enable WDT, BOD, and GLITCH reset
bootloader_ana_super_wdt_reset_config(true);
bootloader_ana_bod_reset_config(true);
brownout_ll_ana_reset_enable(true);
bootloader_ana_clock_glitch_reset_config(true);
}
@ -204,7 +205,7 @@ esp_err_t bootloader_init(void)
}
#endif // !CONFIG_APP_BUILD_TYPE_RAM
// check whether a WDT reset happend
// check whether a WDT reset happened
bootloader_check_wdt_reset();
// config WDT
bootloader_config_wdt();

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -18,17 +18,6 @@ void bootloader_ana_super_wdt_reset_config(bool enable)
}
}
void bootloader_ana_bod_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_BOD_RST);
if (enable) {
REG_SET_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
} else {
REG_CLR_BIT(RTC_CNTL_BROWN_OUT_REG, RTC_CNTL_BROWN_OUT_ANA_RST_EN);
}
}
void bootloader_ana_clock_glitch_reset_config(bool enable)
{
REG_CLR_BIT(RTC_CNTL_FIB_SEL_REG, RTC_CNTL_FIB_GLITCH_RST);

View File

@ -691,19 +691,28 @@ static esp_err_t process_segment_data(int segment, intptr_t load_addr, uint32_t
const uint32_t *src = data;
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
// Case I: Bootloader verifying application
// Case II: Bootloader verifying bootloader
// Anti-rollback check should handle only Case I from above.
// The esp_app_desc_t structure is located in DROM and is always in segment #0.
// Anti-rollback check and efuse block version check should handle only Case I from above.
if (segment == 0 && metadata->start_addr != ESP_BOOTLOADER_OFFSET) {
/* ESP32 doesn't have more memory and more efuse bits for block major version. */
#if !CONFIG_IDF_TARGET_ESP32
const esp_app_desc_t *app_desc = (const esp_app_desc_t *)src;
esp_err_t ret = bootloader_common_check_efuse_blk_validity(app_desc->min_efuse_blk_rev_full, app_desc->max_efuse_blk_rev_full);
if (ret != ESP_OK) {
bootloader_munmap(data);
return ret;
}
#endif // !CONFIG_IDF_TARGET_ESP32
#if CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
ESP_LOGD(TAG, "additional anti-rollback check 0x%"PRIx32, data_addr);
// The esp_app_desc_t structure is located in DROM and is always in segment #0.
size_t len = process_esp_app_desc_data(src, sha_handle, checksum, metadata);
data_len -= len;
src += len / 4;
// In BOOTLOADER_BUILD, for DROM (segment #0) we do not load it into dest (only map it), do_load = false.
}
#endif // CONFIG_BOOTLOADER_APP_ANTI_ROLLBACK
}
for (size_t i = 0; i < data_len; i += 4) {
int w_i = i / 4; // Word index

View File

@ -17,16 +17,15 @@
#include "hal/wdt_hal.h"
// Need to remove check and merge accordingly for ESP32C5 once key manager support added in IDF-8621
#if SOC_KEY_MANAGER_SUPPORTED || CONFIG_IDF_TARGET_ESP32C5
#if SOC_KEY_MANAGER_FE_KEY_DEPLOY || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32C5
#include "soc/keymng_reg.h"
#include "hal/key_mgr_types.h"
#include "soc/pcr_reg.h"
#else
#include "hal/key_mgr_hal.h"
#else /* CONFIG_IDF_TARGET_ESP32C5 */
#include "hal/key_mgr_ll.h"
#include "hal/mspi_timing_tuning_ll.h"
#endif /* CONFIG_IDF_TARGET_ESP32C5 */
#endif
#endif /* !CONFIG_IDF_TARGET_ESP32C5 */
#endif /* SOC_KEY_MANAGER_FE_KEY_DEPLOY */
#ifdef CONFIG_SOC_EFUSE_CONSISTS_OF_ONE_KEY_BLOCK
#include "soc/sensitive_reg.h"
@ -223,17 +222,25 @@ static esp_err_t check_and_generate_encryption_keys(void)
ESP_LOGI(TAG, "Using pre-loaded flash encryption key in efuse");
}
// Need to remove check for ESP32C5 and merge accordingly once key manager support added in IDF-8621
#if SOC_KEY_MANAGER_SUPPORTED || CONFIG_IDF_TARGET_ESP32C5
#if SOC_KEY_MANAGER_FE_KEY_DEPLOY || CONFIG_IDF_TARGET_ESP32C5
#if CONFIG_IDF_TARGET_ESP32C5
REG_SET_FIELD(KEYMNG_STATIC_REG, KEYMNG_USE_EFUSE_KEY, 2);
REG_SET_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
REG_CLR_BIT(PCR_MSPI_CLK_CONF_REG, PCR_MSPI_AXI_RST_EN);
#else
#else /* CONFIG_IDF_TARGET_ESP32C5 */
// Enable and reset key manager
// To suppress build errors about spinlock's __DECLARE_RCC_ATOMIC_ENV
int __DECLARE_RCC_ATOMIC_ENV __attribute__ ((unused));
key_mgr_ll_enable_bus_clock(true);
key_mgr_ll_enable_peripheral_clock(true);
key_mgr_ll_reset_register();
while (key_mgr_ll_get_state() != ESP_KEY_MGR_STATE_IDLE) {
};
// Force Key Manager to use eFuse key for XTS-AES operation
key_mgr_hal_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
key_mgr_ll_set_key_usage(ESP_KEY_MGR_XTS_AES_128_KEY, ESP_KEY_MGR_USE_EFUSE_KEY);
_mspi_timing_ll_reset_mspi();
#endif /* CONFIG_IDF_TARGET_ESP32C5 */
#endif
#endif /* !CONFIG_IDF_TARGET_ESP32C5 */
#endif /* SOC_KEY_MANAGER_FE_KEY_DEPLOY */
return ESP_OK;
}
@ -428,7 +435,7 @@ static esp_err_t encrypt_partition(int index, const esp_partition_info_t *partit
&partition->pos,
&image_data);
should_encrypt = (err == ESP_OK);
#ifdef SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
#ifdef CONFIG_SECURE_FLASH_ENCRYPT_ONLY_IMAGE_LEN_IN_APP_PART
if (should_encrypt) {
// Encrypt only the app image instead of encrypting the whole partition
size = image_data.image_len;

View File

@ -23,6 +23,8 @@
#include "esp32p4/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C5
#include "esp32c5/rom/secure_boot.h"
#elif CONFIG_IDF_TARGET_ESP32C61
#include "esp32c61/rom/secure_boot.h"
#endif
esp_err_t verify_ecdsa_signature_block(const ets_secure_boot_signature_t *sig_block, const uint8_t *image_digest, const ets_secure_boot_sig_block_t *trusted_block);

View File

@ -634,6 +634,7 @@ if(CONFIG_BT_ENABLED)
host/nimble/nimble/nimble/host/services/tps/include
host/nimble/nimble/nimble/host/services/hid/include
host/nimble/nimble/nimble/host/services/sps/include
host/nimble/nimble/nimble/host/services/cte/include
host/nimble/nimble/nimble/host/util/include
host/nimble/nimble/nimble/host/store/ram/include
host/nimble/nimble/nimble/host/store/config/include
@ -656,6 +657,7 @@ if(CONFIG_BT_ENABLED)
"host/nimble/nimble/nimble/host/services/cts/src/ble_svc_cts.c"
"host/nimble/nimble/nimble/host/services/hid/src/ble_svc_hid.c"
"host/nimble/nimble/nimble/host/services/sps/src/ble_svc_sps.c"
"host/nimble/nimble/nimble/host/services/cte/src/ble_svc_cte.c"
"host/nimble/nimble/nimble/host/src/ble_hs_conn.c"
"host/nimble/nimble/nimble/host/src/ble_store_util.c"
"host/nimble/nimble/nimble/host/src/ble_sm.c"
@ -874,7 +876,7 @@ if(CONFIG_BLE_MESH)
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32h2/libble_mesh.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
elseif(CONFIG_IDF_TARGET_ESP32C5)
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32C5/libble_mesh.a")
add_prebuilt_library(ble_mesh "esp_ble_mesh/lib/lib/esp32c5/libble_mesh.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE ble_mesh)
endif()
endif()

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -124,7 +124,31 @@ static size_t write_value(uint16_t conn_handle, uint16_t attr_handle,
}
}
btc_blufi_recv_handler(&ctxt->om->om_data[0], ctxt->om->om_len);
/* Data may come in linked om. So retrieve all data */
if (SLIST_NEXT(ctxt->om, om_next) != NULL) {
uint8_t *fw_buf = (uint8_t *)malloc(517 * sizeof(uint8_t));
memset(fw_buf, 0x0, 517);
memcpy(fw_buf, &ctxt->om->om_data[0], ctxt->om->om_len);
struct os_mbuf *last;
last = ctxt->om;
uint32_t offset = ctxt->om->om_len;
while (SLIST_NEXT(last, om_next) != NULL) {
struct os_mbuf *temp = SLIST_NEXT(last, om_next);
memcpy(fw_buf + offset , &temp->om_data[0], temp->om_len);
offset += temp->om_len;
last = SLIST_NEXT(last, om_next);
temp = NULL;
}
btc_blufi_recv_handler(fw_buf, offset);
free(fw_buf);
}
else {
btc_blufi_recv_handler(&ctxt->om->om_data[0], ctxt->om->om_len);
}
rc = ble_hs_mbuf_to_flat(ctxt->om, value->buf->om_data,
value->buf->om_len, &len);
if (rc != 0) {

View File

@ -46,6 +46,7 @@
#define OSI_INITIAL_TRACE_LEVEL UC_BT_LOG_OSI_TRACE_LEVEL
#define BLUFI_INITIAL_TRACE_LEVEL UC_BT_LOG_BLUFI_TRACE_LEVEL
// MEMORY
#if UC_BT_BLE_DYNAMIC_ENV_MEMORY
#define BT_BLE_DYNAMIC_ENV_MEMORY TRUE
#define BTC_DYNAMIC_MEMORY TRUE
@ -64,6 +65,19 @@
#define BT_BLE_DYNAMIC_ENV_MEMORY FALSE
#endif
#if UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST
#define HEAP_ALLOCATION_FROM_SPIRAM_FIRST TRUE
#else
#define HEAP_ALLOCATION_FROM_SPIRAM_FIRST FALSE
#endif
#if UC_BT_ABORT_WHEN_ALLOCATION_FAILS
#define HEAP_ALLOCATION_FAILS_ABORT TRUE
#else
#define HEAP_ALLOCATION_FAILS_ABORT FALSE
#endif
// HCI LOG
#if UC_BT_HCI_LOG_DEBUG_EN
#define BT_HCI_LOG_INCLUDED UC_BT_HCI_LOG_DEBUG_EN
#else

View File

@ -100,13 +100,26 @@
#define UC_BT_BLUFI_ENABLE FALSE
#endif
//MEMORY DEBUG
//MEMORY
#ifdef CONFIG_BT_BLUEDROID_MEM_DEBUG
#define UC_BT_BLUEDROID_MEM_DEBUG TRUE
#else
#define UC_BT_BLUEDROID_MEM_DEBUG FALSE
#endif
#ifdef CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
#define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST
#else
#define UC_HEAP_ALLOCATION_FROM_SPIRAM_FIRST FALSE
#endif
#ifdef CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS
#define UC_BT_ABORT_WHEN_ALLOCATION_FAILS CONFIG_BT_ABORT_WHEN_ALLOCATION_FAILS
#else
#define UC_BT_ABORT_WHEN_ALLOCATION_FAILS FALSE
#endif
//HCI LOG
#ifdef CONFIG_BT_HCI_LOG_DEBUG_EN
#define UC_BT_HCI_LOG_DEBUG_EN TRUE
#else

View File

@ -213,48 +213,33 @@ char *osi_strdup(const char *str)
void *osi_malloc_func(size_t size)
{
#if HEAP_MEMORY_DEBUG
void *p;
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
p = heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
p = malloc(size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
osi_mem_dbg_record(p, size, __func__, __LINE__);
void *p = osi_malloc_base(size);
if (size != 0 && p == NULL) {
OSI_TRACE_ERROR("malloc failed (caller=%p size=%u)\n", __builtin_return_address(0), size);
#if HEAP_ALLOCATION_FAILS_ABORT
assert(0);
#endif
}
return p;
#else
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
return heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
return malloc(size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
#endif /* #if HEAP_MEMORY_DEBUG */
}
void *osi_calloc_func(size_t size)
{
#if HEAP_MEMORY_DEBUG
void *p;
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
p = heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
p = calloc(1, size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
osi_mem_dbg_record(p, size, __func__, __LINE__);
void *p = osi_calloc_base(size);
if (size != 0 && p == NULL) {
OSI_TRACE_ERROR("calloc failed (caller=%p size=%u)\n", __builtin_return_address(0), size);
#if HEAP_ALLOCATION_FAILS_ABORT
assert(0);
#endif
}
return p;
#else
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
return heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL);
#else
return calloc(1, size);
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
#endif /* #if HEAP_MEMORY_DEBUG */
}
void osi_free_func(void *ptr)
{
#if HEAP_MEMORY_DEBUG
osi_mem_dbg_clean(ptr, __func__, __LINE__);
#endif
free(ptr);
}

View File

@ -122,13 +122,18 @@ do { \
#else
// Memory alloc function without print and assertion
#if HEAP_ALLOCATION_FROM_SPIRAM_FIRST
#define osi_malloc(size) heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#define osi_calloc(size) heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#define osi_malloc_base(size) heap_caps_malloc_prefer(size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#define osi_calloc_base(size) heap_caps_calloc_prefer(1, size, 2, MALLOC_CAP_DEFAULT|MALLOC_CAP_SPIRAM, MALLOC_CAP_DEFAULT|MALLOC_CAP_INTERNAL)
#else
#define osi_malloc(size) malloc((size))
#define osi_calloc(size) calloc(1, (size))
#define osi_malloc_base(size) malloc((size))
#define osi_calloc_base(size) calloc(1, (size))
#endif /* #if HEAP_ALLOCATION_FROM_SPIRAM_FIRST */
// Memory alloc function with print and assertion when fails
#define osi_malloc(size) osi_malloc_func((size))
#define osi_calloc(size) osi_calloc_func((size))
#define osi_free(p) free((p))
#endif /* HEAP_MEMORY_DEBUG */

View File

@ -271,10 +271,10 @@ _err:
}
for (int i = 0; i < thread->work_queue_num; i++) {
if (thread->work_queues[i]) {
if (thread->work_queues && thread->work_queues[i]) {
osi_work_queue_delete(thread->work_queues[i]);
thread->work_queues[i] = NULL;
}
thread->work_queues[i] = NULL;
}
if (thread->work_queues) {

View File

@ -96,6 +96,7 @@ do{\
#define OSI_VERSION 0x00010005
#define OSI_MAGIC_VALUE 0xFADEBEAD
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL)
/* Types definition
************************************************************************
*/
@ -868,7 +869,21 @@ static int IRAM_ATTR cause_sw_intr_to_core_wrapper(int core_id, int intr_no)
static void *malloc_internal_wrapper(size_t size)
{
return heap_caps_malloc(size, MALLOC_CAP_8BIT|MALLOC_CAP_DMA|MALLOC_CAP_INTERNAL);
return heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
}
void *malloc_ble_controller_mem(size_t size)
{
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
if(p == NULL) {
ESP_LOGE(BTDM_LOG_TAG, "Malloc failed");
}
return p;
}
uint32_t get_ble_controller_free_heap_size(void)
{
return heap_caps_get_free_size(BLE_CONTROLLER_MALLOC_CAPS);
}
static int32_t IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
@ -1432,6 +1447,14 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
.name = "BT Controller Data"
};
/*
* Free data and BSS section for Bluetooth controller ROM code.
* Note that rom mem release must be performed before section _bt_data_start to _bt_data_end is released,
* otherwise `btdm_dram_available_region` will no longer be available when performing rom mem release and
* thus causing heap corruption.
*/
ret = esp_bt_controller_rom_mem_release(mode);
if (mode == ESP_BT_MODE_BTDM) {
/* Start by freeing Bluetooth BSS section */
if (ret == ESP_OK) {
@ -1444,11 +1467,6 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode)
}
}
/* free data and BSS section for Bluetooth controller ROM code */
if (ret == ESP_OK) {
ret = esp_bt_controller_rom_mem_release(mode);
}
return ret;
}

View File

@ -294,6 +294,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED

View File

@ -49,6 +49,7 @@
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/sleep_modem.h"
#endif // CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/esp_modem_clock.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -75,11 +76,6 @@
#define EXT_FUNC_MAGIC_VALUE 0xA5A5A5A5
#define BT_ASSERT_PRINT ets_printf
typedef enum ble_rtc_slow_clk_src {
BT_SLOW_CLK_SRC_MAIN_XTAL,
BT_SLOW_CLK_SRC_32K_XTAL_ON_PIN0,
} ble_rtc_slow_clk_src_t;
/* Types definition
************************************************************************
*/
@ -192,6 +188,9 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
@ -200,6 +199,237 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
};
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
default:
assert(0);
}
ret = ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
}
return ret;
}
void esp_bt_ontroller_log_deinit(void)
{
ble_log_deinit_async();
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
assert(log_partition != NULL);
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
ble_log_async_output_dump_all(true);
stop_write = true;
esp_bt_ontroller_log_deinit();
portEXIT_CRITICAL_SAFE(&spinlock);
buffer = (const uint8_t *)mapped_ptr;
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
vTaskDelay(2);
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
}
}
void esp_ble_controller_log_dump_all(bool output)
{
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
@ -208,6 +438,7 @@ static bool s_ble_active = false;
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US (1800)
@ -322,6 +553,20 @@ void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -348,7 +593,7 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
s_ble_active = true;
}
esp_err_t controller_sleep_init(ble_rtc_slow_clk_src_t slow_clk_src)
esp_err_t controller_sleep_init(modem_clock_lpclk_src_t slow_clk_src)
{
esp_err_t rc = 0;
#ifdef CONFIG_BT_LE_SLEEP_ENABLE
@ -356,7 +601,7 @@ esp_err_t controller_sleep_init(ble_rtc_slow_clk_src_t slow_clk_src)
r_ble_lll_rfmgmt_set_sleep_cb(controller_sleep_cb, controller_wakeup_cb, 0, 0, 500 + BLE_RTC_DELAY_US);
#ifdef CONFIG_PM_ENABLE
if (slow_clk_src == BT_SLOW_CLK_SRC_MAIN_XTAL) {
if (slow_clk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_ON);
} else {
esp_sleep_pd_config(ESP_PD_DOMAIN_XTAL, ESP_PD_OPTION_AUTO);
@ -411,11 +656,11 @@ void controller_sleep_deinit(void)
#endif //CONFIG_PM_ENABLE
}
static void esp_bt_rtc_slow_clk_select(ble_rtc_slow_clk_src_t slow_clk_src)
static void esp_bt_rtc_slow_clk_select(modem_clock_lpclk_src_t slow_clk_src)
{
/* Select slow clock source for BT momdule */
switch (slow_clk_src) {
case BT_SLOW_CLK_SRC_MAIN_XTAL:
case MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using main XTAL as clock source");
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_XTAL32K_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 1, MODEM_CLKRST_LP_TIMER_SEL_XTAL_S);
@ -427,7 +672,7 @@ static void esp_bt_rtc_slow_clk_select(ble_rtc_slow_clk_src_t slow_clk_src)
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM, 249, MODEM_CLKRST_LP_TIMER_CLK_DIV_NUM_S);
#endif // CONFIG_XTAL_FREQ_26
break;
case BT_SLOW_CLK_SRC_32K_XTAL_ON_PIN0:
case MODEM_CLOCK_LPCLK_SRC_EXT32K:
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Using external 32.768 kHz XTAL as clock source");
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 1, MODEM_CLKRST_LP_TIMER_SEL_XTAL32K_S);
SET_PERI_REG_BITS(MODEM_CLKRST_MODEM_LP_TIMER_CONF_REG, 1, 0, MODEM_CLKRST_LP_TIMER_SEL_XTAL_S);
@ -444,40 +689,39 @@ static void esp_bt_rtc_slow_clk_select(ble_rtc_slow_clk_src_t slow_clk_src)
SET_PERI_REG_BITS(MODEM_CLKRST_ETM_CLK_CONF_REG, 1, 0, MODEM_CLKRST_ETM_CLK_SEL_S);
}
static ble_rtc_slow_clk_src_t ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
static modem_clock_lpclk_src_t ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
ble_rtc_slow_clk_src_t slow_clk_src;
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
#ifdef CONFIG_XTAL_FREQ_26
cfg->rtc_freq = 40000;
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
cfg->rtc_freq = 32000;
#endif // CONFIG_XTAL_FREQ_26
slow_clk_src = BT_SLOW_CLK_SRC_MAIN_XTAL;
#else
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) {
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_OSC_SLOW) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#endif // CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32768;
slow_clk_src = BT_SLOW_CLK_SRC_32K_XTAL_ON_PIN0;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
#ifdef CONFIG_XTAL_FREQ_26
cfg->rtc_freq = 40000;
#else
cfg->rtc_freq = 32000;
#endif // CONFIG_XTAL_FREQ_26
slow_clk_src = BT_SLOW_CLK_SRC_MAIN_XTAL;
}
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
esp_bt_rtc_slow_clk_select(slow_clk_src);
return slow_clk_src;
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
return s_bt_lpclk_src;
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
ble_rtc_slow_clk_src_t rtc_clk_src;
modem_clock_lpclk_src_t rtc_clk_src;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
@ -566,20 +810,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble rom commit:[%s]", r_ble_controller_get_rom_compile_version());
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init(log_output_mode);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto controller_init_err;
@ -595,6 +826,9 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
uint8_t mac[6];
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
esp_ble_ll_set_public_addr(mac);
@ -617,7 +851,7 @@ free_controller:
controller_sleep_deinit();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
controller_init_err:
ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
modem_deint:
@ -646,7 +880,7 @@ esp_err_t esp_bt_controller_deinit(void)
controller_sleep_deinit();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
ble_controller_deinit();
@ -996,30 +1230,6 @@ uint8_t esp_ble_get_chip_rev_version(void)
return efuse_ll_get_chip_wafer_version_minor();
}
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
}
void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if (!CONFIG_BT_NIMBLE_ENABLED) && (CONFIG_BT_CONTROLLER_ENABLED)
#if CONFIG_BT_LE_SM_LEGACY || CONFIG_BT_LE_SM_SC
#define BLE_SM_KEY_ERR 0x17

View File

@ -118,6 +118,9 @@ do{\
#define OSI_VERSION 0x00010009
#define OSI_MAGIC_VALUE 0xFADEBEAD
#define BLE_PWR_HDL_INVL 0xFFFF
#define BLE_CONTROLLER_MALLOC_CAPS (MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA)
/* Types definition
************************************************************************
*/
@ -254,8 +257,8 @@ extern bool API_vhci_host_check_send_available(void);
extern void API_vhci_host_send_packet(uint8_t *data, uint16_t len);
extern int API_vhci_host_register_callback(const vhci_host_callback_t *callback);
/* TX power */
extern int ble_txpwr_set(int power_type, int power_level);
extern int ble_txpwr_get(int power_type);
extern int ble_txpwr_set(int power_type, uint16_t handle, int power_level);
extern int ble_txpwr_get(int power_type, uint16_t handle);
extern uint16_t l2c_ble_link_get_tx_buf_num(void);
extern void coex_pti_v2(void);
@ -687,13 +690,27 @@ static bool IRAM_ATTR is_in_isr_wrapper(void)
static void *malloc_internal_wrapper(size_t size)
{
void *p = heap_caps_malloc(size, MALLOC_CAP_INTERNAL|MALLOC_CAP_DMA);
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
if(p == NULL) {
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
}
return p;
}
void *malloc_ble_controller_mem(size_t size)
{
void *p = heap_caps_malloc(size, BLE_CONTROLLER_MALLOC_CAPS);
if(p == NULL) {
ESP_LOGE(BT_LOG_TAG, "Malloc failed");
}
return p;
}
uint32_t get_ble_controller_free_heap_size(void)
{
return heap_caps_get_free_size(BLE_CONTROLLER_MALLOC_CAPS);
}
static int IRAM_ATTR read_mac_wrapper(uint8_t mac[6])
{
int ret = esp_read_mac(mac, ESP_MAC_BT);
@ -1677,16 +1694,89 @@ esp_bt_controller_status_t esp_bt_controller_get_status(void)
return btdm_controller_status;
}
static int enh_power_type_get(esp_ble_power_type_t power_type)
{
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
return ESP_BLE_ENHANCED_PWR_TYPE_ADV;
case ESP_BLE_PWR_TYPE_SCAN:
return ESP_BLE_ENHANCED_PWR_TYPE_SCAN;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
case ESP_BLE_PWR_TYPE_CONN_HDL2:
case ESP_BLE_PWR_TYPE_CONN_HDL3:
case ESP_BLE_PWR_TYPE_CONN_HDL4:
case ESP_BLE_PWR_TYPE_CONN_HDL5:
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
return ESP_BLE_ENHANCED_PWR_TYPE_CONN;
case ESP_BLE_PWR_TYPE_DEFAULT:
return ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT;
default:
break;
}
return power_type;
}
/* extra functions */
esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_t power_level)
{
esp_err_t stat = ESP_FAIL;
uint16_t handle = BLE_PWR_HDL_INVL;
int enh_pwr_type = enh_power_type_get(power_type);
if (power_type > ESP_BLE_PWR_TYPE_DEFAULT) {
return ESP_ERR_NOT_SUPPORTED;
}
if (enh_pwr_type == ESP_BLE_ENHANCED_PWR_TYPE_CONN) {
handle = power_type;
}
if (ble_txpwr_set(enh_pwr_type, handle, power_level) == 0) {
stat = ESP_OK;
}
return stat;
}
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
{
esp_power_level_t lvl;
uint16_t handle = BLE_PWR_HDL_INVL;
int enh_pwr_type = enh_power_type_get(power_type);
if (power_type > ESP_BLE_PWR_TYPE_DEFAULT) {
return ESP_PWR_LVL_INVALID;
}
if (enh_pwr_type == ESP_BLE_ENHANCED_PWR_TYPE_CONN) {
handle = power_type;
}
lvl = (esp_power_level_t)ble_txpwr_get(power_type, handle);
return lvl;
}
esp_err_t esp_ble_tx_power_set_enhanced(esp_ble_enhanced_power_type_t power_type, uint16_t handle,
esp_power_level_t power_level)
{
esp_err_t stat = ESP_FAIL;
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
case ESP_BLE_PWR_TYPE_DEFAULT:
if (ble_txpwr_set(power_type, power_level) == 0) {
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
if (ble_txpwr_set(power_type, BLE_PWR_HDL_INVL, power_level) == 0) {
stat = ESP_OK;
}
break;
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
if (ble_txpwr_set(power_type, handle, power_level) == 0) {
stat = ESP_OK;
}
break;
@ -1698,33 +1788,26 @@ esp_err_t esp_ble_tx_power_set(esp_ble_power_type_t power_type, esp_power_level_
return stat;
}
esp_power_level_t esp_ble_tx_power_get(esp_ble_power_type_t power_type)
esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t power_type,
uint16_t handle)
{
esp_power_level_t lvl;
int tx_level = 0;
switch (power_type) {
case ESP_BLE_PWR_TYPE_ADV:
case ESP_BLE_PWR_TYPE_SCAN:
lvl = (esp_power_level_t)ble_txpwr_get(power_type);
case ESP_BLE_ENHANCED_PWR_TYPE_DEFAULT:
case ESP_BLE_ENHANCED_PWR_TYPE_SCAN:
case ESP_BLE_ENHANCED_PWR_TYPE_INIT:
tx_level = ble_txpwr_get(power_type, BLE_PWR_HDL_INVL);
break;
case ESP_BLE_PWR_TYPE_CONN_HDL0:
case ESP_BLE_PWR_TYPE_CONN_HDL1:
case ESP_BLE_PWR_TYPE_CONN_HDL2:
case ESP_BLE_PWR_TYPE_CONN_HDL3:
case ESP_BLE_PWR_TYPE_CONN_HDL4:
case ESP_BLE_PWR_TYPE_CONN_HDL5:
case ESP_BLE_PWR_TYPE_CONN_HDL6:
case ESP_BLE_PWR_TYPE_CONN_HDL7:
case ESP_BLE_PWR_TYPE_CONN_HDL8:
case ESP_BLE_PWR_TYPE_DEFAULT:
lvl = (esp_power_level_t)ble_txpwr_get(ESP_BLE_PWR_TYPE_DEFAULT);
case ESP_BLE_ENHANCED_PWR_TYPE_ADV:
case ESP_BLE_ENHANCED_PWR_TYPE_CONN:
tx_level = ble_txpwr_get(power_type, handle);
break;
default:
lvl = ESP_PWR_LVL_INVALID;
break;
return ESP_PWR_LVL_INVALID;
}
return lvl;
return (esp_power_level_t)tx_level;
}
esp_err_t esp_bt_sleep_enable (void)

View File

@ -39,11 +39,10 @@
#include "esp_pm.h"
#include "esp_phy_init.h"
#include "esp_private/periph_ctrl.h"
#include "bt_osi_mem.h"
#if SOC_PM_RETENTION_HAS_CLOCK_BUG
#include "soc/retention_periph_defs.h"
#include "esp_private/sleep_retention.h"
#endif // SOC_PM_RETENTION_HAS_CLOCK_BUG
#include "soc/regdma.h"
#include "bt_osi_mem.h"
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
#include "esp_private/sleep_modem.h"
@ -52,9 +51,6 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_private/periph_ctrl.h"
#include "esp_sleep.h"
#include "hal/efuse_hal.h"
#include "soc/rtc.h"
/* Macro definition
@ -190,6 +186,7 @@ static bool s_ble_active = false;
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (2500)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (500)
@ -333,6 +330,20 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
}
}
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -362,25 +373,53 @@ IRAM_ATTR void controller_wakeup_cb(void *arg)
}
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
// TODO: IDF-10765
// static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
// {
// uint8_t size;
// int extra = *(int *)arg;
// const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
// esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
// if (err == ESP_OK) {
// ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
// }
// return err;
// return ESP_OK;
// }
static esp_err_t sleep_modem_ble_mac_modem_state_init(uint8_t extra)
{
uint8_t size;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
}
return err;
// TODO: IDF-10765
// int retention_args = extra;
// sleep_retention_module_init_param_t init_param = {
// .cbs = { .create = { .handle = sleep_modem_ble_mac_retention_init, .arg = &retention_args } },
// .depends = BIT(SLEEP_RETENTION_MODULE_BT_BB)
// };
// esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_BLE_MAC, &init_param);
// if (err == ESP_OK) {
// err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_BLE_MAC);
// }
// return err;
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!");
return ESP_OK;
}
static void sleep_modem_ble_mac_modem_state_deinit(void)
{
sleep_retention_entries_destroy(SLEEP_RETENTION_MODULE_BLE_MAC);
// TODO: IDF-10765
// esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_BLE_MAC);
// if (err == ESP_OK) {
// err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_BLE_MAC);
// assert(err == ESP_OK);
// }
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!");
}
void sleep_modem_light_sleep_overhead_set(uint32_t overhead)
{
esp_ble_set_wakeup_overhead(overhead);
// TODO: IDF-10765
// esp_ble_set_wakeup_overhead(overhead);
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "This func temporary not supported for current target!");
}
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
@ -534,12 +573,51 @@ void ble_controller_scan_duplicate_config(void)
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_XTAL32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC32K;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
uint8_t mac[6];
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
uint32_t slow_clk_freq = 0;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
@ -592,33 +670,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
modem_clock_module_enable(PERIPH_BT_MODULE);
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
/* Select slow clock source for BT momdule */
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC_SLOW);
slow_clk_freq = 30000;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_XTAL32K);
slow_clk_freq = 32768;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC32K);
slow_clk_freq = 32000;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_EXT32K);
slow_clk_freq = 32000;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
ble_rtc_clk_init(cfg);
esp_phy_modem_init();
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
@ -664,7 +716,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
r_esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
@ -680,6 +731,8 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
r_esp_ble_ll_set_public_addr(mac);

View File

@ -342,6 +342,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED

View File

@ -134,7 +134,7 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern const sleep_retention_entries_config_t *esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
@ -176,6 +176,9 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
@ -184,6 +187,204 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
};
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
default:
assert(0);
}
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
}
return ret;
}
void esp_bt_ontroller_log_deinit(void)
{
r_ble_log_deinit_async();
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
r_ble_log_async_output_dump_all(true);
esp_bt_ontroller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_reconfigure_wdts(5000);
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_reconfigure_wdts(5000);
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
@ -192,6 +393,7 @@ static bool s_ble_active = false;
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (2500)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (500)
@ -335,6 +537,20 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
}
}
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -368,7 +584,7 @@ static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
{
uint8_t size;
int extra = *(int *)arg;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
sleep_retention_entries_config_t *ble_mac_modem_config = r_esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
@ -558,16 +774,54 @@ void ble_controller_scan_duplicate_config(void)
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_XTAL32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC32K;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
uint8_t mac[6];
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
uint32_t slow_clk_freq = 0;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
if (ble_controller_status != ESP_BT_CONTROLLER_STATUS_IDLE) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "invalid controller state");
return ESP_ERR_INVALID_STATE;
@ -616,33 +870,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
modem_clock_module_enable(PERIPH_BT_MODULE);
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
/* Select slow clock source for BT momdule */
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC_SLOW);
slow_clk_freq = 30000;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_XTAL32K);
slow_clk_freq = 32768;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC32K);
slow_clk_freq = 32000;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_EXT32K);
slow_clk_freq = 32000;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
ble_rtc_clk_init(cfg);
esp_phy_modem_init();
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
@ -656,20 +884,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = r_ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = r_ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init(log_output_mode);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
@ -688,7 +903,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
r_esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
@ -703,7 +917,10 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "controller_sleep_init failed %d", ret);
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
r_esp_ble_ll_set_public_addr(mac);
@ -732,7 +949,7 @@ free_controller:
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
esp_phy_modem_deinit();
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
@ -768,7 +985,7 @@ esp_err_t esp_bt_controller_deinit(void)
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@ -1088,24 +1305,40 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(1000);
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
void esp_ble_controller_log_dump_all(bool output)
{
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
BT_ASSERT_PRINT("\r\n[DUMP_START:");
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

View File

@ -333,6 +333,24 @@ config BT_LE_CONTROLLER_LOG_DUMP_ONLY
help
Only operate in dump mode
config BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
bool "Store ble controller logs to flash(Experimental)"
depends on !BT_LE_CONTROLLER_LOG_DUMP_ONLY
depends on BT_LE_CONTROLLER_LOG_ENABLED
default n
help
Store ble controller logs to flash memory.
config BT_LE_CONTROLLER_LOG_PARTITION_SIZE
int "size of ble controller log partition(Multiples of 4K)"
depends on BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
default 65536
help
The size of ble controller log partition shall be a multiples of 4K.
The name of log partition shall be "bt_ctrl_log".
The partition type shall be ESP_PARTITION_TYPE_DATA.
The partition sub_type shall be ESP_PARTITION_SUBTYPE_ANY.
config BT_LE_LOG_CTRL_BUF1_SIZE
int "size of the first BLE controller LOG buffer"
depends on BT_LE_CONTROLLER_LOG_ENABLED

View File

@ -126,9 +126,12 @@ extern void r_ble_rtc_wake_up_state_clr(void);
extern int os_msys_init(void);
extern void os_msys_deinit(void);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
extern const sleep_retention_entries_config_t *esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern sleep_retention_entries_config_t *r_esp_ble_mac_retention_link_get(uint8_t *size, uint8_t extra);
extern void r_esp_ble_set_wakeup_overhead(uint32_t overhead);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#if CONFIG_PM_ENABLE
extern void r_esp_ble_stop_wakeup_timing(void);
#endif // CONFIG_PM_ENABLE
extern void r_esp_ble_change_rtc_freq(uint32_t freq);
extern int ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x,
const uint8_t *peer_pub_key_y,
@ -168,6 +171,9 @@ static int esp_ecc_gen_dh_key(const uint8_t *peer_pub_key_x, const uint8_t *peer
const uint8_t *our_priv_key, uint8_t *out_dhkey);
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end);
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
#endif // #if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* Local variable definition
***************************************************************************
@ -176,6 +182,203 @@ static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, b
static DRAM_ATTR esp_bt_controller_status_t ble_controller_status = ESP_BT_CONTROLLER_STATUS_IDLE;
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
const static uint32_t log_bufs_size[] = {CONFIG_BT_LE_LOG_CTRL_BUF1_SIZE, CONFIG_BT_LE_LOG_HCI_BUF_SIZE, CONFIG_BT_LE_LOG_CTRL_BUF2_SIZE};
enum log_out_mode {
LOG_DUMP_MEMORY,
LOG_ASYNC_OUT,
LOG_STORAGE_TO_FLASH,
};
bool log_is_inited = false;
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
uint8_t log_output_mode = LOG_DUMP_MEMORY;
#else
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
uint8_t log_output_mode = LOG_STORAGE_TO_FLASH;
#else
uint8_t log_output_mode = LOG_ASYNC_OUT;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
void esp_bt_log_output_mode_set(uint8_t output_mode)
{
log_output_mode = output_mode;
}
uint8_t esp_bt_log_output_mode_get(void)
{
return log_output_mode;
}
esp_err_t esp_bt_controller_log_init(uint8_t log_output_mode)
{
esp_err_t ret = ESP_OK;
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
bool task_create;
uint8_t buffers = 0;
if (log_is_inited) {
return ret;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
switch (log_output_mode) {
case LOG_DUMP_MEMORY:
task_create = false;
break;
case LOG_ASYNC_OUT:
case LOG_STORAGE_TO_FLASH:
task_create = true;
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
esp_bt_ctrl_log_partition_get_and_erase_first_block();
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
break;
default:
assert(0);
}
ret = r_ble_log_init_async(bt_controller_log_interface, task_create, buffers, (uint32_t *)log_bufs_size);
if (ret == ESP_OK) {
log_is_inited = true;
}
return ret;
}
void esp_bt_ontroller_log_deinit(void)
{
r_ble_log_deinit_async();
log_is_inited = false;
}
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#include "esp_partition.h"
#include "hal/wdt_hal.h"
#define MAX_STORAGE_SIZE (CONFIG_BT_LE_CONTROLLER_LOG_PARTITION_SIZE)
#define BLOCK_SIZE (4096)
#define THRESHOLD (3072)
#define PARTITION_NAME "bt_ctrl_log"
static const esp_partition_t *log_partition;
static uint32_t write_index = 0;
static uint32_t next_erase_index = BLOCK_SIZE;
static bool block_erased = false;
static bool stop_write = false;
static bool is_filled = false;
static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void)
{
log_partition = NULL;
assert(MAX_STORAGE_SIZE % BLOCK_SIZE == 0);
// Find the partition map in the partition table
log_partition = esp_partition_find_first(ESP_PARTITION_TYPE_DATA, ESP_PARTITION_SUBTYPE_ANY, PARTITION_NAME);
assert(log_partition != NULL);
// Prepare data to be read later using the mapped address
ESP_ERROR_CHECK(esp_partition_erase_range(log_partition, 0, BLOCK_SIZE));
write_index = 0;
next_erase_index = BLOCK_SIZE;
block_erased = false;
is_filled = false;
stop_write = false;
}
static int esp_bt_controller_log_storage(uint32_t len, const uint8_t *addr, bool end)
{
if (len > MAX_STORAGE_SIZE) {
return -1;
}
if (stop_write) {
return 0;
}
if (((write_index) % BLOCK_SIZE) >= THRESHOLD && !block_erased) {
// esp_rom_printf("Ers nxt: %d,%d\n", next_erase_index, write_index);
esp_partition_erase_range(log_partition, next_erase_index, BLOCK_SIZE);
next_erase_index = (next_erase_index + BLOCK_SIZE) % MAX_STORAGE_SIZE;
block_erased = true;
}
if (((write_index + len) / BLOCK_SIZE) > (write_index / BLOCK_SIZE)) {
block_erased = false;
}
if (write_index + len <= MAX_STORAGE_SIZE) {
esp_partition_write(log_partition, write_index, addr, len);
write_index = (write_index + len) % MAX_STORAGE_SIZE;
} else {
uint32_t first_part_len = MAX_STORAGE_SIZE - write_index;
esp_partition_write(log_partition, write_index, addr, first_part_len);
esp_partition_write(log_partition, 0, addr + first_part_len, len - first_part_len);
write_index = len - first_part_len;
is_filled = true;
// esp_rom_printf("old idx: %d,%d\n",next_erase_index, write_index);
}
return 0;
}
void esp_bt_read_ctrl_log_from_flash(bool output)
{
esp_partition_mmap_handle_t mmap_handle;
uint32_t read_index;
const void *mapped_ptr;
const uint8_t *buffer;
uint32_t print_len;
uint32_t max_print_len;
esp_err_t err;
print_len = 0;
max_print_len = 4096;
err = esp_partition_mmap(log_partition, 0, MAX_STORAGE_SIZE, ESP_PARTITION_MMAP_DATA, &mapped_ptr, &mmap_handle);
if (err != ESP_OK) {
ESP_LOGE("FLASH", "Mmap failed: %s", esp_err_to_name(err));
return;
}
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(5000);
r_ble_log_async_output_dump_all(true);
esp_bt_ontroller_log_deinit();
stop_write = true;
buffer = (const uint8_t *)mapped_ptr;
esp_panic_handler_reconfigure_wdts(5000);
if (is_filled) {
read_index = next_erase_index;
} else {
read_index = 0;
}
esp_rom_printf("\r\nREAD_CHECK:%ld,%ld,%d\r\n",read_index, write_index, is_filled);
esp_rom_printf("\r\n[DUMP_START:");
while (read_index != write_index) {
esp_rom_printf("%02x ", buffer[read_index]);
if (print_len > max_print_len) {
esp_panic_handler_reconfigure_wdts(5000);
print_len = 0;
}
print_len++;
read_index = (read_index + 1) % MAX_STORAGE_SIZE;
}
esp_rom_printf(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
esp_partition_munmap(mmap_handle);
err = esp_bt_controller_log_init(log_output_mode);
assert(err == ESP_OK);
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
/* This variable tells if BLE is running */
@ -184,6 +387,7 @@ static bool s_ble_active = false;
static DRAM_ATTR esp_pm_lock_handle_t s_pm_lock = NULL;
#define BTDM_MIN_TIMER_UNCERTAINTY_US (200)
#endif // CONFIG_PM_ENABLE
static DRAM_ATTR modem_clock_lpclk_src_t s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_INVALID;
#define BLE_RTC_DELAY_US_LIGHT_SLEEP (5100)
#define BLE_RTC_DELAY_US_MODEM_SLEEP (1500)
@ -322,6 +526,20 @@ void esp_bt_rtc_slow_clk_select(uint8_t slow_clk_src)
}
}
modem_clock_lpclk_src_t esp_bt_get_lpclk_src(void)
{
return s_bt_lpclk_src;
}
void esp_bt_set_lpclk_src(modem_clock_lpclk_src_t clk_src)
{
if (clk_src >= MODEM_CLOCK_LPCLK_SRC_MAX) {
return;
}
s_bt_lpclk_src = clk_src;
}
IRAM_ATTR void controller_sleep_cb(uint32_t enable_tick, void *arg)
{
if (!s_ble_active) {
@ -355,7 +573,7 @@ static esp_err_t sleep_modem_ble_mac_retention_init(void *arg)
{
uint8_t size;
int extra = *(int *)arg;
const sleep_retention_entries_config_t *ble_mac_modem_config = esp_ble_mac_retention_link_get(&size, extra);
sleep_retention_entries_config_t *ble_mac_modem_config = r_esp_ble_mac_retention_link_get(&size, extra);
esp_err_t err = sleep_retention_entries_create(ble_mac_modem_config, size, REGDMA_LINK_PRI_BT_MAC_BB, SLEEP_RETENTION_MODULE_BLE_MAC);
if (err == ESP_OK) {
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Modem BLE MAC retention initialization");
@ -413,6 +631,9 @@ esp_err_t controller_sleep_init(void)
if (rc != ESP_OK) {
goto error;
}
rc = esp_deep_sleep_register_hook(&r_esp_ble_stop_wakeup_timing);
assert(rc == 0);
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
/* Create a new regdma link for BLE related register restoration */
rc = sleep_modem_ble_mac_modem_state_init(0);
@ -433,6 +654,7 @@ error:
esp_sleep_disable_bt_wakeup();
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
esp_deep_sleep_deregister_hook(&r_esp_ble_stop_wakeup_timing);
/*lock should release first and then delete*/
if (s_pm_lock != NULL) {
esp_pm_lock_delete(s_pm_lock);
@ -452,6 +674,7 @@ void controller_sleep_deinit(void)
esp_pm_unregister_inform_out_light_sleep_overhead_callback(sleep_modem_light_sleep_overhead_set);
#endif /* CONFIG_FREERTOS_USE_TICKLESS_IDLE */
#ifdef CONFIG_PM_ENABLE
esp_deep_sleep_deregister_hook(&r_esp_ble_stop_wakeup_timing);
/* lock should be released first */
esp_pm_lock_delete(s_pm_lock);
s_pm_lock = NULL;
@ -529,12 +752,51 @@ void ble_controller_scan_duplicate_config(void)
ble_vhci_disc_duplicate_set_max_cache_size(cache_size);
}
static void ble_rtc_clk_init(esp_bt_controller_config_t *cfg)
{
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_INVALID) {
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC_SLOW;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_XTAL32K;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_RC32K;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
s_bt_lpclk_src = MODEM_CLOCK_LPCLK_SRC_EXT32K;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
}
if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL) {
cfg->rtc_freq = 100000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_XTAL32K) {
cfg->rtc_freq = 32768;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC_SLOW) {
cfg->rtc_freq = 30000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_RC32K) {
cfg->rtc_freq = 32000;
} else if (s_bt_lpclk_src == MODEM_CLOCK_LPCLK_SRC_EXT32K) {
cfg->rtc_freq = 32000;
}
esp_bt_rtc_slow_clk_select(s_bt_lpclk_src);
}
esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
{
uint8_t mac[6];
esp_err_t ret = ESP_OK;
ble_npl_count_info_t npl_info;
uint32_t slow_clk_freq = 0;
uint8_t hci_transport_mode;
memset(&npl_info, 0, sizeof(ble_npl_count_info_t));
@ -586,33 +848,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
modem_clock_module_enable(PERIPH_BT_MODULE);
modem_clock_module_mac_reset(PERIPH_BT_MODULE);
/* Select slow clock source for BT momdule */
#if CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
#else
#if CONFIG_RTC_CLK_SRC_INT_RC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC_SLOW);
slow_clk_freq = 30000;
#elif CONFIG_RTC_CLK_SRC_EXT_CRYS
if (rtc_clk_slow_src_get() == SOC_RTC_SLOW_CLK_SRC_XTAL32K) {
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_XTAL32K);
slow_clk_freq = 32768;
} else {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "32.768kHz XTAL not detected, fall back to main XTAL as Bluetooth sleep clock");
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_MAIN_XTAL);
slow_clk_freq = 100000;
}
#elif CONFIG_RTC_CLK_SRC_INT_RC32K
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_RC32K);
slow_clk_freq = 32000;
#elif CONFIG_RTC_CLK_SRC_EXT_OSC
esp_bt_rtc_slow_clk_select(MODEM_CLOCK_LPCLK_SRC_EXT32K);
slow_clk_freq = 32000;
#else
ESP_LOGE(NIMBLE_PORT_LOG_TAG, "Unsupported clock source");
assert(0);
#endif
#endif /* CONFIG_BT_LE_LP_CLK_SRC_MAIN_XTAL */
ble_rtc_clk_init(cfg);
if (ble_osi_coex_funcs_register((struct osi_coex_funcs_t *)&s_osi_coex_funcs_ro) != 0) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "osi coex funcs reg failed");
@ -625,20 +861,7 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
#endif // CONFIG_SW_COEXIST_ENABLE
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
interface_func_t bt_controller_log_interface;
bt_controller_log_interface = esp_bt_controller_log_interface;
uint8_t buffers = 0;
#if CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
buffers |= ESP_BLE_LOG_BUF_CONTROLLER;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_CTRL_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
buffers |= ESP_BLE_LOG_BUF_HCI;
#endif // CONFIG_BT_LE_CONTROLLER_LOG_HCI_ENABLED
#if CONFIG_BT_LE_CONTROLLER_LOG_DUMP_ONLY
ret = r_ble_log_init_async(bt_controller_log_interface, false, buffers, (uint32_t *)log_bufs_size);
#else
ret = r_ble_log_init_async(bt_controller_log_interface, true, buffers, (uint32_t *)log_bufs_size);
#endif // CONFIG_BT_CONTROLLER_LOG_DUMP
ret = esp_bt_controller_log_init(log_output_mode);
if (ret != ESP_OK) {
ESP_LOGW(NIMBLE_PORT_LOG_TAG, "ble_controller_log_init failed %d", ret);
goto modem_deint;
@ -657,7 +880,6 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
}
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "ble controller commit:[%s]", ble_controller_get_compile_version());
r_esp_ble_change_rtc_freq(slow_clk_freq);
ble_controller_scan_duplicate_config();
@ -673,6 +895,8 @@ esp_err_t esp_bt_controller_init(esp_bt_controller_config_t *cfg)
goto free_controller;
}
ESP_ERROR_CHECK(esp_read_mac((uint8_t *)mac, ESP_MAC_BT));
ESP_LOGI(NIMBLE_PORT_LOG_TAG, "Bluetooth MAC: %02x:%02x:%02x:%02x:%02x:%02x",
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
swap_in_place(mac, 6);
r_esp_ble_ll_set_public_addr(mac);
@ -701,7 +925,7 @@ free_controller:
modem_deint:
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
modem_clock_deselect_lp_clock_source(PERIPH_BT_MODULE);
modem_clock_module_disable(PERIPH_BT_MODULE);
@ -735,7 +959,7 @@ esp_err_t esp_bt_controller_deinit(void)
r_ble_controller_deinit();
esp_ble_unregister_bb_funcs();
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
r_ble_log_deinit_async();
esp_bt_ontroller_log_deinit();
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
#if CONFIG_BT_NIMBLE_ENABLED
@ -1055,16 +1279,30 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
#if CONFIG_BT_LE_CONTROLLER_LOG_ENABLED
static void esp_bt_controller_log_interface(uint32_t len, const uint8_t *addr, bool end)
{
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
if (log_output_mode == LOG_STORAGE_TO_FLASH) {
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_controller_log_storage(len, addr, end);
#endif //CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
} else {
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
esp_panic_handler_reconfigure_wdts(1000);
for (int i = 0; i < len; i++) {
esp_rom_printf("%02x ", addr[i]);
}
if (end) {
esp_rom_printf("\n");
}
portEXIT_CRITICAL_SAFE(&spinlock);
}
}
void esp_ble_controller_log_dump_all(bool output)
{
#if CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
esp_bt_read_ctrl_log_from_flash(output);
#else
portMUX_TYPE spinlock = portMUX_INITIALIZER_UNLOCKED;
portENTER_CRITICAL_SAFE(&spinlock);
@ -1073,6 +1311,7 @@ void esp_ble_controller_log_dump_all(bool output)
r_ble_log_async_output_dump_all(output);
BT_ASSERT_PRINT(":DUMP_END]\r\n");
portEXIT_CRITICAL_SAFE(&spinlock);
#endif // CONFIG_BT_LE_CONTROLLER_LOG_STORAGE_ENABLE
}
#endif // CONFIG_BT_LE_CONTROLLER_LOG_ENABLED

@ -1 +1 @@
Subproject commit ad0d5df0b9890c783c02da126df8a979e5ca1cf9
Subproject commit 8112ca2c575c6feb32d755623f097f1b66759490

@ -1 +1 @@
Subproject commit fc65dbee2093051bdf8dd45fd4346811a39a4ff8
Subproject commit e652624750341aca124e9f850e261b0c1ac63529

@ -1 +1 @@
Subproject commit bfdfe8f851c99ced8316b133b0b15521917ea049
Subproject commit d874f55e1132416fe18293ae1aa9ac73c40b3261

@ -1 +1 @@
Subproject commit a59ed65177bd3af09efcbf687a3360c824549cdd
Subproject commit 53056440bc6e76f5bf00fd920769a4979dcc7d66

@ -1 +1 @@
Subproject commit 2085541b6e9963640e4090401faaf2061758d847
Subproject commit f95513f22be7b21429b01ba05dbfbc98097b5e67

@ -1 +1 @@
Subproject commit 9e29a8b39fe81ac82064dc4525e56e0faa9e1b8a
Subproject commit 58a293a2b4c305157723908ea29c2776f5803bbc

View File

@ -1309,7 +1309,6 @@ int bt_mesh_gatts_service_stop(struct bt_mesh_gatt_service *svc)
{
int rc;
uint16_t handle;
const ble_uuid_t *uuid;
if (!svc) {
BT_ERR("%s, Invalid parameter", __func__);
@ -1317,12 +1316,11 @@ int bt_mesh_gatts_service_stop(struct bt_mesh_gatt_service *svc)
}
if (BLE_MESH_UUID_16(svc->attrs[0].user_data)->val == BT_UUID_MESH_PROXY_VAL) {
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL);
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL), &handle);
} else {
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL);
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL), &handle);
}
rc = ble_gatts_find_svc(uuid, &handle);
assert(rc == 0);
ble_gatts_svc_set_visibility(handle, 0);
@ -1336,15 +1334,13 @@ int bt_mesh_gatts_service_start(struct bt_mesh_gatt_service *svc)
{
int rc;
uint16_t handle;
const ble_uuid_t *uuid;
if (BLE_MESH_UUID_16(svc->attrs[0].user_data)->val == BT_UUID_MESH_PROXY_VAL) {
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL);
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROXY_VAL), &handle);
} else {
uuid = BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL);
rc = ble_gatts_find_svc(BLE_UUID16_DECLARE(BT_UUID_MESH_PROV_VAL), &handle);
}
rc = ble_gatts_find_svc(uuid, &handle);
assert(rc == 0);
ble_gatts_svc_set_visibility(handle, 1);

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -8,6 +8,8 @@
#include <string.h>
#include <assert.h>
#include "esp_log.h"
#if CONFIG_BT_BLUEDROID_ENABLED
#include "bta/bta_api.h"
#endif
@ -190,6 +192,11 @@ void bt_mesh_ext_mem_swap(void *buf, size_t length)
sys_mem_swap(buf, length);
}
uint32_t bt_mesh_ext_log_timestamp(void)
{
return esp_log_timestamp();
}
/* Net buf */
void bt_mesh_ext_buf_simple_init(struct net_buf_simple *buf, size_t reserve_head)
{
@ -498,6 +505,11 @@ float bt_mesh_ext_log2(float num)
return bt_mesh_log2(num);
}
const char *bt_mesh_ext_hex(const void *buf, size_t len)
{
return bt_hex(buf, len);
}
/* Crypto */
bool bt_mesh_ext_s1(const char *m, uint8_t salt[16])
{
@ -3954,6 +3966,8 @@ void bt_mesh_ext_mbt_server_cb_evt_to_btc(uint8_t event, void *model, void *ctx)
}
typedef struct {
uint64_t config_ble_mesh_stack_trace_level : 3;
uint64_t config_ble_mesh_use_duplicate_scan : 1;
uint64_t config_ble_mesh_pb_adv : 1;
uint64_t config_ble_mesh_pb_gatt : 1;
@ -4116,6 +4130,8 @@ typedef struct {
} bt_mesh_ext_config_t;
static const bt_mesh_ext_config_t bt_mesh_ext_cfg = {
.config_ble_mesh_stack_trace_level = BLE_MESH_LOG_LEVEL,
.config_ble_mesh_use_duplicate_scan = IS_ENABLED(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN),
.config_ble_mesh_pb_adv = IS_ENABLED(CONFIG_BLE_MESH_PB_ADV),
.config_ble_mesh_pb_gatt = IS_ENABLED(CONFIG_BLE_MESH_PB_GATT),

@ -1 +1 @@
Subproject commit 4934ca903807dd74f7f808dadcd9a478e18fc6c3
Subproject commit 8312e0e0d5390d04fd282e8005528d2b5c351c08

View File

@ -244,7 +244,8 @@ static void time_get(struct bt_mesh_model *model,
change.time_status.subsecond = srv->state->time.subsecond;
change.time_status.uncertainty = srv->state->time.uncertainty;
change.time_status.time_authority = srv->state->time.time_authority;
change.time_status.tai_utc_delta_curr = srv->state->time.subsecond;
change.time_status.tai_utc_delta_curr = srv->state->time.tai_utc_delta_curr;
change.time_status.time_zone_offset_curr = srv->state->time.time_zone_offset_curr;
bt_mesh_time_scene_server_cb_evt_to_btc(BTC_BLE_MESH_EVT_TIME_SCENE_SERVER_STATE_CHANGE,
model, ctx, (const uint8_t *)&change, sizeof(change));
@ -386,7 +387,8 @@ static void time_set(struct bt_mesh_model *model,
change.time_set.subsecond = srv->state->time.subsecond;
change.time_set.uncertainty = srv->state->time.uncertainty;
change.time_set.time_authority = srv->state->time.time_authority;
change.time_set.tai_utc_delta_curr = srv->state->time.subsecond;
change.time_set.tai_utc_delta_curr = srv->state->time.tai_utc_delta_curr;
change.time_set.time_zone_offset_curr = srv->state->time.time_zone_offset_curr;
break;
case BLE_MESH_MODEL_OP_TIME_ZONE_SET:
change.time_zone_set.time_zone_offset_new = srv->state->time.time_zone_offset_new;

View File

@ -1223,3 +1223,10 @@ config BT_BLE_HIGH_DUTY_ADV_INTERVAL
default n
help
This enable BLE high duty advertising interval feature
config BT_ABORT_WHEN_ALLOCATION_FAILS
bool "Abort when memory allocation fails in BT/BLE stack"
depends on BT_BLUEDROID_ENABLED
default n
help
This enables abort when memory allocation fails

View File

@ -238,3 +238,14 @@ esp_err_t esp_bluedroid_deinit(void)
return ESP_OK;
}
#if defined(CONFIG_EXAMPLE_CI_ID) && defined(CONFIG_EXAMPLE_CI_PIPELINE_ID)
char *esp_bluedroid_get_example_name(void)
{
static char example_name[ESP_BLE_ADV_NAME_LEN_MAX];
memset(example_name, 0, sizeof(example_name));
sprintf(example_name, "BE%02X_%05X_%02X", CONFIG_EXAMPLE_CI_ID & 0xFF,
CONFIG_EXAMPLE_CI_PIPELINE_ID & 0xFFFFF, CONFIG_IDF_FIRMWARE_CHIP_ID & 0xFF);
return example_name;
}
#endif

View File

@ -504,21 +504,37 @@ esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t
return ESP_OK;
}
uint8_t *esp_ble_resolve_adv_data( uint8_t *adv_data, uint8_t type, uint8_t *length)
uint8_t *esp_ble_resolve_adv_data_by_type( uint8_t *adv_data, uint16_t adv_data_len, esp_ble_adv_data_type type, uint8_t *length)
{
if (length == NULL) {
return NULL;
}
if (((type < ESP_BLE_AD_TYPE_FLAG) || (type > ESP_BLE_AD_TYPE_128SERVICE_DATA)) &&
(type != ESP_BLE_AD_MANUFACTURER_SPECIFIC_TYPE)) {
LOG_ERROR("the eir type not define, type = %x\n", type);
LOG_ERROR("The advertising data type is not defined, type = %x", type);
*length = 0;
return NULL;
}
if (adv_data_len == 0) {
*length = 0;
return NULL;
}
if (adv_data == NULL) {
LOG_ERROR("Invalid p_eir data.\n");
LOG_ERROR("Invalid advertising data.");
*length = 0;
return NULL;
}
return (BTM_CheckAdvData( adv_data, type, length));
return (BTM_CheckAdvData( adv_data, adv_data_len, type, length));
}
uint8_t *esp_ble_resolve_adv_data( uint8_t *adv_data, uint8_t type, uint8_t *length)
{
return esp_ble_resolve_adv_data_by_type( adv_data, ESP_BLE_ADV_DATA_LEN_MAX + ESP_BLE_SCAN_RSP_DATA_LEN_MAX, (esp_ble_adv_data_type) type, length);
}
#if (BLE_42_FEATURE_SUPPORT == TRUE)
esp_err_t esp_ble_gap_config_adv_data_raw(uint8_t *raw_data, uint32_t raw_data_len)
{

View File

@ -184,6 +184,7 @@ esp_err_t esp_bt_gap_set_cod(esp_bt_cod_t cod, esp_bt_cod_mode_t mode)
}
switch (mode) {
case ESP_BT_SET_COD_RESERVED_2:
case ESP_BT_SET_COD_MAJOR_MINOR:
case ESP_BT_SET_COD_SERVICE_CLASS:
case ESP_BT_CLR_COD_SERVICE_CLASS:

View File

@ -110,6 +110,14 @@ typedef enum {
ESP_BT_STATUS_HCI_CONN_TOUT_DUE_TO_MIC_FAILURE,
ESP_BT_STATUS_HCI_CONN_FAILED_ESTABLISHMENT,
ESP_BT_STATUS_HCI_MAC_CONNECTION_FAILED,
ESP_BT_STATUS_HCI_CCA_REJECTED,
ESP_BT_STATUS_HCI_TYPE0_SUBMAP_NOT_DEFINED,
ESP_BT_STATUS_HCI_UNKNOWN_ADV_ID,
ESP_BT_STATUS_HCI_LIMIT_REACHED,
ESP_BT_STATUS_HCI_OPT_CANCEL_BY_HOST,
ESP_BT_STATUS_HCI_PKT_TOO_LONG,
ESP_BT_STATUS_HCI_TOO_LATE,
ESP_BT_STATUS_HCI_TOO_EARLY,
} esp_bt_status_t;
@ -201,6 +209,8 @@ typedef uint8_t esp_ble_key_mask_t; /* the key mask type */
#define ESP_BD_ADDR_STR "%02x:%02x:%02x:%02x:%02x:%02x"
#define ESP_BD_ADDR_HEX(addr) addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
#define ESP_BLE_ADV_NAME_LEN_MAX 29
#ifdef __cplusplus
}
#endif

View File

@ -95,6 +95,11 @@ esp_err_t esp_bluedroid_init_with_cfg(esp_bluedroid_config_t *cfg);
*/
esp_err_t esp_bluedroid_deinit(void);
#if defined(CONFIG_EXAMPLE_CI_ID) && defined(CONFIG_EXAMPLE_CI_PIPELINE_ID)
// Only for internal used (CI example test)
char *esp_bluedroid_get_example_name(void);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -631,6 +631,7 @@ typedef struct
{
esp_bd_addr_t bd_addr; /*!< peer address */
esp_ble_bond_key_info_t bond_key; /*!< the bond key information */
esp_ble_addr_type_t bd_addr_type; /*!< peer address type */
} esp_ble_bond_dev_t; /*!< the ble bond device type */
@ -1179,13 +1180,13 @@ typedef union {
struct ble_update_conn_params_evt_param {
esp_bt_status_t status; /*!< Indicate update connection parameters success status */
esp_bd_addr_t bda; /*!< Bluetooth device address */
uint16_t min_int; /*!< Min connection interval */
uint16_t max_int; /*!< Max connection interval */
uint16_t min_int; /*!< Minimum connection interval. If the master initiates the connection parameter update, this value is not applicable for the slave and will be set to zero. */
uint16_t max_int; /*!< Maximum connection interval. If the master initiates the connection parameter update, this value is not applicable for the slave and will be set to zero. */
uint16_t latency; /*!< Slave latency for the connection in number of connection events. Range: 0x0000 to 0x01F3 */
uint16_t conn_int; /*!< Current connection interval */
uint16_t conn_int; /*!< Current connection interval in milliseconds, calculated as N × 1.25 ms */
uint16_t timeout; /*!< Supervision timeout for the LE Link. Range: 0x000A to 0x0C80.
Mandatory Range: 0x000A to 0x0C80 Time = N * 10 msec */
} update_conn_params; /*!< Event parameter of ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT */
This value is calculated as N × 10 ms */
} update_conn_params; /*!< Event parameter for ESP_GAP_BLE_UPDATE_CONN_PARAMS_EVT */
/**
* @brief ESP_GAP_BLE_SET_PKT_LENGTH_COMPLETE_EVT
*/
@ -1902,17 +1903,41 @@ esp_err_t esp_ble_gap_get_device_name(void);
*
*/
esp_err_t esp_ble_gap_get_local_used_addr(esp_bd_addr_t local_used_addr, uint8_t * addr_type);
/**
* @brief This function is called to get ADV data for a specific type.
*
* @param[in] adv_data - pointer of ADV data which to be resolved
* @param[in] type - finding ADV data type
* @param[out] length - return the length of ADV data not including type
* @note This is the recommended function to use for resolving ADV data by type.
* It improves upon the deprecated `esp_ble_resolve_adv_data` function by
* including an additional parameter to specify the length of the ADV data,
* thereby offering better safety and reliability.
*
* @return pointer of ADV data
* @param[in] adv_data - pointer of ADV data which to be resolved
* @param[in] adv_data_len - the length of ADV data which to be resolved.
* @param[in] type - finding ADV data type
* @param[out] length - return the length of ADV data not including type
*
* @return pointer of ADV data
*
*/
uint8_t *esp_ble_resolve_adv_data_by_type( uint8_t *adv_data, uint16_t adv_data_len, esp_ble_adv_data_type type, uint8_t *length);
/**
* @brief This function is called to get ADV data for a specific type.
*
* @note This function has been deprecated and will be removed in a future release.
* Please use `esp_ble_resolve_adv_data_by_type` instead, which provides
* better parameter validation and supports more accurate data resolution.
*
* @param[in] adv_data - pointer of ADV data which to be resolved
* @param[in] type - finding ADV data type
* @param[out] length - return the length of ADV data not including type
*
* @return pointer of ADV data
*
*/
uint8_t *esp_ble_resolve_adv_data(uint8_t *adv_data, uint8_t type, uint8_t *length);
#if (BLE_42_FEATURE_SUPPORT == TRUE)
/**
* @brief This function is called to set raw advertising data. User need to fill

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