printf exception

Sysprogs forums Forums VisualGDB printf exception

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #25332
    ExtSol
    Participant

    Hi,

    So, this issue have both normal semihosting, and fast semihosting framework with its generated led blinking project.

    Issue no.1:

    When i started VisualGDB debugger it asking me to enabled VisualGDB handle the calls and emulating a basic console.

    If i selecting Yes, everithing is working fine.

    If i selecting No, the application throw an exception.

     

    Issue no.2:

    When i compile and select Debug->Start without debugging, the led is not blinking. So the program in the microcontroller, not run. If i comment out the two printf function call, and select again Debug->Start without debugging, the led blinking and everything is working fine.

     

    So if the source contain printf function call, the program in the microcontroller, not run without debugging.

    Have you any idea for this issue?

    • This topic was modified 4 years, 9 months ago by ExtSol.
    Attachments:
    You must be logged in to view attached files.
    #25336
    ExtSol
    Participant

    • This reply was modified 4 years, 9 months ago by ExtSol.
    #25363
    support
    Keymaster

    Hi,

    This is actually by design. Semihosting works by triggering a breakpoint so that the debugger can stop at it and read the data produced by the target. If no debugger is attached (or you configure it to ignore semihosting calls), the breakpoint will be handled by either the regular debugger logic, or the exception handler in the firmware.

    We normally recommend using conditional compilation (#ifdef DEBUG) to remove semihosting-based logging from release builds. If you are using our Advanced Semihosting framework, you can also configure it to suppress the semihosting calls unless a debugger is attached (see the configuration Embedded Frameworks page of VisualGDB Project Properties), however the hardware registers responsible for detecting a debugger are not present on all devices, hence this may not work on some targets.

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