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/XEVMK2LX: Hello example runs on ARM15 core, but does not print to CCS7 console

Part Number: XEVMK2LX

Tool/software: Code Composer Studio

Hi,

we are using CCS7.1.0 and ti-processor-sdk-rtos-k2l-evm-03.03.00.04 on Ubuntu 16.04 with a xds560 Blackhawk USB JTAG. Whereas the hello example works fine on the C66XX DSP cores, on the ARM15 cores the example runs but does not produce any output in the console.

The same applies to all other examples that should write to standard out.

What are we doing wrong? It would be great if you guys had some ideas.. I also posted this question to the Keystone multicore forum.

Cheers

Dorothea

  • Hello Dorothea,
    There are a lot of considerations to be aware of when using printf in an embedded system. The below wiki article covers many of the common ones:
    processors.wiki.ti.com/.../Tips_for_using_printf

    Please let me know if this helps

    Thanks
    ki
  • Dorothea Pfeiffer said:
    we are using CCS7.1.0 and ti-processor-sdk-rtos-k2l-evm-03.03.00.04 on Ubuntu 16.04 with a xds560 Blackhawk USB JTAG. Whereas the hello example works fine on the C66XX DSP cores, on the ARM15 cores the example runs but does not produce any output in the console.

    The SYS/BIOS programs for the Cortex-A15 are compiled using the GNU ARM compiler, which uses Semi-Hosting to produce output in the CCS CIO console.

    The SYS/BIOS "Hello" Cortex-A15 examples for the GNU compiler produce no output in the CCS CIO console, as those examples don't have Semi-Hosting support enabled.

    Whereas the SYS/BIOS "Semi-Hosting" Cortex-A15 examples for the GNU compiler should produce output in thee CCS CIO console, as those examples have Semi-Hosting support enabled.

    See also How do I enable Semi-Hosting for Cortex-A GNU targets ? from the SYS/BIOS with GCC Wiki entry.

  • Thanks a lot, Ki-Soo and Chester! Ki-Soo's link gave very useful information, and the adding of the semi-hosting did the trick. Just one thing that left me puzzled: I modified the hello example to have two outputs:
    printf("hello!\n");
    System_printf("hello!\n");

    Both statements write as expected "hello!", but printf() does it directly after the statement, whereas the System_printf() output only appears at the end of the main() function. Why is that so?

    Cheers

    Dorothea
  • Dorothea Pfeiffer said:
    Both statements write as expected "hello!", but printf() does it directly after the statement, whereas the System_printf() output only appears at the end of the main() function. Why is that so?

    System_printf() stores its output in a buffer, and the buffer is flushed by calling System_flush

    System_flush is called at some times, e.g. when BIOS_exit() is called. What do have at the end the main() function?

    You can also call System_flush() when required to flush the output buffer.

  • Now I understand, thanks a lot! At the end of the main was a BIOS_exit(), hence the flushing.

    Cheers

    Dorothea