This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Odd situation with USB Communication Device (CDC )- VCP

Hi all,

I’m having an odd situation with RL-USB with the following characteristics:

STM23F407ZG (board with proven hardware)
Communication Device (CDC) – Virtual COM Port
Full Speed

CDC Config (in usb_config_FS.c):
#define USBD_CDC_ENABLE 1
#define USBD_CDC_EP_INTIN 1
#define USBD_CDC_WMAXPACKETSIZE 64
#define USBD_CDC_BINTERVAL 2
#define USBD_CDC_HS_ENABLE 0
#define USBD_CDC_HS_WMAXPACKETSIZE 16
#define USBD_CDC_HS_BINTERVAL 2
#define USBD_CDC_EP_BULKIN 2
#define USBD_CDC_EP_BULKOUT 2
#define USBD_CDC_WMAXPACKETSIZE1 64
#define USBD_CDC_HS_ENABLE1 0
#define USBD_CDC_HS_WMAXPACKETSIZE1 64
#define USBD_CDC_HS_BINTERVAL1 0
#define USBD_CDC_CIF_STRDESC L"USB_CDC"
#define USBD_CDC_DIF_STRDESC L"USB_CDC1"
#define USBD_CDC_BUFSIZE 64
#define USBD_CDC_OUTBUFSIZE 128

VCP is configured and recognized in Windows, communication work fine, but after sending a few thousand bytes (the amount varies) RL-USB just stops sending data over the USB, MCU keeps working normally and bytes are still receive over the USB interface.

After some debugging I found that “usbd_cdc_ser_availchar” is still being called, but usbd_cdc_ser_read is no longer called.

In order to isolate the problem, I made a project with only RL-USB and a very simple loop for sending and receiving bytes, and the situations remains the same, after a few thousand bytes sent RL-USB just stops calling usbd_cdc_ser_read … any ideas of what I'm doing wrong ?

Best regards,
Paulo

Parents Reply Children
  • Confirm that host is still polling the target bulk IN endpoint or not.

    On a hardware bus analyzer, the bulk IN endpoint is NAKing.
    or
    On a software sniffer, confirm that the last URB to the bulk IN endpoint is pending, without any error.

    Tsuneo

  • Hi,

    We have tried every situation and the problem still remains.

    The last URB to the host is the following:
    -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
    PipeHandle = 89a949cc [endpoint 0x00000082]
    TransferFlags = 00000003 (USBD_TRANSFER_DIRECTION_IN, USBD_SHORT_TRANSFER_OK)
    TransferBufferLength = 00000000
    TransferBuffer = 8971b004
    TransferBufferMDL = 89cad538
    UrbLink = 00000000

    TransferBufferLength is zero, and it should be 12 as in all the previous IN URB to the host, at some point RL-USB just quits sending more data.

    We have even tried the examples supplied by Keil and the problem still occurs, it’s strange that anyone has not reported this before.

    We were really looking forward to use RL-USB, but it seems that we are at a dead end.

    Is anyone using RL-USB Communication Device (CDC) with success ?

    Best regards,
    Paulo

  • Did you ever find any resolution to this? I am also seeing oddness with usbd_cdc_ser_read not getting called after a number of bytes. usbd_cdc_write is still working just fine.

    I haven't dug into it as far as you, but this popped up when I did a google search.

    Thanks
    Bryce

  • Also, I am on a LPC2478 with this tool chain.

    Tool Version Numbers:
    Toolchain: MDK-ARM Professional Version: 4.60.0.0
    Toolchain Path: C:\Keil\ARM\ARMCC\bin\
    C Compiler: Armcc.Exe
    Assembler: Armasm.Exe V5.02.0.28
    Linker/Locator: ArmLink.Exe V5.02.0.28
    Librarian: ArmAr.Exe V5.02.0.28
    Hex Converter: FromElf.Exe V5.02.0.28
    CPU DLL: SARM.DLL V4.60.0.0
    Dialog DLL: DARMP.DLL V1.51
    Target DLL: ULP2ARM.DLL V2.18.0.0
    Dialog DLL: TARMP.DLL V1.51

  • Hi Bryce,

    I did not find a workaround this problem in the RL-USB, the good news is that Keil did address the issue in the last version of MDK (Version 4.70) and the RL-USB CDC module has been rewritten and it now works great ! This new version finaly solved this and some other issues. I now have a composite device (Mass Storage and VCP) working just fine, I highly recommend you to upgrade :)

    Follow this link to the MDK Version 4.70 release notes:
    http://www.keil.com/update/whatsnew.asp?p=RVMDK&v=4.70

    Regards,
    Paulo

  • Thanks for the reply! I'll look in to doing the upgrade and see if that fixes it.