JLinkExe equivalent of nrfjprog --erasepage

Hello, We're using JLinkExe for production programming. Is there an equivalent of the nrfjprog --erasepage command for JLinkExe?

I'm looking for the equivalent of

nrfjprog -f nrf52 --erasepage 0x0007F000-0x00080000

It would be cool if nrfjprog could provide information on how it uses libjlink.

Alternative: Give a command that lets me clear those pages out of a .hex file.

Thanks, Jacob

  • Hi Jacob,

    in order to erase a page on the nRF52 you first have to enable erase mode by writing to the CONFIG register and then write the address of the first word on the flash page to the ERASEPAGE register of the NVMC peripheral, see this section of the nRF52832 Product Specification. Thus, if you want to erase the flash page starting at 0x7F000 you use the following commands

    w4 4001E504 2
    w4 4001E508 0007f000
    w4 4001E504 0

    The last command sets the program memory access mode to read access only.

    You also might want to take a look at pynrfjprog, here is the link to the GitHub repo.

    Best regards