2024-08-01 01:31 PM
Hi
the USB tutorial of ST is a bit outdated. Do I still need to do the loop back of line coding in usbd_cdc_if.c in function CDC_Control_HS? I am using Stm32f4 and STM32Cube FW_F4 V1.28.0
This is mentined in this video:
https://youtu.be/h9T0RTu9Muc?list=PLnMKNibPkDnFFRBVD206EfnnHhQZI4Hxa&t=1702
Thx
2024-08-01 01:44 PM
In general, yes, although the answer will depend on the terminal software. Some of them don't care, some of them need you to return the same settings it sent to you.
2024-08-01 01:46 PM - edited 2024-08-01 01:47 PM
I am using python actually. Do you think it will matter with different python versions? Or on Linux/mac?
2024-08-01 04:20 PM
Yes, I do think it will matter.
And it's easy to do, so do it. That way you don't have to guess.
2024-08-02 03:16 AM
Hi @MK..1
Here is another implementation to set LineCoding function
case CDC_SET_LINE_CODING:
LineCoding.bitrate = (uint32_t)(pbuf[0] | (pbuf[1] << 8) |\
(pbuf[2] << 16) | (pbuf[3] << 24));
LineCoding.format = pbuf[4];
LineCoding.paritytype = pbuf[5];
LineCoding.datatype = pbuf[6];
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.