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.

xdctools do not create the proper #define in CCS v6

Moved this here from the Tiva forum

Here is the text from EK_TM41294XL.c:

 *  The following defines are used to determine which TI-RTOS peripheral drivers
 *  to include:
 *     TI_DRIVERS_EMAC_INCLUDED
 *     TI_DRIVERS_GPIO_INCLUDED
 *     TI_DRIVERS_I2C_INCLUDED
 *     TI_DRIVERS_SDSPI_INCLUDED
 *     TI_DRIVERS_SPI_INCLUDED
 *     TI_DRIVERS_UART_INCLUDED
 *     TI_DRIVERS_USBMSCHFATFS_INCLUDED
 *     TI_DRIVERS_WATCHDOG_INCLUDED
 *     TI_DRIVERS_WIFI_INCLUDED
 *  These defines are created when a useModule is done on the driver in the
 *  application's .cfg file. The actual #define is in the application
 *  generated header file that is brought in via the xdc/cfg/global.h.
 *  For example the following in the .cfg file
 *     var GPIO = xdc.useModule('ti.drivers.GPIO');
 *  Generates the following
 *     #define TI_DRIVERS_GPIO_INCLUDED 1

Here is the data from app.cfg from the imported udp echo example:

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');
var EMAC = xdc.useModule('ti.drivers.EMAC');
var Global = xdc.useModule('ti.ndk.config.Global');
var Tcp = xdc.useModule('ti.ndk.config.Tcp');
var Udp = xdc.useModule('ti.ndk.config.Udp');
var Ip = xdc.useModule('ti.ndk.config.Ip');
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var DhcpClient = xdc.useModule('ti.ndk.config.DhcpClient');
var Emac = xdc.useModule('ti.ndk.config.Emac');
var GPIO = xdc.useModule('ti.drivers.GPIO');

As you can see app.cfg clearly indicates that a header file somewhere should be generated with the line:

#define TI_DRIVERS_EMAC_INCLUDED 1

I have used every tool in my arsenal to find any file that has that text to no avail.

xdc\cfg\global.h is looking for a symbol to be set "xdc_cfg__xheader__" somewhere.  I am led to believe that the symbol should be generated automagically as part of the build process, but it is not happening.

Guidance needed on setting up the environment to make this happen.  Tools installed are CCS V6, TI RTOS Tiva C 2.00,  Tivaware v2.1.0, and xdc tools 3.30.01.

The project was imported from the UDP echo example.

The engineer across the hall is using CCS v5 and it works fine for him.

  • Hi Raymond,

    I imported and compiled the example and could not reproduce the error.  Can you please post your project's .cfg file?

    Thanks,

    -- Emmanuel

  • Actually, the app.cfg file data was in the initial message as text.  Here is the complete file as an attachment.  You can see that all of the devices are in the list, but the appropriate defines are not being generated.

    It is not clear if any of the instructions in this Wiki will solve the issue:

    processors.wiki.ti.com/index.php/Porting_an_existing_SYS/BIOS_project_to_TI-RTOS_with_TI-RTOS_drivers


    Several of the changes fixed other unresolved symbol problems.  I am still working through all of the changes in the Wiki.

    app.cfg
  • Emmanuel:

    I have attached my compiler.opt file, the app.cfg file, as well as the generated app_pem4f.h header file.  As you can see this file which is included from global.h has nary a #define included.  I have no idea why the xdc tools do not generate a proper header file.  I have spent the entire afternoon looking over the execution of this tool without success.  Perhaps your installation of XDC Tools will generate  a header file with the proper #defines.


    Ray

    PS: you might want to let your IT folks know that .opt files are a reasonable file extension to be allowed for uploading!!!

    upload.zip
  • We reloaded the project from subversion and it is working now.  It is unclear what fixed it.  It is worrying that what appeared to be a perfectly legitimate app.cfg would not create a proper app_pem4f.h

    Ray

  • Hi Raymond,

    Sorry for the delayed response.

    I took your app.cfg file and imported it into my example project and was able to reproduce the error.  I believe the problem you were having was because you were trying to use TI-RTOS drivers without also including the TI-RTOS module.  The project should work after adding the following line:

    // Include the TI-RTOS module - it creates the appropriate
    // #define's for drivers
    var TIRTOS = xdc.useModule('ti.tirtos.TIRTOS');

    Please let me know if this helps,

    -- Emmanuel

  • No worries on the timing.  I know how busy your job can get!

    Here is the app.cfg screen I get:

    You can see that app.cfg editing thinks that I am using TI-RTOS.  However, it just shows the SYS/BIOS component.  Is there some documentation somewhere that does or needs to indicate that we need to add an explicit line manually to app.cfg?

    It seems reasonable that hitting "System Overview" in the screen below should automatically generate the line you mention in your instructions.  It does not appear to do that.


    Thanks again for tracking down this issue.  That absolutely solved the problem.  Holler if you need any help in recreating this issue from my end.

  • Hi Raymond, 

    Glad to hear you got it working!!  

    Your screenshot did not load correctly, mind uploading it again?  If you select the "System Overview" you should be greeted by the following screen:

    From your previous post, you said you imported the UDP Echo example; the TI-RTOS useModule line of code should have already been included.  But it seems like you have also made some modifications of your own; did you use the visual config tool?  Do you remember your modifications?  I would like to see if by reproducing your steps I will also run into the problem.

    Thanks,

    -- Emmanuel.

  • Emmanuel,

    I have the same problem when using a previously defined *.cfg file and modifying to add I2C driver. I am using CCSv6, TI-RTOS 2.1.0.03, SYS/BIOS 6.40.3.39, and XDC 3.30.4.52.

    I delete it and started from scratch using visual editor., same issue. On the original file the visual editor did show RTOS checked, I ended up just adding the RTOS line to *.cfg file.