cancel
Showing results for 
Search instead for 
Did you mean: 

HAL I2C Slave using DMA and interrupts. Has anyone found a good description of how to use the HAL DMA functions?

JTayl.4
Associate

I see there are sequencing functions, but have found no examples or documentation on how to use them. I need to be able to RX an address, then a pointer, and then either read or write data on a restart, multiple bytes, then a stop.

By sequencing functions, I am referring to: HAL_I2C_Slave_Seq_Receive_DMA() and HAL_I2C_Slave_Seq_Transmit_DMA().

Does anyone have any examples or flowchart for how to use the DMA functions to receive and transmit from a slave's perspective?

Thank you!

Jeff

1 ACCEPTED SOLUTION

Accepted Solutions
Amira
Associate III

Hello @JTayl.4​ 

You can find the description of these HAL APIs in the user manual. eg: https://www.st.com/resource/en/user_manual/dm00122016-description-of-stm32f3-hal-and-lowlayer-drivers-stmicroelectronics.pdf

You can also refer to the firmware example "I2C_TwoBoards_RestartComIT" under this path :

\STM32Cube\Repository\STM32Cube_FW_F3_V1.11.0\Projects\STM32F303K8-Nucleo\Examples\I2C\I2C_TwoBoards_RestartComIT. This example is using IT mode, but you can make some changes to use it with DMA mode (configuration of DMA)

Hope this would help you!

Regards,

Amira

View solution in original post

2 REPLIES 2
Amira
Associate III

Hello @JTayl.4​ 

You can find the description of these HAL APIs in the user manual. eg: https://www.st.com/resource/en/user_manual/dm00122016-description-of-stm32f3-hal-and-lowlayer-drivers-stmicroelectronics.pdf

You can also refer to the firmware example "I2C_TwoBoards_RestartComIT" under this path :

\STM32Cube\Repository\STM32Cube_FW_F3_V1.11.0\Projects\STM32F303K8-Nucleo\Examples\I2C\I2C_TwoBoards_RestartComIT. This example is using IT mode, but you can make some changes to use it with DMA mode (configuration of DMA)

Hope this would help you!

Regards,

Amira

JTayl.4
Associate

Hi Amira. Thank you. Somehow I missed that example when looking for examples in the STM32CubeIDE. I have my code up and running now. Should have asked sooner. %)