This example demonstrates the PRU and ARM sharing memory access via a semaphore.
See the PRU Software examples project in the SDK under example-applications. The source code for both the ARM and the PRU can be found there.