From 91a1e8de2c9e0784961254eb52a23f66ee46e1bf Mon Sep 17 00:00:00 2001
From: Ilya Zhuravlev <whatever@xyz.is>
Date: Sun, 24 Oct 2021 15:10:11 -0400
Subject: [PATCH] eeprom_stm32: add workaround for arm gcc 11

---
 tmk_core/common/chibios/eeprom_stm32.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tmk_core/common/chibios/eeprom_stm32.c b/tmk_core/common/chibios/eeprom_stm32.c
index 056f886c6f..e24253eab1 100644
--- a/tmk_core/common/chibios/eeprom_stm32.c
+++ b/tmk_core/common/chibios/eeprom_stm32.c
@@ -34,7 +34,8 @@ static uint8_t *empty_slot;
 
 void EEPROM_Init(void) {
     /* First, load the snapshot directly from flash */
-    memcpy(DataBuf, (void*)FEE_BASE_ADDRESS, FEE_SNAPSHOT_SIZE);
+    void *volatile tmp = (void*)FEE_BASE_ADDRESS;
+    memcpy(DataBuf, (void*)tmp, FEE_SNAPSHOT_SIZE);
 
     /* Then, process writelog to update DataBuf entries */
     uint8_t *addr;