From 0aab25e870006235be4f5934eba898e3cd9a7bc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Sat, 4 Jan 2020 14:33:23 +0100 Subject: [PATCH] Rakefile: add debug bootloader target --- Rakefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Rakefile b/Rakefile index 08d1413..ec51220 100644 --- a/Rakefile +++ b/Rakefile @@ -240,3 +240,15 @@ task :debug => APPLICATION+".elf" do |t| exec("#{GDB} --eval-command='target extended-remote #{BMP_PORT}' --eval-command='monitor version' --eval-command='monitor swdp_scan' --eval-command='attach 1' #{t.source}") end end + +# debug application using GDB +desc "debug bootloader using GDB" +task :debug_bootloader => BOOTLOADER+".elf" do |t| + case SWD_ADAPTER + when "STLINKV2" + # for GDB to work with openOCD the firmware needs to be reloaded + exec("#{GDB} --eval-command='target remote | #{OOCD} --file interface/#{OOCD_INTERFACE}.cfg --file target/#{OOCD_TARGET}.cfg --command \"gdb_port pipe; log_output /dev/null; init\"' --eval-command='monitor reset halt' --eval-command='load' --eval-command='monitor reset init' #{t.source}") + when "BMP" + exec("#{GDB} --eval-command='target extended-remote #{BMP_PORT}' --eval-command='monitor version' --eval-command='monitor swdp_scan' --eval-command='attach 1' #{t.source}") + end +end