File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed
features/storage/TESTS/kvstore/direct_access_devicekey_test Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ void test_direct_access_to_devicekey_tdb_flashiap_remainder()
186
186
187
187
void test_direct_access_to_devicekey_tdb_last_two_sectors ()
188
188
{
189
- utest_printf (" Test Direct Access To DeviceKey Test Entire FlashIAP Remainder \n " );
189
+ utest_printf (" Test Direct Access To DeviceKey Test Last Two Sectors \n " );
190
190
191
191
uint32_t flash_bd_start_address;
192
192
uint32_t flash_bd_end_address;
@@ -198,6 +198,18 @@ void test_direct_access_to_devicekey_tdb_last_two_sectors()
198
198
uint32_t flash_bd_size = flash_bd_end_address - flash_bd_start_address;
199
199
200
200
FlashIAPBlockDevice *flash_bd = new FlashIAPBlockDevice ((bd_addr_t )flash_bd_start_address, (bd_size_t )flash_bd_size);
201
+ flash_bd->init ();
202
+ uint32_t sector_addr = flash_bd->size ();
203
+ for (int i = 0 ; i < 2 ; i++) {
204
+ uint32_t sector_size = flash_bd->get_erase_size (sector_addr - 1 );
205
+ uint32_t erase_prog_ratio = sector_size / flash_bd->get_program_size ();
206
+ if (erase_prog_ratio < 4 ) {
207
+ delete flash_bd;
208
+ TEST_SKIP_UNLESS_MESSAGE (false , " Test skipped. Flash program size doesn't support this test." );
209
+ }
210
+ sector_addr -= sector_size;
211
+ }
212
+ flash_bd->deinit ();
201
213
202
214
TDBStore *tdb = new TDBStore (flash_bd);
203
215
// Start by Init and Reset to TDBStore
You can’t perform that action at this time.
0 commit comments