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

nrfjprog code region 0

hey,

so today I updated my NRF Tools... I guess i was using an old version before.

To test our prototypes we have a test fixture where the board is programmed at the end. I used to use the following command with no problems: nrfjprog -e --programs <file.hex>

with the new tools the command doesn't excist, so I tried with: nrfjprog --program <file.hex> --chiperase

After that I program the application and the bootloader. The problem arises as soon I programmed the bootloader... then the application doesn't run. If I program everything with NrfGo it works fine, so I investigated a little ;)

What I found out is, that with the new tools nothing is written into UICR.CLENR0, so the flash is not divided into Region 0 and Region 1.

Is there a possibility to do that with the updated tools?

Have a nice day, Alex

P.S. we are using NRF51822

Parents
  • Which version of nrftools are you using? Did you get any warning messages while programming your device? If there are no warnings then it should have worked (although i am not sure if the chip erase is done before programming softdevice or after. I do not have nrfjprog at my home PC to try it out)

    Can you please post your commond logs here.

  • You are seeing this just after you changed nrfjprog tool and all the hex files are the same? The latest version of softdevice hex not write to UICR.CLENR0 by default. Which means that it is user choice to protect the softdevice or not. Seems that your bootloader might be trying to read this register to jump to the application vector table. How old is your bootloader? The softdevice and the application do not have to be split between code region 0 and 1, it should work even if nothing is protected and in that case your whole flash will be CR1. If you cannot use latest version of bootloader and/or softdevice, then do the same thing like below for UICR.CLENR0 in your application and it should work from nrfjprog and nrfgo and your softdevice is in CR0 all the time devzone.nordicsemi.com/.../

Reply
  • You are seeing this just after you changed nrfjprog tool and all the hex files are the same? The latest version of softdevice hex not write to UICR.CLENR0 by default. Which means that it is user choice to protect the softdevice or not. Seems that your bootloader might be trying to read this register to jump to the application vector table. How old is your bootloader? The softdevice and the application do not have to be split between code region 0 and 1, it should work even if nothing is protected and in that case your whole flash will be CR1. If you cannot use latest version of bootloader and/or softdevice, then do the same thing like below for UICR.CLENR0 in your application and it should work from nrfjprog and nrfgo and your softdevice is in CR0 all the time devzone.nordicsemi.com/.../

Children
No Data
Related