Giter Club home page Giter Club logo

boron-recovery's Introduction

Device restoration test

Description


Assertion failure (10 blinks between 2 SOS patterns)

Assertion failure is triggered when a test for something that should never occur occurs, and there is no solution other than to SOS and restart. Code might do this if the internal state is invalid and not what is expected, for example. Or something that should never happen and is non-recoverable, for example if the system thread cannot be created. At the moment, all of the AssertionFailures are in things related to threads and the system thread, but that’s just because those are the only things that have been instrumented with an AssertionFailure panic.

Steps undertaken

Device restoration via USB


Only works if the device is in DFU mode which i cannot do on the bricked boards

Device restoration via JTAG


Bricked particle Boron restoration tests with the Particle Debugger.I have written several bash scripts to make testing easier

  • Connect the Particle Debugger ribbon cable between the debugger and device.

  • Connect the device by USB to your computer

  • Connect the Particle Debugger by USB to your computer

  • Put the device in DFU mode (blinking yellow) by holding down MODE. Tap RESET and continue to hold down MODE while the status LED blinks magenta (red and blue at the same time) until it blinks yellow, then release MODE.

  • Run the setup script

    ./setup.sh

    Output:

    Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-09-09-19:42)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport "swd". To override use 'transport select    <transport>'.
    adapter speed: 1000 kHz
    
    Warn : Transport "swd" was already selected
    swd
    Info : CMSIS-DAP: SWD  Supported
    Info : CMSIS-DAP: FW Version = 0254.2
    Info : CMSIS-DAP: Serial# = 310436023538ce6d0433363639323946a5a5a5a597969908
    Info : CMSIS-DAP: Interface Initialised (SWD)
    Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
    Info : CMSIS-DAP: Interface ready
    Info : clock speed 1000 kHz
    Info : SWD DPIDR 0x2ba01477
    Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : nrf52.cpu: external reset detected
    Info : Listening on port 3333 for gdb connections
    {name nrf5 base 0 size 0 bus_width 1 chip_width 1} {name nrf5 base 268439552 size 0 bus_width 1     chip_width 1}

    The flash list command is done here for illustration purposes and to make sure the debugger can connect to the boron device.

  • Program the bootloader Download the appropriate bootloader bin file from the release site and run the flash_bootloader script

    ./flash_bootloader.sh

    Output:

    Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-09-09-19:42)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport "swd". To override use 'transport select    <transport>'.
    adapter speed: 1000 kHz
    
    Warn : Transport "swd" was already selected
    swd
    Info : CMSIS-DAP: SWD  Supported
    Info : CMSIS-DAP: FW Version = 0254.2
    Info : CMSIS-DAP: Serial# = 310436023538ce6d0433363639323946a5a5a5a597969908
    Info : CMSIS-DAP: Interface Initialised (SWD)
    Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
    Info : CMSIS-DAP: Interface ready
    Info : clock speed 1000 kHz
    Info : SWD DPIDR 0x2ba01477
    Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : nrf52.cpu: external reset detected
    Info : Listening on port 3333 for gdb connections
    target halted due to debug-request, current mode: Thread 
    xPSR: 0x01000000 pc: 0x00000998 msp: 0x20000400
    ** Programming Started **
    Info : nRF52840-QIAA(build code: C0) 1024kB Flash
    Warn : using fast async flash loader. This is currently supported
    Warn : only with ST-Link and CMSIS-DAP. If you have issues, add
    Warn : "set WORKAREASIZE 0" before sourcing nrf51.cfg/nrf52.cfg to disable it
    ** Programming Finished **
    ** Verify Started **
    ** Verified OK **
    ** Resetting Target **
    ./flash_softdevice.sh

    Output:

    Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-09-09-19:42)
    Licensed under GNU GPL v2
    For bug reports, read
            http://openocd.org/doc/doxygen/bugs.html
    Info : auto-selecting first available session transport "swd". To override use 'transport select    <transport>'.
    adapter speed: 1000 kHz
    
    Warn : Transport "swd" was already selected
    swd
    Info : CMSIS-DAP: SWD  Supported
    Info : CMSIS-DAP: FW Version = 0254.2
    Info : CMSIS-DAP: Serial# = 310436023538ce6d0433363639323946a5a5a5a597969908
    Info : CMSIS-DAP: Interface Initialised (SWD)
    Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
    Info : CMSIS-DAP: Interface ready
    Info : clock speed 1000 kHz
    Info : SWD DPIDR 0x2ba01477
    Info : nrf52.cpu: hardware has 6 breakpoints, 4 watchpoints
    Info : nrf52.cpu: external reset detected
    Info : Listening on port 3333 for gdb connections
    target halted due to debug-request, current mode: Thread 
    xPSR: 0x01000000 pc: 0x00000998 msp: 0x20000400
    ** Programming Started **
    Info : nRF52840-QIAA(build code: C0) 1024kB Flash
    Info : Padding image section 0 at 0x00000a18 with 1512 bytes
    Warn : using fast async flash loader. This is currently supported
    Warn : only with ST-Link and CMSIS-DAP. If you have issues, add
    Warn : "set WORKAREASIZE 0" before sourcing nrf51.cfg/nrf52.cfg to disable it
    ** Programming Finished **
    ** Verify Started **
    ** Verified OK **
    ** Resetting Target **

    So seems like i am successfully able to flash both the bootloader and the softdevice, all this however does not seem to recover the brinked devices from the assertion fault state. Looking into the documentation further the above flash procedure does not erase configuration ie the following are not erased:

    • Emulated EEPROM contents
    • Device Keys
    • Gen 3 Wi-Fi credentials, APN settings, antenna, and SIM selection configuration
    • Anything else in the DCT
    • Gen 3 flash file system contents

    On Gen 3 devices the Bootloader, Soft Device, UICR bytes, Device OS, and Tinker are restored.

    ToDo

    • Erase all available user flash (including UICR[User information configuration registers])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.