File tree Expand file tree Collapse file tree 1 file changed +5
-14
lines changed
features/storage/TESTS/kvstore/direct_access_devicekey_test Expand file tree Collapse file tree 1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ int get_virtual_TDBStore_position(uint32_t conf_start_address, uint32_t conf_si
5858 uint32_t flash_start_address;
5959 uint32_t aligned_start_address;
6060 FlashIAP flash;
61- static const int STORE_SECTORS = 2 ;
6261
6362 int ret = flash.init ();
6463 if (ret != 0 ) {
@@ -93,19 +92,11 @@ int get_virtual_TDBStore_position(uint32_t conf_start_address, uint32_t conf_si
9392 }
9493 }
9594 } else {
96- // Assumption is that last two sectors are reserved for the TDBStore
97- aligned_start_address = flash.get_flash_start () + flash.get_flash_size ();
98-
99- for (int i = STORE_SECTORS; i; i--) {
100- bd_size_t sector_size = flash.get_sector_size (aligned_start_address - 1 );
101- aligned_start_address -= sector_size;
102- }
103-
104- if (aligned_start_address < flash_first_writable_sector_address) {
105- flash.deinit ();
106- return -2 ;
107- }
108- bd_final_size = (flash_end_address - aligned_start_address);
95+ bd_addr_t default_start;
96+ bd_size_t default_size;
97+ TDBStore::get_default_flash_addresses (&default_start, &default_size);
98+ aligned_start_address = (uint32_t )default_start;
99+ bd_final_size = (uint32_t )default_size;
109100 }
110101
111102 (*tdb_start_address) = aligned_start_address;
You can’t perform that action at this time.
0 commit comments