2019-03-14 12:10 PM
Hello,
Controller STM32F302C8T - 48 pins. I tried to config USB as CDC with STM32CubeMX version 5.0.1 and USB CDC doesn't work. STM32CubeMX doesn't setup USB-pins as additional functions or alternative functions. How I can setup USB-pins? And how is correct to setup USB-pins as additional functions or alternative functions?
BR,
Eugene.
2019-03-14 03:47 PM
Have you read AN4879 "USB hardware and PCB guidelines using STM32 MCUs" ?
-- pa
2019-03-15 06:46 AM
Hi Pavel,
1. Yes, of cause I read this document and a lot of another your documents. But I didn’t find answer for my questions.
DocID025147 Rev 7, Table 13 shows that USB_DM and USB_DP must be initializing as Additional functions. It doesn’t work.
2. Also I have question about RAM for USB.
Document AN4879 "USB hardware and PCB guidelines using STM32 MCUs", Table 5 shows that STM32F302x6/8 has 1024 bytes SRAM.
But I have access only to 512 bytes.
After I configured USB_DM and USB_DP as alternative functions AF14 and changed defines (for use 512 instead 1024) in stm32f3xx_hal_pcd_ex.h from
to
and in stm32f3xx_hal_pcd_ex.c from
to
USB CDC began to work OK.
3. Additional STM32CubeMX generates source code for USB CDC with errors, see pictures
I fix it each time after STM32CubeMX generated source code, it is not comfortable.
My questions:
- your documentations is not correct?
- why STM32CubeMX doesn’t configure USB_DM and USB_DP?
BR,
Eugene.
2019-03-15 07:56 AM
HI Eugene,
It is not "my documentation", I don' t work at ST :)
CubeMX should generate code which configures the USB pins.
If you modified this code for any reason (yes there can be good reasons to do so)
ensure that it compiles without errors and actually runs.
-- pa
2019-03-15 08:00 AM
Pavel.
Thank you for your trying to help.
BR,
Eugene.