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.

Add pragmas in auto-generated XDC C code via configuration (cfg) file

Other Parts Discussed in Thread: SYSBIOS

We need to move different symbols (data structures) from the auto-generated app_pe674.oe674 in XDC to different memory sections. Since the DATA_SECTION pragmas are not created automatically, this is not possible.

Is there a way to add pragmas via cfg file in SySBIOS?

  • In order to add pragmas to the generated C file so the module state data structures can be placed in their own section, you can make use of module template files. This would basically require creating a new package that contains a dummy module with a C template file. This C template file will contain all the C pragmas.

    I created a package called “genC” which has a module called “GeneratedC”. I have attached this package to this email. Since I have already built this package, you don’t have to build it. All you need to do is useModule it in your app’s *.cfg file. The package needs to be placed at the root of the package path i.e. you can either place it @ C:\ti\bios_6_xx_yy_zz\packages or if you are building using CCS, you can copy in the project folder itself. The genC/ directory has a C template file called “GeneratedC.xdt”. You can edit this file and add any pragma you need to place the module state.

    App.cfg:
    
    xdc.useModule(‘genC.GeneratedC’);
    

    I have also attached a CCS v6.0.190 example project that has a copy of this “genC” package in the project folder. In case you create your own project, you can go to the project properties and update the package repositories (package path) so the new “genC” package is in the package path:

    CCS Example project: 8081.clock_66AK2H12_C66XX.zip

    genC package: 7840.genC.zip

    Best,

    Ashish