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.

Beaglebone-Black, g_printer flow control ?



Hi !

I use ti-processor-sdk-linux-am335x-evm-01.00.00.03 in Beaglebone-Black.

Also, I use g_printer module for printer function.

I want know What mathod is flow control to connect between Beaglebone-Black and Host PC with USB.

Let me know How use follow status code.

#define PRINTER_NOT_ERROR 0x08
#define PRINTER_SELECTED 0x10
#define PRINTER_PAPER_EMPTY 0x20

Host PC is connect to Beaglebone-Black with USB High-Speed.

Data Send Speed is too fast.

Then Beaglebone-Black lost data.

I need flow control for USB Printer Class.

Help !

  • I will ask the USB experts to look at this.
  • g_printer is not supported/validated in TI Processor SDK, since it requires further implementation of a user space application. But we have customers using it on am335x without any issue.

    With a quick glance on the g_printer driver source code, the flow control should be already in there. g_printer by default allocates 10 rx buffers and queues them to the usb controller driver. If the printer application does not run fast enough to offload these rx buffers, the rx queue will be empty and the controller will NAK the OUT token from the usb host, which prevents the host sending further data.


    To further debug this, you could run a test without running your printer user space application (so that the rx data will not be offloaded at all), then capture the usb bus trace to see what is happening.

    hoyoun lyu said:

    Let me know How use follow status code.

    #define PRINTER_NOT_ERROR 0x08
    #define PRINTER_SELECTED 0x10
    #define PRINTER_PAPER_EMPTY 0x20

    These are for printer status, not for flow control. Please refer to kernel doc Documentation/usb/gadget_printer.txt for more details.

  • Hi, Bin.

    Thank you Reply.