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.

printf is very slow

Hello,

I inserted 'printf' to my routine for debugging. 

I thought printf to console would be fast, but it took about 20ms to print 5 characters(three numbers and '\n\r).

My environment is ccs6 and xds560v2. Three DSPs are connected to one emulator and just one DSP is printing. I attach connection properties.

I don't think this is DSP's problem because the execution time of the routine is improved pretty much if I remove 'printf'. 

The board I am developing is timing critical so I need a fast printf.

Please let me know any clue.

  • Hello,

    Yes, standard printf is very slow, adds to code size and is also intrusive (will halt the target to send out printf messages). Hence it is not recommended in environments that are time citical.

    Are you using SYS/BIOS? There is something called System_printf() which addresses all of the issues above. If you are using SYS/BIOS, I suggest you try using that.

    Thanks

    ki

  • I am not using SYS/BIOS now. Is there no way to print any debug message?

    Anyway, I will check SYS/BIOS later.

    Thank you for fast answer.