This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352: USB communication issue and dual network issue

Part Number: AM3352

Hi,

Have a good day!

Customer have connected several USB serial devices on the USB of am3352, and the endpoint type is bulk. Each USB device is a 1-to-4 USB serial port, he connected a total of 6 devices, a total of 24 serial ports. After normal startup, they can communicate with external devices normally, but when he unplug any device, it will affect the normal communication of other devices. Isn't the bulk type dynamically shared? What is the possible cause of this problem?

Customer also use Dual network port of am3352, when he close eth0, eth1 will not work. he use the ifconfig eth0 down command. Are the two network cards not isolated?

  • Hi,

    Does the customer use Linux? Which version?

    When unplugged any device, how exactly does it affect the normal operation of other devices? does the kernel print any log message?

    Network related issues would be handled by different TI personnel, so please create a separate E2E thread for your network issue. This thread will focus on the USB issue.

  • Hi Bin, 

    The kernel version used is linux-3.2.0.

    Customer deign is like this: He extend a hub (7 ports) through the USB of am3352, and then connect a USB to serial device (1 to 4) under each port. I have 6 devices in total, so there are 24 serial devices (ttyusb0 ~ ttyusb23).

    He connect a communication device on each USB port for data exchange.After the system starts up normally, these 24 ports can communicate with external devices normally.But when he unplug one of the USB devices, the communication between the remaining 5 devices (20 ports) and the external devices will be abnormal.

    Through the test, he found that the remaining devices can send data normally, and the external devices can respond normally, but I can't receive the data from the external devices.

    He think this problem is caused by the USB endpoint problem of am3352.Because the USB devices he used before were int type endpoints, so 24 int type endpoints exceeded the limit of 15. Later, He replaced the USB devices with all bulk type。

    What He don't understand is why the first boot is normal. Removing a USB device will cause other devices to be abnormal .The kernel printing information is all the relevant information about USB device removal, and there is no other useful information.

    look forward to your reply.

  • Hi,

    Kernel v3.2 is very old and no longer supported on this forum.

    One simple thing to ask the customer to try is to disable MUSB CPPI41 in kernel config and rebuild the kernel to see if the issue still happens.

  • Hi Bin, 

    thanks for your feedback.

  • I have upgraded the kernel version to the latest 4.19. The dual network problem has been solved, but the USB problem still exists. I think it's a USB endpoint problem. Can am3352 not support up to 48 (24 in, 24 out) bulk endpoints?

  • Hi Baoguo,

    The AM3352 USB controller has 15 in and 15 out endpoints. But only 9in and 9out can be used for high-speed bulk transfers because the Linux kernel driver configures other endpoint fifo differently for other use cases.

    In theory the 24in and 24out usecase should be supported, however, once all 9in or 9out endpoints are allocated, all further bulk transfer requests will be allocated to EP1, which, I guess, would have performance impact. This scenario has never been validated though. so I am not sure what causes the issue that other device cannot receive data after one of the devices is detached.

    As I requested above, has the customer tested if the issue also happens when MUSB CPPI41 DMA is disabled in kernel config?

  • Hi, Bin Liu:
    I cancelled DMA mode according to the method you said, but the problem still exists.I also tried the following methods, but still can't. If the devices only use Bulk or Control transfers, MUSB can support up to 126 devices; But I've only got 24 now.
    Look forward to your reply,thanks.

    /* mode 4 - fits in 16KB */
    static struct musb_fifo_cfg mode_4_cfg[] = {
    { .hw_ep_num = 1, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 1, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 2, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 2, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 3, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 3, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 4, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 4, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 5, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 5, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 6, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 6, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 7, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 7, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 8, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 8, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 9, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 9, .style = FIFO_RX, .maxpacket = 512, },
    #if 0
    { .hw_ep_num = 10, .style = FIFO_TX, .maxpacket = 256, },
    { .hw_ep_num = 10, .style = FIFO_RX, .maxpacket = 64, },
    { .hw_ep_num = 11, .style = FIFO_TX, .maxpacket = 256, },
    { .hw_ep_num = 11, .style = FIFO_RX, .maxpacket = 64, },
    { .hw_ep_num = 12, .style = FIFO_TX, .maxpacket = 256, },
    { .hw_ep_num = 12, .style = FIFO_RX, .maxpacket = 64, },
    { .hw_ep_num = 13, .style = FIFO_RXTX, .maxpacket = 4096, },
    { .hw_ep_num = 14, .style = FIFO_RXTX, .maxpacket = 1024, },
    { .hw_ep_num = 15, .style = FIFO_RXTX, .maxpacket = 1024, },
    #else
    { .hw_ep_num = 10, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 10, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 11, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 11, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 12, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 12, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 13, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 13, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 14, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 14, .style = FIFO_RX, .maxpacket = 512, },
    { .hw_ep_num = 15, .style = FIFO_TX, .maxpacket = 512, },
    { .hw_ep_num = 15, .style = FIFO_RX, .maxpacket = 512, },
    #endif
    };

  • Hi Baoguo,

    This patch won't help your usecase.

    Before we start capturing kernel debug logs, can you please provide kernel dmesg log which includes the time when you remove one USB device and the other devices communication failed.