Hello,
Let s say I have two cores and they share a variable within the shared memory we all agree that if they both access it at the same time I will generate conflict and my board is very likely to crash. Now what if I define this structure :
Will accessing buff->var1 on CORE1 and buff->var2 on CORE2 at the same time generate conflict? I mean the variable addresses are different but they are a part of the same structure.
volatile just instructs the compiler to not optimise read/write access to the variable and always fetch from/write to the original memory location for every access
so you still have a conflict if two cores can access (write) the same variable or if one can read whilst the other is modifying the bytes. You can use a mutex, semaphore etc for example to guard against simultaneous access.
accessing two different variables (think in terms of memory location) is not an issue
I already use Hardware Semaphore, from what I have read on mutex (and I read it quite fast so I might be wrong as hell) it does approximately the same thing by creating atomic locks and help avoid the issues linked to software semaphore (where a semaphore could be checked at the same time). Since I use HW semaphore I am not supposed to face this issue so I will keep my HW semaphore for now.
Thanks anyway for having me discover mutexes!