I have made a custom board using STM32L051K8U6 (64KB Flash), and configured the board variant myself. While compiling for Nucleo L432KC, the flash size is very different in size.
Nucleo L432KC: 54132 bytes
Custom STM32L051K8U6: 61796 bytes
The difference is 7664 bytes, for the exact same code. The result is that the final code will not fit the flash.
Do you have any idea what is causing this, and how i can start investigate to optimise the code for my custom board?
I'm using platformio for dev environment. This is the libraries in use:
olikraus/U8g2 @ ^2.28.8
adafruit/Adafruit BusIO @ ^1.7.2
adafruit/Adafruit DPS310 @ ^1.1.1
adafruit/Adafruit LSM303DLH Mag @ ^1.0.7
adafruit/Adafruit SHTC3 Library @ ^1.0.0
stm32duino/STM32duino Low Power @ ^1.1.0
stm32duino/STM32duino RTC @ ^1.1.0
adafruit/Adafruit MLX90393 @ ^2.0.1
Platformio config file:
Code: Select all
{
"build": {
"core": "stm32",
"cpu": "cortex-m0plus",
"extra_flags": "-DSTM32L051xx",
"f_cpu": "32000000L",
"mcu": "STM32L051K8U6",
"product_line": "STM32L051xx",
"variant": "STM32L0xx/L051K(6-8)U"
},
"debug": {
"default_tools": [
"stlink"
],
"jlink_device": "STM32L051K8",
"onboard_tools": [
"stlink"
],
"openocd_target": "stm32l0",
"svd_path": "STM32L051.svd"
},
"frameworks": [
"arduino"
],
"name": "STM32L051K8 (8k RAM. 64k Flash)",
"upload": {
"maximum_ram_size": 8192,
"maximum_size": 65536,
"protocol": "serial",
"protocols": [
"blackmagic",
"dfu",
"jlink",
"serial",
"stlink"
]
},
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32l051k8.html",
"vendor": "Generic"
}