This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

USB Mass storage class module

Hello guys,

In our current project, we need to have the ability to copy .bmp images from our PC directly to W25N01GVZEIG TR QSPI flash memory of NAND type. To the best of my knowledge, the best starting point for us would be to use  usbd_msc (USB Mass Storage Class module) example from $SDK_ROOT/examples/peripheral/usbd_msc. Our NAND flash is 128MB in size. Am I right or there is some better point to start with?

Also, I noticed some people here on the forum reporting difficulties when using the USB Mass Storage Class module with QSPI flash memories of NAND type (e.g. here). Is that issue resolved now with SDK 15.3.0?

Finally, is errata 187 resolved with SDK 15.3.0 (I could not find nrf_drv_usbd_errata.h file)?

Thank you very much for your time and effort. It is really appreciated.

Cheers,

Bojan.

Parents
  • Hello, 

    Am I right or there is some better point to start with?

     Yes, the USB MSC example is a good starting point, but I would also recommend the QSPI example to ensure the communication with your flash device.

    Is that issue resolved now with SDK 15.3.0?

    From the datasheet of the device, I could not see any issues, as it supports QSPI. You can try the QSPI example to ensure functionality.

    Finally, is errata 187 resolved with SDK 15.3.0 (I could not find nrf_drv_usbd_errata.h file)?

    The workaround is implemented in the SDK I believe.

    Kind regards,
    Øyvind

  • Hello Øyvind,

    Thanks for replying. We tested the QSPI example as well. It is functional.

    However, nRF52840-DK board contains MX25R6435F flash memory of NOR type and 8MB in size. On our custom board, we would like to use high-capacity (128MB) W25N01GVxxIG/IT flash of NAND type. While reading through the forum I realized some people are complaining about using USB Mass Storage Class with QSPI flash memories of NAND type (e.g. here). That is why I wanted to double-check and see if there is any still existing issue for using QSPI flash memories of NAND type with USB Mass Storage Class.

    Sincerely,

    Bojan.

  • Hello Bojan, 

    I have talked to our systems team and can confirm that we do not have native support for NAND. However, the flash you are referring to may be compatible.


    Figure 25a from page 45 in the device datasheet, should match figure 16 in the QSPI chapter in regards to timing. The Fast Read Quad Output with 4-byte address indicates that it should be able to communicate with the nRF52420: "This allows using a single Read instruction to read out the entire memory array and is also compatible to Winbond’s SpiFlash NOR flash memory command sequence", but for READ4O the number of address bits and dummy cycles is different. 

    From what I am told, there are a lot of configuration options in the QSPI, and there is a possible workaround but will require some low-level programming to work.

    If you do have the flash device I would recommend to test with the QSPI example to verify that it does in fact work.

    Kind regards,
    Øyvind

  • Hello Øyvind,

    Thank you very much for your effort!

    I have here with me one custom board containing some BLE module based on nRF52840 (link) and W25N01GVZEIG TR flash. Will try to implement usbd_msc example and see what is going on.

    Will report you about the results. Thanks once again!

    Sincerely,

    Bojan.

  • Yes, please update me when you have tried!

    Kind regards,
    Øyvind

Reply Children
  • Hello Øyvind,

    Just tried the usbd_msc example on my custom board containing NAND flash. Unfortunately, only logical unit implemented in RAM properly mounted. External QSPI NAND flash failed to mount:

    [00:00:00.000,000] <info> app: Initializing disk 0 (QSPI)...
    [00:00:00.000,000] <error> app: Disk initialization failed.

    I imagine there are little subtle differences in interfacing NOR and NAND flash memories that are the reason for this failure.

    So, before diving deeper into the code, I would like to ask you to recommend me some QSPI flash memory that is of NOR type and at least 1Gb (128MB) in size. The most important, the one that you think will work with your  usbd_msc example. What is the key parameter of the NOR flash memory I need to pay attention to?

    Once again, thanks for the great support!

    Sincerely,

    Bojan.

  • Are some of the following 1Gb NOR flash memories coming from Macronix compatible with the NOR flash we have on nRF52840-DK board:

    Sincerely,

    Bojan.

  • Hello,

    I have discussed the issue with the systems team again and the first link you have, is a suggestion from them as well:
    MX66U1G45G (1.8V)
    MX66L1G45G (3.0V)
    They say that the two others should work as well.

    Since the Flash is >128Mb the interface needs to use 32-bit addressing mode. That is set in IFCONFIG0 in the QSPI peripheral

    Hope this helps!

    Kind regards,
    Øyvind

  • Thanks, Øyvind.

    We will now continue developing with nRF52840-DK board. Once we design our custom hardware with MX66L1G45G NOR flash and we test it, I will come back here to report you about the success.

    Sincerely,

    Bojan.

  • Hello ,

    Here I am after a few months with the custom board containing MX66L1G45G (3.0V) memory module. I changed addressing mode to 32-bit in usbd_msc example, like you suggested. I did that change within sdk_config.h file:

    // <o> QSPI_CONFIG_ADDRMODE  - Addressing mode.
     
    // <0=> 24bit 
    // <1=> 32bit 
    
    #ifndef QSPI_CONFIG_ADDRMODE
    #define QSPI_CONFIG_ADDRMODE 1
    #endif
    
    // <o> NRFX_QSPI_CONFIG_ADDRMODE  - Addressing mode.
     
    // <0=> 24bit 
    // <1=> 32bit 
    
    #ifndef NRFX_QSPI_CONFIG_ADDRMODE
    #define NRFX_QSPI_CONFIG_ADDRMODE 1
    #endif

    However, I am still getting the error - Disk initialization failed.

    First question, do I properly change the addressing mode? After that, is there anything else I need to change in order to make usbd_msc example working with our new flash memory?

    I tested QSPI example with our custom board and it was OK. QSPI interface between nRF52840 and flash memory seems to be OK. Here is what I get with 24-bit addressing mode:

    <info> app: QSPI write and read example using 24bit addressing mode
    <info> app: QSPI example started.
    <info> app: Process of erasing first block start
    <info> app: Process of writing data start
    <info> app: Data read
    <info> app: Compare...
    <info> app: Data consistent
    <info> app: Flash ID: 0xC2201B

    When I changed the addressing mode to 32-bit the way I described before, QSPI example was not functional (inconsistent data):

    <info> app: QSPI example started.
    <info> app: Process of erasing first block start
    <info> app: Process of writing data start
    <info> app: Data read
    <info> app: Compare...
    <info> app: Data inconsistent
    <info> app: Flash ID: 0xC2201B

    Thank you very much for your time and effort.

    Sincerely,

    Bojan.

Related