Part Number: TDA4AEN-Q1
Shared data in DDR can be accessed by multi-cores. Some data, like the point cloud, is large, so we store it in DDR rather than transmit it via IPC RPMessage. Both main R5F and C7x will access the data, and we need protection against simultaneous write/read.
e.g.
C7x: Spinlock_lock() -> write point cloud to DDR via UDMA -> Spinlock_unlock()
main R5F: Spinlock_lock() -> read point cloud from DDR via UDMA -> Spinlock_unlock()
Based on spinlock descriptions in SDK, it can be used for synchronization between multi-cores, but the guideline also states the time to hold the lock should be predictable and small. In our case, the lock(DDR access) time may not be so small.
https://software-dl.ti.com/jacinto7/esd/processor-sdk-rtos-j722s/11_02_01_03/exports/docs/mcu_plus_sdk_j722s_11_02_01_05/docs/api_guide_j722s/DRIVERS_SPINLOCK_PAGE.html
Is it suitable to use spinlock to protect DDR access? If not, any other suggestion?