lpcware

How to use internal Flash memory for data storage with so long execution times?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by giusloq on Mon Apr 27 02:41:20 MST 2015
I need to save a small set of small variables, rarely changed during the execution time. Internal flash memory and IAP commands seem to me a good choice. I already read and studied AN11008 documentantion and code.

I have only one but big problem. When a variable is updated, a swap of sectors could happen. And this operation takes a long time (more than 100ms!). During this time, interrupts are disabled.

My gadget is a RS485 slave on a bus network. I use UART rx interrupts to receive bytes from the bus. If I disable interrupts for an interval of 100ms, I surely lost some bytes and I could end with problems on communication.

It seems the IAP routines can't be splitted in small parts and transformed using a state-machine pattern. So I can't see any way to solve this big problem.

Any suggestions? Is an external non-volatile memory the only solution?

Outcomes