feat(esp32p4): base idf_as_lib support

This commit is contained in:
Armando
2023-08-07 14:16:53 +08:00
parent c09d823b6a
commit 5bd644942a
3 changed files with 22 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16)
project(idf_as_lib C)
set(targets "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32c2" "esp32c6" "esp32h2")
set(targets "esp32" "esp32s2" "esp32s3" "esp32c3" "esp32c2" "esp32c6" "esp32h2" "esp32p4")
if("${TARGET}" IN_LIST targets)
# Include for ESP-IDF build system functions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -euo pipefail
PARAM=""
# Retrive the target from the current filename, if no target specified,
# the variable will be empty
TARGET=$(echo $0 | cut -s -f2 -d- | cut -s -f1 -d.)
if [[ -n $TARGET ]]
then
# Target is not null, specify the build parameters
PARAM="-DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-${TARGET}.cmake -DTARGET=${TARGET} -GNinja"
fi
rm -rf build && mkdir build && cd build
cmake .. $PARAM
cmake --build .

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
cd build
python $IDF_PATH/components/esptool_py/esptool/esptool.py -p $1 write_flash @flash_project_args
python -m esp_idf_monitor -p $1 idf_as_lib.elf