Commit graph

65 commits

Author SHA1 Message Date
Michael Balzer 0137aef471 Merge branch 'release/v3.3' of https://github.com/espressif/esp-idf.git into release/v3.3
# Conflicts:
#	components/bt/include/esp_bt.h
2020-07-15 12:08:17 +02:00
Roland Dobai 8d4e1c0616 Fix memory leak upon failure of esp_vfs_fat_sdmmc_mount()
Closes https://github.com/espressif/esp-idf/issues/4165
2019-10-21 08:22:12 +02:00
Michael Balzer e97f72ea24 Merge remote-tracking branch 'upstream/release/v3.3'
# Conflicts:
#	.gitlab-ci.yml
#	components/bootloader/project_include.cmake
#	components/bootloader_support/include/bootloader_common.h
#	components/bootloader_support/src/bootloader_common.c
#	components/bt/Kconfig
#	components/bt/bluedroid/btc/profile/std/include/btc_gap_ble.h
#	components/bt/bluedroid/stack/btm/btm_ble_gap.c
#	components/bt/bluedroid/stack/btm/btm_devctl.c
#	components/bt/bluedroid/stack/include/stack/hcidefs.h
#	components/bt/bluedroid/stack/smp/smp_act.c
#	components/bt/bt.c
#	components/bt/lib
#	components/driver/Kconfig
#	components/driver/include/driver/rmt.h
#	components/driver/test/test_spi_master.c
#	components/driver/uart.c
#	components/esp32/CMakeLists.txt
#	components/esp32/Kconfig
#	components/esp32/ld/esp32.project.ld.in
#	components/esp32/ld/esp32.spiram.rom-functions-dram.ld
#	components/esp32/ld/esp32.spiram.rom-functions-iram.ld
#	components/esp32/lib
#	components/esp32/spiram.c
#	components/esp32/spiram_psram.c
#	components/esp32/test/test_wifi.c
#	components/esp32/wifi_init.c
#	components/esp_http_server/include/esp_http_server.h
#	components/esp_http_server/src/esp_httpd_priv.h
#	components/esp_http_server/src/httpd_parse.c
#	components/esp_http_server/src/httpd_sess.c
#	components/esp_http_server/src/httpd_txrx.c
#	components/esp_http_server/src/httpd_uri.c
#	components/esp_http_server/test/test_http_server.c
#	components/esp_https_ota/src/esp_https_ota.c
#	components/ethernet/emac_main.c
#	components/freemodbus/Kconfig
#	components/idf_test/include/idf_performance.h
#	components/idf_test/integration_test/TC_IT_BLUEDROID_SMP.yml
#	components/lwip/Kconfig
#	components/newlib/test/test_time.c
#	components/nvs_flash/nvs_partition_generator/nvs_partition_gen.py
#	components/spi_flash/Kconfig
#	components/ulp/cmake/CMakeLists.txt
#	components/ulp/component_ulp_common.cmake
#	components/vfs/vfs.c
#	docs/conf_common.py
#	docs/en/api-reference/provisioning/wifi_provisioning.rst
#	examples/mesh/internal_communication/main/Kconfig.projbuild
#	examples/protocols/aws_iot/subscribe_publish/main/CMakeLists.txt
#	examples/protocols/aws_iot/thing_shadow/main/CMakeLists.txt
#	examples/protocols/coap_client/README.md
#	examples/protocols/coap_server/README.md
#	examples/protocols/modbus_slave/main/Kconfig.projbuild
#	examples/protocols/mqtt/ssl/mqtt_ssl_example_test.py
#	examples/protocols/mqtt/tcp/main/Kconfig.projbuild
#	examples/protocols/mqtt/ws/mqtt_ws_example_test.py
#	examples/protocols/mqtt/wss/mqtt_wss_example_test.py
#	examples/wifi/iperf/components/iperf/iperf.c
#	requirements.txt
#	tools/ci/build_examples.sh
#	tools/ci/test_build_system_cmake.sh
#	tools/cmake/idf_functions.cmake
#	tools/cmake/kconfig.cmake
#	tools/cmake/scripts/expand_requirements.cmake
#	tools/esp_prov/README.md
#	tools/esp_prov/esp_prov.py
#	tools/esp_prov/transport/ble_cli.py
#	tools/idf.py
#	tools/kconfig_new/confgen.py
#	tools/mass_mfg/docs/README.rst
#	tools/mass_mfg/samples/sample_config.csv
#	tools/tiny-test-fw/DUT.py
#	tools/tiny-test-fw/IDF/IDFApp.py
#	tools/tiny-test-fw/IDF/IDFDUT.py
#	tools/tiny-test-fw/TinyFW.py
#	tools/unit-test-app/tools/UnitTestParser.py
#	tools/unit-test-app/unit_test.py
2019-07-20 22:11:10 +02:00
Michael Balzer 40f01ec30a Merge remote-tracking branch 'upstream/release/v3.2' 2019-07-20 15:22:14 +02:00
Ivan Grokhotkov bbeb62547e fatfs: add option to prefer ext. RAM for internal buffers 2018-11-29 19:26:46 +08:00
Roland Dobai 5110d4b303 fatfs: Do not log from critical sections
Logging in the critical section can result in a deadlock when the logger
is redirected to FATFS.

Closes https://github.com/espressif/esp-idf/issues/1693
2018-11-26 09:21:44 +01:00
Roland Dobai ad2cdeb476 fatfs: Do not log from critical sections
Logging in the critical section can result in a deadlock when the logger
is redirected to FATFS.

Closes https://github.com/espressif/esp-idf/issues/1693
2018-11-16 11:19:01 +00:00
Roland Dobai fb334baa7c VFS: Implement utime() 2018-11-05 09:54:01 +01:00
Jakob Löw f2fbfeca87 Merge branch 'master' of github.com:espressif/esp-idf 2018-10-20 23:32:01 +02:00
Dmitry 35842d02ab Calculation for heap usage corrected with workaround.
Fixed problem with multiple mount/unmount for different devices.
Additional check for structure length included into the code.
Remove useless spaces.
Added initialization for reserved memory.
2018-07-31 08:45:42 +03:00
Angus Gratton a67d5d89e0 Replace all DOS line endings with Unix
Command run was:
git ls-tree -r HEAD --name-only | xargs dos2unix
2018-07-12 19:10:37 +08:00
Michael Balzer 0fb2019f2b Merge remote-tracking branch 'upstream/master' 2018-07-06 20:45:32 +02:00
Anton Maklakov 714a9bda92 fatfs: fix errors for GCC 8 support and some indentation
components/fatfs/src/ff.c: In function 'f_fdisk':
components/fatfs/src/ff.c:5995:5: error: this 'for' clause does not guard... [-Werror=misleading-indentation]
     for (n = 16; n < 256 && sz_disk / n / cluster_size > 1024; n *= 2) ;
     ^~~
components/fatfs/src/ff.c:5996:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  if (n == 256) n--;
  ^~
2018-07-02 09:05:00 +00:00
Sagar Bijwe fd7b794e81 FATFS support without wear levelling
This change allows readonly FATFS to be mounted without wear levelling
support. This will provide the customers a simple way to mount FATFS images
generated on host and flashed onto the chip during factory provisioning.
Since NVS encryption is not supported yet and NVS entry size is limited,
the change will provide an easy alternative for securing the provisioning data
by just marking FATFS parition as encrypted.
2018-06-16 16:02:35 +08:00
Renz Bagaporo ea711f2ee9 vfs, fatfs: Add file truncate for fatfs 2018-06-14 06:37:21 +08:00
Michael Balzer 1a1a544afa Fix vfs_fat_stat() DST time offset 2018-06-07 20:48:36 +02:00
Jiang Jiang Jian 993b8b7bf6 Merge branch 'bugfix/o3_fails' into 'master'
Fix compilation errors when -O3 is used

See merge request idf/esp-idf!2396
2018-05-17 16:48:13 +08:00
Roland Dobai ca08397b6b Fix compilation errors when -O3 is used
Closes https://github.com/espressif/esp-idf/issues/718
2018-05-14 12:29:57 +02:00
Roland Dobai 4345e198ce Implement VFS support for access()
Closes https://github.com/espressif/esp-idf/issues/1085
2018-05-14 09:04:18 +02:00
Roland Dobai 733ff15719 VFS: use O_APPEND flag of open() correctly
Closes https://github.com/espressif/esp-idf/pull/1455
2018-05-11 08:28:22 +02:00
Darian Leung 99b8ae34c9 fatfs/add menuconfig options for different encodings
This commit adds character encoding configurations in for the fatfs component.
The FF_LFN_UNICODE definition in ffconf.h can now be changed to accept UTF-8 or
UTF-16 encoded filernames. Test cases using UTF-8 encoded file paths and names in
FatFs have also been added.

Closes #1183
2018-03-23 14:06:56 +08:00
Ivan Grokhotkov bf53c8abb1 fatfs: check allocated workbuf pointer 2018-02-11 13:03:36 +08:00
Ivan Grokhotkov 59859fa53c fatfs: add configuration of allocation unit size
Closes https://github.com/espressif/esp-idf/issues/1382.
2018-02-11 13:03:36 +08:00
Ivan Grokhotkov 68bba96911 Merge branch 'bugfix/sdmmc_vfs_deinit' into 'master'
SDSPI bug fixes

See merge request !1647
2017-12-14 13:36:20 +08:00
Ivan Grokhotkov 4839da4d98 Merge branch 'bugfix/fatfs_stat' into 'master'
Fix stat behavior for FATFS mount point

See merge request !1652
2017-12-13 11:10:27 +08:00
Ivan Grokhotkov dfee6e825a vfs/fatfs: use structures with bit fields for FAT date/time
Replace explicit masks and shifts with bit fields when working with FATFS date and time representations. Also zero-initialize remaining members of struct tm.

Fixes https://github.com/espressif/esp-idf/issues/1369.
2017-12-11 11:11:48 +08:00
Ivan Grokhotkov ed1e6e7224 fatfs: fix double free in bailout path of esp_vfs_fat_sdmmc_mount
Fixes https://github.com/espressif/esp-idf/issues/1370
2017-12-11 11:07:08 +08:00
Ivan Grokhotkov 4170904224 fatfs: fix deinit not called for SDSPI host
Closes https://github.com/espressif/esp-idf/issues/1362
2017-12-11 11:07:08 +08:00
Ivan Grokhotkov a63ace15bd vfs/fatfs: fix stat call failing when called for mount point
FATFS does not support f_stat call for drive root. When handling stat
for drive root, don't call f_stat and just return struct st with S_IFDIR
flag set.

Closes #984
2017-12-08 20:04:27 +08:00
luc lebosse 58f046715e Unify the time file creation for SPIFFS and SD 2017-11-21 22:51:36 +08:00
Ivan Grokhotkov 8e180f6155 fatfs: update to R0.13a
- Remove ASCII-only configuration, CP437 is used instead
- Add dynamic code page configuration

See components/fatfs/src/00history.txt for FATFS changelog.
2017-11-14 12:57:55 +08:00
Angus Gratton bd9c5d9adc Merge branch 'feature/fatfs_kconfig_options' into 'master'
fatfs: expose some configuration values in Kconfig

See merge request !1415
2017-11-11 02:48:15 +08:00
Ivan Grokhotkov 07c44d7f01 fatfs: expose some configuration values in Kconfig
- _FS_TINY: disables per-file caches
- _FS_TIMEOUT: locking timeout for concurrent access
- _FS_LOCK: prevents operations which are not allowed on open files

Also sets _MAX_SS based on sector size configured for wear_levelling.
This reduces memory usage of FATFS if wear_levelling is using 512 byte
sectors.
2017-10-17 18:43:46 +08:00
Ivan Grokhotkov 502c3d0243 vfs,fat: add fsync to VFS interface, implement it for fatfs 2017-10-17 15:14:53 +08:00
Ivan Grokhotkov 104204ce56 fatfs: use correct return types in ioctl calls
GET_SECTOR_SIZE should return WORD (unsigned short) but returned
uint32_t.

Reference: http://elm-chan.org/fsw/ff/doc/dioctl.html

Closes https://github.com/espressif/esp-idf/pull/1031.
2017-10-10 12:02:32 +08:00
Luc 6e0f054884 use localtime_r instead of gmtime to get timezone
on fatfs
2017-09-30 21:44:35 +08:00
me-no-dev dd87deb278 Add SPIFFS Component to IDF 2017-09-11 19:56:40 +03:00
Quentin Thérond 88e71a680e vfs: fix double free. 2017-08-30 12:11:57 +10:00
Dmitry Yakovlev e5bb45f381 driver: SD protocol driver for SPI peripheral 2017-07-20 13:43:07 +08:00
Anton Maklakov 3d1d4fe150 build: Fix the warnings that break the tests
unused variable 'lfn'
    'isr_handler' defined but not used
    'servo_set_angle' defined but not used
    'gpio_test_signal' defined but not used
    'change_duty' defined but not used
2017-07-07 11:03:25 +08:00
Ivan Grokhotkov 45037efc45 Merge branch 'bugfix/vfs_write_return_type' into 'master'
Change esp_vfs_t.write return value to ssize_t

See merge request !897
2017-06-22 11:48:34 +08:00
Deomid Ryabkov b8782bdd90 Change esp_vfs_t.write return value to ssize_t
write() should return ssize_t, not size_t.
2017-06-09 21:24:00 +01:00
Ivan Grokhotkov 06accaf851 add C++ include guards to header files which are missing them
Fixes https://github.com/espressif/esp-idf/issues/628
2017-05-31 17:20:17 +08:00
Ivan Grokhotkov 53d5c5f668 vfs, fatfs: fix support for two FATFS instances (SD and flash)
- fix null pointer dereference in VFS when VFS implementations are added
  and removed in different order

- vfs_fat_sdmmc, vfs_fat_spiflash: pass correct drive to mkfs
  (previously it would always do mkfs in the first drive)

- add test case
2017-05-05 15:21:38 +08:00
Ivan Grokhotkov 5ac28e843d fatfs: clean up diskio code
- clean up diskio_spiflash, fix the max number of volumes supported
- move SDMMC code into a separate file
2017-05-05 15:21:38 +08:00
Ivan Grokhotkov d18157e108 vfs_fat: allocate FIL structures on the heap in vfs_fat_link
vfs_fat_link opened two files to perform copy operation. File structures
were allocated on the stack. When _MAX_SS setting was increased in
ffconf.h due to wear levelling feature, the size of these structures
increased to ~4k each (~8k total). This exceeds stack size allocated for
tasks in most typical cases.

This change makes file structures dynamically allocated.
2017-05-05 15:21:37 +08:00
Ivan Grokhotkov 1a73b41b10 vfs_fat: fix prepend_drive_to_path
Originally, prepend_drive_to_path was designed to be a macro, and it
modified local path variables to point to a temporary buffers.
When it was converted into a function, modification to path variables
were no longer visible outside of this function.

In addition to that, prepend_drive_to_path allocated 2k bytes on the
stack for temporary path buffers. This is replaced with path buffers
allocated as part of vfs_fat context object. Locking is added around
parts of code which use these temporary buffers.

Additionally, _lock member of vfs_fat_ctx_t was placed after the
variable-sized files array, which caused the first entry in the
array to be never used. This change fixes the order of members
and adds comments.
2017-05-05 15:21:37 +08:00
Nineis K b65779eefe Fix vfs_fat_spiflash failed to mount / f_mkfs() 2017-05-04 17:31:14 +08:00
Ivan Grokhotkov b540322dc1 Merge branch 'feature/wear_levelling' into 'master'
wear levelling

This MR adds wear levelling component. It presents an interface similar to the interface of spi_flash and esp_partition. Inside, it stores data inside a partition to in a way that reduces worst case number of erase cycles for any given sector.

Also included are APIs similar to the ones provided for SDMMC to mount FAT filesystem on top of the wear levelling partition. A simple example shows how this API can be used.

Ref TW10338.

See merge request !567
2017-04-25 19:46:11 +08:00
Ivan Grokhotkov 8f02730e1f fat/sdmmc: unmount FATFS object on error
Failure to call f_mount(NULL,...) makes FATFS attempt to clean up the old
FS object upon next mount. If previous mount operation has failed, some
parts of FS object may not be fully initialized, which will cause errors
(such as attempting to delete a mutex which wasn’t allocated).
2017-04-19 15:03:30 +08:00