Skip to content

Commit f0d7aca

Browse files
authored
Merge branch 'master' into feature/tinyusb_host
2 parents 6be5ecb + fc0e6bb commit f0d7aca

File tree

3 files changed

+67
-2
lines changed

3 files changed

+67
-2
lines changed

build.sh

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [ -z $DEPLOY_OUT ]; then
3131
fi
3232

3333
function print_help() {
34-
echo "Usage: build.sh [-s] [-n] [-A <arduino_branch>] [-I <idf_branch>] [-D <debug_level>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf-libs|copy-bootloader|mem-variant>] [config ...]"
34+
echo "Usage: build.sh [-s] [-n] [-A <arduino_branch>] [-I <idf_branch>] [-D <debug_level>] [-i <idf_commit>] [-c <path>] [-t <target>] [-b <build|menuconfig|reconfigure|idf-libs|copy-bootloader|mem-variant|hosted>] [config ...]"
3535
echo " -s Skip installing/updating of ESP-IDF and all components"
3636
echo " -n Disable ccache"
3737
echo " -A Set which branch of arduino-esp32 to be used for compilation"
@@ -87,7 +87,8 @@ while getopts ":A:I:i:c:t:b:D:sde" opt; do
8787
[ "$b" != "reconfigure" ] &&
8888
[ "$b" != "idf-libs" ] &&
8989
[ "$b" != "copy-bootloader" ] &&
90-
[ "$b" != "mem-variant" ]; then
90+
[ "$b" != "mem-variant" ] &&
91+
[ "$b" != "hosted" ]; then
9192
print_help
9293
fi
9394
BUILD_TYPE="$b"
@@ -137,6 +138,11 @@ if [ "$BUILD_TYPE" != "all" ]; then
137138
print_help
138139
fi
139140

141+
if [ "$BUILD_TYPE" == "hosted" ]; then
142+
./tools/build-hosted.sh
143+
exit $?
144+
fi
145+
140146
# Target Features Configs
141147
for target_json in `jq -c '.targets[]' configs/builds.json`; do
142148
target=$(echo "$target_json" | jq -c '.target' | tr -d '"')
@@ -226,6 +232,12 @@ for target_json in `jq -c '.targets[]' configs/builds.json`; do
226232
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" idf-libs
227233
if [ $? -ne 0 ]; then exit 1; fi
228234

235+
# Build ESP-Hosted slave firmwares
236+
if [ "$target" == "esp32p4" ]; then
237+
./tools/build-hosted.sh
238+
fi
239+
240+
# Build ESP-SR Models
229241
if [ "$target" == "esp32s3" ] || [ "$target" == "esp32p4" ]; then
230242
idf.py -DIDF_TARGET="$target" -DSDKCONFIG_DEFAULTS="$idf_libs_configs" srmodels_bin
231243
if [ $? -ne 0 ]; then exit 1; fi

configs/defconfig.common

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ CONFIG_LWIP_ETHARP_TRUST_IP_MAC=y
5656
# CONFIG_LWIP_DHCP_DOES_ARP_CHECK is not set
5757
CONFIG_LWIP_TCP_SYNMAXRTX=6
5858
CONFIG_LWIP_TCP_MSS=1436
59+
CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744
5960
CONFIG_LWIP_TCP_RTO_TIME=3000
6061
CONFIG_LWIP_TCP_SACK_OUT=y
6162
CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=4096

tools/build-hosted.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/bash
2+
3+
CCACHE_ENABLE=1
4+
5+
export IDF_CCACHE_ENABLE=$CCACHE_ENABLE
6+
source ./tools/config.sh
7+
8+
SLAVE_DIR="$AR_MANAGED_COMPS/espressif__esp_hosted/slave"
9+
10+
if [ ! -d "$SLAVE_DIR" ]; then
11+
echo "ESP-Hosted component not found!"
12+
exit 1
13+
fi
14+
15+
VERSION_FILE="$SLAVE_DIR/main/esp_hosted_coprocessor_fw_ver.h"
16+
17+
if [ ! -f "$VERSION_FILE" ]; then
18+
echo "Error: File $VERSION_FILE not found!"
19+
exit 1
20+
fi
21+
22+
MAJOR=$(grep "PROJECT_VERSION_MAJOR_1" "$VERSION_FILE" | sed 's/.*PROJECT_VERSION_MAJOR_1 \([0-9]*\).*/\1/')
23+
MINOR=$(grep "PROJECT_VERSION_MINOR_1" "$VERSION_FILE" | sed 's/.*PROJECT_VERSION_MINOR_1 \([0-9]*\).*/\1/')
24+
PATCH=$(grep "PROJECT_VERSION_PATCH_1" "$VERSION_FILE" | sed 's/.*PROJECT_VERSION_PATCH_1 \([0-9]*\).*/\1/')
25+
26+
if [ -z "$MAJOR" ] || [ -z "$MINOR" ] || [ -z "$PATCH" ]; then
27+
echo "Error: Could not extract all version infos!"
28+
echo "MAJOR: '$MAJOR', MINOR: '$MINOR', PATCH: '$PATCH'"
29+
exit 1
30+
fi
31+
32+
VERSION="$MAJOR.$MINOR.$PATCH"
33+
echo "Building ESP-Hosted firmware $VERSION"
34+
35+
cd "$SLAVE_DIR"
36+
37+
OUTPUT_DIR="$AR_TOOLS/esp32-arduino-libs/hosted"
38+
mkdir -p "$OUTPUT_DIR"
39+
40+
TARGETS=(
41+
"esp32c5"
42+
"esp32c6"
43+
)
44+
45+
for target in "${TARGETS[@]}"; do
46+
echo "Building for target: $target"
47+
idf.py set-target "$target"
48+
idf.py clean
49+
idf.py build
50+
cp "$SLAVE_DIR/build/network_adapter.bin" "$OUTPUT_DIR/$target-v$VERSION.bin"
51+
echo "Build completed: $target-v$VERSION.bin"
52+
done

0 commit comments

Comments
 (0)