[LPC5516] usb_cdc_adapter incompatible with component/serial_manager

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[LPC5516] usb_cdc_adapter incompatible with component/serial_manager

ソリューションへジャンプ
65件の閲覧回数
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 解決策
37件の閲覧回数
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 返答(返信)
38件の閲覧回数
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 件の賞賛
返信
37件の閲覧回数
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 件の賞賛
返信
47件の閲覧回数
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 件の賞賛
返信