From cb448335993c7a24a1aa813e64a6f0d229735d33 Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Sun, 6 Aug 2017 12:14:29 -0600 Subject: [PATCH] STM32F103-Minimum: (1) Enable CONFIG_MTD_PARTITION in Kconfig if flash partition is enabled and (2) Update the README.txt file with info needed to get SmartFS working. --- configs/stm32f103-minimum/Kconfig | 1 + configs/stm32f103-minimum/README.txt | 45 +++++++++++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/configs/stm32f103-minimum/Kconfig b/configs/stm32f103-minimum/Kconfig index 15f1bc0f1c..142bf16bf2 100644 --- a/configs/stm32f103-minimum/Kconfig +++ b/configs/stm32f103-minimum/Kconfig @@ -28,6 +28,7 @@ config STM32F103MINIMUM_FLASH_PART bool "Enable partition support on FLASH" default y depends on STM32F103MINIMUM_FLASH + select MTD_PARTITION ---help--- Enables creation of partitions on the FLASH diff --git a/configs/stm32f103-minimum/README.txt b/configs/stm32f103-minimum/README.txt index d85ac86df2..111598ed7f 100644 --- a/configs/stm32f103-minimum/README.txt +++ b/configs/stm32f103-minimum/README.txt @@ -291,7 +291,7 @@ SPI NOR Flash support: PA4 to /CS; Also connect 3.3V to VCC and GND to GND. You can start with default "stm32f103-minimum/nsh" configuration option and - enable these options using "make menuconfig" : + enable/disable these options using "make menuconfig" : System Type ---> STM32 Peripheral Support ---> @@ -303,6 +303,13 @@ SPI NOR Flash support: [*] Enable partition support on FLASH (1024,1024,1024,1024) Flash partition size list + RTOS Features ---> + Stack and heap information ---> + (512) Idle thread stack size + (1024) Main thread stack size + (256) Minimum pthread stack size + (1024) Default pthread stack size + Device Drivers ---> -*- Memory Technology Device (MTD) Support ---> [*] Support MTD partitions @@ -311,10 +318,46 @@ SPI NOR Flash support: (20000000) W25 SPI Frequency File Systems ---> + [ ] Disable pseudo-filesystem operations -*- SMART file system (0xff) FLASH erased state (16) Maximum file name length + Memory Management ---> + [*] Small memory model + + Also change the configs/stm32f103-minimum/scripts/ld.script file to use 128KB + of Flash instead 64KB (since this board has a hidden 64KB flash) : + + MEMORY + { + flash (rx) : ORIGIN = 0x08000000, LENGTH = 128K + sram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K + } + + Then after compiling and flashing the file nuttx.bin you can format and mount + the flash this way: + + nsh> mksmartfs /dev/smart0p0 + nsh> mksmartfs /dev/smart0p1 + nsh> mksmartfs /dev/smart0p2 + nsh> mksmartfs /dev/smart0p3 + + nsh> mount -t smartfs /dev/smart0p0 /mnt + nsh> ls /mnt + /mnt: + + nsh> echo "Testing" > /mnt/file.txt + + nsh> ls /mnt + /mnt: + file.txt + + nsh> cat /mnt/file.txt + Testing + + nsh> + SDCard support: ===============