Skip to content

Commit 5180418

Browse files
committed
feat(elf_loader): Add ESP32-C6 support
1 parent df76c29 commit 5180418

File tree

12 files changed

+19
-11
lines changed

12 files changed

+19
-11
lines changed

.gitlab/ci/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,7 @@ build_example_elf_loader_build_elf_file_example:
13441344
- IMAGE: espressif/idf:release-v5.1
13451345
- IMAGE: espressif/idf:release-v5.2
13461346
- IMAGE: espressif/idf:release-v5.3
1347+
- IMAGE: espressif/idf:release-v5.4
13471348
variables:
13481349
EXAMPLE_DIR: examples/elf_loader/build_elf_file_example
13491350

components/elf_loader/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
menu "Espressif ELF Loader Configuration"
2-
visible if (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4)
2+
visible if (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32P4)
33

44
config ELF_LOADER_BUS_ADDRESS_MIRROR
55
bool
66
default y if (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3)
7-
default n if IDF_TARGET_ESP32P4
7+
default n if (IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32P4)
88

99
config ELF_LOADER
1010
bool "Enable Espressif ELF Loader"
1111
default y
12-
depends on (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32P4)
12+
depends on (IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32P4)
1313
help
1414
Select this option to enable ELF Loader and show the submenu with ELF Loader configuration choices.
1515

components/elf_loader/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ This ELF loader supports following SoCs:
1212
- ESP32-S2, support running ELF in PSRAM
1313
- ESP32-S3, support running ELF in PSRAM
1414
- ESP32-P4, support running ELF in PSRAM
15+
- ESP32-C6
1516

1617
### Usage
1718

components/elf_loader/elf_loader.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ macro(project_elf project_name)
3737
set(strip_flags --strip-unneeded
3838
--remove-section=.comment
3939
--remove-section=.got.loc
40-
--remove-section=.got
4140
--remove-section=.dynamic)
4241

4342
if(CONFIG_IDF_TARGET_ARCH_XTENSA)

components/elf_loader/src/arch/esp_elf_riscv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/

components/elf_loader/src/arch/esp_elf_xtensa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/

components/elf_loader/src/esp_elf_adapter.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@ void *esp_elf_malloc(uint32_t n, bool exec)
3838
#endif
3939
#else
4040
#ifdef CONFIG_ELF_LOADER_LOAD_PSRAM
41-
caps = MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT | MALLOC_CAP_CACHE_ALIGNED;
41+
caps = MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT;
4242
#else
43-
caps = MALLOC_CAP_8BIT | MALLOC_CAP_CACHE_ALIGNED;
43+
caps = MALLOC_CAP_8BIT;
44+
#endif
45+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 3, 0)
46+
caps |= MALLOC_CAP_CACHE_ALIGNED;
4447
#endif
4548
#endif
4649

examples/.build-rules.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,10 @@ examples/elf_loader/elf_loader_example:
362362
enable:
363363
- if: IDF_TARGET in ["esp32","esp32s2","esp32s3"]
364364
- if: IDF_TARGET in ["esp32p4"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 3)
365+
- if: IDF_TARGET in ["esp32c6"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 1)
365366

366367
examples/elf_loader/build_elf_file_example:
367368
enable:
368369
- if: IDF_TARGET in ["esp32","esp32s2","esp32s3"]
369370
- if: IDF_TARGET in ["esp32p4"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 3)
371+
- if: IDF_TARGET in ["esp32c6"] and (IDF_VERSION_MAJOR >= 5 and IDF_VERSION_MINOR >= 1)

examples/elf_loader/build_elf_file_example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This example shows how to build ELF file.
66

77
Before project configuration and build, be sure to set the correct chip target using `idf.py set-target <chip_name>`.
88

9-
* Note: Only ESP32, ESP32-S2, ESP32-S3 and ESP32-P4 are supported
9+
* Note: Only ESP32, ESP32-S2, ESP32-S3, ESP32-C6 and ESP32-P4 are supported
1010

1111
### Build and Flash
1212

13-
Run `idf.py build` to build project, and when compiling is done you can see `hello_world.app.elf` in `build` directory.
13+
Run `idf.py elf` to build project, and when compiling is done you can see `hello_world.app.elf` in `build` directory.

examples/elf_loader/elf_loader_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Before project configuration and build, be sure to set the correct chip target u
1010

1111
### Hardware Required
1212

13-
* A development board based on espressif ESP32/ESP32-S2/ESP32-S3/ESP32-P4 SoC
13+
* A development board based on espressif ESP32/ESP32-S2/ESP32-S3/ESP32-C6/ESP32-P4 SoC
1414
* A USB cable for power supply and programming
1515

1616
### Configure the Project

0 commit comments

Comments
 (0)