STM32CubeMX USB CDC Library Problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-15 9:37 PM
MCU : STM32F446RET
CubeMX Version : 4.26.1
===
Hi! I'm currently developing usb CDC(Communication Device Class / USB-OTG-FS) through STM32CubeMX.
When I upload the automatically generated code without changing any settings, the usb device will not be recognized properly as follows.(Error code 10)
However, following this YouTube video https://youtu.be/oDoavXrQdEg, change the CDC_DATA_HS_MAX_PACKET_SIZE value of usbd_cdc.h file from 512 to 256, and you can see that it is normally recognized.
Is this a problem with the STM32CubeMX library?
Thanks! =)
Solved! Go to Solution.
- Labels:
-
STM32CubeMX
-
STM32F4 Series
-
USB
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-16 5:05 AM
I found a solution! In the CubeMX Setting, setting heap size over 0x1000 makes usb cdc to work properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-16 5:05 AM
I found a solution! In the CubeMX Setting, setting heap size over 0x1000 makes usb cdc to work properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-17 3:35 AM
Hi @YKim.7 ,
Correct! When creating your USB CDC application using STM32CubeMX tool, you should take care of increasing the heap size; Otherwise, USB will not be functional (Using Keil for example, the heap size is 0x200 by default which is too low for USB applications). If you increase it to 0x800, the USB device will be successfully enumerated.
Khouloud.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-08-17 3:29 PM
Please note: this size belongs to High speed mode, but your USB controller is FS (Full speed). It cannot work in High speed mode so the max. transfer size is limited to 64. How it works for you with larger size? A miracle, perhaps?
