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/TMS320F2812: Converting from cdb to tcf

Part Number: TMS320F2812


Tool/software: Code Composer Studio

Hello

I am converting a CC3.1 project to CC6.2. I have used the cdb2tcf.exe tool to convert my cdb file.

I am compiling for the TMSC320F2812.

The build doesn't work as expected and I'm wondering if something went wrong during conversion. Mostly I am simply unsure what to expect from my tcf file. The cdb file contains almost 12000 lines, while the tcf file has fewer than 200. Does the tcf file cover everything the cdb file does?

Also the the tcf files uses memory names such as L0SARAM and M0SARAM. According to https://www.ti.com/lit/ug/spru007i/spru007i.pdf, old memory names can be used as long as

environment["ti.bios.oldMemoryNames"] = true;

is set, which it is. However, L0SARAM and M0SARAM do not appear on the list of 2812 names (and there isn't even a list of old memory names for this device), only LSARAM and MSARAM - would they still be okay to use?

Thanks in advance

  • Hi,

    I would import a TMSC320F2812 DSP/BIOS example from your 5.x product. Compare that .tcf to the .tcf that was generated by the conversion. Then adjust as needed. 

    Todd

  • Hello Todd

    After comparing i tried changing the old memory names to match the examples (L0SARAM->LSARAM, M0SARAM->MSARAM), but it does not appear to do much. Most of my remaining tcf file seems too different from the examples for them to help much. Are there more complex examples available somewhere?

    I'm assuming the problem is the configuration files, since the code hasn't been changed. But are there other common problems? I have used the same compiler and linker options, but are there perhaps CC3.1 default options that are no longer default in CC6.2 and thus won't be included in my new project?

    I have attached my cdb and tcf files in case I can convince you to take a quick look at them.

    Thanks for your assistance.

    4375.f2812.cdb.log

    environment["ti.bios.oldMemoryNames"] = true;
    
    /* loading the generic platform */
    var params = {};
    params.clockRate = 150;
    params.deviceName = "2812";
    params.catalogName = "ti.catalog.c2800";
    params.regs = {};
    params.regs.pllcr = 0xa;
    utils.loadPlatform("ti.platforms.generic", params);
    
    
    /* enabling DSP/BIOS components */
    bios.GBL.ENABLEINST = true;
    bios.MEM.NOMEMORYHEAPS = false;
    bios.RTDX.ENABLERTDX = true;
    bios.HST.HOSTLINKTYPE = "RTDX";
    bios.TSK.ENABLETSK = true;
    bios.GBL.ENABLEALLTRC = true;
    
    bios.M0SARAM.createHeap = true;
    bios.M0SARAM.heapSize = 0x0200;
    
    bios.L0SARAM.createHeap = true;
    bios.L0SARAM.heapSize = 0x0200;
    
    bios.MEM.BIOSOBJSEG = prog.get("L0SARAM");
    bios.MEM.MALLOCSEG = prog.get("L0SARAM");
    bios.TSK.STACKSEG = prog.get("L0SARAM");
    
    
    /* applying user changes */
    bios.FPGA_MEM = bios.MEM.create("FPGA_MEM");
    
    bios.FPGA_MEM.base = 0x2000;
    
    bios.FPGA_MEM.len = 0x100;
    
    bios.FPGA_MEM.createHeap = 0;
    
    bios.ZONE6_code = bios.MEM.create("ZONE6_code");
    
    bios.ZONE6_code.base = 0x100100;
    
    bios.ZONE6_code.len = 0x7ff00;
    
    bios.ZONE6_code.createHeap = 0;
    
    bios.ZONE6_code.space = "code";
    
    bios.BOOTMEM = bios.MEM.create("BOOTMEM");
    
    bios.BOOTMEM.base = 0x100000;
    
    bios.BOOTMEM.len = 0x100;
    
    bios.BOOTMEM.createHeap = 0;
    
    bios.BOOTMEM.space = "code";
    
    bios.PRD0_10ms = bios.PRD.create("PRD0_10ms");
    
    bios.PRD5_1ms = bios.PRD.create("PRD5_1ms");
    
    bios.SWI2_LowSpeedTx = bios.SWI.create("SWI2_LowSpeedTx");
    
    bios.SWI_Exchange_SPI_data2 = bios.SWI.create("SWI_Exchange_SPI_data2");
    
    bios.SWI_Rx_LS_Data = bios.SWI.create("SWI_Rx_LS_Data");
    
    bios.SWI6_UpdateContactorFeedBack = bios.SWI.create("SWI6_UpdateContactorFeedBack");
    
    bios.TSK0 = bios.TSK.create("TSK0");
    
    bios.GI_RI_log = bios.LOG.create("GI_RI_log");
    
    bios.QUE_SPI_Exchange = bios.QUE.create("QUE_SPI_Exchange");
    
    bios.MEM.BIOSSEG = prog.get("ZONE6_code");
    
    bios.MEM.STACKSIZE = 0x300;
    
    bios.MEM.ENABLELOADADDR = 1;
    
    bios.MEM.LOADBIOSSEG = prog.get("ZONE6_code");
    
    bios.MEM.SYSINITSEG = prog.get("ZONE6_code");
    
    bios.MEM.LOADSYSINITSEG = prog.get("ZONE6_code");
    
    bios.MEM.CINITSEG = prog.get("ZONE6_code");
    
    bios.MEM.LOADCINITSEG = prog.get("ZONE6_code");
    
    bios.MEM.ECONSTSEG = prog.get("H0SARAM");
    
    bios.MEM.CONSTSEG = prog.get("H0SARAM");
    
    bios.MEM.LOADCONSTSEG = prog.get("H0SARAM");
    
    bios.MEM.LOADHWIVECSEG = prog.get("ZONE6_code");
    
    bios.PRD0_10ms.period = 0xa;
    
    bios.PRD0_10ms.fxn = prog.extern("PRD_10ms");
    
    bios.PRD0_10ms.order = 1;
    
    bios.PRD5_1ms.period = 1;
    
    bios.PRD5_1ms.fxn = prog.extern("PRD_1ms");
    
    bios.PRD5_1ms.order = 0x2;
    
    bios.TSK0.fxn = prog.extern("SPITask");
    
    bios.TSK0.stackSize = 0x80;
    
    bios.TSK0.stackMemSeg = prog.get("M0SARAM");
    
    bios.TSK0.priority = 0x7;
    
    bios.LNK_dataPump.order = 1;
    
    bios.RTA_dispatcher.order = 0x2;
    
    bios.IDL_cpuLoad.order = 0x3;
    
    bios.GI_RI_log.comment = "For at kunne se om programmet k�rer uden at skulle stoppe det!";
    
    bios.GI_RI_log.bufSeg = prog.get("L0SARAM");
    
    bios.QUE.OBJMEMSEG = prog.get("M0SARAM");
    
    bios.QUE_SPI_Exchange.comment = "SPI";
    
    bios.PIE_INT1_4.fxn = prog.extern("XINT1_ISR");
    
    bios.PIE_INT1_4.useDispatcher = 1;
    
    bios.PIE_INT1_5.fxn = prog.extern("XINT2_ISR");
    
    bios.PIE_INT1_5.useDispatcher = 1;
    
    bios.PIE_INT1_6.fxn = prog.extern("ADCINT_ISR");
    
    bios.PIE_INT1_6.useDispatcher = 1;
    
    bios.PIE_INT2_4.fxn = prog.extern("T1PINT_ISR");
    
    bios.PIE_INT2_6.fxn = prog.extern("T1UFINT_ISR");
    
    bios.PIE_INT5_5.fxn = prog.extern("CaptureFreq_ISR");
    
    bios.PRD_clock.order = 1;
    
    bios.RTDX.BUFSIZE = 0x400;
    
    bios.HWI_INT13.fxn = prog.extern("XINT13_ISR");
    
    bios.HWI_INT13.useDispatcher = 1;
    
    bios.SWI2_LowSpeedTx.fxn = prog.extern("Tx_LS_Data");
    
    bios.SWI2_LowSpeedTx.priority = 0x2;
    
    bios.SWI_Exchange_SPI_data2.comment = "<exchange data with SPI devices>";
    
    bios.SWI_Exchange_SPI_data2.fxn = prog.extern("Exchange_SPI_data");
    
    bios.SWI_Exchange_SPI_data2.priority = 0x4;
    
    bios.SWI_Rx_LS_Data.comment = "<Reading LS data from FIFO and calling StateMAchine>";
    
    bios.SWI_Rx_LS_Data.fxn = prog.extern("Rx_LS_Data");
    
    bios.SWI_Rx_LS_Data.priority = 0x3;
    
    bios.SWI6_UpdateContactorFeedBack.fxn = prog.extern("UpdateContactorFeedBackTick1ms");
    
    bios.SWI6_UpdateContactorFeedBack.priority = 0x4;
    
    // !GRAPHICAL_CONFIG_TOOL_SCRIPT_INSERT_POINT!
    
    if (config.hasReportedError == false) {
        prog.gen();
    }
    

  • I'd recommend you look at the settings in the cdb via the graphical interface. Then start making the same setting on a .tcf  from an DSP/BIOS example for your device. So basically have both open side by side and replicate the values from the old cdb. You'll need to step through every setting.

    Todd

  • Hello Todd

    Good idea. So far I have compared the configuration files in the graphical interface and found some small differences, which I have tried to correct. However it doesn't seem to have changed anything. The one that is left over is the DIO - class driver which appears in the tcf configuration, but not in the cdb. It is in the cdb file though, so maybe that is just what gconf chooses to display.

    Then what I tried was compiling the project in CCS6.2 using the 4.1.0 compiler from CCS3.1. This works and the program runs as it's supposed to. The program builds using the same tcf file as the 20.2.2 compiler and the generated cdb files are identical apart from a timestamp, leading me to believe that the tcf file maybe isn't the problem after all. When compiling with the 20.2.2 compiler I get the warning 'Data is being written to auto-generated file f2812.i10' - I am converting to intel hex format. So my working theory is that this data being written in the wrong file causes the program to malfunction.

    This does not happen with the 4.1.0 compiler. From what I can gather this usually occurs when initialized data is written to page 1 and this should be determined by the tcf file and the linker. I am using DSP281x_Headers_BIOS.cmd file, which is standard from TI and a boot.cmd file, which contains the following:

    SECTIONS {

    .boot:   {} > BOOTMEM

    }

    For the 4.1.0 compiler, .boot is listed in the map file and when translating to hex:

    Translating f2812.out to Intel format...

       "f2812.out"   ==> .boot

       "f2812.out"   ==> .bios

       "f2812.out"   ==> .cinit

       "f2812.out"   ==> .sysinit

    etc.

    For the 20.2.2 compiler, .boot is not translated.

    This is also evident in the map file where .boot appears in BOOTMEM for 4.1.0 but not 20.2.2. According to the build console though, the boot.cmd file is used when linking with either compiler.

    I assume this is connected with the warning mentioned earlier. Any idea what exactly is going wrong and how to fix this?

  • I recommend you stay with the older compiler. We have not validated DSP/BIOS against any of the newer compilers.

    Todd