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.

CCS/PROCESSOR-SDK-AM335X: RTOS libraries query

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: SYSBIOS, AM3352

Tool/software: Code Composer Studio

WHY WON'T YOU PUBLISH HOW TO LINK??     How many times do I have to ask?

All this "Hidden under the covers" just makes it impossible to use any of your tools for anything but it's own incestuous demos.

Steps:

Project | New CCS Project.

BeagleBone Black  -  SysBios - Typical, TI Complier, ...    XDC 3.32.2.25...  EDMA3 LLD...  am3352 PDK ... etc.  (I have no idea if I need EDMA or PDK, but I added it)

Now there is a simple SysBios task based example.  Builds fine...  until you try to add something to it!

Lets say you want to all a simple test to blink the LED.  Add this:

#include <ti/board/board.h>

static void Board_initGPIO(void)
{
    Board_initCfg boardCfg;

    boardCfg = BOARD_INIT_PINMUX_CONFIG |
        BOARD_INIT_MODULE_CLOCK |
        BOARD_INIT_UART_STDIO;

    Board_init(boardCfg);

}

 ........

/*
 *  ======== main ========
 */
Int main()
{ 
    Task_Handle task;
    Error_Block eb;

    Board_initGPIO();

And get this error:

 undefined  first referenced
  symbol        in file     
 ---------  ----------------
 Board_init ./main.obj   
error #10234-D: unresolved symbols remain

I don't know where this is to link to it. There is nothing documented about where this (or any) functions are. Your tool doesn't put it in the project for me.  Nowhere does anything tell me what to add to the linker to find it.

Please do not tell me to go to Resource Explorer.  Everything under the "Software | Sitara" tree is nothing but silicon docs and white papers.  No documentation on library functions.

  • The RTOS team have been notified. They will respond here.
  • Thank you...
    And for renaming it. My (continued) frustration was present in the subject line.

    But this is not an RTOS issue, is it? The Board_init() function, wherever it is, is not related to RTOS. It's some kind of Dev Kit function... baremetal access, or the like.
  • Chris,

    The Board_init is part of the board library that can be found here:

    pdk_am335x_1_0_7\packages\ti\board\lib\evmAM335x\a8\release

    The general organization of  how the stack is organized in the Application development with Processor SDK RTOS training. (Refer Section 2 and Section 9.1)

    Hope this helps.

    Regards,

    Rahul

    PS: The SDK documentation is currently wiki based and API reference guide is provided here:

    pdk_am335x_1_0_8/packages/API_Documentation.html

    Based on feedback that we have received on the SDK documentation, we are planning to re-organize the documentation and provide a starting template, but the enhancement are not yet integrated in the SDK so we will try and provide assistance to you when you run into issues.

  • Thank you...

    Up until recently, that training page didn't even work.  I exchanged many emails with someone at some Web group trying to prove to them that it didn't work.

    And I have been through that WiKi as well.  It's doesn't say what libs are required to use what functions, not does it address the "thanks to XDC It automatically incorporates into your project" when things that actually don't work.

    But that is only a small portion of the question.  How do I set the linker search path, according to those "magic" variables, which are also not described?  

    TI created this behemoth environment, that is supposed to do everything automatically with the XGCONF tool, but nothing is clear.  I already asked how I can link to RTOS directly, but apparently you CAN'T use RTOS without this XDC mystery tool, and you can't add libraries with it.  So everyhting, as afar as I can tell, is just a cobbled together mess.

    I have a handful of library search paths, of which NOT ONE of them is defined:

    "${TI_PDK_LIBRARY_PATH}"

    "${BIOS_LIBRARY_PATH}"

    "${CG_TOOL_ROOT}/lib"

    "${CG_TOOL_ROOT}/include"

    So, if I am supposed to actually USE this environment in a manner consistent with the architecture that the entire eco-system is supposed to follow, where are these being defined?  Where am I supposed to define these new paths?  Or should I just ignore all these mystery variables and hack it together as some cobbled mess?  I already have the "PDK" added in the project properties.  But apparently that doesn't add the libs or the linker search paths  (What exactly does it do then??)

    Because when I do hack that into the search path, now I get this:

     undefined      first referenced                                                                                          
      symbol            in file                                                                                               
     ---------      ----------------                                                                                          
     UART_stdioInit C:/ti/pdk_am335x_1_0_7/packages/ti/board/lib/bbbAM335x/a8/release/ti.board.aa8fg<bbbAM335x_lld_init.oa8fg>

    I can see where this is going. It's called an avalanche.  Last time I was asking how to link one of the dev packages, I peaked out at over 100 undefined symbols during the link stage.

    I read your last sentence.  The "starting templates" that I try to use don't react well to being modified.  Nor is there any clue how to take "Template A" and merge it with "Template B"

    I hope you take that into account when you "get around" to fixing the doc.

  • Let me try and help based on the feedback you have provided here:

    For XGCONF/RTC/XDCTools usage, TI RTOS OS kernel has been designed to be used with XGCONF so that the appropriate module in the SYSBIOS kernel can be added and removed from the .cfg file. However, the PDK library which is the device specific drivers, low level register defines and board libraries don`t  necessarily require XDCtools, they can be linked and included similar to any other library.

    Now, let us look at CCS project creation and look at the Macros that you refered to. TI SDK uses setup environment scripts, CCS Product discovery and pdkProjectCreate script to generate the CCS projects, these scripts are created to pick up macro definitions based on where you have installed the SDK.

    When you are creating a project in CCS, if you want to create portable projects that you can share with other, you can define similar macros by right clicking on the project and going to Build Properties. Under properties, you can define your own variable like PDK_PACKAGES as shown below:

    For headers files that are included in the PDK, you care only recommended to add ${TI_PDK_LIBRARY_PATH} to the CCS Build- > GNU Compiler- >Directories

    In the source include path relative to the packages folder:

    /* UART Header files */
    #include <ti/drv/uart/UART.h>
    #include <ti/drv/uart/UART_stdio.h>
    #include <ti/drv/uart/test/src/UART_board.h>

    To link the libraries, go to the CCS BUILD -> GNU Linker- > Libraries.  Add library search path :

    and add the  driver library using the following ssyntax

    Note:  For GNU compiler , you need to add colon infront of library names that don`t start with lib as explained here:

    http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS_FAQ#How_to_create_ARM_baremetal_CCS_project_that_link_to_PDK_driver_libraries_using_GNU_Linker.3F 

    Note: Board library, drivers may have dependency on other libraries so you need to include other libraries as required.

    For Example board library has dependency on csl, uart, i2c, osal drivers so those libraries will have to be added in the same way. When getting started, I will start by creating a project where all driver libraries, board and OSAL library are linked, the linker will eliminate symbols that are not used. Note when using OSAL, you need to select whether your application will use RTOS or will be bare metal and link library appropriately.

    Driver libraries have dependency on the CSL and OSAL and rely on application performing initialization using board library.

    Hope this gives you some insight into getting your development started. In the future, we plan to provide a starter template that explicitly links the libraries and eliminates the use of XDCtools for device level components but this template is currently work  in progress.

    Please feel free to provide any feedback if you run into any issues

    Regards.

    Rahul

  • Your projects requires the following libraries to start with
    "$(PDK_PACKAGES)/ti/board/lib/bbbAM335x/a8/release/ti.board.aa8fg" (Beagle bone board library )
    "$(PDK_PACKAGES)/ti/osal/lib/rtos/am335x/a8/release/ti.osal.aa8fg" (OS abstraction library for drivers to interface with TI RTOS )
    "$(PDK_PACKAGES)/ti/drv/uart/lib/am335x/a8/release/ti.drv.uart.aa8fg" (UART driver library)
    "$PDK_PACKAGES)/ti/drv/i2c/lib/am335x/a8/release/ti.drv.i2c.aa8fg" (I2C driver library)
    "$(PDK_PACKAGES)/ti/csl/lib/am335x/a8/release/ti.csl.aa8fg" (CSL driver library)

    you can add other libraries as your application needs more functionality.
  • Rahul Prabhu,

    I am going to mark this as answered.  Although the I knew almost all of it, the information on which libraries to start with is new.

    However, I had to abandon this, because the PDK is missing critical things I need.  Now I am trying to link to the older StarterWare 2.0.1.1 which actually has a USB CDC example, but that is turning out to be a train wreck as well.

    But this does it explain why, if I add the PDK to the projects setting, variables are not added automatically.  And why I have to define it myself?

    Or where those ones come from that are not defined anywhere?

    What's the point of checking that "am335x_PDK" box if it doesn't do anything?