diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-12-12 09:23:54 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-12-12 09:23:54 -0600 |
commit | 2eb282696b46c12b524b4e59575ba73401b0d5d6 (patch) | |
tree | 50c679070668c79d0c31fd88dac6b5191517ca15 /nuttx/configs | |
parent | 147415a647658c5d472338d745c5b68942eb0b2c (diff) | |
download | px4-nuttx-2eb282696b46c12b524b4e59575ba73401b0d5d6.tar.gz px4-nuttx-2eb282696b46c12b524b4e59575ba73401b0d5d6.tar.bz2 px4-nuttx-2eb282696b46c12b524b4e59575ba73401b0d5d6.zip |
STM32F429I-Discovery: Andd procfs MTD partition names
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/stm32f429i-disco/Kconfig | 8 | ||||
-rw-r--r-- | nuttx/configs/stm32f429i-disco/extflash/defconfig | 20 | ||||
-rw-r--r-- | nuttx/configs/stm32f429i-disco/nsh/defconfig | 17 | ||||
-rw-r--r-- | nuttx/configs/stm32f429i-disco/src/up_nsh.c | 36 |
4 files changed, 67 insertions, 14 deletions
diff --git a/nuttx/configs/stm32f429i-disco/Kconfig b/nuttx/configs/stm32f429i-disco/Kconfig index f2e5bfe05..dddb2a5d1 100644 --- a/nuttx/configs/stm32f429i-disco/Kconfig +++ b/nuttx/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/nuttx/configs/stm32f429i-disco/extflash/defconfig b/nuttx/configs/stm32f429i-disco/extflash/defconfig index 0245ebd34..60523721c 100644 --- a/nuttx/configs/stm32f429i-disco/extflash/defconfig +++ b/nuttx/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/nuttx/configs/stm32f429i-disco/nsh/defconfig b/nuttx/configs/stm32f429i-disco/nsh/defconfig index 78c8dca33..8b1f8cc87 100644 --- a/nuttx/configs/stm32f429i-disco/nsh/defconfig +++ b/nuttx/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 @@ -308,12 +308,6 @@ CONFIG_STM32_USART=y # 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/nuttx/configs/stm32f429i-disco/src/up_nsh.c b/nuttx/configs/stm32f429i-disco/src/up_nsh.c index bca81d939..fff6da883 100644 --- a/nuttx/configs/stm32f429i-disco/src/up_nsh.c +++ b/nuttx/configs/stm32f429i-disco/src/up_nsh.c @@ -59,6 +59,10 @@ # include <apps/usbmonitor.h> #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 <nuttx/configdata.h> @@ -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')) |