I3C – Can’t get bidirectional Communication working
Hi guys,
I'm coming from Arduino and recently started working on a project where I need a protocol that supports bidirectional communication between MCUs and Hot-Join.
I decided to give I3C with the STM32H5 a shot and got myself some Nucleo-H503RB boards.
Based on the example projects from ST on GitHub:
https://github.com/STMicroelectronics/STM32CubeH5/tree/main/Projects/NUCLEO-H503RB
I got these things working:
- Target sends a Hot-Join
- Controller detects it and assigns a dynamic address
- IBI from the target is received on the controller
What doesn’t work
I can’t get regular data communication working.
For example, I want the controller to send a string on a button input like "ping" to the target, and the target should respond with "pong".
From my understanding, communication in I3C works something like this:
Target to Controller:
- Target sends IBI
- Controller receives IBI and starts listening using HAL_I3C_Ctrl_Receive_IT()
- Target sends data using HAL_I3C_Tgt_Transmit_IT()
- Controller receives data in HAL_I3C_CtrlRxCpltCallback()
Controller to Target:
- Target actively checks if the controller wants to send data using HAL_I3C_Tgt_Receive_IT()
- Controller sends data using HAL_I3C_Ctrl_Transmit_IT()
- Target receives data in HAL_I3C_TgtRxCpltCallback()
I just want to get a basic setup running where the target sends "ping" and the controller replies with "pong", and vice versa.
Any help or a minimal working example for STM32 HAL I3C communication would be really appreciated.
