Change in Baud on PC does not cause USBFS USB_GetDTERate change on USBFS as CDC UART

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

cross mob
AnSa_1225656
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

How to detect a baud rate change on PC change on a on a USBFS CDC device?  Driver issue?  Bug?

USBFS config attached

0 Likes
1 Solution

Hi @AnSa_1225656 ,

The USBUART does not have any transfer rate limitation, but theoretically the transfer rate is limited by the USB Full Speed (12 Mbit/s) in case of PSoC devices.

I have attached the USBFS_UART PSoC 5LP code example. Can you please try it at your end to check if this is working fine for you? You can follow up the code example document to understand the working.

I will explain below the steps which I followed in order to detect the change in the baud rate -

1. I tried to run the program in the debug mode. Meanwhile, I checked that whatever I type on the serial terminal, it is getting printed. This is how the code example should work.

2. Now I added a breakpoint at the line 143 in main.c file in order to check that when I change the baud rate  through the serial terminal, does it set the USBUART_LINE_CODING_CHANGED macro. I then tried changing the baud rate to 115200 and executed "step over" until I reach LCD_Position(0,0) API. 

3. I could see that the value of changed baudrate(115200 here) is getting stored in the string "lineStr" using the USBUART_GetDTERate() API. In the debug mode, if we hover over this variable lineStr, we can see the baudrate as 115200 there. by expanding it's value.

Hence, USBUART_IslineChanged() and USBUART_GetDTERate() APIs works at my end. Can you please follow the above steps and let us know if it this helps or in case of any query?

Best Regards,

Aashita

 

View solution in original post

0 Likes
6 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello @AnSa_1225656 

Could you please attach your complete project? This will help us to recreate the issue at our end.

Also, Kindly let us know how are you changing the baud rate from the PC?

I guess you have created a similar thread in the community: https://community.cypress.com/t5/PSoC-5-3-1-MCU/USBFS-USB-GetDTERate-not-changing/td-p/283508

We will be continuing the discussion over the same thread as well.

Thanks and Regards

Ekta

0 Likes

Ekta, I can send the code directly to you (Cypress/Infineon), but because of client I can not post the code in a more public venue.  Do you have an email that I can send it to?  Basically, I just need a USBFS CDC port example that can detect baud changes.

To change the baud on the PC side, I am changing the baud in the terminal emulator.  I have tried with XBee3 XCTU application as well as TeraTerm, and PuTTY.  The XBee3 module that is on the UART side needs the baud change when it goes to bootloader mode.

 

0 Likes

@Ekta_N Did you see my last note?

0 Likes
AnSa_1225656
Level 4
Level 4
50 replies posted 25 replies posted 10 replies posted

Still looking for some help

0 Likes

Hi @AnSa_1225656 ,

The USBUART does not have any transfer rate limitation, but theoretically the transfer rate is limited by the USB Full Speed (12 Mbit/s) in case of PSoC devices.

I have attached the USBFS_UART PSoC 5LP code example. Can you please try it at your end to check if this is working fine for you? You can follow up the code example document to understand the working.

I will explain below the steps which I followed in order to detect the change in the baud rate -

1. I tried to run the program in the debug mode. Meanwhile, I checked that whatever I type on the serial terminal, it is getting printed. This is how the code example should work.

2. Now I added a breakpoint at the line 143 in main.c file in order to check that when I change the baud rate  through the serial terminal, does it set the USBUART_LINE_CODING_CHANGED macro. I then tried changing the baud rate to 115200 and executed "step over" until I reach LCD_Position(0,0) API. 

3. I could see that the value of changed baudrate(115200 here) is getting stored in the string "lineStr" using the USBUART_GetDTERate() API. In the debug mode, if we hover over this variable lineStr, we can see the baudrate as 115200 there. by expanding it's value.

Hence, USBUART_IslineChanged() and USBUART_GetDTERate() APIs works at my end. Can you please follow the above steps and let us know if it this helps or in case of any query?

Best Regards,

Aashita

 

0 Likes

@Aashita_R , Thank you!  I will validate here today.

0 Likes