[LPC5516] usb_cdc_adapter incompatible with component/serial_manager

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

[LPC5516] usb_cdc_adapter incompatible with component/serial_manager

跳至解决方案
1,197 次查看
wilkinsw
Contributor III

SDK Version: SDK_2.x_LPC5516 version 2.16.000

MCUXpresso version: 11.9.0

SDK component(s):

  • Utilities
    • Device
      • SDK Utilities
        • debug_console
        • serial_manager_usb_cdc

Problem: Using the debug_console SDK utility in kSerialPort_UsbCdc mode fails.

Several of the global variables and defines that fsl_component_serial_port_usb.c rely upon are heavily decorated on the LPC5516 due to there being two USB ports.

For example at line 178 in fsl_component_serial_port_usb.c there is the following definition expecting a global usb_device_class_struct_t named g_UsbDeviceCdcVcomConfig:

/* USB device class information */
static usb_device_class_config_struct_t s_cdcAcmConfig[1] = {{
    USB_DeviceCdcVcomCallback,
    0,
    &g_UsbDeviceCdcVcomConfig,
}};

 

However in usb_device_descriptor.c, which is installed as part of the same SDK component, the struct seems to be declared with the name g_UsbDeviceInterface0CicVcomConfig instead.

usb_device_class_struct_t g_UsbDeviceInterface0CicVcomConfig = {
    g_UsbDeviceInterface0CicVcomInterfaceList,
    kUSB_DeviceClassTypeCdc,
    USB_DEVICE_CONFIGURATION_COUNT,
};

 

It looks like the serial_port component is expecting variables to be decorated with "UsbDeviceCdc" but the globals are actually decorated with "UsbDeviceInterface0Cic"

How would you suggest I handle this? Is there a way to change the decoration for the generated code, or should I modify the component source code directly?

Thanks!

标签 (1)
0 项奖励
回复
1 解答
1,169 次查看
wilkinsw
Contributor III

Ah I see what you mean, the "dev_cdc_vcom_bm" has a version of "usb_device_descriptor.c" that has things named correctly.  I'll use that then.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,170 次查看
wilkinsw
Contributor III

Ah I see what you mean, the "dev_cdc_vcom_bm" has a version of "usb_device_descriptor.c" that has things named correctly.  I'll use that then.

0 项奖励
回复
1,169 次查看
wilkinsw
Contributor III

This is a bug report of sorts.

It seems like the best path forward is to delete the "usb_cdc_adapter" that gets added by the SDK component manager and add our own modified one that matches the expected naming convention of fsl_component_serial_port_usb.c

Most of the tools added by the SDK manager work with very little configuration (or by modifying a few defines).  I assumed that since this one was broken in its default state that there may be something I was missing.

0 项奖励
回复
1,179 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @wilkinsw 

To better solve your problem, please tell me what project you want to develop.

And you can also refer to the SDK demo "dev_cdc_vcom_bm" . The Virtual COM project is a simple demonstration program based on the MCUXpresso SDK. It is enumerated as a COM
port, which the users can open using terminal tools, such as TeraTerm. The demo echoes back any character it receives. The purpose of this demo is to show how to build a device of USB CDC class and to provide a simple project for further development.

 

BR

Alice

0 项奖励
回复