cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F072 Nucleo STDIO

JuM
Senior
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).

5 REPLIES 5
Andrew Neil
Chief II
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...

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 Up vote any posts that you find helpful, it shows what's working..
Posted on January 24, 2018 at 17:49

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

 
Clive1 (HNL)
Senior II
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.

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 Up vote any posts that you find helpful, it shows what's working..