Skip to content
Commit 037f994e authored by Rodrigo Brochado's avatar Rodrigo Brochado Committed by Kumar Gala
Browse files

drivers: flash: Add workaround for anomaly 122 on nrf52840



The energy consumption on nrf52840 is unnecessarily high when
CONFIG_NORDIC_QSPI_NOR is used due to Anomaly 122. The nrf_qspi_nor
driver is unitialize after QSPI usage and initialize before using
it again.

Semaphore objects are used to allow multiple threads exclusive access
and efficient usage.

The main assumption made was that all QSPI API is stateless, in the
sense that it is not required to store any peripheral state before
uninit. Also, the QSPI driver was supposed to be synchronous, except
for the erase operation, in which the nrf signals its start, instead of
its end. While the flash is performing the erase, an uninit followed
by an init doesn't work. For that reason, polling is done before
every uninit.

Tests were made with a simple LittleFS application in a custom board
using flash MX25R3235F and another with the LittleFS flash sample
using nrf52840 DK that has a MX25R6435F. Current consumption dropped
from 630 uA to ~10uA in both cases.

Signed-off-by: default avatarRodrigo Brochado <git.rodrigobrochado@gmail.com>
parent e8458788
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment