The test board carries an 8 MHz passive crystal. A counter attached to the production test pad reads a steady 2 MHz. Before replacing the crystal, find the source of that signal. The STM32G071 can route a selected clock to its microcontroller clock output, or MCO, after dividing it. With HSE selected and a divider of four, a working 8 MHz crystal gives exactly the expected 2 MHz at that point. This check can save a part removal and an unnecessary rework cycle.
Trace the test point back to the clock output
Use the schematic for the board revision on the bench. Cross-reference the test pad with the MCU pin. If it goes to MCO, label it as a divided clock output on the test drawing. Check the datasheet pin and alternate-function tables for the specific package and read the GPIO configuration from the running firmware. A board spin that changes pin assignment or package can route the fixture to a different net even when the project name remains the same.
A passive 8 MHz crystal works in the MCU oscillator loop, where load capacitance, equivalent series resistance, and startup matter. MCO presents a digital signal routed through the MCU's clock multiplexer and divider. Use the buffered output when troubleshooting clock presence. A conventional probe on a high-impedance crystal node can change the load. For a silent MCO, first verify the GPIO alternate function, output route, and source enable before investigating the crystal loop using the manufacturer's measurement guidance.
Two sources can produce the same 2 MHz
In ST's RM0444, the MCOSEL field in RCC_CFGR selects the clock and MCOPRE sets the output divider. Read those fields and the relevant HSE and HSI ready flags at the time of the test. An 8 MHz HSE divided by four produces 2 MHz, or a 500 ns period. The internal 16 MHz HSI divided by eight gives the same result. The input counter observes identical spacing in both cases.
Keep three observations in the test record. Save the actual MCO source selection, the HSE ready state at measurement time, and the divider read from hardware. Capture a register snapshot from the running target because firmware can change the clock tree after startup or wake-up. Production firmware may also differ from the build open in the IDE. For evidence that the application clock also comes from HSE, check the system clock selection independently. MCO confirms the clock routed to MCO.
Test the divider in two positions
If the sample board permits a diagnostic configuration, disable the MCO output, set the divider as recommended in RM0444, then re-enable the output and capture again. With a working 8 MHz HSE, divide by four gives 2 MHz and divide by two gives 4 MHz. The period moves from 500 ns to 250 ns. If both reads stay at 2 MHz, check the target register, whether the application has overwritten the setting, and whether the fixture is sampling the intended net. Save the source selection even if the frequency follows both divides.
Dividing the clock also scales the absolute difference in hertz. An illustrative 8 MHz clock running 20 ppm fast is 160 Hz high. At divide by four the counter should read 2,000,040 Hz, still 20 ppm high. A display with three decimal places in MHz can round that to 2.000 MHz. Write down the reference accuracy, counter resolution, and stable capture interval in the procedure. ST also notes that MCO can produce shortened cycles during startup or when changing sources. Capture steady-state frequency after the transition and measure cold startup in a separate test with an explicit time origin and acceptance condition.
Make sure the fixture can resolve its acceptance window
Suppose a product calls for a room-temperature board-level HSE tolerance of plus or minus 30 ppm. The ideal four-divided test limits are 1,999,940 Hz and 2,000,060 Hz. Check that counter timebase accuracy and resolution can distinguish those limits, and use a calibrated reference or a more suitable measurement setting if necessary. Save the raw hertz readings and the measurement conditions. Multiplication by the divider restores the nominal scale and absolute error, but any digits discarded by the instrument stay lost.
An MCO result can also be correct once running even when a fraction of boards take too long to assert HSE ready. Have the fixture record time from oscillator enable to the ready flag. Track the proportion of boards that start within the allowed time and the proportion that meet the settled frequency limits separately. A handful of accurate samples after a passive 8 MHz crystal substitution cannot explain cold power-up failures elsewhere in the sample set. Both measurements tell purchasing what the candidate has passed and whether the temperature and startup margin tests need further work.
What purchasing needs for the active oscillator build
A board variant may use an 8 MHz active oscillator feeding the MCU external clock input. With the correct bypass mode, input levels, and firmware, this version can also produce 2 MHz on MCO. Keep distinct part and assembly records for the two builds. The passive-crystal BOM should specify the full order code, package, load capacitance, maximum ESR, and drive level. The active oscillator BOM needs its output format, supply, enable behavior, pinout, and temperature range. Engineering should confirm the MCU external-clock input and bypass wiring from the matching datasheet and manual. An identical fixture reading is compatible with two distinct BOMs.
Leave a short record that includes board revision, BOM, complete clock part number, firmware build, MCO pad, source, divider, and settled frequency. When an incoming inspection ticket says that an 8 MHz crystal was measured at 2 MHz, request this record. If HSE is ready and MCO divides it by four, report that signal path with the measured 2 MHz. A missing HSE ready flag or an incorrect result at either divide setting gives engineering a specific path to investigate. The same record becomes a useful reference whenever purchasing or engineering changes the passive crystal or active oscillator build.
