Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 10 months ago.
the serial port seems doesn't send data
I tried the "Nucleo_printf" example, and I use another board with a serial port to receive the data, but it seems no data transmit from TX port, what's the problem?
1 Answer
9 years, 8 months ago.
First make sure you update the mbed library to the latest revision (in the compiler click on the mbed library, go to the far right summary tab, click 'update')
than try this code
#include "mbed.h" DigitalOut myled(LED1); int main() { int i = 1; printf("Hello World !\n"); while(1) { wait(1); printf("This program runs since %d seconds.\n\r", i++); myled = !myled; } }
When I change USART2 to USART1 like below, the USART1 port works normally Serial pc(SERIAL_TX, SERIAL_RX); Serial pc(PA_9, PA_10);
posted by Qiang Guo 26 Jul 2014