From 1840972894d4ac9b32d12b2a6c0a0e9c4bd03990 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 28 Oct 2020 23:34:31 +0100 Subject: [PATCH] cpu/sam0_common: flashpage: invalidate cache on _lock() --- cpu/sam0_common/periph/flashpage.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/sam0_common/periph/flashpage.c b/cpu/sam0_common/periph/flashpage.c index de9eeedc8184..fcfe94d2d400 100644 --- a/cpu/sam0_common/periph/flashpage.c +++ b/cpu/sam0_common/periph/flashpage.c @@ -84,6 +84,11 @@ static void _lock(void) #else PAC1->WPSET.reg = PAC1_WPROT_DEFAULT_VAL; #endif + + /* invalidate cache */ +#ifdef CMCC + CMCC->MAINT0.bit.INVALL = 1; +#endif } static void _cmd_clear_page_buffer(void)