Reflash Puck.js using J-Link OB

Posted on
  • I made an application using Nordic's SDK on their nRF52 DK board, which has the same processor as Puck.js. Now, I'd like to run my app on the Puck.js. I can flash Puck using the J-Link OB from the nRF52 DK board but I would also like to be able to go back to Puck.js original firmware.
    My application (see screenshot from nRFgo Studio) uses SoftDevice 132 and does not have a bootloader.
    I see that I can download binary file from Espruino.com (espruino_1v94_puckjs.bin) but I am not sure that is enough.
    I have nRFgo Studio and I can download hex from Puck.js, but only application and softdevice. It won't let me download the bootloader.
    So the question is, if I perform a complete chip erase, will I be able to load back all the Puck.js original firmware, including bootloader and how. As I said, I have nRFgo Studio and J-Link OB at my disposal.

    Thank you
    Jakub


    1 Attachment

    • myapp.png
  • Hi Jakub,

    The published files on Espruino.com don't include the bootloader, no. However you could re-build it yourself or I could send you a full hex file. I'm very surprised you can't read the whole contents of memory as a hex file though? I'm certain I've done that in the past for debugging.

    Your other option is to just write your firmware as-is, keeping the bootloader. Espruino's bootloader doesn't do any checks on the firmware as far as I remember, so it should just boot right into what you supply.

    The private key for signing Espruino firmwares is also in the Espruino repo, so you could even make your own DFU package including your code if you needed,

  • Thank you for the swift response! Right now, the easiest thing for me would be to have the bootloader hex so I could alternate between Puck.js original FW and my FW.
    On the nRFgo Studio "Program Bootloader" tab, there is only "Program" option, whereas on SoftDevice and Application tabs, I can extract the hex. I don't know why it is this way. I am used to ST-Link utility where you can see the memory and download the whole image as one file...

  • I use something called nrfjprog which is a command-line tool. It's got a --readcode option on it.

    I've just attached what I believe is a complete 1v94 firmware though - including softdevice and bootloader.


    1 Attachment

  • That worked, even through nRFgo Studio. Thank you very much, Gordon!

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

Reflash Puck.js using J-Link OB

Posted by Avatar for kaktus @kaktus

Actions