cancel
Showing results for 
Search instead for 
Did you mean: 

Use HAL_I2C_Master_Receive_DMA when the receive size is contained in the first received byte?

arnold_w
Senior

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?

1 REPLY 1
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".