samples: subsys: usb: mass: Use &flash0 storage_partition for USB mass storage #37818
-
Discussed in #37764Originally posted by joaodullius August 18, 2021 From the Kconfig, it appears that it only supports RAM, NAND and SD. Most boards (at least the nrfxxxxDKs) now have a storage_partition in the end of the &flash. I with to mount the USB there:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
No, RAM, NAND, SD are predefined strings to identify disk by ELMFAT module. samples/subsys/usb/mass supports only NOR flash connected over QSPI on few nRF boards, see The reason to not support internal flash in the sample is that storage partitions are usually to small and internal flash (page erase times) to slow, cumbersome configuration... (see also #33657). You can change the sample like: diff --git a/samples/subsys/usb/mass/Kconfig b/samples/subsys/usb/mass/Kconfig
index 5dceba3b34..c4780d865a 100644
--- a/samples/subsys/usb/mass/Kconfig
+++ b/samples/subsys/usb/mass/Kconfig
@@ -62,7 +62,7 @@ config FLASH_PAGE_LAYOUT
default y
config DISK_FLASH_START
- default 0x0
+ default 0x73000
config FLASH_LOG_LEVEL
default 3
@@ -77,12 +77,15 @@ if NORDIC_QSPI_NOR
config NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE
default 4096
+endif # NORDIC_QSPI_NOR
+
config DISK_FLASH_DEV_NAME
default "MX25R64" if "$(dt_nodelabel_enabled,mx25r64)"
default "GD25Q16" if "$(dt_nodelabel_enabled,gd25q16)"
+ default "NRF_FLASH_DRV_NAME"
config DISK_VOLUME_SIZE
- default 0x20000
+ default 0x67000
config DISK_FLASH_MAX_RW_SIZE
default 4096
@@ -93,7 +96,6 @@ config DISK_FLASH_ERASE_ALIGNMENT
config DISK_ERASE_BLOCK_SIZE
default 0x1000
-endif # NORDIC_QSPI_NOR
endif # DISK_DRIVER_FLASH Build the sample with |
Beta Was this translation helpful? Give feedback.
-
Now we have two of these: #37764 |
Beta Was this translation helpful? Give feedback.
No, RAM, NAND, SD are predefined strings to identify disk by ELMFAT module.
samples/subsys/usb/mass supports only NOR flash connected over QSPI on few nRF boards, see
https://github.com/zephyrproject-rtos/zephyr/blob/main/samples/subsys/usb/mass/boards/adafruit_feather_nrf52840.overlay for example.
The reason to not support internal flash in the sample is that storage partitions are usually to small and internal flash (page erase times) to slow, cumbersome configuration... (see also #33657).
You can change the sample like:
diff --git a/samples/subsys/usb/mass/Kconfig b/samples/subsys/usb/mass/Kconfig index 5dceba3b34..…