Part Number: AM5728
Other Parts Discussed in Thread: AM5729
Hi all,
I'm trying to test IPC using shared memory transport to exchange messages between A15 and DSP. I want to allocate message once on each core and then reuse it indefinitely.
Platform:
- AM5729 on BeagleBorad-X15
- pdk_am57xx_1_0_15
- processor_sdk_rtos_am57xx_6_00_00_07
- bios_6_75_02_00
Cache is enabled on A15, disabled on DSP.
- A15 and DSP: Create and open queues, one on A15 side, one on DSP side using MessageQ_create() and MessageQ_open().
- DSP: Allocate message1 (MessageQ_alloc()) and send it over through A15 queue (MessageQ_put()).
- A15: Receive message1 (MessageQ_get()), allocate message2 and send it to DSP (MessageQ_put()).
- DSP: Receive message2 and resend message1 to A15.
- A15 Assert A_regionInvalid: region is invalid (A15's stack address is supplied to SharedRegion_getPtr())
I've tried to narrow down the issue. When A15 receives message1 for the first time, I see that IPC uses SWi to dequeue the message from some "shared" queue located in shared region and enqueues message1 to "internal" queue located on A15's stack. So the message head is updated, BUT no Cache_inv() is called and the updated head is in the cache only. This fires back when the message1 is received on A15 for second time, SWi does Cache_inv() and old value from the cache overwrites the new value updated by DSP. Then it tries to translate shared region address to A15's address and assertion is raised.
When I change the approach that A15 doesn't allocate message2, but uses message1 to reply to DSP, everything is OK.
So my question is if this is expected behavior or there's missing Cache_inv() when message is enqueued into A15's queue? I thought that once message is dequeued, no-one owns it and can be re-used by any core.
Thanks!