KV store global and storage options

I am using an Nucleo F446RE and am being driven to some frustration with the KV store.

I had the global KV working until I added MBEDTLS which is quite large. Even though I have reduced the footprint of the app to under 250K, FLASHIAP won’t initialise.

I enabled FLASHIAP, however the base address is being ignored whenever I’m running GDB/OpenOCD and it cannot claim the last to sectors (2 x 128K) for TDB_INTERNAL. This is no matter what the size is of the app. Under debug, it always shows the same app end location.

I added an SD card via SPI and have configured filesystem, however when kv_init_storage_config it kicks out with an MBED_ERROR_UNSUPPORTED if it is not using FLASHIAP.

code from kv_config.cpp


If I add both SD and FLASHIAP in the components_add in mbed_app.json, I get undefined reference to `mbedtls_platform_teardown’ from the linker after 100% compilation.