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/CODECOMPOSER: Abort while using std::cout

Part Number: CODECOMPOSER


Tool/software: Code Composer Studio

Hi again,

referring to the issue here I open a new thread. The problem I have here is that the standard cout operation fails in some cases. Again I am unsure about my project settings, so I attached a minimalistic example again. Running this will lead to an abort():

What I basically do is to cast the value of an enum class entry to an int. However, I can see that the content of my enum class variable is quite cryptic again, so this could be related to the previous thread:

Thanks for your support.

std_cout_abort()_EK_TM4C1294XL_TI.zip

  • Hello,

    Have you seen the below article?

    http://processors.wiki.ti.com/index.php/Tips_for_using_printf

    Specifically the sections on the Heap size and the C I/O buffer placement

    Thanks

    ki

  • Hello,
    I haven’t heard back from you, hence this issue is being closed. If you wish to continue the discussion, please post a reply with an update below (or create a new thread).

    Thanks,
    ki

  • Volker Weber said:
    Running this will lead to an abort():

    I have run the program and found two problems:

    1. When initially run ended up in abort() with the following call stack:

    abort() at exit.c:105 0x00017F5A 	
    __vla_alloc(void *)() at vla_alloc.c:255 0x0000CB16 	
    std::__2::num_put<char, std::__2::ostreambuf_iterator<char, std::__2::char_traits<char>>>::do_put(std::__2::ostreambuf_iterator<char, std::__2::char_traits<char>>, std::__2::ios_base &, char, long) const(int, long)() at locale:1,460 0x0000F50C 	
    std::__2::basic_ostream<char, std::__2::char_traits<char>>::operator <<(int)() at locale:1,278 0x0000F25E 	
    main() at bigtime.cpp:80 0x000137E6 	
    _c_int00() at boot.asm:254 0x0001365C  (_c_int00 does not contain frame information)	

    The RTOS Object View (ROV) BIOS -> Scan for errors reported that a Hwi Stack Overrun had occurred.

    In the bigtime.cfg  changed:

        Program.stack = 768;

    To:

        Program.stack = 1024;

    To prevent Hwi Stack Overrun.

    2. The program still ended up in abort() with the following call stack:

    abort() at exit.c:105 0x00017F5A 	
    __vla_alloc(void *)() at vla_alloc.c:255 0x0000CB16 	
    std::__2::num_put<char, std::__2::ostreambuf_iterator<char, std::__2::char_traits<char>>>::do_put(std::__2::ostreambuf_iterator<char, std::__2::char_traits<char>>, std::__2::ios_base &, char, long) const(int, long)() at locale:1,460 0x0000F50C 	
    std::__2::basic_ostream<char, std::__2::char_traits<char>>::operator <<(int)() at locale:1,278 0x0000F25E 	
    main() at bigtime.cpp:80 0x000137E6 	
    _c_int00() at boot.asm:254 0x0001365C  (_c_int00 does not contain frame information)	

    This failure is because there is insufficient heap to allocate the VLA (variable length array) storage pool which requires 3000 bytes.

    In the bigtime.cfg changed:

    BIOS.heapSize = 2048;

    To:

    BIOS.heapSize = 4096;

    The program then ran to completion, reporting the following on the the CIO console:

    Start of application.My favorite song is: 2

    With further changes to the program, the stack and heapSize might need to be increased further.

  • Hello Ki, hello Chester,
    sorry for the late replay, after the holidays I'm back in the office today.
    Both of your ways solved my problem, the information out of the link lead to the results that Chester posted. Thanks for the link and for the detailed example!

    Volker