diff --git a/dev/scripts/flash.sh b/dev/scripts/flash.sh index ec3caafa..3a9252ef 100644 --- a/dev/scripts/flash.sh +++ b/dev/scripts/flash.sh @@ -1,2 +1,6 @@ #! /bin/bash -openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "program /home/app/build/*.elf verify reset exit" +elf_file=$(ls /home/app/build/*.elf) + +printf "$elf_file" + +openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "program $elf_file verify reset exit" \ No newline at end of file diff --git a/dev/scripts/gdb.sh b/dev/scripts/gdb.sh index cd51d724..f3142854 100644 --- a/dev/scripts/gdb.sh +++ b/dev/scripts/gdb.sh @@ -1,2 +1,8 @@ #! /bin/bash -openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "init" -c "reset halt" & sleep 1 && arm-none-eabi-gdb /home/app/build/*.elf -ex "target remote localhost:3333" +elf_file=$(ls /home/app/build/*.elf) + +printf "$elf_file" + +openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "adapter speed 5000" -c "init" -c "reset halt" & sleep 1 && arm-none-eabi-gdb $elf_file -ex "target remote localhost:3333" + +kill $(pidof openocd)