Skip to main content
NBrow.2
Associate
May 4, 2021
Solved

Is there enough memory on the STM32F011 to use the HAL or should I write my own peripheral layer?

  • May 4, 2021
  • 2 replies
  • 878 views

Hello, I am designing with a STM32L011 (16KB) and setting up with STMCubeIDE. I require I2C, LPTIM,DMA and A/D with a small amount of program space for my actual program. The HAL however uses up all the flash space. Just adding the MX_ADC_Init() function uses about 2KB and overflows my last 10% of flash.

This topic has been closed for replies.
Best answer by Ozone

You can try to gear up optimisation settings, or check if you use the smallest library variant possible.

But otherwise, those are the perils of "convenience" frameworks, especially those trying to please everyone.

You could write your own libs, or use the "LL part (Low Level) of Cube/HAL.

While it does not come with the baggage of useless code, it is often incomplete and occasional buggy.

2 replies

Ozone
OzoneBest answer
Principal
May 4, 2021

You can try to gear up optimisation settings, or check if you use the smallest library variant possible.

But otherwise, those are the perils of "convenience" frameworks, especially those trying to please everyone.

You could write your own libs, or use the "LL part (Low Level) of Cube/HAL.

While it does not come with the baggage of useless code, it is often incomplete and occasional buggy.

NBrow.2
NBrow.2Author
Associate
May 4, 2021

Thank you, optimizing for size has got me to 60%. Sometimes I can forget the obvious.

Cheers.