micropython-samples/fastbuild/buildpyb

55 wiersze
1.4 KiB
Plaintext
Czysty Zwykły widok Historia

2016-11-26 14:03:24 +00:00
#! /bin/bash
2016-11-27 13:49:44 +00:00
# Detect attached pyboard variant build and deploy
# Assumes only one device attached and that this will appear as /dev/pyboard (udev rule)
2016-11-26 14:03:24 +00:00
# requires pyb_check
2016-11-27 13:49:44 +00:00
# Also requires the pyboard.py utility to be on the path (micropython/tools/pyboard.py)
2016-11-26 14:03:24 +00:00
2016-12-01 17:21:11 +00:00
MPDEVICE='/dev/pyboard'
2019-11-01 15:42:50 +00:00
MANIFESTS='/mnt/qnap2/Scripts/manifests'
2016-12-01 17:21:11 +00:00
# Determine board type
BOARD=$(pyb_check $MPDEVICE)
2019-11-01 15:42:50 +00:00
# Currently have only two manifest variants for V1.x and D
if [[ $BOARD == 'PYBV11' || $BOARD == 'PYBV10' || $BOARD == 'PYBLITEV10' ]]
then
MANIFEST=$MANIFESTS/pyb_v1_manifest.py
fi
if [[ $BOARD == 'PYBD_SF2' || $BOARD == 'PYBD_SF3' || $BOARD == 'PYBD_SF6' ]]
then
MANIFEST=$MANIFESTS/pyb_d_manifest.py
fi
2016-11-26 14:03:24 +00:00
2016-12-01 17:21:11 +00:00
# Check for user override of frozen directory
if [ $FROZEN_DIR ]
then
echo Frozen modules located in $FROZEN_DIR
else
FROZEN_DIR='modules'
fi
2016-11-26 14:03:24 +00:00
if [ $BOARD ]
then
echo Building for $BOARD
cd $MPDIR/ports/stm32
2020-10-21 07:52:18 +00:00
if [ $# -eq 1 ] && [ $1 = "--minimal" ]
then
MANIFEST=$MANIFESTS/minimal_manifest.py
make BOARD=$BOARD clean
fi
2016-11-26 14:03:24 +00:00
if [ $# -eq 1 ] && [ $1 = "--clean" ]
then
make BOARD=$BOARD clean
fi
make submodules
2020-10-21 07:52:18 +00:00
if make -j 8 BOARD=$BOARD FROZEN_MANIFEST=$MANIFEST MICROPY_VFS_LFS2=1 && pyb_boot $MPDEVICE
2016-11-26 14:03:24 +00:00
then
sleep 1
2019-11-01 15:42:50 +00:00
make PYTHON=python3 BOARD=$BOARD FROZEN_MANIFEST=$MANIFEST deploy
2016-11-26 14:03:24 +00:00
else
echo Build failure
fi
cd -
2016-11-26 14:03:24 +00:00
else
echo Incorrect board type
fi