Spark Core: 92.9% Flash used, 53.4% RAM used on empty app


#1

I have a Spark Core, which has been chugging along fine until recently. Now even if I create a new empty app and compile it, it shows 92.9% Flash used, 53.4% RAM used! What the heck? How do I fix this? I ran particle device doctor and cleared everything (except device keys), and I cleared cache in the Web IDE. Neither helped. Targeting older firmware reduces the footprint somewhat but for example 0.6.2 still shows 91560 text size (83.7% Flash used, 52.3% RAM used).

Steps to repro:

  1. In the Web IDE, under Devices > Target: Default (1.4.3).
  2. Settings > Clear Cache.
  3. Code > Create New App. Name it “Test” and save.
  4. Click Verify.
Output of arm-none-eabi-size:

text	data	bss	dec	hex
101724	972	9964	112660	1

In a nutshell:
Flash used	102696 / 110592	92.9 %
RAM used	10936 / 20480	53.4 %

The code literally looks like this:

void setup() {

}

void loop() {

}

And yes, the numbers seem to be real because I hit errors when I try to compile any substantial app:

/usr/local/gcc-arm-embedded/bin/../lib/gcc/arm-none-eabi/5.3.1/../../../../arm-none-eabi/bin/ld: region `APP_FLASH' overflowed by 3012 bytes


#2

@jrc, the Core was based on an STM32F103 which has a total of 128KB of flash and 20KB of RAM for both the user code and the DeviceOS. It also only takes a monolithic image unlike the newer devices (Photon, Electron, etc). It is no longer officially supported though, as you can see, you can still compile the latest version of DeviceOS for it. I don’t recommend using any firmware later than 0.7.0 on a Core. Tinker on DeviceOS 0.7.0 takes:

text	data	bss	dec	hex
97572	1092	9328	107992	1

In a nutshell:
Flash used	98664 / 110592	89.2 %
RAM used	10420 / 20480	50.9 %

With DeviceOS 1.4.3:


text	data	bss	dec	hex
106412	1100	10044	117556	1

In a nutshell:
Flash used	107512 / 110592	97.2 %
RAM used	11144 / 20480	54.4 %

#3

Thanks for the quick and helpful reply! I couldn’t find this information anywhere else.