Exploring the Mass Storage Example on nRF52840dk with QSPI Flash

Exploring the Mass Storage Example on nRF52840dk with QSPI Flash

Hi everyone,

I’ve been diving into the world of embedded systems and recently decided to explore the Mass Storage example using the nRF Connect SDK. My goal is to get this running on the nRF52840dk development kit, specifically utilizing the QSPI NOR flash. I’ve been using the nRF5 SDK for years, but the transition to nRF Connect SDK has been an exciting learning journey.

My Setup and Challenges

I’ve copied the Mass storage example into my project directory and started working on configuring it for the nRF52840dk board. I followed the build process, enabling debugging to understand what’s happening under the hood. Here’s what I ran in the terminal:

bash
west build -b nrf52840dk/nrf52840 – -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y

The build process went smoothly, and I was able to flash the application onto my board. However, when I plugged it into my Windows machine, I encountered an issue where the device wasn’t recognized properly. Windows prompted me to format the device, but when I tried, it failed, citing unknown size and sector size.

Debugging the Issue

Looking at the build output and RTT logs, everything seemed to initialize correctly. The device detected the NAND flash, but I’m unsure if it’s properly configured for the QSPI NOR flash I’m using. I noticed that the example provided in the SDK uses a different board, so I’m wondering if there are specific configurations needed for the nRF52840dk.

Questions and Insights

  1. Configuration for QSPI NOR Flash: Has anyone successfully used this example with a 2Gbit NOR flash? Are there specific settings or workarounds needed for larger flash sizes?
  2. FATFS Initialization: The failure during formatting suggests an issue with how the FATFS is initialized. Could this be related to incorrect partitioning or flash geometry settings?
  3. Board-Specific Adjustments: Are there any board-specific configurations or drivers I need to include for the nRF52840dk’s QSPI flash?

Looking for Guidance

I’d greatly appreciate any insights or tips from the community. Have others encountered similar issues when transitioning from smaller flash sizes or when using the QSPI interface? Any recommendations on debugging tools or configurations would be incredibly helpful.

Let me know if you’ve faced similar challenges or have any suggestions. I’m eager to get this working and would love to share my findings once I resolve the issue.

Cheers,
Ian