Hello,
what is the correct way to implement simple mutex to share date between Core 0 (FreeRTOS) and Core 1 (without FreeRTOS)? There is a simple example for ARM: http://infocenter.arm.com/help/index.js ... 03s02.html.
Mutex without FreeRTOS
Re: Mutex without FreeRTOS
You can build some form of mutual exclusion on top of the atomic compare-and-set instruction.
Here's the basic C wrapper for it: https://github.com/espressif/esp-idf/bl ... #L273-L290
Xtensa port of FreeRTOS has its spinlocks (portMUX_TYPE) built on top of it: https://github.com/espressif/esp-idf/bl ... ort.c#L302 (the link is to an older version, because the most recent one in master branch is a bit more complicated due to external RAM support).
Here's the basic C wrapper for it: https://github.com/espressif/esp-idf/bl ... #L273-L290
Xtensa port of FreeRTOS has its spinlocks (portMUX_TYPE) built on top of it: https://github.com/espressif/esp-idf/bl ... ort.c#L302 (the link is to an older version, because the most recent one in master branch is a bit more complicated due to external RAM support).
Re: Mutex without FreeRTOS
Is there any option for dual-core mutex? E. g. what happens when both cores access the same peripheral register / memory segment?
-
- Posts: 9764
- Joined: Thu Nov 26, 2015 4:08 am
Re: Mutex without FreeRTOS
That is what the spinlock is for. On unicore systems, just disabling the interrupts is enough, but on multicore you need spinlocks.
Who is online
Users browsing this forum: No registered users and 75 guests