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()
101
101
TEST_ASSERT_EQUAL_ERROR_CODE (0 , res);
102
102
103
103
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
104
109
if (erase_val == -1 ) {
105
110
flash_bd = new FlashSimBlockDevice (bd);
106
111
kvstore = new TDBStore (flash_bd);
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ static void kvstore_init()
96
96
TEST_ASSERT_EQUAL_ERROR_CODE (0 , res);
97
97
98
98
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
99
104
if (erase_val == -1 ) {
100
105
flash_bd = new FlashSimBlockDevice (bd);
101
106
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()
156
156
157
157
#elif COMPONENT_FLASHIAP
158
158
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 )
159
163
static LittleFileSystem flash (" flash" , BlockDevice::get_default_instance ());
160
164
flash.set_as_default ();
161
165
162
166
return &flash;
167
+ #else
168
+ return NULL ;
169
+ #endif
163
170
164
171
#else
165
172
Original file line number Diff line number Diff line change 84
84
"default-adc-vref" : {
85
85
"help" : " Default reference voltage for ADC (float)" ,
86
86
"value" : " NAN"
87
+ },
88
+ "internal-flash-uniform-sectors" : {
89
+ "help" : " Target's internal flash has uniform sector sizes" ,
90
+ "value" : true
87
91
}
88
92
}
89
93
},
1344
1348
"macro_name" : " CLOCK_SOURCE"
1345
1349
}
1346
1350
},
1351
+ "overrides" : {
1352
+ "internal-flash-uniform-sectors" : false
1353
+ },
1347
1354
"device_has_add" : [
1348
1355
" ANALOGOUT" ,
1349
1356
" CAN" ,
1495
1502
"macro_name" : " CLOCK_SOURCE"
1496
1503
}
1497
1504
},
1505
+ "overrides" : {
1506
+ "internal-flash-uniform-sectors" : false
1507
+ },
1498
1508
"device_has_add" : [
1499
1509
" SERIAL_ASYNCH" ,
1500
1510
" FLASH" ,
2109
2119
}
2110
2120
},
2111
2121
"overrides" : {
2112
- "lpticker_delay_ticks" : 0
2122
+ "lpticker_delay_ticks" : 0 ,
2123
+ "internal-flash-uniform-sectors" : false
2113
2124
},
2114
2125
"macros_add" : [
2115
2126
" MBED_TICKLESS" ,
You can’t perform that action at this time.
0 commit comments