cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 dual core connectivity protocol handling

HDesa.1
Senior

Hello,

Could you please help me with handling a same channel I2C protocol between 2 core.

I have two devices connected on the same I2C channel(I2C1). I want to run one device on M7 core and another on M4 core. How to handle the communication between the devices and the microcontroller so that there is no interference during communication?

- Regards

Hrishikesh

-Regards
Hrishikesh
1 ACCEPTED SOLUTION

Accepted Solutions

As I said you need to handle that with semaphores. I'm not expert of i2c but you need to test. 

If you face a synchro issues, I think you can opt with my first scenario: one core handles the comm + one slave and the second core handles the second slave.

Hope I answered your question.

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.

View solution in original post

11 REPLIES 11
funky
Associate II

Hello,

Thank you for the reply. The link which you have shared provides the concept or direction for implementation.

Are there any resources, which provides the method to do so. May be a sample code or the module which should be used.

-Regards

-Regards
Hrishikesh
funky
Associate II

i don't have any resources regarding this topic

but to be honest i would question the concept. why would you handle the same bus from 2 controllers? what's the usecase for this? handle the i2c with one controller and exchange data between controllers if needed

SofLit
ST Employee

Hello,

Not clear what do you mean by this: " I want to run one device on M7 core and another on M4 core"

Do you have two I2C slave devices connected on I2C1 interface and you need to handle one slave data with CM7 and the other one with CM4?

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.

Hello,

Yes I have two I2C slave devices on I2C1 channel. I want two handle them on separate cores.

My question is how can it be done without causing interference between the devices during communication.

-Regards

-Regards
Hrishikesh

I think you can implement that by data exchanges between cores:

One core will handle the communication of the two slaves and manage the data of one slave. It will send/receive data of the second slave to the second core.

Refer to that article: https://community.st.com/t5/stm32-mcus/stm32h7-dual-core-how-to-communicate-between-cm4-cm7/ta-p/49656

and especially: AN5617 Application note: STM32H745/755 and STM32H747/757 lines inter-processor communications

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.

Hi,

Thank you for the suggestion. I will try the same.

But out of curiosity, isn't it possible for the two cores to work on same I2C channel without any interference. Maybe some flag or interrupt like arrangement which will indicate whether the channel is busy or not.

So in my application I wouldn't prefer to exchange the entire data set of a device from one core to another. For me it will be convenient if the two cores handle the two I2C devices separately and further process the data independently.

-Regards

-Regards
Hrishikesh

Hello,

It's possible to manage the same instance of I2C channel with two cores but you need to use semaphore mainly with HW semaphore to lock/unlock the ownership of the peripheral at a given time by a given core.

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.

Thank you for the suggestion.

I would like to know, should this be the efficient way to handling the device communication. Will there be any clashes or possibility of synchronization error?

-Regards

-Regards
Hrishikesh