‎2017-11-07 01:49 AM
Hello,
I am working on a STM32H743 – NUCLEO 144 and need to use OTG_FS device only option in CDC mode.
I generated a project using the stm32cubeMX and have defined:
Found 2 problems:
As a test, same steps (using the cube) were applied on STM32L496 – nucleo, the L4 board enumerates and works properly as usb OTG.
Did someone encountered these problems on STM32H7?
What am I missing?
Amann.Joerg
, I saw your question about the stm32H743 USB, did you manage to run the OTG FS CDC mode?Thanks for the help!
null‎2017-11-07 01:58 AM
Yes , working without a problem.
‎2017-11-07 09:02 AM
Thanks for the fast response, glad to hear that it is working for you!
I downloaded your project for reference, the device is still not enumerated.
I saw you defined a HSE clock, did you add an external crystal source to the nucleo board? Any additional changes you made?
Also, I saw a functions called
HAL_PWREx_EnableUSBReg(), HAL_PWREx_EnableUSBVoltageDetector() in this file stm32h7xx_hal_pwr_ex.h.
D
id anybody use them?Thanks a lot!
‎2017-11-16 07:45 AM
Hello
marina.brener
,Please add HAL_PWREx_EnableUSBVoltageDetector function call to usb_device.c file. This may resolve your problem.
Best Regards
Imen
‎2018-05-09 04:19 PM
Yeaaaah, this was the issue for me as well:
Having VBUS pin configured but not doing thisHAL_PWREx_EnableUSBVoltageDetector() call - USB will not do anything (except one interrupt to reset USB device). Maybe obvious in device mode with VBUS monitor.
Thank you.BTW:
yes, all data on DTCM cannot work (DMA has no access). I placed all my data on RAM_D1. Even caches enabled and not doing cache maintenance it works fine: USB is enumerated and my audio recording device works on PC. Cool.‎2018-10-05 02:32 AM
‎2018-12-06 01:06 PM
Blocked by this bug for couple days until I found this thread. Great job guys!
‎2020-01-16 09:33 AM
Thank's so much, had the same problem.
:grinning_face:
‎2021-05-03 09:25 AM
Hi @KVija​ your code work! Thank for it !
I decided to change speed of bitrate for data that transferd, but could,n to see that in code .
Show me, please, place in your code, where i could change bitrate for VCP from 115200 to maximal, like 921300.
Best regards.
‎2021-05-03 11:30 AM
Not sure, about which USB VCP we are talking:
For a "full", native USB VCP (e.g. via the USR USB port):
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];
/* Add your code here */
break;
case CDC_GET_LINE_CODING:
pbuf[0] = (uint8_t)(linecoding.bitrate);
pbuf[1] = (uint8_t)(linecoding.bitrate >> 8);
pbuf[2] = (uint8_t)(linecoding.bitrate >> 16);
pbuf[3] = (uint8_t)(linecoding.bitrate >> 24);
pbuf[4] = linecoding.format;
pbuf[5] = linecoding.paritytype;
pbuf[6] = linecoding.datatype;
/* Add your code here */
break;
You have just to remember what was requested, in order to return it. Or, you could to something with the info. But the data transfer, the VCP bit rate is actually any possible via the type of USB (FS, HS).
If it is the VCP on Debug/Power port - it goes via a real UART, from/to external chip and you had to change your UARTx configuration.