cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a limit on how many bytes to send over I2C from the slave? The MCU is STM32F469NI, and I have programed the board to act as an slave, it works fine if amount of data sent from slave is less than 100 bytes, but data gets corrupted if sent more.

fzx
Associate II

Is there a limit on how many bytes to send over I2C from the slave?

The MCU in question is STM32F469NI, and I have programed the board to act as an slave using HAL, it works fine if amount of data sent from slave is less than 100, but gets corrupted for data bigger than 100. I have studied the datasheet and the reference manual, but I haven't found any mention of such limitations. It can be demonstrated by some minor medications to the example codes.

4 REPLIES 4
berendi
Principal

There's no such limit in the controller itself, I've made a slave once (on an F429, which has the same I2C block) that sends and receives continuously in one never-ending I2C transaction.

Look for timeouts and fixed size buffers in the code. Don't assume that HAL or the examples are perfect.

fzx
Associate II

Thanks berendi for the reply!

For the sake of simplicity, and to make sure it's not affected by buffers, I have modified HAL's function I2C_SlaveTransmit_TXE to send a hard coded byte (0x55). And after 100 bytes I receive garbage on master side. I have increased all the timeouts.

fzx
Associate II

I have to add that, I have confirmed using a logic analyzer that what the master receives is actually what's on the wire. So the master side is not at fault here.

Cube imposed timeout?

I don't Cube.

JW