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.

Create a xdc.bld.iTarget extension

Other Parts Discussed in Thread: SYSBIOS

I'm trying to create a new target as an extension of ti.targets.arm.elf.A8Fnv, as indicated in the guide http://rtsc.eclipse.org/docs-tip/Creating_Targets#Inheriting_from_an_Existing_Target. I'd like to use the same rts library of  ti.targets.arm.elf.A8Fnv, but adding in the target's package a new hardware abstraction library of my own, that should be linked mandatory from all the users willing to create an executable based on my new target. It would be nice also to add in the target's package both the pre-complied library and its sources.

Is it possible? Which is the best way to to this? Is there an example?

Thank you

Best regards

  • If you follow the steps from the linked guide, you'll end up with two new packages. The first one contains the actual target's XDC file. The second one contains the libraries required by your target, and the target's XDC file points to that second package using the line:
    override readonly config string rts = "local.targets.rts";
    The files that you must have in that package are described in http://rtsc.eclipse.org/docs-tip/Creating_Targets#ProvideRTSPackage. Once you create that package, the only library delivered by that package will be a copy of the same library delivered by ti.targets.arm.elf.A8Fnv. To add another pre-compiled library, you'll have to have a file package.xs in your rts package and the function getLibs() in it. Here is a simplified version of that function from 'ti.targets.arm.rtsarm':
    function getLibs(prog) {
        var libs = ;
        var libs = "lib/" + this.$name + ".a" + prog.build.target.suffix + ";"
            + "lib/boot.a" + prog.build.target.suffix + ";lib/auto_init.a"
            + prog.build.target.suffix;

        return (libs);
    }
    This function returns the standard XDCtools runtime support. If you want to add one more pre-compiled library, copy it somewhere in the rts package subdirectory. Let's say you have a subdirectory mylibs and the library mtLib.lib in it. Your getLibs() function would look very much the same as above except that the last line would change into:
        return (libs + ";mylibs/myLib.lib");
    You can also build your library from the sources in thsi package, but let's make this first step working properly and when you have that, we can move to building from sources.

     

  • Hi Sasha,

    I followed your instructions and now I'm trying to build an application based on my new Platform and target, but I get the error showed in the log 8345.buildLog.txt file.

    Of course BIOS cannot support my target, since SystemElectronics.targets.CPU2E000100 cannot be a known target to the BIOS itself. Probably I misunderstood something in your reply.

    Thank you

    Best regards

  • Francesco,
    I haven't really considered SYS/BIOS support in my first message so you haven't misunderstood anything. The next step would be to make changes in SYS/BIOS to recognize your target as compatible with ti.targets.arm.elf.A8Fnv. SYS/BIOS is delivered with all sources, so you can change it and rebuild it. To overcome the current error, you can add the following line to ti/sysbios/family/Settings.xs, right after the line 59:
    "ti.targets.arm.elf.A8Fnv" : "arm", // line 59
    "SystemElectronics.targets.CPU2E000100" : "arm",  // new line
    There are probably a couple of other places where you would have to make a change. Also, I need to mention that adding support for a new target, which is the same as a supported one, is not normally done or tested.

    However, after reading again your initial post I would like to ask is the addition of one library the only difference between A8Fnv target and your target? It's possible that we can avoid adding a new target. What do you deliver to your customers, a RTSC target package or some other kind of package? Do they just choose your target in config.bld or in CCS, or there is something in the config script that your customers need to do?

  • Sasha,

    the only thing that my customer as to do is to link his executable against my library. The simplest way to do this is to copy my library and sources in a directory and to add, from the CCS, the option -lmyLib to the build options of the execubale.

    Nevertheless I thought it could be a pretty thing to give to my customer my library in the form of a RTSC package, so that he had only to select my target in the executable. But I guess that this approach is growing up a little bit complex; since it is not necessary I can give up. What do you think about?

    Regards

  • Perhaps it is possible to give to my library the form of a RTSC package, without involving a new target...

  • I think that creating a new target just to add one library is too much unnecessary work. The easiest way to accomplish the addition of the library is to create a new package, let's call it systemelectronics.libPkg, and instruct the user to add the following to a config script:
    xdc.loadPackage("systemelectronics.libPkg");
    The package can either build the library or simply deliver it. If the library is already built, getLibs() function in package.xs would be simple:
    function getLibs(prog) {
        return ("myLibs/myLib.lib");
    }

    If you build the library from the sources, then you don't need getLibs. The default version of it would work for you. But your package.bld would be now:
    for (var i = 0; i < Build.targets.length; i++) {
        var targ = Build.targets[i];

        var lib = Pkg.addLibrary('lib/' + Pkg.name, targ);
        lib.addObjects(Pkg.modules);
    }

    You probably want to build only for the A8Fnv target.