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

USB Mass Storage Class on external QSPI flash

Hello guys,

We are using SES and SDK15.3.0. Our SoC is from nRF52840 family. We have a custom board with external QSPI flash memory that we want to use as USB MSC device. After some consultations with Nordic technical support (see this thread), we selected  MX66L1G45G (3.0V) memory module for our external memory.

usbd_msc example from SDK 15.3.0 did not work on our custom board - disk initialization failed issue:

Changing the addressing mode to 32-bit (because we are using memory that is >128Mb) did not help. We changed the addressing mode inside sdk_config.h file as follows:

// <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

QSPI link between our nRF52840 and external memory is OK because QSPI example is working properly.

Do you have any suggestions on what should we change in order to have usbd_msc example working on our custom board?

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

Sincerely,

Bojan.

Parents
  • Hello Bojan, 

    QSPI link between our nRF52840 and external memory is OK because QSPI example is working properly.

     I'm glad to hear that the QSPI example is working properly. 

    Do you have any suggestions on what should we change in order to have usbd_msc example working on our custom board?

    Are the settings the same as with QSPI example? Are you using FAT FS? Can you please provide your project for testing? Difficult for me to say at this moment.

    Thanks!

    Kind regards,
    Øyvind 

  • Hello ,

    Thanks for your reply!

    My starting point is usbd_msc example. Inside sdk_config.h file I just defined and set QSPI_CONFIG_ADDRMODE and NRFX_QSPI_CONFIG_ADDRMODE to have 32-bit addressing mode and that's all. The rest of the code is actually the code from usbd_msc example.

    Yes, FAT FS is used. The issue appears when disk_initialize(0); function is called within fatfs_init(). This is when I get the error "Disk initialization failed".

    Am I missing something?

    Sincerely,

    Bojan.

  • Hey, .

    I changed sdk_config.h file according to your suggestions. I can see the same logs I was able to see before:

    <info> app: Initializing disk 0 (QSPI)...
    <info> app: m_drives[drv].config.wait_func = NULL
    <error> app: QSPI FLASH not supported
    <error> app: Error: nrf_blk_dev_init() function!
    <error> app: err_code: 0x6
    <info> app: Return state 
    <error> app: Disk initialization failed.

    fatfs_init()>>disk_initialize(0) function fails. I am aware there is FatFS implementation in the base of usbd_msc example. By pressing a button 3 in usbd_msc example, fatfs_mkfs() function is called. However, this happens inside while(true) loop, and AFTER fatfs_init()>>disk_initialize(0) function calls.

    When I run the same code for my custom board on nRF52840 DK board without pressing ANY button, fatfs_init()>>disk_initialize(0) function passes without any problem!

    Sincerely,

    Bojan.



  • I have to apologize for my last reply, as I realize now that I must have been drunk or something. I see that I already asked you to edit sdk_config in this answer (Nov. 11).

     

    bojan said:
    When I run the same code for my custom board on nRF52840 DK board without pressing ANY button, fatfs_init()>>disk_initialize(0) function passes without any problem!

     This is very interesting. What is different? I assume that it uses the default QSPI device on the DK?

    The specialists on QSPI have not returned from their holidays yet, and I expect them to be back on Monday. I will get back to you then.

    Sorry for the inconvenience!

    BR,
    Øyvind

  • Hey, !

    This is very interesting. What is different? I assume that it uses the default QSPI device on the DK?

    Yes, I am using the same default QSPI interface to communicate with the flash memory on my custom board. The only thing that is different is the flash memory!

    No worries, as soon as you have some feedback from your QSPI guys, please share it with me.

    Happy New 2020! Santa

    Best wishes and a lot of successful projects!

    Bojan.

  • Hello

    My sincerest apologies for the late reply. I have not got any response from our team. Still pushing for an answer!

    Kind regards,
    Øyvind

  • Oyvind

    Is there any more news on this solution it's been 1 year and we can't figure out if this is viable or what is the issue?

    Thank you

Reply Children
Related