Selecting Correct Target


#1

I am working on an electron and am having issues compiling and flashing a basic application.

I’m setting the target via ctrl+shift+p > Particle:Set Target Device to “electron” and I can confirm the value is updated in the workspace file.

However, when I build I still see lots of references to photon and when I try to flash the image via CLI it fails to flash.


#2

ah, perhaps we can find a way to make these commands clearer

Particle: Set Target Platform - which type of hardware are you targeting (photon, electron, etc)?

Particle: Set Target Device - which specific device of yours will you be sending updates to?

Particle: Set Firmware Version - which version of the Device OS you’ll be compiling for?

sounds like you are like me and named your dev hardware the same as what we call platform - e.g. electron, etc.

try running Particle: Set Target Platform and recompiling from there :+1:


#3

Maybe not only clearer but rather have Set Target Device implicitly/automatically also select the correct platform :wink:


#4

haha! good point @ScruffR thanks :+1:


#5

Thanks that helps clear that up, however I am still unable to flash the compiled binary to my electron. Any thoughts on why that might be?

> particle flash --serial .\testApp.bin
! PROTIP: Hold the SETUP button on your device until it blinks blue!
? Press ENTER when your device is blinking BLUE
sending file: .\testApp.bin
Error writing firmware: Transfer cancelled

#6

Try via DFU Mode and particle flash --usb ./testApp.bin -v
You can also check the binary via particle binary inspect testApp.bin to see what platform it’s targeted at.
And also check the device via particle serial inspect (in Listening Mode) to make sure the bootloader isn’t out of sync with your device OS (you can post the output for us to have a look).


#7

Thanks, that helped. It was still compiling for photon for some reason. I had to delete the target folder and build again to have it targeted at the electron.