Particle CLI compile/flash just re-flashes Tinker

boron
Tags: #<Tag:0x00007f038ff03db0>

#1

I want to use the particle CLI to compile and flash my code, but every time I try to do so it just re-flashes the default Tinker app. Here’s a comparison of the flows I’m following, using a super basic blink program:

void setup() {
    pinMode(D7, OUTPUT);
    digitalWrite(D7, HIGH);
}

void loop() {
	digitalWrite(D7, LOW);
	delay(300);
  digitalWrite(D7, HIGH);
	delay(300);
}

First flow - web IDE

Steps:

  1. Paste code into build.particle.io
  2. Click flash

Outcome:

  • Device resets
  • Device LED D7 starts blinking
  • particle list results in no available functions

Second flow - CLI

Steps:

  1. Be in empty directory
  2. Create empty app.ino file
  3. Paste code into file
  4. Run particle compile boron --saveTo=out.bin
  5. Put device in DFU (yellow flashing) mode
  6. Run particle flash --usb out.bin OR particle flash <device_name> out.bin (I’ve tried both)

Outcome:

  • Device resets
  • Device LED D7 does not blink
  • particle list results in digitalread, digitalwrite, analogread, analogwrite commands

What am I doing wrong? Why can’t I flash my boron over USB? Why is it falling back to Tinker?

  • I’ve run particle update and particle update-cli
  • particle compile results in different output for different files

#2

AFAIK there is no equal sign in the command also you’d need to provide the sources you want to compile somehow.

I usually use this command

particle compile boron . --saveTo out.bin

Where the dot (.) denotes current directory (which only contains one project)

Can you post the output of your next build command?
You can also try particle binary inspect out.bin to get some info on the resulting binary.


#3

Thanks for the fast response!

I tried these unplugging the device from the breadboard it was in, switching to a different USB port on the same computer, compiling/flashing from a different computer, and using a different USB cable. The only thing I haven’t switched out is the Boron.

I had all of this working a few months ago, maybe at that time I flashed some weird firmware to the device? If particle update says “There are currently no system firmware updates available for this device”, where can I get firmware to re-flash the device with?

COMPILE/FLASH OUTPUT

Here’s the output of my compile/flash commands:

C:\Users\Jon\busboy\boron>particle compile boron . --saveTo out.bin

Compiling code for boron

Including:
    app.ino
attempting to compile firmware
downloading binary from: /v1/binaries/5c5b1276b1ead847109a9011
saving to: out.bin
Memory use:
   text    data     bss     dec     hex filename
   5100       4    1140    6244    1864 /workspace/target/workspace.elf

Compile succeeded.
Saved firmware to: C:\Users\Jon\busboy\boron\out.bin
C:\Users\Jon\busboy\boron>particle flash --usb out.bin

Flash success!

I’d share out.bin via Drive, but I’m not sure on the forum policy for that.

Running particle binary inspect seems to result in reasonable values:

C:\Users\Jon\busboy\boron>particle binary inspect out.bin
out.bin
 CRC is ok (04e2a4eb)
 Compiled for boron
 This is an application module number 1 at version 5
 It depends on a system module number 1 at version 326

MY SETUP

I’m running these commands in an empty directory containing only app.ino (the blink code from the first post):

C:\Users\Jon\busboy\boron>dir
 Directory of C:\Users\Jon\busboy\boron

02/06/2019  08:59 AM    <DIR>          .
02/06/2019  08:59 AM    <DIR>          ..
02/06/2019  12:32 AM               174 app.ino
               1 File(s)            174 bytes
               2 Dir(s)  328,008,794,112 bytes free

Here’s a video of me flashing to the boron through the process described above.


#4

You should be able to update your Boron following these steps

Download
https://github.com/particle-iot/firmware/releases/download/v0.8.0-rc.27/system-part1-0.8.0-rc.27-boron.bin
https://github.com/particle-iot/firmware/releases/download/v0.8.0-rc.27/tinker-serial1-debugging-0.8.0-rc.27-boron.bin
https://github.com/particle-iot/firmware/releases/download/v0.8.0-rc.27/bootloader-0.8.0-rc.27-boron.bin
And then you need to perform these commands in order
In DFU Mode (blinking yellow)

particle flash --usb system-part1-0.8.0-rc.27-boron.bin -v
particle flash --usb tinker-serial1-debugging-0.8.0-rc.27-boron.bin -v

In Listening Mode (blinking blue)

particle flash --serial bootloader-0.8.0-rc.27-boron.bin -v

The interesting part is missing due to the lack of the -v verbose switch :wink:

After the whole procedure you can also run particel serial identify and particle serial inspect in Listening Mode to see what version you ended up with and whether all dependencies pass.


#5

I ran the first two flash commands but now I can’t put my device into listening mode. Here’s the order of events:

C:\Users\Jon\Downloads\boron os>particle flash --usb system-part1-0.8.0-rc.27-boron.bin -v
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device...
ID 2b04:d00d
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x00030000, size = 644140
Download        [=========================] 100%       644140 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!

Flash success!
C:\Users\Jon\Downloads\boron os>particle flash --usb tinker-serial1-debugging-0.8.0-rc.27-boron.bin -v
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Opening DFU capable USB device...
ID 2b04:d00d
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x000d4000, size = 14260
Download        [=========================] 100%        14260 bytes
Download done.
File downloaded successfully
Transitioning to dfuMANIFEST state
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!

Flash success!

After these two commands, the yellow CHG LED (not the main status LED) started flashing yellow constantly. Holding MODE and/or RESET doesn’t do anything, and unplugging the device and plugging it back in results in the same constant yellow flash.

Is there some button combination other than just holding MODE that will put the device into listening mode when it’s in this state?


#6

I haven’t been following this thread, but I will note that if the CHG LED is blinking at 1Hz, the PMIC is in a “fault condition”, per this.

Also, to answer your question about listening mode – you can force listening mode by connecting a terminal emulator to the device and setting the baud rate to 28800. I use TeraTerm on Windows… this works for all Particle devices. (57600 = DFU mode.)


#7

That’s news to me :confused:
It used to be 14400 and that’s what’s documented too - although 57600 may make more sense since some Linux distros seem to barf when trying to set 14400, but then it should be documented too
e.g.
https://docs.particle.io/reference/device-os/firmware/boron/#serial

However, this should not impact the rest of the device nor your application (as long it doesn’t actively communicate with the PMIC).
Connecting a LiPo may also alleviate the PMIC’s confusion.


#8

My Boron’s CHG light is flashing yellow at ~15Hz, are the docs inaccurate or am I dealing with something else?

It’s unresponsive to button inputs, as shown in this video.

I don’t have a LiPo, I could try to power the battery terminals from a power supply set to 3.7v?

Otherwise, it seems I may need a JTAG programmer.


#9

That looks very much like a case where a support ticket should be opened.
Reference this thread in the ticket.


#10

I’ve opened a support ticket, thanks for all the help!

I suspect I put my boron in a weird state a few months ago, I was messing around with local builds. I would have thought re-flashing the firmware would have fixed it… Ah well, I don’t mind getting a JTAG programmer if I need to, but I’ll see what support says first :slight_smile:

FWIW, I opened up my other Boron and it flashed over USB first try! :smiley:


#11

@ScruffR Oops you’re correct on the baud rate. I should’ve looked it up to confirm, but for some reason 57600 was stuck in my head.