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.

NDK and OpenMP with image_processing demos cfg and platform

Hi all!

I'm trying to combine NDK and OpenMP and I have a problem.
For this I'm using demos.image_processing.openmp.evmc6678l.platform and image_processing_openmp_evmc6678l.cfg file but as a result I'm getting this error:

Segment: 0xa0200000 overlaps with: SL2_RAM

Maybe somebody knows how to fix this error?

CCS          6.0.1

SYS/Bios  6.33.6.50

XDCtools 3.23.4.60

MCSDK    2.01.02.06

NDK          2.24.0.11

board EVM6678LE

Best Regards,

Ekaterina.

  • I am not expert on this however please review the selected platform and configuration (.cfg) file for memory overlap.
    Thank you.
  • Hi Rajasekaran!

    Thank you for reply!

    I reviewed platform and .cfg file, but didn't see something wariosly (I'am new in DSP programming).

    The platform is:

     

    The .cfg file is:

    var Memory    = xdc.useModule('xdc.runtime.Memory');
    var Log       = xdc.useModule('xdc.runtime.Log');
    var Error     = xdc.useModule('xdc.runtime.Error');
    var Diags     = xdc.useModule('xdc.runtime.Diags');
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var Startup   = xdc.useModule('xdc.runtime.Startup');
    var System    = xdc.useModule('xdc.runtime.System');
    //var SysStd    = xdc.useModule('xdc.runtime.SysStd');
    var Main      = xdc.useModule("xdc.runtime.Main");
    
    //System.SupportProxy = SysStd;
    
    var SysMin = xdc.useModule("xdc.runtime.SysMin");
    System.SupportProxy = SysMin;
    SysMin.bufSize = 0x8000;
    
    
    /* Load and configure SYSBIOS packages */
    var BIOS      = xdc.useModule('ti.sysbios.BIOS');
    var Task      = xdc.useModule('ti.sysbios.knl.Task');
    var Clock     = xdc.useModule('ti.sysbios.knl.Clock');
    var Mailbox   = xdc.useModule('ti.sysbios.knl.Mailbox'); 
    var Hwi       = xdc.useModule('ti.sysbios.hal.Hwi');
    var Ecm       = xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
    var BiosCache = xdc.useModule('ti.sysbios.hal.Cache');
    var HeapBuf   = xdc.useModule('ti.sysbios.heaps.HeapBuf');
    var HeapMem   = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var Exc       = xdc.useModule('ti.sysbios.family.c64p.Exception');
    var Cache     = xdc.useModule('ti.sysbios.family.c66.Cache');
    
    BIOS.taskEnabled = true;
    Task.common$.namedInstance = true;
    
    /*
     * Enable Event Groups here and registering of ISR for specific GEM INTC is done
     * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
     */
    
    Ecm.eventGroupHwiNum[0] = 7;
    Ecm.eventGroupHwiNum[1] = 8;
    Ecm.eventGroupHwiNum[2] = 9;
    Ecm.eventGroupHwiNum[3] = 10;
    
    /* Create a Heap. */
    var heapMemParams = new HeapMem.Params();
    heapMemParams.size = 0x8000000;
    heapMemParams.sectionName = "ddr_heap";
    Program.global.ddr_heap = HeapMem.create(heapMemParams);
    
    /* Load and configure NDK */
    var Global = xdc.useModule('ti.ndk.config.Global');
    
    /* 
    ** This allows the heart beat (poll function) to be created but does not generate the stack threads 
    **
    ** Look in the cdoc (help files) to see what CfgAddEntry items can be configured. We tell it NOT
    ** to create any stack threads (services) as we configure those ourselves in our Main Task
    ** thread.
    */  
    Global.enableCodeGeneration = false;
    
    /* Load the PDK packages */
    var Csl  = xdc.useModule('ti.csl.Settings');
    var Pa   = xdc.useModule('ti.drv.pa.Settings');
    var Cppi = xdc.loadPackage('ti.drv.cppi');     
    var Qmss = xdc.loadPackage('ti.drv.qmss');
    
    /* Load the Platform/NDK Transport packages */
    var PlatformLib  = xdc.loadPackage('ti.platform.evmc6678l');
    var NdkTransport = xdc.loadPackage('ti.transport.ndk');
    
    /* Use more efficient Notify driver */
    var Notify        = xdc.module('ti.sdo.ipc.Notify');
    Notify.SetupProxy = xdc.module('ti.sdo.ipc.family.c647x.NotifyCircSetup');
    
    /* Use more efficient MessageQ transport */
    var MessageQ = xdc.module('ti.sdo.ipc.MessageQ');
    MessageQ.SetupTransportProxy = 
            xdc.useModule('ti.sdo.ipc.transports.TransportShmNotifySetup');
    
    Startup.firstFxns.$add('&lld_init');
    
    
    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    
     
    
    /* Load OpenMP module */
    var OpenMP = xdc.useModule('ti.omp.utils.OpenMP');
    OpenMP.stackSize = 0x4000;
    OpenMP.setNumProcessors(8);
    OpenMP.qmssInit = false;
    OpenMP.ipcHeapSize = 0x30000;
    OpenMP.qmssMemRegion = -1;
    OpenMP.qmssStartIndex = 0;
    OpenMP.qmssDestQueueNum = -1;
    OpenMP.stackRegionId = -1;
    OpenMP.internalOsal = true;
    OpenMP.cppiHwSem = 3;
    OpenMP.qmssHwSem = 4;
    OpenMP.mpaxIndex = 3;
    OpenMP.enableMemoryConsistency = false;
    
    // Configure HeapOMP
    
    // HeapOMP created in ti/omp/common.cfg.xs
    
    var HeapOMP = xdc.useModule('ti.omp.utils.HeapOMP');
    HeapOMP.sharedRegionId = 2;
    HeapOMP.localHeapSize  = 0x20000;
    HeapOMP.sharedHeapSize = 0x1000000;
    
    // Specify the Shared Region
    
    SharedRegion.setEntryMeta( HeapOMP.sharedRegionId,
                               {   base: 0x90000000,
                                   len:  HeapOMP.sharedHeapSize,
                                   ownerProcId: 0,
                                   cacheLineSize: 0,
                                   cacheEnable: false,
                                   createHeap: true,
                                   isValid: true,
                                   name: "sr2-ddr3",
                               }
    );
    
    //
    
    // Setup HeapOMP
    
    //
    
    // Initialize HeapMem parameters
    var HeapOMP      = xdc.useModule('ti.omp.utils.HeapOMP');
    var HeapMem      = xdc.useModule('ti.sysbios.heaps.HeapMem');
    var heapMemParams = new HeapMem.Params();
    heapMemParams.size = HeapOMP.localHeapSize;
    
    // Create a HeapOMP instance
    var heapOmpParams = new HeapOMP.Params();
    heapOmpParams.localHeap = HeapMem.create(heapMemParams)
    heapOmpParams.sRegionId = HeapOMP.sharedRegionId;
    
    // Setup defaultHeapInstance to a HeapOMP instance
    
    var Memory       = xdc.useModule('xdc.runtime.Memory');
    if (Memory.defaultHeapInstance)
        Program.$logWarning("Memory.defaultHeapInstance already set!", this);
    
    Memory.defaultHeapInstance = HeapOMP.create(heapOmpParams)
    
    Task.defaultStackSize = 0x4000;
    //BIOS.heapSize = 0x50000;
    
    Program.sectMap[".cio"]              = {loadSegment: "L2SRAM", loadAlign:8};
    Program.sectMap[".args"]             = {loadSegment: "L2SRAM", loadAlign:8};
    Program.sectMap[".cppi"]             = {loadSegment: "MSMCSRAM", loadAlign:16};
    Program.sectMap[".qmss"]             = {loadSegment: "MSMCSRAM", loadAlign:16};
    Program.sectMap[".nimu_eth_ll2"]     = {loadSegment: "MSMCSRAM", loadAlign:16};
    Program.sectMap[".far:NDK_PACKETMEM"]= {loadSegment: "MSMCSRAM", loadAlign: 128};
    Program.sectMap[".far:NDK_OBJMEM"]   = {loadSegment: "L2SRAM", loadAlign: 16};
    Program.sectMap[".far:WEBDATA"]      = {loadSegment: "DDR3", loadAlign: 8};
    Program.sectMap[".resmgr_memregion"] = {loadSegment: "MSMCSRAM", loadAlign:128};
    Program.sectMap[".resmgr_handles"]   = {loadSegment: "MSMCSRAM", loadAlign:16};
    Program.sectMap[".resmgr_pa"]        = {loadSegment: "MSMCSRAM", loadAlign:8};
    
    Program.sectMap["ddr_heap"]          = "DDR3";
    Program.sectMap[".plt"]              = "MSMCSRAM";
    Program.sectMap["platform_lib"]      = "MSMCSRAM";
    Program.sectMap[".text"]             = "MSMCSRAM";
    Program.sectMap[".far:NDK_MMBUFFER1"]= "MSMCSRAM";
    
    Program.sectMap["ddr"] = new Program.SectionSpec();
    Program.sectMap["ddr"].loadSegment = "DDR3_NOCACHE";
    Program.sectMap[".threadprivate"] = new Program.SectionSpec();
    Program.sectMap[".threadprivate"].loadSegment = "L2SRAM";
    
    var Cache        = xdc.useModule('ti.sysbios.family.c66.Cache');
    //Cache.setMarMeta(0x80000000, 0x20000000, Cache.PC );
    //Cache.setMarMeta(0x80000000, 0x20000000, Cache.PC|Cache.PFX );
    
    // Do not cache DDR - Shared region 2 in OpenMP.xs is marked as non-cacheable
    // These 2 settings need to be in sync!
    Cache.setMarMeta(0x90000000, 0x10000000, 0);
    
    /* Add init function */
    Startup.lastFxns.$add('&EVM_init');
    
    /*BIOS.libType = BIOS.LibType_Debug;*/
    

    I tryed to do this with new SYS/BIOS, XDCtools and IPC, but result the same:

    **** Build of configuration Debug for project helloworld_evmc6678l ****
    
    "c:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
    'Building file: ../test_eth_ndk.cfg'
    'Invoking: XDCtools'
    "C:/ti/xdctools_3_30_05_60_core/xs" --xdcpath="C:/ti/ctoolslib_1_0_0_2/packages/ti;D:/Ermolenko/Project_work/CCS/myPlatform_lib;C:/ti/mcsdk_2_01_02_06;C:/ti/dsplib_c66x_3_2_0_1/packages;C:/ti/edma3_lld_02_11_05_02/packages;C:/ti/imglib_c66x_3_1_1_0/packages;C:/ti/ipc_1_25_03_15/packages;C:/ti/mathlib_c66x_3_1_0_0/packages;C:/ti/mcsdk_2_01_02_06/demos;C:/ti/pdk_C6678_1_1_2_6/packages;C:/ti/ndk_2_24_01_18/packages;C:/ti/nsp_1_10_02_09/packages;C:/ti/openem_1_0_0_2/packages;C:/ti/omp_1_02_00_05/packages;C:/ti/bios_6_41_00_26/packages;C:/ti/tirtos_c6000_2_00_01_23/packages;C:/ti/tirtos_c6000_2_00_01_23/products/bios_6_40_01_15/packages;C:/ti/tirtos_c6000_2_00_01_23/products/ipc_3_10_01_11/packages;C:/ti/tirtos_c6000_2_00_01_23/products/ndk_2_23_01_01/packages;C:/ti/tirtos_c6000_2_00_01_23/products/uia_2_00_00_28/packages;c:/ti/ccsv6/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p demos.image_processing.openmp.evmc6678l.platform -r release -c "c:/ti/ccsv6/tools/compiler/c6000_7.4.8" "../test_eth_ndk.cfg"
    making package.mak (because of package.bld) ...
    generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    configuring test_eth_ndk.xe66 from package/cfg/test_eth_ndk_pe66.cfg ...
    error: ti.sdo.ipc.SharedRegion: "C:/ti/ipc_1_25_03_15/packages/ti/sdo/ipc/SharedRegion.xs", line 367: ti.sdo.ipc.SharedRegion : Segment: 0xa0200000 overlaps with: SL2_RAM
    js: "C:/ti/xdctools_3_30_05_60_core/packages/xdc/cfg/Main.xs", line 160: Error: Configuration failed!
    gmake.exe: *** [package/cfg/test_eth_ndk_pe66.xdl] Error 1
    js: "C:/ti/xdctools_3_30_05_60_core/packages/xdc/tools/Cmdr.xs", line 51: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
    gmake: *** [configPkg/linker.cmd] Error 1
    gmake: Target `all' not remade because of errors.
    
    **** Build Finished ****
  • Kacharava Ekaterina,
    Please refer this wiki page for how to create OpenMP based application project,
    http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide#Programming_Model_using_OpenMP
    And also refer the user guide to find detailed info at: C:\ti\omp_1_01_03_02\docs