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

Does LPC1343 USBCDC example lack flow control when sending from target to host?

When using the NXP/Keil usbcdc example, data appears to be lost when sending large amounts from target to host. Does the Keil usbcore/usbcdc lack flow control, or is this a limitation of the usb cdc specification?

Target: LPC1343
Compiler: gcc
Host: Linux (Ubuntu)

vcomdemo.c V1.02
cdcuser.c V1.10
usbcore.c V1.20
serial.c V1.10

Changes below were made to the usbcdc example, to send an incrementing stream of bytes [0..255].

cat /dev/ttyACM0 > capture
hexdump capture | less

* serial.c *

int ser_Read (char *buffer, const int *length) {
        static int increment = 0;
        buffer[0] = increment++;
        return 1;
}

void ser_AvailChar (int *availChar) {
        return 1;
}

Parents
  • > Are you implementing the test code correctly?
    > For example, this code is nonsense at all.

    The code I presented is to construct a pathological test, and certainly should not be used in application code. Setting ser_AvailChar to always return '1' signals that there is always data available. In ser_AvailChar, a single incrementing byte is sent on each call.

    What I would expect to see in the output file is [0,1,2,3,4,...,255,0,1,2...], repeated as fast as the interface can send and the host can accept.

    However, I do not see this, which returns me to the original question. Does the Keil USBCDC example support flow control? If it does, can someone please demonstrate this under the principles I have presented of sending a test sequence that floods the interface with deterministic data.

Reply
  • > Are you implementing the test code correctly?
    > For example, this code is nonsense at all.

    The code I presented is to construct a pathological test, and certainly should not be used in application code. Setting ser_AvailChar to always return '1' signals that there is always data available. In ser_AvailChar, a single incrementing byte is sent on each call.

    What I would expect to see in the output file is [0,1,2,3,4,...,255,0,1,2...], repeated as fast as the interface can send and the host can accept.

    However, I do not see this, which returns me to the original question. Does the Keil USBCDC example support flow control? If it does, can someone please demonstrate this under the principles I have presented of sending a test sequence that floods the interface with deterministic data.

Children