AnsweredAssumed Answered

Using internal flash for data storage with STM32L151VC

Question asked by p.ben on Aug 12, 2017
Latest reply on Aug 13, 2017 by p.ben


We are using the L151VC part (with 256 KB flash consisting of one bank) for a sensor logger applications. We roughly log 32 bytes of data at 50 Hz. We have partitioned the flash into 96 KB of code and rest 160KB for data.

I have a couple of questions:

1) write throughput: we ran an experiment to write to 160 KB of flash using the following operation: unlock , 4-bytes write, lock 

Based on this experiment it is taking 197 sec, representing 4.8 ms/4 bytes write. Is this expected? 

Using this result, I can estimate 30 ms for writing 32 bytes, which is much higher than what I was expecting.


2) bus stall: the documentation says during write to flash, code fetches cannot be performed (since we execute out of flash and read from flash during write to the same block leads to bus stall. This means that for each 50 ms duration, the processor execution is stalled for 30ms. Did I get this right?