Skip to main content
CDamp.1
Associate
July 18, 2020
Question

STM32F042C4U6 memory too small for cubeMX generated project.

  • July 18, 2020
  • 5 replies
  • 1298 views

I've used a STM32F042C4U6 in a simple application requiring USB. I'm using cube IDE. When the project is generated with cubeMX and compiled, it is too large to fit in memory before I've even added any user code. Is this right ? If so, what is the point of this chip ?

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
July 18, 2020

> If so, what is the point of this chip ?

It's useful for those who write programs, rather than click in CubeMX.

JW

Tesla DeLorean
Guru
July 18, 2020

It is targeting a different audience​.

The STM32G04/8 devices seem more accommodating​ in the Flash/RAM department, whilst being in physically smaller packages.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
RMart.1
Associate II
July 18, 2020

Hi.

You would probably have to do all peripheral configuration by yourself or else use older version of standard peripheral libraries (STM32F0xx_StdPeriph_Driver) to do so which are lighter...

Another option would be to explore each API cubemx uses for code generating and replicate this at register programming level... I am afraid you do not have many options here.

Hope this helps,

S.Ma
Principal
July 18, 2020

Is there pin to pin compatible F0 with bigger memory to get started, then optimize later?

CDamp.1
CDamp.1Author
Associate
July 18, 2020

For now I've switched to another pin compatible one I've used previously and now having trouble getting USB to work reliably - it keeps dropping out. The whole point of this was switching away from a pic and separate FTDI to reduce cost while doing some other tweaks to the design. This is now more expensive and a load of hassle into the bargain. It strikes me as rather unprofessional that ST haven't even tried their own supplied firmware in their chips. The whole point of manufacturer supplied tooling is that it's supposed to avoid this kind of compatibility issue. I'll be switching the design back to PIC again, another 2 weeks wasted for another prototype iteration.