-
Notifications
You must be signed in to change notification settings - Fork 1k
Simple sketches using too much flash memory for STM32C0 #2250
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
Comments
Hi @sfe-SparkFro Warning have to be fix in the STM32Cube. |
Thanks for the reply @fpistm! Just to confirm, it should be as simple as creating a file called Doing this does have some minor effects, but not significant enough to get the I2C scanner example small enough. I tested the effect of adding each
And here's the new Output with this
The HAL configuration wiki also suggests disabling |
Well, unfortunately, it will be hard to reduce enough the size of code to fit your needs. Note that I've fixed the |
Raised in #2250. Signed-off-by: Frederic Pillon <[email protected]>
Fair enough, I understand, and I appreciate your time! I'll see about using the LL drivers; my initial tests with them in the STM32CubeIDE have helped a lot in reducing the flash memory requirement. I do also have the opportunity to switch to the 32kB package (STM32C011F6Ux), so that will help too. If possible, I would like to suggest adding a warning or something in the Notes column here (and to other devices with a small flash size) that out-of-the-box functionality will be limited in Arduino. IMO, not being able to use multiple Arduino drivers simultaneously (eg. Thanks again! |
Updated issue title to hopefully make this more searchable. |
Raised in stm32duino#2250. Signed-off-by: Frederic Pillon <[email protected]>
Describe the bug
I'm having issues compiling code for the STM32C0. This problem actually exists with most code I try to compile, but to limit the scope of this issue, I'll focus on the I2C scanner example, since it demonstrates the fundamental problems and it should be easy for others to reproduce. Attempting to compile this example for the STM32C011F4Ux gives several warnings and fails due to not enough flash memory (it states the FLASH region overflowed by ~7kB).
To Reproduce
Expected behavior
The example should compile with no warnings and not overflow the FLASH region (ideally use much less so I still have room for my own code!)
Screenshots
Easier to just paste the Output after clicking the Verify button:
Desktop:
Board:
Additional context
I understand that this MCU only has 16kB of flash, but this example really should not use so much memory that it can't be flashed in the first place. For reference, compiling the I2C scanner example for the Arudino Uno (the kind of MCU the STM32C0 is advertised to replace) uses about 4kB of flash memory. Even the blink example uses over 12kB of flash by itself! Simply including Wire.h from the blink example causes the FLASH region to be overflowed by almost 1kB. Makes it basically impossible to do anything with I2C.
The text was updated successfully, but these errors were encountered: