diff --git a/configs/stm32f429i-disco/Kconfig b/configs/stm32f429i-disco/Kconfig index f2e5bfe05f..dddb2a5d11 100644 --- a/configs/stm32f429i-disco/Kconfig +++ b/configs/stm32f429i-disco/Kconfig @@ -54,6 +54,14 @@ config STM32F429I_DISCO_FLASH_PART_LIST ---help--- Comma separated list of partition sizes in KB. +config STM32F429I_DISCO_FLASH_PART_NAMES + string "Flash partition name list" + default "config,rfs" + depends on STM32F429I_DISCO_FLASH_PART + depends on MTD_PARTITION_NAMES + ---help--- + Comma separated list of partition names. + config STM32F429I_DISCO_RAMMTD bool "MTD driver for SMARTFS RAM disk" default n diff --git a/configs/stm32f429i-disco/extflash/defconfig b/configs/stm32f429i-disco/extflash/defconfig index 0245ebd341..60523721c2 100644 --- a/configs/stm32f429i-disco/extflash/defconfig +++ b/configs/stm32f429i-disco/extflash/defconfig @@ -384,7 +384,11 @@ CONFIG_NSH_MMCSDMINOR=0 # CONFIG_STM32F429I_DISCO_FLASH=y CONFIG_STM32F429I_DISCO_FLASH_MINOR=0 -# CONFIG_STM32F429I_DISCO_FLASH_PART is not set +CONFIG_STM32F429I_DISCO_FLASH_PART=y +CONFIG_STM32F429I_DISCO_FLASH_CONFIG_PART=y +CONFIG_STM32F429I_DISCO_FLASH_CONFIG_PART_NUMBER=0 +CONFIG_STM32F429I_DISCO_FLASH_PART_LIST="4,8188" +CONFIG_STM32F429I_DISCO_FLASH_PART_NAMES="config,rfs" CONFIG_STM32F429I_DISCO_RAMMTD=y CONFIG_STM32F429I_DISCO_RAMMTD_MINOR=1 CONFIG_STM32F429I_DISCO_RAMMTD_SIZE=256 @@ -487,6 +491,7 @@ CONFIG_MTD=y # MTD Configuration # CONFIG_MTD_PARTITION=y +CONFIG_MTD_PARTITION_NAMES=y CONFIG_MTD_BYTE_WRITE=y CONFIG_MTD_CONFIG=y CONFIG_MTD_CONFIG_RAM_CONSOLIDATE=y @@ -586,9 +591,18 @@ CONFIG_FS_WRITABLE=y CONFIG_FS_SMARTFS=y CONFIG_SMARTFS_ERASEDSTATE=0xff CONFIG_SMARTFS_MAXNAMLEN=16 -# CONFIG_SMARTFS_MULTI_ROOT_DIRS is not set +CONFIG_SMARTFS_MULTI_ROOT_DIRS=y # CONFIG_FS_BINFS is not set -# CONFIG_FS_PROCFS is not set +CONFIG_FS_PROCFS=y + +# +# Exclude individual procfs entries +# +# CONFIG_FS_PROCFS_EXCLUDE_MOUNTS is not set +# CONFIG_FS_PROCFS_EXCLUDE_MTD is not set +# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set +# CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS is not set +# CONFIG_FS_PROCFS_EXCLUDE_SMARTFS is not set # # System Logging diff --git a/configs/stm32f429i-disco/nsh/defconfig b/configs/stm32f429i-disco/nsh/defconfig index 78c8dca335..8b1f8cc875 100644 --- a/configs/stm32f429i-disco/nsh/defconfig +++ b/configs/stm32f429i-disco/nsh/defconfig @@ -247,12 +247,13 @@ CONFIG_STM32_FSMC=y # CONFIG_STM32_I2C1 is not set # CONFIG_STM32_I2C2 is not set # CONFIG_STM32_I2C3 is not set +# CONFIG_STM32_LTDC is not set # CONFIG_STM32_OTGFS is not set # CONFIG_STM32_OTGHS is not set CONFIG_STM32_PWR=y # CONFIG_STM32_RNG is not set # CONFIG_STM32_SDIO is not set -CONFIG_STM32_SPI1=y +# CONFIG_STM32_SPI1 is not set # CONFIG_STM32_SPI2 is not set # CONFIG_STM32_SPI3 is not set # CONFIG_STM32_SPI4 is not set @@ -283,7 +284,6 @@ CONFIG_STM32_USART1=y # CONFIG_STM32_UART8 is not set # CONFIG_STM32_IWDG is not set # CONFIG_STM32_WWDG is not set -CONFIG_STM32_SPI=y # # Alternate Pin Mapping @@ -307,12 +307,6 @@ CONFIG_STM32_USART=y # CONFIG_SERIAL_DISABLE_REORDERING is not set # CONFIG_STM32_USART_SINGLEWIRE is not set -# -# SPI Configuration -# -# CONFIG_STM32_SPI_INTERRUPTS is not set -# CONFIG_STM32_SPI_DMA is not set - # # USB Host Configuration # @@ -381,6 +375,8 @@ CONFIG_NSH_MMCSDMINOR=0 # # Board-Specific Options # +# CONFIG_STM32F429I_DISCO_FLASH is not set +# CONFIG_STM32F429I_DISCO_RAMMTD is not set # # RTOS Features @@ -454,6 +450,7 @@ CONFIG_DEV_NULL=y # CONFIG_LOOP is not set # CONFIG_RAMDISK is not set # CONFIG_CAN is not set +# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set # CONFIG_PWM is not set # CONFIG_I2C is not set CONFIG_ARCH_HAVE_I2CRESET=y @@ -462,6 +459,7 @@ CONFIG_SPI=y CONFIG_SPI_EXCHANGE=y # CONFIG_SPI_CMDDATA is not set # CONFIG_SPI_BITBANG is not set +# CONFIG_I2S is not set # CONFIG_RTC is not set # CONFIG_WATCHDOG is not set # CONFIG_ANALOG is not set @@ -531,12 +529,15 @@ CONFIG_USART1_2STOP=0 # File system configuration # # CONFIG_DISABLE_MOUNTPOINT is not set +# CONFIG_FS_READABLE is not set +# CONFIG_FS_WRITABLE is not set # CONFIG_FS_RAMMAP is not set # CONFIG_FS_FAT is not set # CONFIG_FS_NXFFS is not set # CONFIG_FS_ROMFS is not set # CONFIG_FS_SMARTFS is not set # CONFIG_FS_BINFS is not set +# CONFIG_FS_PROCFS is not set # # System Logging diff --git a/configs/stm32f429i-disco/src/up_nsh.c b/configs/stm32f429i-disco/src/up_nsh.c index bca81d939a..fff6da883f 100644 --- a/configs/stm32f429i-disco/src/up_nsh.c +++ b/configs/stm32f429i-disco/src/up_nsh.c @@ -59,6 +59,10 @@ # include #endif +#ifndef CONFIG_STM32F429I_DISCO_FLASH_MINOR +#define CONFIG_STM32F429I_DISCO_FLASH_MINOR 0 +#endif + #ifdef CONFIG_STM32F429I_DISCO_FLASH_CONFIG_PART #ifdef CONFIG_PLATFORM_CONFIGDATA # include @@ -153,6 +157,9 @@ int nsh_archinitialize(void) FAR struct spi_dev_s *spi; FAR struct mtd_dev_s *mtd; #endif +#if defined(CONFIG_MTD_PARTITION_NAMES) + FAR const char *partname = CONFIG_STM32F429I_DISCO_FLASH_PART_NAMES; +#endif /* Configure SPI-based devices */ @@ -193,7 +200,7 @@ int nsh_archinitialize(void) const char *partstring = CONFIG_STM32F429I_DISCO_FLASH_PART_LIST; const char *ptr; FAR struct mtd_dev_s *mtd_part; - char partname[4]; + char partref[4]; /* Now create a partition on the FLASH device */ @@ -226,11 +233,34 @@ int nsh_archinitialize(void) */ #if defined(CONFIG_MTD_SMART) && defined(CONFIG_FS_SMARTFS) - sprintf(partname, "p%d", partno); - smart_initialize(CONFIG_STM32F429I_DISCO_FLASH_MINOR, mtd_part, partname); + sprintf(partref, "p%d", partno); + smart_initialize(CONFIG_STM32F429I_DISCO_FLASH_MINOR, mtd_part, partref); #endif } + /* Set the partition name */ + +#if defined(CONFIG_MTD_PARTITION_NAMES) + mtd_setpartitionname(mtd_part, partname); + + /* Now skip to next name. We don't need to split the string here + * because the MTD partition logic will only display names up to + * the comma, thus allowing us to use a single static name + * in the code. + */ + + while (*partname != ',' && *partname != '\0') + { + /* Skip to next ',' */ + + partname++; + } + if (*partname == ',') + { + partname++; + } +#endif + /* Update the pointer to point to the next size in the list */ while ((*ptr >= '0') && (*ptr <= '9'))