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

How to use nRF52840DK with on board memory?

In the User Guide for the nRF52840DK on pg 26 is:

8.5 External memory
The nRF52840 DK has a 64 Mb external flash memory. The memory is a multi-I/O memory supporting both
regular SPI and Quad SPI.
The memory is connected to the chip using the following GPIOs:

and then a table for which pins are being used. This is the only documentation I have been able to find on using the 64 Mb external flash. It is not enough for me to get started; is there more documentation elsewhere?

Also, in browsing on using the nRF52840 with an SD card, everything is pointing to a single FatFs example (I have used FatFs previously with the STML4 series and got it to work; it was a real bear). In the example, near the beginning is:

To run the example, connect the SD card to the nRF5 DK in the following way:

and a table follows that lists the pins to be used. This is pretty minimalist. Are we expected to know ahead of time how to do this? I'm assuming we need a new break out board for the SD card? Is there any recommended? Do we need special wiring or cabling? It seems previously there was an SD card on board; are we now on our own regarding this?

There are some other examples of writing to Flash which I assume are intended for the flash in the nRF52840DK? Can these be modified to used the external 64 Mb flash?

Parents
  • Hi Kenneth

    Probably the best example showing how to use external flash is the usbd_msc example:
    \examples\peripheral\usbd_msc\

    In order to enable the SD card rather than the on board QSPI flash you have to set the USE_SD_CARD define on line 106 of main.c to 1. 

    When USE_SD_CARD is 1 the SPI pin assignment will be set by the SDC_xxx_PIN defines on lines 167-170 in main.c.

    Also, in browsing on using the nRF52840 with an SD card, everything is pointing to a single FatFs example

    Can you let me know which example this is? 

    You should be able to use any simple SD card breakout board, such as this one

    I did some testing earlier with a similar board, but I am currently working from home and don't have access to it, so I can't say exactly which type this was. That said since you can connect the SD card pretty much directly to the chip (as long as the GPIO voltage is close to 3.3V) the type of adapter is not critical.

    The FDS or fstorage examples are intended for accessing the internal flash only, that is correct. These libraries are not designed to support external memory. 

    You might be right that the very first preview DK's for the nRF52840 included a micro SD card slot. Why this was removed I am not sure, but it could be a cost optimization issue, since only a minority of nRF52840 designs require external flash memory. 

    Best regards
    Torbjørn

Reply
  • Hi Kenneth

    Probably the best example showing how to use external flash is the usbd_msc example:
    \examples\peripheral\usbd_msc\

    In order to enable the SD card rather than the on board QSPI flash you have to set the USE_SD_CARD define on line 106 of main.c to 1. 

    When USE_SD_CARD is 1 the SPI pin assignment will be set by the SDC_xxx_PIN defines on lines 167-170 in main.c.

    Also, in browsing on using the nRF52840 with an SD card, everything is pointing to a single FatFs example

    Can you let me know which example this is? 

    You should be able to use any simple SD card breakout board, such as this one

    I did some testing earlier with a similar board, but I am currently working from home and don't have access to it, so I can't say exactly which type this was. That said since you can connect the SD card pretty much directly to the chip (as long as the GPIO voltage is close to 3.3V) the type of adapter is not critical.

    The FDS or fstorage examples are intended for accessing the internal flash only, that is correct. These libraries are not designed to support external memory. 

    You might be right that the very first preview DK's for the nRF52840 included a micro SD card slot. Why this was removed I am not sure, but it could be a cost optimization issue, since only a minority of nRF52840 designs require external flash memory. 

    Best regards
    Torbjørn

Children
No Data
Related