SemiHosting on Debug only

Sysprogs forums Forums VisualGDB SemiHosting on Debug only

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23073
    Johanan
    Participant

    Hi,

    In order to use semi-hosting I need to use the default C lib, and to enable semi hosting.

    Is there a way to make this selection only when Debug is built? so in the release I will use nano lib and no semi-hosting.

    In the code I use #ifdef DEBUG like

    #ifdef DEBUG
    printf(“Starting ABC Task\n”);
    #endif

    Thanks

    #23082
    support
    Keymaster

    Hi,

    Yes, please try disabling the “Redirect printf() to semihosting” flag via VisualGDB Project Properties -> Embedded Frameworks and then manually define the “FAST_SEMIHOSTING_STDIO_DRIVER=1” preprocessor macro for the Debug configuration where you want to have semihosting enabled.

    Please note that you can also configure the profiler framework to ignore semihosting calls when no debugger is attached (works with most Cortex-M devices) using a corresponding setting on the Embedded Frameworks page.

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