Skip to main content
Visitor II
July 13, 2021
Solved

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

  • July 13, 2021
  • 2 replies
  • 3811 views

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

    This topic has been closed for replies.
    Best answer by Amira

    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

    2 replies

    AmiraAnswer
    Visitor II
    July 14, 2021

    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.4Author
    Visitor II
    July 15, 2021

    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. %)