From ef3b93daa11eaeeae7830436fcec0164b1d6fad6 Mon Sep 17 00:00:00 2001 From: pinchies Date: Mon, 25 Mar 2019 12:07:31 +1100 Subject: [PATCH] Fix STM32F1 SD-based EEPROM emulation (#13475) If `openFile` is given `true`, then it has read-only access. Because all the writing occurs on the next line, this breaks SD card as EEPROM. --- Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp index e7a1336edd..2b184cdc4c 100644 --- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp +++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp @@ -55,7 +55,7 @@ bool PersistentStore::access_start() { bool PersistentStore::access_finish() { if (!card.isDetected()) return false; - card.openFile(eeprom_filename, true); + card.openFile(eeprom_filename, false); int16_t bytes_written = card.write(HAL_STM32F1_eeprom_content, HAL_STM32F1_EEPROM_SIZE); card.closefile(); return (bytes_written == HAL_STM32F1_EEPROM_SIZE);