From b1c3c2813e45bf8d8d05009ce24800ac6907e2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 4 Apr 2019 10:10:22 +0200 Subject: [PATCH] [ion] ExternalFlash: reset QUADSPI peripheral --- ion/src/device/shared/drivers/external_flash.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ion/src/device/shared/drivers/external_flash.cpp b/ion/src/device/shared/drivers/external_flash.cpp index 4eb3129d2..2de53139d 100644 --- a/ion/src/device/shared/drivers/external_flash.cpp +++ b/ion/src/device/shared/drivers/external_flash.cpp @@ -263,7 +263,10 @@ static void initGPIO() { static void initQSPI() { // Enable QUADSPI AHB3 peripheral clock RCC.AHB3ENR()->setQSPIEN(true); - // Configure controller for target device + /* Reset QSPI peripheral */ + RCC.AHB3RSTR()->setQSPIRST(true); + RCC.AHB3RSTR()->setQSPIRST(false); + // Configure controller for target device class QUADSPI::DCR dcr(0); dcr.setFSIZE(NumberOfAddressBitsInChip - 1); /* According to the device's datasheet (see Sections 8.7 and 8.8), the CS