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.

Custom timestamp module issue

Other Parts Discussed in Thread: SYSBIOS

Hello everyone,

(target C6678, CCS 5.5, BIOS 1.25, XDCTools 3.25)

For my SYSBIOS application,
I'm trying to build a custom timestamp module.

I followed http://rtsc.eclipse.org/docs-tip/Extending_xdc.runtime_Timestamps/Example_1

with a very simple test application but I get undefined symbol errors during the link :

custom_Timestamp_Module_startup__F
custom_Timestamp_get32__F
custom_Timestamp_get64__F
custom_Timestamp_getFreq__F

I don't get why and I'm stuck.

Can you point me at what is wrong ?

See the attached project + custom module

4784.timestamp_issue.zip

Thank you
Clement

  • In particular what should be put in package.bld ?

    I think it's where the error is.

    Right now I have what is in the tutorial but I think it's too generic (i.e. not adapted to SYS/BIOS)

    Here's the content

    for (var i = 0; i < Build.targets.length; i++) {
        var targ = Build.targets[i];
        if (targ.isa == "66") {
            var lib = Pkg.addLibrary("lib/" + Pkg.name, targ);
            lib.addObjects(["Timestamp.c"]);
        }
    }
  • Clement,
    most likely you have some kind of target mismatch. When you are building your custom package, you are using config.bld whose content I can't see, so I can't tell if you are building for targets that are compatible with the target you are using for your app (C66 ELF, I think). For example, you could be building your library for COFF targets only, and then when building your app there wouldn't be any compatible library in your package.

    If you still can't find the problem, please post the console output when building your package, and also the console output when building the app. That should give me some further clues about what went wrong.

  • Sasha,

    To be honest, I don't know much about building a custom module.

    Here's what I do :
    I've put my custom folder in XDCtools packages folder.
    Then I do "xdc all"
    A bunch of files is created

    And I've just noticed (I can't explain how I didn't see it before) there is a big warning

    "xdc all
    making package.mak (because of package.bld) ...
    Warning: no config.bld file was found along the package path.
             The config.bld file specifies the location of the
             compiler tool-chains required to compile runtime content.
             Without this file, the XDC tools assume no targets are to be
             used.
    generating interfaces for package octane (because package/package.xdc.inc is old
    er than package.xdc) ...
        translating Timestamp
    all files complete."

    I got confused by the "all files complete".
    Now I get why it can't work in the current state.

    Could you explain to me how can I tell it to build it for ti.targets.elf.C66 and ti.platforms.evm6678 ?

    Thank you
    Clement

  • You need a file config.bld with the following content:
    var elfTargets = xdc.loadPackage('ti.targets.elf');
    elfTargets.C66.rootDir = "<the path to a C6000 compiler, directory above bin>";
    Build.targets = [elfTargets.C66];

    For now, you can leave that file in the base directory of your package, but in general it should be in some place where you could use it for other packages. Here is a link with more info: http://rtsc.eclipse.org/docs-tip/RTSC_Packaging_Primer/Lesson_5#Preparing_config.bld

  • Sasha in the meantime (before I saw your answer) I found a workaround

    In SYS/bios install dir etc folder there is a 'config.bld.default'

    I edited it and configured it for C66.

    Now I get a .ae66 library that I can link in my CCS project and it works.

    Thank you

    Clement

  • For those interested the config.bld file looks like this

    var elfTargets = xdc.loadPackage('ti.targets.elf');
    
    /* Common ccopts suffix used for all C6x targets */
    var c6xSuffix = "-mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 "; 
    
    /* Setup for C66 ELF target */
    elfTargets.C66.rootDir = "D:/.../ccsv5/tools/compiler/c6000_7.4.4";
    elfTargets.C66.ccOpts.suffix += "--embed_inline_assembly " + c6xSuffix;
    elfTargets.C66.platform = "ti.platforms.evm6678";
    
    /* list interested targets in Build.targets array */
    Build.targets = [elfTargets.C66];
  • Sasha,

    I get these two warnings

    warning: ti.sysbios.BIOS: "D:/CoralieDev/ccsv5/bios_6_35_04_50/packages/ti/sysbios/BIOS.xs", line 927: ti.sysbios.BIOS getTimestampFrequency: WARNING: Timestamp provider octane_timestamp.Timestamp does not implement getFreqMeta(). BIOS.getTimestampFrequency() is returning 0!

     

    warning: ti.uia.runtime.UIAMetaData: "D:/CoralieDev/ccsv5/uia_1_03_01_08/packages/ti/uia/runtime/UIAMetaData.xs", line 1462: [object Object] timestampFreq: BIOS could not determine the timestamp frequency of device. Setting timestamp frequency to cpu frequency.To override this setting, set UIAMetaData.timestampFreq in your configuration (.cfg) file.

    I don't get it because I have a file Timestamp.xs with 

    function getFreqMeta()
    {
        return ({lo : (1000/6) * 1000000, hi : 0});
    }

    does it mean that my Timestamp.xs file is ignored ?

    Thanks Clement

  • Clement,
    your getFreqMeta() function is not seen because it's not declared anywhere. That function is not a part of xdc.runtime.ITimestampProvider interface, it is added in ti.sysbios.interfaces.ITimestamp. The easist way to fix that is to have your interface inherit from ti.sysbios.interfaces.ITimestamp. You are already implementing all required functions and you might as well inherit from it.

    The second warning is most likely a consequence of the first, but as I am not familiar with uia, I can't tell for sure. Try fixing the first problem and see what happens.

  • Sasha,

    I agree for the second warning.

    Concerning inheriting from ti.sysbios.interfaces.ITimestamp the thing is when I do

    "xdc all" with "module Timestamp inherits ti.sysbios.interfaces.ITimestamp" in my "Timestamp.xdc" file

    it doesn't know where to find ti.sysbios.interfaces.ITimestamp.
    It means that the path to ...\bios_6_35_04_50\packages is not known.

    I don't know the syntax to tell it where to find \bios_6_35_04_50\packages.

    For now, as a workaround, I duplicated the content of ti.sysbios.interfaces in my working folder.
    A better solution would be welcome.

    It solves the getFreqMeta warning though.

    Clement

  • Your command should be
    xdc XDCPATH=<bios install dir>/bios_6_35_04_50/packages all
    Here is the documentation about the xdc command - http://rtsc.eclipse.org/docs-tip/Command_-_xdc

  • Ok got it, it works.

    I consider this thread closed. 

    Thank you Sasha once again.

    Regards,

    Clement