forked from pine64/bl_iot_sdk
-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathrun.sh
executable file
·45 lines (34 loc) · 955 Bytes
/
run.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
#!/usr/bin/env bash
# macOS script to build, flash and run BL602 Firmware
set -e # Exit when any command fails
set -x # Echo commands
# Name of app
export APP_NAME=sdk_app_adc2
# Build for BL602
export CONFIG_CHIP_NAME=BL602
# Where BL602 IoT SDK is located
export BL60X_SDK_PATH=$PWD/../..
# Where blflash is located
export BLFLASH_PATH=$PWD/../../../blflash
# Where GCC is located
export GCC_PATH=$PWD/../../../xpack-riscv-none-embed-gcc
# Build the firmware
make
# Generate the disassembly
$GCC_PATH/bin/riscv-none-embed-objdump \
-t -S --demangle --line-numbers --wide \
build_out/$APP_NAME.elf \
>build_out/$APP_NAME.S \
2>&1
# Copy firmware to blflash
cp build_out/$APP_NAME.bin $BLFLASH_PATH
# Flash the firmware
pushd $BLFLASH_PATH
cargo run flash $APP_NAME.bin \
--port /dev/tty.usbserial-14* \
--initial-baud-rate 230400 \
--baud-rate 230400
sleep 5
popd
# Run the firmware
open -a CoolTerm