Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » linking with DSP/BIOS 5
linking with DSP/BIOS 5 [message #644647] Mon, 13 December 2010 10:45 Go to next message
Patrick Geremia is currently offline Patrick Geremia
Messages: 79
Registered: July 2009
Member
I am trying to link an xdc package and a lib with DSP/BIOS 5 ( I do not
use CCSv4)
Could you please let me know what I need to add to my config.bld, ....?
I could not find any examples.

Thanks in advance
Patrick
Re: linking with DSP/BIOS 5 [message #644699 is a reply to message #644647] Mon, 13 December 2010 14:59 Go to previous message
Amit Mookerjee is currently offline Amit Mookerjee
Messages: 47
Registered: July 2009
Member
Hi Patrick,
You will be using a tconf script (*.tcf) for specifying your BIOS5 configuration, and a RTSC configuration script (*.cfg)
to refer to the RTSC package/module containing your library.

The package.bld scripts needs some special sauce to work with BIOS5. Look at the statement in bold below.


/* package.bld */
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');

/* Required to pickup BIOS5 include path */
Pkg.uses.$add("ti/bios/include");

var PROGRAM_NAME = 'hello';
var PROGRAM_SOURCES = ['hello.c'];

for (var i = 0; i < Build.targets.length; i++) {
var targ = Build.targets[i];
/* create an executable named PROGRAM_NAME from PROGRAM_SOURCES */
Pkg.addExecutable(PROGRAM_NAME, targ, targ.platform,
{cfgScript: xdc.csd() + "hello.tcf",
cfgHome:"bios5_app"
}).
addObjects(PROGRAM_SOURCES);
}


Your RTSC configuration script will refer to the packages and modules supplying your library::

/*hello.cfg */
xdc.useModule('xdc.runtime.System')
.........


Note that the RTSC configuration script needs to have the same prefix as the BIOS5 tconf file .In this example the config script name is "hello.cfg". XDCtools will automatically search for this file along the package path.

In your 'C' file you need to explicitly add the generated header file to use the BIOS5 APIs

/* hello.c */
#include <xdc/runtime/System.h>

#include <log.h>

#include "package/cfg/hello_x674cfg.h"

/*
* ======== main ========
*/
Void main()
{
LOG_printf(&trace, "hello world!");
System_printf("hello world\n");

/* fall into DSP/BIOS idle loop */
return;
}

Let me know if this works for you.
Regards
Amit
Previous Topic:Package Compatibility Keys
Next Topic:building gnu target on linux 64 bit machines
Goto Forum:
  


Current Time: Wed Jul 23 20:35:26 EDT 2014

Powered by FUDForum. Page generated in 0.01469 seconds