Skip to content

Commit 9cb3028

Browse files
committed
mpsl: Temporary fix to make 54l15/ns functionaly work
Temporary fix that will force rramc to not go to powerdown. Mpsl gets to high interupt latency without this and stops working. Signed-off-by: Martin Tverdal <martin.tverdal@nordicsemi.no>
1 parent 73c2240 commit 9cb3028

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

subsys/mpsl/init/mpsl_init.c

+16
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
#include <mpsl/mpsl_work.h>
1616
#include "multithreading_lock.h"
1717
#include <nrfx.h>
18+
#if defined(NRF_TRUSTZONE_NONSECURE)
19+
#include "tfm_platform_api.h"
20+
#include "tfm_ioctl_core_api.h"
21+
#endif
1822
#if IS_ENABLED(CONFIG_SOC_COMPATIBLE_NRF54LX)
1923
#include <nrfx_power.h>
2024
#endif
@@ -436,6 +440,18 @@ static int32_t mpsl_lib_init_internal(void)
436440
return err;
437441
}
438442
#endif /* MPSL_TIMESLOT_SESSION_COUNT > 0 */
443+
#if defined(NRF_TRUSTZONE_NONSECURE)
444+
/* Temporary fix in order to get mpsl to work well when
445+
* compiling for nrf54l15dk/nrf54l15/cpuapp/ns
446+
*/
447+
uint32_t result_out;
448+
uint32_t result = tfm_platform_mem_write32((uint32_t)&NRF_RRAMC_S->POWER.LOWPOWERCONFIG,
449+
RRAMC_POWER_LOWPOWERCONFIG_MODE_Standby << RRAMC_POWER_LOWPOWERCONFIG_MODE_Pos,
450+
RRAMC_POWER_LOWPOWERCONFIG_MODE_Msk,
451+
&result_out);
452+
__ASSERT(result == TFM_PLATFORM_ERR_SUCCESS, "tfm_platform_mem_write32 failed %i\n", result);
453+
__ASSERT(result_out == 0, "tfm_platform_mem_write32 failed %i\n", result_out);
454+
#endif
439455

440456
return 0;
441457
}

0 commit comments

Comments
 (0)