Hi,
I am using nrf52840-based custom hardware and have an external flash connected on SPIM3. Till now I was working with my other peripheral connected on different buses and was measuring current consumption for all of them to maintain a power budget.
Without enabling flash and SPIM,3 I have reached an Idle current consumption of 80uA. When I enabled the flash on SPIM3, it jumped to 550uA. I saw the errata document for that issue and found that in my ncs version 2.6.1 in nrfx_spim.c has a workaround added for anomaly_195. I confirmed by adding the logs there whether it is executing or not, and found that it is executing.
For testing, I added a while loop in my main which resumes the power of flash, checks the chip id, and after 3 seconds of sleep, it suspends the power and again sleeps for 3 seconds, and this loop continues.
From the logs, I found that my PM APIs are executed successfully, and also checked from the hardware that the clock pin of SPIM is also responding to its states in between the suspend and resume power states.
Can anyone suggest, there is anything that needs to be done apart from this work around which is already present, and still the current consumption is high.
//// Main while(1) { power_on(); k_msleep(3000); power_off(); k_msleep(3000); } int power_on() { int ret =0; #ifdef CONFIG_PM_DEVICE LOG_INF("Resume Flash peripheral"); ret = pm_device_action_run(nand_flash, PM_DEVICE_ACTION_RESUME); flash_read_jedec_id(nand_flash,false); #endif return ret; } int power_off() { int ret =0; #ifdef CONFIG_PM_DEVICE LOG_INF("Suspending Flash peripheral"); ret = pm_device_action_run(nand_flash, PM_DEVICE_ACTION_SUSPEND); #endif return ret; } //// nrfx_spim.c #if NRFX_CHECK(USE_WORKAROUND_FOR_ANOMALY_195) if (p_instance->p_reg == NRF_SPIM3) { *(volatile uint32_t *)0x4002F004 = 1; } #endif