# Is it a good idea to omit HSE in favour of HSI?

I'm considering using stm32 L412 chip that comes with a 48Mhz HSI with +/- 0.25% accuracy. On the datasheet it says HSI can be used to drive usb fs peripheral. I will also using SPI peripheral.

https://www.mouser.in/datasheet/2/389/dm00481909-1799148.pdf

My question is, Is HSI reliable and can it be used in production examples?

The internal oscillators are reliable, and will meet the accuracy specified in the datasheet, if that's adequate for your application, then by all means use them.

If you're not sure, and you have the pins and PCB area available, add a crystal or oscillator to your circuit, and board, and don't populate them unless you find they're required.

In the part you specify, there's an HSI48 which can be used to clock the USB peripheral, this oscillator gets trimmed by the chips 'Clock Recovery System' which uses the incoming USB Start Of Frame packets to adjust its frequency.

• extremely helpful advice, also in cubemx RCC option, there is option for crs sync with gpio, LSE and USB. Going by your last sentence, should I turn crs sync with usb on? May 6, 2021 at 10:27
• Yes, if you're using it with USB that would be a sensible option. May 6, 2021 at 10:28

HSI16 and HSI48 are both reliable.

HSI16 +/- 2% accuracy over the whole temperature interval is extremely good for an internal oscillator.

HSI48 is less accurate but still reliable.

SPI clock recovery is far less critical than USB because it has a dedicated clock pin.

For safety critical applications use an external hardware watchdog to control your CPU code execution.

There is an application note AN5067 which details how accurate you can expect the HSI to be.

They especially mention, that after a reflow process (or any soldering process) there will be a drift, which can be as big as 2.5 % - and they consider it still being within the expected range (not inside the specification).

The drift usually happens in a way that the end frequency will be lower than the specified value.

So depending on the end product specification it might be worth testing how much the assembled unit differs from the specification to see if it needs additional trimming.

The new variants with MSI also offer the possibility to automatically trim the MSI to an external 32 kHz oscillator, which results in a quite precise clock even over temperature with a very low increase in power consumption. But of course with additional cost.