NRF52833DK_NRF52833 USB Mass Storage Issue

Hi everyone,

I am trying to run the Zephyr Samples USB Mass Storage example on a NRF52833DK using the internal flash for the FAT-FS partition.

When I plug the Nordic device into a windows machine, the USB device is recognized as a USB storage device however the system cannot access the flash device.

  

My development environment:
- nRF52833 DK
- Zephyr ncs v2.2.0
- nRF Connect for VS Code 

My Proj Conf is as follows:

CONFIG_STDOUT_CONSOLE=y

#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
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_MAIN_STACK_SIZE=16384
CONFIG_APP_WIPE_STORAGE=y

CONFIG_APP_MSC_STORAGE_FLASH_FATFS=y

I have also zipped up the project and attached this to this post.

mass-nrf52833.zip

Has anyone come across this issue and know what is going wrong?

Thanks,

David

Parents Reply Children
  • Hi Ovrebekk,

    Thank you for replying to my post. I did see your post from last year and the code example in 275880_mass.zip.

    It seems that the following Kconfig additions have been deprecated with ncs v2.2.0 (replacement of node labels).

    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 0x3A000
    
    config DISK_FLASH_MAX_RW_SIZE
    	default 4096
    
    config DISK_FLASH_ERASE_ALIGNMENT
    	default 0x1000
    
    config DISK_ERASE_BLOCK_SIZE
    	default 0x1000

    It seems the latest way to configure the usb msc disk is to add the following into the overlay:

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

    However I can't find any documentation on the options to configure the mdc_disk with the same parameters as used in 275880_mass example. And when adding the msc_ovelay - it still did not work.

    Do you know what needs to be added to update my example or the 275880_mass to compile with ncs v2.2.0? 

    Thanks,

    David

  • Hi David

    Basically these options have been moved from Kconfig to device tree, and things like the DISK_VOLUME_SIZE will now be read from the partition sizes directly. 

    I made some changes to the overlay and Kconfig files in order to make the sample run in v2.2.0. I tested it on the nRF52840DK and the nRF52833DK:

    275880_mass_v2.2.0.zip

    Best regards
    Torbjørn 

Related