From c1bc2527bbd8edf45afe26cf225b5254390898b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 29 Oct 2018 15:03:29 +0100 Subject: [PATCH] disable UART output for ST-Link V2 board on ST-Link V2 USART1_TX is also the LED pin if you still want USART1 for debugging output, remap it USART1_TX will then be on RST pin of connector, USART1_RX will then be on SWIM pin of connector, remapping is not done per default since this board already has a limited number of pin available on the connector --- application.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/application.c b/application.c index 855f2d7..27fb18a 100644 --- a/application.c +++ b/application.c @@ -39,7 +39,9 @@ /* own libraries */ #include "global.h" // board definitions #include "print.h" // printing utilities +#if !defined(STLINKV2_ALU) #include "uart.h" // USART utilities +#endif #include "usb_cdcacm.h" // USB CDC ACM utilities #include "terminal.h" // handle the terminal interface #include "menu.h" // menu utilities @@ -58,12 +60,16 @@ size_t putc(char c) static char last_c = 0; // to remember on which character we last sent if ('\n' == c) { // send carriage return (CR) + line feed (LF) newline for each LF if ('\r' != last_c) { // CR has not already been sent +#if !defined(STLINKV2_ALU) uart_putchar_nonblocking('\r'); // send CR over USART +#endif usb_cdcacm_putchar('\r'); // send CR over USB length++; // remember we printed 1 character } } +#if !defined(STLINKV2_ALU) uart_putchar_nonblocking(c); // send byte over USART +#endif usb_cdcacm_putchar(c); // send byte over USB length++; // remember we printed 1 character last_c = c; // remember last character @@ -257,7 +263,9 @@ void main(void) #endif board_setup(); // setup board +#if !defined(STLINKV2_ALU) uart_setup(); // setup USART (for printing) +#endif usb_cdcacm_setup(); // setup USB CDC ACM (for printing) printf("\nwelcome to the CuVoodoo STM32F1 example application\n"); // print welcome message