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/TMDSICE3359: Project build issue with ARM toolset

Part Number: TMDSICE3359
Other Parts Discussed in Thread: SYSBIOS, AM3359

Tool/software: TI-RTOS

Hello everyone,

I am a beginner with TI CCS and started to dive into RTOS-World with the TMDSICE3359 V2 device.

My problem is to build a simple project which uses GPIO driver with usage of the TI toolset (ARM Compiler, ARM Linker). However, the same SysBios.cfg works with a project which uses gnu toolset (GNU Compiler, GNU Linker).

I will describe my environemnt, the steps I have done, the SysBios configuration and the build output of both projects. Additionally I have some questions.

I worked through 

processors.wiki.ti.com/.../Processor_SDK_RTOS_Software_Developer_Guide

1. Environment

I set up my environment with CCS 7.4, pdk_am335x_1_0_10, xdctools_3_50_04_43_core. I rebuilt the PDK sucessfully.

All the PDK example projects, which are loacted under /home/thomas/ti/pdk_am335x_1_0_10/packages/MyExampleProjects build an run fine!

All the CCS-Project templates works fine (with TI-Compiler or GNU-Compiler used).

That said, I wanted to understand how SysBios works and how it needs to get configurated in a correct way. I can't find much details about this on the TI website and wikis.

2. Steps

My plan was to start with a SYS/BIOS-Typical project template, and add minimal configurations to be able to interface the GPIOs on the board.

2.1 Created Project Template (New CCS Project, Compiler Version: TI v16.9.6.LTS, Target: ICE_AM3359). Building at this stage was successfull.

I investigated some threads here in the forum, and found out that I probably need the "OSAL-Layer", the "CSL-Layer" and maybe the UART and I2C package to use and initialize the GPIO drivers.

2.2 Change to app.cfg

So my complete app.cfg looks like this:

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');

/*
 * Uncomment this line to globally disable Asserts.
 * All modules inherit the default from the 'Defaults' module.  You
 * can override these defaults on a per-module basis using Module.common$. 
 * Disabling Asserts will save code space and improve runtime performance.
Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF;
 */

/*
 * Uncomment this line to keep module names from being loaded on the target.
 * The module name strings are placed in the .const section. Setting this
 * parameter to false will save space in the .const section.  Error and
 * Assert messages will contain an "unknown module" prefix instead
 * of the actual module name.
Defaults.common$.namedModule = false;
 */

/*
 * 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;       

/* 
 * Uncomment this line to disable the Error print function.  
 * We lose error information when this is disabled since the errors are
 * not printed.  Disabling the raiseHook will save some code space if
 * your app is not using System_printf() since the Error_print() function
 * calls System_printf().
Error.raiseHook = null;
 */

/* 
 * Uncomment this line to keep Error, Assert, and Log strings from being
 * loaded on the target.  These strings are placed in the .const section.
 * Setting this parameter to false will save space in the .const section.
 * Error, Assert and Log message will print raw ids and args instead of
 * a formatted message.
Text.isLoaded = false;
 */

/*
 * Uncomment this line to disable the output of characters by SysMin
 * when the program exits.  SysMin writes characters to a circular buffer.
 * This buffer can be viewed using the SysMin Output view in ROV.
SysMin.flushAtExit = false;
 */

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

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

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

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

/* 
 * Create and install logger for the whole system
 */
var loggerBufParams = new LoggerBuf.Params();
loggerBufParams.numEntries = 16;
var logger0 = LoggerBuf.create(loggerBufParams);
Defaults.common$.logger = logger0;
Main.common$.diags_INFO = Diags.ALWAYS_ON;

System.SupportProxy = SysMin;

/* ================ Driver configuration ================ */

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

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

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

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

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

/* Load Profiling package */
var Utils = xdc.loadPackage('ti.utils.profiling');

/* Load the gpio package */
var GpioPackage = xdc.loadPackage('ti.drv.gpio');
GpioPackage.Settings.enableProfiling = true;

2.3 Build does fail with this output

**** Clean-only build of configuration Debug for project OwnSysBios_TICompiler ****

/home/thomas/ti/ccsv7/utils/bin/gmake -j 8 clean -O 
 
cleaning ../src/sysbios ...
rm -rf  "OwnSysBios_TICompiler.hex"  "configPkg/linker.cmd" "configPkg/compiler.opt"  "OwnSysBios_TICompiler.out" 
rm -rf  "configPkg/" 
rm -rf "main.obj" 
rm -rf "main.d" 
Finished clean
 

**** Build Finished ****

**** Build of configuration Debug for project OwnSysBios_TICompiler ****

/home/thomas/ti/ccsv7/utils/bin/gmake -j 8 all -O 
 
Building file: "../app.cfg"
Invoking: XDCtools
"/home/thomas/ti/xdctools_3_50_04_43_core/xs" --xdcpath="/home/thomas/ti/bios_6_52_00_12/packages;/home/thomas/ti/pdk_am335x_1_0_10/packages;/home/thomas/ti/uia_2_21_02_07/packages;/home/thomas/ti/ccsv7/ccs_base;" xdc.tools.configuro -o configPkg -t ti.targets.arm.elf.A8Fnv -p ti.platforms.evmAM3359 -r release -c "/home/thomas/ti/ccsv7/tools/compiler/ti-cgt-arm_16.9.6.LTS" --compileOptions "-g --optimize_with_debug" "../app.cfg"
making package.mak (because of package.bld) ...
generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
configuring app.xea8fnv from package/cfg/app_pea8fnv.cfg ...
generating custom ti.sysbios library makefile ... 
subdir_rules.mk:10: recipe for target 'build-1140064849-inproc' failed
js: "/home/thomas/ti/pdk_am335x_1_0_10/packages/ti/drv/gpio/package.xs", line 115: Error: 	Library not found: /home/thomas/ti/pdk_am335x_1_0_10/packages/ti/drv/gpio/./lib/a8/release/ti.drv.gpio.profiling.aea8fnv
gmake: *** [package/cfg/app_pea8fnv.xdl] Error 1
gmake: *** Deleting file `package/cfg/app_pea8fnv.xdl'
gmake: *** [package/cfg/app_pea8fnv.xdl] Deleting file `package/cfg/app_pea8fnv.h'
gmake: *** [package/cfg/app_pea8fnv.xdl] Deleting file `package/cfg/app_pea8fnv.c'
js: "/home/thomas/ti/xdctools_3_50_04_43_core/packages/xdc/tools/Cmdr.xs", line 52: Error: xdc.tools.configuro: configuration failed due to earlier errors (status = 2); 'linker.cmd' deleted.
gmake[1]: *** [build-1140064849-inproc] Error 1
gmake: *** No rule to make target 'build-1140064849', needed by 'configPkg/compiler.opt'.  Stop.

**** Build Finished ****

The problem here is this line: "js: "/home/thomas/ti/pdk_am335x_1_0_10/packages/ti/drv/gpio/package.xs", line 115: Error: Library not found: /home/thomas/ti/pdk_am335x_1_0_10/packages/ti/drv/gpio/./lib/a8/release/ti.drv.gpio.profiling.aea8fnv"

This path does not exist, because of the dot (.) in the path. I investigated why the dot occures there: Within the file "pdk_am335x_1_0_10/packages/ti/drv/gpio/package.xs", the lib path gets modified to ./lib, when the env LIBDIR is not defined:

/* Read LIBDIR variable */
    var lib = java.lang.System.getenv("LIBDIR");

    /* If NULL, default to "lib" folder */
    if (lib == null)
    {
        lib = "./lib";
    } else {
        print ("\tSystem environment LIBDIR variable defined : " + lib);
    }

I triple checked all the DEFINES and build configurations, between this project and the other PDK-example project which uses GPIO but couldn't make it working.

I also followed the steps of the toolset and glanced into the makefiles to understand why LIBDIR was not set in my case. I gave up since it was to complex to me as a beginner.

With some luck, I tried the same steps with a new CCS-Project template with GNU as toolset. I applied the exact same app.cfg and the build worked!

4. Questions

Now I have a few questions:

4.1 Why does my example not work with TI toolset, but with the GNU ones? I this suppose to be, or a bug?

4.2 Why do I not see the print commands within the .xs-files during the build process? How can I enable this? I already checked but could not find the answer.

4.3 What is the difference, between TI toolset and the GNU toolset? Which should I use for best stability?

4.4 What is really the minimal configuration to interface GPIO via SysBios? Do I really need UART for this?

4.5 Is there any description, how the build process of SysBios/Drivers/OSAL/CSL works under the hood? My understanding so far (for GPIO as example):

"pdk/packages/ti/drv/gpio/gpio.h" describe a common interface for GPIO functionality, with no dependency on a specific hardware.

The build process picks up the SysBios-configuration and reads the values for the target board and processor, and configures the linker in a way, that it links with the correct hardware implementation.

Is that more or less correct?

Many thanks in advance!