This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

缓存和内存不一致的问题

Other Parts Discussed in Thread: OMAP-L138

TI提供的OMAP-L138双核通信的库函数的实现方法是:

开辟一段ARM和DSP共用的内存,从而实现共享数据。

我在DSP端使用了32k的数据缓存后,发现当DSP像共享内存中写入数据的时候,只是缓存中发生变化,而实际的内存地址中的数据没有变化。

这个问题应该怎么解决呢?

我尝试在结构体前面加volatile也是不行的:

typedef volatile struct IPC_notifyEvent
{
UInt16 eventId; /* event number */
UInt32 payload; /* 32-bit value to pass to remote CPU */
UInt16 procId; /* space for "sent from" cpu id (future use) */
UInt16 lineId; /* interrupt line */
UInt16 semCnt; /* semaphore */
UInt16 key; /* system key */
} IPC_notifyEvent;

  • 你说的数据缓存是Cache吧。用了数据Cache后,需要做Cache与物理内存的一致性维护,如你的情况,则在更新数据后做一次Cache writeback操作即可。

    L138的starterware里的有Cache操作的API函数可供调用。