2026-03-16 3:49 PM
Hello all,
I've designed a board around a STM32H743 (LQFP-100) and am running into the following issue.
On 2 boards out of 10, the HSE seems not to start properly. The HSE_RDY flag is never set after enabling HSE. I have checked it's not in bypass mode. On the other boards, it works perfectly.
The crystal is a ABM3B-8.000MHZ-10-1-U-T and the load caps are 10 pF. We checked possible soldering issues, tested different load cap values just to see, and even replaced the crystal on the failing boards - to no avail.
Looking at the OSC_IN/OSC_OUT signals (PH0/PH1) on a scope does not show a significant difference between the working and non-working boards. Maybe just a very slight difference in p-p amplitude.
I have looked at the AN2867 app note, and the gain margin seems sufficient according to the formulas given there. I have heard that this crystal may have a bit too high ESR (200 ohm) for the STM32H7 HSE, but again, the gain margin seems alright.
Any idea? I have tested with a minimal firmware that just sets up the power config, turns on HSE and waits (forever) for the HSE_RDY flag. It never gets out of the loop on the failing boards (works fine on the working boards). If using HSI instead on the failing boards, everything seems to work ok, so it's definitely just a problem with the HSE.
Thanks!
Solved! Go to Solution.
2026-03-19 10:46 AM
Hi JW,
NP - embedded debugging can be tricky especially when doing it remotely. Main thing is to eventually pinpoint the issues while making sure we haven't missed any possible related problem that could resurface at a later point.
Regarding this session, the final oddity was again to find that the LSE_RDY flag could get set after enabling the LSE even if no crystal is present. Just the noise on floating pins is probably enough to make it detect enough toggling. I've seen other MCUs a bit more strict with their oscillator detectors, but that's just a detail.
Regarding ST tools, I have never used any generator. The HAL is bloated but I don't fully blame ST devs, it's meant to be a general-purpose solution to abstract hardware and it almost always ends up like this, because those libraries must cover a lot of various cases.
I use the "cube" distributions (taken from ST's git repo) strictly as a SDK, and mostly use only CMSIS and LL files. I actually find their LL layer reasonable compared to many SDKs of other vendors. I personally don't overly like CMSIS code style and find LL definitions easier to read, but of course YMMV. Another plus is that most functions it exposes are actual inline functions, while CMSIS mostly exposes only macros. inline functions are usually as efficient and at least, type-safe. I've otherwise written my own such lightweight layers for other MCUs, but this can be very time-consuming (but at least you get exactly what you want and need).
In any case, I always recommend separating the low-level parts in any firmware as much as possible to make it easier to maintain and easier to port. After that, your pick of the very low-level header files for CPU and register definitions is often a matter of preferences.