-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thansk for this PR.
I assume you have tested with bmp_upload provided with Arduino_Tools?
Could you test with the compiler path and update your PR. I do not have BMP to do the test.
Thanks in advance
platform.txt
Outdated
|
||
# 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/ |
There was a problem hiding this comment.
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
I can try in a few days with my BMP |
It looks like you are using the original version of the BMP command line I wrote a long time ago. I've since simplified the parameters so that it isn't doing a lot of extra work. You might look at doing something like this:
I started a post a while back http://www.stm32duino.com/viewtopic.php?f=37&t=2802 but I don't think it went anywhere. Seeing as you are adding something new to this core, you might think about how to select the debug BMP port a different way so you can still use the serial console without having to switch the port between the debug port and the virtual com port. I had some ideas in that post thread. |
I tried the path but it seems that this is not evaluated correctly (why?), so I have to define the compiler path again
The command line of gdb can be simplified, according blackmagic wiki and looking how the gdb is used in platformio as
There is no need to full erase the chip on every download. |
@RickKimball , I see your point. The only way I see is to add script file to perform this but as I cannot perform any test it will be too risky and bring several support I guess Edit: |
tools.bmp_upload.upload.speed=230400 | ||
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" |
There was a problem hiding this comment.
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"
# 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/ | ||
tools.bmp_upload.upload.speed=230400 |
There was a problem hiding this comment.
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}
There was a problem hiding this comment.
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
I've tested under windows, it seems it could not expand properly |
I've opened an issue at Arduino side: |
|
||
# 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/ |
There was a problem hiding this comment.
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.
Thanks @evark |
Based and closes stm32duino#238 Signed-off-by: EvArk <arkalis.e@gmail.com>
A small addition to boards/platform files to support Blackmagic probe as uploading method for Generic F103 devices.