Commit Graph

288 Commits

Author SHA1 Message Date
Martin Gaňo
1206d05d36 fatfsgen.py: removed unused options in Kconfig 2022-09-30 14:49:20 +02:00
Roland Dobai
a38c63b211 Merge branch 'feature/enable-variable-partition-size-fatfs' into 'master'
fatfs: enabled reading sector size and sectors count from boot sector in rawflash

Closes IDF-4130

See merge request espressif/esp-idf!20412
2022-09-30 15:24:26 +08:00
Martin Vychodil
dd3cf2513d Merge branch 'bugfix/fatfsgen-omit-cluster-for-empty-files' into 'master'
fatfsgen.py: omit cluster allocation when the file is empty

Closes IDF-6037

See merge request espressif/esp-idf!20441
2022-09-30 14:42:52 +08:00
Martin Vychodil
27601eed24 Merge branch 'feature/ut-fatfs-not-ignore-leading-spaces' into 'master'
fatfs/unittest: fatfs ignores leading spaces

Closes IDF-5896

See merge request espressif/esp-idf!20152
2022-09-30 14:38:56 +08:00
Martin Gaňo
7fb62d41d5 fatfsgen.py: omit cluster allocation when the file is empty 2022-09-29 16:18:56 +02:00
Martin Gaňo
41742c2369 fatfs: enabled reading sector size and sectors count from boot sector in rawflash 2022-09-29 16:16:36 +02:00
Martin Vychodil
e82adaaaf7 Merge branch 'feature/add-test-coverage-with-review' into 'master'
fatfs: add test coverage and comments to the fatfsgen.py related code

Closes IDF-5864

See merge request espressif/esp-idf!19986
2022-09-29 19:17:17 +08:00
Martin Gaňo
f995584a6d fatfs: unittest fatfs ignores leading spaces 2022-09-29 12:22:53 +02:00
Martin Gaňo
943f96422b fatfs: add test coverage and comments to the fatfsgen.py related code 2022-09-27 12:14:32 +02:00
Martin Gaňo
2a0ea8703d fatfsgen.py: enabled 512 sized sectors 2022-09-27 10:18:52 +02:00
Martin Gaňo
567f5f963c fatfsgen.py: use lfn record when forbidden character detected in the file name
The file name is recorded as a LFN when it doesn't fit 8.3 pattern or if it contains characters prohibited in SFN
2022-09-21 15:22:51 +00:00
Martin Gaňo
b187fad076 fatfsgen.py: Increase number of files in directory
By starting the ID at the value 1, instead of ord('1') we increase the possible number of files by 49.
2022-09-21 13:30:05 +00:00
Martin Gaňo
53c2ea2d08 fatfsgen.py: enable multiple dots in the long file name 2022-09-16 13:50:12 +02:00
Martin Gaňo
26f7f105c3 fatfsparse.py: Fixed ignoring first file in directory
Closes IDF-5968
2022-09-15 19:38:39 +02:00
Martin Vychodil
1146b83bf1 Merge branch 'feature/detect-wl-automatically' into 'master'
fatfsparse.py: enable automatic WL detection

Closes IDF-5903

See merge request espressif/esp-idf!20076
2022-09-16 00:23:50 +08:00
Martin Gaňo
30dd0fbf30 fatfsparse.py: enable automatic WL detection 2022-09-15 10:51:48 +00:00
Martin Gaňo
131b28314e fatfsgen.py: fixed missing NULL terminator 2022-09-14 16:55:13 +02:00
Martin Gaňo
37178dfa74 fatfsparse.py: limit the file content size to correct number 2022-09-12 14:13:03 +00:00
Martin Gaňo
72acbeb921 fatfsparse.py: enable automatic detection of lfn 2022-09-08 10:53:04 +02:00
Ivan Grokhotkov
401c10ecfb build system: re-add -Wno-format as private flag for some components 2022-08-03 16:42:47 +04:00
Martin Gaňo
2d173c0777 fatfsgen.py: enabled extension of the FAT table
Closes IDF-5688
2022-08-01 20:29:02 +02:00
Martin Gaňo
d56e692f2f fatfsgen.py: Speedup FAT cluster allocation in fatfsgen.py
Closes IDF-5243
2022-07-28 01:37:39 +02:00
Martin Gaňo
2ddcda29b3 fatfsparse.py: Add support for WL 2022-07-26 14:50:07 +02:00
Martin Vychodil
8def7b3e55 Merge branch 'contrib/github_pr_9361' into 'master'
Change placeholder in ESP_LOGD conditionally depending on FF_FS_EXFAT (GitHub PR)

Closes IDFGH-7832 and IDFGH-7735

See merge request espressif/esp-idf!19111
2022-07-24 16:49:22 +08:00
John
aaf35889b6 Change placeholder in ESP_LOGD conditionally depending on FF_FS_EXFAT
In case of using EXFAT by setting in ffconf.h:
the type FSIZE_t is changing from 4 to 8 bytes.

As a result,  ESP_LOGD() in vfs_fat_lseek() does not compile:
error: format '%d' expects argument of type 'int', but argument 8 has type 'FSIZE_t' {aka 'long long unsigned int'} [-Werror=format=]
     ESP_LOGD(TAG, "%s: offset=%ld, filesize:=%d", __func__, new_pos, f_size(file));

To solve the problem we need to change %d with %lld conditionally, depending on FF_FS_EXFAT.

Closes https://github.com/espressif/esp-idf/pull/9361
2022-07-22 16:52:14 +01:00
Darian Leung
781d06af73 esp_hw_support: Remove compare_set.h API
This function removes the following legacy atomic CAS functions:

From compare_set.h (file removed):
- compare_and_set_native()
- compare_and_set_extram()

From portmacro.h
- uxPortCompareSet()
- uxPortCompareSetExtram()

Users should call esp_cpu_compare_and_set() instead as this function hides the details
of atomic CAS on internal and external RAM addresses.

Due to the removal of compare_set.h, some missing header includes are also fixed in this commit.
2022-07-22 00:06:06 +08:00
David Cermak
5c383d7b73 esp_netif/lwip: Fix deps cycles to "lwip -> esp_netif -> phy-drivers"
Fix dependency tree so that lwip doesn't depend on any specific network
interface component.
Network interface drivers shall depend on esp_netif.
esp_netif shall depend on lwip (but not on any specific interface
driver) -- it optionally depends on vfs and esp_eth (need ethernet
header for L2/bridge mode)
2022-07-20 14:59:07 +02:00
Jakob Hasse
daacc19149 Merge branch 'bugfix/fatfs_spiffs_vfs_dep' into 'master'
fatfs, spiffs: add missing dependency on vfs

See merge request espressif/esp-idf!18613
2022-07-01 18:13:51 +08:00
Cao Sen Miao
a690a87829 spi_flash: Remove legacy spi_flash drivers 2022-07-01 11:01:34 +08:00
Adam Múdry
0fac7d1c02 fatfs: Fix undefined ssize member of FATFS struct 2022-06-27 08:57:58 +00:00
Ivan Grokhotkov
88d2a221f1
fatfs, spiffs: add missing dependency on vfs
Since vfs is no longer a common component, the dependency needs to be
added explicitly.
2022-06-21 17:16:49 +02:00
Martin Vychodil
7f884dc966 Merge branch 'fix/ff_sdmmc_status_check_optional' into 'master'
fatfs: Add option to mock ff_sdmmc_status output to increase IO speed

Closes IDF-4788

See merge request espressif/esp-idf!18300
2022-06-13 14:42:12 +08:00
Matus Fabo
384d61f156 remove: sdspi_host deprecated api
add: migration guide documentation
2022-06-12 20:07:27 +00:00
Martin Vychodil
aa2cf79e13 Merge branch 'bugfix/fatfs_mtime_dst' into 'master'
fatfs: fix incorrect mtime returned for files created during DST

Closes IDFGH-7467

See merge request espressif/esp-idf!18333
2022-06-10 17:18:01 +08:00
Roland Dobai
724b4121b9 Merge branch 'feature/enable-lfn-for-fatfsparse' into 'master'
fatfs: enable long file names for fatfsparse.py

Closes IDF-4992

See merge request espressif/esp-idf!18212
2022-06-10 16:22:45 +08:00
Martin Vychodil
16a4ee7c36 Merge branch 'bugfix/spi_mode_status_check' into 'master'
sdmmc, sdspi: fixes related to status checks, R1b response support, erase fix for SPI mode, fix for erase timeout calculation

Closes IDF-4728

See merge request espressif/esp-idf!17727
2022-06-10 13:15:47 +08:00
Adam Múdry
8af790da45 fatfs: Add mock option to ff_sdmmc_status function to increase IO speed
Adds `disk_status_check_enable` field to `esp_vfs_fat_mount_config_t` struct to control if ff_sdmmc_status is mocked or not.
2022-06-09 20:09:32 +00:00
Ivan Grokhotkov
39238f51ce fatfs: fix incorrect mtime returned for files created during DST
mktime function uses tm_isdst member as an indicator whether the time
stamp is expected to be in daylight saving time (1) or not (0).
FAT filesystem uses local time as mtime, so no information about DST
is available from the filesystem.

According to mktime documentation, tm_isdst can be set to -1, in which
case the C library will try to determine if DST was or wasn't in
effect at that time, and will set UTC time accordingly.

Note that the conversion from UTC to local time and then back to UTC
(time_t -> localtime_r -> FAT timestamp -> mktime -> time_t) does not
always recover the same UTC time. In particular, the local time in the
hour before DST comes into effect can be interpreted as "before DST"
or "after DST", which would correspond to different UTC values. In
this case which option the C library chooses is undefined.

Closes https://github.com/espressif/esp-idf/issues/9039
Originally reported in https://github.com/espressif/arduino-esp32/issues/6786
2022-06-09 19:50:00 +00:00
Martin Gaňo
0f160c8f11 fatfs: enable long file names for fatfsparse.py 2022-06-09 15:51:03 +02:00
Cao Sen Miao
6589daabb9 MMU: Add configurable mmu page size support on ESP32C2 2022-06-08 19:34:31 +08:00
Michael (XIAO Xufeng)
6a8aed12ee ci: partially enable ut tests for esp32c2
Disabled test cases are tracked in:

 IDF-4465, IDF-5045, IDF-5057, IDF-5058, IDF-5059, IDF-5060, IDF-5061, IDF-5131

- test_fatfs: IDF-5136

- test_pm: IDF-5053

- test_cache_mmu: IDF-5138

- test_partitions: IDF-5137

- test_vfs: IDF-5139

- test_freertos: IDF-5140

- test_wpa_supplicant: IDF-5046

- test_mbedtls: IDF-5141

- test_pthread: IDF-5142

- test_protocomm: IDF-5143

- test_lightsleep: IDF-5053

- test_taskwdt: IDF-5055

- test_tcp_transport: IDF-5144

- test_app_update: IDF-5145

- test_timer: IDF-5052

- test_spi: IDF-5146

- test_rtc_clk: IDF-5060

- test_heap: IDF-5167

ci: fixed issues for tests of libgcc, ets_timer, newlib

test_pm: support on C2
2022-06-02 14:23:35 +08:00
Ivan Grokhotkov
a28828a6f4
fatfs: re-enable TRIM support for SPI mode
Previously this didn't work because MMC_ERASE implementation for SPI
didn't wait for the busy status indication.
2022-05-30 15:39:01 +02:00
Martin Vychodil
9bd819c78f Merge branch 'fix/fatfs_remove_utf16_support' into 'master'
FatFS: Disable UTF 16 filename encoding

Closes IDF-4795

See merge request espressif/esp-idf!18192
2022-05-30 20:59:53 +08:00
Martin Gano
8ef66536ed fatfsparse.py: add cluster chaining support to enable reading longer-than-sector files
Closes IDF-4975
2022-05-25 15:49:24 +02:00
Adam Múdry
b388321e3b fatfs: Disable UTF-16 filename encoding
UTF-16 is not supported in VFS and not covered by unit tests
2022-05-20 15:15:01 +02:00
Adam Múdry
2565acbc28 fatfs: Fix possible integer overflow in esp_vfs_fat_info() 2022-05-20 14:51:11 +02:00
Martin Gaňo
005af75da3 Added FATFS partition parser 2022-05-16 14:32:17 +02:00
morris
f670c2a963 Merge branch 'contrib/github_pr_8888' into 'master'
utils.py: fix assert range with hour (GitHub PR)

Closes IDFGH-7300

See merge request espressif/esp-idf!18011
2022-05-09 10:11:26 +08:00
Junzhuo
0172e97151
utils.py: fix assert range with hour
`hour=23` (23 P.M.) will out of the `range(0, 23)`, which should be `range(0, 24)`.
2022-05-04 00:43:27 +08:00
Ivan Grokhotkov
25a5344763 Merge branch 'feature/vfs_fat_info' into 'master'
fatfs: add esp_vfs_fat_info() + unit tests

Closes IDF-4853

See merge request espressif/esp-idf!17654
2022-04-27 17:01:33 +08:00
Anton Maklakov
bbe2bb9994 components: correct abs() use for 64-bit argument 2022-04-21 12:22:15 +07:00
Adam Múdry
22b46580f8 fatfs: add esp_vfs_fat_info() + unit tests 2022-04-15 20:49:53 +02:00
Matus Fabo
24268d47a2 change: renamed FATFS convenience mounting functions
change: renamed every instance of these functions
add: deprecation notice with old functions
change: CC0 licence to CC0-1.0 in fatfsgen_example_main.c
2022-04-11 08:44:40 +00:00
Martin Gano
d76de32f74 fatfsgen.py: enabled date and time for fatfs 2022-04-07 15:01:28 +02:00
Vamshi Gajjela
66561f838d vfs: bugfix vfs_fat_write/pwrite upon disk-full
Closes https://github.com/espressif/esp-idf/issues/5027
2022-03-21 17:28:46 +00:00
Martin Gaňo
fea2b5b64e fatfsgen.py: enabled long names support
Closes https://github.com/espressif/esp-idf/issues/8171
2022-03-11 11:20:31 +01:00
Vamshi Gajjela
ea9f7cc370 fatfs: Add ftruncate api support for VFS and FAT-VFS
Unit test cases added to verify ftruncate within fatfs tests.

Closes https://github.com/espressif/esp-idf/issues/8279
2022-03-08 16:58:25 +05:30
Zim Kalinowski
0440aca4e3 Merge branch 'feature/reevaluate_headers_include_dirs' into 'master'
esp_hw_support/esp_system: Re-evaluate header inclusions and include directories

See merge request espressif/esp-idf!16763
2022-03-08 01:32:24 +08:00
Sudeep Mohanty
a9fda54d39 esp_hw_support/esp_system: Re-evaluate header inclusions and include directories
This commit updates the visibility of various header files and cleans up
some unnecessary inclusions. Also, this commit removes certain header
include paths which were maintained for backward compatibility.
2022-03-07 11:18:08 +05:30
Vamshi Gajjela
964592e189 fatfs: Add trim ioctl call, set FF_USE_TRIM as default option.
FF_USE_TRIM is set by default with this commit. Fatfs invokes disk_ioctl
with CTRL_TRIM to erase the sectors calling sdmmc_erase_sectors to choose the right
argument for the erase operation based on media type.
2022-03-05 16:35:37 +05:30
Adam Múdry
bb8587a139 fatfs: Update to version 0.14b
Updated FATFS to 0.14b from 0.13c and patched for ESP32
2022-02-21 14:54:55 +01:00
Martin Gaňo
f3425dea96 fatfsgen.py: enabled automatic detection of the FATFS type for FAT12 and FAT16 2022-02-07 17:22:58 +01:00
Ivan Grokhotkov
f770cf721a fatfs: make global constants extern 2022-01-27 11:00:09 +07:00
laokaiyao
cf049e15ed esp8684: rename target to esp32c2 2022-01-19 11:08:57 +08:00
Roland Dobai
c43d14c2bf Merge branch 'contrib/github_pr_8169' into 'master'
fix fatfs_create_spiflash_image() feature

Closes IDFGH-6383

See merge request espressif/esp-idf!16601
2022-01-03 15:19:38 +00:00
Martin Gaňo
140f5be289 Updated typehints from str values to bytes 2022-01-03 01:02:16 +01:00
Martin Gaňo
f7983fd313 Use bytes instead of strings in tests 2022-01-03 00:47:00 +01:00
Cao Sen Miao
b0decda1e3 bootloader: move bootloader flash support to isolate folders 2021-12-30 14:05:12 +08:00
Levente Tamas
df2ae4689c fix fatfs_create_spiflash_image() feature (IDFGH-6383)
Open the files in binary mode, and remove the redundant encode
2021-12-30 00:22:13 +02:00
Omar Chebib
1bad4f18ed FATFS: fix system crash when mounting more than 2 volumes
* Fixes https://github.com/espressif/esp-idf/issues/7513
2021-12-20 03:16:18 +00:00
Simon
1c82e6eac7 Merge branch 'ci/8684_build_ci' into 'master'
CI: Enable ESP8684 build (2nd stage) CI on master (except example build)

Closes IDF-4388

See merge request espressif/esp-idf!16197
2021-12-14 11:12:10 +00:00
Cao Sen Miao
e81841318f CI: Enable ESP8684 build stage CI on master 2021-12-13 19:18:47 +08:00
hörbert
ed2a21e1c7
Don't return a hard coded errno in vfs_fat_access
Why should the return value of vfs_fat_access be hard coded as ENOENT?
This hides errors like FR_DISK_ERR of the lower layers.
2021-12-08 11:43:18 +01:00
Martin Gano
7460deeae8 support for wear levelling in fatfs partition generator
Closes https://github.com/espressif/esp-idf/issues/5785
2021-11-29 16:57:47 +01:00
Matus Fabo
a390efe798 fix: pin definitions for other boards
fix: re-enabled fatfs r/w test on sdspi
fix: copyright notice
add: pin definitions for esp32c3
fix: Changed fixed spi dma channel to a macro definition
2021-11-16 14:13:25 +01:00
Roland Dobai
766aa57084 Build & config: Remove leftover files from the unsupported "make" build system 2021-11-11 15:32:36 +01:00
Martin Gano
3c4034d36e support for generating FATFS on a host 2021-11-03 13:06:11 +01:00
Jan Procházka
fb22c1f182 fatfs: Implementation of disk_status nad disk_initialize for SD/MMC card
FATFS provides a disk status and disk initialize callback which were not
implemented. Implementation has very low impact on SD/MMC speed and
fixes issues, when trying to open file when SD card was removed from
slot and not deinited.

If disk_status returns STA_NOINIT, it will always continue with
disk_initialize. If that returns 0, it will continue like everything is
working normally. So there has to be the same check as in disk_status.
Return of disk_initialize is always checked like this for STA_NOINIT or
STA_PROTECT so if command fails, we return the STA_NOINIT.

stat = disk_initialize(pdrv);
if (stat & STA_NOINIT) return FR_NOT_READY;
if (stat & STA_PROTECT) return FR_WRITE_PROTECTED;

Closes IDF-4125
2021-11-01 15:11:40 +08:00
Omar Chebib
63b96d7612 FAT: Number of volumes can now be configured through menuconfig
Closes https://github.com/espressif/esp-idf/issues/7513
2021-10-19 12:15:31 +08:00
Adam Múdry
4a6cc1d2a4 vfs/fatfs: fix failed tests by increasing timeout
Default 30s timeout is too low for a case when SD card formatting is triggered,
which could lead to tests failure. Timeout of tests is now set to 60s.

JIRA IDFCI-742
2021-08-25 19:04:34 +08:00
Omar Chebib
bd96484f7b host tests: add missing header files for compiling host tests 2021-07-20 17:44:20 +08:00
Marius Vikhammer
79b5dedeb1 CI: minor testcases fixes and disable some cases that cant run on S3 2021-06-15 13:39:48 +08:00
Jakob Hasse
ef2dba3921 Integrated linux log into fatfs and spiffs host tests 2021-05-28 11:05:55 +08:00
Michael (XIAO Xufeng)
925dacd7fb Merge branch 'bugfix/remove_HSPI_macro_on_c3' into 'master'
spi: remove HSPI macros on esp32c3 and esp32s3

Closes IDF-2535

See merge request espressif/esp-idf!12637
2021-04-08 09:33:18 +00:00
Armando
9b9ea71ff9 spi: remove HSPI macro on esp32c3 and esp32s3 2021-04-06 13:42:49 +08:00
Renz Bagaporo
e6edf34e82 esp32: move esp_clk functions 2021-03-31 19:17:33 +08:00
Renz Bagaporo
4a08264e7a esp_system: split esp_system.h header 2021-03-31 19:13:03 +08:00
aditi_lonkar
6e7780421b fatfs: Fix some memory leak issues by coverity static analyzer. 2021-01-25 03:37:47 +00:00
morris
e9c131e174 fatfs: return EINVAL if truncate length is less than 0 2021-01-13 19:11:48 +08:00
morris
753a929525 global: fix sign-compare warnings 2021-01-12 14:05:08 +08:00
Marius Vikhammer
9c8e4fd4c5 C3: build and run unit tests
Enable building and running of unit tests in CI for C3 as well as fix
related compile errors

Also enables building of C3 test apps
2021-01-11 11:34:37 +08:00
Ivan Grokhotkov
b1c4107275 vfs: zero-initialize struct stat in *_stat and *_fstat handlers
...otherwise some fields will contain garbage values.
This wasn't noticed until HAVE_BLKSIZE got enabled in newlib builds.
2020-12-29 16:18:04 +01:00
Angus Gratton
8fa2cf464a fatfs: Whitespace cleanup 2020-12-24 13:40:01 +11:00
Angus Gratton
61f4be45ec fatfs: Make host sdkconfig compatible 2020-11-17 22:51:07 +00:00
Angus Gratton
6ce34a227e Merge branch 'feature/fatfs_fast_seek' into 'master'
feature/fatfs: enable the usage of fast-seek algorithm

See merge request espressif/esp-idf!9916
2020-11-17 07:17:31 +08:00
Angus Gratton
66fb5a29bb Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo.

(Line endings, blank lines at end of file, trailing whitespace)
2020-11-11 07:36:35 +00:00
Felipe Neves
ac6ce5ddbd docs: added some fast-seek documentation to the fatfs.rst 2020-11-06 13:18:16 -03:00
Felipe Neves
93ffc009ef vfs: restrict the fast seek for read-only files
Since the files under fast-seek cannot be expanded with further writes, it does not
make sense to enable fast-seek which may fail in write-mode files
2020-11-05 17:01:50 -03:00
Felipe Neves
32e760adfb fat_vfs: added fast seek capable file operation 2020-11-05 17:01:50 -03:00
Felipe Neves
8815a3dfa0 fatfs: expose FF_USE_FASTSEEK option 2020-11-05 17:01:50 -03:00