Can i redirect CyU3PDebugPrint message from CY_U3P_LPP_SOCKET_UART_CONS to Y_FX_EP_CONSUMER_CDC_SOCKET

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

cross mob
jkhoo
Level 3
Level 3
25 replies posted 25 sign-ins First solution authored

Hi FX3 team,

From the example code in slavefifo_example\slfifosync, the UART in CyFxSlFifoApplnDebugInit (void) in the example code is pointing to CY_U3P_LPP_SOCKET_UART_CONS. meaning the UART message will be send to the physical UART port  in cypress FX3 IC. 

Can i reuse back the same code with minor change on :

  • From the example : CyU3PDebugInit (CY_U3P_LPP_SOCKET_UART_CONS, 😎
  • My changes              : CyU3PDebugInit (CY_FX_EP_CONSUMER_CDC_SOCKET, 8), this is assuming that the USB serial com port is already make available in windows device manager.

and direct the UART message via USB to the host-PC and read it with teraterm terminal? 

the example code i am refering to with the minor change is as in the picture attached.minor change in line 40minor change in line 40

 

0 Likes
1 Solution

Hello,

I have modified the project that was shared in your previous response. Currently, I'm able to obtain the debug logs using the CDC interface with this project. Please test this at your end and let me know if you face any issues.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
18 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please refer to the following blog post:

https://community.infineon.com/t5/Resource-Library/SlaveFiFoSync-example-with-a-CDC-debug-console/ta...

You can also refer to the following thread:

https://community.infineon.com/t5/USB-superspeed-peripherals/FX3-UVC-black-screen-for-400-400-RAW-RG...

Even though the above thread has interactions for adding CDC interface for a UVC device, you can make use of the same modifications for slave fifo too.

Best Regards,
Jayakrishna
0 Likes

Hi JayaKrishna,

I follow the 1st blog post on the link to add the CDC (Adding Communication Device Class Interface to FX3 Firmware - KBA229099)and where able to get the virtual COM3 detected in windows device manager. But as i add the void SwitchConsoles(void) into the slfifo example, i don't see any message appearing in teraterm terminal.

1st blog post refer to : https://community.infineon.com/t5/Resource-Library/SlaveFiFoSync-example-with-a-CDC-debug-console/ta...

4.PNG

SwitchConsoles code that i added in:

1.png

"UsingUARTConsole" variable is place at :

2.png

SwitchConsoles() call is place at:

3.png

0 Likes

Hi,

Can you please share the complete project with us? It looks like the device went to the bootloader mode. I would like to check the code to see why this happened.

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

Here are the project in the attachment.

Regards, jkhoo

0 Likes

Hello,

Can you please let me know why you have added a separate thread (USBUARTAppThread) in your application. Also, please let me know if the functions CyFxUSBUARTAppStop () and CyFxUSBUARTAppStart () are added to configure the DMA channels for obtaining the debug prints. If my understanding is not correct, then please let me know why it is used.

Best Regards,
Jayakrishna
0 Likes

I follow the example provided by the link provided by you Adding Communication Device Class Interface to FX3 Firmware - KBA229099

where the below CDC function are added into the slfifosynch example. They are:

USBUARTDmaCallback(), USBUARTAppStart(), USBUARTAppStop(), USBUARTAppInit(), USBUARTAppThread_Entry ().

And yes, USBUARTAppStart(), USBUARTAppStop() are added to configure the DMA channels for obtaining the debug prints.

 

0 Likes
jkhoo
Level 3
Level 3
25 replies posted 25 sign-ins First solution authored

Do let me know if it is not advisable to have a separate USBUARTAppThread_Entry ().

My intention to add the CDC is to only print the message via CyU3PDebugPrint() at the teraterm terminal. not so much on using the terminal to send instruction into the cypress firmware.

0 Likes

Hello,

I have modified the project that was shared in your previous response. Currently, I'm able to obtain the debug logs using the CDC interface with this project. Please test this at your end and let me know if you face any issues.

Best Regards,
Jayakrishna
0 Likes

Can you tell me which file has you modified?

0 Likes

Hi, 

I removed the unwanted functions that you mentioned in your previous response. Also, I added few lines of code to the file cyfxslfifosync.c (line #499 - line #545).

Best Regards,
Jayakrishna
0 Likes

i am trying it our now, should take about 10 mins.

 

0 Likes
jkhoo
Level 3
Level 3
25 replies posted 25 sign-ins First solution authored

i don't see message in the terminal. do i need to type anything in the control center to get the message?

0 Likes

Hello,

Please let me know if you are testing with the project that was shared in my previous response or not. If not, then please try testing with that project and let me know if you are still not getting any prints. 
You need not type anything in the control center to get the print. The API CyU3PDebugPrint () will directly print the messages in the terminal.

Best Regards,
Jayakrishna
0 Likes

yes, i am trying the project you send me.

0 Likes

Hello,

Have you made any modifications to this firmware? This is because I am able to see the prints "Data tracker: .." continuously at my end without any issues. Please try uninstalling and re-installing the device again from the device manager and check if you are able to get the prints.

Also, can you please test on a different PC?

Best Regards,
Jayakrishna
0 Likes

noted on the advise, will try it next week monday, its a bit late here, need to go off.

you have a good day.

0 Likes

Hi Jayakrishna,

Yes, it is working now, i can see message appearing in the terminal. Many thanks for your guidance.

Really appreciated the support, JJ

0 Likes

Hi,

We are glad to hear that the issue is resolved.

Best Regards,
Jayakrishna
0 Likes