Skip to main content
Dave Nadler
Senior III
Jun 24, 2019 6:00 PM UTC
Question

Bug: USB CDC fails to save-echo LineCoding or respond to setCtrlLineState

Code generated for F429 using CubeMXIDE:

USB CDC code in usb_cdc_if.c does not save/echo line coding info,

nor respond (and ignore by default) to setCtrlLineState.

This prevents some OS and common utilities (ie PuTTY) from connecting via CDC.

For information on what's required, see:

http://janaxelson.com/usb_virtual_com_port.htm

or Jan's excellent book on USB.

FYI, your competitors I've used recently to create products do this correctly;

namely USB stacks from Silicon Labs, Freescale/NXP, and Microchip.

Also, CubeMX needs to provide options and generate working code for:

  • USB OTG
  • multiple USB classes

Again, you're behind your competitors here.

Thanks,

Best Regards, Dave

This topic has been closed for replies.

5 replies

Dave Nadler
Senior III
Aug 6, 2019 8:32 PM UTC

@Markus GIRDLAND​ ? @Nesrine.JLASSI​ ? @Nawres GHARBI​ ? Anybody there? 6 weeks with no response?

Markus GIRDLAND
ST Employee
Aug 7, 2019 8:37 AM UTC

I believe this needs to be provided by the firmware team, I'll create a ticket for them unless they have one already.

Dave Nadler
Senior III
Aug 9, 2019 3:26 PM UTC

@Markus GIRDLAND​ I'd submit a pull request, but F4 stuff is not yet available on github,

so I've attached suggested patches addressing these 4 problems in USB stack:

1) Save/restore linecontrol

2) Monitor host DTR as required to control device->host flow

3) Add callbacks to support queued (not polled!!) transmission as normal for OS applications

4) USB command processing requires wValue in some cases without payload

This requires fixes to both usb_cdc_if.c and usbd_cdc.c

Can you confirm when you've created a ticket(s) for all 4 problems and attached the suggested patches?

Thanks,

Best Regards, Dave

Pavel A.
Aug 10, 2019 12:44 AM UTC

F4 already available on github.

https://github.com/STMicroelectronics/STM32CubeF4/

-- pa

Dave Nadler
Senior III
Aug 10, 2019 1:17 AM UTC