Application firmware size

My application is getting pretty large and I am wondering if I’m getting close to the limit of Flash for my application. I’m doing cloud compiles. Is there a way to see the size of my application is using in flash memory?

How do you cloud compile?
Web IDE or CLI?

Both will give you a build summary like this
image

1 Like

I compile on the cloud using Platform IO with the particle workbench. Where do I find this report? The only time I see a report is if there is a compile error.

I just did a local compile and all I got from that was:

  text    data     bss     dec     hex filename
  71424    1680    1272   74376   12288 c:/Users/scrai/OneDrive/Documents/Particle/SepticController/target/3.1.0/photon/SepticController.elf

*** COMPILED SUCCESSFULLY ***

There you have the info you need.
text + data is what your code’s flash requirements are.
data + bss is what your global variables will take up in RAM.

(as in my screenshot 5132 + 112 = 5244 flash used, 112 + 1084 = 1196 RAM used)

The maximum user firmware binary size is 128 Kbytes on the Photon, P1, Electron, and E Series.

With Device OS 3.1 or later, it’s 256 Kbytes on Gen 3 devices including the Argon and Boron.

With the P2 and Photon 2, it’s 2048 Kbytes.

I’m using Particle workbench in VS code. When I do a cloud compile I don’t see a report anywhere telling me the actual size of my compiled application. Where can I find this?

There may be another way, but the way I do it in Workbench is Particle: Launch CLI and then type a command like:

particle compile photon .

Replace photon with whatever platform you’re building for, and note the space and period at the end of the command.

@m_m, this might be something that maybe should be added.
Not only download the build files but also the build log on success (not only on build error).

BTW, that’s also something missing from Web IDE where only the build summary is shown, but in order to address warnings SHOW RAW should also show the rest of the build log.

2 Likes

hey jman,

thanks for your question, it’s been helpful for me too!

you can find the information on the bottom by clickin on the information icon after ‘verifying’ (compiling):

image

I think I’m closer to reaching the limit than you are :slight_smile:
image

That worked. See below. Did that compile on the cloud or was it a local compile? Is that the command line equivalent of clicking the compile button in the upper right corner of Particle workbench? Also can you describe the text,data,bss,dec fields and what each means?

Thanks,
Steve

attempting to compile firmware
downloading binary from: /v1/binaries/625d9df3949f707126f01b92
saving to: photon_firmware_1650302427439.bin
Memory use:
text data bss dec hex filename
69120 1688 2444 73252 11e24 /workspace/target/workspace.elf

Compile succeeded.
Saved firmware to: C:\Users\scrai\OneDrive\Documents\Particle\SepticController\photon_firmware_1650302427439.bin
PS C:\Users\scrai\OneDrive\Documents\Particle\SepticController>

The particle compile command is a cloud compile. It’s what the cloud compile option in Workbench does, though it may also a add --target option to specify which version of Device OS to target.

Thanks for the reply. But I don’t see the info button. Are you using VS code with particle workbench? Here’s a screenshot of what I get after a compile…

I’m using the web IDE -
image

  1. open the Web IDE

  2. select the project you’re working on

  3. click on the ‘verify’ buttton on the top left, the circle with the check mark

  4. in this case it was a successful compile, that’s when the information button next to ‘Ready’ appears.
    4.a. if the code doesn’t compile succesfully, you will get the errors, but not the data you’re asking for here. it needs to be a successful compile.
    4.b. it could also show like this:
    image

  5. click on said button. it doesn’t look like a button, but if you drag the pointer to it, the pointer will change to let you know it is a ‘link’ (sorry I don’t have a better word for it).

  6. once clicked, it looks like this:

hope it helps!

-R

That explains it. I no longer use the WEB Ide as I like VS code much better. Much better editing and Git is integrated into VS code. But it looks like they need to add the results to the cloud compile option when initiating it from the Particle workbench in VS code. Thanks for your feedback.

glad it was helpful.

I’m just getting started using VSCode, but I can see the advantages.

good luck,

-R