Merge branch 'fix/ble_i2c' into 'master'

fix(i2c): Fix i2c read from fifo issue when enabling bt/wifi/uart, etc...

Closes IDFGH-11762

See merge request espressif/esp-idf!31917
This commit is contained in:
C.S.M
2024-11-29 13:48:29 +08:00

View File

@@ -575,7 +575,9 @@ __attribute__((always_inline))
static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len) static inline void i2c_ll_read_rxfifo(i2c_dev_t *hw, uint8_t *ptr, uint8_t len)
{ {
for(int i = 0; i < len; i++) { for(int i = 0; i < len; i++) {
ptr[i] = HAL_FORCE_READ_U32_REG_FIELD(hw->fifo_data, data); // Known issue that hardware read fifo will cause data lose, (fifo pointer jump over a random address)
// use `DPORT_REG_READ` can avoid this issue.
ptr[i] = DPORT_REG_READ((uint32_t)&hw->fifo_data);
} }
} }