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 all 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-6-2017-q2-update.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.

Based on @facchinm comment in arduino/Arduino#7616 (comment)
{runtime.tools.arm-none-eabi-gcc} will be used by default in git repo.
I will update path when releasing the package to set the gcc version as it is done for other upload tools.

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=-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"
Copy link
Member

Choose a reason for hiding this comment

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

There are some extra space btw:
{serial.port}" -ex "monitor swdp_scan
and
-ex "monitor swdp_scan" -ex "attach 1"