cancel
Showing results for 
Search instead for 
Did you mean: 

i2c error

hongjo
Associate II

Dear ST 

I have some question about i2c read functions 

Currently we use zephyr os (version 3.4.0) 

the stm32f412RGT used as the host and the host  reads a 5-byte value from another mcu used as a slave through

i2c

the following problem occurs once every 3 hours after that i2c gets stuck.

 

 

uint8_t rx_buf[5];
rc = i2c_read_dt(&cfg->bus, rx_buf, sizeof(rx_buf));

 

hongjo_0-1742212846669.png

When the host reads the last byte 0x3f normally, it should send nack instead of ack to slave , but it seems that i2c is stuck because ack is sent to slave . Is there a way to solve this?

 

thanks

BR

MR.SHIM 

 

2 REPLIES 2

@hongjo wrote:

the following problem occurs once every 3 hours  


Is that exactly 3 hours, or just "some time around 3 hours" ?

Repeatable?

 

Schematic & details of the slave may help.

hongjo
Associate II

Dear guru

It takes about 3 hours, but when it happens quickly, the I2C STUCK happens in 30 minutes.

When I modified the code on the slave to process it as if it received a nack even though the host sent an ack at the end of the read, the i2c stuck did not occur even after several days of operation

thanks

BR

Mr.shim