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.

TDA4VM: Get access to shared memory from Linux

Part Number: TDA4VM


Hi TI,

I am trying to establish an IPC communication from MCU2_0 -> MPU1_0 using shared memory due to the limitation of 512 Byte for IPC messages. Therefore, I am sending a dummy struct containing data larger than 512 Byte. To do so, I am allocating memory using the following functions on MCU2_0:

#define APP_MEM_HEAP_DDR        (0u)
void *ptr;
uint32_t size = 1024*1024; // size in bytes
uint64_t phys_ptr;

ptr = appMemAlloc(APP_MEM_HEAP_DDR, size, 1);
phys_ptr = appMemGetVirt2PhyBufPtr((uint64_t)(uintptr_t)ptr, APP_MEM_HEAP_DDR);
value = (uint32_t)phys_ptr;
*(volatile dataObj*)ptr = data;

appMemCacheInv((void*)ptr, size*8);
*(volatile dataObj*)ptr = data;
appMemCacheWbInv((void*)ptr, size*8);

This allocates memory at physical address 0xE1000100, which corresponds to DDR_MCU2_0_LOCAL_HEAP_ADDR from app_mem.h in vision_apps.

Looking up this address using Memory Browser, I could verify, that the previous mentioned dummy struct is actually there.

My question refers now to Linux. In Linux I was not able to read from this address (neither using memory browser, nor devmem2 nor in the linux user space application itself). The device tree overlay, which is used in Linux is the default device tree k3-j721e-vision-apps.dts, which includes k3-j721e-rtos-memory-map.dtsi. Here no memory region for 0xE1000100 is mentioned. So is this maybe the reason why I can not read from this address?

Which steps do I have to add in Linux to read from this address?

Thanks for your help and best regards,

Felix

  • Hi Felix,

    Not sure if you checked this device tree node:

            };
            vision_apps_core_heaps_lo: vision-apps-core-heap-memory-lo@d8000000 {
                    compatible = "shared-dma-pool";
                    reg = <0x00 0xd8000000 0x00 0x24000000>;
                    no-map;
            };

    0xd8000000 + 0x24000000 = 0xFC000000

    The entire region from 0xD8000000 - 0xFC000000 is marked shared-dma-pool.

    I am able to access the address you are quoting above:

    devmem2 0xE1000100 w
    /dev/mem opened.
    Memory mapped at address 0xffff950e0000.
    Read at address  0xE10000 (0xffff950e0100): 0x00000001

    What is the error you are facing at your end while reading this address? Can you share more logs?

    - Keerthy

  • Hi Keerthy,

    I was using mixed up versions of Kernel Images and Device Tree binaries. Using the default binaries (Kernel Image + Device Tree) from PSDKL v08.00 solved the issue and I can now read from the mentioned address using devmem2. Thanks for pointing out that in default case, this address is readable from Linux side.

    Best regards,

    Felix