How to unbrick Xenon (return to factory default firmware)

xenon
Tags: #<Tag:0x00007fe21fbe0fd8>

#2

Can you elaborate or provide a video?
Can you get into DFU Mode?


#3

Hi, I would like initially to use Xenon as a standalone device (not a part of mesh network) talking to my phone and doing things like sensors reading, on/off, etc. I did follow the instruction from here https://medium.com/home-wireless/using-segger-studio-and-nordic-sdk-with-particle-xenon-91e34aeb632a to install Adafruit bootloader and use it Arduino style. I can’t get into DFU mode now. The nRF52840 chip coming from factory most likely comes with blank flash memory, so Particle does the programming of Xenon. My question is how can I flash the Particle original firmware (the bootloader, Particle OS, Nordic libraries, whatever else is there) into my Xenon.


#4

You can have a look here
https://docs.particle.io/support/particle-tools-faq/jtag/#openocd-commands-3rd-generation-


#5

Thanks for the link. Unfortunately only the Gen 1 and 2 devices are covered and the Jlink is not covered. That part of documentation is old, not updated and very complex. Most microcontrollers today can be flashed with a single click, using a single *.hex or *.bin file instead of typing a dozen on command line commands (easy to make a mistake) Surely the Particle production must use a quicker and simpler way


#6

Really?


#7

@janek after some research and trying it myself, you can un-brick a Xenon, Argon and Boron using a NRF52 DK (or similar)

A full explanation is coming but you can clone this repository. Then, you can follow the instructions at the end of the Readme.

You need to download a bootloader binary from the release page on Github. You’ll also need the soft device.

Good luck! :slight_smile:


Bricked boron after using nrf sdk
#8

Thanks a lot, much appreciate it. I will check it when back from my trip. Will it work with J-link or do I need to buy a Particle Debugger? Are the Particle, Adafruit and Nordic bootloaders compatible?


#9

This is specifically for J-Link.

Particle’s boot loader is different from anything else.


#10

@janek, revisiting this:

Just remember you’ll need to program the system part and the tinker app to make sure everything is working afterwards. My xenon got into a weird state probably due to programing an image out of order.

Here are the steps for anyone else who’s interested:

  1. Run the following to program the soft device
    ./nrfjprog.sh --flash-softdevice /path/to/s140_nrf52_6.0.0_softdevice.hex

  2. Then, run to program the bootloader.
    ./nrfjprog.sh --flash-bootloader-bin /path/to/xenon-bootloader@1.3.0-rc.1.bin 0xf4000

  3. The device should be blinking yellow. Next, let’s program the system part:
    particle flash --usb /path/to/xenon-system-part1@1.3.0-rc.1.bin

  4. Finally, lets flash Tinker to make sure everything works!
    particle flash --usb /path/to/xenon-tinker@1.3.0-rc.1.bin

You should be able to substitute any version of deviceOS with the one I used above. Just make sure that the boot loader, system part and Tinker are all the same version.

Here’s a picture of my setup:


#11

@jaredwolff thank you for sharing your knowledge and experience with community. Much appreciate it, it saves a lot of time


#12

You’re welcome. I hope it worked for you :grinning:


#13

I have been doing some un-bricking of Argons and your route makes me wonder how hard is it to actually load nordic example nrf52840 code onto particle mesh devices? I don’t have a j-link but have been working with the nrf52840 usb dongles, which must be reasonably similar to the particle mesh devices. Any suggestions for getting Nordic software onto Particle.

I have a gitpod (Browser based docker) that loads the entire Openthread (and ARM files) and generates output for a nrf52840 board.

Open in Gitpod


#14

@rocksetta very doable. As long as you have an nRF52x development board you should be able to easily program the onboard nRF52840. (Using nrfjprog) If you’re utilizing an Argon, you’ll likely have to implement or utilize NCP software to get Wifi to work. (if you’re going that far)

I haven’t played with the nRF52 SDK w/ OpenThread for probably two years. I’m sure it’s come a long way since then. :grin: I have no doubt though that it will not be as user friendly as Particle Development environment is.

Good luck & have fun


#15

So true (would really love to use Particle IDE with full Openthread), however working code trumps non-working code.Using Particle Mesh Devices with the OpenThread Border Router
Using Particle Mesh Devices with the OpenThread Border Router
At one point I new how to use nrfprop, will have to look back at my notes. Thanks for the reply @jaredwolff


#16

Hey @jaredwolff if nrfjprog can do the softdevice and the bootloader why not use it to load the system and tinker? If you know the starting address can you do everything with nrfjprog ? I noticed you put 0xf4000 for the bootloader


#17

You could definitely do it a more manual way. That bash script is a wrapper for JlinkExe before they even came out with nrfjprog for OSX. (Those were the days!) The script is not set up to program at a specific address for the system part. This script is more for getting people back to the Particle environment ASAP. It’s not too hard to tweak if you’re looking to do that.

Additionally, there’s a likely chance that you can use the standard nrfjprog command line tool if you have a hex version of the files. That has the address built in so none of this funny business has to happen. :slight_smile:


#18

@jaredwolff Thanks for sharing your knowledge. Just wondering what’s the tiny board to hook up nRF52 DK and the particle board?


#19

Hey @RichardC,

It’s a level shifter for JTAG that I designed a while back. It allows me to use a 3.3V programmer and program anything from 1.7V to 5V without added complications. As long as you’re 2.4V to 3.3V a standard programmer should work.

Another advantage is that I shorted SB32 on the NRF52DK. This supplies the Debug Out connector to supply 3.3V. It also forces the on board J-Link to use the Debug Out connection at all times. This board isolates the DK 3.3V and the Particle’s 3.3V.


#20

Thank you very much @jaredwolff. Very useful information.

I was trying to hook the nRF52 DK and the particle board directly using the 10 pin cable, then powering the particle using USB but for some reason it just did not work. That’s why I got onto this thread.

Any suggestions?


#21

Can you send a pic of your setup? Generally speaking, “does not work” isn’t helpful in debugging. :sweat_smile:

One suggestion though is to make sure you’re plugging into the correct port on the NRFSDK. Reference my picture above. It’s tempting to use the other one on the board but that’s for the J-Link processor.

If your DK is unmodified, it won’t use the Debug Out port unless it sees 3.3V on the input. So you need to power both the programmer and the Particle board via USB.

I’m assuming the DK works standalone?