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.

TMS320C6748: There happens the failure of Vector.push_back.

Part Number: TMS320C6748

Dears:

There happens the failure of Vector.push_back, pls. refer the below picture:

Btw: There will happen the issue using DSP/BIOS, if not using BIOS the program(C++ Add STL) is OK.

compiler: TIC6000 V7.4.4

CPU: TMS320C6748

Tool:CCS5.5

Dsp/bios: 5.4.2

File format: COFF

The begin pointer: 0x00000000

  • Hi,

    Sorry for the delay, this is being looked at.

    Best Regards,
    Yordan

  • Hi Yordan:

    Ok, is there any update, pls. kindly let me know. Since customer is pushing me.

  • Luck Wu,

    DSPBIOS on C6748 is over 8 year old software so there is only limited guidance that we can provide regarding this software. Additionally the TI C6000 compiler used with that version of RTOS CGT 6.x had limited support for C++ STL code on the DSP. HEre is the list of features in C++ support in the 7.4.4 version:

    Can you please help us understand your setup a little better so we can provide guidance. For example vector.push_back doesn`t seem to be part of TI provided software for this device. Is this part of your software stack. You have not indicated what issue occurs when using DSPBIOS. Does the DSP hang or does it go into weeds. We need little more information like build or runtime failure logs to understand what issue occurs with DSPBIOS.

    Regards,

    Rahul

  • Dear Rahul:

    there is something wrong with the vector using with DSP/BIOS,  you can get the detailed infomation from the attachment "vector-use.cpp"

           vector-use.cpp

  • Dear Rahul:

    there is something wrong with the vector using with DSP/BIOS,  you can get the detailed infomation from the attachment "vector-use.cpp"

           1488.vector-use.cpp

  • You have provided the code but have not provided detailed information like build or runtime failure logs to understand what issue occurs with DSPBIOS.

    I am trying to understand if this is a Compiler issue with C++ code or an DSP BIOS issue. If you have any observations when stepping through the code that points to any of these TI provided components then please highlight it so we can narrow down the issue. 

    Regards,

    Rahul

  • Hi Rahul:

    I am not sure whether you have get the file named vector-use.cpp,  if not, pls. let me know.

    line 88 in this file, It is one example to show the using vector without DSP/BIOS,  it works well,

    but in line 136, it is another vector example with DSP/BIOS

    In the function showSomething(line 114)which was called by TaskTest, you can see some code as shown below:

    line 117-121:

        for(int i=0;i<10;i++){
            person.Setage(i);
            person.agegroup_.push_back(person.age_); // standard C++ STL vector, not ok
            personStack.push(i); //personStack is a template defined by myself, result is ok
        }

    agegroup_ is a standard vector member of class person,  it dose not work well in DSP/BIOS,

    the value of agegroup_.capacity() and agegroup_.size() is 0 after the push_back operation, I do not know why?

    but personStack works well whick is a template(stack) defined by myself.

    thanks a lot

    best regards!

  • We have received the vector.cpp file that you posted. I have also looped in my colleagues in the DSPBIOS and compiler team to comment on if they see any issues with missing c++ template based code with DSP BIOS and will get back to you if we can provide additional guidance.

    Regards,

    Rahul

  • Hi Luck Wu,

    I am trying to reproduce your problem, but there are some missing header files from your project that are included by vector.cpp.  Can you please attach the missing files?

    Best regards,

    Janet

  • Hi Janet:

    The attachment file include two projects:

    the name of one project is  CPlusTest, DSP/BIOS is not used

    the name of another porject is CPLUSTest1,  DSP/BIOS is used

    I get the result throuth debug online using SEED-XDS560v2, and the operate enviroment are as shown below:

    compiler: TIC6000 V7.4.4

    CPU: TMS320C6748

    Tool:CCS5.5

    Dsp/bios: 5.4.2

    File format: COFF

    external oscillator  24M

    pll and psc use default value

    Best Regards!

    vector-test-project.rar

  • Hi User,

    Thanks for the project files.  I was able to reproduce the problem, and I think I can get it to work by adding the following lines to your .tcf file:

    /*
     * Enable heaps in IRAM and define label SEG0 for heap usage.
     */
    bios.enableMemoryHeaps(prog);
     
    bios.IRAM.createHeap      = true;
    bios.IRAM.enableHeapLabel = true;
    bios.IRAM["heapLabel"]    = prog.extern("SEG0");
    bios.IRAM.heapSize        = 0x2000;
    bios.MEM.BIOSOBJSEG = prog.get("IRAM");
    bios.MEM.MALLOCSEG = prog.get("IRAM");

    Can you try this and see if it fixes your problem?

    Best regards,

    Janet

  • Hi Janet:

    Thank you very much for the advise,it is helpful to solve the STL problem.

    std::alloc is used in the STL low-level allocation strategy, so we need a heap which size is not zero when using DSP/BIOS.

    thanks again!

    best regards!