From 4bd1e550932d0557a66b1e3cd00973d32426a27e Mon Sep 17 00:00:00 2001
From: Tanguy Pruvot <tpruvot@users.noreply.github.com>
Date: Sun, 4 Aug 2019 01:11:06 +0200
Subject: [PATCH] STM32F1: Init EEPROM SPI pin modes (#14810)

---
 .../src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp
index b1b50a39e1..babcdeaee3 100644
--- a/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp
+++ b/Marlin/src/HAL/HAL_STM32F1/persistent_store_eeprom.cpp
@@ -26,7 +26,18 @@
 
 #include "../shared/persistent_store_api.h"
 
-bool PersistentStore::access_start() { return true; }
+bool PersistentStore::access_start() {
+  #if ENABLED(SPI_EEPROM)
+    #if SPI_CHAN_EEPROM1 == 1
+      SET_OUTPUT(BOARD_SPI1_SCK_PIN);
+      SET_OUTPUT(BOARD_SPI1_MOSI_PIN);
+      SET_INPUT(BOARD_SPI1_MISO_PIN);
+      SET_OUTPUT(SPI_EEPROM1_CS);
+    #endif
+    spiInit(0);
+  #endif
+  return true;
+}
 bool PersistentStore::access_finish() { return true; }
 
 bool PersistentStore::write_data(int &pos, const uint8_t *value, size_t size, uint16_t *crc) {
-- 
GitLab