Commit Graph

43 Commits (5f19b6b03a71f2f9b6585fb03a573de608a5532d)

Author SHA1 Message Date
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02:00
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
Martin Kojtal 04ed9c5c8c
Merge pull request #11851 from amq/patch-2
Enable FAT ChaN lib configuration with mbed_lib.json
2019-11-22 13:38:56 +01:00
amq 5ec0a911fa
Change "MBED_CONF_FAT" to MBED_CONF_FAT_CHAN" 2019-11-13 16:08:08 +01:00
amq 1b55cbe92d
Change library name from "fat" to "fat_chan" 2019-11-13 15:51:55 +01: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
amq b90838d6df
Change "description" to "help" 2019-11-12 19:15:39 +01:00
amq 52beee2bce
Add mbed_lib.json for the FAT ChaN library 2019-11-12 15:42:22 +01:00
amq 9b3affa78b
Enable FAT configuration with mbed_lib.json 2019-11-12 15:39:19 +01: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
Seppo Takalo 7f089ac074 Add empty unittest to generate zero baseline for untested files. 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
Martin Kojtal b005bf2133
Merge pull request #11269 from michalpasztamobica/coverity_fixes
storage: fix potential memory corruption and check return values
2019-08-23 15:49:14 +02:00
Janne Kiiskila f149b4c309 IAR / FATFS - Pe029 error
IAR compilation fails at `_fs = { 0 };` due to

```
[Error] FATFileSystem.cpp@285,0: [Pe029]: expected an expression
```

Changing that object initializer list instead, as that seems
to pass IAR compilation, too.

Changed original memset to object initialiser list based on review
feedback from Kevin Bracey.
2019-08-22 10:58:35 +03:00
Janne Kiiskila 4ad24c0dc2 FATFS - Fix copyright year
It's 2019 now.
2019-08-22 10:58:35 +03:00
Michal Paszta 5a9183c549 storage: fix potential memory corruption and check return values 2019-08-21 09:26:35 +03:00
Michal Paszta 406fcdc9b7 FATFileSystem::stat() enabled for all compilers
Macro which restricted compilation to GCC_ARM is removed.
Existing read_write() test is amended to call stat() and check that correct size is returned.
2019-08-09 15:52:49 +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
Martin Kojtal e54ce88bca storage: fix astyle coding style 2018-11-07 08:56:35 +00:00
Kevin Bracey fc32d954ac FATFileSystem: fix format specifiers 2018-10-31 14:49:22 +02: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
Oren Cohen 9e337bb600 Restore disk_get_sector_size() to return WORD 2018-10-10 14:57:44 +03:00
Oren Cohen 37b5442656 Fix overflow in disk_get_sector_size() 2018-10-10 14:57:42 +03: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