File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed
kvstore/tests/TESTS/kvstore Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -101,6 +101,11 @@ static void kvstore_init()
101101 TEST_ASSERT_EQUAL_ERROR_CODE (0 , res);
102102
103103 if (kv_setup == TDBStoreSet) {
104+ #if COMPONENT_FLASHIAP && !COMPONENT_SPIF && !COMPONENT_QSPIF && !COMPONENT_DATAFLASH && !COMPONENT_SD
105+ // TDBStore requires two areas of equal size, do the check for FlashIAP
106+ TEST_SKIP_UNLESS (MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS ||
107+ (MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0 ) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF ))
108+ #endif
104109 if (erase_val == -1 ) {
105110 flash_bd = new FlashSimBlockDevice (bd);
106111 kvstore = new TDBStore (flash_bd);
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ static void kvstore_init()
9696 TEST_ASSERT_EQUAL_ERROR_CODE (0 , res);
9797
9898 if (kv_setup == TDBStoreSet) {
99+ #if COMPONENT_FLASHIAP && !COMPONENT_SPIF && !COMPONENT_QSPIF && !COMPONENT_DATAFLASH && !COMPONENT_SD
100+ // TDBStore requires two areas of equal size
101+ TEST_SKIP_UNLESS (MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS ||
102+ (MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0 ) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF ))
103+ #endif
99104 if (erase_val == -1 ) {
100105 flash_bd = new FlashSimBlockDevice (bd);
101106 kvstore = new TDBStore (flash_bd);
Original file line number Diff line number Diff line change @@ -156,10 +156,17 @@ MBED_WEAK FileSystem *FileSystem::get_default_instance()
156156
157157#elif COMPONENT_FLASHIAP
158158
159+ // To avoid alignment issues, initialize a filesystem if all sectors have the same size
160+ // OR the user has specified an address range
161+ #if MBED_CONF_TARGET_INTERNAL_FLASH_UNIFORM_SECTORS || \
162+ (MBED_CONF_FLASHIAP_BLOCK_DEVICE_SIZE != 0 ) && (MBED_CONF_FLASHIAP_BLOCK_DEVICE_BASE_ADDRESS != 0xFFFFFFFF )
159163 static LittleFileSystem flash (" flash" , BlockDevice::get_default_instance ());
160164 flash.set_as_default ();
161165
162166 return &flash;
167+ #else
168+ return NULL ;
169+ #endif
163170
164171#else
165172
Original file line number Diff line number Diff line change 8484 "default-adc-vref" : {
8585 "help" : " Default reference voltage for ADC (float)" ,
8686 "value" : " NAN"
87+ },
88+ "internal-flash-uniform-sectors" : {
89+ "help" : " Target's internal flash has uniform sector sizes" ,
90+ "value" : true
8791 }
8892 }
8993 },
13441348 "macro_name" : " CLOCK_SOURCE"
13451349 }
13461350 },
1351+ "overrides" : {
1352+ "internal-flash-uniform-sectors" : false
1353+ },
13471354 "device_has_add" : [
13481355 " ANALOGOUT" ,
13491356 " CAN" ,
14951502 "macro_name" : " CLOCK_SOURCE"
14961503 }
14971504 },
1505+ "overrides" : {
1506+ "internal-flash-uniform-sectors" : false
1507+ },
14981508 "device_has_add" : [
14991509 " SERIAL_ASYNCH" ,
15001510 " FLASH" ,
21092119 }
21102120 },
21112121 "overrides" : {
2112- "lpticker_delay_ticks" : 0
2122+ "lpticker_delay_ticks" : 0 ,
2123+ "internal-flash-uniform-sectors" : false
21132124 },
21142125 "macros_add" : [
21152126 " MBED_TICKLESS" ,
You can’t perform that action at this time.
0 commit comments