Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » DSDP - Real-Time Software Components (RTSC) » Module that uses c28x's peripherals
Module that uses c28x's peripherals [message #720706] Wed, 31 August 2011 05:57 Go to next message
linkinsebas is currently offline linkinsebasFriend
Messages: 22
Registered: April 2011
Junior Member
Hello,

What should I do if I want to create a module that be able to use C28x's peripherals such as GPIO's, ePWMs, eCAN and SCI's?

Any help would be appreciated. Thanks.

[Updated on: Wed, 31 August 2011 13:15]

Report message to a moderator

Re: Module that uses c28x's peripherals [message #721800 is a reply to message #720706] Fri, 02 September 2011 23:04 Go to previous messageGo to next message
linkinsebas is currently offline linkinsebasFriend
Messages: 22
Registered: April 2011
Junior Member
I have just been able to accomplish this by using the following package.bld file:

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

var PERIPH_HEAD_PREF='C:/tidcs/c28/DSP2833x/v131/DSP2833x_'

var LIB_NAME = "lib/" + Pkg.name;
var LIB_SRCS = ["source1.c",
                "source2.c"];

var libAttrs={
    profile: "whole_program",
    incs: '--include_path="'+PERIPH_HEAD_PREF+'common/include"' 
      + ' --include_path="'+PERIPH_HEAD_PREF+'headers/include"',
    };

for each (var targ in Build.targets) {
    Pkg.addLibrary(LIB_NAME, targ, libAttrs).addObjects(LIB_SRCS);
}


and copying C:\tidcs\c28\DSP2833x\v131\DSP2833x_headers\source\DSP2833x_GlobalVariableDefs.c to the client program's directory and compiling with it. Also, I had to link the client program using C:\tidcs\c28\DSP2833x\v131\DSP2833x_headers\cmd\DSP2833x_Headers_nonBIOS.cmd (non-BIOS client program).

However, I would like to make a module that does not require the client to include anything besides the module itself.

Any advice on how to improve the module would be deeply appreciated.

Thank you.
Re: Module that uses c28x's peripherals [message #722855 is a reply to message #721800] Tue, 06 September 2011 23:55 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
Sebastian,
in one of the previous threads you posted, I described how to add some content to the generated linker command file using templates and getSects(). You can use that same example to include the non-BIOS linker command file. As for the C file, we recently (in XDCtools 3.22) added a new module, xdc.cfg.SourceDir that allows you to specify that you want to add some C source files to an executable build. However, you would also need to create a makefile template that will build GlobalVariableDefs.c.

Right now, I don't have a simple example for SourceDir, and if I remember correctly you are using 3.20, but I'll try to create one and post it here, or ask Dave Russo to do it.
Re: Module that uses c28x's peripherals [message #722863 is a reply to message #722855] Wed, 07 September 2011 01:53 Go to previous messageGo to next message
linkinsebas is currently offline linkinsebasFriend
Messages: 22
Registered: April 2011
Junior Member
Sasha:

I am going to try what you said, but if you or Dave get an example before I get this working, please post it. By the way, I am using xdctools 3.22.

Thanks for your help.
Re: Module that uses c28x's peripherals [message #753826 is a reply to message #722863] Sat, 29 October 2011 02:35 Go to previous message
Sasha Slijepcevic is currently offline Sasha SlijepcevicFriend
Messages: 115
Registered: July 2009
Senior Member
Sebastian,
I don't know if you still need it, but I attached an example for the use of xdc.cfg.SourceDir. The attached file consists of two packages. One package (basic.srcDir.pkgA) delivers a C source file and a Makefile. In your case, that would be the package that would deliver GlobalVariableDefs.c. The client package (basic.srcDir) only loads the package basic.srcDir.pkgA. The example is simpler than what your implementation would have to be because it's meant to be the simplest example we can come up with. But I think if you start with this example, and with some additional help, you should be able to apply this to your project.

This is a relatively new feature, and we are actively working on it for 3.23 release sometimes in November. Since you are using 3.22, you'll have to manually delete the directory in which the delivered sources are built. In this example, the name of that directory is 'sources' and it's located in the client's package.
  • Attachment: srcDir.zip
    (Size: 3.10KB, Downloaded 434 times)
Previous Topic:Math functions for c28_float target
Next Topic:how to generate a custom memory map for rtsc based project
Goto Forum:
  


Current Time: Tue Apr 16 19:56:15 GMT 2024

Powered by FUDForum. Page generated in 0.42079 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top