Skip to content
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

Added --flash=n[k][m] command line option to override device model #576

Merged
merged 8 commits into from
Mar 24, 2017

Conversation

ve3wwg
Copy link
Contributor

@ve3wwg ve3wwg commented Mar 20, 2017

By default, st-flash works the same as before (there is no more chipid override in this pull request).

Now optionally, you can specify --flash=128k for example, to override the stm32f103c8t6 to assume 128k of flash instead of the default of 64k. This option accepts decimal (128k), octal 0200k, or hex 0x80k. Obviously leaving the multiplier out is equally valid, for example: --flash=0x20000

The size may be followed by an optional "k" or "m" to multiply the given value by 1024 or 1 Meg respectively.

Tests on the stm32f103c8t6 confirm that overriding the flash size is all that is required. I was still able to flash and read 128k without changing the chipid. I don't know if this will be true of all other devices but I suspect that they will.

include/stlink/tools/flash.h Outdated Show resolved Hide resolved
include/stlink/tools/flash.h Outdated Show resolved Hide resolved
@xor-gate
Copy link
Member

I also recommend updating the manpage source with a small description about this feature:
https://github.com/texane/stlink/blob/master/doc/man/st-flash.md

@ve3wwg
Copy link
Contributor Author

ve3wwg commented Mar 21, 2017

The suggested changes have been added to this request.

Thanks, Warren

@ve3wwg
Copy link
Contributor Author

ve3wwg commented Mar 21, 2017

Sorry, one more change added to rm old ref to chipid in the flash.c usage display.

@xor-gate
Copy link
Member

Looks good, finished and ready to go?

@xor-gate
Copy link
Member

ping @ve3wwg

@ve3wwg
Copy link
Contributor Author

ve3wwg commented Mar 24, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bluepill 128kb support Option: ignore flash size reported by chip
3 participants