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.
10 years, 10 months ago.
Using USB serial on the new Nucleo F401RE
Hello tried the USB serial example to do a printf() to the PC. But
#include "USBSerial.h"
fails
Quote:
Error: Cannot open source input file "USBSerial.h": No such file or directory in "main.cpp", Line: 2, Col: 23
Heinz
2 Answers
10 years, 10 months ago.
Sorry, does not help
Tried the 'update' option on right click on different entries without success.
Heinz
Regular Serial communication is done through the st-link interface. You wont need USBSerial in that case. Just include mbed.h, define a Serial object with Serial pc(SERIAL_TX,SERIAL_RX), and use printf.
USBSerial is for a device that has a hardware USB port on-chip. That may not yet be supported on the nucleo. Note that there also is no separate USB socket on the board for the target device. You would have to add that also.
posted by 02 Mar 2014Thanks Wim with this Serial Object and TX/RX values the example compiles. Anyway, I naow have trouble getting the pc.printf() output on /dev/ttyACM0. It looks like the debugger closes and reopens this device, which makes it difficult to have the serial terminal open. I hope to find some more hints on using mbed and the serial output when working with Linux. Heinz
posted by 02 Mar 201410 years, 10 months ago.
I had that problem too. Rightclick on the mbed lib in your project and update the lib, then recompile all. That solved it for me.