cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX support for HSI clock source for USB

mo_FEAR
Associate

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.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

TDK_0-1727353575772.png

 

You can hardwire it to use HSI in code if you want and cross your fingers.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
SofLit
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
AScha.3
Chief III

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.

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

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

TDK_0-1727353575772.png

 

You can hardwire it to use HSI in code if you want and cross your fingers.

If you feel a post has answered your question, please click "Accept as Solution".