Flash and RAM available (Photon and P1)


I’m currently working with the WolfSSL port so memory is precious. This is the output I get from compiling locally:

arm-none-eabi-size --format=berkeley ../../myProject/target/myProject.elf
   text	   data	    bss	    dec	    hex	filename
 118284	    216	   2396	 120896	  1d840	../../myProject/target/myProject.elf

From what I’ve read, you should combine text+data to get the amount of Flash used. This should give me (118284+216= 118500) and with 128Kb total, I should have about 9Kb remaining for my app.

However - according to the official documentation1 - the above overruns the available memory since there only is 110592 bytes available. It looks like compiling using CLI stops working from 105Kb Flash used and upwards. Compiling with a local toolchain works well beyond this.

I would really appreciate some clear guidance on this. Could someone with the knowledge please clarify what the correct numbers are for both the Photon and the P1?


Let me ping someone that might be able to help, @rickkas7 are you able to assist?



@jenschr, I had a discussion with some of the Particle folks the other day and we did some testing. With the latest firmware version which gets compiled with gcc v5.3.1, there is an overhead of approx. 3KB on any user app. So with 128KB of user flash, that leaves about 125KB or 128,000 bytes. As for RAM, there should be at least 60KB available to the user.

WolfSSL optimisation (how to get more usable memory)

Great! Any idea why the online tools will stop at 105Kb? Could this be some old heritage from the Spark Core days?