Skip to main content
Visitor II
August 7, 2025
Question

stm32l412kbu3 USB

  • August 7, 2025
  • 2 replies
  • 221 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
    This topic has been closed for replies.

    2 replies

    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.

    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.