Commit Graph

390 Commits (930ef8466223bcc416dc987989f0819f941ec6b5)

Author SHA1 Message Date
Martin Kojtal 906999a61c
Merge pull request #12850 from kyle-cypress/pr/general-filesystem-init
Fix intermittent sync fail in tests-filesystem-general_filesystem
2020-04-24 10:11:59 +02:00
Martin Kojtal 4b5f34a1ea
Merge pull request #12844 from amq/patch-3
Add invalid data case to tdbstore ram init
2020-04-24 10:11:28 +02:00
Martin Kojtal 422b194114
Merge pull request #12843 from ithinuel/bare_metal_storage
enable storage tests on baremetal
2020-04-22 16:03:14 +02:00
amq 56d35b188a Add invalid data case to tdbstore ram init 2020-04-22 15:30:48 +02:00
Kyle Kearney 18af867704 Filesystem test: Move lfs init in test startup
tests-filesystem-general_filesystem declares BlockDevice and FileSystem
pointers as globals. If these are initialized to their respective
default_instance values in the declaration, the LFS init happens during
OS startup when __libc_init_array() is invoked by mbed_toolchain_init().
If the filesystem blockdevice does not currently contain a valid filesystem
(e.g. the chip has just been erased), then LFS will flag this as corruption
and abort the mounting process.
This cleanup process can take long enough (and is running pre-main) that
greentea times out waiting for the device to respond to its sync packet,
and resets the device.
To resolve this, move the initialization into the first test case
(bd_init_fs_reformat) right before it initializes and formats the
blockdevice and filesystem.
2020-04-21 15:13:01 -07:00
Wilfried Chauveau 1005ea28df
enable storage tests on baremetal 2020-04-21 17:53:43 +01:00
MarceloSalazar e78ba7065b Remove MTB_MTS_XDOT target 2020-04-20 16:55:33 +01:00
Martin Kojtal ee476d9954
Merge pull request #12699 from hugueskamba/hk_remove_armc5_support_storage
Storage: Remove support for ARM Compiler 5
2020-04-15 15:30:44 +02:00
Martin Kojtal ea56ffbafc
Merge pull request #12799 from kyle-cypress/pr/tdb-calc-size
TDBStore: Handle odd number of sectors in block
2020-04-15 09:43:06 +02:00
Kyle Kearney b46da65937 TDBStore: Handle odd number of sectors in block
Rework TDBStore::calc_area_params so that it can handle situations where
the block device size is not an even multiple of the sector size (while
retaining its ability to handle non-uniform erase sizes).
This avoids intermittent asserts on boards where TDBStore is implemented
in internal flash, in which case the size of the block device varies
with the application size and a minor change (or a shift in optimization
level) can shift TDBStore from an odd to an even number of sectors.
2020-04-13 12:01:25 -07:00
MarceloSalazar a15f6a43ad General clean-up of unsupported targets 2020-04-09 15:36:21 +01:00
Martin Kojtal 5539d65017
Merge pull request #12638 from tymoteuszblochmobica/testall
Enable storage tests to all targets
2020-04-03 09:00:18 +02:00
Tymoteusz Bloch 2ca832c673 Enable storage tests to all targets 2020-04-01 12:04:36 +02:00
Hugues Kamba a9a00e9b29 Storage: Remove support for ARM Compiler 5
ARM Compiler 5 is no longer actively supported and was superseded in
Mbed OS by ARM Compiler 6.
2020-03-25 17:25:20 +00:00
Kyle Kearney ab8ac8871c Remove stray include of TDBStore.h 2020-03-24 12:27:21 -07:00
Kyle Kearney ae7c6203cc kv_config: Remove hard fail on too few pages
STORE_SECTORS is a hard requirement. If there are fewer than 2 pages
then the kvstore will not work, because the garbage collection process
relies on having at least two sectors to work with.
STORE_PAGES is a heuristic. It is a reasonable default to use if the
application does not specify the amount of flash to use for TDBStore.
But if an application knows that a smaller number of pages will suffice
for its specific needs, then that is valid and should be permitted.
2020-03-24 12:27:21 -07:00
Kyle Kearney 7f18a6ce49 Move flash bounds helpers from TDBStore to kv_config 2020-03-24 12:27:21 -07:00
Kyle Kearney 926423c109 Reuse TDBStore default size computation in devicekey test
Replace custom caluation that always assumed two sectors with the standard
calculation exposed on TDBStore.
2020-03-24 12:27:21 -07:00
Kyle Kearney 622a50ff6a KV_CONFIG: Change errors to use tr_error not tr_warning 2020-03-24 12:27:21 -07:00
Kyle Kearney e1b857078a Remove unnecessary reference-typed arguments
No callers make use of the modified argument values, so change
them to a more straightforward pass by value.
2020-03-24 12:27:21 -07:00
Kyle Kearney 3ef04db1a3 TDBStore: Increase min pages to 14
Increase minimum page count from 10 to 14 based on further experiments
with features-storage-tests-kvstore-static_tests.
2020-03-24 12:27:21 -07:00
Kyle Kearney 0002830c03 TDBStore: remove get_flash_bounds input constraint
Handle the case where the entirety of flash (size = 0) is required
for a flash memory starting at address 0, instead of erroring out.
2020-03-24 12:27:20 -07:00
Kyle Kearney 9d414316da TDBStore: Fix potential alignment issue in default addresses
When 10 pages is larger than 2 sectors, align the selected size
down to be an even multiple of the sector size, to ensure that
the allocated space divides cleanly in half for garbage collection.
2020-03-24 12:27:20 -07:00
Kyle Kearney 7cd4d11a8a Expand error checks in _calculate_blocksize_match_tdbstore
The minimum size required by tdbstore is either 2 sectors or 10 pages,
whichever is larger. Correspondingly, adjust the error checks in
_calculate_blocksize_match_tdbstore to match this requirement.
2020-03-24 12:27:20 -07:00
Kyle Kearney cda0af66eb Move TDB bounds computation for better reuse
Migrate into TDBStore so that DirectAccessDeviceKey can use it as well.
2020-03-24 12:27:20 -07:00
Kyle Kearney afa88b76d4 Refactor internal flash TDB bounds determination
Default the size to the larger of two sectors or 10 pages, so that the
  computation works better on devices with a low sector to page size ratio.
Reduce code duplication.
2020-03-24 12:27:20 -07:00
Martin Kojtal ef2c1c89e6
Merge pull request #12658 from VeijoPesonen/fix_tests-integration-fs
tests-integration;tests-filesystem: fix code causing compiler warnings and enable more tests
2020-03-23 12:31:13 +01:00
Veijo Pesonen 244c2fba5f tests-filesystem: enable all for QSPIF- OSPIF(future)-devices
littlefs is the preferred filesystem for general filesystem tests.
2020-03-19 19:26:16 +02:00
Marcin Tomczyk 6a21dfa080 [Storage] Use internal flash for KVStore always if default configuration. TDB_INTERNAL is always for first choose. 2020-03-18 06:05:52 -07:00
Anna Bridge e307695e82
Merge pull request #12599 from tymoteuszblochmobica/rotfix
Greentea kvstorage tests Cypress targets fix.
2020-03-10 12:08:48 +00:00
Tymoteusz Bloch 7b9170541a KV storage. Root of trust fix to pass Greentea tests for CY8CPROTO_062_4343W. 2020-03-09 13:53:28 +01:00
Jarno Lamsa b34dd0ce89 Remove _variant_bd_erase_unit_size
In some cases, it is possible that every erase unit in area 0
has the same size, but they are still different than in area 1.
Remove the flag for varying erase sizes and instead check from
flash, what is the erase size of the current unit.
2020-03-03 13:05:27 +02:00
Martin Kojtal fc5f3259de
Merge pull request #12458 from GaborAbonyi/add_musca_b1_platform
Add Musca B1 target
2020-02-27 13:53:58 +00:00
Martin Kojtal 67e950296d
Merge pull request #12385 from tymoteuszblochmobica/rot
DeviceKey Root of Trust generation refactored.
2020-02-26 16:59:24 +00:00
Veijo Pesonen b575df072f Removes RSPIF block device driver
The driver is not needed by the bootloader anymore.
2020-02-24 16:01:14 +02:00
Tamas Kaman 551c3c553c Add ARM_MUSCA_B1 as a new target platform
Musca-B1 is a Cortex-M33 based target with security extension enabled.

- ARM_MUSCA_B1 is the non-secure target running mbed-os.
- ARM_MUSCA_B1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_B1 is submitted by a
  pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
  signs it and then concatenates the bootloader with the signed binary.

Change-Id: I4b36290941b5f0bb7aa7c12dda2f38b5c1e39ae2
Signed-off-by: Tamas Kaman <tamas.kaman@arm.com>
Signed-off-by: Gabor Abonyi <gabor.abonyi@arm.com>
2020-02-21 14:34:39 +01:00
Marcin Tomczyk b5d0b7b6f1 IOTSTOR-1009 - TDBStore magic number if endian sensitive - remove incorrect comment 2020-02-21 00:57:50 -08:00
Seppo Takalo 94bb831753 Extend storage tests with de-init test case 2020-02-20 12:22:16 +02:00
Tymoteusz Bloch 0e7a53cdb1 DeviceKey Root of Trust generation refactored.
It's no longer automatically and silently created.
2020-02-18 16:32:20 +01:00
Michal Paszta a3ba7d964d FlashSimBlockDevice: initialize blanks buffer 2020-02-13 15:19:11 +02:00
Michal Paszta 10481f2f7e BlockDevice: multiple fixes to BlockDevice classes
Incorrect addresses only cause error return values instead of assertion.
ExhaustibleBlockDevice has working get/set_erase_cycle functions and an
array preventing programming without erase.
Fixed MBRBlockDevice partitioning function.
2020-02-10 09:53:49 +02:00
Pawel Zarembski 620442305f hani_iot: add spif storage config 2020-02-03 14:03:09 +01:00
Rajkumar Kanagaraj b2890822d9 Incorporated the review comment 2020-01-27 09:21:12 -08:00
Rajkumar Kanagaraj 46a1f01b6d Fix general filesystem greentea test
ARM microlib is not supported below features
- fflush(NULL) return `-1` instead `0`
- fread with size parameter "Zero".
- if file opened in append mode, file postion starts from the beginning.
2020-01-27 06:51:52 -08:00
Anna Bridge 80fe861f1d
Merge pull request #12035 from kjbracey-arm/callback_prep
Preparation for Callback changes
2020-01-21 11:50:43 +00:00
Kyle Kearney d8f47bdaa3 Improve reliability of KVStore general tests
In kvstore_init, prior to initializing the kvstore, erase the
underlying block storage device. This ensures that each test run
starts from a consistent state and avoids failures that can result
if a previous test run left the storage in an inconsistent state.
2020-01-13 11:32:12 -08:00
Evelyne Donnaes 8a4bba33bd Fixed baremetal build failures 2020-01-10 13:20:59 +00:00
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02:00
Martin Kojtal 974baaf199
Merge pull request #12143 from VeijoPesonen/blockdevices_testable
Blockdevice config changes to make it possible to run littlefs filesystem tests
2020-01-09 12:04:20 +01:00
ccli8 41d95ef2fb [M2351] Support TFM level 1 2020-01-06 15:55:00 +08:00