@@ -14,11 +14,38 @@ SET_BAUDRATE='-b 2000000'
1414
1515CTNG_VER=xtensa-fdpic
1616CTNG_CONFIG=xtensa-esp32s3-linux-uclibcfdpic
17- BUILDROOT_VER=xtensa-2024.05-fdpic
18- BUILDROOT_CONFIG=esp32s3_defconfig
17+ BUILDROOT_VER=xtensa-2024.08-fdpic
1918ESP_HOSTED_VER=ipc-5.1.1
2019ESP_HOSTED_CONFIG=sdkconfig.defaults.esp32s3
2120
21+ function die()
22+ {
23+ echo " $1 "
24+ exit 1
25+ }
26+
27+ while : ; do
28+ case " $1 " in
29+ -c)
30+ conf=" $2 "
31+ . " $conf "
32+ shift 2
33+ named_config=1
34+ ;;
35+ * )
36+ break
37+ ;;
38+ esac
39+ done
40+
41+ if [ -z " $named_config " ] ; then
42+ [ -f default.conf ] || { echo " Making devkit-c1-8m the default configuration" ; ln -s devkit-c1-8m.conf default.conf ; }
43+ . default.conf || die " No config selected and default.conf couldn't be loaded"
44+ fi
45+
46+ [ -n " $BUILDROOT_CONFIG " ] || die " BUILDROOT_CONFIG is missing"
47+ [ -n " $ESP_HOSTED_CONFIG " ] || die " ESP_HOSTED_CONFIG is missing"
48+
2249if [ ! -d autoconf-2.71/root/bin ] ; then
2350 wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.71.tar.xz
2451 tar -xf autoconf-2.71.tar.xz
@@ -33,7 +60,7 @@ if [ -z "$keep_toolchain$keep_buildroot$keep_rootfs$keep_bootloader" ] ; then
3360 rm -rf build
3461else
3562 [ -n " $keep_toolchain " ] || rm -rf build/crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
36- [ -n " $keep_rootfs " ] || rm -rf build/build-buildroot-esp32s3
63+ [ -n " $keep_rootfs " ] || rm -rf build/build-buildroot-$BUILDROOT_CONFIG
3764 [ -n " $keep_buildroot " ] || rm -rf build/buildroot
3865 [ -n " $keep_bootloader " ] || rm -rf build/esp-hosted
3966fi
@@ -73,14 +100,14 @@ else
73100 git pull
74101 popd
75102fi
76- if [ ! -d build-buildroot-esp32s3 ] ; then
77- nice make -C buildroot O=` pwd` /build-buildroot-esp32s3 $ BUILDROOT_CONFIG
78- buildroot/utils/config --file build-buildroot-esp32s3 /.config --set-str TOOLCHAIN_EXTERNAL_PATH ` pwd` /crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
79- buildroot/utils/config --file build-buildroot-esp32s3 /.config --set-str TOOLCHAIN_EXTERNAL_PREFIX ' $(ARCH)-esp32s3-linux-uclibcfdpic'
80- buildroot/utils/config --file build-buildroot-esp32s3 /.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX ' $(ARCH)-esp32s3-linux-uclibcfdpic'
103+ if [ ! -d build-buildroot-$BUILDROOT_CONFIG ] ; then
104+ nice make -C buildroot O=` pwd` /build-buildroot-$BUILDROOT_CONFIG ${ BUILDROOT_CONFIG} _defconfig || die " Could not apply buildroot config ${BUILDROOT_CONFIG} _defconfig "
105+ buildroot/utils/config --file build-buildroot-$BUILDROOT_CONFIG /.config --set-str TOOLCHAIN_EXTERNAL_PATH ` pwd` /crosstool-NG/builds/xtensa-esp32s3-linux-uclibcfdpic
106+ buildroot/utils/config --file build-buildroot-$BUILDROOT_CONFIG /.config --set-str TOOLCHAIN_EXTERNAL_PREFIX ' $(ARCH)-esp32s3-linux-uclibcfdpic'
107+ buildroot/utils/config --file build-buildroot-$BUILDROOT_CONFIG /.config --set-str TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX ' $(ARCH)-esp32s3-linux-uclibcfdpic'
81108fi
82- nice make -C buildroot O=` pwd` /build-buildroot-esp32s3
83- [ -f build-buildroot-esp32s3 /images/xipImage -a -f build-buildroot-esp32s3 /images/rootfs.cramfs -a -f build-buildroot-esp32s3 /images/etc.jffs2 ] || exit 1
109+ nice make -C buildroot O=` pwd` /build-buildroot-$BUILDROOT_CONFIG
110+ [ -f build-buildroot-$BUILDROOT_CONFIG /images/xipImage -a -f build-buildroot-$BUILDROOT_CONFIG /images/rootfs.cramfs -a -f build-buildroot-$BUILDROOT_CONFIG /images/etc.jffs2 ] || exit 1
84111
85112#
86113# bootloader
@@ -92,7 +119,7 @@ cd esp-idf
92119. export.sh
93120cd ../network_adapter
94121idf.py set-target esp32s3
95- cp $ESP_HOSTED_CONFIG sdkconfig
122+ cp $ESP_HOSTED_CONFIG sdkconfig || die " Could not apply IDF config $ESP_HOSTED_CONFIG "
96123idf.py build
97124read -p ' ready to flash... press enter'
98125while ! idf.py $SET_BAUDRATE flash ; do
103130#
104131# flash
105132#
106- parttool.py $SET_BAUDRATE write_partition --partition-name linux --input build-buildroot-esp32s3 /images/xipImage
107- parttool.py $SET_BAUDRATE write_partition --partition-name rootfs --input build-buildroot-esp32s3 /images/rootfs.cramfs
133+ parttool.py $SET_BAUDRATE write_partition --partition-name linux --input build-buildroot-$BUILDROOT_CONFIG /images/xipImage
134+ parttool.py $SET_BAUDRATE write_partition --partition-name rootfs --input build-buildroot-$BUILDROOT_CONFIG /images/rootfs.cramfs
108135if [ -z " $keep_etc " ] ; then
109136 read -p ' ready to flash /etc... press enter'
110- parttool.py $SET_BAUDRATE write_partition --partition-name etc --input build-buildroot-esp32s3 /images/etc.jffs2
137+ parttool.py $SET_BAUDRATE write_partition --partition-name etc --input build-buildroot-$BUILDROOT_CONFIG /images/etc.jffs2
111138fi
0 commit comments