cancel
Showing results for 
Search instead for 
Did you mean: 

USB HID device on STM32F042F4 using CubeMX - FLASH overflow.

Xses
Associate II

Hi,

When I set the USB class to anything in CubeMX, the compiler gives me the error - FLASH overflow. It happens even with a completely empty main.c file, so is there a way to make it work, or should I choose MCU with 32kB flash (it will fit then)? The current one has 16kB.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

You can try turning on optimization to see if it reduces the code size enough. Change the build configuration to Release.

Project -> Build Configurations -> Set Active -> Release

Generally, CubeMX and HAL wasn't created for chips with small FLASH sizes.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

You can try turning on optimization to see if it reduces the code size enough. Change the build configuration to Release.

Project -> Build Configurations -> Set Active -> Release

Generally, CubeMX and HAL wasn't created for chips with small FLASH sizes.

If you feel a post has answered your question, please click "Accept as Solution".
Xses
Associate II

That actually worked, thx