2022-03-02 06:13 AM
I'm working with the Nucleo-64 development board with an STM32L476 microcontroller. I wish to receive data over I2C using DMA with the function HAL_I2C_Master_Receive_DMA. However, to use that function I need to specify the parameter Size, and I don't know that until I have received the first byte. Does anybody know how I can solve this?
2022-03-02 07:02 AM
If they can be split into two transactions, read one byte then call HAL_I2C_Master_Receive_DMA with the data. Otherwise, you'll need to use the sequential receive functions. See instructions under "*** Interrupt mode or DMA mode IO sequential operation ***" in the HAL I2C source file.