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.

RTOS/TMS320C6746: undefined symol: Board_init. Where is Board_init? Am i miss something?

Part Number: TMS320C6746
Other Parts Discussed in Thread: OMAPL138

Tool/software: TI-RTOS

here is my code:

/*
 *  ======== main.c ========
 */

#include <xdc/std.h>

#include <xdc/runtime/Error.h>
#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>

#include <ti/sysbios/knl/Task.h>
#include <ti/board/board.h>
/*
 *  ======== taskFxn ========
 */
Void taskFxn(UArg a0, UArg a1)
{
    System_printf("enter taskFxn()\n");

    Task_sleep(10);

    System_printf("exit taskFxn()\n");

    System_flush(); /* force SysMin output to console */
}

/*
 *  ======== main ========
 */
Int main()
{ 
    Board_initCfg boardCfg;
    boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_UART_STDIO;
    Board_init(boardCfg);

    Task_Handle task;
    Error_Block eb;

    System_printf("enter main()\n");

    Error_init(&eb);
    task = Task_create(taskFxn, NULL, &eb);
    if (task == NULL) {
        System_printf("Task_create() failed!\n");
        BIOS_exit(0);
    }

    BIOS_start();    /* does not return */
    return(0);
}

This is project property:

  • Board_Init API comes from the board library which is part of PDK. If you are runnning this on LCDK platform then, you need to add the following in your .cfg file.

    var devType = "omapl138"

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

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

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

    <Add any drivers as required.>

    Please note, before creating your examples refer to some of the PDK examples to understand how this works. to Create PDK driver examples, you need to run the pdkProjectCreate script as shown here:

     

    Make sure that your PDK or Processor SDK RTOS build environment is setup before you run the Project create script.

    Regards,

    Rahul

  • /*
     *  Copyright 2015 by Texas Instruments Incorporated.
     *
     *  All rights reserved. Property of Texas Instruments Incorporated.
     *  Restricted rights to use, duplicate or disclose this code are
     *  granted through contract.
     *
     */
    
    /* THIS FILE WAS GENERATED BY ti.sysbios.genx */
    
    /*
     *  ======== uart_test.cfg ========
     *
     */
    
    /* Load all required BIOS/XDC runtime packages */
    var Memory                      =   xdc.useModule('xdc.runtime.Memory');
    var BIOS                        =   xdc.useModule('ti.sysbios.BIOS');
    var HeapMem                     =   xdc.useModule('ti.sysbios.heaps.HeapMem');
    var HeapBuf                     =   xdc.useModule('ti.sysbios.heaps.HeapBuf');
    var Log                         =   xdc.useModule('xdc.runtime.Log');
    var Task                        =   xdc.useModule('ti.sysbios.knl.Task');
    var Semaphore                   =   xdc.useModule('ti.sysbios.knl.Semaphore');
    //var CpIntc                      =   xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
    var Hwi                         =   xdc.useModule('ti.sysbios.family.c64p.Hwi');
    var ECM                         =   xdc.useModule('ti.sysbios.family.c64p.EventCombiner');
    var core                        =   xdc.useModule('ti.sysbios.hal.Core');
    
    var devType = "omapl138"
    
    /* Load the OSAL package */ 
    var osType = "tirtos"
    var Osal = xdc.useModule('ti.osal.Settings');
    Osal.osType = osType;
    Osal.socType = devType;
    
    /*use CSL package*/
    var Csl = xdc.loadPackage('ti.csl');
    Csl.Settings.deviceType = devType;
    
    /* Load the Board package and set the board name */
    var Board = xdc.loadPackage('ti.board');
    Board.Settings.boardName = "lcdkOMAPL138";
    
    /* Load Profiling package */
    /*var Utils = xdc.loadPackage('ti.utils.profiling');*/
    
    /* Load the uart package */
    var Uart = xdc.loadPackage('ti.drv.uart');
    Uart.Settings.enableProfiling = false;
    Uart.Settings.socType = devType;
    
    var System                      =   xdc.useModule('xdc.runtime.System');
    SysStd                          =   xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy             =   SysStd;
    
    /* Load and use the CSL packages */
    var Csl = xdc.useModule('ti.csl.Settings');
    Csl.deviceType = devType;
    
    /* Create a default system heap using ti.bios.HeapMem. */
    var heapMemParams1              =   new HeapMem.Params;
    heapMemParams1.size             =   8192 * 25;
    heapMemParams1.sectionName      =   "systemHeap";
    Program.global.heap0            =   HeapMem.create(heapMemParams1);
    
    
    /* No runtime stack checking is performed */
    Task.checkStackFlag = false;
    
    
    /* Reduce the number of task priorities */
    Task.numPriorities = 4;
    
    /* ================ Task configuration ================ */
    
    
    /* This is the default memory heap. */
    Memory.defaultHeapInstance      =   Program.global.heap0;
    
    Program.sectMap["systemHeap"]   =   Program.platform.stackMemory;
    Program.sectMap[".fardata:benchmarking"] = "DDR";
    
    /****** IPC - Shared Memory Settings ********/
    /* IPC packages */
    
    var memmap = Program.cpu.memoryMap;
    
    /*Startup = xdc.useModule('xdc.runtime.Startup');
    Startup.firstFxns.$add('&myStartupFxn');*/
    
    /* Enable BIOS Task Scheduler */
    BIOS.taskEnabled			=   true;
    
    /*
     * Enable Event Groups here and registering of ISR for specific GEM INTC is done
     * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs
     */
    var exception			                =	xdc.useModule('ti.sysbios.family.c64p.Exception');
    exception.enablePrint = true;
    
    /*
     *  @(#) ti.sysbios.genx; 2, 0, 0, 0,275; 4-29-2009 15:45:06; /db/vtree/library/trees/avala/avala-k25x/src/
     */
    
    /* Define and add one Task Hook Set */
    /*Task.addHookSet({
    	registerFxn: '&TaskRegisterId',
    	switchFxn: '&mySwitch',
    });*/
    

    Problem solved

    i found your uart sample app.cfg.