Sysprogs forums › Forums › VisualGDB › Slow debug output
Tagged: FastSemihosting
- This topic has 5 replies, 2 voices, and was last updated 7 years, 5 months ago by
support.
-
AuthorPosts
-
May 31, 2018 at 09:02 #21032
Yuriy
ParticipantWe 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!
May 31, 2018 at 19:55 #21035support
KeymasterHi,
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.
June 4, 2018 at 09:30 #21044Yuriy
ParticipantHi,
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.June 5, 2018 at 03:18 #21055support
KeymasterHi,
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.
June 5, 2018 at 08:34 #21056Yuriy
ParticipantHi! I have checked my project with Fast Semihosting version 2.15, it works perfect. Thank you!
June 5, 2018 at 17:12 #21059support
KeymasterHi,
No problem. Let us know if you encounter any further issues and we will be happy to help.
-
AuthorPosts
- You must be logged in to reply to this topic.