News for hackers. Stuff that matters.
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast? by edoo on Sunday January 27, 2019 @11:04PM (#19015265)
It is always good to get to know your MCUs. When I first started using STM32s I would also scope the crystal and then toggle some pins as fast as possible to make sure.

Many gadgets later I trust the programmatic detection of external crystal use and appropriate PLL function. If you HAVE to know if the crystal fails you can use the CSS (Clock Security System) to generate interrupts in case you fall back to the internal oscillator.

Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast? by ChuckNorris89 on Monday January 28, 2019 @03:13AM (#19015929)
TIP: You should never scope a crystal directly as that could damage it. In production, for testing crystals, we output a PWM on a pin using the crystal as a source and measure that if the MCU doesn't have a built in functionality.
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast? by philpem on Monday January 28, 2019 @04:51AM (#19016259)
I've never heard of putting a scope probe on a crystal damaging it, though the load resistance (typically 1Megohm to ground) and capacitance (~5pF to ground) will affect the frequency.

This is why the PWM-out is useful -- it gives you a buffered, divided-down version of the crystal clock.

Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast? by berti on Monday January 28, 2019 @03:23AM (#19015967)
STM32 has MCO outputs that can be used to more directly pass various (divided) clocks through.
Re:Embedded Rust Experiments: Is My STM32 MCU Running Fast? by edoo on Monday January 28, 2019 @10:34AM (#19018190)
Interesting, but maybe not required. You can do a programmatic check of the crystal and PLL. I've had over 200k devices fabbed and deployed without ever directly testing a single crystal. What kind of error rate do you find?