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.

Compiler/OMAP-L138: Compilation failure - undefined symbol -> EmacInit

Part Number: OMAP-L138
Other Parts Discussed in Thread: OMAPL138,

Tool/software: TI C/C++ Compiler

I would like portable example project (NIMU_FtpExample_idkAM572x_armExampleproject) to my platform (OMAPL138). When I use EmacInit function in my project I encounter a problem.

I tried include various libraries but I did not solve this problem.

>> Compilation failure
makefile:142: recipe for target 'NIMU_emacExampleClient_lcdkOMAPL138ARMBiosExampleProject.out' failed
 
 undefined first referenced     
  symbol       in file          
 --------- ----------------     
 EmacInit  ./client_omapl13x.obj
 
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "NIMU_emacExampleClient_lcdkOMAPL138ARMBiosExampleProject.out" not built
gmake[1]: *** [NIMU_emacExampleClient_lcdkOMAPL138ARMBiosExampleProject.out] Error 1
gmake: *** [all] Error 2
makefile:138: recipe for target 'all' failed

**** Build Finished ****

My *.cfg file:

/*
 * client.cfg
 *
 * Memory Map and Program intiializations for the client example Utility
 *
 * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/ 
 *  
 *  Redistribution and use in source and binary forms, with or without 
 *  modification, are permitted provided that the following conditions 
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the 
 *    documentation and/or other materials provided with the   
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
 
var Defaults = xdc.useModule('xdc.runtime.Defaults');
var Diags = xdc.useModule('xdc.runtime.Diags');
var Error = xdc.useModule('xdc.runtime.Error');
var Log = xdc.useModule('xdc.runtime.Log');
var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');
var Main = xdc.useModule('xdc.runtime.Main');
var Memory = xdc.useModule('xdc.runtime.Memory')
var SysMin = xdc.useModule('xdc.runtime.SysMin');
var System = xdc.useModule('xdc.runtime.System');
var Text = xdc.useModule('xdc.runtime.Text');

var BIOS = xdc.useModule('ti.sysbios.BIOS');
var Clock = xdc.useModule('ti.sysbios.knl.Clock');
var Swi = xdc.useModule('ti.sysbios.knl.Swi');
var Task = xdc.useModule('ti.sysbios.knl.Task');
var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
var Hwi 		= xdc.useModule('ti.sysbios.hal.Hwi');

var devType = "omapl138"

var socType = "omapl138";

/*use CSL package*/
var Csl = xdc.loadPackage('ti.csl');
Csl.Settings.deviceType = socType;

/* Load the OSAL package */
var osType = "tirtos"
var Osal = xdc.useModule('ti.osal.Settings');
Osal.osType = osType;
Osal.socType = devType;

/* Load the EMAC package */
var Emac = xdc.loadPackage('ti.drv.emac');
Emac.Settings.socType = devType;
Emac.Settings.enableProfiling = false;

/* Load the UART package */
var UART = xdc.loadPackage('ti.drv.uart');    
UART.Settings.socType = devType;  

/* Load the I2C package */
var I2c 			= xdc.loadPackage('ti.drv.i2c');
I2c.Settings.socType = devType;

/* Load the Board package and set the board name */
var Board = xdc.loadPackage('ti.board');
Board.Settings.boardName = "lcdkOMAPL138";

var Nimu 		= xdc.loadPackage('ti.transport.ndk.nimu');
Nimu.Settings.socType  = socType;

/*
** Use this load to configure NDK 2.2 and above using RTSC. In previous versions of
** the NDK RTSC configuration was not supported and you should comment this out.
*/
var Ndk       = xdc.loadPackage('ti.ndk.config');
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 hpdspuaStart.
*/  
Global.enableCodeGeneration = false;

/*
 * Program.argSize sets the size of the .args section.
 * The examples don't use command line args so argSize is set to 0.
 */
Program.argSize = 0x0;

/*
 * Minimize exit handler array in System.  The System module includes
 * an array of functions that are registered with System_atexit() to be
 * called by System_exit().
 */
System.maxAtexitHandlers = 4;

/* No runtime stack checking is performed */
Task.checkStackFlag = false;

/*
 * The BIOS module will create the default heap for the system.
 * Specify the size of this default heap.
 */
BIOS.heapSize = 0x30000;

/*
 * Build a custom SYS/BIOS library from sources.
 */
BIOS.libType = BIOS.LibType_Custom;

/* System stack size (used by ISRs and Swis) */
Program.stack = 0x40000;

/* Circular buffer size for System_printf() */
SysMin.bufSize = 0x400;

System.SupportProxy = SysMin;

var Cache1  = xdc.useModule('ti.sysbios.family.arm.arm9.Cache');
var Mmu = xdc.useModule('ti.sysbios.family.arm.arm9.Mmu');

/* Enable the cache                                                           */
Cache1.enableCache = true;

/* Enable the MMU (Required for L1 data caching)                              */
Mmu.enableMMU = true;
/* Enable the MMU (Required for L1/L2 caching)                              */

/***********************************************
 *              MMU Configuration              *
 ***********************************************/
var Mmu = xdc.useModule('ti.sysbios.family.arm.arm9.Mmu');
Mmu.enableMMU = true;
var attrs = {
	type: Mmu.FirstLevelDesc_SECTION,  // SECTION descriptor
        bufferable: true,                  // bufferable
        cacheable: false,                   // cacheable
	imp: 1,                            // implementation defined
        domain: 3,                         // domain between 0-15
        accPerm: 3,                        // read/write permission
    };


 for (var i=0x01C42000; i < 0x01C42FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01D0C000; i < 0x01D0CFFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01D0D000; i < 0x01D0DFFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01E27000; i < 0x01E27FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01D00000; i < 0x01D02FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01D04000; i < 0x01D06FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01D08000; i < 0x01D0AFFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01C22000; i < 0x01C22FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

 for (var i=0x01E28000; i < 0x01E28FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }
     
 for (var i=0x01E26000; i < 0x01E26FFF; i = i + 0x00000400) {
         // Each 'SECTION' descriptor entry spans a 1MB address range
         Mmu.setFirstLevelDescMeta(i, i, attrs);
     }

/* Set IO Delay configuration areas as non-cache */
/* Mmu.setSecondLevelDescMeta(0x4844a000, 0x4844a000, attrs);
   Mmu.setSecondLevelDescMeta(0x4ae07d00, 0x4ae07d00, attrs);
*/

/* This is the default memory heap. */
Program.sectMap["emacComm"]          = "DDR";
Program.sectMap[".far:EMAC_DRV"]     = "DDR";
Program.sectMap["msmc"]              = "L3_CBA_RAM";
Program.sectMap[".far:PKTBUF_L2MEM"] = "DDR";
Program.sectMap[".far"]              = "DDR";
Program.sectMap[".cinit"]            = "DDR";
Program.sectMap[".bss"]              = "DDR";
Program.sectMap[".const"]            = "DDR";
Program.sectMap[".text"]             = "DDR";
Program.sectMap[".code"]             = "DDR";
Program.sectMap[".data"]             = "DDR";
Program.sectMap[".far:taskStackSection"] = "DDR";
Program.sectMap[".stack"]            = "DDR";
Program.sectMap[".sysmem"]           = "DDR";
Program.sectMap[".args"]             = "DDR";
Program.sectMap[".cio"]              = "DDR";
Program.sectMap[".switch"]           = "DDR";
Program.sectMap[".tx_buf"] = "DDR";
Program.sectMap[".rx_buf"] = "DDR";

Program.sectMap[".far:taskStackSection"] = "DDR";
Program.sectMap[".stack"]	=	"DDR";
Program.sectMap[".far:IMAGEDATA"] = {loadSegment: "DDR", loadAlign: 8};
Program.sectMap[".far:NDK_OBJMEM"] = {loadSegment: "DDR", loadAlign: 8};
Program.sectMap[".far:NDK_PACKETMEM"] = {loadSegment: "DDR", loadAlign: 128};

/* Required if using System_printf to output on the console */
SysStd          		=   xdc.useModule('xdc.runtime.SysStd');
System.SupportProxy     =   SysStd;

/********************************************************************************************************************
* Define hooks and static tasks  that will always be running.               										*
 ********************************************************************************************************************/

/* 
** Create the stack Thread Task for our application.
*/
var tskNdkStackTest  		=   Task.create("&StackTest");
tskNdkStackTest.stackSize  	= 	0x5000;
tskNdkStackTest.priority    = 	0x5;


/* 
** Create a Periodic task to handle all NDK polling functions. 
** If you are using RTSC configuration with NDK 2.2 and above, this is done by default and 
** you do not need to do this.
*/
var prdNdkClkParams         =   new Clock.Params ();
prdNdkClkParams.period      =   0x64;   
prdNdkClkParams.startFlag   =   true;
Program.global.clockInst1   =   Clock.create("&llTimerTick", 5, prdNdkClkParams);

/* 
** If you are using RTSC configuration with NDK 2.2 and above, this is done by default, else
** register hooks so that the stack can track all Task creation 
Task.common$.namedInstance  =   true;
Task.addHookSet ({ registerFxn: '&NDK_hookInit', createFxn: '&NDK_hookCreate', });

/* Enable BIOS Task Scheduler */
BIOS.taskEnabled			=   true;

  • Hi Patryk,

    I would like portable example project (NIMU_FtpExample_idkAM572x_armExampleproject) to my platform (OMAPL138).


    This would NOT work. AM572x devices are different from OMAP-L138. Portable projects are meant to be easily transferred from one host PC to another. They are not portable between devices.

    AM572x EMAC hardware is different from the one in OMAP-L138 device, so the NIMU_FtpExample_idkAM572x_armExampleproject will NOT work on OMAPL138.

    Best Regards,
    Yordan