From 9411153966f488f88833a452aac94d906fa1bd11 Mon Sep 17 00:00:00 2001 From: Josiitaa RL Date: Fri, 22 Dec 2023 11:34:22 +0530 Subject: [PATCH] RTI UC1 fix --- examples/rti/UC1/sdl_rti_example.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/rti/UC1/sdl_rti_example.c b/examples/rti/UC1/sdl_rti_example.c index 685942e..bdf86d4 100644 --- a/examples/rti/UC1/sdl_rti_example.c +++ b/examples/rti/UC1/sdl_rti_example.c @@ -48,6 +48,12 @@ volatile uint32_t isrFlag = RTI_NO_INTERRUPT; /**< Flag used to indicate interrupt is generated */ +/* ========================================================================== */ +/* Macros */ +/* ========================================================================== */ +/* define the unlock and lock values */ +#define KICK0_UNLOCK_VAL 0x68EF3490 +#define KICK1_UNLOCK_VAL 0xD172BC5A /* ========================================================================== */ /* Function Definitions */ /* ========================================================================== */ @@ -207,6 +213,9 @@ static void RTISetClockSource(uint32_t rtiModuleSelect, uint32_t rtiClockSourceSelect) { #if !defined(SOC_TPR12) && !defined (SOC_AWR294X) /* No need to set clock for TPR12 */ + /* Unlock the MCU_CTRL_MMR before programming the RTI CLKSEL */ + *((uint32_t *)(SDL_MCU_CTRL_MMR0_CFG0_BASE + SDL_MCU_CTRL_MMR_CFG0_LOCK2_KICK0)) = KICK0_UNLOCK_VAL; + *((uint32_t *)(SDL_MCU_CTRL_MMR0_CFG0_BASE + SDL_MCU_CTRL_MMR_CFG0_LOCK2_KICK1)) = KICK1_UNLOCK_VAL; switch (rtiModuleSelect) { case SDL_MCU_RTI0_CFG_BASE: HW_WR_FIELD32(SDL_MCU_CTRL_MMR0_CFG0_BASE + -- 2.34.1