I2C Receive Function Size Parameter Problem
Hi,
I am working on STM32G474RET6 MCU in i2c slave mode. I want to make a polling mode with DMA but the problem is i don't know the receiving data's length. Every time it can be different. But 'HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size)' function takes size parameter. I tried to give the size parameter buffer size. And for example i gave 20 as a parameter but get 5 byte data.When i do that, it takes the whole data to the buffer but hi2c state stays busy and it does get into ErrorCallback instead of RxCompltdCallback.
I tried to give the size 1 and takes the data one by one. It takes the data. But it overwrites the data in the same column of the buffer itself and in the end i can only take the last byte. And also again it goes into ErrorCallback.
Is there any way I can communicate without knowing the size parameter?
