Skip to content

Commit 9abfd39

Browse files
authored
Merge branch 'espressif:release/v5.3' into release/v5.3
2 parents c47ce41 + cfea4f7 commit 9abfd39

File tree

176 files changed

+2145
-788
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+2145
-788
lines changed

.gitlab/ci/common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ stages:
66
- pre_check
77
- build
88
- assign_test
9+
- build_doc
910
- target_test
1011
- host_test
11-
- build_doc
1212
- test_deploy
1313
- deploy
1414
- post_deploy

.gitlab/ci/docs.yml

Lines changed: 19 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,16 @@
3737
.if-dev-push: &if-dev-push
3838
if: '$CI_COMMIT_REF_NAME != "master" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_COMMIT_TAG !~ /^qa-test/ && ($CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "merge_request_event")'
3939

40-
.if-schedule: &if-schedule
41-
if: '$CI_PIPELINE_SOURCE == "schedule"'
42-
4340
.doc-rules:build:docs-full:
4441
rules:
4542
- <<: *if-qa-test-tag
4643
when: never
47-
- <<: *if-schedule
44+
- <<: *if-protected
4845
- <<: *if-label-build_docs
4946
- <<: *if-label-docs_full
5047
- <<: *if-dev-push
5148
changes: *patterns-docs-full
5249

53-
.doc-rules:build:docs-full-prod:
54-
rules:
55-
- <<: *if-qa-test-tag
56-
when: never
57-
- <<: *if-protected-no_label
58-
5950
.doc-rules:build:docs-partial:
6051
rules:
6152
- <<: *if-qa-test-tag
@@ -92,13 +83,14 @@ check_docs_lang_sync:
9283
stage: build_doc
9384
tags:
9485
- build_docs
86+
needs:
87+
- job: fast_template_app
88+
artifacts: false
89+
optional: true
9590
script:
9691
- if [ -n "${BREATHE_ALT_INSTALL_URL}" ]; then pip uninstall -y breathe && pip install -U ${BREATHE_ALT_INSTALL_URL}; fi
9792
- cd docs
9893
- build-docs -t $DOCTGT -bs $DOC_BUILDERS -l $DOCLANG build
99-
artifacts:
100-
expire_in: 4 days
101-
when: always
10294
parallel:
10395
matrix:
10496
- DOCLANG: ["en", "zh_CN"]
@@ -119,41 +111,25 @@ build_docs_html_full:
119111
extends:
120112
- .build_docs_template
121113
- .doc-rules:build:docs-full
122-
needs:
123-
- job: fast_template_app
124-
artifacts: false
125-
optional: true
126-
artifacts:
127-
paths:
128-
- docs/_build/*/*/*.txt
129-
- docs/_build/*/*/html/*
130-
variables:
131-
DOC_BUILDERS: "html"
132-
133-
build_docs_html_full_prod:
134-
extends:
135-
- .build_docs_template
136-
- .doc-rules:build:docs-full-prod
137-
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
138114
artifacts:
115+
when: always
139116
paths:
140117
- docs/_build/*/*/*.txt
141118
- docs/_build/*/*/html/*
119+
expire_in: 4 days
142120
variables:
143121
DOC_BUILDERS: "html"
144122

145123
build_docs_html_partial:
146124
extends:
147125
- .build_docs_template
148126
- .doc-rules:build:docs-partial
149-
needs:
150-
- job: fast_template_app
151-
artifacts: false
152-
optional: true
153127
artifacts:
128+
when: always
154129
paths:
155130
- docs/_build/*/*/*.txt
156131
- docs/_build/*/*/html/*
132+
expire_in: 4 days
157133
variables:
158134
DOC_BUILDERS: "html"
159135
parallel:
@@ -167,26 +143,12 @@ build_docs_pdf:
167143
extends:
168144
- .build_docs_template
169145
- .doc-rules:build:docs-full
170-
needs:
171-
- job: fast_template_app
172-
artifacts: false
173-
optional: true
174-
allow_failure: true # TODO IDFCI-2216
175146
artifacts:
147+
when: always
176148
paths:
177149
- docs/_build/*/*/latex/*
178-
variables:
179-
DOC_BUILDERS: "latex"
180-
181-
build_docs_pdf_prod:
182-
extends:
183-
- .build_docs_template
184-
- .doc-rules:build:docs-full-prod
185-
dependencies: [] # Stop build_docs jobs from downloading all previous job's artifacts
150+
expire_in: 4 days
186151
allow_failure: true # TODO IDFCI-2216
187-
artifacts:
188-
paths:
189-
- docs/_build/*/*/latex/*
190152
variables:
191153
DOC_BUILDERS: "latex"
192154

@@ -234,12 +196,13 @@ deploy_docs_production:
234196
# The DOCS_PROD_* variables used by this job are "Protected" so these branches must all be marked "Protected" in Gitlab settings
235197
extends:
236198
- .deploy_docs_template
237-
- .doc-rules:build:docs-full-prod
199+
rules:
200+
- <<: *if-protected-no_label
238201
stage: post_deploy
239202
dependencies: # set dependencies to null to avoid missing artifacts issue
240203
needs: # ensure runs after push_to_github succeeded
241-
- build_docs_html_full_prod
242-
- build_docs_pdf_prod
204+
- build_docs_html_full
205+
- build_docs_pdf
243206
- job: push_to_github
244207
artifacts: false
245208
variables:
@@ -254,16 +217,19 @@ deploy_docs_production:
254217
check_doc_links:
255218
extends:
256219
- .build_docs_template
257-
- .doc-rules:build:docs-full-prod
220+
rules:
221+
- <<: *if-protected-no_label
258222
stage: post_deploy
259223
needs:
260224
- job: deploy_docs_production
261225
artifacts: false
262226
tags: ["build", "amd64", "internet"]
263227
artifacts:
228+
when: always
264229
paths:
265230
- docs/_build/*/*/*.txt
266231
- docs/_build/*/*/linkcheck/*.txt
232+
expire_in: 1 week
267233
allow_failure: true
268234
script:
269235
- cd docs

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,6 @@ repos:
236236
name: Lint rST files in docs folder using Sphinx Lint
237237
files: ^(docs/en|docs/zh_CN)/.*\.(rst|inc)$
238238
- repo: https://github.com/espressif/esp-idf-kconfig.git
239-
rev: v2.3.0
239+
rev: v2.4.1
240240
hooks:
241241
- id: check-kconfig-files

components/bt/common/btc/profile/esp/blufi/bluedroid_host/esp_blufi.c

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -160,20 +160,31 @@ static void blufi_profile_cb(tBTA_GATTS_EVT event, tBTA_GATTS *p_data)
160160
if (p_data->req_data.p_data->write_req.is_prep) {
161161
tBTA_GATT_STATUS status = GATT_SUCCESS;
162162

163-
if (blufi_env.prepare_buf == NULL) {
164-
blufi_env.prepare_buf = osi_malloc(BLUFI_PREPAIR_BUF_MAX_SIZE);
165-
blufi_env.prepare_len = 0;
166-
if (blufi_env.prepare_buf == NULL) {
167-
BLUFI_TRACE_ERROR("Blufi prep no mem\n");
168-
status = GATT_NO_RESOURCES;
163+
do {
164+
if (p_data->req_data.p_data->write_req.offset > BLUFI_PREPARE_BUF_MAX_SIZE) {
165+
status = ESP_GATT_INVALID_OFFSET;
166+
break;
169167
}
170-
} else {
171-
if (p_data->req_data.p_data->write_req.offset > BLUFI_PREPAIR_BUF_MAX_SIZE) {
172-
status = GATT_INVALID_OFFSET;
173-
} else if ((p_data->req_data.p_data->write_req.offset + p_data->req_data.p_data->write_req.len) > BLUFI_PREPAIR_BUF_MAX_SIZE) {
174-
status = GATT_INVALID_ATTR_LEN;
168+
169+
if ((p_data->req_data.p_data->write_req.offset + p_data->req_data.p_data->write_req.len) > BLUFI_PREPARE_BUF_MAX_SIZE) {
170+
status = ESP_GATT_INVALID_ATTR_LEN;
171+
break;
175172
}
176-
}
173+
174+
if (blufi_env.prepare_buf == NULL) {
175+
if (p_data->req_data.p_data->write_req.offset != 0) {
176+
status = GATT_INVALID_OFFSET;
177+
break;
178+
}
179+
blufi_env.prepare_buf = osi_malloc(BLUFI_PREPARE_BUF_MAX_SIZE);
180+
blufi_env.prepare_len = 0;
181+
if (blufi_env.prepare_buf == NULL) {
182+
BLUFI_TRACE_ERROR("Blufi prep no mem\n");
183+
status = GATT_NO_RESOURCES;
184+
break;
185+
}
186+
}
187+
} while (0);
177188

178189
memset(&rsp, 0, sizeof(tGATTS_RSP));
179190
rsp.attr_value.handle = p_data->req_data.p_data->write_req.handle;

components/bt/common/btc/profile/esp/blufi/include/blufi_int.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ typedef struct {
3636
UINT32 trans_id;
3737
UINT8 congest;
3838
UINT16 frag_size;
39+
// Deprecated: This macro will be removed in the future
3940
#define BLUFI_PREPAIR_BUF_MAX_SIZE 1024
41+
#define BLUFI_PREPARE_BUF_MAX_SIZE 1024
4042
uint8_t *prepare_buf;
4143
int prepare_len;
4244
/* Control reference */

components/bt/common/btc/profile/esp/blufi/include/esp_blufi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void esp_blufi_gatt_svr_register_cb(struct ble_gatt_register_ctxt *ctxt, void *a
4444

4545
/* Initialise gatt server */
4646
int esp_blufi_gatt_svr_init(void);
47+
int esp_blufi_gatt_svr_deinit(void);
4748
void esp_blufi_btc_init(void);
4849
void esp_blufi_btc_deinit(void);
4950
#endif

components/bt/common/btc/profile/esp/blufi/nimble_host/esp_blufi.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,32 @@ static void init_gatt_values(void)
240240

241241
}
242242

243+
static void deinit_gatt_values(void)
244+
{
245+
int i = 0;
246+
const struct ble_gatt_svc_def *svc;
247+
const struct ble_gatt_chr_def *chr;
248+
const struct ble_gatt_dsc_def *dsc;
249+
250+
for (svc = gatt_svr_svcs; svc && svc->uuid; svc++) {
251+
for (chr = svc->characteristics; chr && chr->uuid; chr++) {
252+
if (i < SERVER_MAX_VALUES && gatt_values[i].buf != NULL) {
253+
os_mbuf_free(gatt_values[i].buf); /* Free the buffer */
254+
gatt_values[i].buf = NULL; /* Nullify the pointer to avoid dangling references */
255+
}
256+
++i;
257+
258+
for (dsc = chr->descriptors; dsc && dsc->uuid; dsc++) {
259+
if (i < SERVER_MAX_VALUES && gatt_values[i].buf != NULL) {
260+
os_mbuf_free(gatt_values[i].buf); /* Free the buffer */
261+
gatt_values[i].buf = NULL; /* Nullify the pointer to avoid dangling references */
262+
}
263+
++i;
264+
}
265+
}
266+
}
267+
}
268+
243269
int esp_blufi_gatt_svr_init(void)
244270
{
245271
int rc;
@@ -260,6 +286,18 @@ int esp_blufi_gatt_svr_init(void)
260286
return 0;
261287
}
262288

289+
int esp_blufi_gatt_svr_deinit(void)
290+
{
291+
deinit_gatt_values();
292+
293+
ble_gatts_free_svcs();
294+
/* Deinitialize BLE GATT and GAP services */
295+
ble_svc_gatt_deinit();
296+
ble_svc_gap_deinit();
297+
298+
return 0;
299+
}
300+
263301
static int
264302
esp_blufi_gap_event(struct ble_gap_event *event, void *arg)
265303
{

components/bt/controller/esp32/bt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,8 @@ static esp_err_t esp_bt_controller_rom_mem_release(esp_bt_mode_t mode)
13451345

13461346
//already released
13471347
if (!(mode & btdm_dram_available_region[0].mode)) {
1348-
return ESP_ERR_INVALID_STATE;
1348+
ESP_LOGW(BTDM_LOG_TAG, "%s already released, mode %d",__func__, mode);
1349+
return ESP_OK;
13491350
}
13501351

13511352
for (int i = 0; i < sizeof(btdm_dram_available_region)/sizeof(btdm_dram_available_region_t); i++) {

components/bt/controller/esp32c2/Kconfig.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,3 +659,11 @@ config BT_LE_PLACE_CONN_RELATED_INTO_IRAM
659659
bool "Place the connection-related code into IRAM"
660660
depends on BT_CTRL_RUN_IN_FLASH_ONLY
661661
default n
662+
663+
config BT_LE_CTRL_CHECK_CONNECT_IND_ACCESS_ADDRESS
664+
bool "Enable enhanced Access Address check in CONNECT_IND"
665+
default n
666+
help
667+
Enabling this option will add stricter verification of the Access Address in the CONNECT_IND PDU.
668+
This improves security by ensuring that only connection requests with valid Access Addresses are accepted.
669+
If disabled, only basic checks are applied, improving compatibility.

components/bt/controller/esp32c2/bt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ static void esp_bt_ctrl_log_partition_get_and_erase_first_block(void);
199199
/* Local variable definition
200200
***************************************************************************
201201
*/
202-
#if CONFIG_ESP32C2_REV_MIN_FULL < 200
202+
#if (CONFIG_ESP32C2_REV_MIN_FULL < 200) && (!CONFIG_BT_CTRL_RUN_IN_FLASH_ONLY)
203203
void *g_ble_lll_rfmgmt_env_p;
204204
#endif
205205
/* Static variable declare */

0 commit comments

Comments
 (0)