cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

KeWa_2323766
New Contributor II

I run the GpioApp example firmware on FX3 demo board CYUSB3KIT-003, the SuperSpeed Explorer Kit. I added only one  function to test the UART debugging at line 242.  

      CyU3PDebugPrint (4, "high, returned = %d\n",apiRetStatus);

Please see the attached code.

USB2.0 microB on demo board is connected to PC. The debugging message print both intended message and some leading garbage characters.

pastedImage_0.png

How to remove the garbage leading character?

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator

Hello,

In the CyFxDebugInit() function block, please add the below code after the CyU3PDebugInit() API call.

CyU3PDebugPreamble(CyFalse);

When the above API (CyU3PDebugPreamble() API) is not used, FX3 sends an additional 8 bytes data as preamble onto the UART. Out of these 8 bytes, only the printable characters get displayed on the Terminal while the rest may be seen as white spaces/garbage. This is the reason why additional garbage characters were seen on the terminal.

You can refer to the cyu3debug.c file in the FX3 SDK firmware source to understand more about the CyU3PDebugPrint() and the use of CyU3PDebugPreamble() APIs

Best regards,
Srinath S

View solution in original post

4 Replies
SrinathS_16
Moderator
Moderator

Hello,

The firmware that you have shared is fine and is working at my end. Can you please check if the same issue occurs even with other terminal such as TeraTerm/HyperTerm?

Best regards,

Srinath S

KeWa_2323766
New Contributor II

Srinath,

Thank you. I installed Tera Term. The leading garbage is gone. But one specific debug message printing has an extra " character although it use same function in same format. I am wondering where this " comes from.

pastedImage_0.png

0 Likes
KeWa_2323766
New Contributor II

The sample code I attached in last reply uses UART port on GPIO48 and GPIO49. But it has the same printing extra " issue with using micro B port on demo board.

0 Likes
SrinathS_16
Moderator
Moderator

Hello,

In the CyFxDebugInit() function block, please add the below code after the CyU3PDebugInit() API call.

CyU3PDebugPreamble(CyFalse);

When the above API (CyU3PDebugPreamble() API) is not used, FX3 sends an additional 8 bytes data as preamble onto the UART. Out of these 8 bytes, only the printable characters get displayed on the Terminal while the rest may be seen as white spaces/garbage. This is the reason why additional garbage characters were seen on the terminal.

You can refer to the cyu3debug.c file in the FX3 SDK firmware source to understand more about the CyU3PDebugPrint() and the use of CyU3PDebugPreamble() APIs

Best regards,
Srinath S

View solution in original post