Compare commits

...

68 Commits

Author SHA1 Message Date
LonerDan
7815e20ccd
Merge f92bff6009 into 81f4ef73c3 2024-09-19 16:08:16 +08:00
Alexey Gerenkov
81f4ef73c3 Merge branch 'feature/update-esp-clang-to-esp-18.1.2_20240815' into 'master'
Some checks are pending
docker / docker (push) Waiting to run
feat(tools): update esp-clang version to esp-18.1.2_20240912

Closes LLVM-333

See merge request espressif/esp-idf!32895
2024-09-19 03:49:46 +08:00
Alexey Gerenkov
391dd7b9ad fix(build): Fix declaration of linker labels for ROM reserved regions
It looks like as a part of optimization for inlined functions like 'mmu_ll_vaddr_to_laddr' Clang aligns constant value
used for bitwise AND operation with the pointer to external symbol passed to the function as parameter.
That led to assertion failures because boundaries can be unaligned to 4 bytes.
2024-09-18 21:40:39 +03:00
Alexey Gerenkov
b8d23b334b change(build): Enable 'xesppie' for esp32p4 Clang builds 2024-09-18 21:40:39 +03:00
Alexey Gerenkov
9ca231e76e change(build): Use integrated assembler with Clang for RISCV chips 2024-09-18 21:40:39 +03:00
Alexey Gerenkov
64203d1403 feat(tools): update esp-clang version to esp-18.1.2_20240912 2024-09-18 21:40:34 +03:00
Konstantin Kondrashov
dcd433e62c Merge branch 'bugfix/werror_hint' into 'master'
fix(tools): Fix a regular expression in hints.yml for Werror=

See merge request espressif/esp-idf!33625
2024-09-19 01:30:27 +08:00
Michael (XIAO Xufeng)
ed92c2c226 Merge branch 'test/add_cache2phys_xip_tests' into 'master'
fix(mmap): fixed spi_flash_phys2cache return addr in PSRAM issue

See merge request espressif/esp-idf!31083
2024-09-18 23:53:47 +08:00
Konstantin Kondrashov
d1a00f5808 fix(tools): Fix a regular expression in hints.yml for Werror= 2024-09-18 16:33:47 +03:00
David Čermák
22facff58c Merge branch 'fix/ws_transport_linux_signed_promotions' into 'master'
fix(ws_transport): Fix incorrect packet-len on linux due to int promotions of char (GitHub PR)

Closes IDFGH-13642 and IDFGH-13657

See merge request espressif/esp-idf!33595
2024-09-18 20:56:51 +08:00
Lou Tian Hao
3415ff27d6 Merge branch 'fix/regdma_wait_node_issue' into 'master'
fix(pm): fix the issue of regdma wait node to immediately return to done caused by regdma wait mode comparator for esp32c6, esp32h2 and esp32p4

Closes PM-202

See merge request espressif/esp-idf!33547
2024-09-18 20:52:59 +08:00
Erhan Kurubas
2dbb811747 Merge branch 'fix/apptrace_print_lock' into 'master'
fix(apptrace): fix build error when print lock is enabled

See merge request espressif/esp-idf!33368
2024-09-18 19:50:21 +08:00
Alexey Gerenkov
5c43055e3e Merge branch 'esp32c61_jtag_doc_update' into 'master'
docs(jtag): update esp32c61 jtag debugging guide

Closes IDF-10168

See merge request espressif/esp-idf!33546
2024-09-18 19:36:23 +08:00
Roland Dobai
eb606b9777 Merge branch 'feat/add_constraint_files' into 'master'
add a note regarding separate constraint files

Closes IDF-10232

See merge request espressif/esp-idf!33230
2024-09-18 18:48:06 +08:00
Sudeep Mohanty
eb676c0afc Merge branch 'task/enable_freertos_tests_for_c61' into 'master'
test(freertos): Enabled FreeRTOS unit tests for esp32c61

Closes IDF-10988

See merge request espressif/esp-idf!33568
2024-09-18 18:40:29 +08:00
Ren Peiying
91ad4bcbce Merge branch 'add_application_examples_peripherals' into 'master'
Add application examples for i2c, jpeg, temp_sensor and usb_serial-jtag-console

See merge request espressif/esp-idf!33274
2024-09-18 17:31:59 +08:00
Ren Peiying
fb1b91c8d7 Add application examples for i2c, jpeg, temp_sensor and usb_serial-jtag-console 2024-09-18 17:31:59 +08:00
Frantisek Hrbata
7a03ac385d change: add a note regarding separate constraint files
Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
2024-09-18 16:56:04 +08:00
Jiang Jiang Jian
f8894140ee Merge branch 'bugfix/11kv_prints' into 'master'
fix(esp_wifi): Added prints in btm roam for error condition

See merge request espressif/esp-idf!32658
2024-09-18 16:19:45 +08:00
Erhan Kurubas
6ade64eb05 docs(jtag): update esp32c61 jtag debugging guide 2024-09-18 10:44:41 +03:00
Sudeep Mohanty
453850eff2 Merge branch 'contrib/github_pr_14593' into 'master'
feat(advanced_console): Add ESP32-P4 ESP32-C5 model support in 'version' command output (GitHub PR)

Closes IDFGH-13722

See merge request espressif/esp-idf!33565
2024-09-18 15:37:33 +08:00
Shu Chen
28a92e56db Merge branch 'feature/add_ot_nat64_curl_ci_case' into 'master'
feat(openthread): add thread curl https ci case

See merge request espressif/esp-idf!33486
2024-09-18 15:36:25 +08:00
Kapil Gupta
27cf5267a1 fix(esp_wifi): Added prints in btm roam for error condition 2024-09-18 14:44:24 +08:00
Zhang Shu Xian
6a0ec48b11 Merge branch 'docs/fix_wrong_statement' into 'master'
docs: Fix wrong statement about set/get gptimer raw count

Closes DOC-8882

See merge request espressif/esp-idf!33574
2024-09-18 14:28:32 +08:00
yiwenxiu
26be72307b feat(openthread): add thread curl https ci case 2024-09-18 14:04:08 +08:00
Ren Peiying
84791fce2f Merge branch 'docs/add_app_examples_for_spi_master_twai_etc' into 'master'
docs: Update application examples for spi master, twai, and spi_slave

See merge request espressif/esp-idf!33276
2024-09-18 12:01:16 +08:00
Ren Peiying
a360c737ea Merge branch 'docs/update_app_examples_to_usb_host_device' into 'master'
docs: Add or update application examples for usb_host and usb_device

See merge request espressif/esp-idf!33275
2024-09-18 11:59:36 +08:00
Zhang Xiao Yan
40892b67c5 Merge branch 'docs/update_description_improve_io_performance' into 'master'
docs: update descriptions about improve I/O performance

See merge request espressif/esp-idf!33367
2024-09-18 11:48:05 +08:00
Wang Meng Yang
4b74e4e595 Merge branch 'bugfix/fix_sdp_compatibility' into 'master'
Bugfix/fix sdp compatibility

See merge request espressif/esp-idf!33442
2024-09-18 11:31:27 +08:00
Island
030470efa6 Merge branch 'ble_dev/esp32c61_chip_20240903' into 'master'
feat(ble): added ble support on esp32c61

Closes IDF-10360, IDF-10362, IDF-10363, and IDF-10365

See merge request espressif/esp-idf!33286
2024-09-18 11:17:58 +08:00
Island
1a065dc37a Merge branch 'feat/support_blecrt_242' into 'master'
fix(bt/bluedroid): Fixed access fault when reading BLE controller information fails

Closes BLERP-1019 and BLERP-1020

See merge request espressif/esp-idf!33406
2024-09-18 10:56:47 +08:00
Island
5f865a81b9 Merge branch 'refactor/ble_example_print_on_bluedroid' into 'master'
refactor(bt/bluedroid): Refactor the print for BLE examples

Closes BLERP-904, BLERP-910, BLERP-1026, and BLERP-1031

See merge request espressif/esp-idf!33296
2024-09-18 10:56:42 +08:00
Island
cb2624fb3f Merge branch 'bugfix/fix_ble_max_tx_power_on_esp32c3' into 'master'
fix(bt/controller): Change the max TX power to +20dBm on ESP32-C3 and ESP32-S3

Closes BLERP-1022

See merge request espressif/esp-idf!33264
2024-09-18 10:56:37 +08:00
Linda
ef1bffa937 docs: update descriptions about improve I/O performance 2024-09-18 10:53:42 +08:00
Zhang Shuxian
0244f7a9b5 docs: Fix wrong statement about set/get gptimer raw count 2024-09-18 10:14:55 +08:00
Sudeep Mohanty
812fbb7874 test(freertos): Enabled FreeRTOS unit tests for esp32c61 2024-09-17 14:17:01 +02:00
Sudeep Mohanty
328de495de fix(console): Fixed a typing error in the console advanced example 2024-09-17 09:16:06 +02:00
rudi ;-)
4281f58229 feat(advanced_console): Add support for ESP32-P4 and ESP32-C5 models in 'version' command output
The model ESP32P4 and ESP32C5 was unknown on version command in iperf example

add model ESP32P4 and ESP32C5
which prints out model names now by the knowed model
ESP32P4 = "ESP32-P4"
ESP32C5 = "ESP32-C5"

example app: iperf

before:
iperf> version
IDF Version:v5.4-dev-2744-g59e1838270-dirty
Chip info:
        model:Unknown
        cores:1
        feature:/802.11bgn/BLE/External-Flash:8 MB
        revision number:0
iperf>

after this add model is knowed now

iperf> version
IDF Version:v5.4-dev-2744-g59e1838270-dirty
Chip info:
        model:ESP32-C5
        cores:1
        feature:/802.11bgn/BLE/External-Flash:8 MB
        revision number:0
iperf>

Merges https://github.com/espressif/esp-idf/pull/14593
2024-09-17 09:04:52 +02:00
Aditya Patwardhan
fe47676a8b Merge branch 'feature/add_api_to_get_last_status_code_logged_during_ota' into 'master'
feat(esp_https_ota): added API to get last status code logged from http resonse

Closes IDFGH-13394

See merge request espressif/esp-idf!33356
2024-09-17 12:27:22 +08:00
Aditya Patwardhan
794c60411b Merge branch 'feat/update_random_number_docs_for_esp32c61' into 'master'
docs(systems): Updated the random number generator docs for esp32c61

Closes IDF-10153

See merge request espressif/esp-idf!33405
2024-09-17 11:58:03 +08:00
Rahul Tank
f68d16e7ad Merge branch 'bugfix/nimble_coverity_fixes' into 'master'
fix(nimble): Fix for coverity issues

Closes IDF-9419 and IDF-9425

See merge request espressif/esp-idf!33432
2024-09-16 22:26:42 +08:00
Roland Dobai
75fec0bdff Merge branch 'feat/move_sample_project' into 'master'
feat(tools): Move sample_project from examples to tools

Closes IDF-9812

See merge request espressif/esp-idf!33515
2024-09-16 20:00:07 +08:00
Tomas Borcin
4e4fb3a57b Merge branch 'docs/roadmap' into 'master'
docs: Adding ESP-IDF Project Roadmap

Closes RDT-668

See merge request espressif/esp-idf!31339
2024-09-16 19:02:31 +08:00
Rahul Tank
2113e99aeb fix(nimble): Fix for coverity issues 2024-09-16 14:24:32 +05:30
Rahul Tank
cfb78587f3 Merge branch 'bugfix/add_dummy_cb_during_deinit' into 'master'
fix(nimble): De-register host cb in stack deinit

See merge request espressif/esp-idf!33251
2024-09-16 16:40:19 +08:00
Marek Fiala
6ec1e9107f feat(tools): Move sample_project from examples to tools
Extended example readme.md by further development options.
2024-09-16 09:12:50 +02:00
Rahul Tank
2512588884 fix(nimble): De-register host cb in stack deinit 2024-09-16 10:35:47 +05:30
Jiang Jiang Jian
5a5c004691 Merge branch 'feature/optimize_coex_connectionless_pwr' into 'master'
feat(coex): optimize connectionless coexist pwr, optimize wifi pwr with BLE IDLE

Closes WIFI-6693 and WIFI-6645

See merge request espressif/esp-idf!33437
2024-09-15 23:41:21 +08:00
liuning
83809910d2 feat(coex): optimize connectionless coexist pwr, optimize wifi pwr with bt idle 2024-09-14 19:28:09 +08:00
Lou Tianhao
dd3d5f1598 fix(ci): :fix the issue of regdma wait node to immediately return to done caused by regdma wait mode comparator for esp32c6 & esp32h2 &esp32p4 2024-09-14 19:21:51 +08:00
liqigan
205e66c9fd fix(bt/bluedroid): Fixed not deep copy service_name and user1_ptr in RAW SDP search event 2024-09-14 14:37:50 +08:00
liqigan
1cfb537813 fix(bt/bluedroid): Fixed the SDP API compatibility bug 2024-09-14 14:37:50 +08:00
Shen Weilong
bf52e37fa8 feat(ble): added ble support on esp32c61 2024-09-14 12:22:04 +08:00
Xiao Xufeng
436bcd6c06 ci(app_update): move test_apps to subfolder with a name 2024-09-14 10:19:30 +08:00
Xiao Xufeng
cdb9f2b098 ci(spi_flash): add tests for cache2phys with XIP 2024-09-14 10:19:30 +08:00
Xiao Xufeng
8bf68ff07b fix(mmap): fixed spi_flash_phys2cache return addr in PSRAM issue
When SPIRAM_FETCH_INSTRUCTIONS or SPIRAM_RODATA enabled
2024-09-14 10:19:30 +08:00
renpeiying
5fe1f22b34 docs: Update application examples for spi master, twai, and spi_slave 2024-09-13 17:05:02 +08:00
renpeiying
27a88b83fb docs: Add or update application examples for usb_host and usb_device 2024-09-13 16:12:21 +08:00
chenjianhua
53a8345e60 refactor(bt/bluedroid): Refactor the print for BLE examples 2024-09-12 19:30:45 +08:00
Tomas Borcin
83393cdec8 docs: Adding ESP-IDF Project Roadmap 2024-09-12 12:51:22 +02:00
Erhan Kurubas
8fd3e8c0d3 fix(apptrace): fix build error when print lock is enabled 2024-09-11 23:02:11 +03:00
chenjianhua
e4e23087ee fix(bt/bluedroid): Fixed access fault when reading BLE controller information fails 2024-09-11 10:26:45 +08:00
chenjianhua
e4a372ab76 feat(bt/bluedroid): Add BLE connection id param for ESP_GATTS_RESPONSE_EVT 2024-09-11 10:26:45 +08:00
Sean DuBois
58775cce6e fix(ws_transport): Fix crash when reading
When parsing WS framing protocol integer promotion would cause
invalid values to be read. Acting upon these values would eventually
cause a crash

Fixes esp-protocols#645
2024-09-09 12:32:37 -04:00
hrushikesh.bhosale
952533bee3 docs(systems): Updated the random number generator docs for esp32c61
Udpated the non_updated_docs for esp32c61 for random number geneartor
2024-09-09 17:20:35 +05:30
chenjianhua
fe43c8f1b5 fix(bt/controller): Change the max TX power to +20dBm on ESP32-C3 and ESP32-S3 2024-09-09 11:25:10 +08:00
nilesh.kale
70d4414eeb feat(esp_https_ota): added API to get last status code logged from http resonse
Closes https://github.com/espressif/esp-idf/issues/14302
2024-09-06 15:09:42 +05:30
LonerDan
f92bff6009 fix(rmt): set rx filter resolution_hz to rmt_sclk
Fixes assignment of `filter_clock_resolution_hz` to `rx_channel->base.resolution_hz`, which is the clock frequency after the fractional divider `RMT_SCLK_DIV` (also referenced as `rmt_sclk` in the TRM), instead of the previously used value from `group->resolution_hz`, which represents the full undivided frequency from clock selected by `RMT_SCLK_SEL` (APB, RC_FAST or XTAL).
Before this fix, this mixup resulted in error `signal_range_min_ns too big` returned by the `rmt_receive` function due to the check at 8e4454b285/components/esp_driver_rmt/src/rmt_rx.c (L410-L413) failing no matter the `resolution_hz` used in configuration of the channel.
2024-08-07 15:53:50 +02:00
261 changed files with 1814 additions and 1115 deletions

View File

@ -59,6 +59,7 @@
/CONTRIBUTING.md @esp-idf-codeowners/docs
/Kconfig @esp-idf-codeowners/build-config
/README*.md @esp-idf-codeowners/docs
/ROADMAP*.md @esp-idf-codeowners/docs
/SUPPORT_POLICY*.md @esp-idf-codeowners/docs
/add_path.sh @esp-idf-codeowners/tools
/conftest.py @esp-idf-codeowners/ci

View File

@ -156,11 +156,12 @@ build_clang_test_apps_esp32s3:
extends:
- .build_cmake_clang_template
variables:
# For RISCV clang generates '.linker-options' sections of type 'llvm_linker_options' in asm files.
# See (https://llvm.org/docs/Extensions.html#linker-options-section-linker-options).
# Binutils gas ignores them with warning.
# TODO: LLVM-333, Use integrated assembler.
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'Warning: unrecognized section type'"
# https://reviews.llvm.org/D90108.
# GNU 'as' lets .weak override .globl since binutils-gdb
# https://github.com/bminor/binutils-gdb/commit/5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996)
# while MC lets the last directive win (PR38921).
# For RISCV chips we use integrated assembler by default, so suppress this warning to pass CI pipeline.
TEST_BUILD_OPTS_EXTRA: "--ignore-warning-str 'changed binding to STB_WEAK'"
build_clang_test_apps_esp32c3:
extends:

123
ROADMAP.md Normal file
View File

@ -0,0 +1,123 @@
# ESP-IDF Project Roadmap2024
This document outlines the goals of ESP-IDF project and is shared for the convenience of our customers. It is important to clarify that this document is not a binding commitment to our customers. Instead, its primary purpose is to offer a clear roadmap and direction for the project's development. By openly sharing this information, we aim to enhance our customers' understanding, promote transparency and ensure alignment with the overarching objectives of the ESP-IDF project.
## Project Overview
### Project Goals
In both minor and major releases, we integrate new chip support to enhance our product range. By expanding the chip matrix, we broaden the scope of our offerings, catering to a wider audience with diverse needs. This proactive approach ensures that our products remain at the forefront of technological advancements, consistently meeting and exceeding customer expectations.
Furthermore, we prioritize bugfix releases for active branches, focusing on improving the stability and performance of products already in production. By addressing bugs promptly, we aim to enhance the overall user experience and provide tangible benefits to customers relying on our solutions. This proactive maintenance strategy reflects our commitment to delivering reliable, high-quality products to our valued customer base.
Below are the main objectives that ESP-IDF project/teams would like to implement in 2024.
- New Chip Support
- Add support for ESP32-P4
- Add support for ESP32-C5
- Add support for ESP32-C61
- More Minor Releases
- Release IDF v5.3 in 2024
- Release IDF v5.4 at the start of 2025
- More Bugfix Releases
- Release v4.4.8 for IDF v4.4 before ESP-IDF v4.4 goes End of Life in July 2024
- Do more bugfix releases for IDF v5.1 before release/5.1 enters maintenance period in June 2024
- Do more bug fixes releases for release/5.2 and release/5.3, and push the two releases to be more stable and production-ready
- Updates of Libraries
- Update GDB to 14.2
- Update LLVM to 18.1.2
- Update MbedTLS to 3.6 (LTS)
- Update LWIP to 2.2.0
- Change minimal Python requirement to 3.9
Please note that support status of previous silicones could be found on [ESP-IDF Release and SoC Compatibility](https://github.com/espressif/esp-idf#esp-idf-release-and-soc-compatibility).
### Roadmap Details
The ESP-IDF project prioritizes consistent maintenance and updates to ensure our customers remain at the forefront of technological advancements. Our commitment to ongoing development ensures that customers continuously benefit from the latest innovations in the field.
Moreover, we are dedicated to empowering our customers to leverage newly implemented features and enhanced functionalities through iterative improvements. Our steadfast commitment to pushing boundaries ensures that clients not only keep pace with evolving technology but also extract optimal value from the cutting-edge capabilities of our products.
Below are the main roadmap details for functional areas inside ESP-IDF.
- New Chip Support
- Add full support for ESP32-P4 in ESP-IDF v5.3, refer to [ESP32-P4 Support Status](https://github.com/espressif/esp-idf/issues/12996)
- Add preview support for ESP32-C5 in ESP-IDF v5.3 and full support for ESP32-C5 in ESP-IDF v5.4, refer to [ESP32-C5 Support Status](https://github.com/espressif/esp-idf/issues/14021)
- Add preview support for the early samples of ESP32-C61 in ESP-IDF v5.4 and full support for mass production version in ESP-IDF v5.4.x. Refer to [ESP32-C61 Support Status](https://developer.espressif.com/pages/chip-support-status/esp32c61/#esp-idf)
- Bugfix releases
- Do bugfix release IDF v4.4.8 and stop maintaining ESP-IDF v4.4 in July 2024
- Release bugfix IDF v5.0.6 and IDF v5.0.7 in 2024 (maintenance period)
- Release bugfix IDF v5.1.3 and IDF v5.1.4 in H1 of 2024, and release IDF v5.1.5 in H2 of 2024
- Push release/5.1 to maintenance period from June 2024
- Do more bug fixes releases for release/5.2 (IDF v5.2.1, IDF v5.2.2, IDF v5.2.3) and release/5.3 (IDF v5.3.1, IDF v5.3.2), and push releases to be more stable and more production-ready
## ESP-IDF Planning information
For the full list of ESP-IDF releases, please visit https://github.com/espressif/esp-idf/releases
### ESP-IDF Major Releases
No Major Releases planned
### ESP-IDF Minor Releases
#### Quarter One
- v5.2-RC1, estimate release date: 2024/02/02
- v5.2 final release, estimate release date: 2024/02/08
#### Quarter Two
- v5.3-beta1, estimate release date:: 2024/05/13
- v5.3-beta2, estimate release date:: 2024/05/31
- v5.3-RC1, estimate release date:: 2024/07/08
#### Quarter Three
- v5.3-RC2, estimate release date:: 2024/07/26
- v5.3 final release, estimate release date:: 2024/08/02
#### Quarter Four
- v5.4-beta1, estimate release date:: 2024/11/08
- v5.4-beta2, estimate release date:: 2024/11/29
- v5.4-RC1, estimate release date:: 2025/01/09
- v5.4-RC2, estimate release date:: 2025/01/29
- v5.4 final release, estimate release date: 2025/02/05
### ESP-IDF Bugfix Releases
#### Quarter One
- v5.1.3, estimate release date: 2024/02/08
- v5.0.6, estimate release date: 2024/02/18
- v4.4.7, estimate release date:: 2024/03/19
- v5.2.1, estimate release date:: 2024/03/31
#### Quarter Two
- v5.1.4, estimate release date:: 2024/05/06
- v5.2.2, estimate release date:: 2024/06/17
- v4.4.8, estimate release date:: 2024/07/19
#### Quarter Three
- v5.0.7, estimate release date: 2024/08/22
- v5.3.1, estimate release date: 2024/09/16
- v5.2.3, estimate release date: 2024/10/10
#### Quarter Four
- v5.1.5, estimate release date: 2024/11/04 (Maintenance period since June 2024)
- v5.3.2, estimate release date: 2024/12/31
- v5.2.4, estimate release date: 2025/02/20 (Service period ends Feb. 2025)

View File

@ -26,8 +26,6 @@
#define ESP_APPTRACE_MAX_VPRINTF_ARGS 256
#define ESP_APPTRACE_HOST_BUF_SIZE 256
#define ESP_APPTRACE_PRINT_LOCK 0
const static char *TAG = "esp_apptrace";
/** tracing module internal data */
@ -90,7 +88,7 @@ void esp_apptrace_down_buffer_config(uint8_t *buf, uint32_t size)
return;
}
// currently down buffer is supported for JTAG interface only
// TODO: one more argument should be added to this function to specify HW inteface: JTAG, UART0 etc
// TODO: one more argument should be added to this function to specify HW interface: JTAG, UART0 etc
ch = &s_trace_channels[ESP_APPTRACE_DEST_JTAG];
if (ch->hw != NULL) {
if (ch->hw->down_buffer_config != NULL) {

View File

@ -9,12 +9,14 @@
#include "esp_app_trace_util.h"
#include "sdkconfig.h"
#define ESP_APPTRACE_PRINT_LOCK 0
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////// Locks /////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
#if ESP_APPTRACE_PRINT_LOCK
static esp_apptrace_lock_t s_log_lock = {.irq_stat = 0, .portmux = portMUX_INITIALIZER_UNLOCKED};
static esp_apptrace_lock_t s_log_lock = { .mux = portMUX_INITIALIZER_UNLOCKED };
#endif
int esp_apptrace_log_lock(void)
@ -31,7 +33,7 @@ int esp_apptrace_log_lock(void)
void esp_apptrace_log_unlock(void)
{
#if ESP_APPTRACE_PRINT_LOCK
#if ESP_APPTRACE_PRINT_LOCK
esp_apptrace_lock_give(&s_log_lock);
#endif
}
@ -87,7 +89,7 @@ esp_err_t esp_apptrace_lock_give(esp_apptrace_lock_t *lock)
uint8_t *esp_apptrace_rb_produce(esp_apptrace_rb_t *rb, uint32_t size)
{
uint8_t *ptr = rb->data + rb->wr;
// check for avalable space
// check for available space
if (rb->rd <= rb->wr) {
// |?R......W??|
if (rb->wr + size >= rb->size) {

View File

@ -1,7 +0,0 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/app_update/test_apps:
disable:
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: target esp32c61 is not supported yet # TODO: [ESP32C61] IDF-9245

View File

@ -1,26 +0,0 @@
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
import pytest
from pytest_embedded import Dut
DEFAULT_TIMEOUT = 20
TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
def run_multiple_stages(dut: Dut, test_case_num: int, stages: int) -> None:
for stage in range(1, stages + 1):
dut.write(str(test_case_num))
dut.expect(TEST_SUBMENU_PATTERN_PYTEST, timeout=DEFAULT_TIMEOUT)
dut.write(str(stage))
if stage != stages:
dut.expect_exact('Press ENTER to see the list of tests.')
@pytest.mark.supported_targets
# 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:
dut.run_all_single_board_cases(timeout=90)

View File

@ -0,0 +1,12 @@
# Documentation: .gitlab/ci/README.md#manifest-file-to-control-the-buildtest-apps
components/app_update/test_apps:
enable:
- if: CONFIG_NAME == "defaults" and IDF_TARGET != "linux"
- if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"]
# S2 doesn't have ROM for flash
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"]
disable:
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: target esp32c61 is not supported yet # TODO: [ESP32C61] IDF-9245

View File

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

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "esp_log.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <freertos/semphr.h>
@ -113,3 +114,11 @@ TEST_CASE("esp_ota_get_partition_description", "[ota]")
};
TEST_ESP_ERR(ESP_ERR_NOT_FOUND, bootloader_common_get_partition_description(&not_app_pos, &app_desc1));
}
TEST_CASE("esp_ota_get_running_partition points to correct address", "[spi_flash]")
{
const esp_partition_t *factory = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, "factory");
const esp_partition_t* part = esp_ota_get_running_partition();
ESP_LOGI("running bin", "0x%p", (void*)part->address);
TEST_ASSERT_EQUAL_HEX32(factory->address, part->address);
}

View File

@ -0,0 +1,52 @@
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
import pytest
from pytest_embedded import Dut
DEFAULT_TIMEOUT = 20
TEST_SUBMENU_PATTERN_PYTEST = re.compile(rb'\s+\((\d+)\)\s+"([^"]+)"\r?\n')
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported deep sleep') # TODO: [ESP32C5] IDF-8640, IDF-10317
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'defaults',
],
indirect=True,
)
def test_app_update(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
@pytest.mark.supported_targets
# 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
@pytest.mark.parametrize(
'config',
[
'xip_psram',
],
indirect=True,
)
def test_app_update_xip_psram(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c5'], reason='C5 has not supported deep sleep') # TODO: [ESP32C5] IDF-8640, IDF-10317
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
'xip_psram_with_rom_impl',
],
indirect=True,
)
def test_app_update_xip_psram_rom_impl(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=90)

View File

@ -0,0 +1,2 @@
# don't delete.
# used for CI to compile a default config when 'sdkconfig.ci.xxxx' is exist

View File

@ -1,2 +1,2 @@
CONFIG_IDF_TARGET="esp32c5"
CONFIG_SPIRAM=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y

View File

@ -0,0 +1,3 @@
CONFIG_SPIRAM=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_SPI_FLASH_ROM_IMPL=y

View File

@ -6,6 +6,8 @@ endif()
if(CONFIG_IDF_TARGET_ESP32S3)
set(target_name "esp32c3")
elseif(CONFIG_IDF_TARGET_ESP32C61)
set(target_name "esp32c6")
else()
set(target_name "${idf_target}")
endif()
@ -853,6 +855,14 @@ if(CONFIG_BT_ENABLED)
target_link_directories(${COMPONENT_LIB} INTERFACE
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c3_family/esp32s3")
target_link_libraries(${COMPONENT_LIB} PUBLIC btdm_app)
elseif(CONFIG_IDF_TARGET_ESP32C6)
add_prebuilt_library(libble_app
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c6/libble_app.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
elseif(CONFIG_IDF_TARGET_ESP32C61)
add_prebuilt_library(libble_app
"${CMAKE_CURRENT_LIST_DIR}/controller/lib_esp32c6/esp32c6-bt-lib/esp32c61/libble_app.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)
elseif(CONFIG_BT_CONTROLLER_ENABLED)
add_prebuilt_library(libble_app "controller/lib_${target_name}/${target_name}-bt-lib/libble_app.a")
target_link_libraries(${COMPONENT_LIB} PRIVATE libble_app)

View File

@ -200,8 +200,8 @@ choice BT_CTRL_DFT_TX_POWER_LEVEL
bool "+15dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P18
bool "+18dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P21
bool "+21dBm"
config BT_CTRL_DFT_TX_POWER_LEVEL_P20
bool "+20dBm"
endchoice
config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
@ -221,7 +221,7 @@ config BT_CTRL_DFT_TX_POWER_LEVEL_EFF
default 12 if BT_CTRL_DFT_TX_POWER_LEVEL_P12
default 13 if BT_CTRL_DFT_TX_POWER_LEVEL_P15
default 14 if BT_CTRL_DFT_TX_POWER_LEVEL_P18
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P21
default 15 if BT_CTRL_DFT_TX_POWER_LEVEL_P20
default 0
config BT_CTRL_BLE_ADV_REPORT_FLOW_CTRL_SUPP

View File

@ -0,0 +1 @@
source "$IDF_PATH/components/bt/controller/esp32c6/Kconfig.in"

@ -1 +1 @@
Subproject commit f95513f22be7b21429b01ba05dbfbc98097b5e67
Subproject commit 44e3d21b8f1b1802a6b5282fab5a1ec314d695a6

View File

@ -126,6 +126,7 @@ config BT_L2CAP_ENABLED
config BT_SDP_COMMON_ENABLED
bool "BT SDP COMMON"
depends on BT_CLASSIC_ENABLED
default y if BT_L2CAP_ENABLED
default n
help
This enables common SDP operation, such as SDP record creation and deletion.

View File

@ -242,6 +242,7 @@ typedef union {
*/
struct gatts_rsp_evt_param {
esp_gatt_status_t status; /*!< Operation status */
uint16_t conn_id; /*!< Connection id */
uint16_t handle; /*!< Attribute handle which send response */
} rsp; /*!< Gatt server callback param of ESP_GATTS_RESPONSE_EVT */

View File

@ -65,64 +65,66 @@ typedef enum {
/**
* @brief SDP header structure
*/
typedef struct {
esp_bluetooth_sdp_types_t type; /*!< SDP type */
uint32_t service_name_length; /*!< Service name length */
char *service_name; /*!< Service name */
int32_t rfcomm_channel_number; /*!< RFCOMM channel number, if not used set to -1*/
int32_t l2cap_psm; /*!< L2CAP psm, if not used set to -1 */
int32_t profile_version; /*!< Profile version */
} esp_bluetooth_sdp_hdr_t;
typedef struct bluetooth_sdp_hdr_overlay {
esp_bluetooth_sdp_types_t type; /*!< SDP type */
esp_bt_uuid_t uuid; /*!< UUID type, include uuid and uuid length, only needed to be set for RAW record creation */
uint32_t service_name_length; /*!< Service name length */
char *service_name; /*!< Service name */
int32_t rfcomm_channel_number; /*!< RFCOMM channel number, if not used set to -1*/
int32_t l2cap_psm; /*!< L2CAP psm, if not used set to -1 */
int32_t profile_version; /*!< Profile version */
int user1_ptr_len; /*!< User data1 length, only used for searching RAW record */
uint8_t *user1_ptr; /*!< User data1 pointer to the raw SDP response data, only used for searching RAW record */
int user2_ptr_len __attribute__((deprecated)); /*!< User data2 length, only used for searching RAW record */
uint8_t *user2_ptr __attribute__((deprecated)); /*!< User data2 pointer, only used for searching RAW record */
} esp_bluetooth_sdp_hdr_overlay_t;
/**
* @brief Raw SDP record
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
esp_bt_uuid_t uuid; /*!< UUID type include uuid and uuid length */
int user1_ptr_len; /*!< Length of raw SDP data */
uint8_t *user1_ptr; /*!< Raw SDP data */
typedef struct bluetooth_sdp_raw_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
} esp_bluetooth_sdp_raw_record_t;
/**
* @brief Message Access Profile - Server parameters
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
uint32_t mas_instance_id; /*!< MAS Instance ID */
uint32_t supported_features; /*!< Map supported features */
uint32_t supported_message_types; /*!< Supported message types */
typedef struct bluetooth_sdp_mas_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t mas_instance_id; /*!< MAS Instance ID */
uint32_t supported_features; /*!< Map supported features */
uint32_t supported_message_types; /*!< Supported message types */
} esp_bluetooth_sdp_mas_record_t;
/**
* @brief Message Access Profile - Client (Notification Server) parameters
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
uint32_t supported_features; /*!< Supported features */
typedef struct bluetooth_sdp_mns_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t supported_features; /*!< Supported features */
} esp_bluetooth_sdp_mns_record_t;
/**
* @brief Phone Book Profile - Server parameters
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
uint32_t supported_features; /*!< PBAP Supported Features */
uint32_t supported_repositories; /*!< Supported Repositories */
typedef struct bluetooth_sdp_pse_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint32_t supported_features; /*!< PBAP Supported Features */
uint32_t supported_repositories; /*!< Supported Repositories */
} esp_bluetooth_sdp_pse_record_t;
/**
* @brief Phone Book Profile - Client parameters
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
typedef struct bluetooth_sdp_pce_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
} esp_bluetooth_sdp_pce_record_t;
/**
* @brief Object Push Profile parameters
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
typedef struct bluetooth_sdp_ops_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
int supported_formats_list_len; /*!< Supported formats list length */
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH]; /*!< Supported formats list */
} esp_bluetooth_sdp_ops_record_t;
@ -130,8 +132,8 @@ typedef struct {
/**
* @brief SIM Access Profile parameters
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
typedef struct bluetooth_sdp_sap_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
} esp_bluetooth_sdp_sap_record_t;
/**
@ -148,21 +150,21 @@ typedef enum {
* @note Only one primary Device Identification service record can be added in the SDP database. If primary
* Device Identification service is created multiple times, only the last one will take effect.
*/
typedef struct {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
uint16_t vendor; /*!< Vendor ID */
uint16_t vendor_id_source; /*!< Vendor ID source, 0x0001 for Bluetooth, 0x0002 for USB, other values reserved, see `esp_sdp_vendor_id_source_t` */
uint16_t product; /*!< Product ID */
uint16_t version; /*!< Release version in format 0xJJMN(JJ major number, M minor number, N sub-minor number) */
bool primary_record; /*!< Indicate if the record is primary, shall set to true if there is a only single device
record, others shall be set to false */
typedef struct bluetooth_sdp_dip_record {
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
uint16_t vendor; /*!< Vendor ID */
uint16_t vendor_id_source; /*!< Vendor ID source, 0x0001 for Bluetooth, 0x0002 for USB, other values reserved, see `esp_sdp_vendor_id_source_t` */
uint16_t product; /*!< Product ID */
uint16_t version; /*!< Release version in format 0xJJMN(JJ major number, M minor number, N sub-minor number) */
bool primary_record; /*!< Indicate if the record is primary, shall set to true if there is a only single device
record, others shall be set to false */
} esp_bluetooth_sdp_dip_record_t;
/**
* @brief SDP record parameters union
*/
typedef union {
esp_bluetooth_sdp_hdr_t hdr; /*!< General info */
esp_bluetooth_sdp_hdr_overlay_t hdr; /*!< General info */
esp_bluetooth_sdp_raw_record_t raw; /*!< Raw SDP search data for unknown UUIDs */
esp_bluetooth_sdp_mas_record_t mas; /*!< Message Access Profile - Server */
esp_bluetooth_sdp_mns_record_t mns; /*!< Message Access Profile - Client (Notification Server) */
@ -205,7 +207,7 @@ typedef union {
/**
* @brief ESP_SDP_CREATE_RECORD_COMP_EVT
*/
struct sdp_crate_record_evt_param {
struct sdp_create_record_evt_param {
esp_sdp_status_t status; /*!< Status */
int record_handle; /*!< SDP record handle */
} create_record; /*!< SDP callback param of ESP_SDP_CREATE_RECORD_COMP_EVT */

View File

@ -85,9 +85,11 @@ typedef void (tBTA_SDP_DM_CBACK)(tBTA_SDP_EVT event, tBTA_SDP *p_data, void *use
/* MCE configuration structure */
typedef struct {
UINT16 sdp_db_size; /* The size of p_sdp_db */
UINT16 sdp_raw_size; /* The size of p_sdp_raw_data */
UINT16 sdp_db_size; /* The size of p_sdp_db */
#if (SDP_INCLUDED == TRUE)
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
UINT8 *p_sdp_raw_data; /* The data buffer to keep raw data */
tSDP_DISCOVERY_DB *p_sdp_db; /* The data buffer to keep SDP database */
#endif ///SDP_INCLUDED == TRUE
} tBTA_SDP_CFG;

View File

@ -395,29 +395,29 @@ static void bta_create_raw_sdp_record(bluetooth_sdp_record *record, tSDP_DISC_RE
tSDP_DISC_ATTR *p_attr;
tSDP_PROTOCOL_ELEM pe;
record->hdr.type = SDP_TYPE_RAW;
record->hdr.service_name_length = 0;
record->hdr.service_name = NULL;
record->hdr.rfcomm_channel_number = -1;
record->hdr.l2cap_psm = -1;
record->hdr.profile_version = -1;
record->raw.hdr.type = SDP_TYPE_RAW;
record->raw.hdr.service_name_length = 0;
record->raw.hdr.service_name = NULL;
record->raw.hdr.rfcomm_channel_number = -1;
record->raw.hdr.l2cap_psm = -1;
record->raw.hdr.profile_version = -1;
/* Try to extract a service name */
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_SERVICE_NAME)) != NULL) {
record->pse.hdr.service_name_length = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
record->pse.hdr.service_name = (char *)p_attr->attr_value.v.array;
record->raw.hdr.service_name_length = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
record->raw.hdr.service_name = (char *)p_attr->attr_value.v.array;
}
if ((p_attr = SDP_FindAttributeInRec(p_rec, ATTR_ID_GOEP_L2CAP_PSM)) != NULL) {
record->hdr.l2cap_psm = p_attr->attr_value.v.u16;
record->raw.hdr.l2cap_psm = p_attr->attr_value.v.u16;
}
/* Try to extract an RFCOMM channel */
if (SDP_FindProtocolListElemInRec(p_rec, UUID_PROTOCOL_RFCOMM, &pe)) {
record->pse.hdr.rfcomm_channel_number = pe.params[0];
record->raw.hdr.rfcomm_channel_number = pe.params[0];
}
record->raw.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_size;
record->raw.user1_ptr = p_bta_sdp_cfg->p_sdp_db->raw_data;
record->raw.hdr.user1_ptr_len = p_bta_sdp_cfg->p_sdp_db->raw_used;
record->raw.hdr.user1_ptr = p_bta_sdp_cfg->p_sdp_db->raw_data;
}
@ -570,6 +570,10 @@ void bta_sdp_search(tBTA_SDP_MSG *p_data)
SDP_InitDiscoveryDb (p_bta_sdp_cfg->p_sdp_db, p_bta_sdp_cfg->sdp_db_size, 1,
bta_sdp_search_uuid, 0, NULL);
/* tell SDP to keep the raw data */
p_bta_sdp_cfg->p_sdp_db->raw_size = p_bta_sdp_cfg->sdp_raw_size;
p_bta_sdp_cfg->p_sdp_db->raw_data = p_bta_sdp_cfg->p_sdp_raw_data;
if (!SDP_ServiceSearchAttributeRequest2(p_data->get_search.bd_addr, p_bta_sdp_cfg->p_sdp_db,
bta_sdp_search_cback, (void *)bta_sdp_search_uuid)) {
bta_sdp_cb.sdp_active = BTA_SDP_ACTIVE_NONE;

View File

@ -65,7 +65,9 @@ tBTA_SDP_STATUS BTA_SdpEnable(tBTA_SDP_DM_CBACK *p_cback)
#if BTA_DYNAMIC_MEMORY == TRUE
/* Malloc buffer for SDP configuration structure */
p_bta_sdp_cfg->p_sdp_db = (tSDP_DISCOVERY_DB *)osi_malloc(p_bta_sdp_cfg->sdp_db_size);
if (p_bta_sdp_cfg->p_sdp_db == NULL) {
p_bta_sdp_cfg->p_sdp_raw_data = (UINT8 *)osi_malloc(p_bta_sdp_cfg->sdp_raw_size);
if (p_bta_sdp_cfg->p_sdp_db == NULL || p_bta_sdp_cfg->p_sdp_raw_data == NULL) {
BTA_SdpCleanup();
return BTA_SDP_FAILURE;
}
#endif
@ -118,8 +120,15 @@ tBTA_SDP_STATUS BTA_SdpCleanup(void)
bta_sys_deregister(BTA_ID_SDP);
#if BTA_DYNAMIC_MEMORY == TRUE
/* Free buffer for SDP configuration structure */
osi_free(p_bta_sdp_cfg->p_sdp_db);
p_bta_sdp_cfg->p_sdp_db = NULL;
if (p_bta_sdp_cfg->p_sdp_db) {
osi_free(p_bta_sdp_cfg->p_sdp_db);
p_bta_sdp_cfg->p_sdp_db = NULL;
}
if (p_bta_sdp_cfg->p_sdp_raw_data) {
osi_free(p_bta_sdp_cfg->p_sdp_raw_data);
p_bta_sdp_cfg->p_sdp_raw_data = NULL;
}
#endif
return BTA_SDP_SUCCESS;
}

View File

@ -30,16 +30,24 @@
#define BTA_SDP_DB_SIZE 1500
#endif
#ifndef BTA_SDP_RAW_DATA_SIZE
#define BTA_SDP_RAW_DATA_SIZE 1024
#endif
#if BTA_DYNAMIC_MEMORY == FALSE
static UINT8 bta_sdp_raw_data[BTA_SDP_RAW_DATA_SIZE];
static UINT8 __attribute__ ((aligned(4))) bta_sdp_db_data[BTA_SDP_DB_SIZE];
#endif
/* SDP configuration structure */
tBTA_SDP_CFG bta_sdp_cfg = {
BTA_SDP_RAW_DATA_SIZE,
BTA_SDP_DB_SIZE,
#if BTA_DYNAMIC_MEMORY == FALSE
bta_sdp_raw_data,
(tSDP_DISCOVERY_DB *)bta_sdp_db_data /* The data buffer to keep SDP database */
#else
NULL,
NULL
#endif
};

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -469,7 +469,7 @@ static esp_gatt_status_t btc_gatts_check_valid_attr_tab(esp_gatts_attr_db_t *gat
if(gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_16 &&
gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_32 &&
gatts_attr_db[i+1].att_desc.uuid_length != ESP_UUID_LEN_128) {
BTC_TRACE_ERROR("%s, The Charateristic uuid length = %d is invalid", __func__,\
BTC_TRACE_ERROR("%s, The Characteristic uuid length = %d is invalid", __func__,\
gatts_attr_db[i+1].att_desc.uuid_length);
return ESP_GATT_INVALID_ATTR_LEN;
}
@ -481,7 +481,7 @@ static esp_gatt_status_t btc_gatts_check_valid_attr_tab(esp_gatts_attr_db_t *gat
uuid == ESP_GATT_UUID_CHAR_SRVR_CONFIG || uuid == ESP_GATT_UUID_CHAR_PRESENT_FORMAT ||
uuid == ESP_GATT_UUID_CHAR_AGG_FORMAT || uuid == ESP_GATT_UUID_CHAR_VALID_RANGE ||
uuid == ESP_GATT_UUID_EXT_RPT_REF_DESCR || uuid == ESP_GATT_UUID_RPT_REF_DESCR) {
BTC_TRACE_ERROR("%s, The charateristic value uuid = %d is invalid", __func__, uuid);
BTC_TRACE_ERROR("%s, The characteristic value uuid = %d is invalid", __func__, uuid);
return ESP_GATT_INVALID_PDU;
}
}
@ -694,6 +694,7 @@ void btc_gatts_call_handler(btc_msg_t *msg)
}
param.rsp.status = 0;
param.rsp.conn_id = BTC_GATT_GET_CONN_ID(arg->send_rsp.conn_id);
btc_gatts_cb_to_app(ESP_GATTS_RESPONSE_EVT, BTC_GATT_GET_GATT_IF(arg->send_rsp.conn_id), &param);
break;
}

View File

@ -38,73 +38,79 @@ typedef enum {
SDP_TYPE_DIP_SERVER, // Device Identification Profile
} bluetooth_sdp_types;
typedef struct _bluetooth_sdp_hdr {
/**
* Some signals need additional pointers, hence we introduce a
* generic way to handle these pointers.
*/
typedef struct _bluetooth_sdp_hdr_overlay {
bluetooth_sdp_types type;
esp_bt_uuid_t uuid;
uint32_t service_name_length;
char *service_name;
int32_t rfcomm_channel_number;
int32_t l2cap_psm;
int32_t profile_version;
} bluetooth_sdp_hdr;
int user1_ptr_len;
uint8_t *user1_ptr;
int user2_ptr_len; // not used
uint8_t *user2_ptr; // not used
} bluetooth_sdp_hdr_overlay;
typedef struct _bluetooth_sdp_raw_record {
bluetooth_sdp_hdr hdr;
esp_bt_uuid_t uuid;
int user1_ptr_len;
uint8_t *user1_ptr;
bluetooth_sdp_hdr_overlay hdr;
} bluetooth_sdp_raw_record;
typedef struct _bluetooth_sdp_mas_record {
bluetooth_sdp_hdr hdr;
uint32_t mas_instance_id;
uint32_t supported_features;
uint32_t supported_message_types;
bluetooth_sdp_hdr_overlay hdr;
uint32_t mas_instance_id;
uint32_t supported_features;
uint32_t supported_message_types;
} bluetooth_sdp_mas_record;
typedef struct _bluetooth_sdp_mns_record {
bluetooth_sdp_hdr hdr;
uint32_t supported_features;
bluetooth_sdp_hdr_overlay hdr;
uint32_t supported_features;
} bluetooth_sdp_mns_record;
typedef struct _bluetooth_sdp_pse_record {
bluetooth_sdp_hdr hdr;
uint32_t supported_features;
uint32_t supported_repositories;
bluetooth_sdp_hdr_overlay hdr;
uint32_t supported_features;
uint32_t supported_repositories;
} bluetooth_sdp_pse_record;
typedef struct _bluetooth_sdp_pce_record {
bluetooth_sdp_hdr hdr;
bluetooth_sdp_hdr_overlay hdr;
} bluetooth_sdp_pce_record;
typedef struct _bluetooth_sdp_ops_record {
bluetooth_sdp_hdr hdr;
int supported_formats_list_len;
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH];
bluetooth_sdp_hdr_overlay hdr;
int supported_formats_list_len;
uint8_t supported_formats_list[SDP_OPP_SUPPORTED_FORMATS_MAX_LENGTH];
} bluetooth_sdp_ops_record;
typedef struct _bluetooth_sdp_sap_record {
bluetooth_sdp_hdr hdr;
bluetooth_sdp_hdr_overlay hdr;
} bluetooth_sdp_sap_record;
typedef struct _bluetooth_sdp_dip_record {
bluetooth_sdp_hdr hdr;
uint16_t vendor;
uint16_t vendor_id_source;
uint16_t product;
uint16_t version;
bool primary_record;
bluetooth_sdp_hdr_overlay hdr;
uint16_t vendor;
uint16_t vendor_id_source;
uint16_t product;
uint16_t version;
bool primary_record;
} bluetooth_sdp_dip_record;
typedef union {
bluetooth_sdp_hdr hdr;
bluetooth_sdp_raw_record raw;
bluetooth_sdp_mas_record mas;
bluetooth_sdp_mns_record mns;
bluetooth_sdp_pse_record pse;
bluetooth_sdp_pce_record pce;
bluetooth_sdp_ops_record ops;
bluetooth_sdp_sap_record sap;
bluetooth_sdp_dip_record dip;
bluetooth_sdp_hdr_overlay hdr;
bluetooth_sdp_raw_record raw;
bluetooth_sdp_mas_record mas;
bluetooth_sdp_mns_record mns;
bluetooth_sdp_pse_record pse;
bluetooth_sdp_pce_record pce;
bluetooth_sdp_ops_record ops;
bluetooth_sdp_sap_record sap;
bluetooth_sdp_dip_record dip;
} bluetooth_sdp_record;
#endif /* __BT_SDP_H__ */

View File

@ -91,11 +91,6 @@ static int get_sdp_record_size(bluetooth_sdp_record* in_record)
records_size = sizeof(bluetooth_sdp_record);
break;
case SDP_TYPE_RAW:
if (record->raw.user1_ptr != NULL) {
records_size += record->raw.user1_ptr_len;
}
/* fall through */
default:
records_size += sizeof(bluetooth_sdp_record);
records_size += record->hdr.service_name_length;
@ -254,12 +249,6 @@ static void copy_sdp_record_common(bluetooth_sdp_record* in_record, bluetooth_sd
*(free_ptr) = '\0'; // Set '\0' termination of string
free_ptr++;
}
if (in_record->hdr.type == SDP_TYPE_RAW && in_record->raw.user1_ptr != NULL) {
out_record->raw.user1_ptr = (UINT8 *)free_ptr; // Update pointer
memcpy(free_ptr, in_record->raw.user1_ptr, in_record->raw.user1_ptr_len); // Copy content
free_ptr += in_record->raw.user1_ptr_len;
}
}
static void copy_sdp_record(bluetooth_sdp_record* in_record, bluetooth_sdp_record* out_record)
@ -402,6 +391,7 @@ static int add_raw_sdp(const bluetooth_sdp_raw_record *rec)
UINT8 temp[LEN_UUID_128];
UINT8* p_temp = temp;
UINT32 sdp_handle = 0;
const esp_bt_uuid_t *p_uuid = &rec->hdr.uuid;
BTC_TRACE_DEBUG("%s(): scn 0x%02x, psm = 0x%04x\n service name %s", __func__,
rec->hdr.rfcomm_channel_number, rec->hdr.l2cap_psm, rec->hdr.service_name);
@ -411,15 +401,15 @@ static int add_raw_sdp(const bluetooth_sdp_raw_record *rec)
return sdp_handle;
}
if (rec->uuid.len == ESP_UUID_LEN_16) {
if (p_uuid->len == ESP_UUID_LEN_16) {
UINT8_TO_BE_STREAM (p_temp, (UUID_DESC_TYPE << 3) | SIZE_TWO_BYTES);
UINT16_TO_BE_STREAM (p_temp, rec->uuid.uuid.uuid16);
} else if (rec->uuid.len == ESP_UUID_LEN_32) {
UINT16_TO_BE_STREAM (p_temp, p_uuid->uuid.uuid16);
} else if (p_uuid->len == ESP_UUID_LEN_32) {
UINT8_TO_BE_STREAM (p_temp, (UUID_DESC_TYPE << 3) | SIZE_FOUR_BYTES);
UINT32_TO_BE_STREAM (p_temp, rec->uuid.uuid.uuid32);
} else if (rec->uuid.len == ESP_UUID_LEN_128) {
UINT32_TO_BE_STREAM (p_temp, p_uuid->uuid.uuid32);
} else if (p_uuid->len == ESP_UUID_LEN_128) {
UINT8_TO_BE_STREAM (p_temp, (UUID_DESC_TYPE << 3) | SIZE_SIXTEEN_BYTES);
ARRAY_TO_BE_STREAM (p_temp, rec->uuid.uuid.uuid128, LEN_UUID_128);
ARRAY_TO_BE_STREAM (p_temp, p_uuid->uuid.uuid128, LEN_UUID_128);
} else {
SDP_DeleteRecord(sdp_handle);
sdp_handle = 0;
@ -466,12 +456,12 @@ static int add_raw_sdp(const bluetooth_sdp_raw_record *rec)
sdp_handle = 0;
BTC_TRACE_ERROR("%s() FAILED, status = %d", __func__, status);
} else {
if (rec->uuid.len == ESP_UUID_LEN_16) {
bta_sys_add_uuid(rec->uuid.uuid.uuid16);
} else if (rec->uuid.len == ESP_UUID_LEN_32) {
bta_sys_add_uuid_32(rec->uuid.uuid.uuid32);
} else if (rec->uuid.len == ESP_UUID_LEN_128) {
bta_sys_add_uuid_128((UINT8 *)&rec->uuid.uuid.uuid128);
if (p_uuid->len == ESP_UUID_LEN_16) {
bta_sys_add_uuid(p_uuid->uuid.uuid16);
} else if (p_uuid->len == ESP_UUID_LEN_32) {
bta_sys_add_uuid_32(p_uuid->uuid.uuid32);
} else if (p_uuid->len == ESP_UUID_LEN_128) {
bta_sys_add_uuid_128((UINT8 *)&p_uuid->uuid.uuid128);
}
BTC_TRACE_DEBUG("%s(): SDP Registered (handle 0x%08x)", __func__, sdp_handle);
}
@ -943,7 +933,7 @@ static int btc_handle_create_record_event(int id)
switch (record->hdr.type) {
case SDP_TYPE_RAW:
sdp_handle = add_raw_sdp(&record->raw);
memcpy(&service_uuid, &record->raw.uuid, sizeof(esp_bt_uuid_t));
memcpy(&service_uuid, &record->hdr.uuid, sizeof(esp_bt_uuid_t));
break;
case SDP_TYPE_MAP_MAS:
sdp_handle = add_maps_sdp(&record->mas);
@ -1041,6 +1031,83 @@ static bool btc_sdp_remove_record_event(int id, int *p_sdp_handle)
return result;
}
static void btc_sdp_cb_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
{
switch (msg->act) {
case BTA_SDP_SEARCH_COMP_EVT: {
tBTA_SDP_SEARCH_COMP *src_search_comp = (tBTA_SDP_SEARCH_COMP *)p_src;
tBTA_SDP_SEARCH_COMP *dest_search_comp = (tBTA_SDP_SEARCH_COMP *)p_dest;
int record_count = src_search_comp->record_count;
for (int i = 0; i < record_count; i++) {
bluetooth_sdp_record *src_record = &src_search_comp->records[i];
bluetooth_sdp_record *dest_record = &dest_search_comp->records[i];
// deep copy service name
uint32_t src_service_name_length = src_record->hdr.service_name_length;
char *src_service_name = src_record->hdr.service_name;
dest_record->hdr.service_name_length = 0;
dest_record->hdr.service_name = NULL;
if (src_service_name && src_service_name_length) {
char *service_name = (char *)osi_malloc(src_service_name_length + 1);
if (service_name) {
memcpy(service_name, src_service_name, src_service_name_length);
service_name[src_service_name_length] = '\0';
dest_record->hdr.service_name_length = src_service_name_length;
dest_record->hdr.service_name = service_name;
} else {
BTC_TRACE_ERROR("%s malloc service name failed, orig service name:%s", __func__, src_service_name);
}
}
// deep copy user1_ptr fow RAW type
int src_user1_ptr_len = src_record->hdr.user1_ptr_len;
uint8_t *src_user1_ptr = src_record->hdr.user1_ptr;
dest_record->hdr.user1_ptr_len = 0;
dest_record->hdr.user1_ptr = NULL;
if (src_record->hdr.type == SDP_TYPE_RAW && src_user1_ptr && src_user1_ptr_len) {
uint8_t *user1_ptr = (uint8_t *)osi_malloc(src_user1_ptr_len);
if (user1_ptr) {
memcpy(user1_ptr, src_user1_ptr, src_user1_ptr_len);
dest_record->hdr.user1_ptr_len = src_user1_ptr_len;
dest_record->hdr.user1_ptr = user1_ptr;
} else {
BTC_TRACE_ERROR("%s malloc user1_ptr failed", __func__);
}
}
}
break;
}
default:
break;
}
}
static void btc_sdp_cb_arg_deep_free(btc_msg_t *msg)
{
switch (msg->act) {
case BTA_SDP_SEARCH_COMP_EVT: {
tBTA_SDP_SEARCH_COMP *search_comp = (tBTA_SDP_SEARCH_COMP *)msg->arg;
for (size_t i = 0; i < search_comp->record_count; i++) {
bluetooth_sdp_record *record = &search_comp->records[i];
if (record->hdr.service_name) {
osi_free(record->hdr.service_name);
}
if (record->hdr.user1_ptr) {
osi_free(record->hdr.user1_ptr);
}
}
break;
}
default:
break;
}
}
static void btc_sdp_dm_cback(tBTA_SDP_EVT event, tBTA_SDP* p_data, void* user_data)
{
btc_msg_t msg;
@ -1072,7 +1139,7 @@ static void btc_sdp_dm_cback(tBTA_SDP_EVT event, tBTA_SDP* p_data, void* user_da
msg.pid = BTC_PID_SDP;
msg.act = event;
status = btc_transfer_context(&msg, p_data, sizeof(tBTA_SDP), NULL, NULL);
status = btc_transfer_context(&msg, p_data, sizeof(tBTA_SDP), btc_sdp_cb_arg_deep_copy, btc_sdp_cb_arg_deep_free);
if (status != BT_STATUS_SUCCESS) {
BTC_TRACE_ERROR("%s btc_transfer_context failed", __func__);
@ -1244,11 +1311,10 @@ static void btc_sdp_search(btc_sdp_args_t *arg)
void btc_sdp_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
{
bluetooth_sdp_record **dst_record = &((btc_sdp_args_t *)p_dest)->create_record.record;
bluetooth_sdp_record *src_record = ((btc_sdp_args_t *)p_src)->create_record.record;
switch (msg->act) {
case BTC_SDP_ACT_CREATE_RECORD:
case BTC_SDP_ACT_CREATE_RECORD: {
bluetooth_sdp_record **dst_record = &((btc_sdp_args_t *)p_dest)->create_record.record;
bluetooth_sdp_record *src_record = ((btc_sdp_args_t *)p_src)->create_record.record;
bluetooth_sdp_record *record = (bluetooth_sdp_record *)osi_calloc(get_sdp_record_size(src_record));
if (record) {
copy_sdp_record(src_record, record);
@ -1259,6 +1325,7 @@ void btc_sdp_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
*dst_record = record;
break;
}
default:
break;
}
@ -1266,15 +1333,15 @@ void btc_sdp_arg_deep_copy(btc_msg_t *msg, void *p_dest, void *p_src)
void btc_sdp_arg_deep_free(btc_msg_t *msg)
{
btc_sdp_args_t *arg = (btc_sdp_args_t *)msg->arg;
bluetooth_sdp_record *record = arg->create_record.record;
switch (msg->act) {
case BTC_SDP_ACT_CREATE_RECORD:
case BTC_SDP_ACT_CREATE_RECORD: {
btc_sdp_args_t *arg = (btc_sdp_args_t *)msg->arg;
bluetooth_sdp_record *record = arg->create_record.record;
if (record) {
osi_free(record);
}
break;
}
default:
break;
}
@ -1331,23 +1398,11 @@ void btc_sdp_cb_handler(btc_msg_t *msg)
sdp_local_param.search_allowed = true;
param.search.status = p_data->sdp_search_comp.status;
if (param.search.status == ESP_SDP_SUCCESS) {
memcpy(param.search.remote_addr, p_data->sdp_search_comp.remote_addr, sizeof(BD_ADDR));
memcpy(&param.search.sdp_uuid, &p_data->sdp_search_comp.uuid, sizeof(tSDP_UUID));
param.search.record_count = p_data->sdp_search_comp.record_count;
param.search.records = osi_malloc(sizeof(esp_bluetooth_sdp_record_t)*p_data->sdp_search_comp.record_count);
if (param.search.records != NULL) {
memcpy(param.search.records, p_data->sdp_search_comp.records,
sizeof(esp_bluetooth_sdp_record_t)*p_data->sdp_search_comp.record_count);
} else {
BTC_TRACE_ERROR("%s %d osi_malloc failed\n", __func__, event);
param.search.status = ESP_SDP_NO_RESOURCE;
}
}
memcpy(param.search.remote_addr, p_data->sdp_search_comp.remote_addr, sizeof(BD_ADDR));
memcpy(&param.search.sdp_uuid, &p_data->sdp_search_comp.uuid, sizeof(tSDP_UUID));
param.search.record_count = p_data->sdp_search_comp.record_count;
param.search.records = (esp_bluetooth_sdp_record_t *)p_data->sdp_search_comp.records;
btc_sdp_cb_to_app(ESP_SDP_SEARCH_COMP_EVT, &param);
if (param.search.records != NULL) {
osi_free(param.search.records);
}
break;
case BTA_SDP_CREATE_RECORD_USER_EVT:
param.create_record.status = p_data->sdp_create_record.status;
@ -1372,6 +1427,8 @@ void btc_sdp_cb_handler(btc_msg_t *msg)
BTC_TRACE_DEBUG("%s: Unhandled event (%d)!", __func__, msg->act);
break;
}
btc_sdp_cb_arg_deep_free(msg);
}
#endif ///defined BTC_SDP_COMMON_INCLUDED && BTC_SDP_COMMON_INCLUDED == TRUE

View File

@ -1310,7 +1310,7 @@
#ifdef CONFIG_IDF_TARGET_ESP32
#define BTM_BLE_ADV_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
#else
#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
#define BTM_BLE_ADV_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 20}
#endif
#endif
@ -1318,7 +1318,7 @@
#ifdef CONFIG_IDF_TARGET_ESP32
#define BTM_TX_POWER {-12, -9, -6, -3, 0, 3, 6, 9}
#else
#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 21}
#define BTM_TX_POWER {-24, -21, -18, -15, -12, -9, -6, -3, 0, 3, 6, 9, 12, 15, 18, 20}
#endif
#endif

View File

@ -269,7 +269,7 @@ static void start_up(void)
#endif //#if (BLE_50_FEATURE_SUPPORT == TRUE)
#if (BLE_50_FEATURE_SUPPORT == TRUE && BLE_42_FEATURE_SUPPORT == FALSE)
if (HCI_LE_ENHANCED_PRIVACY_SUPPORTED(controller_param.features_ble.as_array)) {
if (HCI_LE_EXT_ADV_SUPPORTED(controller_param.features_ble.as_array)) {
response = AWAIT_COMMAND(controller_param.packet_factory->make_read_max_adv_data_len());
controller_param.packet_parser->parse_ble_read_adv_max_len_response(
response,

View File

@ -186,7 +186,9 @@ static void parse_ble_read_resolving_list_size_response(
{
uint8_t *stream = read_command_complete_header(response, HCI_BLE_READ_RESOLVING_LIST_SIZE, 1 /* bytes after */);
STREAM_TO_UINT8(*resolving_list_size_ptr, stream);
if (stream) {
STREAM_TO_UINT8(*resolving_list_size_ptr, stream);
}
osi_free(response);
}
@ -198,10 +200,14 @@ static void parse_ble_read_suggested_default_data_length_response(
{
uint8_t *stream = read_command_complete_header(response, HCI_BLE_READ_DEFAULT_DATA_LENGTH, 2 /* bytes after */);
STREAM_TO_UINT16(*ble_default_packet_length_ptr, stream);
STREAM_TO_UINT16(*ble_default_packet_txtime_ptr, stream);
if (stream) {
STREAM_TO_UINT16(*ble_default_packet_length_ptr, stream);
STREAM_TO_UINT16(*ble_default_packet_txtime_ptr, stream);
}
osi_free(response);
}
#if (BLE_50_FEATURE_SUPPORT == TRUE)
static void parse_ble_read_adv_max_len_response(
BT_HDR *response,
@ -209,8 +215,10 @@ static void parse_ble_read_adv_max_len_response(
{
uint8_t *stream = read_command_complete_header(response, HCI_BLE_RD_MAX_ADV_DATA_LEN, 1 /* bytes after */);
// Size: 2 Octets ; Value: 0x001F 0x0672 ; Maximum supported advertising data length
STREAM_TO_UINT16(*adv_max_len_ptr, stream);
if (stream) {
// Size: 2 Octets ; Value: 0x001F 0x0672 ; Maximum supported advertising data length
STREAM_TO_UINT16(*adv_max_len_ptr, stream);
}
osi_free(response);
}
@ -254,6 +262,7 @@ static uint8_t *read_command_complete_header(
STREAM_TO_UINT8(status, stream);
if (status != HCI_SUCCESS) {
HCI_TRACE_ERROR("%s failed: opcode 0x%04x, status 0x%02x", __func__, opcode, status);
return NULL;
}

View File

@ -1871,42 +1871,50 @@ typedef struct {
#define HCI_PING_SUPPORTED(x) ((x)[HCI_EXT_FEATURE_PING_OFF] & HCI_EXT_FEATURE_PING_MASK)
/*
** LE features encoding - page 0 (the only page for now)
** LE features encoding - page 0
*/
/* LE Encryption */
/* LE Encryption: bit 0 */
#define HCI_LE_FEATURE_LE_ENCRYPTION_MASK 0x01
#define HCI_LE_FEATURE_LE_ENCRYPTION_OFF 0
#define HCI_LE_ENCRYPTION_SUPPORTED(x) ((x)[HCI_LE_FEATURE_LE_ENCRYPTION_OFF] & HCI_LE_FEATURE_LE_ENCRYPTION_MASK)
/* Connection Parameters Request Procedure */
/* Connection Parameters Request Procedure: bit 1 */
#define HCI_LE_FEATURE_CONN_PARAM_REQ_MASK 0x02
#define HCI_LE_FEATURE_CONN_PARAM_REQ_OFF 0
#define HCI_LE_CONN_PARAM_REQ_SUPPORTED(x) ((x)[HCI_LE_FEATURE_CONN_PARAM_REQ_OFF] & HCI_LE_FEATURE_CONN_PARAM_REQ_MASK)
/* Extended Reject Indication */
/* Extended Reject Indication: bit 2 */
#define HCI_LE_FEATURE_EXT_REJ_IND_MASK 0x04
#define HCI_LE_FEATURE_EXT_REJ_IND_OFF 0
#define HCI_LE_EXT_REJ_IND_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_REJ_IND_OFF] & HCI_LE_FEATURE_EXT_REJ_IND_MASK)
/* Slave-initiated Features Exchange */
/* Slave-initiated Features Exchange: bit 3 */
#define HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_MASK 0x08
#define HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_OFF 0
#define HCI_LE_SLAVE_INIT_FEAT_EXC_SUPPORTED(x) ((x)[HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_OFF] & HCI_LE_FEATURE_SLAVE_INIT_FEAT_EXC_MASK)
/* LE Data Packet Length Extension: bit 5 */
#define HCI_LE_FEATURE_DATA_LEN_EXT_MASK 0x20
#define HCI_LE_FEATURE_DATA_LEN_EXT_OFF 0
#define HCI_LE_DATA_LEN_EXT_SUPPORTED(x) ((x)[HCI_LE_FEATURE_DATA_LEN_EXT_OFF] & HCI_LE_FEATURE_DATA_LEN_EXT_MASK)
/* Enhanced privacy Feature: bit 6 */
#define HCI_LE_FEATURE_ENHANCED_PRIVACY_MASK 0x40
#define HCI_LE_FEATURE_ENHANCED_PRIVACY_OFF 0
#define HCI_LE_ENHANCED_PRIVACY_SUPPORTED(x) ((x)[HCI_LE_FEATURE_ENHANCED_PRIVACY_OFF] & HCI_LE_FEATURE_ENHANCED_PRIVACY_MASK)
/* Extended scanner filter policy : 7 */
/* Extended scanner filter policy: bit 7 */
#define HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_MASK 0x80
#define HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_OFF 0
#define HCI_LE_EXT_SCAN_FILTER_POLICY_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_OFF] & HCI_LE_FEATURE_EXT_SCAN_FILTER_POLICY_MASK)
/* Slave-initiated Features Exchange */
#define HCI_LE_FEATURE_DATA_LEN_EXT_MASK 0x20
#define HCI_LE_FEATURE_DATA_LEN_EXT_OFF 0
#define HCI_LE_DATA_LEN_EXT_SUPPORTED(x) ((x)[HCI_LE_FEATURE_DATA_LEN_EXT_OFF] & HCI_LE_FEATURE_DATA_LEN_EXT_MASK)
/*
** LE features encoding - page 1
*/
/* LE Extended Advertising: bit 12 */
#define HCI_LE_FEATURE_EXT_ADV_MASK 0x10
#define HCI_LE_FEATURE_EXT_ADV_OFF 1
#define HCI_LE_EXT_ADV_SUPPORTED(x) ((x)[HCI_LE_FEATURE_EXT_ADV_OFF] & HCI_LE_FEATURE_EXT_ADV_MASK)
/*
** Local Supported Commands encoding

View File

@ -65,7 +65,7 @@ config BT_NIMBLE_LOG_LEVEL
config BT_NIMBLE_MAX_CONNECTIONS
int "Maximum number of concurrent connections"
range 1 2 if IDF_TARGET_ESP32C2
range 1 70 if IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C5
range 1 70 if IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32C5 || IDF_TARGET_ESP32C61
range 1 35 if IDF_TARGET_ESP32H2
range 1 9
default 2 if IDF_TARGET_ESP32C2

View File

@ -190,6 +190,11 @@ static void controller_rcv_pkt_ready(void)
}
}
static void dummy_controller_rcv_pkt_ready(void)
{
/* Dummy function */
}
void bt_record_hci_data(uint8_t *data, uint16_t len)
{
#if (BT_HCI_LOG_INCLUDED == TRUE)
@ -203,6 +208,12 @@ void bt_record_hci_data(uint8_t *data, uint16_t len)
#endif // (BT_HCI_LOG_INCLUDED == TRUE)
}
static int dummy_host_rcv_pkt(uint8_t *data, uint16_t len)
{
/* Dummy function */
return 0;
}
/*
* @brief: BT controller callback function, to transfer data packet to the host
*/
@ -264,6 +275,11 @@ static const esp_vhci_host_callback_t vhci_host_cb = {
.notify_host_recv = host_rcv_pkt,
};
static const esp_vhci_host_callback_t dummy_vhci_host_cb = {
.notify_host_send_available = dummy_controller_rcv_pkt_ready,
.notify_host_recv = dummy_host_rcv_pkt,
};
extern void ble_transport_init(void);
extern esp_err_t ble_buf_alloc(void);
@ -313,6 +329,8 @@ esp_err_t esp_nimble_hci_deinit(void)
}
ble_transport_deinit();
esp_vhci_host_register_callback(&dummy_vhci_host_cb);
ble_buf_free();
#if MYNEWT_VAL(BLE_QUEUE_CONG_CHECK)

@ -1 +1 @@
Subproject commit 6b890f81c0db10ae4757e27eb1312f4232d8fb56
Subproject commit 7e4f538a23591dfd361b90415eb517c6fc901a40

View File

@ -376,17 +376,18 @@ typedef enum {
ESP_PWR_LVL_N18 = 2, /*!< Corresponding to -18dbm */
ESP_PWR_LVL_N15 = 3, /*!< Corresponding to -15dbm */
ESP_PWR_LVL_N12 = 4, /*!< Corresponding to -12dbm */
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +21dbm */
ESP_PWR_LVL_N9 = 5, /*!< Corresponding to -9dbm */
ESP_PWR_LVL_N6 = 6, /*!< Corresponding to -6dbm */
ESP_PWR_LVL_N3 = 7, /*!< Corresponding to -3dbm */
ESP_PWR_LVL_N0 = 8, /*!< Corresponding to 0dbm */
ESP_PWR_LVL_P3 = 9, /*!< Corresponding to +3dbm */
ESP_PWR_LVL_P6 = 10, /*!< Corresponding to +6dbm */
ESP_PWR_LVL_P9 = 11, /*!< Corresponding to +9dbm */
ESP_PWR_LVL_P12 = 12, /*!< Corresponding to +12dbm */
ESP_PWR_LVL_P15 = 13, /*!< Corresponding to +15dbm */
ESP_PWR_LVL_P18 = 14, /*!< Corresponding to +18dbm */
ESP_PWR_LVL_P20 = 15, /*!< Corresponding to +20dbm */
ESP_PWR_LVL_P21 = 15, /*!< Corresponding to +20dbm, this enum variable has been deprecated */
ESP_PWR_LVL_INVALID = 0xFF, /*!< Indicates an invalid value */
} esp_power_level_t;

View File

@ -206,7 +206,9 @@ typedef struct {
uint8_t cca_drop_mode; /*!< CCA drop mode */
int8_t cca_low_tx_pwr; /*!< CCA low transmit power */
uint8_t main_xtal_freq; /*!< Main crystal frequency */
#if CONFIG_IDF_TARGET_ESP32C6
uint32_t version_num; /*!< Controller configuration version number */
#endif //CONFIG_IDF_TARGET_ESP32C6
uint8_t cpu_freq_mhz; /*!< CPU frequency in megahertz (MHz) */
uint8_t ignore_wl_for_direct_adv; /*!< Ignore the whitelist for direct advertising */
uint8_t enable_pcl; /*!< Enable power control */
@ -214,6 +216,7 @@ typedef struct {
uint32_t config_magic; /*!< Magic number for configuration validation */
} esp_bt_controller_config_t;
#if CONFIG_IDF_TARGET_ESP32C6
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
.config_version = CONFIG_VERSION, \
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
@ -261,6 +264,54 @@ typedef struct {
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
.config_magic = CONFIG_MAGIC, \
}
#elif CONFIG_IDF_TARGET_ESP32C61
#define BT_CONTROLLER_INIT_CONFIG_DEFAULT() { \
.config_version = CONFIG_VERSION, \
.ble_ll_resolv_list_size = CONFIG_BT_LE_LL_RESOLV_LIST_SIZE, \
.ble_hci_evt_hi_buf_count = DEFAULT_BT_LE_HCI_EVT_HI_BUF_COUNT, \
.ble_hci_evt_lo_buf_count = DEFAULT_BT_LE_HCI_EVT_LO_BUF_COUNT, \
.ble_ll_sync_list_cnt = DEFAULT_BT_LE_MAX_PERIODIC_ADVERTISER_LIST, \
.ble_ll_sync_cnt = DEFAULT_BT_LE_MAX_PERIODIC_SYNCS, \
.ble_ll_rsp_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
.ble_ll_adv_dup_list_count = CONFIG_BT_LE_LL_DUP_SCAN_LIST_COUNT, \
.ble_ll_tx_pwr_dbm = BLE_LL_TX_PWR_DBM_N, \
.rtc_freq = RTC_FREQ_N, \
.ble_ll_sca = CONFIG_BT_LE_LL_SCA, \
.ble_ll_scan_phy_number = BLE_LL_SCAN_PHY_NUMBER_N, \
.ble_ll_conn_def_auth_pyld_tmo = BLE_LL_CONN_DEF_AUTH_PYLD_TMO_N, \
.ble_ll_jitter_usecs = BLE_LL_JITTER_USECS_N, \
.ble_ll_sched_max_adv_pdu_usecs = BLE_LL_SCHED_MAX_ADV_PDU_USECS_N, \
.ble_ll_sched_direct_adv_max_usecs = BLE_LL_SCHED_DIRECT_ADV_MAX_USECS_N, \
.ble_ll_sched_adv_max_usecs = BLE_LL_SCHED_ADV_MAX_USECS_N, \
.ble_scan_rsp_data_max_len = DEFAULT_BT_LE_SCAN_RSP_DATA_MAX_LEN_N, \
.ble_ll_cfg_num_hci_cmd_pkts = BLE_LL_CFG_NUM_HCI_CMD_PKTS_N, \
.ble_ll_ctrl_proc_timeout_ms = BLE_LL_CTRL_PROC_TIMEOUT_MS_N, \
.nimble_max_connections = DEFAULT_BT_LE_MAX_CONNECTIONS, \
.ble_whitelist_size = DEFAULT_BT_NIMBLE_WHITELIST_SIZE, \
.ble_acl_buf_size = DEFAULT_BT_LE_ACL_BUF_SIZE, \
.ble_acl_buf_count = DEFAULT_BT_LE_ACL_BUF_COUNT, \
.ble_hci_evt_buf_size = DEFAULT_BT_LE_HCI_EVT_BUF_SIZE, \
.ble_multi_adv_instances = DEFAULT_BT_LE_MAX_EXT_ADV_INSTANCES, \
.ble_ext_adv_max_size = DEFAULT_BT_LE_EXT_ADV_MAX_SIZE, \
.controller_task_stack_size = NIMBLE_LL_STACK_SIZE, \
.controller_task_prio = ESP_TASK_BT_CONTROLLER_PRIO, \
.controller_run_cpu = 0, \
.enable_qa_test = RUN_QA_TEST, \
.enable_bqb_test = RUN_BQB_TEST, \
.enable_tx_cca = DEFAULT_BT_LE_TX_CCA_ENABLED, \
.cca_rssi_thresh = 256 - DEFAULT_BT_LE_CCA_RSSI_THRESH, \
.sleep_en = NIMBLE_SLEEP_ENABLE, \
.coex_phy_coded_tx_rx_time_limit = DEFAULT_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EFF, \
.dis_scan_backoff = NIMBLE_DISABLE_SCAN_BACKOFF, \
.ble_scan_classify_filter_enable = 1, \
.main_xtal_freq = CONFIG_XTAL_FREQ, \
.cpu_freq_mhz = CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ, \
.ignore_wl_for_direct_adv = 0, \
.enable_pcl = DEFAULT_BT_LE_POWER_CONTROL_ENABLED, \
.csa2_select = DEFAULT_BT_LE_50_FEATURE_SUPPORT, \
.config_magic = CONFIG_MAGIC, \
}
#endif
/**
* @brief Initialize BT controller to allocate task and other resource.

View File

@ -28,6 +28,16 @@ typedef enum {
COEX_SCHM_CALLBACK_TYPE_I154,
} coex_schm_callback_type_t;
typedef enum {
COEX_SCHM_ST_TYPE_WIFI = 0,
COEX_SCHM_ST_TYPE_BLE,
COEX_SCHM_ST_TYPE_BT,
} coex_schm_st_type_t;
#define COEX_STATUS_GET_WIFI_BITMAP (1 << COEX_SCHM_ST_TYPE_WIFI)
#define COEX_STATUS_GET_BLE_BITMAP (1 << COEX_SCHM_ST_TYPE_BLE)
#define COEX_STATUS_GET_BT_BITMAP (1 << COEX_SCHM_ST_TYPE_BT)
typedef void (* coex_func_cb_t)(uint32_t event, int sched_cnt);
typedef esp_err_t (* coex_set_lpclk_source_callback_t)(void);
typedef void (* coex_wifi_channel_change_cb_t)(uint8_t primary, uint8_t secondary);
@ -94,9 +104,11 @@ esp_err_t coex_preference_set(coex_prefer_t prefer);
/**
* @brief Get software coexist status.
*
* @param bitmap : bitmap of the module getting status.
* @return : software coexist status
*/
uint32_t coex_status_get(void);
uint32_t coex_status_get(uint8_t bitmap);
/**
* @brief WiFi requests coexistence.

@ -1 +1 @@
Subproject commit bf7cda7b17a4fd22c123d39748565a68c021e562
Subproject commit e15e7a161fc1a48e8fb4fd0b3da74623c30ba1cb

View File

@ -283,7 +283,7 @@ esp_err_t rmt_new_rx_channel(const rmt_rx_channel_config_t *config, rmt_channel_
ESP_LOGW(TAG, "channel resolution loss, real=%"PRIu32, rx_channel->base.resolution_hz);
}
rx_channel->filter_clock_resolution_hz = group->resolution_hz;
rx_channel->filter_clock_resolution_hz = rx_channel->base.resolution_hz;
// On esp32 and esp32s2, the counting clock used by the RX filter always comes from APB clock
// no matter what the clock source is used by the RMT channel as the "core" clock
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S2

View File

@ -239,6 +239,21 @@ esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, es
int esp_https_ota_get_image_len_read(esp_https_ota_handle_t https_ota_handle);
/**
* @brief This function returns the HTTP status code of the last HTTP response.
*
* @note This API should be called only after esp_https_ota_begin() has been called.
* This can be used to check the HTTP status code of the OTA download process.
*
* @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure
*
* @return
* - -1 On failure
* - HTTP status code
*/
int esp_https_ota_get_status_code(esp_https_ota_handle_t https_ota_handle);
/**
* @brief This function returns OTA image total size.
*

View File

@ -724,6 +724,15 @@ esp_err_t esp_https_ota_abort(esp_https_ota_handle_t https_ota_handle)
return err;
}
int esp_https_ota_get_status_code(esp_https_ota_handle_t https_ota_handle)
{
esp_https_ota_t *handle = (esp_https_ota_t *) https_ota_handle;
if (handle == NULL || handle->http_client == NULL) {
return -1;
}
return esp_http_client_get_status_code(handle->http_client);
}
int esp_https_ota_get_image_len_read(esp_https_ota_handle_t https_ota_handle)
{
esp_https_ota_t *handle = (esp_https_ota_t *)https_ota_handle;

View File

@ -21,7 +21,7 @@
#include "sdkconfig.h"
#include "esp_pmu.h"
#if SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE && CONFIG_IDF_TARGET_ESP32C5 // TODO: PM-202
#if SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE
#include "soc/pmu_reg.h" // for PMU_DATE_REG, it can provide full 32 bit read and write access
#endif
#if SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
@ -506,7 +506,7 @@ static esp_err_t sleep_retention_entries_create_impl(const sleep_retention_entri
return ESP_ERR_NOT_SUPPORTED;
}
#endif
#if SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE && CONFIG_IDF_TARGET_ESP32C5 // TODO: PM-202
#if SOC_PM_PAU_REGDMA_UPDATE_CACHE_BEFORE_WAIT_COMPARE
/* There is a bug in REGDMA wait mode, when two wait nodes need to wait for the
* same value (_val & _mask), the second wait node will immediately return to
* wait done, The reason is that the wait mode comparison output logic immediate

View File

@ -134,8 +134,8 @@ static void s_reserve_irom_region(mem_region_t *hw_mem_regions, int region_nums)
* - Now IBUS addresses (between `_instruction_reserved_start` and `_instruction_reserved_end`) are consecutive on all chips,
* we strongly rely on this to calculate the .text length
*/
extern int _instruction_reserved_start;
extern int _instruction_reserved_end;
extern char _instruction_reserved_start;
extern char _instruction_reserved_end;
size_t irom_len_to_reserve = (uint32_t)&_instruction_reserved_end - (uint32_t)&_instruction_reserved_start;
assert((mmu_ll_vaddr_to_laddr((uint32_t)&_instruction_reserved_end) - mmu_ll_vaddr_to_laddr((uint32_t)&_instruction_reserved_start)) == irom_len_to_reserve);
@ -162,8 +162,8 @@ static void s_reserve_drom_region(mem_region_t *hw_mem_regions, int region_nums)
/**
* Similarly, we follow the way how 1st bootloader load flash .rodata:
*/
extern int _rodata_reserved_start;
extern int _rodata_reserved_end;
extern char _rodata_reserved_start;
extern char _rodata_reserved_end;
size_t drom_len_to_reserve = (uint32_t)&_rodata_reserved_end - (uint32_t)&_rodata_reserved_start;
assert((mmu_ll_vaddr_to_laddr((uint32_t)&_rodata_reserved_end) - mmu_ll_vaddr_to_laddr((uint32_t)&_rodata_reserved_start)) == drom_len_to_reserve);

View File

@ -1174,8 +1174,8 @@ hal_set_sta_tbtt = 0x40001e4c;
pm_set_sleep_type = 0x40001e54;
pm_tx_null_data_done_process = 0x40001eb0;
//pm_tx_data_process = 0x40001eb4;
pm_attach = 0x40001eb8;
pm_coex_schm_process = 0x40001ebc;
/*pm_attach = 0x40001eb8;*/
/*pm_coex_schm_process = 0x40001ebc;*/
pm_on_probe_resp_rx = 0x40001ecc;
pm_send_probe_stop = 0x40001edc;
hal_sniffer_rx_set_promis = 0x40001ef4;

View File

@ -1903,7 +1903,7 @@ coex_hw_timer_set = 0x4000219c;
coex_schm_interval_set = 0x400021a0;
coex_schm_lock = 0x400021a4;
coex_schm_unlock = 0x400021a8;
coex_status_get = 0x400021ac;
/*coex_status_get = 0x400021ac;*/
coex_wifi_release = 0x400021b0;
esp_coex_ble_conn_dynamic_prio_get = 0x400021b4;
/*coex_hw_timer_tick_get = 0x400021b8;*/

View File

@ -1772,7 +1772,7 @@ coex_hw_timer_set = 0x400018e0;
coex_schm_interval_set = 0x400018e4;
coex_schm_lock = 0x400018e8;
coex_schm_unlock = 0x400018ec;
coex_status_get = 0x400018f0;
/*coex_status_get = 0x400018f0;*/
coex_wifi_release = 0x400018f4;
esp_coex_ble_conn_dynamic_prio_get = 0x400018f8;
/* Data (.data, .bss, .rodata) */

View File

@ -35,7 +35,7 @@ coex_hw_timer_set = 0x40000afc;
coex_schm_interval_set = 0x40000b00;
coex_schm_lock = 0x40000b04;
coex_schm_unlock = 0x40000b08;
coex_status_get = 0x40000b0c;
/*coex_status_get = 0x40000b0c;*/
coex_wifi_release = 0x40000b10;
esp_coex_ble_conn_dynamic_prio_get = 0x40000b14;
/* Data (.data, .bss, .rodata) */

View File

@ -35,7 +35,7 @@ coex_hw_timer_set = 0x40000b30;
coex_schm_interval_set = 0x40000b34;
coex_schm_lock = 0x40000b38;
coex_schm_unlock = 0x40000b3c;
coex_status_get = 0x40000b40;
/*coex_status_get = 0x40000b40;*/
coex_wifi_release = 0x40000b44;
esp_coex_ble_conn_dynamic_prio_get = 0x40000b48;
/* Data (.data, .bss, .rodata) */

View File

@ -35,7 +35,7 @@ coex_hw_timer_set = 0x40000a64;
coex_schm_interval_set = 0x40000a68;
coex_schm_lock = 0x40000a6c;
coex_schm_unlock = 0x40000a70;
coex_status_get = 0x40000a74;
/*coex_status_get = 0x40000a74;*/
coex_wifi_release = 0x40000a78;
esp_coex_ble_conn_dynamic_prio_get = 0x40000a7c;
/* Data (.data, .bss, .rodata) */

View File

@ -2058,7 +2058,7 @@ coex_hw_timer_set = 0x40005c04;
coex_schm_interval_set = 0x40005c10;
coex_schm_lock = 0x40005c1c;
coex_schm_unlock = 0x40005c28;
coex_status_get = 0x40005c34;
/*coex_status_get = 0x40005c34;*/
coex_wifi_release = 0x40005c40;
esp_coex_ble_conn_dynamic_prio_get = 0x40005c4c;
/* Data (.data, .bss, .rodata) */

View File

@ -452,7 +452,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -389,7 +389,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -406,7 +406,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -464,7 +464,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -395,7 +395,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -464,7 +464,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -443,7 +443,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

View File

@ -460,7 +460,7 @@ static void coex_disable_wrapper(void)
static IRAM_ATTR uint32_t coex_status_get_wrapper(void)
{
#if CONFIG_SW_COEXIST_ENABLE || CONFIG_EXTERNAL_COEX_ENABLE
return coex_status_get();
return coex_status_get(COEX_STATUS_GET_WIFI_BITMAP);
#else
return 0;
#endif

@ -1 +1 @@
Subproject commit 473674948f178962fefd7f7b1df7ebc9cc59a98a
Subproject commit efa80057b04ade8b1412a0dedcb5572d6ccd1fcc

View File

@ -441,7 +441,7 @@ rtos_current_tcb:
lw a0, pxCurrentTCBs
#endif /* ( configNUM_CORES > 1 ) */
ret
.size, .-rtos_current_tcb
.size rtos_current_tcb, .-rtos_current_tcb
/**

View File

@ -5,9 +5,6 @@ components/freertos/test_apps/freertos:
- if: CONFIG_NAME == "smp" and IDF_TARGET == "esp32p4"
temporary: true
reason: target(s) not supported yet
- if: IDF_TARGET in ["esp32c61"]
temporary: true
reason: target(s) not supported yet # TODO: [esp32c61] IDF-9280
disable_test:
- if: CONFIG_NAME == "smp" and IDF_TARGET == "esp32c5"
temporary: true

View File

@ -1,2 +1,2 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- |

View File

@ -7,22 +7,15 @@ from pytest_embedded import Dut
CONFIGS = [
pytest.param('default', marks=[
pytest.mark.supported_targets,
# TODO [ESP32C61] IDF-10988
pytest.mark.temp_skip_ci(targets=['esp32h2', 'esp32c61'], reason='test failed')
pytest.mark.temp_skip_ci(targets=['esp32h2'], reason='test failed')
]),
pytest.param('freertos_options', marks=[
pytest.mark.supported_targets,
# TODO [ESP32C61] IDF-10988
pytest.mark.temp_skip_ci(targets=['esp32h2', 'esp32c61'], reason='test failed')]),
pytest.mark.temp_skip_ci(targets=['esp32h2'], reason='test failed')]),
pytest.param('psram', marks=[pytest.mark.esp32]),
pytest.param('release', marks=[
pytest.mark.supported_targets,
# TODO [ESP32C61] IDF-10988
pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='support TBD'),
]),
pytest.param('single_core', marks=[pytest.mark.esp32, pytest.mark.esp32p4]),
# TODO: [ESP32C5] IDF-10335
# TODO [ESP32C61] IDF-10988
# TODO: [ESP32C61] IDF-11146
pytest.param('smp', marks=[
pytest.mark.supported_targets,
pytest.mark.temp_skip_ci(targets=['esp32h2', 'esp32p4', 'esp32c5', 'esp32c61'],
@ -38,7 +31,6 @@ def test_freertos(dut: Dut) -> None:
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='support TBD') # TODO [ESP32C61] IDF-10988
@pytest.mark.generic
@pytest.mark.parametrize('config', ['freertos_options'], indirect=True)
def test_task_notify_too_high_index_fails(dut: Dut) -> None:
@ -50,7 +42,6 @@ def test_task_notify_too_high_index_fails(dut: Dut) -> None:
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='support TBD') # TODO [ESP32C61] IDF-10988
@pytest.mark.generic
@pytest.mark.parametrize('config', ['freertos_options'], indirect=True)
def test_task_notify_wait_too_high_index_fails(dut: Dut) -> None:
@ -62,7 +53,6 @@ def test_task_notify_wait_too_high_index_fails(dut: Dut) -> None:
@pytest.mark.supported_targets
@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='support TBD') # TODO [ESP32C61] IDF-10988
@pytest.mark.generic
@pytest.mark.parametrize('config', ['default'], indirect=True)
def test_port_must_assert_in_isr(dut: Dut) -> None:

View File

@ -21,7 +21,14 @@
#if ( SOC_CPU_COPROC_NUM > 0 )
/* Targets with coprocessors present a special CSR to get Illegal Instruction exception reason */
#ifdef __clang__
/* Clang does not support constant declared via `equ` as operand for csrrw
* TODO: LLVM-369
*/
#define EXT_ILL_CSR 0x7F0
#else
.equ EXT_ILL_CSR, 0x7F0
#endif
/* EXT_ILL CSR reasons are stored as follows:
* - Bit 0: FPU core instruction (Load/Store instructions NOT concerned)
@ -167,7 +174,6 @@ _panic_handler:
la ra, _return_from_exception
/* EXT_ILL CSR should contain the reason for the Illegal Instruction */
csrrw a0, EXT_ILL_CSR, zero
/* Hardware loop cannot be treated lazily, so we should never end here if a HWLP instruction is used */
#if SOC_CPU_HAS_PIE
/* Check if the PIE bit is set. */

View File

@ -23,6 +23,10 @@ config SOC_GPTIMER_SUPPORTED
bool
default y
config SOC_BT_SUPPORTED
bool
default y
config SOC_USB_SERIAL_JTAG_SUPPORTED
bool
default y
@ -855,6 +859,38 @@ config SOC_WIFI_MAC_VERSION_NUM
int
default 3
config SOC_BLE_SUPPORTED
bool
default y
config SOC_ESP_NIMBLE_CONTROLLER
bool
default y
config SOC_BLE_50_SUPPORTED
bool
default y
config SOC_BLE_DEVICE_PRIVACY_SUPPORTED
bool
default y
config SOC_BLE_POWER_CONTROL_SUPPORTED
bool
default y
config SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED
bool
default y
config SOC_BLUFI_SUPPORTED
bool
default y
config SOC_BLE_MULTI_CONN_OPTIMIZATION
bool
default y
config SOC_PHY_COMBO_MODULE
bool
default y

View File

@ -23,7 +23,7 @@
#define SOC_GDMA_SUPPORTED 1
#define SOC_AHB_GDMA_SUPPORTED 1
#define SOC_GPTIMER_SUPPORTED 1
// \#define SOC_BT_SUPPORTED 1
#define SOC_BT_SUPPORTED 1
// \#define SOC_IEEE802154_SUPPORTED 1
#define SOC_USB_SERIAL_JTAG_SUPPORTED 1
#define SOC_ASYNC_MEMCPY_SUPPORTED 1
@ -461,17 +461,15 @@
#define SOC_WIFI_MAC_VERSION_NUM (3) /*!< Wi-Fi MAC version num is 3 */
/*---------------------------------- Bluetooth CAPS ----------------------------------*/
// \#define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */
// \#define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */
// \#define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */
// \#define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */
// \#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */
// \#define SOC_BLE_POWER_CONTROL_SUPPORTED (1) /*!< Support Bluetooth Power Control */
// \#define SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED (1) /*!< Support For BLE Periodic Adv Enhancements */
// \#define SOC_BLUFI_SUPPORTED (1) /*!< Support BLUFI */
// \#define SOC_BLE_MULTI_CONN_OPTIMIZATION (1) /*!< Support multiple connections optimization */
// \#define SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND (1)
#define SOC_BLE_SUPPORTED (1) /*!< Support Bluetooth Low Energy hardware */
// #define SOC_BLE_MESH_SUPPORTED (1) /*!< Support BLE MESH */
#define SOC_ESP_NIMBLE_CONTROLLER (1) /*!< Support BLE EMBEDDED controller V1 */
#define SOC_BLE_50_SUPPORTED (1) /*!< Support Bluetooth 5.0 */
#define SOC_BLE_DEVICE_PRIVACY_SUPPORTED (1) /*!< Support BLE device privacy mode */
#define SOC_BLE_POWER_CONTROL_SUPPORTED (1) /*!< Support Bluetooth Power Control */
#define SOC_BLE_PERIODIC_ADV_ENH_SUPPORTED (1) /*!< Support For BLE Periodic Adv Enhancements */
#define SOC_BLUFI_SUPPORTED (1) /*!< Support BLUFI */
#define SOC_BLE_MULTI_CONN_OPTIMIZATION (1) /*!< Support multiple connections optimization */
/*------------------------------------- PHY CAPS -------------------------------------*/
#define SOC_PHY_COMBO_MODULE (1) /*!< Support Wi-Fi, BLE and 15.4*/

View File

@ -174,9 +174,7 @@
#define SOC_CPU_HAS_FPU_EXT_ILL_BUG 1 // EXT_ILL CSR doesn't support FLW/FSW
#define SOC_CPU_HAS_HWLOOP 1
/* PIE coprocessor assembly is only supported with GCC compiler */
#ifndef __clang__
#define SOC_CPU_HAS_PIE 1
#endif
#define SOC_HP_CPU_HAS_MULTIPLE_CORES 1 // Convenience boolean macro used to determine if a target has multiple cores.

View File

@ -270,38 +270,6 @@ uint32_t spi_flash_mmap_get_free_pages(spi_flash_mmap_memory_t memory)
return len / CONFIG_MMU_PAGE_SIZE;
}
const void * spi_flash_phys2cache(size_t phys_offs, spi_flash_mmap_memory_t memory)
{
esp_err_t ret = ESP_FAIL;
void *ptr = NULL;
mmu_target_t target = MMU_TARGET_FLASH0;
__attribute__((unused)) uint32_t phys_page = phys_offs / CONFIG_MMU_PAGE_SIZE;
#if !CONFIG_SPIRAM_FLASH_LOAD_TO_PSRAM
#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS
if (phys_page >= instruction_flash_start_page_get() && phys_page <= instruction_flash_end_page_get()) {
target = MMU_TARGET_PSRAM0;
phys_offs -= instruction_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE;
}
#endif
#if CONFIG_SPIRAM_RODATA
if (phys_page >= rodata_flash_start_page_get() && phys_page <= rodata_flash_start_page_get()) {
target = MMU_TARGET_PSRAM0;
phys_offs -= rodata_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE;
}
#endif
#endif //#if !CONFIG_SPIRAM_FLASH_LOAD_TO_PSRAM
mmu_vaddr_t type = (memory == SPI_FLASH_MMAP_DATA) ? MMU_VADDR_DATA : MMU_VADDR_INSTRUCTION;
ret = esp_mmu_paddr_to_vaddr(phys_offs, target, type, &ptr);
if (ret == ESP_ERR_NOT_FOUND) {
return NULL;
}
assert(ret == ESP_OK);
return (const void *)ptr;
}
static bool IRAM_ATTR is_page_mapped_in_cache(uint32_t phys_addr, const void **out_ptr)
{
*out_ptr = NULL;
@ -398,4 +366,36 @@ size_t spi_flash_cache2phys(const void *cached)
return paddr + offset * CONFIG_MMU_PAGE_SIZE;
}
const void * spi_flash_phys2cache(size_t phys_offs, spi_flash_mmap_memory_t memory)
{
esp_err_t ret = ESP_FAIL;
void *ptr = NULL;
mmu_target_t target = MMU_TARGET_FLASH0;
__attribute__((unused)) uint32_t phys_page = phys_offs / CONFIG_MMU_PAGE_SIZE;
#if !CONFIG_SPIRAM_FLASH_LOAD_TO_PSRAM
#if CONFIG_SPIRAM_FETCH_INSTRUCTIONS
if (phys_page >= instruction_flash_start_page_get() && phys_page <= instruction_flash_end_page_get()) {
target = MMU_TARGET_PSRAM0;
phys_offs -= instruction_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE;
}
#endif
#if CONFIG_SPIRAM_RODATA
if (phys_page >= rodata_flash_start_page_get() && phys_page <= rodata_flash_start_page_get()) {
target = MMU_TARGET_PSRAM0;
phys_offs -= rodata_flash2spiram_offset() * CONFIG_MMU_PAGE_SIZE;
}
#endif
#endif //#if !CONFIG_SPIRAM_FLASH_LOAD_TO_PSRAM
mmu_vaddr_t type = (memory == SPI_FLASH_MMAP_DATA) ? MMU_VADDR_DATA : MMU_VADDR_INSTRUCTION;
ret = esp_mmu_paddr_to_vaddr(phys_offs, target, type, &ptr);
if (ret == ESP_ERR_NOT_FOUND) {
return NULL;
}
assert(ret == ESP_OK);
return (const void *)ptr;
}
#endif //!CONFIG_SPI_FLASH_ROM_IMPL || CONFIG_SPIRAM_FETCH_INSTRUCTIONS || CONFIG_SPIRAM_RODATA

View File

@ -30,6 +30,11 @@ components/spi_flash/test_apps/flash_mmap:
depends_components:
- esp_mm
- spi_flash
enable:
- if: CONFIG_NAME in ["release", "rom_impl"] and IDF_TARGET != "linux"
- if: CONFIG_NAME == "xip_psram" and IDF_TARGET in ["esp32s2", "esp32s3", "esp32p4"]
# S2 doesn't have ROM for flash
- if: CONFIG_NAME == "xip_psram_with_rom_impl" and IDF_TARGET in ["esp32s3", "esp32p4"]
components/spi_flash/test_apps/flash_suspend:
disable:

View File

@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include "esp_log.h"
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
#include <freertos/semphr.h>
@ -517,3 +518,14 @@ TEST_CASE("no stale data read post mmap and write partition", "[spi_flash][mmap]
TEST_ASSERT_EQUAL(0, memcmp(buf, read_data, sizeof(buf)));
#endif
}
TEST_CASE("spi_flash_cache2phys points to correct address", "[spi_flash]")
{
//_rodata_start, which begins with appdesc, is always the first segment of the bin.
extern int _rodata_start;
size_t addr = spi_flash_cache2phys(&_rodata_start);
const esp_partition_t *factory = esp_partition_find_first(ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, "factory");
ESP_LOGI("running bin", "0x%p", (void*)addr);
TEST_ASSERT_HEX32_WITHIN(CONFIG_MMU_PAGE_SIZE/2, factory->address + CONFIG_MMU_PAGE_SIZE/2, addr);
}

View File

@ -1,5 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, 0x9000, 0x6000,
factory, 0, 0, 0x10000, 1M
flash_test, data, fat, , 528K
flash_test, data, fat, 0x10000, 528K
# This partition is placed to this weird address intentionally to test spi_flash_cache2phys
factory, 0, 0, 0xF0000, 1M

1 # Name, Type, SubType, Offset, Size, Flags
2 # Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
3 nvs, data, nvs, 0x9000, 0x6000,
4 factory, 0, 0, 0x10000, 1M flash_test, data, fat, 0x10000, 528K
5 flash_test, data, fat, , 528K # This partition is placed to this weird address intentionally to test spi_flash_cache2phys
6 factory, 0, 0, 0xF0000, 1M

View File

@ -34,21 +34,20 @@ def test_flash_mmap_rom_impl(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=30)
XIP_CONFIGS = [
pytest.param('xip_psram_esp32s2', marks=[pytest.mark.esp32s2]),
pytest.param('xip_psram_esp32s3', marks=[pytest.mark.esp32s3]),
pytest.param('xip_psram_esp32c5', marks=[pytest.mark.esp32c5]),
pytest.param('xip_psram_esp32c61', marks=[pytest.mark.esp32c61]),
]
@pytest.mark.supported_targets
@pytest.mark.generic
@pytest.mark.parametrize('config', XIP_CONFIGS, indirect=True)
@pytest.mark.parametrize(
'config',
[
'xip_psram',
],
indirect=True,
)
def test_flash_mmap_xip_psram(dut: Dut) -> None:
dut.run_all_single_board_cases(timeout=30)
@pytest.mark.esp32s3
@pytest.mark.supported_targets
@pytest.mark.generic
@pytest.mark.parametrize(
'config',

View File

@ -1,2 +1,2 @@
CONFIG_IDF_TARGET="esp32c61"
CONFIG_SPIRAM=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y

View File

@ -1,3 +0,0 @@
CONFIG_IDF_TARGET="esp32s2"
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y

View File

@ -1,3 +0,0 @@
CONFIG_IDF_TARGET="esp32s3"
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y

View File

@ -1,4 +1,3 @@
CONFIG_IDF_TARGET="esp32s3"
CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y
CONFIG_SPIRAM_RODATA=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_SPI_FLASH_ROM_IMPL=y

View File

@ -504,7 +504,7 @@ static int ws_read_header(esp_transport_handle_t t, char *buffer, int len, int t
ESP_LOGE(TAG, "Error read data");
return rlen;
}
payload_len = data_ptr[0] << 8 | data_ptr[1];
payload_len = (uint8_t)data_ptr[0] << 8 | (uint8_t)data_ptr[1];
} else if (payload_len == 127) {
// headerLen += 8;
header = 8;
@ -517,7 +517,7 @@ static int ws_read_header(esp_transport_handle_t t, char *buffer, int len, int t
// really too big!
payload_len = 0xFFFFFFFF;
} else {
payload_len = data_ptr[4] << 24 | data_ptr[5] << 16 | data_ptr[6] << 8 | data_ptr[7];
payload_len = (uint8_t)data_ptr[4] << 24 | (uint8_t)data_ptr[5] << 16 | (uint8_t)data_ptr[6] << 8 | data_ptr[7];
}
}

View File

@ -691,8 +691,10 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, int reply_on_fail)
enum mbo_transition_reject_reason reason =
MBO_TRANSITION_REJECT_REASON_UNSPECIFIED;
if (!wpa_s->wnm_neighbor_report_elements)
if (!wpa_s->wnm_neighbor_report_elements) {
wpa_printf(MSG_INFO, "WNM: Neighbor report not available");
return 0;
}
wpa_dbg(wpa_s, MSG_DEBUG,
"WNM: Process scan results for BSS Transition Management");
@ -706,7 +708,7 @@ int wnm_scan_process(struct wpa_supplicant *wpa_s, int reply_on_fail)
/* Compare the Neighbor Report and scan results */
bss = compare_scan_neighbor_results(wpa_s, 0, &reason);
if (!bss) {
wpa_printf(MSG_DEBUG, "WNM: No BSS transition candidate match found");
wpa_printf(MSG_INFO, "WNM: No BSS transition candidate match found");
status = WNM_BSS_TM_REJECT_NO_SUITABLE_CANDIDATES;
goto send_bss_resp_fail;
}

View File

@ -3,16 +3,6 @@ api-guides/performance/speed.rst
api-guides/performance/size.rst
api-guides/performance/ram-usage.rst
api-guides/performance/index.rst
api-guides/jtag-debugging/debugging-examples.rst
api-guides/jtag-debugging/configure-ft2232h-jtag.rst
api-guides/jtag-debugging/tips-and-quirks.rst
api-guides/jtag-debugging/using-debugger.rst
api-guides/jtag-debugging/building-openocd-macos.rst
api-guides/jtag-debugging/building-openocd-linux.rst
api-guides/jtag-debugging/configure-other-jtag.rst
api-guides/jtag-debugging/building-openocd-windows.rst
api-guides/jtag-debugging/index.rst
api-guides/jtag-debugging/configure-builtin-jtag.rst
api-guides/phy.rst
api-guides/app_trace.rst
api-guides/low-power-mode.rst
@ -115,7 +105,6 @@ api-reference/system/mm_sync.rst
api-reference/system/app_trace.rst
api-reference/system/chip_revision.rst
api-reference/system/async_memcpy.rst
api-reference/system/random.rst
api-reference/system/esp_timer.rst
api-reference/system/system_time.rst
api-reference/system/power_management.rst

View File

@ -1,3 +1,4 @@
INPUT += \
$(PROJECT_PATH)/components/esp_wifi/include/esp_wifi_he_types.h \
$(PROJECT_PATH)/components/esp_wifi/include/esp_wifi_he.h \
$(PROJECT_PATH)/components/bt/include/esp32c6/include/esp_bt.h \

View File

@ -3,7 +3,7 @@ Configure Other JTAG Interfaces
:link_to_translation:`zh_CN:[中文]`
{IDF_TARGET_JTAG_SEL_EFUSE:default="Not Updated!", esp32s3="STRAP_JTAG_SEL", esp32c6="JTAG_SEL_ENABLE", esp32h2="JTAG_SEL_ENABLE", esp32p4="JTAG_SEL_ENABLE", esp32c5="JTAG_SEL_ENABLE"}
{IDF_TARGET_JTAG_SEL_EFUSE:default="Not Updated!", esp32s3="STRAP_JTAG_SEL", esp32c6="JTAG_SEL_ENABLE", esp32h2="JTAG_SEL_ENABLE", esp32p4="JTAG_SEL_ENABLE", esp32c5="JTAG_SEL_ENABLE", esp32c61="JTAG_SEL_ENABLE"}
For guidance about which JTAG interface to select when using OpenOCD with {IDF_TARGET_NAME}, refer to the section :ref:`jtag-debugging-selecting-jtag-adapter`. Then follow the configuration steps below to get it working.

View File

@ -37,11 +37,12 @@
Info : esp_usb_jtag: serial (60:55:F9:F6:03:3C)
Info : esp_usb_jtag: Device found. Base speed 24000KHz, div range 1 to 255
Info : clock speed 24000 kHz
Info : JTAG tap: esp32c61.cpu tap/device found: 0x0000dc25 (mfg: 0x612 (Espressif Systems), part: 0x000d, ver: 0x0)
Info : datacount=2 progbufsize=16
Info : Examined RISC-V core; found 2 harts
Info : hart 0: XLEN=32, misa=0x40903105
Info : starting gdb server for esp32c61 on 3333
Info : JTAG tap: esp32c61.tap0 tap/device found: 0x00014c25 (mfg: 0x612 (Espressif Systems), part: 0x0014, ver: 0x0)
Info : [esp32c61] datacount=1 progbufsize=2
Info : [esp32c61] Examined RISC-V core; found 1 harts
Info : [esp32c61] XLEN=32, misa=0x40101105
Info : [esp32c61] Examination succeed
Info : [esp32c61] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
.. |run-openocd-cfg-file-err| replace:: ``Can't find board/esp32c61-builtin.cfg``
@ -121,17 +122,17 @@
* - ESP32-C61 Pin
- JTAG Signal
* - MTDO / GPIO7
* - MTDO / GPIO6
- TDO
* - MTDI / GPIO5
* - MTDI / GPIO4
- TDI
* - MTCK / GPIO6
* - MTCK / GPIO5
- TCK
* - MTMS / GPIO4
* - MTMS / GPIO3
- TMS
.. |jtag-sel-gpio| replace:: GPIO15
.. |jtag-gpio-list| replace:: GPIO4-GPIO7
.. |jtag-sel-gpio| replace:: GPIO7
.. |jtag-gpio-list| replace:: GPIO3-GPIO6
---

View File

@ -180,7 +180,7 @@ Open a terminal and set it up for using the ESP-IDF as described in the :ref:`se
:start-after: run-openocd
:end-before: ---
{IDF_TARGET_FTDI_CONFIG:default="Not Updated!", esp32s3="board/esp32s3-ftdi.cfg", esp32c3="board/esp32c3-ftdi.cfg", esp32c6="board/esp32c6-ftdi.cfg", esp32h2="board/esp32h2-ftdi.cfg", esp32p4="board/esp32p4-ftdi.cfg", esp32c5="board/esp32c5-ftdi.cfg"}
{IDF_TARGET_FTDI_CONFIG:default="Not Updated!", esp32s3="board/esp32s3-ftdi.cfg", esp32c3="board/esp32c3-ftdi.cfg", esp32c6="board/esp32c6-ftdi.cfg", esp32h2="board/esp32h2-ftdi.cfg", esp32p4="board/esp32p4-ftdi.cfg", esp32c5="board/esp32c5-ftdi.cfg", esp32c61="board/esp32c61-ftdi.cfg"}
.. note::

View File

@ -299,15 +299,20 @@ Improving Network Speed
Improving I/O Performance
-------------------------
Using standard C library functions like ``fread`` and ``fwrite`` instead of platform specific unbuffered syscalls such as ``read`` and ``write`` can be slow.These functions are designed to be portable, so they are not necessarily optimized for speed, have a certain overhead and are buffered.
Using standard C library functions like ``fread`` and ``fwrite`` instead of platform-specific unbuffered syscalls such as ``read`` and ``write``, may result in slower performance.
:doc:`/api-reference/storage/fatfs` specific information and tips:
The ``fread`` and ``fwrite`` functions are designed for portability rather than speed, introducing some overhead due to their buffered nature. Check the example :example:`storage/fatfsgen` to see how to use these two functions.
In contrast, the ``read`` and ``write`` functions are standard POSIX APIs that can be used directly when working with FatFs through VFS, with ESP-IDF handling the underlying implementation. Check the example :example:`storage/perf_benchmark` to see how to use the two functions.
Additional tips are provided below, and further details can be found in :doc:`/api-reference/storage/fatfs`.
.. list::
- Maximum size of the R/W request = FatFS cluster size (allocation unit size).
- Use ``read`` and ``write`` instead of ``fread`` and ``fwrite``.
- To increase speed of buffered reading functions like ``fread`` and ``fgets``, you can increase a size of the file buffer (Newlib's default is 128 bytes) to a higher number like 4096, 8192 or 16384. This can be done locally via the ``setvbuf`` function used on a certain file pointer or globally applied to all files via modifying :ref:`CONFIG_FATFS_VFS_FSTAT_BLKSIZE`.
- The maximum size of a read/write request is equal to the FatFS cluster size (allocation unit size).
- For better performance, prefer using ``read`` and ``write`` over ``fread`` and ``fwrite``.
- To improve the speed of buffered reading functions like ``fread`` and ``fgets``, consider increasing the file buffer size. The default size in Newlib is 128 bytes, but you can increase it to 4096, 8192, or 16384 bytes. This can be made locally using the ``setvbuf`` function for a specific file pointer or globally by modifying the ``CONFIG_FATFS_VFS_FSTAT_BLKSIZE`` setting.
.. note::
Setting a bigger buffer size also increases the heap memory usage.
Increasing the buffer size will also increase heap memory usage.

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