Tiny storage(file) system on MCU internal flash memory for Nucleo F4xx. The purpose of SOFBlock class is to provide a way to write data on flash memory in the same way of file handling class in the file system.

Dependents:   storage_on_flash_demo mbed_controller_demo mbed-os-example-blinky-2

March 26, 2015

Seeed Arch Max platform which is based on STM32-F407 is supported.

Revision:
1:33afe074c8f8
Parent:
0:7f4bc855cb46
Child:
2:e79a9cb05801
--- a/SOFBlock.h	Mon Jan 19 12:57:44 2015 +0000
+++ b/SOFBlock.h	Mon Jan 19 14:45:39 2015 +0000
@@ -8,7 +8,7 @@
 The purpose of SOFBlock class is to provide a way to write data on flash memory
 in the same way of file handling class in the file system.
 It manages a chunk of data on the Flash memory efficiently by minimizing flash erase operation as little as possible.
-Note: Currently I only support STM32F4xx series platforms.
+Note: Currently it only supports STM32F4xx series platforms.
 
 The STM32 F4xx series from ST have plenty of internal Flash memory inside MCU core.
 For example STM32 401RE has 512Kbyts Flash.
@@ -22,16 +22,17 @@
 2) Write data to sector #n
 Read operation:
 1) Just read physical memory address of sector #n
-The base address of STM32 Flash is 0x00000000.
+The base address of STM32 Flash is 0x08000000.
 
 There may be inefficiency in this Flash usage scenario when size of data is too small compared with sector size.
 The size of sectors from #5 to #7 of STM32 401RE Flash 128KB. If I only need to maintain 1KB data,
 whenever I need to update data I need to erase whole 128KB of sector.
 This produces two problems.
-One is time consumption of erase operation. The operation of ERASE128KB takes 1~4 seconds long.
-The other is lifetime of Flash memory. More you erase and write and lifetime of Flash is shorter.
+One is time consumption of the erase operation. The operation of ERASE128KB takes 1~4 seconds long.
+The other is related to lifetime of Flash memory.
+More you erase and write and lifetime of Flash is shorter.
 
-To overcome such problem, here simple flash management algorithm is used for.
+To overcome such problems, here simple flash management algorithm is used for.
 By tracking data offset and size it can hold multiple data in a sector. Bear in mind that is impossible rewriting data on Flash.
 Keeping tracking data along with data itself is crucial.
 Data itself is growing from low address. On the other hand tracking data is growing down from high address.
@@ -149,7 +150,7 @@
 	SOF_Error_t open(uint8_t sector_index);
 
 	/*** Return flash physical address of data for direct access */
-	uint8_t *get_physical_base_addr();
+	uint8_t *get_physical_data_addr();
 
 	/*** Return data size */
 	size_t get_data_size();