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

nRF Connect, APPROTECT

Hi,

I would like to enable the APPROTECT readback protection.

What is the advised way to do this when using nrf connect/zephyr? The following line doesn't work (the 'at' attribute is ignored):

const uint32_t approtect_set __attribute__((used,at(0x10001208))) = 0xFFFFFF00;

I'm thinking this could be fixed by using a 'section' attribute, and define a section in the linkerscript, but I'm not quite sure how to do that using the ncs toolchain. Think the partition manager is involved (maybe i need to define a section in my pm_static.yml file)?

I could let the application write this register, then reboot to activate it, but I'd prefer the 'at'/'section' method if possible.

Parents
  • Hi,

     

    The appropriate way to place something on a absolute address is to use a linker script, but: there's no uicr section defined as a linker section, meaning that if you try this you will get an out-of-bounds error when linking your program.

    You can call "nrfjprog --rbp ALL && nrfjprog --reset" to readback protect and reset the device (to latch the new configuration).

     

    Kind regards,

    Håkon

  • The appropriate way to place something on a absolute address is to use a linker script, but: there's no uicr section defined as a linker section, meaning that if you try this you will get an out-of-bounds error when linking your program.

    Indeed. I was hoping for some pointers on how to define a new section. I know my way around gcc linkerscripts, but don't now how to do this when using the ncs toolchain..

    Using nrfjprog is another option, but yet one more step to take in the programming sequence. I was (still am :)) hoping for a single 'burn hex, boot, done' sequence.

Reply
  • The appropriate way to place something on a absolute address is to use a linker script, but: there's no uicr section defined as a linker section, meaning that if you try this you will get an out-of-bounds error when linking your program.

    Indeed. I was hoping for some pointers on how to define a new section. I know my way around gcc linkerscripts, but don't now how to do this when using the ncs toolchain..

    Using nrfjprog is another option, but yet one more step to take in the programming sequence. I was (still am :)) hoping for a single 'burn hex, boot, done' sequence.

Children
Related