cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-2: Fails to receive data and acknowledgement from the slave.

abbas14
Associate II

I have initialized I2C on BlueNRG-248 as a master, and it is able to successfully transmit address and data to the slave, but is unable to receive data and acknowledgement from it. I monitored the lines on an oscilloscope, and confirmed that the slave is working fine and is responding with the correct data as well as acknowledgement.

It would be really appreciable if someone could help me through this.

Looking forward to hearing back soon.

Warm regards,

Abbas.

5 REPLIES 5
Winfred LU
ST Employee

Please try to start with I2C sample project in DK 3.1.0, by default located:

C:\Users\<user id>\ST\BlueNRG-1_2 DK 3.1.0\Project\BlueNRG1_Periph_Examples\I2C\Master_Polling

Thank you, Winfred. Your prompt response is really appreciable.

I already tried that. The sample code is working fine.

But we need to change the pins. Our application has I2C on DIO12 and DIO13 (as opposed to DIO4 and DIO5 in the sample code). Everything else is the same.

It isn't working.

Winfred LU
ST Employee

Please note that when configuring IO12 and IO13 to I2C, they will be I2C1 (instead of I2C2 for IO4 and IO5).

Thus, the related configurations have to be modified:

const I2C_Type* s_I2cPeripheralVersion[SDK_PLATFORMS_NUMBER] = {I2C1};
const uint32_t s_I2cDataPinVersion[SDK_PLATFORMS_NUMBER] = {GPIO_Pin_13};
const uint32_t s_I2cDataModeVersion[SDK_PLATFORMS_NUMBER] = {Serial0_Mode};
const uint32_t s_I2cClkPinVersion[SDK_PLATFORMS_NUMBER] = {GPIO_Pin_12};
const uint32_t s_I2cClkPinModeVersion[SDK_PLATFORMS_NUMBER] = {Serial0_Mode};
const uint8_t s_I2cIrqVersion[SDK_PLATFORMS_NUMBER] = {I2C1_IRQn};

Hello Winfred.

Thank you once again.

Yes, I am aware. As I mentioned on the original message, it isn't that the I2C is not getting initialized or it isn't working. It is working working perfectly. Both the master and the slave are working perfectly, and states of the clock and data pins are changing as they should. The only problem is that the master (BlueNRG-2) is not able to register the data and the ACK being sent by the slave. Some times it does register, but this is not consistent. Sometimes it receives the data, but misses the ACK, and so, it flushes the data.

Do you resolve this question?

I think I meet the same question.