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.

RE: Compiler/AM5728: IPC Memory setup

We may not, but here is an example:

The debug issue we determined to be that when debugging two DSPs the SYS/BIOS generated linker.cmd files both use EXT_RAM for all the sections... so .text etc... all are in the SAME EXT_RAM.

first question:
1. How through sys/BIOS can I tell it to for example put code (.text) into say L2 ram? or other sections? I can do this for a custom created section of my own, but what about the default sections like .text .bss etc...
2. When calling IPC_Start() it is failing, because for now I manually put all the sections in L2 ram for one DSP, so there is no 'shared' ram for the IPC.... Since I didn't write IPC module... and since the SYS/BIOS isn't createing two separate sections for say .text of DSP1 and .text of DSP2, I assume the reason the shared section in IPC_START is failing because I moved everything to L2 memory on one DSP so it doesn't conflict with DSP... but since I don't know how the IPC/Shared memory is designed in SYS/BIOS... how 'should' I allocate memory so when it asks for the shared memory section the IPC_Start doesn't fail? which section needs to be shared.... and how can we ensure that each DSP has it's private space, and its shared space appropriately?

The idea of a 2nd *.cmd file is simple to allow me to program the CMD file without having to feed any customizations into the SYS/BIOS interface so that it autogenerates it... in that way a person could put there customizations in a separate linker command file, and keep it separate from the SYS/BIOS.

Thanks.
  • to add a little more to the above? I realize that you can't know everyones needs, but shouldn't a 'default' app generation create two separate SYS/BIOS configurations that is capable of working on each DSP?

    Given that the default just dumped it in the same memory space, I guess what I need is information on what SYS/BIOS requires... cause by doing the quick fix of moving it to L2 memory on one DSP solves the conflict, but creates a conflict trying to use the IPC_Start function since it requires shared memory... since I don't know how it works, what documentation tells me how to configure the memory for multi dsp case? ie: I can see the conflict, but how am I supposed to correct it in a way that won't crash the other modules that require shared memory?

    Thanks.
  • Hi Rob,

    When using IPC, you can modify the memory map using a config.bld file as shown in the snippet below. You will need to change your platform to ti.platforms.evmDRA7XX:dsp1 to support this.

    var SR_0 = {
        name: "SR_0", space: "data", access: "RW",
        base: 0x8E000000, len: 0x1000000,
        comment: "SR#0 Memory (16 MB)"
    };
    
    Build.platformTable["ti.platforms.evmDRA7XX:dsp1"] = {
        externalMemoryMap: [
            [ "DSP1_PROG", {
                name: "DSP1_PROG", space: "code/data", access: "RWX",
                base: 0x8C000000, len: 0x1000000,
                comment: "DSP1 Program Memory (16 MB)"
            }],
            [ "SR_0", SR_0 ]
        ],
        codeMemory:  "DSP1_PROG",
        dataMemory:  "DSP1_PROG",
        stackMemory: "DSP1_PROG",
        l1DMode: "32k",
        l1PMode: "32k",
        l2Mode: "128k"
    };
    
    Build.platformTable["ti.platforms.evmDRA7XX:dsp2"] = {
        externalMemoryMap: [
            [ "DSP2_PROG", {
                name: "DSP2_PROG", space: "code/data", access: "RWX",
                base: 0x8D000000, len: 0x1000000,
                comment: "DSP2 Program Memory (16 MB)"
            }],
            [ "SR_0", SR_0 ]
        ],
        codeMemory:  "DSP2_PROG",
        dataMemory:  "DSP2_PROG",
        stackMemory: "DSP2_PROG",
        l1DMode: "32k",
        l1PMode: "32k",
        l2Mode: "128k"
    };

    SharedRegion 0 (SR_0) is required by for IPC_Start. I recommend using our messageQ example as a reference, it can be found at ipc\examples\DRA7XX_bios_elf\ex02_messageq. Our IPC examples are makefile based, but I can walk you through porting them to CCS if needed. 

    Let us know if you are using or planning on using IPC between the ARM running Linux and DSPs running RTOS (SYS/BIOS), as this will require some additional steps. 

  • Thanks very much.

    1.  I assume I will need to make a ti.platforms.evmDRA7XX:dsp2 as well?  I assume I would allocate the same 0x8e000000 base address for the SR_0 and allocate a the DSP2_PROG space to say 0x8d000000 ?

    2.  How did you know (documentation wise) that IPC requires this shared region?  I mean I looked in the code and saw a call to sharedregion implying a shared region was needed, but if I use another module, how would I know to create an appropriate section or is this the ONLY module that requires its own shared section?, how would I know to call it SR_0?  since this is needed memory and is attached to your IPC code.

    I couldn't see anything in the example that brings out what you showed here creating the shared section.

    I'm looking at your sys/bios or spruex3t.pdf and found only one mention of a .bld file.  I also googled it and get a link to: 

    how do I specify to use this particular config.bld file in code composer?

    Is their any logic behind your base address selection relative to SYS/BIOS, ie: is there anything specific tied to your selection of 0x8c000000 for example for DSP1?

    Yes I will need to use IPC between ARM and DSP with ARM running Linux and DSP running SYS/BIOS.

    Thanks.

  • This thread was split from this thread e2e.ti.com/.../666472 since we are now diving into IPC topics.

    1. Yes, that's correct. The same config.bld should be used for all cores so you don't need another for DSP2 (notice it's located within the shared folder of the example). Simply add it to your project folder or specify it under Build Settings -> XDCtools -> Advanced Options -> Build configuration file
    2. This can be found in the IPC User's Guide or in cdoc, processors.wiki.ti.com/.../SharedRegion_Module
    downloads.ti.com/.../_ipc_8h.html
    There is a lot of information to digest in these documents so it can be easy to miss this.

    There is nothing specific tied to the selection of 0x8c000000 other than it corresponding to a section in DDR.

    I should have worded the last sentence of my previous reply differently, if you are using IPC between ARM Linux and DSP RTOS then that actually changes things a bit since the ARM will be in charge of resource management. Remoteproc will handle memory allocation using the dts file on Linux. On the DSP side, resource table is used to inform remoteproc about the DSP's resources. This training video touches on this, training.ti.com/intro-to-ipc-for-keystone-and-sitara

    I recommend looking at our DRA7XX_linux_elf/ex02_messageq example to help you get started. This wiki page is also a very good resource, processors.wiki.ti.com/.../Linux_IPC_on_AM57xx

    Please let us know if you have any questions or need further clarifications.

  • Also, I should mention SharedRegion is no longer used in this case. For ARM Linux to DSP RTOS, CMA or CMEM should be used. This app note explains the details of this pretty well, www.ti.com/.../sprac60.pdf