This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How do I configure my project to write to UICR in IAR

Hello,

I'm trying to create my own bootloader application that uses softdevice in IAR. I would like to know how to configure my project so that it writes 0x0003A000 to the UICR at 0x10001014.

I am using IAR workbench, but when I use

#pragma location = 0x10001014
__root uint32_t uicr = 0x0003A000;

the value is not present at this specific address after i flash the device.

Is there an example available how to do this in IAR?

Thanks in advance

Parents
  • Thank you for your answer. you are correct that it fills the entire bin file with padding if i add it to the icf file.

    I have solved the problem by having my application write the UICR boot address register if it is not found like so:

    uicrTemp = *(reinterpret_cast<volatile uint32_t *>(0x10001014));
    if (uicrTemp != 0x0003A000){
    	nrf_nvmc_write_word(0x10001014, 0x0003A000);	
    }
    
Reply
  • Thank you for your answer. you are correct that it fills the entire bin file with padding if i add it to the icf file.

    I have solved the problem by having my application write the UICR boot address register if it is not found like so:

    uicrTemp = *(reinterpret_cast<volatile uint32_t *>(0x10001014));
    if (uicrTemp != 0x0003A000){
    	nrf_nvmc_write_word(0x10001014, 0x0003A000);	
    }
    
Children
No Data
Related