I have a question about using semaphores in cortex m3. I've found a thread "ARM cortex: mutex using bit banding" ARM cortex: mutex using bit banding . There is a short description of the problem, and the last answer would be good for my problem - but I am not sure how can I implement it in c/c++.
"I've never used bit-banding on the ARM; my inclination instead would be to use load-exclusive/store-conditional for all such operations. Use a loop to load-exclusive the old value, compute the new value, and use a conditional store to write it back. Loop until the conditional store succeeds (which it probably will the second time, if it doesn't the first)."
I would be very grateful if someone could post a short code how to use it.
Thanks, Martin