<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPC Microcontrollers中的主题 Copying USB vcom example on LPC11u24 - what am I doing wrong?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630898#M24820</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New to the forum so hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed my own board using an LPC11U24 chip and want to be able to have a USB&amp;nbsp;virtual serial port so that I can communicate with the chip over USB. I have downloaded the LPCOpen libraries and if I build and flash the&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc example to the chip then /dev/ttyACM0 appears on my PC and I can open a serial terminal and have my text echoed back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have been trying to copy the code from&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc into my own project and I am never able to get /dev/ttyACMx to appear. Specifically vcom_connected() always returns false in my application. I'm really not sure what I am missing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code. As you can see, it is largely borrowed from the&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc example so I'm not sure what I am missing. This has been doing my head in for weeks!&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#include "chip.h"&lt;BR /&gt;#include "Pin.h" //my own thing&lt;BR /&gt;#include "PinAssignments.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "SevenSegmentDriver.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "Button.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "LED.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "TestFunctions.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "app_usbd_cfg.h" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include "cdc_vcom.h" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include "cdc_vcom.c" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include "cdc_desc.c" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//COPIED FROM&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;/P&gt;&lt;P&gt;/*****************************************************************************&lt;BR /&gt; * Public types/enumerations/variables&lt;BR /&gt; ****************************************************************************/&lt;/P&gt;&lt;P&gt;static USBD_HANDLE_T g_hUsb;&lt;BR /&gt;static uint8_t g_rxBuff[256];&lt;/P&gt;&lt;P&gt;extern const USBD_HW_API_T hw_api;&lt;BR /&gt;extern const USBD_CORE_API_T core_api;&lt;BR /&gt;extern const USBD_CDC_API_T cdc_api;&lt;BR /&gt;/* Since this example only uses CDC class link functions for that clas only */&lt;BR /&gt;static const USBD_API_T g_usbApi = {&lt;BR /&gt; &amp;amp;hw_api,&lt;BR /&gt; &amp;amp;core_api,&lt;BR /&gt; 0,&lt;BR /&gt; 0,&lt;BR /&gt; 0,&lt;BR /&gt; &amp;amp;cdc_api,&lt;BR /&gt; 0,&lt;BR /&gt; 0x02221101,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;const USBD_API_T *g_pUsbApi = &amp;amp;g_usbApi;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****************************************************************************&lt;BR /&gt; * Private functions&lt;BR /&gt; ****************************************************************************/&lt;/P&gt;&lt;P&gt;/* Initialize pin and clocks for USB0/USB1 port */&lt;BR /&gt;static void usb_pin_clk_init(void)&lt;BR /&gt;{&lt;BR /&gt; /* enable USB main clock */&lt;BR /&gt; Chip_Clock_SetUSBClockSource(SYSCTL_USBCLKSRC_PLLOUT, 1);&lt;BR /&gt; /* Enable AHB clock to the USB block and USB RAM. */&lt;BR /&gt; Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USB);&lt;BR /&gt; Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USBRAM);&lt;BR /&gt; /* power UP USB Phy */&lt;BR /&gt; Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_USBPAD_PD);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****************************************************************************&lt;BR /&gt; * Public functions&lt;BR /&gt; ****************************************************************************/&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * @brief Handle interrupt from USB0&lt;BR /&gt; * @return Nothing&lt;BR /&gt; */&lt;BR /&gt;void USB_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; USBD_API-&amp;gt;hw-&amp;gt;ISR(g_hUsb);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Find the address of interface descriptor for given class type. */&lt;BR /&gt;USB_INTERFACE_DESCRIPTOR *find_IntfDesc(const uint8_t *pDesc, uint32_t intfClass)&lt;BR /&gt;{&lt;BR /&gt; USB_COMMON_DESCRIPTOR *pD;&lt;BR /&gt; USB_INTERFACE_DESCRIPTOR *pIntfDesc = 0;&lt;BR /&gt; uint32_t next_desc_adr;&lt;/P&gt;&lt;P&gt;pD = (USB_COMMON_DESCRIPTOR *) pDesc;&lt;BR /&gt; next_desc_adr = (uint32_t) pDesc;&lt;/P&gt;&lt;P&gt;while (pD-&amp;gt;bLength) {&lt;BR /&gt; /* is it interface descriptor */&lt;BR /&gt; if (pD-&amp;gt;bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE) {&lt;/P&gt;&lt;P&gt;pIntfDesc = (USB_INTERFACE_DESCRIPTOR *) pD;&lt;BR /&gt; /* did we find the right interface descriptor */&lt;BR /&gt; if (pIntfDesc-&amp;gt;bInterfaceClass == intfClass) {&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; pIntfDesc = 0;&lt;BR /&gt; next_desc_adr = (uint32_t) pD + pD-&amp;gt;bLength;&lt;BR /&gt; pD = (USB_COMMON_DESCRIPTOR *) next_desc_adr;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return pIntfDesc;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;BR /&gt; USBD_API_INIT_PARAM_T usb_param;&lt;BR /&gt; USB_CORE_DESCS_T desc;&lt;BR /&gt; ErrorCode_t ret = LPC_OK;&lt;BR /&gt; uint32_t prompt = 0, rdCnt = 0;&lt;/P&gt;&lt;P&gt;SystemCoreClockUpdate();&lt;/P&gt;&lt;P&gt;/* Initialize board and chip */&lt;BR /&gt; Chip_GPIO_Init(LPC_GPIO);&lt;BR /&gt; Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 11, 1); //set red led pin function to IO&lt;/P&gt;&lt;P&gt;/* enable clocks and pinmux */&lt;BR /&gt; usb_pin_clk_init();&lt;/P&gt;&lt;P&gt;/* initilize call back structures */&lt;BR /&gt; memset((void *) &amp;amp;usb_param, 0, sizeof(USBD_API_INIT_PARAM_T));&lt;BR /&gt; usb_param.usb_reg_base = LPC_USB0_BASE;&lt;BR /&gt; usb_param.max_num_ep = 3;&lt;BR /&gt; usb_param.mem_base = USB_STACK_MEM_BASE;&lt;BR /&gt; usb_param.mem_size = USB_STACK_MEM_SIZE;&lt;/P&gt;&lt;P&gt;/* Set the USB descriptors */&lt;BR /&gt; desc.device_desc = (uint8_t *) &amp;amp;USB_DeviceDescriptor[0];&lt;BR /&gt; desc.string_desc = (uint8_t *) &amp;amp;USB_StringDescriptor[0];&lt;BR /&gt; /* Note, to pass USBCV test full-speed only devices should have both&lt;BR /&gt; descriptor arrays point to same location and device_qualifier set to 0.&lt;BR /&gt; */&lt;BR /&gt; desc.high_speed_desc = (uint8_t *) &amp;amp;USB_FsConfigDescriptor[0];&lt;BR /&gt; desc.full_speed_desc = (uint8_t *) &amp;amp;USB_FsConfigDescriptor[0];&lt;BR /&gt; desc.device_qualifier = 0;&lt;/P&gt;&lt;P&gt;//LEDS&lt;BR /&gt; LED yellowLED(LEDPins[0]);&lt;BR /&gt; LED redLED(LEDPins[1]);&lt;BR /&gt; yellowLED = 0;&lt;BR /&gt; redLED = 1;&lt;/P&gt;&lt;P&gt;/* USB Initialization */&lt;BR /&gt; ret = USBD_API-&amp;gt;hw-&amp;gt;Init(&amp;amp;g_hUsb, &amp;amp;desc, &amp;amp;usb_param);&lt;BR /&gt; if (ret == LPC_OK) {&lt;BR /&gt; /* Init VCOM interface */&lt;BR /&gt; ret = vcom_init(g_hUsb, &amp;amp;desc, &amp;amp;usb_param);&lt;BR /&gt; if (ret == LPC_OK) {&lt;BR /&gt; /* enable USB interrrupts */&lt;BR /&gt; NVIC_EnableIRQ(USB0_IRQn);&lt;BR /&gt; /* now connect */&lt;BR /&gt; USBD_API-&amp;gt;hw-&amp;gt;Connect(g_hUsb, 1);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;redLED = 0;&lt;/P&gt;&lt;P&gt;while (1) {&lt;BR /&gt; /* Check if host has connected and opened the VCOM port */&lt;BR /&gt; //if ((vcom_connected() != 0) &amp;amp;&amp;amp; (prompt == 0)) {&lt;BR /&gt; // vcom_write("Hello World!!\r\n", 15);&lt;BR /&gt; // prompt = 1;&lt;BR /&gt; //}&lt;BR /&gt; yellowLED = vcom_connected();&lt;BR /&gt; /* If VCOM port is opened echo whatever we receive back to host. */&lt;BR /&gt; if (1==1 || prompt) {&lt;BR /&gt; rdCnt = vcom_bread(&amp;amp;g_rxBuff[0], 256);&lt;BR /&gt; if (rdCnt) {&lt;BR /&gt; vcom_write(&amp;amp;g_rxBuff[0], rdCnt);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; /* Sleep until next IRQ happens */&lt;BR /&gt; __WFI();&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Feb 2017 23:23:23 GMT</pubDate>
    <dc:creator>matthollands</dc:creator>
    <dc:date>2017-02-13T23:23:23Z</dc:date>
    <item>
      <title>Copying USB vcom example on LPC11u24 - what am I doing wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630898#M24820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;New to the forum so hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have developed my own board using an LPC11U24 chip and want to be able to have a USB&amp;nbsp;virtual serial port so that I can communicate with the chip over USB. I have downloaded the LPCOpen libraries and if I build and flash the&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc example to the chip then /dev/ttyACM0 appears on my PC and I can open a serial terminal and have my text echoed back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have been trying to copy the code from&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc into my own project and I am never able to get /dev/ttyACMx to appear. Specifically vcom_connected() always returns false in my application. I'm really not sure what I am missing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code. As you can see, it is largely borrowed from the&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc example so I'm not sure what I am missing. This has been doing my head in for weeks!&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#include "chip.h"&lt;BR /&gt;#include "Pin.h" //my own thing&lt;BR /&gt;#include "PinAssignments.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "SevenSegmentDriver.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "Button.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "LED.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "TestFunctions.h"&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;//my own thing&lt;/SPAN&gt;&lt;BR /&gt;#include "app_usbd_cfg.h" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include "cdc_vcom.h" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include "cdc_vcom.c" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include "cdc_desc.c" //referencing&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;BR /&gt;#include &amp;lt;string.h&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//COPIED FROM&amp;nbsp;nxp_lpcxpresso_11u14_usbd_lib_cdc&lt;/P&gt;&lt;P&gt;/*****************************************************************************&lt;BR /&gt; * Public types/enumerations/variables&lt;BR /&gt; ****************************************************************************/&lt;/P&gt;&lt;P&gt;static USBD_HANDLE_T g_hUsb;&lt;BR /&gt;static uint8_t g_rxBuff[256];&lt;/P&gt;&lt;P&gt;extern const USBD_HW_API_T hw_api;&lt;BR /&gt;extern const USBD_CORE_API_T core_api;&lt;BR /&gt;extern const USBD_CDC_API_T cdc_api;&lt;BR /&gt;/* Since this example only uses CDC class link functions for that clas only */&lt;BR /&gt;static const USBD_API_T g_usbApi = {&lt;BR /&gt; &amp;amp;hw_api,&lt;BR /&gt; &amp;amp;core_api,&lt;BR /&gt; 0,&lt;BR /&gt; 0,&lt;BR /&gt; 0,&lt;BR /&gt; &amp;amp;cdc_api,&lt;BR /&gt; 0,&lt;BR /&gt; 0x02221101,&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;const USBD_API_T *g_pUsbApi = &amp;amp;g_usbApi;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****************************************************************************&lt;BR /&gt; * Private functions&lt;BR /&gt; ****************************************************************************/&lt;/P&gt;&lt;P&gt;/* Initialize pin and clocks for USB0/USB1 port */&lt;BR /&gt;static void usb_pin_clk_init(void)&lt;BR /&gt;{&lt;BR /&gt; /* enable USB main clock */&lt;BR /&gt; Chip_Clock_SetUSBClockSource(SYSCTL_USBCLKSRC_PLLOUT, 1);&lt;BR /&gt; /* Enable AHB clock to the USB block and USB RAM. */&lt;BR /&gt; Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USB);&lt;BR /&gt; Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_USBRAM);&lt;BR /&gt; /* power UP USB Phy */&lt;BR /&gt; Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_USBPAD_PD);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*****************************************************************************&lt;BR /&gt; * Public functions&lt;BR /&gt; ****************************************************************************/&lt;/P&gt;&lt;P&gt;/**&lt;BR /&gt; * @brief Handle interrupt from USB0&lt;BR /&gt; * @return Nothing&lt;BR /&gt; */&lt;BR /&gt;void USB_IRQHandler(void)&lt;BR /&gt;{&lt;BR /&gt; USBD_API-&amp;gt;hw-&amp;gt;ISR(g_hUsb);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Find the address of interface descriptor for given class type. */&lt;BR /&gt;USB_INTERFACE_DESCRIPTOR *find_IntfDesc(const uint8_t *pDesc, uint32_t intfClass)&lt;BR /&gt;{&lt;BR /&gt; USB_COMMON_DESCRIPTOR *pD;&lt;BR /&gt; USB_INTERFACE_DESCRIPTOR *pIntfDesc = 0;&lt;BR /&gt; uint32_t next_desc_adr;&lt;/P&gt;&lt;P&gt;pD = (USB_COMMON_DESCRIPTOR *) pDesc;&lt;BR /&gt; next_desc_adr = (uint32_t) pDesc;&lt;/P&gt;&lt;P&gt;while (pD-&amp;gt;bLength) {&lt;BR /&gt; /* is it interface descriptor */&lt;BR /&gt; if (pD-&amp;gt;bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE) {&lt;/P&gt;&lt;P&gt;pIntfDesc = (USB_INTERFACE_DESCRIPTOR *) pD;&lt;BR /&gt; /* did we find the right interface descriptor */&lt;BR /&gt; if (pIntfDesc-&amp;gt;bInterfaceClass == intfClass) {&lt;BR /&gt; break;&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; pIntfDesc = 0;&lt;BR /&gt; next_desc_adr = (uint32_t) pD + pD-&amp;gt;bLength;&lt;BR /&gt; pD = (USB_COMMON_DESCRIPTOR *) next_desc_adr;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;return pIntfDesc;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;int main(void) {&lt;BR /&gt; USBD_API_INIT_PARAM_T usb_param;&lt;BR /&gt; USB_CORE_DESCS_T desc;&lt;BR /&gt; ErrorCode_t ret = LPC_OK;&lt;BR /&gt; uint32_t prompt = 0, rdCnt = 0;&lt;/P&gt;&lt;P&gt;SystemCoreClockUpdate();&lt;/P&gt;&lt;P&gt;/* Initialize board and chip */&lt;BR /&gt; Chip_GPIO_Init(LPC_GPIO);&lt;BR /&gt; Chip_IOCON_PinMuxSet(LPC_IOCON, 0, 11, 1); //set red led pin function to IO&lt;/P&gt;&lt;P&gt;/* enable clocks and pinmux */&lt;BR /&gt; usb_pin_clk_init();&lt;/P&gt;&lt;P&gt;/* initilize call back structures */&lt;BR /&gt; memset((void *) &amp;amp;usb_param, 0, sizeof(USBD_API_INIT_PARAM_T));&lt;BR /&gt; usb_param.usb_reg_base = LPC_USB0_BASE;&lt;BR /&gt; usb_param.max_num_ep = 3;&lt;BR /&gt; usb_param.mem_base = USB_STACK_MEM_BASE;&lt;BR /&gt; usb_param.mem_size = USB_STACK_MEM_SIZE;&lt;/P&gt;&lt;P&gt;/* Set the USB descriptors */&lt;BR /&gt; desc.device_desc = (uint8_t *) &amp;amp;USB_DeviceDescriptor[0];&lt;BR /&gt; desc.string_desc = (uint8_t *) &amp;amp;USB_StringDescriptor[0];&lt;BR /&gt; /* Note, to pass USBCV test full-speed only devices should have both&lt;BR /&gt; descriptor arrays point to same location and device_qualifier set to 0.&lt;BR /&gt; */&lt;BR /&gt; desc.high_speed_desc = (uint8_t *) &amp;amp;USB_FsConfigDescriptor[0];&lt;BR /&gt; desc.full_speed_desc = (uint8_t *) &amp;amp;USB_FsConfigDescriptor[0];&lt;BR /&gt; desc.device_qualifier = 0;&lt;/P&gt;&lt;P&gt;//LEDS&lt;BR /&gt; LED yellowLED(LEDPins[0]);&lt;BR /&gt; LED redLED(LEDPins[1]);&lt;BR /&gt; yellowLED = 0;&lt;BR /&gt; redLED = 1;&lt;/P&gt;&lt;P&gt;/* USB Initialization */&lt;BR /&gt; ret = USBD_API-&amp;gt;hw-&amp;gt;Init(&amp;amp;g_hUsb, &amp;amp;desc, &amp;amp;usb_param);&lt;BR /&gt; if (ret == LPC_OK) {&lt;BR /&gt; /* Init VCOM interface */&lt;BR /&gt; ret = vcom_init(g_hUsb, &amp;amp;desc, &amp;amp;usb_param);&lt;BR /&gt; if (ret == LPC_OK) {&lt;BR /&gt; /* enable USB interrrupts */&lt;BR /&gt; NVIC_EnableIRQ(USB0_IRQn);&lt;BR /&gt; /* now connect */&lt;BR /&gt; USBD_API-&amp;gt;hw-&amp;gt;Connect(g_hUsb, 1);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;redLED = 0;&lt;/P&gt;&lt;P&gt;while (1) {&lt;BR /&gt; /* Check if host has connected and opened the VCOM port */&lt;BR /&gt; //if ((vcom_connected() != 0) &amp;amp;&amp;amp; (prompt == 0)) {&lt;BR /&gt; // vcom_write("Hello World!!\r\n", 15);&lt;BR /&gt; // prompt = 1;&lt;BR /&gt; //}&lt;BR /&gt; yellowLED = vcom_connected();&lt;BR /&gt; /* If VCOM port is opened echo whatever we receive back to host. */&lt;BR /&gt; if (1==1 || prompt) {&lt;BR /&gt; rdCnt = vcom_bread(&amp;amp;g_rxBuff[0], 256);&lt;BR /&gt; if (rdCnt) {&lt;BR /&gt; vcom_write(&amp;amp;g_rxBuff[0], rdCnt);&lt;BR /&gt; }&lt;BR /&gt; }&lt;BR /&gt; /* Sleep until next IRQ happens */&lt;BR /&gt; __WFI();&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2017 23:23:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630898#M24820</guid>
      <dc:creator>matthollands</dc:creator>
      <dc:date>2017-02-13T23:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copying USB vcom example on LPC11u24 - what am I doing wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630899#M24821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="294500" data-username="matthollands" href="https://community.nxp.com/people/matthollands"&gt;Matt Hollands&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;/P&gt;&lt;P&gt;According to your description, I think the enumeration fail cause the issue, so I've attached a tool to illustrate the details of the enumeration, then you can figure out which step fails.&lt;/P&gt;&lt;P&gt;And I'd also recommend you to refer to the USB demos which are from lpcopen_2_12_lpcxpresso_nxp_lpcxpresso_11u68, these demos are based on the USB ROM drivers and these drivers are available on LPC11U2x, however it's unavailable for the LPC11U1x.&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Have a great day!&lt;/P&gt;&lt;P&gt;Ping&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 02:23:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630899#M24821</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2017-02-16T02:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Copying USB vcom example on LPC11u24 - what am I doing wrong?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630900#M24822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Despite what jeremyzhou&amp;nbsp;says - you definitely don't want to use the LPCOpen package for LPC11U68 for development with LPC11U24. The LPC11U1x/2x/3x family are very different to the later LPC11U6x family.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;LPCXpresso Support&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Feb 2017 09:03:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Copying-USB-vcom-example-on-LPC11u24-what-am-I-doing-wrong/m-p/630900#M24822</guid>
      <dc:creator>lpcxpresso_supp</dc:creator>
      <dc:date>2017-02-16T09:03:32Z</dc:date>
    </item>
  </channel>
</rss>

