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, 11 months ago.
USBSerial on the FDRM-K64F
Hi,
The program below does not work on the FDRM-K64F. The program hangs and Windows reports a USB device that did not initialize properly. The program runs fine on the LPC-4088. However, if I comment out the "USBSerial serial;" line inside the usb_thread function and uncomment the global "USBSerial serial;" line, the code works on the FDRM-K64F. Any ideas why this is happening? I have updated all the libs to the most recent release.
Regards,
Tom Doyle
- include "mbed.h"
- include "rtos.h"
- include "USBSerial.h"
DigitalOut led(LED2, 1);
USBSerial serial;
void usb_thread(void const *argument) { USBSerial serial;
while (true) { led = !led.read(); serial.printf("USB Thread\r\n"); Thread::wait(1000); } }
int main() { Thread usbThread(usb_thread);
while (true) { Thread::wait(10000); } }
1 Answer
9 years, 11 months ago.
Tom,
I have never used USBSerial, so pardon my lack of understanding. Is this for communications back to the host PC?
With rtos running, I just use RawSerial pc(USBTX, USBRX); and have my own character grabbing interrupt routine. Works on the K64F
BTW: When if you are receiving characters on the K64F and some characters are getting missed, check out this thread: http://mbed.org/questions/3374/Fixing-missing-Rx-serial-chars-on-the-K6/
...kevin