2024-09-26 03:33 AM - last edited on 2024-09-27 07:52 AM by Mike_ST
CubeMX is mostly intended for (or mostly used by) noobs. Noobs are most likely to want to skip an HSE for any reason whatsoever, as it adds complexity to a learning process. So it would be nice if CubeMX would accept HSI as a solution for USB clock source and simply warn the user that this setup is not USB compliant and would not receive certification.
A noob is likely to breadboard a bare mcu chip, not a professional design team. A noob is least likely to buy an expensive evaluation board that would already include an HSE (as opposed to engineering students enrolled at expensive colleges). It seems ST has set minimum requirements on its clientelle.
Solved! Go to Solution.
2024-09-26 05:27 AM
CubeMX will allow you to use HSI for USB on chips which support crystal-less USB such as the STM32H7 or STM32U5 series and others. The STM32F1 is not one of these and does not support crystal-less USB.
Introduction to USB hardware and PCB guidelines using STM32 MCUs - Application note
You can hardwire it to use HSI in code if you want and cross your fingers.
2024-09-26 03:51 AM - edited 2024-10-04 02:16 AM
Hello @mo_FEAR and welcome to the community.
CubeMx is used by newbies and professionals. The HSI is not recommended for USB usage for some STM32 MCUs that's why it's prohibited in CubeMx in your case. In Nucleo board you can either add a crystal or simply use STLINK MCO as clock source for HSE in Bypass mode for your MCU target.
For example for the case of NUCLEO having STLINK V3 version, you can refer to this article on how to use an accurate STLINK MCO as clock source for the target MCU.
2024-09-26 04:09 AM
But even a noob should be able to afford a quartz for 50 ct - or better stick with his plastic cars .
Or not use USB - the connection cable also is very expensive.
2024-09-26 05:27 AM
CubeMX will allow you to use HSI for USB on chips which support crystal-less USB such as the STM32H7 or STM32U5 series and others. The STM32F1 is not one of these and does not support crystal-less USB.
Introduction to USB hardware and PCB guidelines using STM32 MCUs - Application note
You can hardwire it to use HSI in code if you want and cross your fingers.