• Hello,
    I am trying to flash puckjs via a programming jig from Espruino shop and with NRF 52832 DK and Segger Studio. I managed to load a simple LED sample into my puck v1.0 but my other puck v2.0 stopped working after erasing and flashing the same software (no SoftDevice, using Segger). I tried nrfjprog --recover but the log shows now:

    FUNCTION: recover.
    InitTarget() start
    InitTarget() end
    Found SW-DP with ID 0x2BA01477
    Failed to power up DAP

    Before erasing I was able to see boot+softdev+app in NRF Go Studio.

    Is there another step I need to do before I can erase and load my own firmware?
    Can I still recover this puck?

    Thanks
    Adam

  • Hi! I think the issue you may have is that in order to get enough free pins on the Puck.js v2.0, pin P0.21, the reset pin (if enabled), is used for the magnetometer (which pulls it low by default).

    If you look at the code you compiled, you may find the CONFIG_GPIO_AS_PINRESET is defined, which is what would be causing the issue.

    However, once the microcontroller is configured to use P0.21 as reset I'm not sure if there's a way out of it other than by manually pulling it high and then uploading new firmware. I'm currently asking Nordic to see if there is a way around this.

    However if you want to get it going now (and are ok with some relatively fine soldering) you could attach a wire between pin P0.21 and 3v on the Puck - then you should be able to recover and flash code just fine.


    1 Attachment

    • Screenshot at 2021-04-28 13-05-25.png
  • Thanks!

  • I can confirm that this works:

    1. Solder P0.21 and connect to VDD in programming jig
    2. Run nrfjprog -f NRF52 --recover
    3. Flash firmware without CONFIG_GPIO_AS_PINRESET defined (look in *.emProject and remove)
    4. Run nrfjprog -f NRF52 --memwr 0x10001200 --val 0x00000015

    Adam

  • Run nrfjprog -f NRF52 --memwr 0x10001200 --val 0x00000015

    why this one? this looks like enabling it again (partly, there are two copies of this that must match another is at 0x204). see https://infocenter.nordicsemi.com/topic/­com.nordic.infocenter.nrf52832.ps.v1.1/u­icr.html#register.PSELRESET-0

    CONFIG_GPIO_AS_PINRESET enables code that at each boot checks 0x200 and 0x204 UICR locations and writes 21=0x15 there if needed.

  • Great - glad it's sorted! As @fanoush mentioned you shouldn't need the nrfjprog -f NRF52 --memwr 0x10001200 --val 0x00000015 command if you've used --recover though.

  • After --recover the firmware seemed to work only in the jig, not with a battery. So I tried memwr and then it worked fine. Maybe someone could verify if this step is needed.

  • Maybe someone could verify if this step is needed.

    No need to verify, it makes no sense. Fortunately you did only half of the damage so it is hopefully harmless. If you would also run nrfjprog -f NRF52 --memwr 0x10001204 --val 0x00000015 you would be exactly where you was - reset pin enabled + device in continuous reset.

    Maybe just reboot or something else you did helped. Or maybe you also had another issue why it didn't run on battery.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Unable to recover puckjs after flashing with programming jig

Posted by Avatar for user113493 @user113493

Actions