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.

Writing own hello world using Empty RTSC platform in CCSv5.

Other Parts Discussed in Thread: OMAP3530, SYSBIOS

 

Hi, everyone

To move forward in my project, i am now using the RTSC platform on CCSv5.0.2.00006.

Along with this one i am using the OMAP3530 beagleboard,  XDS100v2 Emulator, windows XP/windows 7, is that fine?

I debugged the sample hello world program of SYSBIOS, and it works fine.

Now, i want to write my own hello world program in empty RTSC project.

1. I wrote the source file as follows.

#include <xdc/std.h>

#include <xdc/runtime/System.h>

#include <ti/sysbios/BIOS.h>


Void main()

{

    System_printf("hello world\n");


    BIOS_exit(0);  

}

2.Then i created target configuration files and added it, then followed by the .cfg file .

What i did is that i copied the content of the .cfg file of sample to my hello world .cfg file (configuration file should be same) okay.

3. In the RTSC platform wizard i created the my own platform file just b looking in to the target.3530.evm platform, and added it to my plateform.

here is my  .cjg file.


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 Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');


/* 

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


/*

 * 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 = 0x2000;


/* System stack size (used by ISRs and Swis) */

Program.stack = 0x1000;


/* Circular buffer size for System_printf() */

SysMin.bufSize = 0x400;


/* 

 * Create and install logger for the whole system

 */

var loggerBufParams = new LoggerBuf.Params();

loggerBufParams.numEntries = 32;

var logger0 = LoggerBuf.create(loggerBufParams);

Defaults.common$.logger = logger0;

Main.common$.diags_INFO = Diags.ALWAYS_ON;


System.SupportProxy = SysMin;

 

Here is the my platform wizard screenshot,


 

 

When i am building my project, i had some errors in the error log, which are something like this.

 

Description Resource Path Location Type

cannot find file "./configPkg/linker.cmd" hello test C/C++ Problem

errors encountered during linking; "hello test.out" not built hello test C/C++ Problem

Linking failed. Check the Console window for details. hello test Unknown C/C++ Problem

unresolved symbol _ti_sysbios_BIOS_exit__E, first referenced in ./hellotest.obj hello test C/C++ Problem

unresolved symbol _xdc_runtime_System_printf__E, first referenced in ./hellotest.obj hello test C/C++ Problem

creating ".stack" section with default size of 0x400; use the -stack option to change the default size hello test C/C++ Problem

Also attaching the project file

4274.hello test.zip

Here i had attached the all the necessary details of project. If anybody what's going wrong here, then please let me know.

Regards,

Nitin Mewada 

 


 

  • Hi, everyone 

    Later, when i am just writing the just 2 below mentioned lines , then i am getting everything perfect, code runs.

    Lines i just wrote in .cfg file,

    var System = xdc.useModule('xdc.runtime.System');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');

    So, earlier default sample program is using such a large .cfg file, and now i am getting my code debugged correctly with these two lines only. These two lines were there in the previous .cfg which i mentioned in the above post. 

    What is the difference it is creating here. Can anybody explain me about this.

    Regards,

    Nitin Mewada

  • Nitin,

    I am going to move this into the BIOS forum.  They should be able to help with .cfg issues.

    John

  • Nitin,

    When calling any BIOS or XDC API in your C code, you need to have a corresponding "useModule()" statement in your configuration file.  The 'useModule()' causes that module's libraries to be linked into your application automatically.

    In your case, your app  had a call to both BIOS and System APIs, and these resulted in unknown symbol errors.  Adding the above 'useModule' statements caused the BIOS and System libraries to link into your app, hence eliminating the unknown symbol errors.

    Steve

  • Hi Steve, but haven't these lines not already been before within Nitin's config file (see his first post, until now I assumed that his ".cjg" has been a typo and actually meant ".cfg") , and wasn't he asking about why reducing the .cfg file to these two lines delivered the solution? What made the difference, that I was interested in to know, because my first interpretation of the error messages from Nitin's 1st post would have lead to the same hint as yours, if not these lines would have already been there also within the first configuration file...

    Regards,
    Joern.

  • Hi, Joern

    Ya buddy, i think you understood my problem.

    The previous .cfg file is from sample hello world from ccs examples, and lator when i created my own hello world i just wrote two lines.

    Whatever Steve is trying to explain, i knew about it. My question is that, earlier .cfg file is running fine with the sample hello world, but not with mine.

    Regards,

    Nitin Mewada

     

  • Nitin,
    the initial error message that states that configPkg/linker.cmd cannot be found indicates that the configuration step failed. Can you check if there are any error messages further up in the console output?