From c9d784a2383e4533247281849b650626dc1dccc3 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Nihei Date: Mon, 25 Oct 2021 14:51:17 -0300 Subject: [PATCH] boards/esp32c3-devkit: Port SPI Flash FS fixes from ESP32 This commit brings 3 fixes/improvements applied to the Kconfig options for SPI Flash file system support on board bring-up: - (925e8f9) Optionally mount SPI Flash MTD on bring-up - (f74c6f7) Transform SPI Flash FS deps into reverse deps - (9056cab) Select MTD_SMART if SmartFS is selected for SPI Flash MTD Signed-off-by: Gustavo Henrique Nihei --- boards/risc-v/esp32c3/esp32c3-devkit/Kconfig | 38 +++++++++++-------- .../esp32c3-devkit/configs/spiflash/defconfig | 3 +- .../configs/sta_softap/defconfig | 2 +- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/Kconfig b/boards/risc-v/esp32c3/esp32c3-devkit/Kconfig index 218697ca0a..6e1bb878bf 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/Kconfig +++ b/boards/risc-v/esp32c3/esp32c3-devkit/Kconfig @@ -50,26 +50,32 @@ config ESP32C3_MERGE_BINS This is only useful when the path to binary files (e.g. bootloader) is provided via the ESPTOOL_BINDIR variable. -choice - prompt "SPIFLASH File System" - default ESP32C3_SPIFLASH_SMARTFS - depends on ESP32C3_SPIFLASH +choice ESP32C3_SPIFLASH_FS + prompt "Mount SPI Flash MTD on bring-up" + default ESP32C3_SPIFLASH_SMARTFS + depends on ESP32C3_SPIFLASH + optional + ---help--- + Mount the SPI Flash MTD with the selected File System format on board + bring-up. + If not selected, the MTD will be registered as a device node on /dev. - config ESP32C3_SPIFLASH_SMARTFS - bool "SmartFS" - depends on FS_SMARTFS + config ESP32C3_SPIFLASH_SMARTFS + bool "SmartFS" + select FS_SMARTFS + select MTD_SMART - config ESP32C3_SPIFLASH_NXFFS - bool "NXFFS" - depends on FS_NXFFS + config ESP32C3_SPIFLASH_NXFFS + bool "NXFFS" + select FS_NXFFS - config ESP32C3_SPIFLASH_SPIFFS - bool "SPIFFS" - depends on FS_SPIFFS + config ESP32C3_SPIFLASH_SPIFFS + bool "SPIFFS" + select FS_SPIFFS - config ESP32C3_SPIFLASH_LITTLEFS - bool "LittleFS" - depends on FS_LITTLEFS + config ESP32C3_SPIFLASH_LITTLEFS + bool "LittleFS" + select FS_LITTLEFS endchoice diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/configs/spiflash/defconfig b/boards/risc-v/esp32c3/esp32c3-devkit/configs/spiflash/defconfig index c21f975bbe..dfab850100 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/configs/spiflash/defconfig +++ b/boards/risc-v/esp32c3/esp32c3-devkit/configs/spiflash/defconfig @@ -21,15 +21,14 @@ CONFIG_BOARD_LOOPSPERMSEC=15000 CONFIG_BUILTIN=y CONFIG_DEV_ZERO=y CONFIG_ESP32C3_SPIFLASH=y +CONFIG_ESP32C3_SPIFLASH_SMARTFS=y CONFIG_ESP32C3_STORAGE_MTD_OFFSET=0x110000 CONFIG_ESP32C3_STORAGE_MTD_SIZE=0xf0000 CONFIG_FS_PROCFS=y -CONFIG_FS_SMARTFS=y CONFIG_IDLETHREAD_STACKSIZE=2048 CONFIG_INTELHEX_BINARY=y CONFIG_LIBC_PERROR_STDOUT=y CONFIG_LIBC_STRERROR=y -CONFIG_MTD_SMART=y CONFIG_NAME_MAX=48 CONFIG_NSH_ARCHINIT=y CONFIG_NSH_BUILTIN_APPS=y diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/configs/sta_softap/defconfig b/boards/risc-v/esp32c3/esp32c3-devkit/configs/sta_softap/defconfig index bce0e0e065..e5500f7297 100644 --- a/boards/risc-v/esp32c3/esp32c3-devkit/configs/sta_softap/defconfig +++ b/boards/risc-v/esp32c3/esp32c3-devkit/configs/sta_softap/defconfig @@ -29,6 +29,7 @@ CONFIG_DEBUG_WIRELESS_ERROR=y CONFIG_DRIVERS_IEEE80211=y CONFIG_DRIVERS_WIRELESS=y CONFIG_ESP32C3_SPIFLASH=y +CONFIG_ESP32C3_SPIFLASH_SPIFFS=y CONFIG_ESP32C3_STORAGE_MTD_OFFSET=0x110000 CONFIG_ESP32C3_STORAGE_MTD_SIZE=0xf0000 CONFIG_ESP32C3_WIFI=y @@ -37,7 +38,6 @@ CONFIG_ESP32C3_WIFI_STATION_SOFTAP_COEXISTENCE=y CONFIG_EXAMPLES_DHCPD=y CONFIG_EXPERIMENTAL=y CONFIG_FS_PROCFS=y -CONFIG_FS_SPIFFS=y CONFIG_HAVE_CXX=y CONFIG_HAVE_CXXINITIALIZE=y CONFIG_IDLETHREAD_STACKSIZE=3072