Debug output stop after some time stops to work

Sysprogs forums Forums VisualGDB Debug output stop after some time stops to work

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #31294
    Rasul
    Participant

    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 2 years, 7 months ago by Rasul.
    Attachments:
    You must be logged in to view attached files.
    #31298
    support
    Keymaster

    Hi,

    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.

    #31299
    Rasul
    Participant

    Could you clarify what is this resource manager?

    Maybe I’m using it but I don’t know that.

    #31300
    support
    Keymaster

    No problem, please see the following page for details: https://visualgdb.com/tutorials/arm/tests/resources/

    #31301
    Rasul
    Participant

    I 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.

     

     

    #31302
    support
    Keymaster

    Thanks 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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.