Does ncs 2.5.0 implement the workaround for TWIM timing spec anomaly 219?

Does ncs 2.5.0 implement the suggested workaround for https://docs.nordicsemi.com/bundle/errata_nRF52840_Rev3/page/ERR/nRF52840/Rev3/latest/anomaly_840_219.html ?

If not, will it be implemeted later?

Parents Reply
  • For ncs, I managed to fix it like this, so that this code runs before main but after driver init:

    static int fix_i2c_anomaly(void)
    {
        const struct device *i2c_dev = DEVICE_DT_GET(DT_NODELABEL(i2c0));
    
        if (i2c_dev) 
        {
            NRF_TWIM_Type *twim = NRF_TWIM0; // Use TWIM instance 0
    
            if (twim->FREQUENCY == NRF_TWIM_FREQ_400K)
            {
                // Set the I2C frequency to 370 kHz
                // https://docs.nordicsemi.com/bundle/errata_nRF52840_Rev3/page/ERR/nRF52840/Rev3/latest/anomaly_840_219.html
                twim->FREQUENCY = 0x05EB8000UL;
            }
        }
    
        return 0;
    }
    
    SYS_INIT(fix_i2c_anomaly, APPLICATION, 0);
    
     

Children
Related