JLinkExe equivalent of nrfjprog --erasepage

jacob gravatar image

asked 2017-04-20 11:22:29 +0200

updated 2017-04-20 11:22:40 +0200

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

edit retag flag offensive close delete report spam

1 answer

Sort by » oldest newest most voted
bjorn-spockeli gravatar image

answered 2017-04-21 11:03:23 +0200

updated 2017-04-21 11:04:45 +0200

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


edit flag offensive delete publish link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer. Do not ask a new question or reply to an answer here.

[hide preview]

User menu

    or sign up

Recent questions

Question Tools

1 follower


Asked: 2017-04-20 11:22:29 +0200

Seen: 55 times

Last updated: Apr 21