Part Number: CC2640R2F
Tool/software:
We are developing a serial bootloader for CC2640R2F and we need to use I2C in bootloader. Due to size limitation, I cannot use TI Drivers since it is too big for bootloader, so I use driverlib without TI-RTOS.
I have enable the I2C Clock and configure IO by following code
PRCMPowerDomainOn(PRCM_DOMAIN_PERIPH | PRCM_DOMAIN_SERIAL); while (PRCMPowerDomainStatus(PRCM_DOMAIN_PERIPH | PRCM_DOMAIN_SERIAL) != PRCM_DOMAIN_POWER_ON); PRCMPeripheralRunEnable(PRCM_PERIPH_I2C0); PRCMPeripheralSleepEnable(PRCM_PERIPH_I2C0); PRCMPeripheralDeepSleepEnable(PRCM_PERIPH_I2C0); PRCMLoadSet(); while (!PRCMLoadGet()); IOCPortConfigureSet(PIN_I2C_SCL,IOC_PORT_MCU_I2C_MSSCL,IOC_NO_IOPULL); IOCPortConfigureSet(PIN_I2C_SDA,IOC_PORT_MCU_I2C_MSSDA,IOC_NO_IOPULL);
Initialize I2C using following code
I2CMasterDisable(I2C0_BASE);
if(cfg->atcai2c.baud == 1000000){
I2CMasterInitExpClk(I2C0_BASE,48000000,false);
}else if(cfg->atcai2c.baud == 400000){
I2CMasterInitExpClk(I2C0_BASE,48000000,true);
}else{
I2CMasterInitExpClk(I2C0_BASE,48000000,false);
}
I2CMasterSlaveAddrSet(I2C0_BASE, address,false);
I2CMasterEnable(I2C0_BASE);
But when I write 0x07 to MCTRL, then write 0x00 to DATA register. the MSTAT:BUSY keep at 1 and other MSTAT bits all zero. I2C is not working as normal just like I previously use TI Driver
Is there anything I am missing to configure?