Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Software Design Question

Status
Not open for further replies.

electroRF

Member
Hi guys,

I always love to hear your suggestions on Designs that I need to prepare and then implement.

And therefore, Thank you in advance :)

The situation is as follows.

Core A has a SendMessage Function, which transfers a Message to Core B (the SendMessage Function simply calls a Core-2-Core Driver).

C:
void SendMessage( int MessageID, int* MessageData, int MessageLength)

Many Tasks in Core A calls this SendMessage Function, with different IDs / Data / Length.

Core B has its own Task for each ID.


The Challenge is as follows.

Gradually, Developers will take a Task from Core B and write it in Core A.

Now the thing is, that if until now, CoreA_Task used the SendMessage Function to transfer a message to CoreB_Task, then it would now need to simply send a Message directly via RTOS to CoreB_Task, since they are in the same Core.

My challenge it to provide a solution so that when CoreA_Task Sends a Message to CoreB_Task, my Mechanism will know whether CoreB_Task was already moved to Core A, or still remained in Core B, and accordingly, will send the Message to Core B, either by RTOS Service (if CoreB_Task is now in Core A ) or by the Core-2-Core Driver (if CoreB_Task still resides in Core B).

How would you design this?

I believe that modifying SendMessage Function is the best solution, instead of changing the code in each Task of Core A. (I'd love to hear your suggestion for how to modify it, if you also believe that's the proper way to design the Mechanism).

I'd love to hear your ideas!

Thank you :)
 
Last edited:
From what I understand of your explanation, you will need to keep a record of some sort of which task resides in which core. This could be done as simply as maintaining a couple of registers and using them as flags, or if you have room in your task id, set a bit there, if the bit is high it has been moved to CoreA, if not then it is still in CoreB kind of thing. Then you could modify your send message function to look at those registers before addressing the task etc :)
 
Hi dear friends,

I thank you very much :)

I'll indeed Set / Clear a Certain Bit in the MessageID,
So that by that bit, the SendMessage Function will tell whether the Designated Module / Task was moved (from Core B) to Core A, or remained in Core B.

I have a Design Question on the next Step after determining that the Designated Module / Task was moved (from Core B) to Core A:

How to Transfer the Message to the Designated Module / Task ?

I need to think of some Generic and Convenient Way to Modify the SendMessage Function to now call each different Designated Module / Task.

Do you have an Idea for such way?

Thank you :)
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top