Empty project occupies 12K flash and 4K RAM?

Post here first, or if you can't find a relevant section!
Post Reply
Violet Giraffe
Posts: 10
Joined: Sun Mar 19, 2017 4:22 pm

Empty project occupies 12K flash and 4K RAM?

Post by Violet Giraffe » Sun Mar 19, 2017 6:49 pm

Trying to get into this STM32-arduino thing. Noticed that an empty .ino, when compiled for the STM32 F3 Discovery board, reports 12K flash and 4K RAM occupied. Is it normal? Granted, ARM Cortex M are rather big chips (compared to 8-bit AVR), but those numbers are on the order of 10%. Seems odd to me.

If that is indeed normal, I'd be curious to find out what takes up that space, if anyone here happens to know.

P. S. By "empty project" I mean literally:

Code: Select all

void setup() {}

void loop() {}

victor_pv
Posts: 1734
Joined: Mon Apr 27, 2015 12:12 pm

Re: Empty project occupies 12K flash and 4K RAM?

Post by victor_pv » Sun Mar 19, 2017 7:03 pm

It's normal due to the flash and ram needed to initialize all the peripherals in the MCU.
This thread shows some of the normal numbers in the first post, but there are more threads in the subject:
viewtopic.php?f=16&t=91&p=565&hilit=empty+sketch#p565

Violet Giraffe
Posts: 10
Joined: Sun Mar 19, 2017 4:22 pm

Re: Empty project occupies 12K flash and 4K RAM?

Post by Violet Giraffe » Sun Mar 19, 2017 8:00 pm

Thanks!

I believe my other project based on the STM32Cube library used about the same 10% flash and less RAM total, but whatever. If it works at all and leaves me some space to work with - I'm more than happy. The "standard" STM32 tools, and especially libraries, are a mess. The only way I'll do another STM32 project is if Arduino + STM32 works for me :)

Post Reply