9 Replies Latest reply on May 20, 2019 2:41 AM by SrinathS_16

    cdc uart for debug but not print in PC uarttool

    rolic_4206696

      Hi:

       

       

           I want to use cdc virtual uart as a debug uart, but PC uart tool can not print  anything.

       

      can you help me?

       

       

       

      Feige鍥剧墖20190509143447.bmp

        • 1. Re: cdc uart for debug but not print in PC uarttool
          rolic_4206696

              /* Create a DMA_AUTO channel between usb producer socket and uart consumer socket */
              dmaCfg.size = size;
              dmaCfg.count = CY_FX_USBUART_DMA_BUF_COUNT;
              dmaCfg.prodSckId = CY_FX_EP_PRODUCER1_SOCKET;
              dmaCfg.consSckId = CY_FX_EP_CONSUMER1_SOCKET;
              dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
              dmaCfg.notification = 0;
              dmaCfg.cb = NULL;
              dmaCfg.prodHeader = 0;
              dmaCfg.prodFooter = 0;
              dmaCfg.consHeader = 0;
              dmaCfg.prodAvailCount = 0;

              apiRetStatus = CyU3PDmaChannelCreate (&glChHandleUsbtoUart,
                      CY_U3P_DMA_TYPE_AUTO, &dmaCfg);
              if (apiRetStatus != CY_U3P_SUCCESS)
              {      
                  CyFxAppErrorHandler(apiRetStatus);
              }

           

          dmaCfg.prodSckId = CY_FX_EP_PRODUCER1_SOCKET;

          in this place, CY_FX_EP_PRODUCER1_SOCKET can replace CY_U3P_CPU_SOCKET_PROD?

          I only want to print, so this producter shoud be CPU.

           

          • 2. Re: cdc uart for debug but not print in PC uarttool
            SrinathS_16

            Hello,

             

            Most of the FX3 SDK examples use the debug printing capability over the UART interface. For instance, please refer to USBBulkSourceSink example in the FX3 SDK. The CyU3PDebugInit() API automatically creates a DMA channel for debug printing with CPU as the producer socket.

             

            Best regards,

            Srinath S

            • 3. Re: cdc uart for debug but not print in PC uarttool
              rolic_4206696

              hi:

               

                   If i want to use cdc for debug print, i should how to do it?

               

               

              thanks very much!

              • 4. Re: cdc uart for debug but not print in PC uarttool
                rolic_4206696

                hi:

                 

                     In this project, I want to output some character information through the CDC serial port.

                How do I change it?

                 

                 

                such as SendDebugMessage("0123456789", 10);

                 

                Looking forward to your reply!

                • 5. Re: cdc uart for debug but not print in PC uarttool
                  SrinathS_16

                  Hello,

                   

                  Please refer to the attached projects which implement debug print over the CDC interface on the host. Kindly, let me know if this suits your requirement.

                   

                  Best regards,

                  Srinath S

                  • 6. Re: cdc uart for debug but not print in PC uarttool
                    rolic_4206696

                    hi:

                     

                    Thank you for your reply.

                     

                    Using the example project you provided, I displayed two devices on the computer as follows:

                    Feige图片20190514103050.png

                     

                    I have installed CYPress CDC driver,and i use all this driver,but it have not for this device. Is this a reminder that no driver is installed?

                     

                    Feige图片20190514105936.png

                    Now how do I load the driver?

                    I'm looking forward to your reply.

                    • 7. Re: cdc uart for debug but not print in PC uarttool
                      SrinathS_16

                      Hello,

                       

                      - The VID/PID that is used in this example is not present as part of the CypressSerial.INF file (Cypress CDC driver). Hence, the device will not be automatically bound to the Cypress driver.

                      - For the interface with the name 'CDC_Management', choose the 'USB-Serial Adapter' string from the Cypress Serial driver list. Upon successful installation of this, a new 'Unknown Device' comes up in the device manager. Follow the same procedure to manually load driver and choose 'USB-Serial Port' string from the list.

                      The CDC device should now be visible under the 'Ports' section in the device manager.

                      - For the interface with the name 'Bulkloop', use the Cypress CYUSB3 driver and follow the same procedure to bind manually.

                       

                      Best regards,

                      Srinath S

                      • 8. Re: cdc uart for debug but not print in PC uarttool
                        rolic_4206696

                        hi:

                        Thank you for your reply.

                         

                        Follow the steps you said. Now there's a problem.

                         

                        1、For the interface with the name 'CDC_Management', choose the 'USB-Serial Adapter' string from the Cypress Serial driver list.

                        then PC show follow picture:

                        1.png

                        2、For the interface with the name 'Virtual Serial Port Device 00',choose 'USB-Serial Port' string from the list. At this point, a serial port appears, but an unknown device appears.  follow picture:

                         

                        2.png

                         

                        3、For the interface with the name 'Bulkloop' ,choose“cypress fx3 usb bulkloopexample device"  ?

                         

                        飞鸽截图20190514170202.png

                         

                        Best regards,

                        • 9. Re: cdc uart for debug but not print in PC uarttool
                          SrinathS_16

                          Hello,

                           

                          1. Please check if there is a composite device corresponding to the VID/PID used in the firmware (In the example, the hardware IDs used are 0x4242/0xEC04)

                          2. For the interface with the name 'Bulkloop', choose“cypress fx3 usb bulkloopexample device"  ?

                          >> Yes. It can be choosen.

                          3. After choosing USB-Serial Port, there should not be any additional 'Unknown Device'. Please choose "Show Hidden Devices" under "View" tab of device manager and check if there is a device named "USB Bus Enumerator" under "USB Controllers" section.

                           

                          Best regards,

                          Srinath S