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.

CCS/AM5728: CCS does not recognize config.bld file

Part Number: AM5728
Other Parts Discussed in Thread: SYSBIOS,

Tool/software: Code Composer Studio

Hi,

I am working on Sitara DSP C6xx project using SYSBIOS, trying to change memory map via configuration build file (config.bld) I included in the CCSv8 project. Just like in the IPC example C:\ti\ipc_3_47_01_00\examples\DRA7XX_bios_elf\ex02_messageq.

I followed the instructions here:

processors.wiki.ti.com/.../Linux_IPC_on_AM57xx

Tried to merge two project but failed, due to IPC project changes and not being able to work with StdMini library due to failed memory mapping. That is why I need new maping for.

I have created a custom platform based on DRA7XXX, added some aditional memory sections like so:

MEMORY
{

L2SRAM                00800000   00040000  00008000  00038000  RW X
  L1PSRAM               00e00000   00008000  00008000  00000000  RW X
  L1DSRAM               00f00000   00008000  00007720  000008e0  RW  
  OCMC_RAM1             40300000   00080000  00000000  00080000  RW X
  OCMC_RAM2             40400000   00100000  00000000  00100000  RW X
  OCMC_RAM3             40500000   00100000  00000000  00100000  RW X
  EXT_RAM               80000000   00002000  00000000  00002000  RW X
  EXT_RAM_2             90000000   00002000  00000000  00002000  RW X
}

In the RTSC tool, and saved the configuration under name: MyPlatformDevice. I did'nt want to do the rest of it through a tool because I have over 50 required memory sections for my project. So I relied on that I could add the memory map through config.bld file

var SR_0 = {
    name: "SR_0", space: "data", access: "RW",
    base: 0x8E000000, len: 0x1000000,
    comment: "SR#0 Memory (16 MB)"
};

var ExtMemMapDsp1 = {
    EXT_CODE: {
        name: "EXT_CODE",
        base: 0x00004000,
        len:  0x000FC000,
        space: "code",
        access: "RWX"
    },
    EXT_DATA: {
        name: "EXT_DATA",
        base: 0x80000000,
        len:  0x00200000,
        space: "data",
        access: "RW"
    },
    EXT_HEAP: {
        name: "EXT_HEAP",
        base: 0x80200000,
        len:  0x00300000,
        space: "data",
        access: "RW"
    },
    TRACE_BUF: {
        name: "TRACE_BUF",
        base: 0x9F000000,
        len:  0x00060000,
        space: "data",
        access: "RW"
    },
    EXC_DATA: {
        name: "EXC_DATA",
        base: 0x9F060000,
        len:  0x00010000,
        space: "data",
        access: "RW"
    },
    PM_DATA: {
        name: "PM_DATA",
        base: 0x9F070000,
        len:  0x00020000,
        space: "data",
        access: "RWX"  /* should this have execute perm? */
    }
};


Build.platformTable["MyPlatformDevice:dsp1"] = {
    externalMemoryMap: [
        [ "EXT_RAM", {
            name: "EXT_RAM", space: "code/data", access: "RWX",
            base: 0x8C000000, len: 0x1000000,
            comment: "DSP1 Program Memory (16 MB)"
        }],
        [ "SR_0", SR_0 ],
        [ "EXT_CODE", ExtMemMapDsp1.EXT_CODE ],
        [ "EXT_DATA", ExtMemMapDsp1.EXT_DATA ],
        [ "EXT_HEAP", ExtMemMapDsp1.EXT_HEAP ],
        [ "TRACE_BUF", ExtMemMapDsp1.TRACE_BUF ],
        [ "EXC_DATA", ExtMemMapDsp1.EXC_DATA ],
        [ "PM_DATA", ExtMemMapDsp1.PM_DATA ]
    ],
    codeMemory:  "L1PSRAM",
    dataMemory:  "L2SRAM",
    stackMemory: "L1DSRAM",
    l1DMode: "32k",
    l1PMode: "0k",
    l2Mode: "0k"
};

/*
 *  ======== ti.targets.elf.C66 ========
 */
var C66 = xdc.useModule('ti.targets.elf.C66');
C66.ccOpts.suffix += " -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 ";
C66.platform = "MyPlatformDevice:dsp1";
C66.rootDir = java.lang.System.getenv("CGTOOLS_DSP");
Build.targets.$add(C66);

And I am certain that I am using the following platform in targets: (General->Products)

MyPlatformDevice:dsp1

Memory sections does not change for some reason, and corect result would have :

MEMORY
{

"SR_0",                  -> some memory description
"EXT_CODE",     -> some memory description
"EXT_DATA",       -> some memory description
"EXT_HEAP",     -> some memory description
"TRACE_BUF"    -> some memory description
"EXC_DATA",     -> some memory description
"PM_DATA",     -> some memory description
L2SRAM                00800000   00040000  00008000  00038000  RW X
  L1PSRAM               00e00000   00008000  00008000  00000000  RW X
  L1DSRAM               00f00000   00008000  00007720  000008e0  RW  
  OCMC_RAM1             40300000   00080000  00000000  00080000  RW X
  OCMC_RAM2             40400000   00100000  00000000  00100000  RW X
  OCMC_RAM3             40500000   00100000  00000000  00100000  RW X
  EXT_RAM               80000000   00002000  00000000  00002000  RW X
  EXT_RAM_2             90000000   00002000  00000000  00002000  RW X

}

But this is not the case. Also I get overlap of every defined memory sector with the "Default" one !? I don''t know where is this default sector defined. (Searched it on E2E, looks like I have to add more specific sectors, but I can't do that :( )

So what are other valid ways to add memory sections? And why does this not work ? Do linkdef.CMD files work with this generated one ?

Thanks and kind regards,

Nikola

  • The RTOS team have been notified. They will respond here.
  • Hello Nikola,

    You should be able to modify the memory map using just the config.bld.

    Is your config.bld file specified under Project Properties -> Build -> XDCtools -> Advanced Options -> Build configuration file?

    Can you share your custom platform file and map file?
  • Hi,

    yes it is placed under there. And I think it is being built and processed.  It seems to have an effect on Cache configuration, but not the memory map. In the linker file the following three lines change as I change cache setting in the config.bld:

    ti_sysbios_family_c66_Cache_l1dSize = 0;
    ti_sysbios_family_c66_Cache_l1pSize = 0;
    ti_sysbios_family_c66_Cache_l2Size = 0;

    I have packed my generated linkdef.cmd, map file and zipped the platform folder. If you neeed anything else please ask.

    toUpload.zip

    Thank you for your help and kind regards,

    Nikola

  • Hi Nikola,

    Your config.bld and platform file look correct (the config.bld you attached had a different platform name and was commented out but the one in your original post is correct).

    It looks as though it is pulling in the default configuration from somewhere as you mentioned. Are you supplying your own linker.cmd file? XDCtools will generate one automatically so you don't need to supply one yourself. Make sure there isn't one specified under Project Properties -> General -> Linker command file.
  • Hi Sahin,

    linker file is set to none. Maybe the build output will help:


    **** Build of configuration Debug for project C6000 ****

    "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 4 all -O

    making ../src/sysbios/sysbios.ae66 ...
    making ../src/ipc.ae66 ...
    Building file: "../app.cfg"
    gmake[1]: Nothing to be done for 'all'.
    gmake[1]: Nothing to be done for 'all'.
    Invoking: XDCtools
    "C:/ti/xdctools_3_50_05_12_core/xs" --xdcpath="C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;" xdc.tools.configuro -o configPkg -t ti.targets.elf.C66 -p MyPlatformDevice:dsp1 -r debug -b "C:/Users/npetrak/workspace_v8/C6000/configurations/configuration.bld" -c "C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3" --compileOptions "-g" -v "../app.cfg"
    #
    # making package.mak (because of package.bld) ...
    C:/ti/xdctools_3_50_05_12_core/xs -Dxdc.path="C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/xdctools_3_50_05_12_core/packages;.." -Dxdc.root=C:/ti/xdctools_3_50_05_12_core -Dxdc.hostOS=Windows -Dconfig.importPath=".;C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/xdctools_3_50_05_12_core/packages;..;C:/ti/xdctools_3_50_05_12_core;C:/ti/xdctools_3_50_05_12_core/etc" -Dxdc.bld.targets="" -DTOOLS= -f C:/ti/xdctools_3_50_05_12_core/packages/xdc/bld/bld.js ./config.bld package.bld package.mak
    #
    # generating interfaces for package configPkg (because package/package.xdc.inc is older than package.xdc) ...
    C:/ti/xdctools_3_50_05_12_core/xs -Dxdc.path="C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/xdctools_3_50_05_12_core/packages;.." -Dxdc.root=C:/ti/xdctools_3_50_05_12_core -Dxdc.hostOS=Windows -Dconfig.importPath=".;C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/xdctools_3_50_05_12_core/packages;..;C:/ti/xdctools_3_50_05_12_core;C:/ti/xdctools_3_50_05_12_core/etc" -Dxdc.bld.targets="" -DTOOLS= -f xdc/services/intern/cmd/build.xs -m package/package.xdc.dep -i package/package.xdc.inc package.xdc
    #
    # configuring app.xe66 from package/cfg/app_pe66.cfg ...
    C:/ti/xdctools_3_50_05_12_core/xs -Dxdc.path="C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/xdctools_3_50_05_12_core/packages;.." -Dxdc.root=C:/ti/xdctools_3_50_05_12_core -Dxdc.hostOS=Windows -Dconfig.importPath=".;C:/Users/npetrak/myRepository/packages;C:/ti/bios_6_70_01_03/packages;C:/ti/pdk_am57xx_1_0_10/packages;C:/ti/dsplib_c66x_3_4_0_0/packages;C:/ti/ipc_3_47_01_00/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/xdctools_3_50_05_12_core/packages;..;C:/ti/xdctools_3_50_05_12_core;C:/ti/xdctools_3_50_05_12_core/etc" -Dxdc.bld.targets="" -DTOOLS= xdc.cfg app.xe66 package/cfg/app_pe66.cfg package/cfg/app_pe66
    generating custom ti.sysbios library makefile ...
    generating custom ti.sdo.ipc library makefile ...
    Linking with library ti.board:./lib/evmAM572x/c66/release/ti.board.ae66
    Linking with library ti.drv.spi:./lib/c66/release/ti.drv.spi.ae66
    Linking with library ti.drv.i2c:./lib/am572x/c66/release/ti.drv.i2c.ae66
    Linking with library ti.drv.uart:./lib/c66/release/ti.drv.uart.ae66
    Linking with library ti.drv.gpio:./lib/c66/release/ti.drv.gpio.profiling.ae66
    Linking with library ti.utils.profiling:./lib/c66/release/ti.utils.profiling.ae66
    Linking with library ti.csl:./lib/am572x/c66/release/ti.csl.ae66
    Linking with library ti.osal:./lib/tirtos/c66/release/ti.osal.ae66
    Starting build of library sources ...
    making C:/Users/npetrak/workspace_v8/C6000/src/ipc.ae66 ...
    gmake[1]: Entering directory `C:/Users/npetrak/workspace_v8/C6000/src/ipc'
    gmake[1]: Nothing to be done for `all'.
    gmake[1]: Leaving directory `C:/Users/npetrak/workspace_v8/C6000/src/ipc'
    making C:/Users/npetrak/workspace_v8/C6000/src/sysbios/sysbios.ae66 ...
    gmake[1]: Entering directory `C:/Users/npetrak/workspace_v8/C6000/src/sysbios'
    gmake[1]: Nothing to be done for `all'.
    gmake[1]: Leaving directory `C:/Users/npetrak/workspace_v8/C6000/src/sysbios'
    Build of libraries done.
    C:/ti/xdctools_3_50_05_12_core/bin/sed 's"^\"\(package/cfg/app_pe66cfg.cmd\)\""\"C:/Users/npetrak/workspace_v8/C6000/Debug/configPkg/\1\""' package/cfg/app_pe66.xdl > linker.cmd
    C:/ti/xdctools_3_50_05_12_core/bin/setdate -r:max package/cfg/app_pe66.h compiler.opt compiler.opt.defs
    C:/ti/xdctools_3_50_05_12_core/bin/rm -f package/cfg/app_pe66.oe66
    #
    # cle66 package/cfg/app_pe66.c ...
    C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/bin/cl6x -c -g -qq -pdsw225 -mo -mv6600 --abi=eabi -eo.oe66 -ea.se66 -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -D_DEBUG_=1 -Dxdc_cfg__xheader__='"configPkg/package/cfg/app_pe66.h"' -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_debug -Dxdc_bld__vers_1_0_8_2_3 --symdebug:dwarf -I. -IC:/Users/npetrak/myRepository/packages -IC:/ti/bios_6_70_01_03/packages -IC:/ti/pdk_am57xx_1_0_10/packages -IC:/ti/dsplib_c66x_3_4_0_0/packages -IC:/ti/ipc_3_47_01_00/packages -IC:/ti/edma3_lld_2_12_05_30C/packages -IC:/ti/xdctools_3_50_05_12_core/packages -I.. -IC:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/include -fs=./package/cfg -fr=./package/cfg -fc package/cfg/app_pe66.c
    C:/ti/xdctools_3_50_05_12_core/bin/mkdep -a package/cfg/app_pe66.oe66.dep -p package/cfg -s oe66 package/cfg/app_pe66.c -C -g -qq -pdsw225 -mo -mv6600 --abi=eabi -eo.oe66 -ea.se66 -mi10 -mo -pdr -pden -pds=238 -pds=880 -pds1110 -D_DEBUG_=1 -Dxdc_cfg__xheader__='"configPkg/package/cfg/app_pe66.h"' -Dxdc_target_name__=C66 -Dxdc_target_types__=ti/targets/elf/std.h -Dxdc_bld__profile_debug -Dxdc_bld__vers_1_0_8_2_3 --symdebug:dwarf -I. -IC:/Users/npetrak/myRepository/packages -IC:/ti/bios_6_70_01_03/packages -IC:/ti/pdk_am57xx_1_0_10/packages -IC:/ti/dsplib_c66x_3_4_0_0/packages -IC:/ti/ipc_3_47_01_00/packages -IC:/ti/edma3_lld_2_12_05_30C/packages -IC:/ti/xdctools_3_50_05_12_core/packages -I.. -IC:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/include -fs=./package/cfg -fr=./package/cfg
    Finished building: "../app.cfg"

    Building file: "../rsc_table_dsp.c"
    Invoking: C6000 Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/bin/cl6x" -mv6600 --include_path="C:/Users/npetrak/workspace_v8/C6000" --include_path="C:/ti/bios_6_70_01_03/packages/ti/posix/ccs" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/include" --define=am5728 --define=core1 -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="rsc_table_dsp.d_raw" --cmd_file="configPkg/compiler.opt" "../rsc_table_dsp.c"
    Finished building: "../rsc_table_dsp.c"

    Building file: "../main.c"
    Invoking: C6000 Compiler
    "C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/bin/cl6x" -mv6600 --include_path="C:/Users/npetrak/workspace_v8/C6000" --include_path="C:/ti/bios_6_70_01_03/packages/ti/posix/ccs" --include_path="C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/include" --define=am5728 --define=core1 -g --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="main.d_raw" --cmd_file="configPkg/compiler.opt" "../main.c"
    Finished building: "../main.c"

    1 file(s) copied.
    making ../src/sysbios/sysbios.ae66 ...
    making ../src/ipc.ae66 ...
    gmake[2]: Nothing to be done for 'all'.
    gmake[2]: Nothing to be done for 'all'.
    Building target: "C6000.out"
    Invoking: C6000 Linker
    "C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/bin/cl6x" -mv6600 --define=am5728 --define=core1 -g --diag_warning=225 --diag_wrap=off --display_error_number -z -m"C6000.map" --heap_size=0x800 --stack_size=0x800 -i"C:/Users/npetrak/workspace_v8/C6000/includes" -i"C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/lib" -i"C:/ti/ccsv8/tools/compiler/ti-cgt-c6000_8.2.3/include" --reread_libs --define=CORE1=1 --diag_wrap=off --display_error_number --verbose_diagnostics --warn_sections --xml_link_info="C6000_linkInfo.xml" --rom_model -o "C6000.out" "./main.obj" "./rsc_table_dsp.obj" -l"configPkg/linker.cmd" -llibc.a
    <Linking>
    "configPkg/linker.cmd", line 229: warning #10096-D: specified address lies outside memory map
    .resource_table: load > 0x3000, type = NOINIT
    error #10264: DEFAULT memory range overlaps existing memory range L2SRAM
    error #10264: DEFAULT memory range overlaps existing memory range OCMC_RAM1
    error #10264: DEFAULT memory range overlaps existing memory range OCMC_RAM2
    error #10264: DEFAULT memory range overlaps existing memory range OCMC_RAM3
    error #10264: DEFAULT memory range overlaps existing memory range EXT_RAM
    error #10010: errors encountered during linking; "C6000.out" not built

    >> Compilation failure
    makefile:141: recipe for target 'C6000.out' failed
    gmake[1]: *** [C6000.out] Error 1
    makefile:137: recipe for target 'all' failed
    gmake: *** [all] Error 2

    **** Build Finished ****

    As you can see the -b is set there. But it doesn't show that is changing memory anywhere in the output linker file. Except for unknown reasons it puts the DEFAULT memory range. (This went away couple of builds ago when I set up the .vecs and .resetVecs sections, but its here again now...) :(

    Kind regards,
    Nikola
  • Hi,

    I have a new advancement. Memory sections are added succesfuly if I use the default platform ti.platforms.evmAM572X:dsp1. But if I use one that I create with following video:

    rtsc.eclipse.org/.../Demo_of_the_RTSC_Platform_Wizard_in_CCSv4

     then this does not happen. Question now is how to make a custom platform and keep the memory placing capability? Is this a BUG in RTSC tool ? I have noticed that when using custom platform the Platform.xs file is almost empty containing some function calls, but when using the default platform ti.platforms.evmAM572X, the Platform.xs contains a lot more code, for example:

     ti.platforms.evmAM572X, the Platform.xs
    
    function getExeContext(prog)
    
    {
    
       var ExeContext = xdc.useModule('xdc.platform.ExeContext');
    
       /* create a default ExeContext execution context */
    
       var cpu;
    
       var core = this.$private.core;
    
       xdc.loadPackage(this.$module[core].catalogName);
    
       cpu = ExeContext.create(this.$module[core], this.$module.BOARD);
    
       cpu.memoryMap = Utils.assembleMemoryMap(cpu, this);
    
       if (this.codeMemory == undefined) {
    
           this.codeMemory = "EXT_RAM";
    
       }
    
       if (this.dataMemory == undefined) {
    
           this.dataMemory = "EXT_RAM";
    
       }
    
       if (this.stackMemory == undefined) {
    
           this.stackMemory = "EXT_RAM";
    
       }
    
       // check for the overlap in the memory map
    
       var overlap = Utils.checkOverlap(cpu.memoryMap);
    
       if (overlap != null) {
    
           this.$module.$logError("Memory objects " + overlap + " overlap", this,
    
               overlap);
    
       }
    
       this.$seal();
    
       return (cpu);
    
    }
    MyPlatformDevice, the Platform.xs:
    
    function getExeContext(prog)
    
    {
    
      return this.$module.CPU.getExeContext(prog);
    
    }

  • Nikola,
    the platform 'ti.platforms.evmAM572X' is developed manually and it supports parameters such as 'DSP1', 'DSP2' and others, as well as memory map additions from config.bld. That's what happens in the function you copied - getExeContext().
    The platforms generated by the Platform Wizard are much simpler and do not support parameters, and the memory map you get is exactly what you specify in the Platform Wizard GUI.

    The problem with DEFAULT memory segment most likely comes from the allocation of the section .resource_table to 0x3000, which is an address outside of memory segments defined in the linker command file. As a result, the linker pulls in the memory segment DEFAULT which overlaps already defined memory segments.

    The easiest way out is to define the complete memory map in the Platform Wizard, and then verify that 0x3000 is in one of the defined memory segments, or specify a different address for it. I am not sure what .resource_table is, but there must be some place in app.cfg or in one of the included scripts, where its allocation is defined.

  • Thank you Saša for your answer,

    I am currently using the default ti.platforms.evmAM572X platform. Is there a way to copy (extract) the platform files to a speciffic folder and edit it if necesary?

    Thanks and kind regards,

    Nikola

  • You can create your own repository, let's say C:/myPkgs and copy the platform into directory myAM572X. You'll have to replace all references to ti.platforms.evmAM572X with myAM572X. I am out of office for a while so I can't tell where references are but you have to change at least package.xdc. Once you do that, and make the changes you need, you have to run the command 'xdc' in your new directory to have the changes applied. Then, add C:/myPkgs to your package path, and use myAM572X as your platform.