bug in MQX usb stack class driver?

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

bug in MQX usb stack class driver?

3,171件の閲覧回数
bluehacker
Contributor III

HI

I am now using MQX in my custom mcf52259 board,the HID device example work, but the virtual com has something strange, the PC can find the virtual com, but I can't change baudrate in device manager of microsoft windows.,and can't send or receive any data.

I read MQX source code, find a strange thing, see below:

 

 

void USB_Framework_Periodic_Task(void)
{
    /* if control request pending to be completed */
    if(g_control_pending==TRUE) 
    {   /* handle pending control request */
        USB_Control_Service(&g_f_event);       
        g_control_pending=FALSE;
    }

 

void USB_Framework_Periodic_Task(void){    /* if control request pending to be completed */    if(g_control_pending==TRUE)     {   /* handle pending control request */    

   USB_Control_Service(&g_f_event);    

         g_control_pending=FALSE;  

    }

 

but the USB_Control_Service prototype is :

void USB_Control_Service (PTR_USB_EVENT_STRUCT event,pointer arg )

SO, in  USB_Framework_Periodic_Task function call it without the second argument

 

is it a bug??

ラベル(1)
タグ(1)
0 件の賞賛
返信
4 返答(返信)

1,307件の閲覧回数
cutworth
NXP Employee
NXP Employee

What baud rate you set for your board? Try set the baud rate to 115200 8N1, and type in the console, you should what you type in the console. The virtual COM demo implements a loopback device which echos back what you typed.

0 件の賞賛
返信

1,307件の閲覧回数
bluehacker
Contributor III

yes ,I set the baudrate as 115200 and 8 bits data , one bit stop, but I can't get anything back when I send some characters to board.

also I can't change the baudrate setting ,if I change it ,The console tools will lose response. I trace into code ,and find the 

void USB_Notif_Callback(uint_8 event_type,void* val,pointer arg) 

 

void USB_Notif_Callback(uint_8 event_type,void* val,pointer arg) function seems something wrong , it was  never called with event_type=USB_APP_CDC_DTE_ACTIVATED, SO the start_transactions global variable never get TRUE.

 

0 件の賞賛
返信

1,307件の閲覧回数
JuroV
NXP Employee
NXP Employee

CDC device example uses hardware data flow. Try to switch on hardware data flow when opening a device in the Windows Hyperterminal.

0 件の賞賛
返信

1,307件の閲覧回数
Nouchi
Senior Contributor II

Hello,

 

USB_Framework_Periodic_Task isn't used in the demo, because DELAYED_PROCESSING isn't defined in the virtual com demo.

 

 

I saw some strange things too with usbView :

 

Device Descriptor:bcdUSB:             0x0200bDeviceClass:         0x02bDeviceSubClass:      0x00bDeviceProtocol:      0x00bMaxPacketSize0:      0x40 (64)idVendor:           0x2504idProduct:          0x0300bcdDevice:          0x0002iManufacturer:        0x010x0409: "FREESCALE SEMICONDUCTOR INC."iProduct:             0x020x0409: "MQX VIRTUAL COM DEMO"iSerialNumber:        0x00bNumConfigurations:   0x01ConnectionStatus: DeviceConnectedCurrent Config Value: 0x01Device Bus Speed:     FullDevice Address:       0x01Open Pipes:              3Endpoint Descriptor:bEndpointAddress:     0x81  INTransfer Type:   InterruptwMaxPacketSize:     0x0010 (16)bInterval:            0x0AEndpoint Descriptor:bEndpointAddress:     0x82  INTransfer Type:        BulkwMaxPacketSize:     0x0040 (64)bInterval:            0x00Endpoint Descriptor:bEndpointAddress:     0x03  OUTTransfer Type:        BulkwMaxPacketSize:     0x0040 (64)bInterval:            0x00Configuration Descriptor:wTotalLength:       0x0043bNumInterfaces:       0x02bConfigurationValue:  0x01iConfiguration:       0x00bmAttributes:         0xC0 (Bus Powered Self Powered )MaxPower:             0x32 (100 Ma)Interface Descriptor:bInterfaceNumber:     0x00bAlternateSetting:    0x00bNumEndpoints:        0x01bInterfaceClass:      0x02bInterfaceSubClass:   0x02bInterfaceProtocol:   0x00iInterface:           0x00Unknown Descriptor:bDescriptorType:      0x24bLength:              0x0505 24 00 10 01 Unknown Descriptor:bDescriptorType:      0x24bLength:              0x0505 24 01 01 01 Unknown Descriptor:bDescriptorType:      0x24bLength:              0x0404 24 02 06 Unknown Descriptor:bDescriptorType:      0x24bLength:              0x0505 24 06 00 01 Endpoint Descriptor:bEndpointAddress:     0x81  INTransfer Type:   InterruptwMaxPacketSize:     0x0010 (16)bInterval:            0x0AInterface Descriptor:bInterfaceNumber:     0x01bAlternateSetting:    0x00bNumEndpoints:        0x02bInterfaceClass:      0x0AbInterfaceSubClass:   0x00bInterfaceProtocol:   0x00iInterface:           0x00Endpoint Descriptor:bEndpointAddress:     0x82  INTransfer Type:        BulkwMaxPacketSize:     0x0040 (64)bInterval:            0x00Endpoint Descriptor:bEndpointAddress:     0x03  OUTTransfer Type:        BulkwMaxPacketSize:     0x0040 (64)bInterval:            0x00

 

 

Just before the end, there's weird Unknown Descriptor.

It works with windows, but it's normal that baud-rate settings doesn't work, it just makes echo, it's not a real USB-RS232 bridge.

With linux, things get worst, device is well detected, but no ttyUSB device were created, even if usbserial module is loaded.

 

I think there an error somewhere in this demo, but I don't have USB knowledge enough to find the problem.

 

0 件の賞賛
返信