I am trying to make a PCB with STM32 L412KB . Data sheet says it can use a crystal of 4 MHz - 48 MHz. But when I initialize the HSE under RCC option in Cubemx I get only one pin as RCC_CK_IN and no RCC_CK_OUT. However, LSE crystal highlights two pins.

Does it require special kind of oscillator or is there a bug or error in datasheet or software?


edit: schematic image from nucleo board

enter image description here

  • 1
    \$\begingroup\$ "One-pin OSC in" suggests that Cubemx is expecting you to provide an external oscillator rather than a crystal for its internal HSC (which requires 2 pins). An external oscillator is connected to OSCin pin, and to GND (Vss). This chip has TWO oscillator domains - are you confusing them...(HSE vs. LSE)? \$\endgroup\$ – glen_geek May 8 at 14:24
  • \$\begingroup\$ @glen_geek Data sheet says, it can use high speed external crystal or ceramic resonator. I've referred nucleo board schematic using same MCU, LSE OUT appears to be shared. \$\endgroup\$ – Mridul May 8 at 14:37
  • \$\begingroup\$ The datasheet, table 14, page 56, shows that PH0 and PH1 are the pins for an external high-speed crystal - but these are not available on all package options (only the 48- and 64-pin versions). Which package are you using? \$\endgroup\$ – brhans May 8 at 14:46
  • \$\begingroup\$ @brhans its a UFQFPN32 package. I would normally use f103 chip but current IC shortage has forced me to consider L412 \$\endgroup\$ – Mridul May 8 at 14:53
  • \$\begingroup\$ Well, there's your answer. 32-pin package for the L412 has no external HSE crystal option. If you refer back to the datasheet to page 57 you'll see that the 32-pin packages use PA0 as an option for the HSE, but that's for an external oscillator, not a crystal. It's labelled 'CK_IN' compared to PH0/PH1 labelled as 'OSC_IN/OSC_OUT' because they're connected to the IC's internal oscillator (which the 32-pin package doesn't have). \$\endgroup\$ – brhans May 8 at 15:02

Since you are using Nucleo, the MCU that handles the ST-LINK debugging has the crystal oscillator, and it provides a square wave clock out to the target MCU. It is the MCO pin that can fed to two pins in the target MCU.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.