Stuck with a xenon

Hi guys,

I’ve got some trouble with a Xenon.
Everything was ok but after a period of using, I was no longer able to flash the device, but the device still works correctly.
The workbench gives no error and the web-ide the same.
I decided to do the setup again, but I can’t connect to the Xenon via the Particle app.
Then I did a factory reset.
After the factory reset still not able to setup or flash.
DFU and serial works ok but flashing over DFU or Serial will not work.

When I try to flash over DFU I’ve got this log in the CLI:

Opening DFU capable USB device...
ID 2b04:d00e
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 = 16312
Download        [=========================] 100%        16312 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!!!
Cannot open DFU device 2b04:d00e

Flash success!

But the device is not flashed!

Can anyone please help me with fixing this issue.

Have you tried

particle flash --usb tinker -v

Yes i did, but the Xenon is not flashed.

Can you run particle serial inspect (in Listening Mode) and post the output?

The result of particle serial inspect:

Platform: 14
Modules
  Bootloader module #0 - version 300, main location, 49152 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  Monolithic module #0 - version 403, main location, 802816 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS

You’d need a hybrid or modular system to flash a modular application.
Hence I’d suggest these steps

  • download this system binary file
  • flash that with particle flash --usb ./system-part1-0.9.0-xenon.bin -v
  • run particle flash --usb tinker -v
  • try particle serial inspect again - you should then see an application module section too
  • try your own application again

I’ve done the steps. The Xenon is still blinking blue but unable to setup with the particle app.
Here are the logs:

PS C:\Particle\Project> particle flash --usb system-part1-0.9.0-xenon.bin -v
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d00e
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 = 613572
Download        [=========================] 100%       613572 bytes
Download done.
File downloaded successfully
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Cannot open DFU device 2b04:d00e

Flash success!
PS C:\Particle\Project> particle flash --usb tinker -v
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Opening DFU capable USB device...
ID 2b04:d00e
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 = 11012
Download        [=========================] 100%        11012 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!!!
Cannot open DFU device 2b04:d00e

Flash success!
PS C:\Particle\Project> Particle serial inspect
Platform: 14
Modules
  Bootloader module #0 - version 300, main location, 49152 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
  System module #1 - version 403, main location, 671744 bytes max size
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      Bootloader module #0 - version 101
      undefined module #0 - version 0
  User module #1 - version 5, main location, 131072 bytes max size
    UUID: 1694D20EB67860398244AB56B1D6E8C7D22E0CDFB62F8B7DA7FD7CC13539CC91
    Integrity: PASS
    Address Range: PASS
    Platform: PASS
    Dependencies: PASS
      System module #1 - version 326
      undefined module #0 - version 0
  empty - factory location, 131072 bytes max size

That’s unfortunate but shouldn’t pose too much of a problem.

You can flash this code to get the device out of Listening Mode

#include "Particle.h"
#include "dct.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
void setup() {
    const uint8_t val = 0x01;
    dct_write_app_data(&val, DCT_SETUP_DONE_OFFSET, 1);
    Particle.connect();
    // This is just so you know the operation is complete
    pinMode(D7, OUTPUT);
    digitalWrite(D7, HIGH);
}

Oke, I flashed the application you provided.
D7 turns blue, so the application is successfully flashed.
But still in listening mode (blinking blue) and unable to setup with the particle app.

After all, I was able to connect the device to the mesh network and particle cloud using the CLI.
Now I can flash the device from via the cloud, so that issue is fixed.
Only 1 thing remains: the device starts in listening mode and the only way to get out of there is with the CLI command: particle usb stop-listening.
So my last question is: How do I remove that start in listening mode?

maybe try a void loop at end of ScruffR program?

void loop() {
}

i’ve always thought it was required but may be wrong.

I’ve tried that but that’s not the solution.

If it’s not provided by user code an empty loop() is “assumed” by the device OS main() function.

This shouldn’t be - unless there are reasons that put your device in LM.

My first hunch in that direction would be the magic baudrate (28800) that can cause your device to enter LM. To tick that off the list of possible causes try powering your Xenon from a USB charger instead of a computer USB port - the defaul baudrate of your computer may activate LM.

Or the running code (which of course is unlikely you’d not know about that).

Trying to run AUTOMATIC mode without mesh network credentials may also cause that behaviour. Standalone Xenons mustnot try running any Mesh.xxx() functions.

If that’s not it there may be more exotic reasons but most of them would warrant a support ticket at support.particle.io.

ok. thanks, that’s good to know.

I’ve tried all different options now, but the Xenon always starts with blinking blue and the only way to get him out of there is with the CLI command: particle usb stop-listening “device-id”
The weird thing is that the Xenon is also not able to connect with the Particle app when in listening mode.

I will do that, I lett you now.

Finally, particle replaced my Xenon.
So no clue what happened to my xenon to get in this stuck mode