Not applicable
Aug 19, 2015
09:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 19, 2015
09:07 AM
I'm working with one Aurix TC27x
In my little application two cores are working together (Core0 is a Producer, and Core1 is a Consumer). But I have some problems to share resources.
What is the typical mechanism to share a variable between them? How can synchronize the information? I have only used mutex and semaphores, but with only one core. So I do not know how to implement this other type of locking
Information about intercore comunications will be appreciated.
Thanks
Edgar Sevilla
In my little application two cores are working together (Core0 is a Producer, and Core1 is a Consumer). But I have some problems to share resources.
What is the typical mechanism to share a variable between them? How can synchronize the information? I have only used mutex and semaphores, but with only one core. So I do not know how to implement this other type of locking
Information about intercore comunications will be appreciated.
Thanks
Edgar Sevilla
2 Replies
Not applicable
Sep 07, 2015
07:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 07, 2015
07:23 AM
Look at synchronization methods from ifx library:
typedef unsigned int IfxCpu_mutexLock;
boolean IfxCpu_acquireMutex (IfxCpu_mutexLock * lock)
{
boolean retVal;
volatile uint32 spinLockVal;
retVal = FALSE;
spinLockVal = 1UL;
spinLockVal = (uint32) __cmpAndSwap (((unsigned int *) lock), spinLockVal, 0);
/* Check if the SpinLock WAS set before the attempt to acquire spinlock */
if (spinLockVal == 0)
{
retVal = TRUE;
}
return retVal;
}
void IfxCpu_releaseMutex (IfxCpu_mutexLock * lock)
{
/*Reset the SpinLock */
*lock = 0;
}
Not applicable
Jul 18, 2018
11:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 18, 2018
11:15 PM
Hi ,
Thank you for the detailed explanation. It helped a lot.
Best regards
Prakt
Thank you for the detailed explanation. It helped a lot.
Best regards
Prakt