Particle Photon 2 Argument List Too Long


I’m trying to Flash the Photon 2 firmware using Visual Studio Code in Windows with the EI exported Photon library and this error appears.

/bin/bash: C:/Users/R/.particle/toolchains/gcc-arm/10.2.1/bin/arm-none-eabi-gcc-ar: Argument list too long
make[4]: *** […/build/ …/build/target/user/platform-32-m/MicTest/libuser.a] Error 126
make[3]: *** […/…/…/build/ user] Error 2
make[2]: *** […/build/ modules/tron/user-part] Error 2
make[1]: *** [C:\Users\R.particle\toolchains\buildscripts\1.15.0\Makefile:142: make-main] Error 2
make: *** [C:\Users\R.particle\toolchains\buildscripts\1.15.0\Makefile:119: flash-all] Error 2

  • The terminal process “C:\Users\R.particle\toolchains\buildtools\1.1.1\bin\bash.exe ‘-c’, ‘make -f ‘C:\Users\R.particle\toolchains\buildscripts\1.15.0\Makefile’ flash-all -s’” terminated with exit code: 2.

Particle Support recommended to copy the exported tf-lite folder into the ZIP located at You're muted | Getting Started | Particle but that did not work either.

Any ideas? Thanks

Hi @Bandini

Particularly on Windows, you can significantly speed up builds by using Docker. Also, if you get the error Argument list too long on Windows, using Docker can work around this issue. For more information, see also building using a buildpack.

They suggest to build with docker in the doc if that happens on Windows. Did you try that?



Hi Eoin,

To avoid other developers and EI experts all the hassle I had trying to Flash Particle Photon 2 I will post my notes.

  • You can flash the You’re muted example with VS Code for Windows and Linux following the instructions
  • If you try to flash an exported Particle Library from Edge Impulse, you will get Argument List Too Long both in Windows and Linux. I don’t have a Mac to test it.
  • Using the You’re muted zip and replacing tf-lite folder as suggested by Particle does not work

This Docker method works:

Download and install Docker Docker Desktop: The #1 Containerization Tool for Developers | Docker
Download and install CLI Command Line Interface (CLI) | Reference | Particle
Extract Edge Impulse library into a folder (For this example Photon2)
Run docker pull particle/buildpack-particle-firmware:5.5.0-p2
Run docker run --name=AnyName -v C:\Users\R\Desktop\Photon2:/input -v C:\Users\R\Desktop\Photon2:/output -e PLATFORM_ID=32 particle/buildpack-particle-firmware:5.5.0-p2
A firmware.bin file will be generated into the same folder
Run particle usb list (get device ID for the next step)
Run particle flash --local 0a10aced202194944a045144 firmware.bin