Skip to content

Add Blackmagic (BMP) support for Generic F103 #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.bmpMethod=BMP (Black Magic Probe)
GenF103.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp
GenF103.menu.upload_method.bmpMethod.upload.tool=bmp_upload

###############################
# Maple
Maple.name=Maple series
Expand Down
8 changes: 8 additions & 0 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should use
tools.bmp_upload.path={compiler.path}

which is set on top of platform.txt
compiler.path={runtime.tools.arm-none-eabi-gcc-6-2017-q2-update.path}/bin/
This will avoid any issue if compiler version change

tools.bmp_upload.upload.speed=230400
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

upload speed is not used in the cmd? It should be fine to add it, no?
-b {upload.speed}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is really a USB CDCACM so it doesn't really matter. It is going to go USB speed. But you can add it without issue

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"