8 years, 10 months ago.

console output over USB

Is it possible with the LPC11U35 to generate console output for debugging puposes? I mean something like the wiki entry for the Nucleo board with the following code-snippet:

Serial console( SERIAL_TX; SERIAL_RX );
console.printf( "Hello world\n" );

Is there a driver for a virtual COM Port?

Thanks in advance

Edit:

I tried 3 possibilities:

Unfortunatly all of them failed.. Is it possible, that the pinnames in pinname.h are wrong regarding the USB-Pins?

Question relating to:

The LPC11U35 QuickStart Board from Embedded Artists is a easy to use ARM Cortex-M0 rapid prototyping board in a breadboard-friendly 30-pin DIL format. The board targets smaller control applications as …

2 Answers

8 years, 10 months ago.

Typically you should first connect the board and the PC using a USB cable, then install the regular mbed serial driver found here. The code on the LPC11U35 needs to use the USBDevice library. Import the lib from here.

Code is something like this:

#include "mbed.h"
#include "USBSerial.h"
 
//Virtual serial port over USB
USBSerial serial;
 
int main(void) {
 
    while(1)
    {
        serial.printf("I am a virtual serial port\r\n");
        wait(1);
    }
}

Note: have not tried this on the 11U35 but it works on similar devices such as the 11U24. The LPC11U35 is used on the more recent NXP mbed platforms as the interface processor for drag-drop programming and also serves as USB-Serial converter with the serial driver referenced above.

Thank you for your answer. I just did some digging and found out, that your suggested solution apperently won't work here. Anyway I'll try the USBSerial library with a second USB-Plug

posted by Men Duri Coray 12 Jun 2015

You dont need a second USB plug. The USB plug that is used for flashing new software should also be used for the USBSerial library. You will probably need to run a program that uses the USBSerial software (see example above) on the 11U35 before you can install the windows driver. The driver installer may not recognise the device when the USBSerial is not running. As stated in the other post, you can alternatively also use an external USB-Serial converter and save on memory space by not running the full USB stack on the 11U35. However, that seems strange since the U in 11U35 indicates that it is specifically intended for use as USB device.

posted by Wim Huiskamp 12 Jun 2015

@Men, at the USBSerial handbook page the correct driver is linked. The one Wim linked afaik indeed does not work for the USBSerial option.

posted by Erik - 12 Jun 2015
8 years, 10 months ago.

There is no serial over the USB as standard. You can use the USBSerial library as already suggested.

The other alternative is to use the uart on the LPC11U35 and a TTL level uart to USB adapter such as one of these: http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm

This simplifies the code since only the base mbed libraries are needed but adds hardware complexity in that you have to wire the cable to pins P0_18,P0_19 and GND.

The code would be:

Serial console(UART_TX,UART_RX);

main() {
  console.puts("Hello\r\n");
}