Skip to main content
SScot.3
Associate III
November 12, 2021
Question

Any way to lower RAM in order to add to FLASH?

  • November 12, 2021
  • 3 replies
  • 3222 views

Hello All.

I am working on a small project for a friend while learning the STM32 environment.

The project is currently using a STM32F030x4 in a 20 pin TSSOP20.

I have committed a sin; I have run out of Flash Memory.

Is there any way to reduce the RAM allocation and move it to FLASH?

STM makes a chip with the same footprint and pinout with more memory (STM32F042x4) but no one has any stock.

Just curious if there is any 'dirty little secret' to doing this......

Regards to All,

Steve

This topic has been closed for replies.

3 replies

TDK
November 12, 2021

No, RAM and FLASH are not interchangeable.

Make sure your optimization settings are turned up to full. That can buy you some space. You can example the map file to see what code is taking the most space and optimize it where possible.

"If you feel a post has answered your question, please click ""Accept as Solution""."
SScot.3
SScot.3Author
Associate III
November 12, 2021

Thanks! I figured but it was worth a shot just in case......

MM..1
Chief III
November 12, 2021

Warning i mean you miss x4 chips have 16k flash both. You need x6 x8 usw for more flash.

And if your code for 030 is over flash in gcc try KEIL , is little better and free for code less 32k

SScot.3
SScot.3Author
Associate III
November 13, 2021

Thanks. I did manage to get 30% more from using TDK's advice!

Uwe Bonnes
Chief
November 13, 2021

Often the smaller chips like the f103x8 arelarger chip in disguise (f103xb) with the upper flash not tested but still available. Some tools may refuse to write above the announced flash. For a a hobby or low security approach, try to use the unannounced flash as a first test.

SScot.3
SScot.3Author
Associate III
November 13, 2021

I don't know how to do this. How would I use 'unannounced' flash? Makes sense to me being a hardware guy.

Uwe Bonnes
Chief
November 14, 2021

On a F103x8 the flash size register returns 0x40 for 64 kiB, on a F103xB 0x80 for 128. Many programmers deny to write above that border of this "announced" flash, I call the area above 64 k on a F103x8 "unannounced".