Skip to main content
SLevi.1
Associate III
August 7, 2025
Question

stm32l412kbu3 USB

  • August 7, 2025
  • 2 replies
  • 222 views

I want to use the 32-pin package of STM32L412 (STM32L412KBU3) as a USB device, using I2C to connect to a few sensors.

  • If I use HSE clock on pin PA0, any suggestion as to a suitable crystal & caps?
  • Could I use LSE instead, would this be accurate enough for reliable USB?
  • Is the internal HSI clock accurate enough for USB? Would it be corrected?
  • How to get power from USB-C connector to Vdd - I assume an LDO convertor to get from USB 5v down to 3.3v

2 replies

TDK
Super User
August 7, 2025

> If I use HSE clock on pin PA0, any suggestion as to a suitable crystal & caps?

See here for some recommendations and how to choose a crystal:

Guidelines for oscillator design on STM8AF/AL/S and STM32 MCUs/MPUs - Application note

 

> Could I use LSE instead, would this be accurate enough for reliable USB?

LSE doesn't help with USB support.

 

> Is the internal HSI clock accurate enough for USB? Would it be corrected?

The STM32L412 supports crystal-less USB, which means it can use the HSI when being a USB device. No HSE needed.

Introduction to USB hardware and PCB guidelines using STM32 MCUs - Application note

 

> How to get power from USB-C connector to Vdd - I assume an LDO convertor to get from USB 5v down to 3.3v

Yes, use a 3.3V LDO.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Technical Moderator
August 7, 2025

Hi @SLevi.1 

You can use CRS as hardware-based trimming of HSI48 to ensure that the USB clock frequency stays within the tight tolerance required by the USB specification (±0.25%), without needing an external crystal.

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.Best regards,FBL