2018-01-24 05:31 AM
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).
2018-01-24 05:40 AM
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...
2018-01-24 06:05 AM
Part data sheet should detail USART options for PA2/3 on the chip. Usually USART2
Solder bridges will need attention if using shield connector.
2018-01-24 09:49 AM
2018-01-24 01:05 PM
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.
2018-01-24 02:38 PM
Check the DAP configuration, EVR can't be selected as a STDIN source. Perhaps Keil should add this functionality. Works well in ITM