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: SDK memory map

Part Number: TDA4VM

Hi, experts

I am studying the problem of memory mapping.
On our customized board, we use 1GB DDR instead of 4GB on EVM board.
After some modifications to the Linux SDK, we can boot the custom board and run some applications.
But we also found some problems, such as:
1. Sometimes the development board fails to start
2. Unable to use RTOS bootloader
3. MCU  cannot allocate memory with malloc
I looked up some information and wanted to remap the memory through file “gen_linker_mem_map.py”.
I see the following code in the file:
ddr_mem_addr = 0xa0000000;
ddr_mem_size = 1*GB + 448*MB; # Last 64MB is used by Linux
My first question is, why does the starting address of DDR start from 0xa0000000? Who uses 512M memory between 0x80000000 and 0xa0000000?
My second question is, does Linux use 64M memory at the end of DDR (2GB space with low address here)?
Best regards,
Tao
  • Hi Tao,

    TDA4VM has a 4GB DDR, which is mapped from 0x80000000 to 0x180000000.
    Initially the HLOS (i.e. Linux or QNX) assumes that it has access to the entire DDR region, until we provide a reserved region for the other cores.
    Here in the SDK we have reserved the address 0xa00000000 to rest for the other cores, which means 0x80000000 to 0xa0000000 is currently being used by Linux.

    Yes, the 64M memory is being used by the Linux, hence this is specified on the python script.

    If changes are made in the memory mapping from 0xa0000000 until DDR_SHARED_MEM, appropriate changes should also be done for the IPC sections, else it could affect the functionality of the IPC.

    Regards,
    Nikhil

     

  • Hi, Nikhil

    Thank you very much for your reply!

    Recently, I made some changes according to your suggestions, and mapped the memory to within 1GB.

    Now, we can boot the customized board normally, MCU can also allocate memory with malloc.

    However, in this process, I encountered two problems:
    The first problem is, as you said, I found that the starting address of the IPC sections cannot be modified.  As long as this starting address is modified, the customized board will fail to boot or the IPC will fail.

    Can you tell me how to modify the IPC sections properly?

    The second problem is that since Linux occupies 512MB + 64MB of memory space, and we only have 1GB of memory in total, there is not enough memory left for other CPUs, especially shared memory.
    Can I compress the memory of Linux and set aside more memory for other CPUs?

    Best regards,
    Tao
  • Hi,

    Can you tell me how to modify the IPC sections properly

    If the IPC sections are changed, then additionally, you would have to make changes in the linux SDK side.
    i believe currently you are making changes in k3-j721e-rtos-memory-map.dtsi and generating the .dtb files?

    Additionaly, you would have to make changes in k3-j721e-som-p0.dtsi too.

    Also, you would have to update the r5_mpu.xs files for the R5 cores in vision_apps folder inorder to adjust the Cache properties.

    After these changes, your IPC should work.


    Can I compress the memory of Linux and set aside more memory for other CPUs

    Do you mean you have just 1GB of DDR?

    Regards,
    Nikhil

  • Hi, Nikhil

    Thank you very much for your reply!

    Do you mean you have just 1GB of DDR?

    Yes,we have just 1GB of DDR.

    Is it possible to reduce Linux memory to get more reserved memory?

    Best regards,
    Tao
  • Hi Tao,

    You could refer the below FAQ for the same
    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1097117/faq-tda4vm-reduce-the-dram-ddr-memory-of-linux-to-1gb?tisearch=e2e-sitesearch&keymatch=faq%3Atrue

    Note : you would have to change the vision_apps memory accordingly.

    Regards,
    Nikhil

  • Hi,Nikhil

    First of all, thank you for your reply!

    My question is how to compress the memory of Linux to get more reserved memory.
    For example, we have a total of 1GB DDR, but now 512MB is allocated to Linux, leaving only 512MB for other CPUs. What we want to do is to allocate 384MB to Linux and the remaining 640MB to other CPUs.

    Therefore, I want to know whether the above things are possible? Can I just expand the reserved memory size in the device tree?

    Best regards,
    Tao
  • Hi Tao,

    Typically Linux uses whatever region that is unassigned to the other CPUs. Hence you could first allocate the regions that are required for the other CPUs (i.e. 640MB) and the unused are shall be accessed by Linux.

    You could refer the patch I had provided in the FAQ in the previous thread for the files that would require changes.

    Also, as mentioned in the previous thread, any movement of address location in the RTOS side, you should also take care of all the related changes so that the IPC is not affected.

    Regards,
    Nikhil