[158] RADIO: Using POWER register clears RADIO trim values

This anomaly applies to IC Rev. Revision 1, build codes CLAA-D00, QKAA-D00.

Domains

Network

Symptoms

RADIO performance is degraded.

Conditions

RADIO->POWER register is set to Disabled and then back to Enabled.

Consequences

RADIO trim values in the device startup SystemInit() function are not reloaded.

Workaround

After writing RADIO->POWER to Enabled, perform the following configuration steps before writing to any other RADIO register.
/* Copy all the RADIO trim values from FICR into the target addresses.*/
uint32_t index = 0;
for (index = 0; index < 32ul && NRF_FICR_NS->TRIMCNF[index].ADDR != (uint32_t *)0xFFFFFFFFul; index++){
    #if defined ( __ICCARM__ )
        /* IAR will complain about the order of volatile pointer accesses. */
        #pragma diag_suppress=Pa082
    #endif
    if (((uint32_t)NRF_FICR_NS->TRIMCNF[index].ADDR & 0xFFFFF000ul) == (volatile uint32_t)NRF_RADIO_NS)
    {
        *((volatile uint32_t *)NRF_FICR_NS->TRIMCNF[index].ADDR) = NRF_FICR_NS->TRIMCNF[index].DATA;
    }
    #if defined ( __ICCARM__ )
        #pragma diag_default=Pa082
    #endif
}