Commit Graph

27 Commits (5f19b6b03a71f2f9b6585fb03a573de608a5532d)

Author SHA1 Message Date
Kevin Bracey cf13cd48bc LittleFS test: silence sign mismatch warning 2019-12-02 14:45:37 +02:00
Kevin Bracey 7a219260c1 LittleFS: correct CRC calculation
When using MbedCRC, init value must be non-reversed, regardless of
`reflect_data` or `reflect_out` settings. This means we need to reflect
the intermediate output before passing using it as the next init value.

(In GCC this ends up putting in two `RBIT` instructions back-to-back,
because it's implemented as assembler, so it doesn't know how to
optimise. In ARMC6, `__RBIT` is implemented as an intrinsic, so adding
this reflection cancels the existing reflection and makes the code
smaller).
2019-12-02 14:45:37 +02:00
Kevin Bracey c67816b5ff Adjust code for MbedCRC changes
* Make mbed_error use bitwise MbedCRC call rather than local
  implementation.
* Remove use of POLY_32BIT_REV_ANSI from LittleFS.
* Move some MbedCRC instances closer to use - construction cost is
  trivial, and visibility aids compiler optimisation.
2019-12-02 14:45:37 +02:00
Martin Kojtal 5f7ecea00b
Revert "MbedCRC and CRC HAL revisions" 2019-11-26 13:45:37 +00:00
Kevin Bracey 8811972201 Adjust code for MbedCRC changes
* Make mbed_error use bitwise MbedCRC call rather than local
  implementation.
* Remove use of POLY_32BIT_REV_ANSI from LittleFS.
* Move some MbedCRC instances closer to use - construction cost is
  trivial, and visibility aids compiler optimisation.
2019-11-13 14:31:49 +02:00
Seppo Takalo 168b51c415 Add storage related files to baseline unittest.
* Refactor some headers to use relative path from Mbed OS root.
* Refactor some data types to compile on 64bit machines.
* Refactor some debug traces to use mbed_trace.
2019-11-04 16:12:36 +02:00
Christopher Haster de8df75ec0 Merge commit '70cb12e72bef7a1f220b0e5f21457b6930d984b2' into littlefs-v1.7.2 2019-10-03 09:56:09 -05:00
Hugues Kamba e65a0c0a99 Remove minor build warnings 2019-09-02 15:04:58 +01:00
Michal Paszta 5a9183c549 storage: fix potential memory corruption and check return values 2019-08-21 09:26:35 +03:00
Michal Paszta 73b122b2c4 Coverity and compilation warnings fixes 2019-08-07 10:30:52 +03:00
int_szyk ae6f8be146 Newline at the end of files 2019-08-01 08:44:58 +02:00
int_szyk 8b68a1ea58 Updated testcases 2019-07-31 10:46:38 +02:00
Olli-Pekka Puolitaival 842d145d91 Py3 fixes for test scripts 2019-05-08 13:46:01 +03:00
Cruz Monrreal II f6b9109934 Fixed littlefs tests to be Py3 compat 2019-04-08 10:45:07 -05:00
Veijo Pesonen 293b0189d2 Adds newlines to avoid compiler warnings 2019-01-23 16:44:16 +02:00
David Saada c826f2eba2 Put LittleFS emulated BD module under .mbedignore 2019-01-20 16:06:08 +02:00
Christopher Haster 9d6e309432 Extended mount to check all metadata-pairs
The most common issue with using littlefs in mbed-os is when users
change from littlefs->FAT->littlefs (or with MBR or similar). When this
corrupts the superblock, littlefs tries to fall back to the backup
superblock. However, at this point in the time the old superblock may be
very out-of-date and pointing to an incorrect filesystem.

There's no complete solution to a malicious modification of the
filesystem (short of checking all metadata+data, a very expensive
operation), but we can at least expand our validation to all of the
metadata for the filesystem. This at least catches the common issues
with changing between different filesystems.
2019-01-17 11:02:29 -06:00
David Saada 3c7924ac9c Minor Doxygen fixes for all file system classes
- Remove Doxygen generation on protected functions
- Minor description fixes
2019-01-10 15:09:52 +02:00
Christopher Haster 8db2c0d00b Added filesystem implementations of truncate
- File::truncate
- FileSystem::file_truncate
- FATFileSystem::file_truncate
- LittleFileSystem::file_truncate
2018-12-14 19:29:29 +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
Martin Kojtal 20646d3da1 littlefs: fix coding style 2018-11-08 08:54:43 +00: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
Deepika 8642ece022 Storage: Add required header file and namespace element instead add all 2018-10-08 07:32:04 -05:00
deepikabhavnani 1cb87d3235 Added thread safety info to FatFs/LittleFs 2018-09-13 11:32:36 -05:00
Deepika 683034db8a Use the same API name to add mbed CRC: lfs_crc 2018-09-02 15:25:41 -05:00
Deepika 4d7fdfc2a9 Use MbedCRC for LittleFS (0xEDB88320)
CRC used in LittleFS is Reversed ANSI, hence new polynomial added.
Reversed polynomials perform shift in reverse direction of standard
polynomial, and we do not have option to notify reverse shift to hardware.
Hence this option is available in software only.
2018-09-02 15:25:40 -05: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