I have customized PCB based on BGM13P22, when i am trying to init my sensor on I2C0 bus (PC10_SDA#15, PC11_SCL#15) default configuration of soc_empty 2.11.5, I have code 1 for I2C_TransferInit. for I2C_Transfer loop, first time i have code 1, second code -1, then only -5.
Any person have an idea about the error ?
I have checked PCB circuit, it seems good.
Thank you,
Abba
Bluetooth Low Energy
Discussion Forums
Unanswered
Hi,
Your question is related to the EFR32 peripherals and not the Bluetooth stack so it was moved to the 32-bit MCU forum.
Regards,
Tiago
0
You should post your initialization and transfer code so we can understand see exactly what is being done.
0
Have you measured the I2C waveform to know what happens there?
0
Thank you for you all,
I have found the problem, there is a mistaks in the PCB customisation.
regards,
Abba
0
Hi,
I am sorry for reopening this thread, but i am wrong about in my last comment, my custom PCB is ok.
Please find under the code steps (this code is working well dev kit)
I2C software communication error -5
Hi,
I have customized PCB based on BGM13P22, when i am trying to init my sensor on I2C0 bus (PC10_SDA#15, PC11_SCL#15) default configuration of soc_empty 2.11.5, I have code 1 for I2C_TransferInit. for I2C_Transfer loop, first time i have code 1, second code -1, then only -5.
Any person have an idea about the error ?
I have checked PCB circuit, it seems good.
Thank you,
Abba
Hi,
Your question is related to the EFR32 peripherals and not the Bluetooth stack so it was moved to the 32-bit MCU forum.
Regards,
Tiago
Thank you for you all,
I have found the problem, there is a mistaks in the PCB customisation.
regards,
Abba
Hi,
I am sorry for reopening this thread, but i am wrong about in my last comment, my custom PCB is ok.
Please find under the code steps (this code is working well dev kit)
void i2c_transfer(uint16_t device_addr, uint8_t cmd_array[], uint8_t data_array[], uint16_t cmd_len, uint16_t data_len, uint8_t flag)
{
// Transfer structure
I2C_TransferSeq_TypeDef i2cTransfer;
// Initialize I2C transfer
I2C_TransferReturn_TypeDef result;
i2cTransfer.addr = device_addr;
i2cTransfer.flags = flag;
i2cTransfer.buf[0].data = cmd_array;
i2cTransfer.buf[0].len = cmd_len;
// Note that WRITE_WRITE this is tx2 data
i2cTransfer.buf[1].data = data_array;
i2cTransfer.buf[1].len = data_len;
// Set up the transfer
result = I2C_TransferInit(I2C0, &i2cTransfer);
printLog("I2C_TransferInit result = %d \n\r", result);
// Do it until the transfer is done
while (result != i2cTransferDone)
{
if (result != i2cTransferInProgress)
{
}
result = I2C_Transfer(I2C0);
printLog(" result = %d \n\r", result);
}
// printLog("transfert done\r\n");
// BSP_LedSet(0);
}
Then i have in my log:
infinite loop.
Have you any idea ?
regards,
Abba