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/TMDXIDK57X-LCD: Can't view numbers in std::vector container!

Part Number: TMDXIDK57X-LCD

Tool/software: Code Composer Studio

Hi

I have included vector library to my c++ code. It compiles successfully but doesn't print the value of vector elements in the console!

I'm using Linaro compiler. The printf function works true when I print a string or a const number but doesn't print a vector element, say v[i].

What should I do?

  • user5927485 said:
    The printf function works true when I print a string or a const number but doesn't print a vector element, say v[i].

    I would expect printing a vector element to work in a similar way as strings or numbers. The first thing we usually suggest checking for when working with things like printf is to ensure that there is sufficient heap and stack allocated. Could you try increasing their sizes and see if that helps? 

    http://software-dl.ti.com/ccs/esd/documents/sdto_cgt_tips_for_using_printf.html

  • Thanks for the answer

    I had previously increased the stack and heap for the printf(), to work for string and numbers but, increasing more, didn't resolved the printf() for vector elements!

    How much can I increase the heap and stack? How should I find the maximum available values for both? Because when I set them to big values and hit the debug button, CCS doesn't finish its job and the run button is inactive!

    Also, I was not able to use fopen() to open a .txt file. Do you think this is also because of heap and stack?
  • user5927485 said:
    How should I find the maximum available values for both?

    There really isn't a static way to determine heap usage.  It can only be determined at run time. You would need to experiment a bit by increasing the heap a good bit and then once the program works as expected, reduce it back down (to the point where program still works) if there are memory constraints.

    user5927485 said:
    Also, I was not able to use fopen() to open a .txt file. Do you think this is also because of heap and stack?

    Yes it could be.