How to unbrick Xenon (return to factory default firmware)

xenon
Tags: #<Tag:0x00007fe21b6124c0>

#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?


#22

Thanks @jaredwolff. Finally got time to come back on this project. Yes it is resolved - tried another (unmodified) NRF5x DK using 10 pin cable directly back to back worked well.

Thank you again for your kind help and tips.


#23

Thanks @jaredwolff. After I lost my mind you instructions and code made my Xenon working. I had the use a j-link and an adapter board. Is there some way we can put all the instruction and the GitHub in one place for the next guy. It really took some digging to find all the links.

Thanks Again.


#24

@Chappy happy to help! :slight_smile: I’ll pop it all in the repository.

@janek can you select my post below as the “answer”? That way people don’t get lost. :innocent:


#25

Actually looks like I can’t edit that one. Here’s all the info in one place. I’ve modified this for 1.4.4. This should work with any version of deviceOS though.

A full explanation is coming but you can clone this repository . The only thing you’ll need to install is jlinkexe. Here’s a link to that download: https://www.segger.com/downloads/jlink/#J-LinkSoftwareAndDocumentationPack

You need to download all the files that match your device. This incluedes the Soft Device, Bootloader, System Part and Tinker images. Here’s a whole zip for 1.4.4 for each of the Particle Mesh boards:

Argon

Xenon

Boron

All links are from the release page on Github: https://github.com/particle-iot/device-os/releases/tag/v1.4.4

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/softdevice.hex
  2. Then, run to program the bootloader.
    ./nrfjprog.sh --flash-bootloader-bin /path/to/xenon-bootloader@1.4.4.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.4.4.bin
  4. Finally, lets flash Tinker to make sure everything works!
    particle flash --usb /path/to/xenon-tinker@1.4.4.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:

Side note: the purple board is a level translator board I designed a while back. Works great for designs that are < 2.25V. :slight_smile:


I think I broke my argon
#26

hi

What is the difference between j-link and particle debugger, i planned update xenon to custom firmware by debugger or need j-link for that ?
there is cheap st-link v2, it is possible to upgrade it to j-link if necessary.

thanks


#27

There’s a big difference actually. Particle’s debugger uses an open source debugger firmware developed by ARM. Whereas Jlink’s is completely closed source. If you’re looking to debug your application, I highly recommend going with the Particle debugger or debuggers that are CMSIS-DAP capable.


#28

i looking for debug application, for replace particle firmware and to unbrick/return to factory firmware if needed


#29

Ahh gotcha. The J-Link is better supported in Nordic’s SDK. Plus they have mini J-Links on every single one of their development boards. That would be my vote if you’re not using DeviceOS