Program with printf() no data on UART

Sysprogs forums Forums VisualGDB Program with printf() no data on UART

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21153
    gorol10
    Participant

    Helo, I have a problem with printf() in visual GDB the program is compiled, but nothing is displayed on UART. The same program compiled in STM Studio Workbench display data on UART. What is the problem in Visual GDB

    https://pastebin.com/embed_js/yHmFRjKy

     

    #21154
    support
    Keymaster

    Hi,

    Most likely you are missing the code responsible for redirecting stdout output to the UART.

    Please see this tutorial for a detailed example (you will need to add a similar implemenation for _write() and other similar functions).

    #21160
    gorol10
    Participant

    Adding the syscalls.c file and changing the main.cpp file to main.c has helped

    • This reply was modified 5 years, 9 months ago by gorol10.
    #21167
    support
    Keymaster

    Hi,

    Good to know it works. BTW, you can avoid renaming the main.cpp file to main.c if you declare all functions that are called from Plain C code with extern “C” as shown in this tutorial: https://visualgdb.com/tutorials/tips/externc/

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