Support for building and running external apps (#112)

This commit is contained in:
Ken Van Hoeylandt
2024-12-08 16:46:19 +01:00
committed by GitHub
parent 42e843b463
commit 415442e410
74 changed files with 2901 additions and 126 deletions
@@ -0,0 +1,11 @@
# For more information about build system see
# https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/build-system.html
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(hello_world)
include(elf_loader)
project_elf(hello_world)
@@ -0,0 +1,13 @@
## Build ELF file Example
This example shows how to build ELF file.
## How to Use Example
Before project configuration and build, be sure to set the correct chip target using `idf.py set-target <chip_name>`.
* Note: Only ESP32, ESP32-S2 and ESP32-S3 are supported
### Build and Flash
Run `idf.py build` to build project, and when compiling is done you can see `hello_world.app.elf` in `build` directory.
@@ -0,0 +1 @@
idf_component_register(SRCS "main.c")
@@ -0,0 +1,5 @@
dependencies:
elf_loader:
version: "0.*"
override_path: "../../../../components/elf_loader"
@@ -0,0 +1,28 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <unistd.h>
char buffer[] = "hello world %d\n";
static int s_cnt;
int try_test(void)
{
for (int i = 0; i < 10; i++) {
printf(buffer, s_cnt++);
sleep(1);
}
return 0;
}
int main(int argc, char *argv[])
{
try_test();
return 0;
}
@@ -0,0 +1 @@
CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=n