From 1ffa11299f1304be5317b0043f001cc5f77ec7e4 Mon Sep 17 00:00:00 2001 From: EvArk Date: Fri, 27 Apr 2018 15:07:16 +0300 Subject: [PATCH 1/3] Add Blackmagic (BMP) support for Generic F103 --- boards.txt | 4 ++++ platform.txt | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/boards.txt b/boards.txt index d7524d1f82..ca69369b34 100644 --- a/boards.txt +++ b/boards.txt @@ -418,6 +418,10 @@ GenF103.menu.upload_method.serialMethod=Serial GenF103.menu.upload_method.serialMethod.upload.protocol=maple_serial GenF103.menu.upload_method.serialMethod.upload.tool=serial_upload +GenF103.menu.upload_method.serialMethod=BMP (Black Magic Probe) +GenF103.menu.upload_method.serialMethod.upload.protocol=gdb_bmp +GenF103.menu.upload_method.serialMethod.upload.tool=bmp_upload + ############################### # Maple Maple.name=Maple series diff --git a/platform.txt b/platform.txt index 8aec01d6d4..b3b9dfb27f 100644 --- a/platform.txt +++ b/platform.txt @@ -172,3 +172,11 @@ tools.serial_upload.path.linux64={runtime.hardware.path}/tools/linux64 tools.serial_upload.upload.params.verbose=-d tools.serial_upload.upload.params.quiet=n tools.serial_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.altID} {upload.usbID} "{build.path}/{build.project_name}.bin" + +# blackmagic upload for generic STM32 +tools.bmp_upload.cmd=arm-none-eabi-gdb +tools.bmp_upload.path={runtime.tools.arm-none-eabi-gcc.path}/bin/ +tools.bmp_upload.upload.speed=230400 +tools.bmp_upload.upload.params.verbose= +tools.bmp_upload.upload.params.quiet=-q --batch-silent +tools.bmp_upload.upload.pattern="{path}{cmd}" -cd "{build.path}" -b {upload.speed} {upload.verbose} -ex "set debug remote 0" -ex "set target-async off" -ex "set remotetimeout 60" -ex "set mem inaccessible-by-default off" -ex "set confirm off" -ex "set height 0" -ex "target extended-remote {serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "x/wx 0x8000004" -ex "monitor erase_mass" -ex "echo 0x8000004 expect 0xffffffff after erase\n" -ex "x/wx 0x8000004" -ex "file {build.project_name}.elf" -ex "load" -ex "x/wx 0x08000004" -ex "tbreak main" -ex "run" -ex "echo \n\n\nUpload finished!" -ex "quit" From cda92975b88d24b9730641834002e6cbd05faa6c Mon Sep 17 00:00:00 2001 From: EvArk Date: Fri, 27 Apr 2018 15:21:42 +0300 Subject: [PATCH 2/3] Add Blackmagic (BMP) support for Generic F103 (fix) --- boards.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/boards.txt b/boards.txt index ca69369b34..96b7d31936 100644 --- a/boards.txt +++ b/boards.txt @@ -418,9 +418,9 @@ GenF103.menu.upload_method.serialMethod=Serial GenF103.menu.upload_method.serialMethod.upload.protocol=maple_serial GenF103.menu.upload_method.serialMethod.upload.tool=serial_upload -GenF103.menu.upload_method.serialMethod=BMP (Black Magic Probe) -GenF103.menu.upload_method.serialMethod.upload.protocol=gdb_bmp -GenF103.menu.upload_method.serialMethod.upload.tool=bmp_upload +GenF103.menu.upload_method.bmpMethod=BMP (Black Magic Probe) +GenF103.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp +GenF103.menu.upload_method.bmpMethod.upload.tool=bmp_upload ############################### # Maple From c568d3bb8ad545f891fc00c0984c23a322b6760a Mon Sep 17 00:00:00 2001 From: EvArk Date: Fri, 11 May 2018 02:57:35 +0300 Subject: [PATCH 3/3] Fix BMP upload --- platform.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/platform.txt b/platform.txt index b3b9dfb27f..34f55d74a8 100644 --- a/platform.txt +++ b/platform.txt @@ -175,8 +175,8 @@ tools.serial_upload.upload.pattern="{path}/{cmd}" {serial.port.file} {upload.alt # blackmagic upload for generic STM32 tools.bmp_upload.cmd=arm-none-eabi-gdb -tools.bmp_upload.path={runtime.tools.arm-none-eabi-gcc.path}/bin/ +tools.bmp_upload.path={runtime.tools.arm-none-eabi-gcc-6-2017-q2-update.path}/bin/ tools.bmp_upload.upload.speed=230400 -tools.bmp_upload.upload.params.verbose= -tools.bmp_upload.upload.params.quiet=-q --batch-silent -tools.bmp_upload.upload.pattern="{path}{cmd}" -cd "{build.path}" -b {upload.speed} {upload.verbose} -ex "set debug remote 0" -ex "set target-async off" -ex "set remotetimeout 60" -ex "set mem inaccessible-by-default off" -ex "set confirm off" -ex "set height 0" -ex "target extended-remote {serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "x/wx 0x8000004" -ex "monitor erase_mass" -ex "echo 0x8000004 expect 0xffffffff after erase\n" -ex "x/wx 0x8000004" -ex "file {build.project_name}.elf" -ex "load" -ex "x/wx 0x08000004" -ex "tbreak main" -ex "run" -ex "echo \n\n\nUpload finished!" -ex "quit" +tools.bmp_upload.upload.params.verbose=-batch +tools.bmp_upload.upload.params.quiet=--batch-silent +tools.bmp_upload.upload.pattern="{path}{cmd}" -nx {upload.verbose} -ex "set confirm off" -ex "target extended-remote {serial.port}" -ex "monitor swdp_scan" -ex "attach 1" -ex "load" -ex "compare-sections" -ex "kill" "{build.path}/{build.project_name}.elf"