9 Replies Latest reply on Apr 6, 2017 6:38 AM by konrad_1872231

    Fx3 Uart debugging printing garbage

    chris.l.

      Hi guys,

         

      I am trying to get UART debugging working on the FX3 with the UVCVideoClass example.

         

      Unfortunately I only get garbage in my console:

         

      Instead of the expected "App Started\r\n" I get "~_��y��}  �Y =  57��" in my serial console (Which is set to 115200-8-N-1 - I only mention this because I have seen similar errors when the baudrate is not set up propperly).

         

      This happens with every CyU3PDebugPrint.

         

      My uart config:

         
      uartConfig.baudRate = CY_U3P_UART_BAUDRATE_115200; uartConfig.stopBit = CY_U3P_UART_ONE_STOP_BIT; uartConfig.parity = CY_U3P_UART_NO_PARITY; uartConfig.txEnable = CyTrue; uartConfig.rxEnable = CyFalse; uartConfig.flowCtrl = CyFalse; uartConfig.isDma = CyTrue;   May someone please point me in the right direction?
         
          
      Greetz, Chris
        • 1. Re: Fx3 Uart debugging printing garbage
          content.librarian

           Hi,

             

          you are using uartr with dma. May be you can post the init for DMA to. 

             

           

             

          e. g.

             

           

             

          void

             

          DebugInit (void)

             

          {

             

              CyU3PUartConfig_t uartConfig;

             

              CyU3PReturnStatus_t apiRetStatus = CY_U3P_SUCCESS;

             

           

             

              /* Initialize the UART for printing debug messages */

             

              apiRetStatus = CyU3PUartInit();

             

              if (apiRetStatus != CY_U3P_SUCCESS)

             

              {

             

                  esAppErrorHandler(apiRetStatus);

             

              }

             

           

             

              /* Set UART Configuration */

             

              uartConfig.baudRate = CY_U3P_UART_BAUDRATE_115200;

             

              uartConfig.stopBit = CY_U3P_UART_ONE_STOP_BIT;

             

              uartConfig.parity = CY_U3P_UART_NO_PARITY;

             

              uartConfig.txEnable = CyTrue;

             

              uartConfig.rxEnable = CyFalse;

             

              uartConfig.flowCtrl = CyFalse;

             

              uartConfig.isDma = CyTrue;

             

           

             

              /* Set the UART configuration */

             

              apiRetStatus = CyU3PUartSetConfig (&uartConfig, NULL);

             

              if (apiRetStatus != CY_U3P_SUCCESS)

             

              {

             

                  esAppErrorHandler(apiRetStatus);

             

              }

             

           

             

              /* Set the UART transfer */

             

              apiRetStatus = CyU3PUartTxSetBlockXfer (0xFFFFFFFF);

             

              if (apiRetStatus != CY_U3P_SUCCESS)

             

              {

             

                  esAppErrorHandler(apiRetStatus);

             

              }

             

           

             

              /* Initialize the debug application */

             

              apiRetStatus = CyU3PDebugInit (CY_U3P_LPP_SOCKET_UART_CONS, 8);

             

              if (apiRetStatus != CY_U3P_SUCCESS)

             

              {

             

                  esAppErrorHandler(apiRetStatus);

             

              }

             

          }

             
                  
          • 2. Re: Fx3 Uart debugging printing garbage
            content.librarian

            and may be check if you are using correct UART port. Which chip are you using (FX3)? Are you using development board?

               

            regards,

               

            lumpi 

            • 3. Re: Fx3 Uart debugging printing garbage
              chris.l.

              Hi Lumpi6,

                 

              Thank you for your quick reply.

                 

              My DebugInit looks exactly like yours. I also tried with lower baud rates - without any luck.

                 

              Unfortunately it is not the cypress dev board (and I have no documentation on the board, at least not yet). It has a CyUSB3014-BZX chip.

                 

              I use a FTDI USB serial cable with only GND and TX attached.

                 

              Greetz,

                 

              Chris

              • 4. Re: Fx3 Uart debugging printing garbage
                content.librarian

                 Hi,

                   

                did you measure the signal with the oscilloscope and checked the baudrate as well as the voltage level?

                   

                Is the FTDI supporting the UART levels or needs the FTDI symmetric levels like RS-232?

                   

                check these and may be there is a configuration in FTDI to work with your environment.

                   

                regards,

                   

                lumpi

                • 5. Re: Fx3 Uart debugging printing garbage
                  mudabir.kabir.a

                   Hi Chris,

                     

                  Specifying the baud rate and other port parameters in the serial console application usually overrides the default port settings specified for the device in Device Manager.

                     

                  However sometimes, OS takes the default port setting values mentioned for the device in the device manager. Identify your device in the device manger, right click and choose properties. Change the port settings to appropriate baud rate. now try launching the serial console application with the same port configuration.

                     

                  Hope this helps.

                     

                  Regards

                     

                  Mudabir Kabir

                  • 6. Re: Fx3 Uart debugging printing garbage
                    daniel.o'connor

                     I get this problem too, see: http://www.cypress.com/?app=forum&id=167&rID=93181

                       

                    Unfortunately I have no fix yet.

                    • 7. Re: Fx3 Uart debugging printing garbage
                      daniel.o'connor

                       See my post for my fix (ish)

                      • 8. Re: Fx3 Uart debugging printing garbage
                        chris.l.

                        After checking with the oscilloscope I saw that it was RS232 and not TTL as I was expecting.

                           

                        So thanks again to Lumpi6 for pointing me in the right direction and thanks to all taking interest in my problem

                           

                        Greetz,

                           

                        Chris

                        • 9. Re: Fx3 Uart debugging printing garbage
                          konrad_1872231

                          I had similar problems when i was using CyU3PDebugPrint function to print bytes. I was using 0x%02X for format. Changing it to 0x%X helped me. I didn't notice that CyU3PDebugPrint function couldn't be used with precision.