Sysprogs forums › Forums › VisualGDB › Debug output stop after some time stops to work
Tagged: Embedded semihosting debug
- This topic has 5 replies, 2 voices, and was last updated 3 years, 2 months ago by support.
-
AuthorPosts
-
September 9, 2021 at 09:18 #31294RasulParticipant
Hi!
I have used guide for debug semihosting as described here https://visualgdb.com/tutorials/arm/semihosting/
And everything worked fine until I got infinite loop in WriteRawFastSemihostingData function.
Then I disabled blocking mode in stetting and now printf() after some time just stops to work.
Sometimes I get error “the runnig embedded project has initiated a blocking semihosting call without properly initializing the advanced smhosting state (9574).”.
Increasing buffer does not give any effect.
- This topic was modified 3 years, 2 months ago by Rasul.
Attachments:
You must be logged in to view attached files.September 9, 2021 at 09:25 #31298supportKeymasterHi,
This likely indicates a memory corruption. This error means that the most significant bit of the s_FastSemihostingState.WriteOffset variable (0x80000000) is set, which is a special value reserved for the resource manager API. If you are not using the resource manager, something likely overwrites WriteOffset with an invalid value.
Memory corruption problems could be tough to pinpoint. The easiest way to handle it would be to revert to the last version that worked via your source control (or re-create the project from scratch, if it is trivial). You can also try setting a breakpoint in WriteRawFastSemihostingData() and observing how it changes s_FastSemihostingState.WriteOffset (it’s a simple ring buffer that is written by the firmware and read by VisualGDB), although it could take some time to find the root cause this way.
September 9, 2021 at 11:50 #31299RasulParticipantCould you clarify what is this resource manager?
Maybe I’m using it but I don’t know that.
September 9, 2021 at 12:20 #31300supportKeymasterNo problem, please see the following page for details: https://visualgdb.com/tutorials/arm/tests/resources/
September 9, 2021 at 12:41 #31301RasulParticipantI worked with this problem little bit.
I made a new clean project with only one printf() function in loop along with 1 ms delay between and found I still getting this overflow state. No error masseges however. I was ready to report it to you but after new reflash problem suddenly dissapeared.
Now I wrote my last firmware with a problem again and now it works without any issues also. I really don’t know what was that. I worked much more then 8 hours today and maybe I made some stupid mistakes but also maybe it somehow related to things I have done.
Anyway. Thank you for your time. I’ll report you in case I’ll get clue or additional useful info.
September 10, 2021 at 18:27 #31302supportKeymasterThanks for letting us know. Intermittent problems like this one are often caused by unstable clocks, power issues, or wiring. In case you encounter it again, please try using a different board.
-
AuthorPosts
- You must be logged in to reply to this topic.