From 3171c925b740b2a26e8fd38abb3bc5be8ff2b9f0 Mon Sep 17 00:00:00 2001 From: Yilin Sun Date: Tue, 19 Mar 2024 19:17:49 +0800 Subject: [PATCH] ports: mimxrt: Fix SNVS_LP build on non-RT1176 devices. The SDK updates includes a breaking change on devices without valid external tamper support. This is done by adding a macro checking whether the `FSL_FEATURE_SNVS_HAS_MULTIPLE_TAMPER` macro is defined and contains non-zero values in SDK driver. Currently this is only enabled on RT1176, so here we are adding the same check to prevent calling the non-exist function on other devices. Signed-off-by: Yilin Sun --- ports/mimxrt/machine_rtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/mimxrt/machine_rtc.c b/ports/mimxrt/machine_rtc.c index 294942cf5a..6d86c07b75 100644 --- a/ports/mimxrt/machine_rtc.c +++ b/ports/mimxrt/machine_rtc.c @@ -156,8 +156,11 @@ void machine_rtc_start(void) { SNVS->HPCOMR |= SNVS_HPCOMR_NPSWA_EN_MASK; // Do a basic init. SNVS_LP_Init(SNVS); + + #if defined(FSL_FEATURE_SNVS_HAS_MULTIPLE_TAMPER) && (FSL_FEATURE_SNVS_HAS_MULTIPLE_TAMPER > 0) // Disable all external Tamper SNVS_LP_DisableAllExternalTamper(SNVS); + #endif SNVS_LP_SRTC_StartTimer(SNVS); // If the date is not set, set it to a more recent start date,