diff --git a/flash.sh b/flash.sh index e69de29..0ee514e 100644 --- a/flash.sh +++ b/flash.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Check if the program name is provided as an argument +if [ -z "$1" ]; then + echo "Please provide the program name as an argument." + exit 1 +fi + +# Assign the program name to a variable +PROGRAM_NAME=$1 + +# Execute the commands +make -j8 all -C ./Debug +STM32_Programmer_CLI.exe -c port=SWD freq=4000 -e all +STM32_Programmer_CLI.exe -c port=SWD freq=4000 -w ./Debug/${PROGRAM_NAME}.elf 0x08000000 -g