From fd21fbcc9518031fd6043ffc97513437ee8153df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Fri, 13 Dec 2019 14:43:06 +0100 Subject: [PATCH] Rakefile: erase flash before flashing bootlaoder --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 3d56ea7..7743954 100644 --- a/Rakefile +++ b/Rakefile @@ -213,7 +213,7 @@ desc "flash bootloader using SWD" task :flash_bootloader => BOOTLOADER+".hex" do |t| case SWD_ADAPTER when "STLINKV2" - sh "#{OOCD} --file interface/#{OOCD_INTERFACE}.cfg --file target/#{OOCD_TARGET}.cfg --command 'init' --command 'reset init' --command 'flash write_image erase #{t.source}' --command 'reset' --command 'shutdown'" + sh "#{OOCD} --file interface/#{OOCD_INTERFACE}.cfg --file target/#{OOCD_TARGET}.cfg --command 'init' --command 'reset init' --command 'flash erase_sector 0 0 last' --command 'flash write_image erase #{t.source}' --command 'reset' --command 'shutdown'" when "BMP" sh "#{GDB} --eval-command='target extended-remote #{BMP_PORT}' --eval-command='set confirm off' --eval-command='monitor swdp_scan' --eval-command='attach 1' --eval-command='load' --eval-command='kill' --eval-command='quit' #{t.source}" end