This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[NRF81522] Can't enable Read Protection ALL (RBPCONF)

Hello,

I am trying to enable the read protection on the NRF51822 on a custom board. By looking through the forums, I found different ways to try and enable the read protection.

According to the reference manual, bits 8 to 15 from RBPCONF must be set to 1 in order to enable the read protection for all the chip. RBPCONF is a RW register, so we should be able to write to the register directly.

So using sd_flash_write, I have this function.

void UTILS_EnableReadProtection (void)
{
#ifdef RELEASE
uint32_t RegisterValue;

RegisterValue = ~(0x0000FF00);
// Check if read-back mechanism is turned ON.
if((uint32_t)((NRF_UICR->RBPCONF & UICR_RBPCONF_PALL_Msk) >> UICR_RBPCONF_PALL_Pos) != UICR_RBPCONF_PALL_Enabled) {
sd_flash_write((uint32_t *)&NRF_UICR->RBPCONF, &RegisterValue,1);
}
//nrf_nvmc_write_word(0x10001004, 0x0000FF00);
#endif
}

I tried both the method with sd_flash_write, or with nrf_nvmc_write_word to no avail. I tried with and without power cycle and still the same.

What am i missing here?

Thanks,

Jean-Francois

  • The error I am getting is this :

    PS C:\Users\Gagnonje> nrfjprog --memrd 0x100010004 --log
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.

    The log file I posted above is the result of --log.

    This is a custom board with a     NRF51822. I can use all of the Segger tools on the custom board, but nrfjprog doesn't work. 

    I can JTAG in the board just fine on different computers and we've done the whole dev with the segger tools.

    I did not try nrfjprog on another computer.

    edit : Running powershell in admin doesn't make a difference, still the same errors

  • The -1 error typically means that the J-Link cannot find the chip, which can be caused by wrong supply voltage, wrong connections, board not powered, etc. What J-Link device are you using with the custom board, and how is it connected? Strange if you are able to use other tools with the same setup.

  • I use the Flasher Arm from Segger which we bought at the beginning of this year (February I think). If I don't touch the setup, I can JTAG the chip repeatedly but can't use any nrfjprog commands. 

    We've run the panelizeds board through multiple rounds of testing with a successful programming using the J-Link lite as well, so I am confident that the voltage levels, as well as the connections are correct.

    Just for testing, I flashed the softdevice (which worked) and tried to use nrfjprog --recover right after, without touching the setup, and I still get the same error as above. 

  • I tried upgrading to the same version of nRF Command Line Tools that you are using, but I'm not able to reproduce this behavior with a DK. Can you check if you are able to use nrfjprog with a different computer, to determine if this is caused by software or hardware problems?

Related