This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

A question about OpenOCD+nrf51822

I believe what I am asking is extremely specific, but keeping hope that I might get some direction

I have used a clone ST- Link v2 programmer to download code into a NRF51822 Cortex M0 SOC from Nordic. In short, I have been following this guide here

When I try to erase the flash of the chip using OpenOCD as said in the guide, I encounter this error

When I execute

nrf51 mass_erase The terminal says Unknown device (HWID 0x00000057)

Is this that the NRF51822 device is not recognised on the STLink is not recognized?

Further digging reveals that neither the OpenOCD nor the ATTN-51 document from Nordic talks about a device having a HWID as 0x0057. Could this be a clone device?

Can someone assist me? Thanks in advance!

  • Hi Rubin,

    Don't worry, it's not a clone device. We are in the process of shifting out the usage of "HWID" field as an identifier, as this is subject to change on many factors, which makes it not-ideal to use for recognition.

    What you really want to verify by reading the HWID is which revision of the hardware that you are running on, so that you can figure out what SDKs/SoftDevices etc that is compatible for your device.

    This can be done by running the library located in this folder:


    It seems that openocd does a check on the HWID value, which I would not recommend doing. Reading out the IC revision and RAM/CODE size from NRF_FICR structure is the proper way of doing this for the nRF51-series.

    Cheers, Håkon

  • I have nRF51822 with HWID 0x58. No problem flashing with OpenOCD using a CMSIS-DAP jtag. See here.