summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/nrf/supervisor/port.c3
-rw-r--r--ports/nrf/supervisor/qspi_flash.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c
index 68d6f5f71..05970a3ed 100644
--- a/ports/nrf/supervisor/port.c
+++ b/ports/nrf/supervisor/port.c
@@ -302,7 +302,8 @@ void port_sleep_until_interrupt(void) {
nrf_gpio_cfg_output(MICROPY_QSPI_CS);
nrf_gpio_pin_write(MICROPY_QSPI_CS, 1);
- *(volatile uint32_t *)0x40029010 = 1;
+ // Workaround to disable QSPI according to nRF52840 Revision 1 Errata V1.4 - 3.8
+ NRF_QSPI->TASKS_DEACTIVATE = 1;
*(volatile uint32_t *)0x40029054 = 1;
NRF_QSPI->ENABLE = 0;
}
diff --git a/ports/nrf/supervisor/qspi_flash.c b/ports/nrf/supervisor/qspi_flash.c
index 83261f080..d5c60ac9e 100644
--- a/ports/nrf/supervisor/qspi_flash.c
+++ b/ports/nrf/supervisor/qspi_flash.c
@@ -39,7 +39,7 @@
#include "supervisor/shared/external_flash/qspi_flash.h"
#if defined(MICROPY_QSPI_OFF_WHEN_SLEEP)
-#define QSPI_ENABLE qspi_enable
+#define QSPI_ENABLE() qspi_enable()
static void qspi_enable(void)
{
@@ -62,7 +62,7 @@ static void qspi_enable(void)
}
#else
-#define QSPI_ENABLE()
+#define QSPI_ENABLE() ((void)0)
#endif
bool spi_flash_command(uint8_t command) {