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.

SYS/BIOS CFG - "Can't find import file"

In ccs4 I found it useful to include a local TCI configuration file in order to setup different conditions for the production code versus units tests

In trying to do the same in ccs5 with SYS/BIOS I have a problem in the editor. In my CFG file I put the line:

utils.importFile("NanoScan2.tci");

After saving the CFG I get this error:

Can't find import file: 'NanoScan2.tci' (not found along 'E:\NanoScan\Firmware\workspace\NanoScan2;C:/ti/xdctools_3_22_04_46/include;C:/ti/xdctools_3_22_04_46/packages') NanoScan2.cfg

I set "config.importPath=" as specified in section 3.4 of "Migrating a DSP/BIOS 5 Application to SYS/BIOS 6" (spraas7e).  The CFG compiles and the task specified in the TCI file is run.

1) Apparently there is a problem in the editor so that it cannot find include files in the same way as the XDC compiler.
2) The list of paths seems strange. The CFG file is a linked file from the production project stored in E:\NanoScan2\Firmware\workspace\NanoScan2.  I don't want it to look in that directory.  I wnat it to in the directory of the current unit test project (E:\NanoScan2\Firmware\workspace\UnitTests).  Each project will have its own TCI file.
3) The previously mentioned section 3.4 states the I should enter "<full path to Tconf include files>".  Hard coded paths will only work on one computer.
    3a) I found where I could use an environment variable.  But this is a workspace not an install directory.  Setting an environment variable to point to a workspace seems odd.
    3b) The XDC compiler looks first in the source file path. Since I want different TCI files in different directories I need to be able to specify directory search order. This problem seems insurmountable.


 

  • Kurt,
    when you say that you are getting an error, and then everything compiles and the task runs, is the difference between those two that you specified config.importPath? That's expected because if you don't specify config.importPath, XDCtools will look into a default path.

    What exactly did you specify in config.importPath?

    As for the absolute paths, the assumption in the document is that your imported files are not in the same project, so you can't rely on the relative path. But, if you want to specify a relative path, you can. Sometimes, it's tricky to figure out what the current working directory is, but in most cases it's one level below the directory of your config script. It's either 'Debug' or 'Release' directory of your project. 

  • Here is my project structure:

    <production code project>
        production.c
        production.cfg

    <unit test project>
        unittest.c
        production.cfg linked to <production code project>
        production.tci

    I put this code in the CFG:

     try
    {
     utils.importFile("production.tci");
    }
    catch(e)
    {
    }

    After I save the CFG, the editor validates it.  At that time I get the error "Can't find import file" in the Problems window.

    The CFG compiles in the unit test project after I set config.importPath to the unit test directory.

    You say, "the assumption in the document is that your imported files are not in the same project".  Why this assumption? Files included in the CFG are not "imported". They can be part of each project. In my case they allow writing unit tests to be much cleaner. I can put in tasks, timers, and other tools to test my production firmware without putting into the main CFG and cluttering up the release code with unnecessary stubs.

  • So, when you set config.importPath for the unit test project to the unit test directory, you can successfully build the project? Is the problem now that config.importPath contains environment variables? You can just use -Dconfig.importPath="../../unit_test".

    As for the order of the directories in the search path, the directory where the CFG script is located always comes first, and then whatever you specified in config.importPath. That is the problem if you have 'production.tci' in your production code project. I don't see it in your project structure, but in case you have it, you'll have to make your production.cfg little bit more complicated. There is a second parameter to utils.importFile, where you can specify a path that is searched first before anything else. But, since you use production.cfg in multiple project, you cannot specify an absolute path there, and you also cannot specify a relative path that resolves to a specific unit test project. You have to make that search path a parameter of the config script. In the same place where you used to specify config.importPath, you can specify
    mySearchPath=<something>
    and then in production.cfg, you write
    utils.importFile("production.tci", environment['mySearchPath']);

    Your search path still has to be relative, but the second parameter passed to utils.importFile is relative a directory in the project you are building, not to the CFG script. In CCS, it is relative to 'Debug/configPkg' in your project, so your search path is as simple as "../..".

    As for my comment about imported files, I think I misread the comment from the document. I read it as if it claimed that you have to use absolute paths, which is not the case.

  • I think I understand the various options now.  Thank you.