spidump/build.sh

23 lines
604 B
Bash
Raw Normal View History

2024-01-25 15:31:51 +00:00
#!/bin/busybox ash
set -e
cargo +stable build --release
output_dir="target/thumbv7m-none-eabi/release"
output_name="spidump"
llvm-size -d "$output_dir/$output_name" | (
read line
echo $line
read line
echo $line | sed -r ':L;s=\b([0-9]+)([0-9]{3})\b=\1K=g;t L'
) | column -t -s' '
llvm-objcopy -O binary "$output_dir/$output_name" "$output_dir/$output_name.bin"
if [ "$(basename "$0")" == "flash.sh" ]; then
echo "Writing file $output_dir/$output_name.bin to device ..."
2024-01-30 15:01:38 +00:00
stm32flash -w "$output_dir/$output_name.bin" -v /dev/ttyUSB0
# st-flash write "$output_dir/$output_name.bin" 0x8000000
2024-01-25 15:31:51 +00:00
fi