FX3: CyU3PDebugPrint Not Printing UART Debug Message - KBA229813

Version 1

    Version: **

     

    Question:

    Why does CyU3PDebugPrint not print any debug message?

     

    Answer:

    There could be multiple reasons why the UART debug message is not printed even though the CyU3PDebugPrint API is called in the firmware. Do the following, if the debug message is not printed:

     

    1. Enable UART in the IO matrix configuration.

    Figure 1. Enabling UART

    2. Check the FX3 pins where the COM port (UART connector) is connected on the PCB.

    • If the COM port is connected to GPIO [46]-[49], the IO Matrix should be configured for GPIF bus width of 16 bits and lppMode should be set as Default LPP mode where all peripherals are enabled.

    Figure 2. IO Matrix Configuration when COM Port is Connected to GPIO [46]-[49]

     

    Figure 3. UART Pin Configuration

    • If the COM port is connected to GPIO [53]-[56], the IO Matrix can be configured either for GPIF bus width of 32 bits with lppMode set as Default LPP mode where all peripherals are enabled or for GPIF bus width of 16 bits with lppMode set as UART only.

    Figure 4. IO Matrix configuration when COM Port is Connected to GPIO [53]-[56]

    Note: If the CYUSB3KIT-003 SuperSpeed Explorer kit is used, CY7C65215 USB Dual channel serial bridge is connected to GPIO [53]:[56]. So, use the IO Matrix configuration shown in Figure 4. If GPIF bus width is set to 16 bits and I2S block is enabled, you cannot use the configuration shown in  Figure 4. Also, the UART will be on GPIO [46] :[49] (as shown in Figure 3); then map GPIO [46]-[49] to GPIO [53]:[56] using jumper wires to get the debug prints.

     

    3. After initializing the UART block by calling the CyU3PUartInit () API, set the UART configuration by enabling the UART transmitter and set UART mode as DMA mode.

    Figure 5. UART Block Configuration

    • Check whether the firmware logging functionality is initialized by calling the CyU3PDebugInit API after setting the UART configuration.
    • Confirm that the UART consumer socket (CY_U3P_LPP_SOCKET_UART_CONS), through which the logs are output (that is, the first parameter passed to the CyU3PDebugInit API), is not used by any other DMA channel in the firmware.
    • Make sure the baud rate, stop bit, parity, and flow control settings of the virtual COM port application (such as Tera Term) is same as the UART configuration used in the firmware.
    • Compare the custom board schematic files with EZ-USB FX3 Superspeed Explorer Kit schematic.

     

    Note: The signal level of the RS-232C DB9 connector is typically +/-12 V.  So, if the signal is connected directly to FX3, the FX3 will be damaged. To connect FX3’s UART pins to the RS-232C DB9 connector, an external level shifter hardware, as shown in Figure 6, is required.

     

    Figure 6. Schematic of UART Connection