Particle flash --usb tinker fails

I just updated the CLI to the newest version (macOS) and now I can’t even seem to flash tinker to try to un-brick a device. The message I get is:

$ particle flash --usb tinker
Error writing firmware: dfu-util: Could not open file undefined for reading: No such file or directory

When performing particle serial inspect, I get:

$ particle serial inspect
Platform: 10 - Electron
Modules
  Bootloader module #0 - version 311, main location, 16384 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 1213, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #3 - version 1213
  System module #2 - version 1213, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 1213
      Bootloader module #0 - version 311
  System module #3 - version 1213, main location, 131072 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #2 - version 110
  User module #1 - version 6, main location, 131072 bytes max size
    UUID: 8DB2538E13EDA573360DD7614E127063E15A3AB4A684F89C816F2BB7B3F47A80
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: FAIL
      System module #2 - version 1301

I don’t really know what most of that means, but any debugging help would be great.

What version CLI are you running?
On Windows I just filed this issue


(a fix should be released today)

But your applicatoin would require a more recent device OS version (1.3.0-rc.1 vs. 1.2.1-rc.3)
You either need to target your application to the version that is installed on your device or update your device OS to match the desired target.

That makes sense. I’m a bit confused though, as when I do particle device inspect it gives the above which I take to mean 1.3.0-rc1 (I definitely installed this at some point), but if I update the device and revert back to 1.2.1 and then issue particle identify, I get 1.2.1. However, when I try to start the device now after flashing anything, the device goes into “pull correct fw version” mode (purple and whatnot).

What’s going on? Is there a better way to 1) revert to an old OS and 2) ensure it’s actually that version? Shouldn’t particle identify and particle serial inspect provide the same answer?

Also, running CLI v1.43.2

All the system parts are reported as 1213 which is not 1.3.0-rc.1.

You have to have an application installed that mustnot be targeted to any higher device OS version than the one you intend to downgrade to otherwise you'll find yourself in the downgrade/upgrade circle you are currently seeing.

Ahhh okay - I see. What is the version 1301 in the dependency failure? Is it something to be worried about?

Nothing to worry about but it tells you what I told you - your 1213 system does not satisfy the need for 1301 which your application wants/expects.
Either upgrade the device OS or downgrade the application target.

Ahhh okay. It seems like for some reason, unless I don’t totally delete the target folder in VS Code, when I rebuild, even if a different OS is specified, it won’t take hold. I just wiped that folder, recomplied, and now the device is live again and now everything passes and it lists the correct version. I haven’t seen the need to wipe the folder anywhere in the docs - not sure if this is a bug, there is a better way to compile (i.e. using the cli instead of extensions in vscode), or dumb luck…

Thanks for all your help though! Will mark this as answered.

Have you switched target version via the respective task
image

Hmmm. Nope - I switched the Device OS in the bottom toolbar to read deviceOS@1.2.1 and then compiled locally. After compiling, I flash the device locally over serial.

Is configuring the project for each device necessary/a better workflow?

Also, I can confirm that 1.43.3 fixes this issue!