Skip to main content
JuM
Senior
January 24, 2018
Question

STM32F072 Nucleo STDIO

  • January 24, 2018
  • 5 replies
  • 962 views
Posted on January 24, 2018 at 14:31

Started with a STM32F072 Nucleo with Keil MDK using ST-Link of Evaluation board.

Managed to do printf()/putchar() output to µVision Serial Debug (printf) Viewer via EventRecorder (DAP).

But: How to get input (do not see an option for EventRecorder)?

Or:

How to configure UART (which?) to get STDIO (STDOUT and STDIN) through ST-Link-USB.

Or:

How to communicate from/to Nucleo board application via STLink Virtual COM Port with terminal program on PC?

Checked SB61, SB62, SB63 of Nucleo board, all three are open, so PA2/PA3 should go as Tx/Rx to ST-Link (CN3 also open).

    This topic has been closed for replies.

    5 replies

    Andrew Neil
    Super User
    January 24, 2018
    Posted on January 24, 2018 at 14:40

    For questions specifically about how to use the Keil tools, probably best to ask Keil.

    I think they see the debugger trace just as an output - hence, 'trace' - thing?

    As for UART, you can just use it directly or via HAL/LL

    Or look-up 'retargetting' or 'semihosting' in the Keil docs...

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Andrew Neil
    Super User
    January 24, 2018
    Posted on January 24, 2018 at 17:49

    http://www.keil.com/forum/63315

     
    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    Tesla DeLorean
    Guru
    January 24, 2018
    Posted on January 24, 2018 at 15:05

    Part data sheet should detail USART options for PA2/3 on the chip. Usually USART2

    Solder bridges will need attention if using shield connector.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Clive1 (HNL)
    Explorer
    January 24, 2018
    Posted on January 24, 2018 at 22:05

    With the SWV implementation you can click the 'Debug (printf) Viewer' window to get focus, and type into it.

    volatile int32_t ITM_RxBuffer; // used by debugger to pass back to target

            { // pumping in loop to provide test echo-back

                int ch = ITM_ReceiveChar();

                if (ch != -1)

                    ITM_SendChar(ch);

            }

    You'd need to see if EventRecorder (DAP) supports a back channel. Perhaps Bob Boys can clarify.

    Tesla DeLorean
    Guru
    January 24, 2018
    Posted on January 24, 2018 at 22:38

    Check the DAP configuration, EVR can't be selected as a STDIN source. Perhaps Keil should add this functionality. Works well in ITM

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..