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.

CODECOMPOSER: Extremely minimal Build for tms320f280049C failed

Part Number: CODECOMPOSER
Other Parts Discussed in Thread: TMS320F280049C, C2000WARE

I am just testing out CCS and just want to check on creating a new project for a tms320f280049C CCS will build and compile (this is very minimal and Im not even trying to flash it to target hardware even...just build it).

1 After using File>New>CCS project I press build project and its sucessful (its only got an empty main() to compile!)

2 I add in a line to write to one of the SPI control registers with the appears to be most likely include file, and build and I get unexpected errors which surprised me.

3. The path for the (presumable correct .h file included) has been added to the Compilers Include paths options but this makes no difference.

This surprised me as most Embedded IDEs have used before normally are easy to get very minimal builds going in only minutes, even if the resulting code is useless in real life...at least it builds!

So this seems like the dumbest question to ask but how do I get CCS to build code modifying one of the registers on TI f280049C controller? 

What .h files should I include and what paths should I expect ?

  • Hello,

    There are plenty of examples to start from in C2000ware. Including empty projects. Have you looked at those? Those examples will have all the right header and cmd files to get you going in minutes.

  • Yes I have seen these and they rely on "driverlib.h" and many functions which are declared inline but  Im sure I should be able to access SpiaRegs directly which I would prefer.  I did try to open the project called GPIO in the examples folder and it totally failed to even attempt building, so something wrong in the project properties I suspect which also doesnt fill me with confidence if its an example!

    All I would like to know is if Im targeting an F280049C what #includes should be in my files and what include paths should be listed in the project properties to access features on the target uC? 

  • Hi Andrew,

    If you don't want to use the driverlib approach , then you can refer the bitfield examples provided at C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f28004x\examples\spi. These examples directly access the SpiaRegs.

    Can you let me know which GPIO example you tried to compile and it failed out of the box? 

    The header files are located at C:\ti\c2000\C2000Ware_3_04_00_00\device_support\f28004x\common\include and C:\ti\c2000\C2000Ware_3_04_00_00\driverlib\f28004x\driverlib folders.

    Best Regards

    Siddharth

  • Hello Siddharth,

    I tried opening the example from "C:\ti\c2000\C2000Ware_3_03_00_00\device_support\f28004x\examples\spi" and it doesnt appear to use direct access to register such as SpiaRegs etc but does rely on "devicelib.h"

    Either way, CCS10 wont compile that example, which is worrying:

  • Hi Andrew,

    Looks like you may have imported the driverlib example.

    Can you check again by importing the CCS project from device support directory of C2000Ware?

    "C:\ti\c2000\C2000Ware_3_03_00_00\device_support\f28004x\examples\spi"

    Attached is the snippet of code in this example which directly accesses the SpiaRegs.

    Best Regards

    Siddharth

  • As a bit of background I already maintain some code (started by someone else on a DSP2833x) and have use the SpiaRegs etc with no issues, but this time on the 280049C, Im only trying to create a new very minimum code to test CCS out.

    I think what I am really seeing is a combination of UX and project/compiler/path management problems CCS10 has - Even if I use "File>OpenProjects from File System" or File>Import" to try to load up TIs example code I get various errors whether it simply wont load the project or CCS wont compile....all of which is very worrying if it cant load & compile its own examples!

    This is what I see if I try to import the spi example you suggest:

  • Hi Andrew,

    All the C2000Ware examples go through a build test to ensure that they are compiling without any errors. Looks like the CCS workspace might have got corrupted which might be causing these issues for you.

    Request you to try importing the same project after switching to a new CCS workspace.

    Best Regards

    Siddharth

  • I tried switching to a new workspace of "C:\ti\c2000\C2000Ware_3_03_00_00\device_support\f28004x\examples" and used "File>Open Project form File System" and only two of the projects within that directory were available to load. 

    Neither compiles but there no errors just it simply doesnt compile anything, even after a 'clean'....the console screen is  blank all the time.

    If i were to use File>import I get the same "import failed" error message from last time I posted.

    If I switch workspace to "C:\ti\c2000\C2000Ware_3_03_00_00\driverlib\f28004x\examples" I see exactly the same issues with CCS10.

  • Hi Andrew,

    Instead of using File->Open Project , can you try importing using "Project->Import CCS Projects". Here you need to specify the folder you want to import the CCS project from. In this case "C:\ti\c2000\C2000Ware_3_03_00_00\device_support\f28004x\examples\spi" and see if you are able to build the CCS project.

    Best Regards

    Siddharth

  • Even if I use "File>OpenProjects from File System" or File>Import" to try to load up TIs example code I get various errors whether it simply wont load the project or CCS wont compile..

    With C2000Ware I use the import option from the Resource Explorer which works:

    I have tried the other import options you are using which give the errors.

  • What .h files should I include and what paths should I expect ?

    The f28004x_spi.h file included by f28004x_device.h declares a structure variable for set set of SPI peripherals variables:

    //---------------------------------------------------------------------------
    // SPI External References & Function Declarations:
    //
    extern volatile struct SPI_REGS SpiaRegs;
    extern volatile struct SPI_REGS SpibRegs;

    And the linker is reporting an undefined symbol for SpiaRegs.

    With C2000Ware the variables which define the structure each set of peripheral registers are defined in a C source file, and also require a linker command file to place the structures at the base address for the peripherals.

    In your case with a bare-metal program, i.e. no SYS/BIOS, then:

    1. C2000Ware_3_03_00_00_Software/device_support/f28004x/headers/source/f28004x_globalvariabledefs.c is the C file which defines the global variables for the peripheral register structures.
    2. C2000Ware_3_03_00_00_Software/device_support/f28004x/headers/cmd/f28004x_headers_nonbios.cmd is the linker command file to use.

    The attached CCS project took your main function accessing the SpiaRegs and added linked resources for the f28004x_globalvariabledefs.c and f28004x_headers_nonbios.cmd files so that CCS uses them during the build, and the program now successfully links.

    Using linked resources means uses the files in the C2000Ware installation, rather than a copy in the project in the workspace (which happens when import the C2000Ware examples from the Resource Explorer):

    Adding or Linking Source Files to Project has more information on creating linked resources.

    /cfs-file/__key/communityserver-discussions-components-files/81/TMS320F280049C_5F00_bare_5F00_metal_5F00_bit_5F00_fields.zip

  • Andrew,

    Let me know if importing using "Project->Import CCS Projects" worked for you. If not, then for now you can use the import option from the Resource Explorer. This use CCS Cloud.

    Best Regards

    Siddharth