Skip to main content
daviddavid942
Associate II
March 12, 2010
Question

USB-FS device lib Virtual COM Port problem

  • March 12, 2010
  • 2 replies
  • 660 views
Posted on March 12, 2010 at 12:18

USB-FS device lib Virtual COM Port problem

    This topic has been closed for replies.

    2 replies

    daviddavid942
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:43

    Hi,

    one of the changes that I made to adapt the sample to my project was to increase VIRTUAL_COM_PORT_DATA_SIZE from 64 to a higher value.

    Knowing nothing about USB, I also changed the last field of the DEVICE_PROP Device_Property (/*MAX PACKET SIZE*/) from 0x40 to the same higher value.

    That was a mistake, apparently. After setting back this field to 0x40 the device is correctly recognized by windows.

    Thanks to everybody who helped :)

    Now the question is: is it a problem to have the VIRTUAL_COM_PORT_DATA_SIZE and usb MAX PACKET SIZE

    set to differet values ?
    daviddavid942
    Associate II
    May 17, 2011
    Posted on May 17, 2011 at 13:43

    Hi All

    after some investigation, the problem was in the Get_SerialNum function.

    For some reason, the chipID is 0xFFFFFFFF on all the 3 Serial0...Serial2.

    I commented out this part and edited directly the Virtual_Com_Port_StringVendor,  Virtual_Com_Port_StringProduct and Virtual_Com_Port_StringSerial, giving the fixed but meaningful values.

    Now the example works !

    However... going back to my project.. I did the same thing but this time windows says that the USB device is not recognized.

    The big difference with the given example is that after calling

    Set_USBClock();

    USB_Interrupts_Config();

    USB_Init(); 

    my fw starts doing many other things (the Keil RT kernel starts and task are launched).

    Could this be a timing problem ?

    What else ?

    Thanks in advance