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.

Custom Platform and ti.sdo.ipc.platforms.evmOMAPL138.arm Program.cpu.id not set

Other Parts Discussed in Thread: OMAPL138

Hi,

I'm using the OMAPL138 with SYS/BIOS.

When I tried to do work with the I2CSample project of PSPDRIVERS with altered memory sections according to ti.sdo.ipc.platforms.evmOMAPL138.arm I encountered the problem that the Program.cpu.id is not set for ti.sdo.ipc.platforms.evmOMAPL138.arm (this is also valid for any custom platform created via the RTSC Platform Wizard). Some drivers seem to use Program.cpu.id for registering events etc. The problem was discussed in http://e2e.ti.com/support/embedded/f/355/p/108846/388528.aspx#388528 where Raghavendra posted a file compare of Platform.xdc c(ti.platforms.evmOMAPL138 vs ti.sdo.ipc.platforms.evmOMAPL138.arm: http://e2e.ti.com/cfs-filesystemfile.ashx/__key/CommunityServer-Discussions-Components-Files/355/2605.Platform_5F00_Report.html) .

Besides the Program.cpu.id there are many other entries in the ti.platforms.evmOMAPL138 which do not appear for ti.sdo.ipc.platforms.evmOMAPL138.arm or custom platform files. How is one supposed to set these information which are needed for proper PSPDRIVERS (and probably other SYS/BIOS components) when the RTSC Platform Creation Wizard does not give any other configuration options than memory section definitions?

Thanks
Stefan

  • Stefan,
    I checked the original thread, and I think that code that keys off of Program.cpu.id expecting that ARM is always 1 and DSP is always 0 can be used only with specific platforms known in advance. There is no requirement for a platform that the id is always 1 for ARM. Platforms that have only one CPU usually set the id for that CPU to be 0, even if that one CPU is ARM.
    Either that code in I2C can be used only with 'ti.platforms.evmOMAPL138' or it should use some other way of figuring out if the CPU is ARM or DSP.
    For example, the Program.cpu.attrs.cpuCore is "C674" for the DSP and "v5T" for the ARM. Alternatively, the platform ti.platform.evmOMAPL138 uses Program.build.target.isa to check if it's "674" to determine the internal memory map.

    Now, back to your question, there are other entries that can't be set up either, and most of them are determined automatically by a platform created by the Platform Wizard. For some of them, id for example, it wouldn't hurt to allow setting that parameter explicitly, but currently there is no such functionality in the Platform Wizard.

    I am not sure how long would it take to change either I2C example or the Platform Wizard, but there is an option for you to go and manually change your copy of ti.sdo.ipc.platforms.evmOMAPL138.arm to get id to be 1. This is just a workaround for you to continue your project, and it's not really a long term solution.
    Open the file Platform.xs from ti.sdo.ipc.platforms.evmOMAPL138.arm and find the function getExeContext();
    Replace the line
    return this.$module.plat.getExeContext(prog);
    with
    var cpu = this.$module.plat.getExeContext(prog);
    cpu.id = "1";
    return (cpu);

    I haven't really tested the code above, so I might miss something. If you decide to try it, please let me know if you find some problems with it.

     

  • Hi Sasha,

    the proposed workaround did solve the problem.

    Regarding a solution of the problem in a general term: You say the driver should maybe only be for one platform.. I'm not sure if that's the right way to see it since it somehow is the "same platform"... same ram, same flash, same everything -- only the memory mapping is different in this case.

    I personally find it a bit distracting that the given ti.platforms.evmOMAPL138 has settings which one can not create equivalently with the RTSC Platform wizard. Simple changes like the program memory sections of the ARM/DSP require creating a custom platform which then is not compatible for given drivers.

    If though the wizard is only for demonstrating purposes and not to be used for real development then I'm missing the documentation how to handle manual platform creation (it might though be that i overlooked it when searching for).

    Thanks for your help,
    Stefan

  • Hi Stefan,

    An alternate and IMHO a simpler approach would be to specify the cpu id in the RTSC configuration script in the following manner.

    Program.cpu.id = "1";

    This way you do not have to modify the existing platforms.  I have filed an enhancement request for the platform wizard that allows the user to specify the cpu id.

    The platform wizard as it currently stands today is a solution for users to quickly specify their memory map for one device core and use it in their CCS projects. If you are working with multiple heterogeneous cores then we would advise you to create one platform per core.  As you have seen there is an alternate approach of  handcrafting platforms of which the evmOMAPL138 is one example. This maybe suitable for advanced users but in our experience the majority go the platform wizard route. We stand behind the platform wizard and are committed to improving it to address common usecases.

    I am also reviewing http://e2e.ti.com/support/embedded/f/355/p/108846/385441.aspx#385441 for the issues reported by you and I will respond in that post..

    Regards

    Amit