I have a question regarding the SDK example:
ipc_spinlock_sharedmem_am263x-cc_r5fss0-0_freertos_ti-arm-clang
In this example the two cores are both accessing a uint32_t variable in shared memory.
The documentation says:
"Spinlocks are used to protect this shared memory access. This ensures that the access is atomic and the shared variable is incremented properly."
Questions:
1)
Since the applications is only to increment a uint32_t is spinlock actually needed? Shouldn't the gUserSharedMem++ operation be atomic?
2a)
Is it true that accessing shared memory without spinlock is not problematic unless the atomic access is required?
2b)
For example, If one core needs to share various uint32_t counters that are independent/orthogonal for another core to process, then no spinlock is needed. Correct?