USB device mode can omit the high-speed crystal, but hardware population alone is not enough
The STM32L476 supports using a 32.768 kHz LSE reference to trim its internal MSI and provide a suitable 48 MHz clock for USB device use. This can eliminate the high-speed HSE crystal. The watch crystal is a calibration reference, not the direct 48 MHz source. The actual USB clock comes from the configured clock tree. Verify the requirements separately for other clock paths and USB roles.
A running calendar does not show that USB has selected a trimmed clock. Nor does occasional enumeration prove the clock came from MSI instead of a PLL or a path selected later in software. Verify low-speed oscillator readiness, calibration state and USB clock selection as separate facts.
Why LSERDY must come before MSIPLLEN
The reference manual requires LSE to be enabled and LSERDY to be set before MSIPLLEN can be enabled. Hardware blocks enabling this mode without a ready LSE. Finding the write in source code is not evidence that the write took effect. On the board, distinguish the low-speed enable command, hardware ready status and the actual latched MSI calibration state.
| Check | Evidence | What it does not establish alone |
|---|---|---|
| LSE enabled | LSEON | Crystal is oscillating |
| LSE ready | LSERDY | MSI calibration is on |
| MSI calibration enabled | Read back MSIPLLEN | USB selected MSI |
| USB 48 MHz path | Clock selection and measured behavior | Cannot infer it from CPU speed or an active RTC |
What happens if the low-speed reference fails?
The manual says hardware clears MSIPLLEN when LSE is disabled or its clock-security system detects an applicable LSE fault. Test this separately from startup. If a product uses sleep or peripheral reinitialization, verify which low-speed state is retained, where the MSI range comes from and whether calibration and the USB clock selection recover. Other firmware running after wake-up does not establish USB timing recovery.
A 48 MHz display does not establish accuracy
The data sheet describes hardware trim to better than ±0.25% when a 32.768 kHz reference is available and describes the USB device path. At 48 MHz, 0.25% is 2500 ppm or 120 kHz. This conversion helps choose measurement resolution; it is not a prediction that every board reaches a limit, or a substitute for USB requirements. Preserve the applicable specification conditions.
A divided-by-four node would nominally be 12 MHz, where the same fractional error corresponds to 30 kHz. Document the measurement point and real divider. Software GPIO toggling can include bus, polling and interrupt latency and is not necessarily MSI frequency. Use a traceable reference and a hardware observation point with a known source. Also test cold starts, repeated connection and the required resume cases at the complete USB interface.
Selecting and validating the low-frequency crystal
Epson lists an FC-135 32.768 kHz, 7 pF option, Q13FC13500002, in its STM32L4/L4+ matching information. Treat it as a starting point and verify the complete ordering code, board revision, load and drive conditions. A family example does not qualify every layout. Routing, adjacent signals, test points and parasitics can affect startup. If load or drive settings differ from a reference design, validate those actual conditions.
Separate cold start, brief interruptions and return to service
Record power-up, LSERDY, confirmed calibration, USB clock selection and initial successful connection. Use consistent event definitions. If the product sees a slow supply ramp, cold conditions or substantial load changes, include relevant in-range worst cases and a bounded timeout. Prefer status and buffered observation to probing a sensitive crystal node.
After normal operation, test sleep and resume to determine what remains enabled, what is lost and which steps software repeats. Keep a snapshot before reinitialization if rerunning the driver makes the problem disappear. For intermittent cold-start enumeration, first match the customer's power-up and host conditions instead of substituting a crystal with unknown specifications.
Keep the evidence needed to omit the HSE part
Record the low-speed part and board revision, verify LSERDY before MSIPLLEN, read back calibration and confirm USB selects its intended clock. Preserve cold-start, resume and environmental results separately. Define what the product does if LSE is missing, including the appropriate timeout, fallback or refusal to connect. Omitting a high-speed crystal does not remove the low-speed verification requirement.
“No high-speed crystal” describes the board; it does not mean the same calibration accuracy without any crystal. This design still depends on its low-speed reference. Keep the clock tree and the hardware choices together so both procurement and firmware know which condition cannot be skipped. Apply the validation method to newer products without assuming their registers and peripherals match STM32L476.
An A/B review can distinguish three cases: LSE never becomes ready, firmware attempts the calibration write early and never retries after LSE is ready, or calibration works but USB uses another path. Record observed evidence rather than assuming every failure fits one category. Preserve supply, crystal lot, firmware revision and cold-start time for each sample; do not overwrite other units' failures with a single pass.
Allow enough time for the low-speed reference before committing to a USB appearance deadline. Startup with the LSE already maintained may differ from the first startup after complete power loss. Budget and measure them separately to distinguish a hardware timing issue from software using the same timeout for both.
