From dbe47a6a2a3a5e34f11cc18c397dbdedff2ad462 Mon Sep 17 00:00:00 2001 From: Yihui Xiong Date: Wed, 5 Aug 2020 16:07:18 +0800 Subject: [PATCH] adjust --- ports/nrf/supervisor/port.c | 3 ++- ports/nrf/supervisor/qspi_flash.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ports/nrf/supervisor/port.c b/ports/nrf/supervisor/port.c index 68d6f5f712..05970a3edf 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 83261f0800..d5c60ac9ee 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) {