Debug string without printf

Sysprogs forums Forums VisualGDB Debug string without printf

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #974
    Anonymous
    Participant

    I would like to know if there is a way to print a debug string without using a printf. Adding a single printf increases the code size by 28KB! I can create the string with a small library that uses only a few KB and would like to send these strings to the debug interface.

    On a separate note, I like VisualGDB for the following reasons:

    1) Allowed download without registering an email address
    2) Deliver on its promises: the LED on my custom STM32F103-based board started to blink a few minutes after the download
    3) Apparently excellent support on this forum
    4) Priced correctly.

    I will turn my evaluation into a paid license this week!

    #3530
    support
    Keymaster

    Hi,

    Please consider using the newlib-nano library. It significantly reduces the size of standard functions like printf(). Follow this tutorial for more details: http://visualgdb.com/tutorials/arm/newlib-nano/
    If that does not work, you can download the newlib source code and copy the functions responsible for sending debug text using the semihosting API from there.

    #6115
    bernardofca
    Participant

    The Newlib-nano fixed the problem – thanks

    #6130
    bernardofca
    Participant

    I was actually too quick to answer: the Newlib-nano reduces the size of the code but the output does not go to the debugger window. I will need to fix that…

    #6137
    support
    Keymaster

    Hi,

    Please try adding –specs=rdimon.specs to your LDFLAGS. This should explicitly include the library providing the debug I/O functionality.

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