disk: disk_access_flash: Make sector size configurable in Kconfig

Make sector size used by flash disk configurable and expose new disk and
fatfs configurations to Kconfig.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
This commit is contained in:
Markus Fuchs 2020-10-15 11:36:23 +02:00 committed by Anas Nashif
commit ea6f7a4292
3 changed files with 12 additions and 1 deletions

View file

@ -79,6 +79,12 @@ config DISK_ERASE_BLOCK_SIZE
is erased at one time in flash storage. is erased at one time in flash storage.
Typically it is equal to the flash memory page size. Typically it is equal to the flash memory page size.
config DISK_FLASH_SECTOR_SIZE
int "Flash device sector size"
default 512
help
This is the file system sector size in bytes.
config DISK_VOLUME_SIZE config DISK_VOLUME_SIZE
hex "Flash device volume size in hex" hex "Flash device volume size in hex"
help help

View file

@ -14,7 +14,7 @@
#include <device.h> #include <device.h>
#include <drivers/flash.h> #include <drivers/flash.h>
#define SECTOR_SIZE 512 #define SECTOR_SIZE CONFIG_DISK_FLASH_SECTOR_SIZE
static const struct device *flash_dev; static const struct device *flash_dev;

View file

@ -126,6 +126,11 @@ config FS_FATFS_CODEPAGE
949 - Korean (DBCS) 949 - Korean (DBCS)
950 - Traditional Chinese (DBCS) 950 - Traditional Chinese (DBCS)
config FS_FATFS_MAX_SS
int "Maximum supported sector size"
range 512 4096
default 512
endmenu endmenu
endif # FAT_FILESYSTEM_ELM endif # FAT_FILESYSTEM_ELM