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.

  • 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