Debian Codegraph @

tests/site_scons/platforms/stm32/run_test.sh

raw
1 #!/bin/bash
2
3 BINARY=$1
4 BASENAME=$(basename $1)
5 shift
6 ARGS=$*
7
8 test X$OPENOCD_BOARD == X && export OPENOCD_BOARD=board/stm32f7discovery.cfg
9
10 timeout 1200s openocd -f $OPENOCD_BOARD \
11 -c "reset_config srst_only srst_nogate connect_assert_srst" \
12 -c "init" -c "arm semihosting enable" \
13 -c "arm semihosting_cmdline $BASENAME $ARGS" \
14 -c "reset halt" \
15 -c "load_image $BINARY 0" \
16 -c "reset halt" -c "resume 0x20000040" 2>openocd.log
17
18 RESULT=$?
19
20 if [ "$RESULT" -ne "0" ]
21 then
22 cat openocd.log >&2
23 echo >&2
24 fi
25
26 exit $RESULT
27
28