7 years, 11 months ago.

USB serial not showing up KL25Z

I can not get the USB serial to work on the FRDM-KL25Z. The code compiles, uploads, and the LED blinks, however there are no devices that show up when the USB cable is connected to either USB port. Also just wondering does this serial port create a virtual serial port using the chip itself or does it utilize the virtual serial line provided by OpenSDA on the secondary chip as it would if using CodeWarrior and the Freescale development software.


#include "mbed.h"

DigitalOut myled(LED_RED);
Serial pc(USBTX,USBRX);

int main() {
    while(1) {
        myled = 1;
        pc.printf("Led ON\n");
        myled = 0;
        pc.printf("Led OFF\n");

3 Answers

7 years, 10 months ago.

I am also struggling with USB serial on this board. I installed the USB driver and got "mbed Serial Port" on COM3 to show up. I am assume that is the SDA port (though I have had no luck communicating over it with any sample code I've tried).

I can't get the on-chip USB port to show up on my computer. I have switched cables, unplugged the SDA port, but the drive installer then says there is no device.

Did you install the serial driver with the KL25Z connected to USB. Is that the only mbed on your PC and are you sure COM3 belongs to the KL25Z. Do you see COM3 in your hyperterminal application and is it selected. Is the baudrate set correctly. Is the program running, do you see the LED flashing.

posted by Wim Huiskamp 04 May 2013
7 years, 9 months ago.

I have found the USB library as referred to in this project - https://mbed.org/users/samux/code/USBKeyboard_HelloWorld/ - works well (ie so far the keyboard and HID work "as expected"). I haven't tried the serial yet but now the HID works, I think I will probably stick to that for my PC -> device comms.

7 years, 7 months ago.

I have found that you have to wait for the Windows Explorer window to come up before trying to connect to the serial port. Once the MBED device comes up , close the windows explorer MBED window and then open the serial port. I tested your example and the other serial examples successfully with the KL25Z board