This commit is contained in:
James
2024-04-23 19:45:13 +01:00
commit 904eda08b8
14 changed files with 955 additions and 0 deletions

BIN
bin/boot_app0.bin Normal file

Binary file not shown.

BIN
bin/bootloader_qio_80m.bin Normal file

Binary file not shown.

29
bin/build Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
if [ ! -d "Compiled" ] ; then mkdir Compiled ; fi
if [ "${DRONE_TAG}" ] ; then
NAME=${DRONE_TAG}
elif [ "${DRONE_BRANCH}" ] ; then
NAME=${DRONE_BRANCH}-${DRONE_BUILD_NUMBER}
else
NAME=`git symbolic-ref --short HEAD`
fi
LIBS="--library `pwd`/libs/ESPAsyncWebServer/src --library `pwd`/libs/ArduinoRS485/src"
LIBS=""
if [ ! "$1" ] || [ "$1" == "0" ] ; then
echo "#define VERSION \"${NAME}\"" >> compile_flags.h
arduino-cli compile $LIBS -e -b esp32:esp32:esp32 || exit 1
mv build/esp32.esp32.esp32/*.ino.bin Compiled/${NAME}_HW0.bin
mv build/esp32.esp32.esp32/*.ino.elf Compiled/${NAME}_HW0.elf
mv build/esp32.esp32.esp32/*.ino.partitions.bin Compiled/${NAME}_HW0.partitions.bin
#if [ "$1" ] ; then
bin/flash Compiled/${NAME}_HW0.bin
#fi
fi
if [ ! "$1" ] ; then
7z a -mx=9 Compiled/${NAME}.elf.7z Compiled/*.elf
rm Compiled/*.elf
fi

17
bin/flash Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
BASENAME=${1%.bin};
esptool.py \
-b 921600 \
--chip esp32 \
--before default_reset \
--after hard_reset \
write_flash \
-z \
--flash_mode dio \
--flash_freq 80m \
--flash_size detect \
0x10000 $BASENAME.bin \
0x8000 $BASENAME.partitions.bin \
0xe000 bin/boot_app0.bin \
0x1000 bin/bootloader_qio_80m.bin