Could anyone confirm POF warning working stable on s132_nrf52_2.0.0_softdevice ?
Could anyone confirm POF warning working stable on s132_nrf52_2.0.0_softdevice ?
I believe you are working on nRF5 SDK v11, in that case you may find this page useful in general:
https://devzone.nordicsemi.com/f/nordic-q-a/12495/what-are-sdk-11-0-0-known-issues
There are some issue with POF and the S132v2.0.0, you should download and program S132v2.0.1:
https://www.nordicsemi.com/Software-and-tools/Software/S132/Download#infotabs
Hi, I am successfully flash S132v2.0.1 and could confirm NRF_EVT_POWER_FAILURE_WARNING is generated well
err_code = sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
APP_ERROR_CHECK(err_code);
err_code = sd_power_pof_enable(1);
APP_ERROR_CHECK(err_code);
err_code = sd_power_pof_threshold_set(NRF_POWER_THRESHOLD_V27);
APP_ERROR_CHECK(err_code);
But I have the next problem after few warnings I got next one sequence:
pstorage LOAD callback received
sys_evt 2
pstorage UPDATE ERROR callback received
sys_evt = 3 (NRF_EVT_FLASH_OPERATION_ERROR)
and all my flash content go corrupt with random values, what you can suggest, how to debug this case ?
I think problem with properly dispatch, my is next
static void sys_evt_dispatch(uint32_t sys_evt)
{
pstorage_sys_event_handler(sys_evt);
ble_advertising_on_sys_evt(sys_evt);
if (sys_evt == NRF_EVT_POWER_FAILURE_WARNING)
{
UI_DEBUG_LOG("NRF_EVT_POWER_FAILURE_WARNING\r\n");
}
}
I don't recommend enabling POF if you are doing any flash erase or write operation:
https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html#unique_648169564
"If power-fail warning is enabled and the supply voltage is below VPOF the power-fail comparator will prevent the NVMC from performing write operations to the NVM."
This in essence means that the flash erase and write operations will simply be skipped by hardware, this is not something software will handle typically.
Best regards,
Kenneth
originally problem is next: I have periodic flash operations (write etc.) and when during this operation I simulate power drop below 1.8 V and more I have corruption of flash content. To prevent this i guess POF could help to skip flash operation on unstable power but not sure yet
If you remove supply voltage and an erase/write operation have already started, then using POF will not help, since the operation has already started. I think POF is really only usable if you have a coin cell battery for instance, and the battery is getting close to the end of life (depleted). However in such case you can also use low power comparator to get the same information.
Kenneth
yep, your right if operation already started POF will not help. Maybe you know, why all the pages of flash are corrupt in this case is it possible to block some pages for erase or etc.?
yep, your right if operation already started POF will not help. Maybe you know, why all the pages of flash are corrupt in this case is it possible to block some pages for erase or etc.?
If flash is corrupted due to power failure, I assume it can be:
- An erase or write operation was occurring when VDD dropped below operating conditions. This would cause an partial erase or write -> undefined result.
- An erase or write operation was occurring when VDD was settling around POF threshold. This could cause erase operation to be skipped, while write operations to succeed on already written words -> old_flash_content_words & new_written_flash_content.
Kenneth