Where to #define MICROPY_HW_RTC_USE_BYPASS for H7

Hi, I’m driving the 32KHz pin on my STM32H7 with an external oscillator, so I want add a #define MICROPY_HW_RTC_USE_BYPASS. I can see where code in rtc.c looks for this define. Is it okay to simply add it to the top of rtc.c? Or should is it better to put it higher up, like maybe in mpconfigboard.h? Thanks!

…based on compile errors, it’s looking like mpconfigboard.h is the right place to define it, and with #define MICROPY_HW_RTC_USE_BYPASS (1) being the right way to do it. Does this sound right?

Do you want to use RTC of openmv board?I tried some times, It seem not work!

My RTC is functional (that is, it is able to set, increment and report date-time) but it’s being driven by the H7’s onboard RC LSI instead of genuine quartz so it’s pretty inaccurate. The H7’s onboard RC is no worse than any other onboard RC - they are always bad, which is why they give you an optional external pin for use cases with critical timing.

yes,it’s being driven by the H7’s onboard RC LSI,Not LSE!

I had tried active crystals(SG-3030CM),Vbat is 3.3V,when power is off,time can keep but not increment。

because many said STM32 is diffcult to work with passive
rtc crystals! and no reason work or not work

It should be in micropython/ports/stm32/boards/OPENMV4/mpconfigboard.h