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

how to use nrfjprog to write UICR.BOOTLOADERADDR

Programming the bootloader How the MBR knows the start address of the bootloader?

pape says : This start address is defined in UICR.BOOTLOADERADDR, which is located at address 0x10001014 (see NRF_UICR_BOOTLOADER_START_ADDRESS),how to write number to the address 0x10001014. thank you!

Parents
  • If you're using the bootloader example from the SDK, then this is already handled by the following variable defined in nrf_bootloader_info.c

    uint32_t  m_uicr_bootloader_start_address __attribute__((at(NRF_UICR_BOOTLOADER_START_ADDRESS)))
                                                    = BOOTLOADER_START_ADDR
    

    which ensures that the linker script will write the bootloader start address to the UICR register. This value will be written in the HEX file and thus written to UICR when the bootloader is flashed into the chip.

    However, if you want to manually write to the UICR register then you can use the following nrfjprog command

    nrfjprog -f nrf52 --memwr 0x10001014 --val <value>
    
Reply
  • If you're using the bootloader example from the SDK, then this is already handled by the following variable defined in nrf_bootloader_info.c

    uint32_t  m_uicr_bootloader_start_address __attribute__((at(NRF_UICR_BOOTLOADER_START_ADDRESS)))
                                                    = BOOTLOADER_START_ADDR
    

    which ensures that the linker script will write the bootloader start address to the UICR register. This value will be written in the HEX file and thus written to UICR when the bootloader is flashed into the chip.

    However, if you want to manually write to the UICR register then you can use the following nrfjprog command

    nrfjprog -f nrf52 --memwr 0x10001014 --val <value>
    
Children
Related