9 years, 9 months ago.

USBSerial.h include error on NXP LPC800-MAX

Hi all,

I am wondering why 2 weeks ago a piece of code:

  1. include "LPC8xx.h"
  2. include "mbed.h"
  3. include "USBSerial.h"

int main(void) { USBSerial pc(USBTX, USBRX); pc.baud(115200); while(1) { pc.printf("test serial usb"); wait(100); }

return 0; }

compiled and currently it throws an error during compilation: Error: Cannot open source input file "USBSerial.h": No such file or directory in "main.cpp", Line: 3, Col: 23

1 Answer

9 years, 9 months ago.

That first include isn't required, and to include USBSerial you do need the USBDevice repository in your project. However even if you had that included it still wouldn't work: the LPC812 does not support USBSerial. USBSerial is Serial over the USB connection of the target microcontroller, which the LPC812 does not have.

It does have the interface IC which also provides a USB <> Serial bridge. To use that simply use regular Serial. Remove the USBSerial include, and use Serial pc(USBTX, USBRX);.

Accepted Answer