//set life cycle state to secure so you can write into KDR registers only once. NRF_CC_HOST_RGF->HOST_IOT_LCS = 2UL; //copy key from flash to KDR registers NRF_CC_HOST_RGF->HOST_IOT_KDR0 = *((uint32_t *)(DEVICE_SECRET_ADDRESS)); NRF_CC_HOST_RGF->HOST_IOT_KDR1 = *((uint32_t *)(DEVICE_SECRET_ADDRESS + 0x00000004)); NRF_CC_HOST_RGF->HOST_IOT_KDR2 = *((uint32_t *)(DEVICE_SECRET_ADDRESS + 0x00000008)); NRF_CC_HOST_RGF->HOST_IOT_KDR3 = *((uint32_t *)(DEVICE_SECRET_ADDRESS + 0x0000000C)); //DEBUG: check if the key was copied if(NRF_CC_HOST_RGF->HOST_IOT_KDR0 == 1) { retcode = 0; }
I use the above code to copy the device root key from the flash region. The if condition at the end results to FALSE always whcih implies that the key was not copied into the registers. Also the LCS_VALID_FLAG reads as invalid via a debugger. What is the right way to write into the device root key registers?