LEraseSector() taking 35 minutes to execute


In NET+OS 7.5, in the file c:/netos75/src/flash/naflash.c, there is the funtion LEraseSector().

In my software I notice this function LEraseSector() can take up to 35 minutes to be executed.

I don’t think this is normal behavior. Would someone know what can cause this problem? Is this function unsuccessfully trying to get something to access the flash?

Can I reduce the
to a lower value?

Or can I reduce the number of polling the flash
while ((sanityCounter < 1000) && (!done));
to a lower value?

Thanks in advance


do you see it on just one module or all of them?
can you ran naflash example app and see if you have the same problem or perhaps the problem is somewhere in interactions with your other tasks?

Hi LeonidM

Thanks for your answer. I can see this problem on different module.
But this problem only happen sometimes.
Usually the LEraseSector is working ok (quick) but sometimes it would take 35 minutes. And then run ok.
I don’t manage to replicate the problem when I want. Only notice it when the module seems frozen.

In my software, I use the NVRAM to store the default data (board parameter) and the file system to store my own data.
NVRAM is set to be the last sector of the flash.

I m not checking if the NVRAM driver is busy before I use fread / fwrite to access the file system.
Could this be an issue? Or is there some protection provided by DIGI to avoid this kind of problem?


yes, using those APIs and accessing FLASH directly, can cause conflict with NVRAM APIs