Commit Graph

40 Commits (8a5f58bf553d62bf1756b79d57d7b490f0219619)

Author SHA1 Message Date
Veijo Pesonen 0278e38896 ExhaustibleBlockDevice: revert commit 10481f2
Reverts commit 10481f2f7e partially.
Changes made to ExhaustibleBlockDevice hides simulated flash degradation
which is the assumed behavior. Converted back to original behavior.
2020-05-04 22:21:25 +03: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
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
Seppo Takalo 191d3444bb HeapBlockDevice: Don't assert on const functions 2019-12-03 14:38:40 +02:00
Seppo Takalo 6105634bb0 Remove unceressary NULL check from BufferedBlockDevice::size() 2019-12-03 14:38:40 +02:00
Seppo Takalo bcaf37dcfa SlicingBlockDevice should assert, if size does not look valid 2019-12-03 14:38:40 +02:00
Seppo Takalo 92a60c3d80 Extend SlicingBlockDevice test coverage 2019-12-03 14:38:40 +02:00
Seppo Takalo 4ab3c8bb48 IOTSTOR-953: Fix address calculations from SlicingBlockDevice
* Change MBED_ASSERTS() to return valid error code, so that
  checks are not bypassed on release builds.
* Fix starting address calculations so that "addr" parameter is always
  relative to SlicingDevice and "_start" is only added when calls to
  underlying storage block is made.
* Bypass BlockDevice:is_valid_*() to underlying block device.
  Slicingblockdevice was just verifying addresses independently, without
  verifying those from underlying block storage.
2019-11-04 16:13:32 +02:00
Seppo Takalo a6d8f74b09 Add unittest for HeapBlockDevice and change some MBED_ASSERTS to errors. 2019-11-04 16:12:36 +02:00
Michal Paszta 73b122b2c4 Coverity and compilation warnings fixes 2019-08-07 10:30:52 +03:00
Kevin Bracey 87396e0bf6 Assembler atomics
Reimplement atomic code in inline assembly. This can improve
optimisation, and avoids potential architectural problems with using
LDREX/STREX intrinsics.

API further extended:
* Bitwise operations (fetch_and/fetch_or/fetch_xor)
* fetch_add and fetch_sub (like incr/decr, but returning old value -
  aligning with C++11)
* compare_exchange_weak
* Explicit memory order specification
* Basic freestanding template overloads for C++

This gives our existing C implementation essentially all the functionality
needed by C++11.

An actual Atomic<T> template based upon these C functions could follow.
2019-04-26 13:12:35 +03:00
Martin Kojtal 1a14b9705a ExhaustibleBD: licensed under Apache 2.0
Fixing license, to the same one as .cpp file.
2019-04-16 10:32:23 +01:00
Amir Cohen 7fac0722a4 Fix functionality for FlashIAPBD & SlicingBD
Due to discovery of inconsistent sector sizes in devices storage the is_valid_erase function was adjusted,
For FlashIAPBD the 'code size' was included to the calculation, preventing faulty "virtual" addresses calculation.
For SlicingBD the same error was fixed and in all 3 validation functions that sent addresses for validation and program/read/erase
different addresses.
2019-03-14 17:46:10 +02:00
Cruz Monrreal 3b43a2d976
Merge pull request #9333 from offirko/offir_doxygen
Minor Doxygen fixes for BufferedBlockDevice and iBeacon
2019-01-17 21:51:14 -06:00
David Saada af23e3f489 MBRBlockDevice: When partitioning, clear the rest of first erase unit
Make sure all the parts of the first erase unit, that are not part of the
partition table are clear.
2019-01-15 16:43:03 +02:00
Guy Wild 6954c396fb Update BlockDevice.h 2019-01-10 16:38:00 +02:00
Yossi Levy 51168ee840 Merge branch 'yossi_write-a-thon2' of github.com:yossi2le/mbed-os into yossi_write-a-thon2 2019-01-10 15:55:08 +02:00
Mel Weed 10662582d1
minor editorial tweaks
partition's->partition
2019-01-10 15:53:59 +02:00
Yossi Levy 73ac904ef9 Doxygen changes to ProfilingBlockDevice and SlicingBlockDevice. 2019-01-10 15:53:49 +02:00
offirko b21576c8cf Review updates 2019-01-10 15:42:28 +02:00
Yossi Levy 7dde6773f9 Some Doxygen fixes in MBRBlockDevice and BlockDevice 2019-01-10 15:10:47 +02:00
offirko 61926092a2 Minor Doxygen fixes for BufferedBlockDevice and iBeacon 2019-01-10 14:35:09 +02:00
Yossi Levy b17d13e75e Documnent changes and adding const to get_type method 2018-12-23 14:27:14 +02:00
Yossi Levy b8b7292d8e astyle fix 2018-12-23 11:03:45 +02:00
Yossi Levy 1d71fb1c9f Add get_type method to block devices. 2018-12-23 11:03:45 +02:00
deepikabhavnani da69da972f Add BlockDevice and Filesystem classes inside mbed namespace.
Adding new modules inside the namespace could be breaking change for existing code base
hence add `using namespace::class` for classes newly added to mbed namespace to maintian
backwards compatibility.

MBED_NO_GLOBAL_USING_DIRECTIVE is added to remove auto-addition of namespace
Macro guard `MBED_NO_GLOBAL_USING_DIRECTIVE` is added around namespace, to avoid
polluting users namespace.
2018-11-26 13:35:40 -06:00
David Saada 50836e76a1 Improve the efficiency of BufferedBlockDevice 2018-11-15 11:52:22 +02:00
Martin Kojtal e54ce88bca storage: fix astyle coding style 2018-11-07 08:56:35 +00:00
Martin Kojtal fc741f03a1
Merge pull request #8346 from OpenNuvoton/nuvoton_fix_mbr
storage: fix valid partion check with windows formatted sd card
2018-10-26 09:37:28 +01:00
Anna Bridge 8dcc949c63
Merge pull request #8002 from deepikabhavnani/storage_remove_mbed_h
Storage: Add required header file and namespace element instead add all
2018-10-12 11:06:35 +01:00
Cruz Monrreal 0aed6bb43f
Merge pull request #8256 from yossi2le/fix_warnings_in_blockdevices
Fix warnings in block devices
2018-10-11 10:10:55 -05:00
ccli8 8ef23ff54d Fix mis-recognize that Windows-formatted SD card has valid partitions
For Windows-formatted SD card, it is not partitioned (no MBR), but its PBR has the
same boot signature (0xaa55) as MBR. We would easily mis-recognize this SD card has valid
partitions if we only check partition type. We add check by only accepting 0x00 (inactive)
/0x80 (active) for valid partition status.
2018-10-09 11:06:49 +08:00
Deepika 8642ece022 Storage: Add required header file and namespace element instead add all 2018-10-08 07:32:04 -05:00
Nir Sonnenschein f1587b50d7
Merge pull request #8262 from juhoeskeli/mbrblockdevice_align
Align MBRBlockDevice writes to underlying BlockDevice write size
2018-09-28 13:23:55 +03:00
Juho Eskeli d32b454c5b Align writes to blockdevice write size in MBRBlockDevice 2018-09-26 22:43:27 +03:00
Yossi Levy dd065e3be1 Fix warnings in block devices 2018-09-26 14:35:48 +03:00
David Saada ff7858a306 Fix is_valid_erase function to use get_erase_size with address 2018-09-03 16:15:54 +03:00
Yossi Levy ed8e170d15 Moving SD, SPIF and FLASHIAP into mbedos and refactoring features storage directory structure. 2018-08-29 12:01:11 +03:00