Skip to content

Commit c8cca16

Browse files
gmarullcarlescufi
authored andcommitted
samples: subsys: usb: mass: add support for Adafruit feather nRF52840
Add configuration and overlay files for Adafruit feather nRF52840. README has also been updated and improved. Documentation related to littlefs has been moved to an independent section as it could apply to any sample. Signed-off-by: Gerard Marull-Paretas <[email protected]>
1 parent ec1a837 commit c8cca16

File tree

3 files changed

+85
-4
lines changed

3 files changed

+85
-4
lines changed

samples/subsys/usb/mass/README.rst

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ nrf52840dk_nrf52840 Example
7979

8080
This board configures to use the external 64 MiBi QSPI flash chip with a
8181
64 KiBy `littlefs`_ partition compatible with the one produced by the
82-
:ref:`littlefs-sample`. While a FAT-based file system can be mounted by
83-
many systems automatically, mounting the littlefs file system on a Linux
84-
or FreeBSD system can be accomplished using the `littlefs-FUSE`_ utility.
82+
:ref:`littlefs-sample`.
8583

8684
.. zephyr-app-commands::
8785
:zephyr-app: samples/subsys/usb/mass
@@ -113,7 +111,47 @@ different):
113111
F 5 newfile
114112
End of files
115113
116-
Determine the local device name from the system log, e.g.:
114+
For information on mounting littlefs file system on Linux or FreeBSD
115+
systems refer to the "littlefs Usage" section below.
116+
117+
adafruit_feather_nrf52840 Example
118+
=================================
119+
120+
This board configures to use the external 16 MiBi QSPI flash chip with a
121+
2 MiBy FAT partition.
122+
123+
.. zephyr-app-commands::
124+
:zephyr-app: samples/subsys/usb/mass
125+
:board: adafruit_feather_nrf52840
126+
:goals: build
127+
:compact:
128+
129+
After you have built and flashed the sample app image to your board,
130+
connect the board's USB connector to a host capable of mounting FAT
131+
drives. The output to the console will look something like this
132+
(file system contents will be different):
133+
134+
.. code-block:: none
135+
136+
*** Booting Zephyr OS build zephyr-v2.3.0-1991-g4c8d1496eafb ***
137+
Area 4 at 0x0 on GD25Q16 for 2097152 bytes
138+
Mount /NAND:: 0
139+
/NAND:: bsize = 512 ; frsize = 1024 ; blocks = 2028 ; bfree = 1901
140+
/NAND: opendir: 0
141+
F 0 SAMPLE.TXT
142+
End of files
143+
[00:00:00.077,423] <inf> main: The device is put in USB mass storage mode.
144+
145+
On most operating systems the drive will be automatically mounted.
146+
147+
littlefs Usage
148+
==============
149+
150+
While a FAT-based file system can be mounted by many systems automatically,
151+
mounting the littlefs file system on a Linux or FreeBSD system can be
152+
accomplished using the `littlefs-FUSE`_ utility.
153+
154+
First determine the local device name from the system log, e.g.:
117155

118156
.. code-block:: none
119157
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# qspi NOR driver
2+
CONFIG_NORDIC_QSPI_NOR=y
3+
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
4+
5+
# flash
6+
CONFIG_FLASH_MAP=y
7+
CONFIG_FLASH_PAGE_LAYOUT=y
8+
9+
# mass storage
10+
CONFIG_MASS_STORAGE_DISK_NAME="NAND"
11+
12+
# disk
13+
CONFIG_DISK_ACCESS_FLASH=y
14+
CONFIG_DISK_FLASH_DEV_NAME="GD25Q16"
15+
CONFIG_DISK_FLASH_START=0x0
16+
CONFIG_DISK_VOLUME_SIZE=0x200000
17+
CONFIG_DISK_FLASH_MAX_RW_SIZE=4096
18+
CONFIG_DISK_FLASH_ERASE_ALIGNMENT=0x1000
19+
CONFIG_DISK_ERASE_BLOCK_SIZE=0x1000
20+
21+
# file system
22+
CONFIG_FILE_SYSTEM=y
23+
CONFIG_FAT_FILESYSTEM_ELM=y
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
* Copyright (c) 2020 Teslabs Engineering S.L.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/delete-node/ &storage_partition;
8+
9+
&gd25q16 {
10+
partitions {
11+
compatible = "fixed-partitions";
12+
#address-cells = <1>;
13+
#size-cells = <1>;
14+
15+
partition@0 {
16+
label = "storage";
17+
reg = <0x00000000 0x00200000>;
18+
};
19+
};
20+
};

0 commit comments

Comments
 (0)