-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/c6_ulp' into 'master'
ulp: added basic support for building and running a binary in the lp core Closes IDF-6829 and IDF-6272 See merge request espressif/esp-idf!22554
- Loading branch information
Showing
33 changed files
with
517 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# CMake toolchain file for ULP LP core | ||
set(CMAKE_SYSTEM_NAME Generic) | ||
|
||
set(CMAKE_C_COMPILER "riscv32-esp-elf-gcc") | ||
set(CMAKE_CXX_COMPILER "riscv32-esp-elf-g++") | ||
set(CMAKE_ASM_COMPILER "riscv32-esp-elf-gcc") | ||
|
||
set(CMAKE_C_FLAGS "-Os -march=rv32imac_zicsr_zifencei -mdiv -fdata-sections -ffunction-sections" | ||
CACHE STRING "C Compiler Base Flags") | ||
set(CMAKE_CXX_FLAGS "-Os -march=rv32imac_zicsr_zifencei -mdiv -fdata-sections -ffunction-sections" | ||
CACHE STRING "C++ Compiler Base Flags") | ||
set(CMAKE_ASM_FLAGS "-march=rv32imac -x assembler-with-cpp" | ||
CACHE STRING "Assembler Base Flags") | ||
set(CMAKE_EXE_LINKER_FLAGS "-march=rv32imac_zicsr_zifencei --specs=nano.specs --specs=nosys.specs" | ||
CACHE STRING "Linker Base Flags") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
#include "sdkconfig.h" | ||
|
||
ENTRY(reset_vector) | ||
|
||
MEMORY | ||
{ | ||
/*first 128byte for exception/interrupt vectors*/ | ||
vector_table(RX) : ORIGIN = 0x50000000, LENGTH = 0x80 | ||
ram(RWX) : ORIGIN = 0x50000080, LENGTH = CONFIG_ULP_COPROC_RESERVE_MEM - 0x80 | ||
} | ||
|
||
SECTIONS | ||
{ | ||
.vector.text : | ||
{ | ||
/*exception/interrupt vectors*/ | ||
__mtvec_base = .; | ||
KEEP (*(.init.vector .init.vector.*)) | ||
} > vector_table | ||
|
||
. = ORIGIN(ram); | ||
|
||
.text ALIGN(4): | ||
{ | ||
*(.text.vectors) /* Default reset vector must link to offset 0x80 */ | ||
*(.text) | ||
*(.text*) | ||
} >ram | ||
|
||
.rodata ALIGN(4): | ||
{ | ||
*(.rodata) | ||
*(.rodata*) | ||
} > ram | ||
|
||
.data ALIGN(4): | ||
{ | ||
*(.data) | ||
*(.data*) | ||
*(.sdata) | ||
*(.sdata*) | ||
} > ram | ||
|
||
.bss ALIGN(4) : | ||
{ | ||
*(.bss) | ||
*(.bss*) | ||
*(.sbss) | ||
*(.sbss*) | ||
PROVIDE(end = .); | ||
} >ram | ||
|
||
__stack_top = ORIGIN(ram) + LENGTH(ram); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
#include <stdint.h> | ||
#include <stddef.h> | ||
#include <stdlib.h> | ||
#include "esp_err.h" | ||
#include "ulp_common.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
|
||
typedef enum { | ||
ULP_LP_CORE_WAKEUP_SOURCE_HP_CPU, // LP core is started by HP core (1 single wakeup) | ||
} ulp_lp_core_wakeup_source_t; | ||
|
||
/** | ||
* @brief ULP LP core init parameters | ||
* | ||
*/ | ||
typedef struct { | ||
ulp_lp_core_wakeup_source_t wakeup_source; | ||
} ulp_lp_core_cfg_t; | ||
|
||
/** | ||
* @brief Configure the ULP | ||
* and run the program loaded into RTC memory | ||
* | ||
* @return ESP_OK on success | ||
*/ | ||
esp_err_t ulp_lp_core_run(ulp_lp_core_cfg_t* cfg); | ||
|
||
/** | ||
* @brief Load the program binary into RTC memory | ||
* | ||
* @param program_binary pointer to program binary | ||
* @param program_size_bytes size of the program binary | ||
* @return | ||
* - ESP_OK on success | ||
* - ESP_ERR_INVALID_SIZE if program_size_bytes is more than KiB | ||
*/ | ||
esp_err_t ulp_lp_core_load_binary(const uint8_t* program_binary, size_t program_size_bytes); | ||
|
||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
Oops, something went wrong.