cancel
Showing results for 
Search instead for 
Did you mean: 

I2C or I3C for broadcast communication - STM32H503RBT6

mpires
Associate II

Hello!

In my project, I have one "Mother board" and other four "Child boards".

Both boards are using STM32H503RBT6 microcontrollers.

There needs to be a communication between the Mother (master/controller) and the Child (slave/target). Child to Child won't be needed.

I thought about using I2C communication. However, I don't want to have anything different hardware-wise between the Child boards (such as a different pulldown resistor value or a jumper to set a different address for each one).

Also, I would like the Child to have all the same firmware (Mother is going to have a dedicated different firmware). Therefore, I can't set the Child address by flashing different firmwares.

Therefore, I thought about two approaches:

 

     1) If I use I2C, would it be alright to use the broadcast address to talk to all the Children at once and "gradually" assigning address to each one with some programming logic ?

 

     2) I've never used I3C before but I noticed there is something about Dynamic Address Assignment. I've read only a few documents, but it seems that to use this feature I still need to set a different Provisioned ID beforehand (therefore, making it a different firmware). However, I noticed something in the CubeIDE code generator, which shows something about a hardcoded ID (picture below). I don't know what it actually means, maybe it is a GUID that comes hardcoded for each chip or something, maybe not... The point is: can I use I3C to assign an address for each of the Child board, which all have the same hardware and firmware ?

     mpires_0-1714659763974.png

 

     3) Any other suggestion on how to achieve this ?

 

Thanks a lot!

 

6 REPLIES 6
cpitman
Associate

A straightforward way of doing this would be to provide a signal from the motherboard to each child board that communicates a unique address for each one. For example, you could set aside two signals to provide a 2-bit address that the child board reads on startup. Or you could use a single trace with an analog signal, assuming you have a spare ADC channel for the child. On the motherboard, the values sent to each child are hardwired.

 

In other words, the child boards should be treated like any other I2C component with a settable address.

Foued_KH
ST Employee

Hello @mpires , 

For I3C , yes you can assign a dynamic address for each I3C target ( STM32H503 in your case ) .
Just you need to check the available examples in the STM32H5 cube FW : 
I3C Controller ( Mother board as you say ) : STM32Cube_FW_H5_V1.2.0\Projects\NUCLEO-H503RB\Examples\I3C\I3C_Controller_ENTDAA_IT
I3C Target : STM32Cube_FW_H5_V1.2.0\Projects\NUCLEO-H503RB\Examples\I3C\I3C_Target_ENTDAA_IT 

 

On the target side, you just need to modify this field :0x1 ( target 1 ) , 0x2 ( target 2 ) , 0x3 ( target 3 ) and 0x4 (target 4)

Foued_KH_0-1714664153854.png

Also for the controller you need to add other files for target 3 and target 4.

Foued_KH_1-1714664297698.png

 

For more information , check the I3C AN :st.com/resource/en/application_note/an5879-introduction-to-i3c-for-stm32h5-series-mcu-stmicroelectronics.pdf

and the I3C Wiki : Getting started with I3C - stm32mcu

Let me know , if this helps you!
Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

AScha.3
Chief

Hi,

how far away are your "members" ?

If more than a few centimeters , you might get a lot of problems (EMI, spikes -> error ).

So i would recommend : CAN bus.

- your H503 has CAN (just need a cheap transceiver to add)

- its not sensible to EMI (is standard in cars...you know.)

- it has built in priority management on bus collision (so not difficult, to enumerate the "childs" )

 

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

Yeah, I thought about that. This means two more wires if I go with the 2-bit solution. This will be my plan-B if nothing else works. Thanks for the suggestion!

 

Thanks for the fast reply!

Would this mean I would have to have 4 different firmwares too, since I am generating a new code for each one (MIPI Identifier) ?

You need to have a firmware for each I3C target and each target need to have a MIPI identifier. 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.