4 Replies Latest reply on Mar 7, 2019 1:51 AM by ajmc_3522501

    Identify the Firmware build date of a CX3 UVC-CDC device

    ajmc_3522501

      Hi,

       

      For identifying the firmware version i had earlier posted a ticket, Identifying the version of firmware in CX3 UVC-CDC device

      I had solved it in a different way by adding the revision into the UVC descriptors.( device release number in the Standard device descriptor).

       

      Now i also need to add the firmware build date along with this information.

      Is there an option to add it into the UVC descriptor ?

       

      If not what are the other ways to achieve the same.

       

      Another question would be in the ticket Identifying the version of firmware in CX3 UVC-CDC device   ,It describes using vendor commands. How can i initiate a custom vendor command.( Python would be the preferred language)

       

      Regards

      Ajay

        • 1. Re: Identify the Firmware build date of a CX3 UVC-CDC device
          abhinavg_21

          Hi Ajay,

           

          There is one more field in the descriptors that is "Serial Number String Descriptors". In CyFxUSB30DeviceDscr structure make the Serial Number String descriptor index to 0X03. Also add the serial number string descriptor at the end of "dscr.c" file.

          Don't forget to register this descriptor in "AppInit" function. To add please use of "CyU3PUsbSetDesc" API.

          For example it is already used to set the product descriptor:

          apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 2,

          (uint8_t *) CyFxUSBProductDscr);

          You can add String descriptor as:

          apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3,

          (uint8_t *) CyFxUSBSerialDscr);

           

          Thanks & Regards
          Abhinav Garg

          • 2. Re: Identify the Firmware build date of a CX3 UVC-CDC device
            ajmc_3522501

            Hi Abhinav,

             

            Could you please tell me how you can read this info using python.

             

            I tried using the serial.tools.list_ports.comports() property in python and printed the parameter serial_number, but it gave the result as '6'. But the description of it mentioned the 'serial_number' to be a string.

             

            Regards

            Ajay

            • 3. Re: Identify the Firmware build date of a CX3 UVC-CDC device
              abhinavg_21

              Hi Ajay,

               

              Are you able to get the serial number in Control Center window? See the attached snip of control center window.

              Serial Number = "FX3"

              If not then you have to follow the following steps to add it properly in the firmware:

               

              1. Add the following piece of code in descr.c file.

              /* Standard Serial string descriptor */

              const uint8_t CyFxUSBSerialDscr[] __attribute__ ((aligned (32))) =

              {

                  0x08,                          /* Descriptor size */

                  CY_U3P_USB_STRING_DESCR,        /* Device descriptor type */

                  'F',0x00,

                  'X',0x00,

                  '3',0x00

              };

               

              2. Add "extern const uint8_t CyFxUSBSerialDscr[];" in Cyfxbulksrcsink.h file.(I am taking bulksrcsink example, you can choose your's).

               

              3. Add the following line in "CyFxBulkSrcSinkApplnInit (void)" function before DMA buffer allocation for USB event logs:

              /* String descriptor 3 */

                      apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3, (uint8_t *)CyFxUSBSerialDscr);

                      if (apiRetStatus != CY_U3P_SUCCESS)

                      {

                          CyU3PDebugPrint (4, "USB set string descriptor failed, Error code = %d\n", apiRetStatus);

                          CyFxAppErrorHandler(apiRetStatus);

                      }

               

              Then check it in control center. You will get "FX3" in String Descriptor section as shown in attached image.

              Same procedure you can follow for CX3.

              I can't comment about Python libraries. I haven't use it for CX3.

              Thanks & Regards
              Abhinav

              • 4. Re: Identify the Firmware build date of a CX3 UVC-CDC device
                ajmc_3522501

                Thanks for the solution.

                It worked for me.

                 

                I couldn't see the serial number in the control center but i could see it in the Device manager -> Details -> Property - Parent.

                Also in linux when you read the descriptor that string is shown.

                 

                Regards

                Ajay