Skip to content

Commit 544af8c

Browse files
authored
add p4 rev.300 support
1 parent cdf15c5 commit 544af8c

20 files changed

+284
-180
lines changed

.github/workflows/parallel_build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4]
12+
target: [esp32, esp32s2, esp32s3, esp32c2, esp32c3, esp32c6, esp32h2, esp32p4, esp32p4_es]
1313
fail-fast: true
1414
steps:
1515
- uses: actions/checkout@v4

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ idf_build_get_property(elf EXECUTABLE GENERATOR_EXPRESSION)
99

1010
add_custom_command(
1111
OUTPUT "idf_libs"
12-
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}" "${CONFIG_IDF_TARGET_ARCH_XTENSA}"
12+
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-libs.sh ${IDF_TARGET} "$ENV{CHIP_VARIANT}" "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}" "${CONFIG_IDF_TARGET_ARCH_XTENSA}"
1313
DEPENDS ${elf}
1414
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
1515
VERBATIM
@@ -18,7 +18,7 @@ add_custom_target(idf-libs DEPENDS "idf_libs")
1818

1919
add_custom_command(
2020
OUTPUT "copy_bootloader"
21-
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-bootloader.sh ${IDF_TARGET} "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_LIB_BUILDER_FLASHFREQ}"
21+
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-bootloader.sh ${IDF_TARGET} "$ENV{CHIP_VARIANT}" "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_LIB_BUILDER_FLASHFREQ}"
2222
DEPENDS bootloader
2323
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2424
VERBATIM
@@ -27,7 +27,7 @@ add_custom_target(copy-bootloader DEPENDS "copy_bootloader")
2727

2828
add_custom_command(
2929
OUTPUT "mem_variant"
30-
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-mem-variant.sh ${IDF_TARGET} "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}"
30+
COMMAND ${CMAKE_SOURCE_DIR}/tools/copy-mem-variant.sh ${IDF_TARGET} "$ENV{CHIP_VARIANT}" "${CONFIG_LIB_BUILDER_FLASHMODE}" "${CONFIG_SPIRAM_MODE_OCT}"
3131
DEPENDS ${elf}
3232
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
3333
VERBATIM

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ Tested on Ubuntu and MacOS.
66

77
### Build on Ubuntu
88
```bash
9-
sudo apt-get install git wget curl libssl-dev libncurses-dev flex bison gperf python python-pip python-setuptools python-serial python-click python-cryptography python-future python-pyparsing python-pyelftools cmake ninja-build ccache jq
10-
sudo pip install --upgrade pip
9+
sudo apt update
10+
sudo apt install -y git wget curl libssl-dev libncurses-dev flex bison gperf python-setuptools gperf cmake ninja-build ccache jq xz-utils
11+
curl -LsSf https://astral.sh/uv/install.sh | sh
12+
uv venv
13+
uv pip install future pyelftools
1114
git clone https://github.com/espressif/esp32-arduino-lib-builder
1215
cd esp32-arduino-lib-builder
1316
./build.sh
@@ -23,10 +26,10 @@ For more information and troubleshooting, please refer to the [UI README](tools/
2326
To use it, follow these steps:
2427

2528
1. Make sure you have the following prerequisites:
26-
- Python 3.9 or later
29+
- Python 3.10 or later
2730
- All the dependencies listed in the previous section
2831

29-
2. Install the required UI packages using `pip install -r tools/config_editor/requirements.txt`.
32+
2. Install the required UI packages using `uv pip install -r tools/config_editor/requirements.txt`.
3033

3134
3. Execute the script `tools/config_editor/app.py` from any folder. It will automatically detect the path to the root of the repository.
3235

@@ -36,9 +39,6 @@ To use it, follow these steps:
3639

3740
6. The script will show the compilation output in a new screen. Note that the compilation process can take many hours, depending on the number of libraries selected and the options chosen.
3841

39-
7. If the compilation is successful and the option to copy the libraries to the Arduino Core folder is enabled, it will already be available for use in the Arduino IDE. Otherwise, you can find the compiled libraries in the `esp32-arduino-libs` folder alongside this repository.
40-
- Note that the copy operation doesn't currently support the core downloaded from the Arduino IDE Boards Manager, only the manual installation from the [`arduino-esp32`](https://github.com/espressif/arduino-esp32) repository.
41-
4242
### Documentation
4343

4444
For more information about how to use the Library builder, please refer to this [Documentation page](https://docs.espressif.com/projects/arduino-esp32/en/latest/lib_builder.html?highlight=lib%20builder)

build.sh

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ if [ "$BUILD_TYPE" != "all" ]; then
125125
# Target Features Configs
126126
for target_json in `jq -c '.targets[]' configs/builds.json`; do
127127
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
128+
export CHIP_VARIANT=$(echo "$target_json" | jq -c '.chip_variant // "'$target'"' | tr -d '"')
128129

129-
# Check if $target is in the $TARGET array
130+
# Check if $CHIP_VARIANT is in the $TARGET array
130131
target_in_array=false
131132
for item in "${TARGET[@]}"; do
132-
if [ "$item" = "$target" ]; then
133+
if [ "$item" = "$CHIP_VARIANT" ]; then
133134
target_in_array=true
134135
break
135136
fi
@@ -140,12 +141,12 @@ if [ "$BUILD_TYPE" != "all" ]; then
140141
continue
141142
fi
142143

143-
configs="configs/defconfig.common;configs/defconfig.$target"
144+
configs="configs/defconfig.common;configs/defconfig.$CHIP_VARIANT"
144145
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
145146
configs="$configs;configs/defconfig.$defconf"
146147
done
147148

148-
echo "* Building for $target"
149+
echo "* Building for target: '$target', variant: '$CHIP_VARIANT'"
149150

150151
# Configs From Arguments
151152
for conf in $CONFIGS; do
@@ -175,36 +176,37 @@ echo "Framework built from
175176
#targets_count=`jq -c '.targets[] | length' configs/builds.json`
176177
for target_json in `jq -c '.targets[]' configs/builds.json`; do
177178
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
179+
export CHIP_VARIANT=$(echo "$target_json" | jq -c '.chip_variant // "'$target'"' | tr -d '"')
178180
target_skip=$(echo "$target_json" | jq -c '.skip // 0')
179181

180-
# Check if $target is in the $TARGET array if not "all"
182+
# Check if $CHIP_VARIANT is in the $TARGET array if not "all"
181183
if [ "$TARGET" != "all" ]; then
182184
target_in_array=false
183185
for item in "${TARGET[@]}"; do
184-
if [ "$item" = "$target" ]; then
186+
if [ "$item" = "$CHIP_VARIANT" ]; then
185187
target_in_array=true
186188
break
187189
fi
188190
done
189191

190-
# If $target is not in the $TARGET array, skip processing
192+
# If $CHIP_VARIANT is not in the $TARGET array, skip processing
191193
if [ "$target_in_array" = false ]; then
192-
echo "* Skipping Target: $target"
194+
echo "* Skipping Target: $CHIP_VARIANT"
193195
continue
194196
fi
195197
fi
196198

197199
# Skip chips that should not be a part of the final libs
198200
# WARNING!!! this logic needs to be updated when cron builds are split into jobs
199201
if [ "$TARGET" = "all" ] && [ $target_skip -eq 1 ]; then
200-
echo "* Skipping Target: $target"
202+
echo "* Skipping Target: $CHIP_VARIANT"
201203
continue
202204
fi
203205

204-
echo "* Target: $target"
206+
echo "* Target: '$target', Variant: '$CHIP_VARIANT'"
205207

206208
# Build Main Configs List
207-
main_configs="configs/defconfig.common;configs/defconfig.$target"
209+
main_configs="configs/defconfig.common;configs/defconfig.$CHIP_VARIANT"
208210
for defconf in `echo "$target_json" | jq -c '.features[]' | tr -d '"'`; do
209211
main_configs="$main_configs;configs/defconfig.$defconf"
210212
done

configs/builds.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@
5050
}
5151
],
5252
"targets":[
53+
{
54+
"chip_variant": "esp32p4_es",
55+
"target": "esp32p4",
56+
"features":["qio_ram"],
57+
"idf_libs":["qio","200m"],
58+
"bootloaders":[
59+
["qio","200m"]
60+
],
61+
"mem_variants":[
62+
[]
63+
]
64+
},
5365
{
5466
"target": "esp32p4",
5567
"features":["qio_ram"],

configs/defconfig.esp32c2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ CONFIG_XTAL_FREQ_26=y
22
CONFIG_XTAL_FREQ=26
33

44
CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB=y
5+
CONFIG_NEWLIB_NANO_FORMAT=y
56

67
#
78
# Bluetooth

configs/defconfig.esp32c3

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CONFIG_NEWLIB_NANO_FORMAT=y
2+
13
#
24
# Bluetooth
35
#

configs/defconfig.esp32h2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
CONFIG_NEWLIB_NANO_FORMAT=y
2+
13
#
24
# Bluetooth
35
#

configs/defconfig.esp32p4

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1+
# CONFIG_ESP32P4_SELECTS_REV_LESS_V3 is not set
12
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
23

4+
CONFIG_SPIRAM=y
5+
36
CONFIG_NEWLIB_NANO_FORMAT=y
47
CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB=y
58

6-
# Enable LP Core
7-
CONFIG_ULP_COPROC_ENABLED=y
8-
CONFIG_ULP_COPROC_TYPE_LP_CORE=y
9-
CONFIG_ULP_COPROC_RESERVE_MEM=8192
9+
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
10+
CONFIG_ESPTOOLPY_FLASHSIZE="16MB"
1011

1112
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_360=y
1213
CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y
1314
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1 is not set
1415

15-
CONFIG_SPIRAM=y
16-
1716
CONFIG_RTC_CLK_CAL_CYCLES=576
1817
# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set
1918
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=y

0 commit comments

Comments
 (0)