Skip to content

Commit 136d9fd

Browse files
authored
add p4 rev.300 support
1 parent 84d7c08 commit 136d9fd

23 files changed

+400
-189
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: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"file":"libspi_flash.a",
55
"src":"build/esp-idf/spi_flash/libspi_flash.a",
66
"out":"lib/libspi_flash.a",
7-
"targets":["esp32","esp32c2","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2","esp32p4"]
7+
"targets":["esp32","esp32c2","esp32c3","esp32s2","esp32s3","esp32c6","esp32h2","esp32p4","esp32c5","esp32c61"]
88
},
99
{
1010
"file":"libesp_psram.a",
@@ -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.esp32c5

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
CONFIG_XTAL_FREQ_AUTO=y
2+
CONFIG_XTAL_FREQ=0
3+
CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP=y
4+
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y
5+
CONFIG_SPIRAM=y
6+
7+
CONFIG_NEWLIB_NANO_FORMAT=y
8+
9+
#
10+
# Bluetooth
11+
#
12+
CONFIG_BT_ENABLED=y
13+
CONFIG_BT_STACK_NO_LOG=y
14+
# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set
15+
# CONFIG_BLE_MESH is not set
16+
CONFIG_BT_NIMBLE_ENABLED=y
17+
CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
18+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
19+
# CONFIG_BT_NIMBLE_NVS_PERSIST is not set
20+
# CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS is not set
21+
# CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY is not set
22+
# CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY is not set
23+
# CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT is not set
24+
25+
CONFIG_BT_CTRL_MODEM_SLEEP=y
26+
CONFIG_BT_CTRL_MODEM_SLEEP_MODE_1=y
27+
CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL=y
28+
# CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW is not set
29+
CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE=y
30+
CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE=y
31+
CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE=y
32+
CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE=y
33+
CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE=y
34+
CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE=y
35+
CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE=y
36+
CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE=y
37+
CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE=y
38+
CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE=y
39+
CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE=y
40+
CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE=y
41+
CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE=y
42+
CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE=y
43+
CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE=y
44+
CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE=y
45+
CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE=y
46+
CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE=y
47+
CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE=y
48+
CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE=y
49+
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE=y
50+
CONFIG_RTC_CLK_CAL_CYCLES=576
51+
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set
52+
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304
53+
54+
# This Enables RISCV LP - but it can't be used within Arduino at this time.
55+
#CONFIG_ULP_COPROC_ENABLED=y
56+
#CONFIG_ULP_COPROC_LP_CORE=y
57+
#CONFIG_ULP_COPROC_RESERVE_MEM=4096
58+
59+
#
60+
# Zigbee
61+
#
62+
CONFIG_ZB_ENABLED=y
63+
CONFIG_ZB_ZED=y
64+
CONFIG_ZB_RADIO_NATIVE=y
65+
# end of Zigbee

configs/defconfig.esp32c61

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
CONFIG_SPIRAM=y
2+
3+
# Enable LP Core
4+
CONFIG_ULP_COPROC_ENABLED=y
5+
CONFIG_ULP_COPROC_TYPE_LP_CORE=y
6+
CONFIG_ULP_COPROC_RESERVE_MEM=8192
7+
8+
#
9+
# Bluetooth
10+
#
11+
CONFIG_BT_ENABLED=y
12+
CONFIG_BT_STACK_NO_LOG=y
13+
# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set
14+
# CONFIG_BLE_MESH is not set
15+
CONFIG_BT_NIMBLE_ENABLED=y
16+
CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
17+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=2
18+
# CONFIG_BT_NIMBLE_NVS_PERSIST is not set
19+
# CONFIG_BT_NIMBLE_CRYPTO_STACK_MBEDTLS is not set
20+
# CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_2M_PHY is not set
21+
# CONFIG_BT_NIMBLE_LL_CFG_FEAT_LE_CODED_PHY is not set
22+
# CONFIG_BT_NIMBLE_50_FEATURE_SUPPORT is not set
23+
24+
CONFIG_BT_CTRL_MODEM_SLEEP=y
25+
CONFIG_BT_CTRL_MODEM_SLEEP_MODE_1=y
26+
CONFIG_BT_CTRL_LPCLK_SEL_MAIN_XTAL=y
27+
# CONFIG_BT_CTRL_LPCLK_SEL_RTC_SLOW is not set
28+
CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE=y
29+
CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE=y
30+
CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE=y
31+
CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE=y
32+
CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE=y
33+
CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE=y
34+
CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE=y
35+
CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE=y
36+
CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE=y
37+
CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE=y
38+
CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE=y
39+
CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE=y
40+
CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE=y
41+
CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE=y
42+
CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE=y
43+
CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE=y
44+
CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE=y
45+
CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE=y
46+
CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE=y
47+
CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE=y
48+
CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE=y
49+
CONFIG_RTC_CLK_CAL_CYCLES=576
50+
# CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 is not set
51+
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=2304

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
#

0 commit comments

Comments
 (0)