Commit Graph

359 Commits (792dfb51d583ee7b8bc177bb60aeb2333b0ddd26)

Author SHA1 Message Date
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
Veijo Pesonen 9763ad3b2d DataFlashBlockDevice: Makes default configuration to use mbed_lib.json settings
DataFlashBlockDevice parameters come from mbed_lib.json if not provided
explicitly.
2020-01-03 15:31:01 +02:00
Veijo Pesonen 67676dc123 SPIFReducedBlockDevice: Makes default configuration to use mbed_lib.json settings
SPIFReducedBlockDevice parameters come from mbed_lib.json if not provided
explicitly.

Introduced an app config file for running filesystem tests with RSPIF
block device
2020-01-03 15:30:13 +02:00
Veijo Pesonen 23f87877a1 SPIFBlockDevice: Makes default configuration to use mbed_lib.json settings
SPIFBlockDevice parameters come from mbed_lib.json if not provided
explicitly.

Introduced an app config file for running filesystem tests with SPIF
modules
2020-01-03 15:28:41 +02:00
Veijo Pesonen 3be2b8bf12 QSPIFBlockDevice: Makes default configuration to use mbed_lib.json settings
QSPIFBlockDevice parameters come from mbed_lib.json if not provided
explicitly.

Introduced an app config file for running filesystem tests with QSPIF
modules
2020-01-03 15:25:40 +02:00
Veijo Pesonen 803ae3444d SDBlockDevice: Makes default configuration to use mbed_lib.json settings
SDBlockDevice parameters come from mbed_lib.json if not provided
explicitly.

Introduced an app config file for running filesystem tests.
2020-01-03 15:25:40 +02:00
Anna Bridge 309183420b
Merge pull request #12111 from rajkan01/feature_feof_disable
Microlib: Disable feof function usage in general filesystem test
2019-12-17 16:36:54 +00:00
Przemyslaw Stekiel 25f354fe1f storage: fix static pin-map for ARMC5 2019-12-16 15:38:07 +01:00
Rajkumar Kanagaraj 95f56bac30 Microlib: Disable feof function usage in tests
feof function is not supported in Microlib library. so disabling all the feof function usage in the green tea test.
2019-12-16 04:34:20 -08:00
Martin Kojtal f2a1804d51
Merge pull request #12058 from mprse/static_pinmap_for_cloud_client
Add static pin-map support: SDBlockDevice, kvstore, system storage (reduce ROM used by Mbed Cloud Client example)
2019-12-10 14:19:18 +01:00
Przemyslaw Stekiel ee5953ad74 Add static pinmap support: SDBlockDevice, kvstore, system storage
This is done in order to enable static pin-map for Mbed Cloud Client Example. This should give extra ROM savings, ~1KB.
2019-12-10 12:26:23 +01:00
Seppo Takalo 1f99703806 Fix TDBStore sizes for tests
Tests must require at least 2 erase sectors per TDBStore,
so that the garbage collection may work.
2019-12-09 11:18:29 +02:00
Martin Kojtal 412a9317de
Merge pull request #12017 from VeijoPesonen/remove_nvstore
NVStore: already deprecated implementation removed
2019-12-05 09:10:30 +01:00
Seppo Takalo 21acb66c1c TDBStore: remove unused variables 2019-12-04 16:21:55 +02:00
Seppo Takalo 7902100238 SecureStore: Get rid of casting by using opaque pointers. 2019-12-04 16:21:55 +02:00
Seppo Takalo 23b2b8c4f3 SecureStore: Deinitialize also member TDBStorages on deinit() 2019-12-04 14:55:45 +02:00
Seppo Takalo 650b93b66c SecureStore: Validate internal RBP data first
Previous logic was allowing external storage to be tampered by setting
write-protected keys, so values could not be updated, but it was still
used by get().
2019-12-04 14:55:45 +02:00
Seppo Takalo bde9753696 SecureStore: Don't use flags of corrupted data. Allow removing. 2019-12-04 14:55:45 +02:00
Seppo Takalo 56d67360ef SecureStore: Validate internal header size before using its values. 2019-12-04 14:55:45 +02:00
Martin Kojtal 7a085b472b
Merge pull request #11987 from ARMmbed/feature_tdbstore_refactoring
TDBStore refactoring
2019-12-04 13:51:50 +01:00
Veijo Pesonen 060a1c6df7 NVStore: deprecated implementation removed 2019-12-03 15:36:31 +02:00
Seppo Takalo ce7b196b26 TDBStore: Don't copy more data than what we can hold 2019-12-03 15:20:10 +02:00
Seppo Takalo fe3c3550f9 TDBStore: Move Assert to init(), so Block parameter are initialised correctly 2019-12-03 15:20:10 +02:00
Seppo Takalo adf409f7f7 Do not require Flash device for TDBStore
TDBStore used to rely on Flash devices erase value.
This logic has been removed, and TDBStore can do the entire erase
logic itself, in case the given BlockDevice does not offer erase().
This relies on BlockDevice to properly return -1 in BlockDevice::get_erase_value().
2019-12-03 15:20:10 +02:00
Seppo Takalo 3dc6c4879f TDBStore: erase one program unit more, when cleaning an area 2019-12-03 15:20:10 +02:00
Seppo Takalo 93d7422f75 TDBStore: Do no garbage_collect() on init()
Previous logic caused garbage collection to kick in, if the init() was
called on empty storage. This has effect of erasing areas twice, if both
areas were empty.

Re-write logic so that we erase areas only on garbage_collect() or reset().
The init() logic already chooses the active area, so no need to touch,
until keys are modified.

Removed also the is_erase_unit_erased() as this is working only on
FLASH devices, and TDBStore should be refactored to work on all storages.
2019-12-03 15:20:10 +02:00
Seppo Takalo 36523282fa TDBStore: Keep copy of reserved data on both areas.
Change the "reserved data" logic so that every time we erase and area,
the content of reserved data is then immediately copied to newly erased
area. This keeps two copies of the data.
When data is requested, return only if checksum is matching.
When data is written, only allow if BOTH checksums are incorrect, meaning
that areas are either corrupted or erased.
Only exception is TDBStore::reset() which erases all keys and reserved data.

Removed all logic that tried to detect, if reserved are was erased or
corrupted. Rely entirely on checksum.

Add moduletest for reserved data.
2019-12-03 15:20:10 +02:00
Seppo Takalo 0fe159f6c4 Greentea: Fix slice-calculation from kvstore test phase 2 2019-12-03 14:51:37 +02:00
Seppo Takalo 2ddd4069b6 Remove flaky error_inject_test 2019-12-03 14:38:40 +02:00
Seppo Takalo b9eaac4da0 Fix Greentea handler typecasting. 2019-12-03 14:38:40 +02:00
Seppo Takalo 3eb8d6eb1d BufferedBlockDevice: Sync all the buffers on deinit()
Make sure that all data has been written on the underlying
storage when we do deinit().
2019-12-03 14:38:40 +02:00
Seppo Takalo 8ab3984d33 Don't allow over-read on BufferedBlockDevice 2019-12-03 14:38:40 +02:00