-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
samples: usb: mass: demonstrate mounting littlefs file systems on Linux/FreeBSD hosts #24696
samples: usb: mass: demonstrate mounting littlefs file systems on Linux/FreeBSD hosts #24696
Conversation
Flash drivers may impose alignment requirements on the destination buffers due to use of DMA transfers. In particular Nordic QSPI flash API requires that addresses, sizes, and buffers all by 4-byte aligned. Align the page buffer to satisfy this requirement. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Flash drivers may impose alignment requirements on the destination buffers due to use of DMA transfers. In particular Nordic QSPI flash API requires that addresses, sizes, and buffers all be 4-byte aligned. Align the ready/copy buffer to satisfy this requirement. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The API call to close the flash area was only invoked when the flash area was erased. It should be closed in all paths. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Drop the old redefine-everything-in-a-special-conf approach and put the customization appropriate for this board into the board directory where it's handled automatically. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
This allows mass storage exposure of a littlefs file system, specifically one on the SPI NOR flash of the nrf52840dk_nrf52840. In combination with littlefs-fuse this allows a host system to examine and change the local storage of a Zephyr application. Note that it is critical that all parameters of the file system match between what Zephyr is using and what littlefs-fuse is using. Inconsistencies can produce confusing results where each system sees different content. The README has been updated with a detailed example. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
96cba5b
to
e5e34d8
Compare
*/ | ||
static u8_t page[BLOCK_SIZE + CONFIG_MASS_STORAGE_BULK_EP_MPS]; | ||
static u8_t __aligned(4) page[BLOCK_SIZE + CONFIG_MASS_STORAGE_BULK_EP_MPS]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__aligned(sizeof(u32_t))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most existing _aligned
attributes in Zephyr use integer values directly rather than deriving them from sizeof(type)
.
@@ -19,7 +19,7 @@ | |||
static struct device *flash_dev; | |||
|
|||
/* flash read-copy-erase-write operation */ | |||
static u8_t read_copy_buf[CONFIG_DISK_ERASE_BLOCK_SIZE]; | |||
static u8_t __aligned(4) read_copy_buf[CONFIG_DISK_ERASE_BLOCK_SIZE]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__aligned(sizeof(u32_t))
?
The https://github.com/ARMmbed/littlefs-fuse project in combination with Zephyr's USB Mass Storage support allows mounting embedded file systems directly onto Linux and FreeBSD hosts for inspection and modification.