-
Notifications
You must be signed in to change notification settings - Fork 2.1k
board/{blue,black}pill: Allow flashing 128 KiB with OpenOCD #10902
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
This change of the openocd.cfg overwrites the flash size to 128 KiB and, thus, allows flashing using `make flash`. Please note that STM32F103C8_FLASH_HACK has to be set to 1 in order for the link time checks to also assume 128 KiB flash. Be aware that - as of January 2019 - the latest stable release of OpenOCD does not allow overwriting the flash size, so you will currently need the development version for this to work.
@kaspar030: If I remember correctly, you have some interest in using the full flash of the Bluepill. Would you mind to review? |
Ping :-) |
Ping? |
I tested with
when it should fail since I have a 64 kB chip (on master it shows With this PR it always says the flash size is 128kB not 64kB like on master. |
Note: it fails correctly on this PR with the |
This is basically what the change does. If I think the reasons for that are:
|
I think you still need to edit
( |
@benpicco: Please check again after running |
Oh sorry, I should read the contribution description till the end instead of just looking at the commits 😅 Could this also be achieved by
so we avoid confusing OpenOCD if the hack is not to be applied? Sorry I can't test it right now, I only just realized that I need an external programmer for the blackpill and I don't have that with me right now. |
@benpicco: That would be super nice, but it didn't work for me. I added now a modified OpenOCD config as |
I think this is better. Since the config should be Tcl, we should be able to use the But I'd also find that bit of duplication acceptable. @MrKevinWeiss what do you think? |
With the latest emails from @cladmi in the devel list in mind, I guess this PR could be integrated into th split of the |
Contribution description
This change of the openocd.cfg overwrites the flash size to 128 KiB and, thus, allows flashing using
make flash
. Please note thatSTM32F103C8_FLASH_HACK
has to be set to1
in order for the link time checks to also assume 128 KiB flash.Be aware that - as of January 2019 - the latest stable release of OpenOCD does not allow overwriting the flash size, so you will currently need the development version for this to work.
Testing procedure
Using the development version of OpenOCD:
Run
STM32F103C8_FLASH_HACK=1 make flash
e.g. inexamples/gnrc_networking
. (Because no network device is present an assertion will be triggered on boot, but flashing would not be possible with 64 KiB flash.)Using the current stable version of OpenOCD:
Run
make flash
in e.g.examples/default
. This should still work.Issues/PRs references
Follow up of #10323