This patch adds working integration of progmem FLASH. User can partition internal FLASH memory to up to 4 partitions and use any combination of raw, nxffs, smartfs and mtd_config filesystems (unless there are other limitations like nxffs supports only single instance). Support for dual CPU is added to Kconfig to not overwrite CPU2 program code. Code guards user to not allocate more memory than there is on FLASH, and warns user if not all FLASH memory is used. Errors will be printed when user tries to initialize two instances of nxffs or mtd_config filesystems. Signed-off-by: Michał Łyszczek <michal.lyszczek@bofc.pl>
279 lines
7.6 KiB
Plaintext
279 lines
7.6 KiB
Plaintext
#
|
|
# For a description of the syntax of this configuration file,
|
|
# see the file kconfig-language.txt in the NuttX tools repository.
|
|
#
|
|
|
|
if ARCH_BOARD_NUCLEO_WL55JC
|
|
|
|
config ARCH_BOARD_NUCLEO_WL55JC_DEMO_LED_IRQ
|
|
bool "[demo] LED on button interrupt"
|
|
depends on ARCH_BUTTONS
|
|
depends on NSH_ARCHINIT
|
|
---help---
|
|
When enabled, pressing B3 button will toggle red LED.
|
|
This options is mostly for demo purposes of how one
|
|
can install GPIO interrupt.
|
|
|
|
comment "[demo] LED on button interrupt requires NSH_ARCHINIT"
|
|
depends on !NSH_ARCHINIT || !ARCH_BUTTONS
|
|
|
|
menuconfig ARCH_BOARD_FLASH_MOUNT
|
|
bool "Enable FLASH partitioning and mounting"
|
|
depends on !DISABLE_MOUNTPOINT
|
|
select MTD
|
|
select MTD_PROGMEM
|
|
select MTD_PARTITION
|
|
select MTD_PARTITION_NAMES
|
|
select FS_PROCFS
|
|
default n
|
|
---help---
|
|
When enabled, you will be able to configure partition table
|
|
for onboard FLASH memory to create and mount flash filesystems.
|
|
All partition sizes are specified in PAGE_SIZE size. On
|
|
STM32WL5 page size is always 2048.
|
|
|
|
On STM32WL55JC there are 128 pages of flash memory. Size of
|
|
all configured partitions shall not exceed 128. In fact, it
|
|
should be equal to 128 or else you will simply have unused
|
|
space on flash. Even if you want some raw flash access you
|
|
should specify this partition in table and select fs_raw.
|
|
|
|
By default there are only 4 partitions defined, if you need
|
|
more, you can define more in Kconfig and stm32_flash.c files.
|
|
|
|
comment "FLASH partitioning and mounting requires !DISABLE_MOUNTPOINT"
|
|
depends on DISABLE_MOUNTPOINT
|
|
|
|
if ARCH_BOARD_FLASH_MOUNT
|
|
|
|
config ARCH_BOARD_FLASH_CPU1_PROG_SIZE
|
|
int "Size reserved for CPU1 program code"
|
|
default 127
|
|
---help---
|
|
How much memory to reserve for CPU1 program code. This should
|
|
specified as other partitions will be created at offset to
|
|
this partition.
|
|
|
|
config ARCH_BOARD_FLASH_CPU2_PROG_SIZE
|
|
int "Size reserved for CPU2 program code"
|
|
default 0
|
|
---help---
|
|
How much memory to reserve for CPU2 program code. If you use
|
|
dual CPU you should specify how much memory you want to
|
|
reserve for code for second CPU. User partition will be
|
|
created at this offset. If you don't use CPU2, set this to 0.
|
|
|
|
config ARCH_BOARD_FLASH_PART1_SIZE
|
|
int "Size of user partition 1"
|
|
default 1
|
|
---help---
|
|
Size of partition specified in PAGE_SIZE. Page size on
|
|
stm32wl5xxx is always 2048.
|
|
|
|
config ARCH_BOARD_FLASH_PART1_NAME
|
|
string "Name of user partition 1"
|
|
default "part1"
|
|
---help---
|
|
MTD partition name, this can be later read by MTD API,
|
|
or it can also be read from /proc/partitions to easily
|
|
identify partitions.
|
|
|
|
config ARCH_BOARD_FLASH_PART1_MNT
|
|
string "Mount point for user partition 1"
|
|
default "/mnt/part1"
|
|
---help---
|
|
Directory where filesystem should be mounted.
|
|
|
|
Note: not all filesystems can be mounted. rawfs and
|
|
mtdconfig for example cannot be mounted. In that case
|
|
this config will be ignored.
|
|
|
|
config ARCH_BOARD_FLASH_PART1_FS
|
|
string
|
|
default "rawfs" if ARCH_BOARD_FLASH_PART1_FS_RAWFS
|
|
default "nxffs" if ARCH_BOARD_FLASH_PART1_FS_NXFFS
|
|
default "smartfs" if ARCH_BOARD_FLASH_PART1_FS_SMARTFS
|
|
default "mtdconfig" if ARCH_BOARD_FLASH_PART1_FS_MTDCONFIG
|
|
|
|
choice
|
|
prompt "Filesystem of user partition 1"
|
|
default ARCH_BOARD_FLASH_PART1_FS_RAW
|
|
|
|
config ARCH_BOARD_FLASH_PART1_FS_RAWFS
|
|
bool "rawfs"
|
|
---help---
|
|
Raw block device /dev/mtdblockN will be available to use
|
|
with standard open(2)/fopen(3) functions.
|
|
|
|
config ARCH_BOARD_FLASH_PART1_FS_NXFFS
|
|
select FS_NXFFS
|
|
bool "nxffs"
|
|
---help---
|
|
Partition will be used as nxffs. Only one nxffs partition
|
|
can be enabled at one given time!
|
|
|
|
config ARCH_BOARD_FLASH_PART1_FS_SMARTFS
|
|
select FS_SMARTFS
|
|
select MTD_SMART
|
|
bool "smartfs"
|
|
---help---
|
|
Partition will be used as smartfs. After first flash, you
|
|
will have to format partition with "mksmartfs /dev/smartN"
|
|
command. This has to be done only once unless you change
|
|
partition table that would affect offsets and/or sizes.
|
|
Programmers (like openocd) should not touch this memory
|
|
when flashing new software, unless you exceeded reserved
|
|
memory for program code.
|
|
|
|
Smartfs uses quite substential ammount of FLASH data to
|
|
get to workable state and mount. Looks like 8 page sizes
|
|
is absolute minimum (so a 16KiB!).
|
|
|
|
config ARCH_BOARD_FLASH_PART1_FS_MTDCONFIG
|
|
select MTD_CONFIG
|
|
bool "mtdconfig"
|
|
---help---
|
|
Purpose build filesystem to hold application's configuration.
|
|
It's not a filesystem per se, as it cannot be mounted and
|
|
setting and retrieving configuration is done via ioctl(2)
|
|
calls.
|
|
|
|
endchoice # Filesystem of user partition 1
|
|
|
|
config ARCH_BOARD_FLASH_PART2_SIZE
|
|
int "Size of user partition 2"
|
|
default 0
|
|
|
|
if ARCH_BOARD_FLASH_PART2_SIZE > 0
|
|
|
|
config ARCH_BOARD_FLASH_PART2_NAME
|
|
string "Name of user partition 2"
|
|
default "part2"
|
|
|
|
config ARCH_BOARD_FLASH_PART2_MNT
|
|
string "Mount point for user partition 2"
|
|
default "/mnt/part2"
|
|
|
|
config ARCH_BOARD_FLASH_PART2_FS
|
|
string
|
|
default "rawfs" if ARCH_BOARD_FLASH_PART2_FS_RAWFS
|
|
default "nxffs" if ARCH_BOARD_FLASH_PART2_FS_NXFFS
|
|
default "smartfs" if ARCH_BOARD_FLASH_PART2_FS_SMARTFS
|
|
default "mtdconfig" if ARCH_BOARD_FLASH_PART2_FS_MTDCONFIG
|
|
|
|
choice
|
|
prompt "Filesystem of user partition 2"
|
|
default ARCH_BOARD_FLASH_PART2_FS_RAW
|
|
|
|
config ARCH_BOARD_FLASH_PART2_FS_RAWFS
|
|
bool "rawfs"
|
|
|
|
config ARCH_BOARD_FLASH_PART2_FS_NXFFS
|
|
select FS_NXFFS
|
|
bool "nxffs"
|
|
|
|
config ARCH_BOARD_FLASH_PART2_FS_SMARTFS
|
|
select FS_SMARTFS
|
|
select MTD_SMART
|
|
bool "smartfs"
|
|
|
|
config ARCH_BOARD_FLASH_PART2_FS_MTDCONFIG
|
|
select MTD_CONFIG
|
|
bool "mtdconfig"
|
|
|
|
endchoice # Filesystem of user partition 2
|
|
|
|
config ARCH_BOARD_FLASH_PART3_SIZE
|
|
int "Size of user partition 3"
|
|
default 0
|
|
|
|
if ARCH_BOARD_FLASH_PART3_SIZE > 0
|
|
|
|
config ARCH_BOARD_FLASH_PART3_NAME
|
|
string "Name of user partition 3"
|
|
default "part3"
|
|
|
|
config ARCH_BOARD_FLASH_PART3_MNT
|
|
string "Mount point for user partition 3"
|
|
default "/mnt/part3"
|
|
|
|
config ARCH_BOARD_FLASH_PART3_FS
|
|
string
|
|
default "rawfs" if ARCH_BOARD_FLASH_PART3_FS_RAWFS
|
|
default "nxffs" if ARCH_BOARD_FLASH_PART3_FS_NXFFS
|
|
default "smartfs" if ARCH_BOARD_FLASH_PART3_FS_SMARTFS
|
|
default "mtdconfig" if ARCH_BOARD_FLASH_PART3_FS_MTDCONFIG
|
|
|
|
choice
|
|
prompt "Filesystem of user partition 3"
|
|
default ARCH_BOARD_FLASH_PART3_FS_RAW
|
|
|
|
config ARCH_BOARD_FLASH_PART3_FS_RAWFS
|
|
bool "rawfs"
|
|
|
|
config ARCH_BOARD_FLASH_PART3_FS_NXFFS
|
|
select FS_NXFFS
|
|
bool "nxffs"
|
|
|
|
config ARCH_BOARD_FLASH_PART3_FS_SMARTFS
|
|
select FS_SMARTFS
|
|
select MTD_SMART
|
|
bool "smartfs"
|
|
|
|
config ARCH_BOARD_FLASH_PART3_FS_MTDCONFIG
|
|
select MTD_CONFIG
|
|
bool "mtdconfig"
|
|
|
|
endchoice # Filesystem of user partition 3
|
|
|
|
config ARCH_BOARD_FLASH_PART4_SIZE
|
|
int "Size of user partition 4"
|
|
default 0
|
|
|
|
if ARCH_BOARD_FLASH_PART4_SIZE > 0
|
|
|
|
config ARCH_BOARD_FLASH_PART4_NAME
|
|
string "Name of user partition 4"
|
|
default "part4"
|
|
|
|
config ARCH_BOARD_FLASH_PART4_MNT
|
|
string "Mount point for user partition 4"
|
|
default "/mnt/part4"
|
|
|
|
config ARCH_BOARD_FLASH_PART4_FS
|
|
string
|
|
default "rawfs" if ARCH_BOARD_FLASH_PART4_FS_RAWFS
|
|
default "nxffs" if ARCH_BOARD_FLASH_PART4_FS_NXFFS
|
|
default "smartfs" if ARCH_BOARD_FLASH_PART4_FS_SMARTFS
|
|
default "mtdconfig" if ARCH_BOARD_FLASH_PART4_FS_MTDCONFIG
|
|
|
|
choice
|
|
prompt "Filesystem of user partition 4"
|
|
default ARCH_BOARD_FLASH_PART4_FS_RAW
|
|
|
|
config ARCH_BOARD_FLASH_PART4_FS_RAWFS
|
|
bool "rawfs"
|
|
|
|
config ARCH_BOARD_FLASH_PART4_FS_NXFFS
|
|
select FS_NXFFS
|
|
bool "nxffs"
|
|
|
|
config ARCH_BOARD_FLASH_PART4_FS_SMARTFS
|
|
select FS_SMARTFS
|
|
select MTD_SMART
|
|
bool "smartfs"
|
|
|
|
config ARCH_BOARD_FLASH_PART4_FS_MTDCONFIG
|
|
select MTD_CONFIG
|
|
bool "mtdconfig"
|
|
|
|
endchoice # Filesystem of user partition 4
|
|
|
|
endif # ARCH_BOARD_FLASH_PART2_SIZE > 0
|
|
endif # ARCH_BOARD_FLASH_PART3_SIZE > 0
|
|
endif # ARCH_BOARD_FLASH_PART4_SIZE > 0
|
|
|
|
endif # ARCH_BOARD_FLASH_MOUNT
|
|
|
|
endif # ARCH_BOARD_NUCLEO_WL55JC
|