Setting up terminal (TeraTerm etc) interface with STM32L476VG-DISCOVERY board
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-03-03 3:58 PM
Posted on March 04, 2018 at 00:58
Hi,
I am developing a code in Visual Studio/visualgdb for STM32L476VG Discovery Board. How do I set up UART on this board so that I would be able to print my output on a terminal program (teraTerm, PuTTY etc)? Is there any standard code library available for this specific problem? I am using ST-Link debugger and STM32CubeMX for skeleton code generation.
Thank you!
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-03-04 7:12 AM
Posted on March 04, 2018 at 16:12
Initialize the port/pins supporting the VCP on your board (see User Manual)
Add code hosting that USART
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)#else#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)#endif /* __GNUC__ */...
/**
* @brief Retargets the C library printf function to the USART. * @param None * @retval None */PUTCHAR_PROTOTYPE{ /* Place your implementation of fputc here */ /* e.g. write a character to the USART1 and Loop until the end of transmission */ HAL_UART_Transmit(&UartHandle, (uint8_t *)&ch, 1, 0xFFFF);return ch;
}
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
