Skip to content

Commit

Permalink
tools/autobuild: Update auto-build code to build esp32 port with IDF v5.
Browse files Browse the repository at this point in the history
Signed-off-by: Damien George <damien@micropython.org>
  • Loading branch information
dpgeorge committed Jun 23, 2023
1 parent 6a9db52 commit 273ba28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 41 deletions.
15 changes: 4 additions & 11 deletions tools/autobuild/autobuild.sh
Expand Up @@ -4,22 +4,16 @@
#
# Requirements:
# - All toolchains must be in path (arm-none-eabi-gcc, xtensa-lx106-elf)
# - IDF_PATH_V42 must be set
# - IDF_PATH_V44 must be set
# - IDF_PATH_V50 must be set
# - MICROPY_AUTOBUILD_MICROPYTHON_REPO must be set to location of micropython repository
# - MICROPY_AUTOBUILD_MAKE must be set to the make command to use, eg "make -j2"
#
# Optional settings:
# - MICROPY_AUTOBUILD_REMOTE_MACHINE can be set to a remote ssh machine to copy files to
# - MICROPY_AUTOBUILD_REMOTE_DIR can be set to destination directory on remote machine

if [ ! -d "$IDF_PATH_V42" ]; then
echo "must set IDF_PATH_V42"
exit 1
fi

if [ ! -d "$IDF_PATH_V44" ]; then
echo "must set IDF_PATH_V44"
if [ ! -d "$IDF_PATH_V50" ]; then
echo "must set IDF_PATH_V50"
exit 1
fi

Expand Down Expand Up @@ -70,8 +64,7 @@ ${AUTODIR}/build-cc3200-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../esp8266
${AUTODIR}/build-esp8266-latest.sh ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../esp32
(source ${IDF_PATH_V42}/export.sh && build_esp32_boards ${FW_TAG} ${LOCAL_FIRMWARE})
(source ${IDF_PATH_V44}/export.sh && build_esp32_boards ${FW_TAG} ${LOCAL_FIRMWARE})
(source ${IDF_PATH_V50}/export.sh && build_esp32_boards ${FW_TAG} ${LOCAL_FIRMWARE})
cd ../mimxrt
build_mimxrt_boards ${FW_TAG} ${LOCAL_FIRMWARE}
cd ../nrf
Expand Down
31 changes: 1 addition & 30 deletions tools/autobuild/build-boards.sh
Expand Up @@ -62,36 +62,7 @@ function build_boards {
}

function build_esp32_boards {
# check/get parameters
if [ $# != 2 ]; then
echo "usage: $0 <fw-tag> <dest-dir>"
return 1
fi

fw_tag=$1
dest_dir=$2

# check we are in the correct directory
if [ ! -r modesp32.c ]; then
echo "must be in esp32 directory"
return 1
fi

# build the boards, based on the IDF version
for board_json in $(find boards/ -name board.json | sort); do
mcu=$(cat $board_json | python3 -c "import json,sys; print(json.load(sys.stdin).get('mcu', 'unknown'))")
if idf.py --version | grep -q v4.2; then
if [ $mcu = esp32 ]; then
# build standard esp32-based boards with IDF v4.2
build_board $board_json $fw_tag $dest_dir bin elf map
fi
else
if [ $mcu != esp32 ]; then
# build esp32-s2/s3/c3 based boards with IDF v4.4+
build_board $board_json $fw_tag $dest_dir bin elf map uf2
fi
fi
done
build_boards modesp32.c $1 $2 bin elf map uf2
}

function build_mimxrt_boards {
Expand Down

0 comments on commit 273ba28

Please sign in to comment.