NVProperty generic key value store using the MCU flash area.

Dependents:   Turtle_RadioShuttle

Files at this revision

API Documentation at this revision

Comitter:
Helmut Tschemernjak
Date:
Wed Feb 13 10:44:06 2019 +0100
Parent:
13:2436a800c0fa
Commit message:
Updated

Changed in this revision

NVProperty_MBEDFlash.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/NVProperty_MBEDFlash.cpp	Sun Feb 10 20:47:25 2019 +0100
+++ b/NVProperty_MBEDFlash.cpp	Wed Feb 13 10:44:06 2019 +0100
@@ -52,7 +52,8 @@
 	_propSizekB = propSizekB;
 	_pageSize = _flashIAP->get_page_size();
 	_numPages = _flashIAP->get_flash_size() / _pageSize;
-	_rowSize = _flashIAP->get_sector_size(_flashIAP->get_flash_start()); //  pageSize * 4;
+	_rowSize = _flashIAP->get_sector_size(_flashIAP->get_flash_start());
+	MBED_ASSERT(((propSizekB *1024) % _rowSize) == 0);
 	_startAddress = (uint8_t*)_flashIAP->get_flash_start() + ((_numPages-(_propSizekB * 1024)/_pageSize) * _pageSize);
 	_endAddress = _startAddress + (_propSizekB * 1024);
 	//	_flashErasedValue = _flashIAP->get_erase_value();