|
| 1 | +#!/bin/bash -e |
| 2 | + |
| 3 | +[ -z "$1" ] && echo "First argument is not set, set to the version, e.g. 2025.2.1" && exit 1 |
| 4 | +version=$1 |
| 5 | + |
| 6 | +echo "Remove dist dir" |
| 7 | +dist_dir=$(realpath dist) |
| 8 | +rm -rf $dist_dir |
| 9 | +mkdir $dist_dir |
| 10 | + |
| 11 | +echo "Clean before build" |
| 12 | +cd ot-ti |
| 13 | +git clean -dxf && \ |
| 14 | + git restore . && \ |
| 15 | + git submodule foreach 'git clean -dxf' && \ |
| 16 | + git submodule foreach --recursive 'git restore .' |
| 17 | + |
| 18 | +items=( |
| 19 | + # target name CC1352P_2_OTHER |
| 20 | + "LP_CC2652RB,CC2652RB,false" |
| 21 | + "CC1352P_2_LAUNCHXL,CC1352P2_CC2652P_launchpad,false" |
| 22 | + "CC1352P_2_LAUNCHXL,CC1352P2_CC2652P_other,true" |
| 23 | + "LP_CC1352P7_4,CC1352P7,false" |
| 24 | + "CC26X2R1_LAUNCHXL,CC2652R,false" |
| 25 | + "LP_CC2652R7,CC2652R7,false" |
| 26 | +) |
| 27 | + |
| 28 | +for target in "${items[@]}"; do |
| 29 | + IFS=',' read -r -a values <<< "$target" |
| 30 | + target="${values[0]}" |
| 31 | + name="${values[1]}" |
| 32 | + CC1352P_2_OTHER="${values[2]}" |
| 33 | + |
| 34 | + echo "Compiling: target=$target name=$name CC1352P_2_OTHER=$CC1352P_2_OTHER" |
| 35 | + file_name="${name}_ot_rcp_${version//./_}" |
| 36 | + CC1352P_2_OTHER="$CC1352P_2_OTHER" FW_VERSION="$version" ./script/build $target |
| 37 | + /opt/ti/ti-cgt-armllvm_4.0.1.LTS/bin/tiarmobjcopy build/bin/ot-rcp.out \ |
| 38 | + --output-target ihex build/bin/$file_name.hex |
| 39 | + pushd build/bin |
| 40 | + zip $dist_dir/$file_name.zip $file_name.hex |
| 41 | + popd |
| 42 | +done |
| 43 | + |
| 44 | +echo "Done!" |
0 commit comments