Rakefile: erase flash before flashing bootlaoder
This commit is contained in:
parent
9f70665fbc
commit
fd21fbcc95
2
Rakefile
2
Rakefile
|
@ -213,7 +213,7 @@ desc "flash bootloader using SWD"
|
||||||
task :flash_bootloader => BOOTLOADER+".hex" do |t|
|
task :flash_bootloader => BOOTLOADER+".hex" do |t|
|
||||||
case SWD_ADAPTER
|
case SWD_ADAPTER
|
||||||
when "STLINKV2"
|
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"
|
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}"
|
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
|
end
|
||||||
|
|
Loading…
Reference in New Issue