-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·56 lines (44 loc) · 1.42 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# y for printf on usb_cdc_acm and n for printf on uart
SUPPORT_USBSTDIO_ENABLE=y
APP=rtos_demo
APP_DIR=m0sense_apps
if [ "$1" != "" ]; then
if [ "$1" == "clean" ]; then
rm -rf m0sense_apps/**/submodule_commit_info.txt bl_mcu_sdk/{build,out}
echo "clean the produced files!"
exit
fi
if [ "$1" == "patch" ]; then
cd bl_mcu_sdk
git switch -c patch
git reset --hard origin/release_v1.4.5
git am --keep-cr ../misc/sdk_patch/*.patch
echo "Apply patch for you!"
cd ..
exit
fi
if [ ! -d "$1" -o ! -f "$1/CMakeLists.txt" ]; then
echo "no this app project \"$1\"!"
exit
fi
APP=${1##*/}
APP_DIR=${1%%/$APP}
fi
if [ "${APP_DIR%%/*}" != "m0sense_apps" -a "$SUPPORT_USBSTDIO_ENABLE" == "y" ]; then
echo "not support \`SUPPORT_USBSTDIO_ENABLE=y\` yet, please disable it in build.sh!"
exit
fi
cd bl_mcu_sdk
if [ $SUPPORT_USBSTDIO_ENABLE == "y" -a $(git rev-parse HEAD) == $(git rev-parse origin/release_v1.4.5) ]; then
git am --signoff --keep-cr ../misc/sdk_patch/*.patch
echo "Apply patch for you!"
fi
make APP=$APP APP_DIR=../$APP_DIR BOARD=bl702_iot SUPPORT_FLOAT=y SUPPORT_USBSTDIO_ENABLE=$SUPPORT_USBSTDIO_ENABLE
cd ..
TARGET=bl_mcu_sdk/out/$APP_DIR/$APP/${APP}_bl702.bin
ls -alh $TARGET
# extra
if [ ! "$APP" == "m0sense_boot" ]; then
UF2_CVT="misc/utils/uf2_convert"
$UF2_CVT $TARGET uf2_demos/${APP}.uf2
fi