[SOLVED][WORKBENCH] Flash application error


#1

Hello all,

First of all, that’s awesome that Particle has released this new tool.
I just installed it and login, compiling are all working fine but facing issues when trying to flash.
It works when using particle flash in the windows console but when I run the task particle: flash application(local) from VS, I have the following the errors.

make[2]: cp: Command not found
make[2]: *** […/…/…/build/module.mk:172: c:/Users/da/Documents/Projects_Repo/Wallboard/particle_test/testTLS/target/testTLS.dfu] Error 127
make[2]: Leaving directory '/cygdrive/c/Users/da/.particle/toolchains/deviceOS/0.7.0/firmware-0.7.0/modules/electron/user-part’
make[1]: *** […/build/recurse.mk:12: modules/electron/user-part] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/da/.particle/toolchains/deviceOS/0.7.0/firmware-0.7.0/main’
make: *** [C:\Users\da.particle\toolchains\buildscripts\1.0.0\Makefile:46: flash-user] Error 2

[EDIT]
As digitalhack mentioned in his answer, the command cp not found was due to the command missing in the folder C:\Users<YourUsername>.particle\toolchains\buildtools\1.0.0\bin. After copying cp.exe from cygwin bin folder to that folder, no more copy errrors. Thanks @digitalhack

I still face the other errors though as below

make[2]: *** […/…/…/build/module.mk:172: c:/Users/da/Documents/Projects_Repo/Wallboard/particle_test/testTLS/target/testTLS.dfu] Error 127
make[2]: Leaving directory '/cygdrive/c/Users/da/.particle/toolchains/deviceOS/0.7.0/firmware-0.7.0/modules/electron/user-part’
make[1]: *** […/build/recurse.mk:12: modules/electron/user-part] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/da/.particle/toolchains/deviceOS/0.7.0/firmware-0.7.0/main’
make: *** [C:\Users\da.particle\toolchains\buildscripts\1.0.0\Makefile:46: flash-user] Error 2
The terminal process terminated with exit code: 2

UPDATE:
Issue was fixed after copying cp.exe file from cygwin64 instead of cygwin 32 bits. Thank you all for the help!

Thanks in advance for the help!


#2

This is probably the cause of the error. You appear to be using Windows and cp by default is not a valid command. I’m not a Windows guy so I don’t really know how to fix this.

@rickkas7 or @ScruffR might be able to help.


#3

Might be able to use cygwin (http://www.cygwin.com) to get your cp command on windows…


#4

There is a portion of Cygwin already in the installer. That’s how GNU make is run under Windows. It’s possible that cp wasn’t installed, however, which would explain that error. Or it’s a path issue of some sort.


#5

Hi @damonzon - when you say

It works when using particle flash in the windows console

what were you flashing? A binary that was compiled in the cloud? Your output suggests a compile error.

Also, which version/build of Windows are you running?


#6

Hello,

I ran into the same problem trying to use the Particle: Flash application (local) option. When I checked
C:\Users\<YourUsername>\.particle\toolchains\buildtools\1.0.0\bin I found that the cp.exe file was missing. It appears that the cygwin1.dll is the 64 bit version 2.10.0. I copied over cp.exe from my current 64 bit version of cygwin which is at 2.11.1 and it worked fine.

Hope this helps.

digitalhack


#7

Hello @jberi
I meant that I could flash the generated binaries after compiling from Workbench by using Windows command line and execute particle flash --serial testTLS.bin.
I’m using Win7.

Thanks!


#8

Hello @digitalhack,
That did the trick for me too, thanks a lot!
cp.exe was missing under .particle\toolchains\buildtools\1.0.0\bin and I copied it from cygwin bin folder to that location and it worked but I still face the other error.

make[2]: *** […/…/…/build/module.mk:172: c:/Users/da/Documents/Projects_Repo/Wallboard/particle_test/testTLS/target/testTLS.dfu] Error 127
make[2]: Leaving directory '/cygdrive/c/Users/da/.particle/toolchains/deviceOS/0.7.0/firmware-0.7.0/modules/electron/user-part’
make[1]: *** […/build/recurse.mk:12: modules/electron/user-part] Error 2
make[1]: Leaving directory '/cygdrive/c/Users/da/.particle/toolchains/deviceOS/0.7.0/firmware-0.7.0/main’
make: *** [C:\Users\da.particle\toolchains\buildscripts\1.0.0\Makefile:46: flash-user] Error 2
The terminal process terminated with exit code: 2

Have you faced the same issue?


#9

Hello @damonzon,

Is there anything above this line: make[2]: *** […/…/…/build/module.mk:172: ?

Thanks,

digitalhack


#10

Hello @digitalhack,

there were no errors below that line but I noticed that the cp.exe binary that I copied was from an old cygwin install 32bits, I copied a 64 bits cygwin cp.exe file and it worked.
Looks like we can only flash when in DFU mode and not in listening mode when use the command line.

Thanks again for the help, I really appreciate it.