Skip to content

Commit f09e76a

Browse files
authored
Merge branch 'master' into mcapdeville
2 parents c0c6921 + 0f0068f commit f09e76a

File tree

1,302 files changed

+40583
-12825
lines changed

Some content is hidden

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

1,302 files changed

+40583
-12825
lines changed

.gitlab/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@
206206

207207
/tools/ @esp-idf-codeowners/tools
208208
/tools/ble/ @esp-idf-codeowners/app-utilities
209+
/tools/bt/ @esp-idf-codeowners/bluetooth
209210
/tools/catch/ @esp-idf-codeowners/ci
210211
/tools/ci/ @esp-idf-codeowners/ci
211212
/tools/cmake/ @esp-idf-codeowners/build-config

.gitlab/ci/default-build-test-rules.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ extra_default_build_targets:
1111
- esp32c61
1212

1313
bypass_check_test_targets:
14+
- esp32h21
1415

1516
#
1617
# These lines would

.gitlab/ci/host-test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ check_public_headers:
3333
- IDF_TARGET=esp32h2 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
3434
- IDF_TARGET=esp32p4 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
3535
- IDF_TARGET=esp32c61 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
36+
- IDF_TARGET=esp32h21 python tools/ci/check_public_headers.py --jobs 4 --prefix riscv32-esp-elf-
3637

3738
test_nvs_coverage:
3839
extends:
@@ -204,10 +205,14 @@ test_tools:
204205
- pytest --noconftest test_idf_py.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY.xml || stat=1
205206
- pytest --noconftest test_hints.py --junitxml=${IDF_PATH}/XUNIT_HINTS.xml || stat=1
206207
- pytest --noconftest test_idf_qemu.py --junitxml=${IDF_PATH}/XUNIT_IDF_PY_QEMU.xml || stat=1
208+
- cd ${IDF_PATH}/tools/test_bsasm
209+
- pytest --noconftest test_bsasm.py --junitxml=${IDF_PATH}/XUNIT_BSASM.xml || stat=1
207210
- cd ${IDF_PATH}/tools/test_mkdfu
208211
- pytest --noconftest test_mkdfu.py --junitxml=${IDF_PATH}/XUNIT_MKDFU.xml || stat=1
209212
- cd ${IDF_PATH}/tools/test_idf_size
210213
- pytest --noconftest test_idf_size.py --junitxml=${IDF_PATH}/XUNIT_IDF_SIZE.xml || stat=1
214+
- cd ${IDF_PATH}/tools/test_idf_diag
215+
- pytest --noconftest test_idf_diag.py --junitxml=${IDF_PATH}/XUNIT_IDF_DIAG.xml || stat=1
211216
- cd ${IDF_PATH}
212217
- shellcheck -s sh tools/detect_python.sh || stat=1
213218
- shellcheck -s bash tools/detect_python.sh || stat=1

.gitlab/ci/rules.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
- "tools/idf_size.py"
9393
- "tools/test_idf_size/**/*"
9494

95+
- "tools/test_idf_diag/**/*"
96+
9597
- "tools/tools.json"
9698
- "tools/tools_schema.json"
9799
- "tools/idf_tools.py"
@@ -124,6 +126,9 @@
124126

125127
- "tools/check_python_dependencies.py"
126128

129+
- "tools/bsasm.py"
130+
- "tools/test_bsasm/**/*"
131+
127132
.patterns-docker: &patterns-docker
128133
- "tools/docker/**/*"
129134

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ repos:
200200
- id: file-contents-sorter
201201
files: 'tools\/ci\/(executable-list\.txt|mypy_ignore_list\.txt|check_copyright_ignore\.txt)'
202202
- repo: https://github.com/espressif/check-copyright/
203-
rev: v1.0.3
203+
rev: v1.1.0
204204
hooks:
205205
- id: check-copyright
206206
args: ['--ignore', 'tools/ci/check_copyright_ignore.txt', '--config', 'tools/ci/check_copyright_config.yaml']

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,13 @@ if(CONFIG_ESP_SYSTEM_USE_EH_FRAME)
207207
list(APPEND link_options "-Wl,--eh-frame-hdr")
208208
endif()
209209

210+
if(CONFIG_ESP_SYSTEM_USE_FRAME_POINTER)
211+
list(APPEND compile_options "-fno-omit-frame-pointer")
212+
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
213+
list(APPEND compile_options "-mno-omit-leaf-frame-pointer")
214+
endif()
215+
endif()
216+
210217
list(APPEND link_options "-fno-lto")
211218

212219
if(CONFIG_IDF_TARGET_LINUX AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")

components/app_trace/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ endif()
6060

6161
if(CONFIG_HEAP_TRACING_TOHOST)
6262
list(APPEND srcs "heap_trace_tohost.c")
63-
set_source_files_properties(heap_trace_tohost.c
64-
PROPERTIES COMPILE_FLAGS
65-
-Wno-frame-address)
63+
if(CONFIG_IDF_TARGET_ARCH_XTENSA)
64+
set_source_files_properties(heap_trace_tohost.c PROPERTIES COMPILE_FLAGS -Wno-frame-address)
65+
endif()
6666
endif()
6767

6868
idf_component_register(SRCS "${srcs}"

components/app_trace/heap_trace_tohost.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
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
*/
6-
#include <sdkconfig.h>
6+
#include "sdkconfig.h"
77

8-
#define HEAP_TRACE_SRCFILE /* don't warn on inclusion here */
98
#include "esp_heap_trace.h"
10-
#undef HEAP_TRACE_SRCFILE
119
#include "esp_heap_caps.h"
1210
#if CONFIG_APPTRACE_SV_ENABLE
1311
#include "esp_app_trace.h"
@@ -16,7 +14,7 @@
1614

1715
#define STACK_DEPTH CONFIG_HEAP_TRACING_STACK_DEPTH
1816

19-
#ifdef CONFIG_HEAP_TRACING_TOHOST
17+
#if CONFIG_HEAP_TRACING_TOHOST
2018

2119
#if !CONFIG_APPTRACE_SV_ENABLE
2220
#error None of the heap tracing backends is enabled! You must enable SystemView compatible tracing to use this feature.

components/app_update/esp_ota_ops.c

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,18 @@ esp_err_t esp_ota_begin(const esp_partition_t *partition, size_t image_size, esp
182182
} else {
183183
erase_size = ALIGN_UP(image_size, partition->erase_size);
184184
}
185-
return esp_partition_erase_range(partition, 0, erase_size);
185+
esp_err_t err = esp_partition_erase_range(partition, 0, erase_size);
186+
if (err != ESP_OK) {
187+
return err;
188+
}
189+
}
190+
191+
#ifdef CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE
192+
if (is_ota_partition(partition)) {
193+
esp_ota_invalidate_inactive_ota_data_slot();
186194
}
195+
#endif
196+
187197
return ESP_OK;
188198
}
189199

@@ -955,7 +965,7 @@ esp_err_t esp_ota_get_state_partition(const esp_partition_t *partition, esp_ota_
955965
return ESP_OK;
956966
}
957967

958-
esp_err_t esp_ota_erase_last_boot_app_partition(void)
968+
static esp_err_t erase_last_boot_app_partition(bool skip_app_part_erase)
959969
{
960970
esp_ota_select_entry_t otadata[2];
961971
const esp_partition_t* ota_data_partition = read_otadata(otadata);
@@ -987,20 +997,32 @@ esp_err_t esp_ota_erase_last_boot_app_partition(void)
987997
return ESP_FAIL;
988998
}
989999

990-
esp_err_t err = esp_partition_erase_range(last_boot_app_partition_from_otadata, 0, last_boot_app_partition_from_otadata->size);
991-
if (err != ESP_OK) {
992-
return err;
1000+
if (!skip_app_part_erase) {
1001+
esp_err_t err = esp_partition_erase_range(last_boot_app_partition_from_otadata, 0, last_boot_app_partition_from_otadata->size);
1002+
if (err != ESP_OK) {
1003+
return err;
1004+
}
9931005
}
9941006

9951007
int sec_id = inactive_otadata;
996-
err = esp_partition_erase_range(ota_data_partition, sec_id * ota_data_partition->erase_size, ota_data_partition->erase_size);
1008+
esp_err_t err = esp_partition_erase_range(ota_data_partition, sec_id * ota_data_partition->erase_size, ota_data_partition->erase_size);
9971009
if (err != ESP_OK) {
9981010
return err;
9991011
}
10001012

10011013
return ESP_OK;
10021014
}
10031015

1016+
esp_err_t esp_ota_erase_last_boot_app_partition(void)
1017+
{
1018+
return erase_last_boot_app_partition(false);
1019+
}
1020+
1021+
esp_err_t esp_ota_invalidate_inactive_ota_data_slot(void)
1022+
{
1023+
return erase_last_boot_app_partition(true);
1024+
}
1025+
10041026
#if SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY && CONFIG_SECURE_BOOT_V2_ENABLED
10051027

10061028
// Validates the image at "app_pos" with the secure boot digests other than "revoked_key_index"

components/app_update/include/esp_ota_ops.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ int esp_ota_get_app_elf_sha256(char* dst, size_t size) __attribute__((deprecated
8383
* use esp_ota_mark_app_valid_cancel_rollback() function for it (this should be done as early as possible when you first download a new application).
8484
*
8585
* Note: Rollback is applicable only for app type partitions.
86+
* Note: For Rollback - The OTA data slot corresponding to the last boot application partition will be invalidated.
8687
*
8788
* @param partition Pointer to info for partition which will receive the OTA update. Required.
8889
* This is considered as the staging partition (where OTA is downloaded), be default this also considered as the final partition which supposed to be updated.
@@ -302,6 +303,20 @@ esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, es
302303
*/
303304
esp_err_t esp_ota_get_bootloader_description(const esp_partition_t *bootloader_partition, esp_bootloader_desc_t *desc);
304305

306+
/**
307+
* @brief Invalidate the OTA data slot associated with the last boot application partition.
308+
*
309+
* This function erases the OTA data slot corresponding to the last boot application partition,
310+
* making the partition invalid for booting in future. The application partition itself
311+
* is not erased, preserving its contents.
312+
*
313+
* @return
314+
* - ESP_OK: Successfully invalidated the OTA data slot.
315+
* - ESP_FAIL: Failed to invalidate the OTA data slot (e.g., invalid parameters, no OTA data partition, or other errors).
316+
* - Other error codes from `esp_partition_erase_range`.
317+
*/
318+
esp_err_t esp_ota_invalidate_inactive_ota_data_slot(void);
319+
305320
/**
306321
* @brief Returns number of ota partitions provided in partition table.
307322
*

0 commit comments

Comments
 (0)