USB Mass Storage Sample using nRF7002-dk

Hello

I would like use the USB Mass Storage Sample from Zephyr on the nRF7002-dk.
Looking at the supported boards for this sample, I can see that the nRF7002-dk is not in the list. The only difference is that on these boards the flash is connected using QSPI. On the nRF7002-dk the flash is connected using SPI. On the nef5340_cpuapp_common.dts I can see that the flash (mx25r64) is defined on the &spi4 which looks right.

I tried to use this example using the following configuration:

  • prj.conf (enable FAT FS Example)

CONFIG_STDOUT_CONSOLE=y

#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
CONFIG_USB_DEVICE_PID=0x0008
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_MASS_STORAGE=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n

CONFIG_MAIN_STACK_SIZE=1536
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_APP_MSC_STORAGE_FLASH_FATFS=y

  • Overlay File

/delete-node/ &storage_partition;

&mx25r64 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		storage_partition: partition@0 {
			label = "storage";
			reg = <0x00000000 0x00020000>;
		};
	};
};

/ {
	msc_disk0 {
		compatible = "zephyr,flash-disk";
		partition = <&storage_partition>;
		disk-name = "NAND";
		cache-size = <4096>;
	};
};

  • The chosen board for the build configuration: nrf7002dk_nrf5340
  • The main file has been the same as in the sample

As a result, when I plug the USB to my computer, the device is recognized as a disk, but I can not access the disk.
Also following is the LOG:

Is there a way to implement the same functionality on the nrf7002-dk as in this example?

As I understand the only difference is the SPI connection to flash, instead of the QSPI. So the flash could work when on the dts file the flash looks at the spi4.

Why this sample does not have support for this board?

Related