Particle Photon 2 Argument List Too Long

Hi.

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/module.mk:255: …/build/target/user/platform-32-m/MicTest/libuser.a] Error 126
make[3]: *** […/…/…/build/recurse.mk:12: user] Error 2
make[2]: *** […/build/recurse.mk:12: 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?

Best

Eoin

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

@Bandini thank you so much for sharing. I’ve wasted a lot of hours trying to import/configure/compile my project on windows. I’ll try your docker method next. Not being a docker expert I appreciate the detailed steps.
@Eoin Could you please get some notes here added to the photon2 page (Particle Photon 2 | Edge Impulse Documentation). A few notes about windows not being supported or some suggestion there to try docker would have saved me a lot of wasted hours. Then long term obviously I’d like to see the root issue fixed.

Hi @danielm7

Can you share your errors? We should have Windows support now.

Let me check with @dayberry for the latest support as he has worked on their latest support and integration.

@danielm7 you can follow @dayberry’s webinar here, which is superb, for a walktrhough of the hardware and the Particle integration:

@jbuckEI fyi

Best

Eoin

Ah reading back over this thread and the specific Windows problem is an inherent limitation in the OS, and not something we can fix as it depends on the users environment:

Argument list too long

Its a pain they didn’t remedy this yet you can see the amount of noise its generating everywhere:

https://answers.microsoft.com/en-us/windows/forum/all/file-name-too-long-for-destination-folder/250ad90a-ad93-46ef-bfae-41036a1f0ede

https://www.reddit.com/r/Windows11/comments/18fpzr8/path_too_long_error_still_in_2023/

Best

Eoin

Thanks @Eoin for the reply. I’ll try the docker route this afternoon.

I’d really like to see some notes on your photon 2 page letting people know and at least a few notes on how to go the docker route. It would have saved me a lot of wasted hours and I’d like to save the next person that wasted time!

Does the docker container used in this repo work as a better method @Bandini ?

@jbuckEI Since you mentioned it I did try the docker image you linked and wasn’t able to get a firmware file as an output. Probably just due to my lack of docker knowledge, but a recurring theme with my entire edge impulse learning curve has been a lack of documentation once I get to the edge(device) parts of the process. The documentation for how to use that docker image just wasn’t good enough for me.

@Bandini Thanks again, I was able to get docker working with your recommended steps. I used the latest deviceOS version of 5.8.1, but everything else just worked as you described.

I’d really like to encourage the edge impulse team to take a fresh look at the experience with Particle devices and please improve the documentation. You’ve got a dedicated page for the photon 2 which doesn’t include a long list of things you need to know to use that MCU. I have been able to find answers, many even from edge impulse resources, but they aren’t linked or mentioned on the photon 2 page so it’s caused a lot of wasted time digging and searching for everything. My list so far of things missing from that page:

  1. No mention of docker or the need to use it for windows users. Please also add some basic docker instructions. Getting everything set and saved in VScode and then docker image and commands to run it.
  2. The photon 2 page has an advanced deployment section that doesn’t seem to cover all the steps. The embedded video shows copying an example to overwrite the main code, but the only example included in the code I got from the deployment page is identical to the main code (static_buffer) so I didn’t have that option.
  3. The Particle library that I download from the deployment tab does not include the code to actually read from the accelerometer for some reason. This is very non-intuitive since the edge impulse provided data capture code automatically reads from the accelerometer. So that should be fixed or mentioned.
  4. The code has a note saying I can copy raw features from the live classification page, but the web link takes me to a page that doesn’t tell me anything about how to do it or why. This video should be on that page: https://www.youtube.com/watch?v=HdkktDbPhxE As well as a note explaining why you might want to copy raw values in and to just remove that section if you’re running live data in. I don’t really see value in that being in the code by default.
  5. And then this video should be on the photon 2 page with the code written out so I can copy/past: https://www.youtube.com/watch?v=OcfgfTIjwz0&t=197s
    I sat and wrote out each line of code as he wrote it since I couldn’t find anywhere that it was printed out. I’ve no idea why those lines of code to read from the accelerometer aren’t in the particle library when I download it.
    When I move to a sensor other than the two officially supported I expect to write all the code for them, but I would like to see support for getting off the ground quickly with the two included sensors from data capture through to deployment.

I hope the next person that stumbles on this forum saves some time from that!

Apologies for the delay. I’m pleased that my notes were helpful to Daniel. The experience with Photon 2 has indeed been somewhat complicated, and this is closely tied to the way Particle manages code deployment.

Hi @Bandini ,

A possible mitigation could be to separate the objects from different file types when calling the AR command.

So in your makefile, where you construct the libuser.a, you can do something like this:

libuser.a: $(COBJECTS) $(CXXOBJECTS) $(CCOBJECTS)
	$(MKDIR_BUILD)
	$(AR) rcs libuser.a $(COBJECTS)
	$(AR) rcs libuser.a $(CXXOBJECTS)
	$(AR) rcs libuser.a $(CCOBJECTS)

(Instead of something I assume looks like:

$(AR) rcs libuser.a $(COBJECTS) $(CXXOBJECTS) $(CCOBJECTS)

)

1 Like

Hi @Bandini

Particle manages code deployment, can you clarify that please - are you having trouble with PlatformIO and the library management? or the particle IoT platform deployment?

Either way it would be good to capture, we can help raise it to the relevant team or at least find the appropriate forum to flag the deployment problem.

Best

Eoin