summaryrefslogtreecommitdiff
path: root/stmhal/flash.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-16 23:08:36 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-16 23:08:36 +0100
commit6d983539bcff2a540dd136a7e84e1db2b334528f (patch)
treea5ba1e873fe2ee63a6bc7b8603ce3ff9ce7c2e81 /stmhal/flash.h
parentf6be480bda92486c3185ceaf8f25f461dfb2aa72 (diff)
stmhal: Improve flash storage cache management.
Internal flash used for the filesystem is now written (from the cache) only after a 5s delay, or when a file is closed, or when the drive is unmounted from the host. This delay means that multiple writes can accumulate in the cache, and leads to less writes to the flash, making it last longer. It's implemented by a high-priority interrupt that takes care of flash erase and write, and flushing the cache. This is still only an interim solution for the flash filesystem. It eventually needs to be replaced with something that uses less RAM for the cache, something that can use more of the flash, and something that does proper wear levelling.
Diffstat (limited to 'stmhal/flash.h')
-rw-r--r--stmhal/flash.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/stmhal/flash.h b/stmhal/flash.h
index 33d31df7a..7900d2c1a 100644
--- a/stmhal/flash.h
+++ b/stmhal/flash.h
@@ -1,2 +1,3 @@
uint32_t flash_get_sector_info(uint32_t addr, uint32_t *start_addr, uint32_t *size);
+void flash_erase(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32);
void flash_write(uint32_t flash_dest, const uint32_t *src, uint32_t num_word32);