USB Printer support for Renesas s7g2

Hi Team,

 

I am using Renesas s7g2 development board , I configured USB hub host module and working as expected tested with usb stick and key board.

We are using Rongta mobile printer (RPP 300) device, connected printer device to USB hub Renesas board,

How to configure printer for renesas board (Hub) ?

Need to install any driver ?

How to test ?

Please provide me source code , documents or links .

 

Regards,

Naveen. 

  • Hi Naveen,

    You may be interested in Anper's response to a similar question: renesasrulz.com/.../33331

    The manufacturer of this printer might hopefully provide you description of the communication protocol.

    Regards,
    adboc
  • In reply to adboc:

    Hi adboc,

    Thanks for the reply,

    I connect to USB printer (RONGTA RPP300 ) to laptop its detected as COM5 port (prolific driver already installed in my lpatop). same printer if connect to Renesas hub it should be detected as COM port, How to check the com port detection,
    How to test COM port communication, We are developing product this requirement is pending,
    Please help me on this.

    Regards,
    Naveen.
  • In reply to naven:

    Hi Naveen,

    USBX included in SSP has code for handling Prolific class (see Components tab > Express Logic > all > ux_host_class_prolific_src), however it is not officially supported. If you've got a development/production license (may apply on www.renesas.com/.../ssp.html - must be signed in), you may view the source code in synergy/ssp/src/framework/el/ux_host_class_prolific_src (add it in Components tab first and generate project content).

    Regards,
    adboc
  • In reply to adboc:

    Hi adboc,

    Thanks for the reply,

    As per your inputs generated project and i got ux_host_class_src files , please provide me source link for testing COM communication via Hub module.

    Regards,
    Naveen.
  • In reply to naven:

    Hi Naveen,

    I meant ux_host_class_prolific_src, not ux_host_class_src. The USBX Host Class Hub Module Guide has detailed description how to use Host Class Hub, in short words, you should add New Stack > X-Ware > USBX > Host > Classes > HUB > USBX Host Class HUB and all classes you would like to handle (e.g. CDC-ACM or Prolific, please remember that the latter is not available in stacks, you should enable it in Components tab).

    Regards,
    adboc

  • In reply to adboc:

    Hi adboc,

    Thanks for the reply,

    How to send the commands (printer) or data to UART port in renesas board, any sample code available please provide me links.

    Regards,
    Naveen.
  • In reply to naven:

    Hi Naveen,

    Examples for Printer Host Class are not available, but there module guides for UART communication: www.renesas.com/.../keyword-search.html

    Regards,
    adboc
  • In reply to adboc:

    HI adboc,

    1. I added prolific components in my code and generated project after project generated compiled code below are the error logs.

    11:59:42 **** Incremental Build of configuration Debug for project USBX_Host_Class_HUB_EL_MG_AP ****
    make -j4 all
    make: *** No rule to make target '../synergy/ssp/src/framework/el/ux_host_class_prolific/ux_host_class_prolific_src/ux_host_class_prolific_transfer_request_completed.c', needed by 'synergy/ssp/src/framework/el/ux_host_class_prolific/ux_host_class_prolific_src/ux_host_class_prolific_transfer_request_completed.o'. Stop.

    11:59:43 Build Failed. 1 errors, 0 warnings. (took 1s.132ms)

    Note : compiled code after clean but same issue.

    2. In case if compilation success how to check the below API ?

    ux_host_class_prolific_write


    Regards,
    Naveen.
  • In reply to naven:

    Hi Naveen,

    Could you manually remove Debug directory and build the project again?

    As I wrote earlier, the Prolific Host Class is not officially supported, but I suppose you should do at least:
    1) Register this class using ux_host_stack_class_register (please see synergy_gen/common_data.c file, ux_common_init0 function).
    2) In host event notification callback, if Prolific device is detected, assign the instance of this device (as a keyboard is detected in USBX_Host_Class_HUB_EL_MG_AP app).
    3) If you already have the instance, you can call ux_host_class_prolific_write function.

    Regards,
    adboc

  • In reply to adboc:

    Hi adboc,

    Thanks for the reply,

    1. Compilation error resolved.
    2. As per your inputs register prolific class in stack after that checking the status by using below function

    status = ux_host_stack_class_get(_ux_system_host_class_prolific_name, &prolific_class);
    status return value always 89.

    code testing with usb to rs232 cable this cable detected in laptop and com port 5.
  • In reply to naven:

    Hi Naveen,

    Have you registered the class by calling ux_host_stack_class_register (_ux_system_host_class_prolific_name, ux_host_class_prolific_entry)? Error code 89 (0x59) means UX_HOST_CLASS_UNKNOWN and is returned if the class hasn't been registered.

    Regards,
    adboc
  • In reply to adboc:

    Hi adboc,

    1. After register issue is resolved by using below code ,
    please can you check any mistakes

    ux_host_stack_class_register(_ux_system_host_class_prolific_name,_ux_host_class_prolific_entry);
    status = ux_host_stack_class_get(_ux_system_host_class_prolific_name,&prolific_class);

    if((UINT) UX_SUCESS == status)
    {
    if(prolific_class == p_host_class)
    {
    if(NULL == g_prolific)
    {
    g_prolific = p_instance;
    if(CodeDebug->DHCR & CodeDebug_DHCSR_C_DEBUGGEN_MASK)
    {
    printf("prolific device detected\n");
    }
    }
    }
    if((ULONG) UX_DEVICE_REMOVAL == event)
    {
    if(p_instance == g_prolific)
    {
    g_prolific = NULL;
    if(CodeDebug->DHCR & CodeDebug_DHCSR_C_DEBUGGEN_MASK)
    {
    printf("prolific device removed\n");
    }
    }
    }

    2. Printing text is not working

    Below function using for print

    UX_HOST_CLASS_CDC_ACM *Ptr_CdcPrinterClass;
    char e_String[100];

    strcpy(e_String, "Test printer\n");
    ux_host_class_prolific_write(Ptr_CdcPrinterClass,e_String,strlen(e_String),strlen(e_String));

    Please help me on print the page.

    Regards,
    Naveen.
  • In reply to naven:

    Hi Naveen,

    I recommend to register a class in thread's code, not in the host notification callback. Moreover, you should use g_prolific instead of Ptr_CdcPrinterClass. The last parameter to ux_host_class_prolific_write is a pointer to ULONG, the function will store a number of actually sent bytes. You should declare ULONG variable and give an address to the function e.g. ULONG bytes_sent; ux_host_class_prolific_write(..., &bytes_sent);

    Please see a simple example below (note it hasn't been tested with Prolific device):

    S7_SK_USBX_Prolific_1_3_3.zip

    Regards,
    adboc

  • In reply to adboc:

    Hi adboc,

    Thanks for the reply,

    How to check the data transfer to usb printer and How to set the baud rate , please provide me required information.

    Regards,
    Naveen.
  • In reply to naven:

    Hi Naveen,

    As I wrote earlier, if you've got a development/production license (may apply on https://www.renesas.com/en-us/products/synergy/software/ssp.html - must be signed in), you may view the source code in synergy/ssp/src/framework/el/ux_host_class_prolific_src (add it in Components tab first and generate project content).

    Additionally, you may ask printer's manufacturer for communication protocol, commands etc.

    Regards,
    adboc