I recently set up my environment to do local app firmware compilation using the instructions found at https://docs.particle.io/faq/particle-tools/local-build/photon/. I am able to get my application to build and program my Photon via DFU with no problems and everything appears to work correctly. My concerns is that the output is different from the cloud compiler. As a sanity check I built the same code with the particle CLI and the output binary is 2K bigger than my locally compiled version although both appear to function the same. Can anyone explain why there is a difference?
For local compile I pulled down the firmware and did a checkout of the
release/stable branch. I am using version 5.3.1 of the GCC ARM compiler tools and when compiling with the CLI for comparison I’m doing
particle compile photon --target 0.6.2 which, as I understand it, is what the
release/stable branch points to.
The current release version for Photon is 0.6.3 (security patch).
The differences in size may come from difference in GCC version (not sure what’s currently used for 0.6.2 on the build farm, but probably not the most recent due to - back then pending - reliability tests and/or compatiblity with existing projects) and also from differences in the default optimizer setting of your toolchain vs. Particle’s.
@rickkas7, can you check with Mat whether/why
release/stable points at 0.6.2?
I’m pretty sure the compile farm uses gcc-arm 4.8.4 for the 0.6.2 build. It uses 5.3.1 for the 0.7.x and later builds. The size difference is almost certainly caused by the different compiler versions.
I’ll ask why release/stable wasn’t moved. I usually check out a specific version, for example “release/v0.6.3” to avoid this sort of situation.
Thanks @rickkas7 and @ScruffR. I went with release/stable as per the instructions at https://docs.particle.io/faq/particle-tools/local-build/core/.
I can checkout 0.6.3 as I’m currently developing a product so I want the current release version. Am I ok to use the 5.3.1 arm tools for that release or do I need to roll it back to 4.8.4?
Thanks for your quick replies.
@sidwarkd, I’ve been using gcc 5.3.1 on my local toolchain without any issues. Do note that I only work with firmware versions 0.6.3 and above.
The combination of compiler 5.3.1 and system firmware 0.6.3 (or later) is good. I don’t think the binary will be identical to the factory binary in size but it’s safe to use.
Thanks @rickkas7 and @peekay123. That’s exactly what I was looking for. Marking this as solved.