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

nrf51822 openOCD GDB open debugger

I am able to flash/program nrf51822 with openOCD on Raspberry-pi and STLink-v2

but when I invoke Open On-Chip Debugger on telnet to write on UICR register, it don't give error but when I read it back, i don't see any change in register value.

Open On-Chip Debugger

nrf51822.cpu mww 0x10001088 0x00000101

nrf51822.cpu mdw 0x10001088 0x10001088 ffffffff ....

After that I used nrfjprog on PC, with same board I was able to update UICR register

C:\Users\hh>nrfjprog --memwr 0x10001088 --val 0xFFFFFF11 Parsing parameters. Writing.

C:\Users\hh>nrfjprog --memrd 0x10001088 0x10001088: FFFFFF11 |....|

Does I have missed anything.

Parents
  • UICR is not a normal register, but handled like FLASH. Look into the NVMC chapter in the reference manual.

    The nrfjprog knows how to handle UICR, but your low level OpenOCD commands only support direct writes - this means you would need to do the unlocking (and erasing) manually via NVMC registers.

    Alternatively you could put the UICR content into your .elf or .hex file - OpenOCD might be able to write to UICR while flashing the firmware.

Reply
  • UICR is not a normal register, but handled like FLASH. Look into the NVMC chapter in the reference manual.

    The nrfjprog knows how to handle UICR, but your low level OpenOCD commands only support direct writes - this means you would need to do the unlocking (and erasing) manually via NVMC registers.

    Alternatively you could put the UICR content into your .elf or .hex file - OpenOCD might be able to write to UICR while flashing the firmware.

Children
Related