2020-03-11 05:46 AM
can anyone help me to know the reason for this unusual behavior or what am I missing here.
2020-03-11 07:40 AM
Which pin? Read out and check the related GPIO and USART registers. Try transmit with that UART and observe the Tx pin using oscilloscope or logic analyzer. Check the given pin's connectivity in the Nucleo User Manual and add/remove any jumpers or solder bridges as needed (especially check if this pin is not connected to the STLink's VCP/USART by default).
JW
2020-03-18 03:47 AM
Thanks for the reply waclawek.jan . The USART pins which are enabled when USART2 is configured through stm32cubemx are PA2 for Tx and PA3 for Rx. But VCP Rx is port PA15. We need to set PA15 as USRT2 Rx from cubemx. This solved my issue.