-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards: Enable STM32F103C8 ROM hack via env var #10323
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
+1 Personally I find "ROM" misleading. We're usually using it to refer to memory that really can only be read, like on TI chips which have driverlib in ROM. Would you mind calling it "FLASH hack"? |
0bd1205
to
88836ba
Compare
Good point. I renamed it as suggested and squashed the commits. |
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.
Untested ACK.
If you feel like, change use of "n/y" to "0/1". |
The STM32F103C8 secretly comes with 128KiB flash instead of 64KiB. Still, only 64KiB of it are tested and guaranteed to work. However, most of the times the whole 128KiB flash works just fine. In the BluePill documentation this fact is already documented and by using $ make BOARD=bluepill CPU_MODEL=stm32f103cb the whole 128 KiB can be used by RIOT. When using this hack routinely, it easier to use environment variables instead. But allowing to overwrite CPU_MODEL via environment variables seems to be a bad thing, as it is easy to forget to clear that environment variable when changing the BOARD variable. This commit introduces the new STM32F103C8_FLASH_HACK variable, which unlocks the 128KiB FLASH when set to "1". The BluePill documentation has been updated accordingly.
88836ba
to
82ea9a0
Compare
Done and rebased :-) |
@kaspar030: Do you mind to let murdock run? |
I guess you mean the the STM32F103CB not STM32F103C8 has the additional memory. I only have the STM32F103C8 but can confirm different behavior when enabling the STM32F103C8_ROM_HACK.
I don't know if this qualifies as tested but I too give it my ACK. |
Tested OK using Tests also complete OK. ;) |
(I'm puzzled because my openocd always thinks the bluepill has 128k |
@kaspar030 doesn't OpenOCD look at the actual CPU register values for the flash specs on STM32 though? |
As minor addition to @gebart: The documentation in the bluepill points that out and suggests to either fiddle with the openocd config (to ignore the flash size the MCU reports in this particular case) or to use a patched version st-flash. I also so far had no problems with flashing more than 64KiB using GDB and the blackmagic probe. (I'm not sure if these tools are aware that the STM32F103C8 has in fact 128 KiB ROM, or if they just ignore whatever the MCU reports at all. I guess the latter.) |
The STM32F103C8 secretly comes with 128KiB flash instead of 64KiB. Still, only
64KiB of it are tested and guaranteed to work. However, most of the times the
whole 128KiB flash works just fine. In the BluePill documentation this fact is
already documented and by using
the whole 128 KiB can be used by RIOT. When using this hack routinely, it easier
to use environment variables instead. But allowing to overwrite CPU_MODEL via
environment variables seems to be a bad thing, as it is easy to forget to clear
that environment variable when changing the BOARD variable.
This commit introduces the new STM32F103C8_ROM_HACK variable, which unlocks the
128KiB ROM when set to "y". The BluePill documentation has been updated
accordingly.