FX3 UART debug print message with leading garbage character

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
KeWa_2323766
Level 4
Level 4
25 sign-ins First solution authored 25 replies posted

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

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
Moderator
1000 replies posted 750 replies posted 500 replies posted

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

lock attach
Attachments are accessible only for community members.

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

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

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