Closed aaraujo11 closed 8 years ago
After some debug, the main reason for this time consumption (15390us), it occurs in write_impl() function when the offset reaches zero and run the flash.erasePage(). The erasePage routine is the reason for those timings. Is possible to decrease the time of the erasepage?
Not to my knowledge - that's how long the hardware takes to erase the page.
There's no way to make the timing even on each write since different writes have different affects on the underlying hardware. If you need to isolate your code form timing variances then you can use multithreading, using a background thread to write to the circular buffer, which itself is fed from an in-memory buffer.
Hi @m-mcgowan, i deal with it by fed the memory buffer, when my routine had a free open time window, instead do it during my "real time" routine. Thanks
Hi @m-mcgowan ,
I'm experiencing some unstable timings while writing to the flash circular buffer. A writing usually lasts 732us, however from time to time it takes 15390us. Any clue on what the problem may be?
To emulate my issue, i had tested with this simple code below and the result is the same.
Thanks in advance!