# HERE4 why using HAL\_HSI\_TRIM\_USING\_PPS?

**URL:** <https://discuss.cubepilot.org/t/here4-why-using-hal-hsi-trim-using-pps/17094>\
**Category:** Here GPS\
**Created:** [5 November 2025 10:27 UTC](https://discuss.cubepilot.org/t/here4-why-using-hal-hsi-trim-using-pps/17094 "2025-11-05T10:27:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mm-vty](https://discuss.cubepilot.org/letter_avatar_proxy/v4/letter/m/c68b51/32.png) [@mm-vty](https://discuss.cubepilot.org/u/mm-vty)\
**Post date:** [5 November 2025 10:27 UTC](https://discuss.cubepilot.org/t/here4-why-using-hal-hsi-trim-using-pps/17094/1 "2025-11-05T10:27:02Z")

</div>

Hi guys,

as I understood, in HERE4 FW 1.15.4 you configured usage of internal clock as PLL source (OSCILLATOR\_HZ =0 in hwdef.dat) and activated trimming of that HSI source from uBlox GPIO output toggled at nominal 1000Hz.

My questions / comments are:

1. **why** doing that relatively expensive and potentially buggy handling (in case you do not plan to save on external 24MHz quartz in newly produced modules)?

Any HSI is imprecise and very temperature-dependent. Even with MCU internal t\_junction ADC channel used (as I see it is just used for reporting in AP\_GPS\_UBLOX::report\_pps\_interrupt\_rate - as hal.analogin-\>mcu\_temperature()) it would be imprecise. But your updates of HSICFGR from AP\_GPS\_UBLOX::pps\_interrupt() once per second just rely on uBlox interrupt rate.

And what in case of GNSS jamming or spoofing - are you sure uBlox will provide correct rate?

Further, from source in stm32h7\_mcuconf.h I see you are using HSI64 as PLL source (/4\*50/2), but in your thoughts “_// each step is 0.175%_“ you apply to STM32H75x datasheet “Table 55. **HSI48** oscillator characteristics” instead of “ **Table 56. HSI** oscillator characteristic” which says that “HSI user trimming step” may introduce up to -5.2% error at some conditions and drift over temperature 2%…. Please review your implementation in case you absolutely need to use HSI PLL source. It potentially affects DroneCAN and serial baud rates errors, etc.

1. as I need to build our modified HERE4 FW anyway, could you please confirm that in the future the external 24MHz quartz will remain in later produced HERE4 modules?

And that reverting the following will work and introduce no regression:

**define**  **HAL\_HSI\_TRIM\_USING\_PPS 0**

**OSCILLATOR\_HZ 24000000** (in hwdef.dat and also hwdef-bl.dat)
