Slow debug output

Sysprogs forums Forums VisualGDB Slow debug output

This topic contains 5 replies, has 2 voices, and was last updated by  support 2 weeks, 4 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #21032

    Yuriy
    Participant

    We redirected printf() to FastSemihosting, but it works too slow. Measured timings intreased significantly after using printf() over FastSemihosting.

    With Keil we had no problem with printf(). As I know, Keil used hardware debug line to print to debug console. Is it possible to decrease delays when using printf() in VisualGDB?

    Thakns!

    #21035

    support
    Keymaster

    Hi,

    No problem, we can help you nail it down. First of all, what exact timings do you mean and how do you measure them?

    Second of all, could you confirm that the WriteToFastSemihostingChannel() function is invoked when you call printf()? If yes, does calling it explicitly instead of printf() also result in slow operation?

    Finally, do you get the same behavior if you throttle the printf() output (e.g. sleep for 100 msec between each call)? If not, the fast semihosting buffer might be overflowing and delaying the CPU until VisualGDB reads its contents. If this is the case, please ensure you are not using USB virtualization as it significantly reduces the semihosting performance.

    #21044

    Yuriy
    Participant

    Hi,

    I measured time from request to response using external tools (oscilloscope). Response time increased when printf() to debug output is used.

    Problem was in insufficient buffer space. There are no delays when output data fits into semihosting buffer. So first problem solved.

    Second problem is in FastSemihosting option “When out of buffer space: Discard further data”.

    I expected that data will be discarded, and no delays will occurs. But delays increased, and no output was discarded. What I do wrong?

    Test project attached: buffer size 32 bytes, we write to semihosting directly 10 times by 1000 bytes.

    Call stack: _write() –> WriteToFastSemihostingChannel() –> WriteRawFastSemihostingData() –> return 0;

    Although we returned 0 from WriteRawFastSemihostingData(), function WriteToFastSemihostingChannel() can’t exit from loop untill data sent.

    Thank you for your support!

    Attachments:
    You must be logged in to view attached files.
    #21055

    support
    Keymaster

    Hi,

    No problem, the non-blocking mode behavior looks like our bug. We have fixed it and updated the semihosting framework.

    Please install the latest version via VisualGDB Package Manager.

    #21056

    Yuriy
    Participant

    Hi! I have checked my project with Fast Semihosting version 2.15, it works perfect. Thank you!

    #21059

    support
    Keymaster

    Hi,

    No problem. Let us know if you encounter any further issues and we will be happy to help.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.