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

Flash filing system for nRF Connect SDK

Hi there,

Our team is developing an application based on the nRF5340-DK - we are developing on the DK while our hardware is in transit.  Our schematic largely follows the reference design for all necessary peripherals.  Notably, we've used the same QSPI NOR flash series as the MX25R6435F specified in the PCA10095 schematic (albeit larger).  Our intention is to use this external flash as a general filing system to store sensor data

I've scoured the nRF Connect SDK examples and there doesn't seem to be any reference as to how one uses the external flash as a general filing system. I'd very much appreciate it if someone could please provide some guidance as to the simplest way to achieve this.  Thanks!

BR,

Z

Parents Reply Children
  • Hi Simon,

    I had a cursory look, but nothing meaningful.  Figured that I'd wait for (i.e. rely on) the official guidance and so focussed on some other activities to make more efficient use of my time - i.e. nothing at all (sorry!).

    Appreciate your assistance.

    BR,
    Zyrus

  • I tried to look into this, but it wasn't that straightforward. I'll put off some time the next days and see if I can make this work.

  • I was able to make it work.

    Could you test this application with NCS v1.5.0 and the board nrf5340dk_nrf5340_cpuapp:

    3603.nvs_external_flash.zip

    Also you have to make CONFIG_NORDIC_QSPI_NOR select CONFIG_FLASH_HAS_PAGE_LAYOUT in zephyr/drivers/flash/Kconfig.nordic_qspi_nor. See code snippet below:

    menuconfig NORDIC_QSPI_NOR
    	bool "QSPI NOR Flash"
    	select FLASH_HAS_DRIVER_ENABLED
    	select NRFX_QSPI
    	select FLASH_JESD216
    	select FLASH_HAS_PAGE_LAYOUT
    	depends on HAS_HW_NRF_QSPI
    	help
    	  Enable support for nrfx QSPI driver with EasyDMA.

    The Kconfig CONFIG_FLASH_HAS_PAGE_LAYOUT does not have a prompt, so it's not possible to set it directly in the prj.conf file.

    Best regards,

    Simon

  • Great - thanks Simon. Will give it a go first thing in the morning - it's 9pm here ATM.

    BR,

    Zyrus

  • Hi Simon,

    Have tested and confirm that it works (at this stage).  I'm using a custom board with the Macronix MX66L1G45G (1-Gbit flash); I made the necessary changes in the zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340_cpuapp_common.dts as below:

    &qspi {
    	status = "okay";
    	sck-pin = <17>;
    	io-pins = <13>, <14>, <15>, <16>;
    	csn-pins = <18>;
    	mx66l1g: mx66l1g45g@0 {
    		compatible = "nordic,qspi-nor";
    		reg = <0>;
    		/* MX66L1G supports only pp and pp4io */
    		writeoc = "pp4io";
    		/* MX66L1G supports all readoc options */
    		readoc = "read4io";
    		sck-frequency = <8000000>;
    		label = "MX66L1G";
    		jedec-id = [c2 20 1b];
    		sfdp-bfp = [
    			e5 20 fb ff  ff ff ff 3f  44 eb 08 6b  08 3b 04 bb
    			fe ff ff ff  ff ff 00 ff  ff ff 44 eb  0c 20 0f 52
    			10 d8 00 ff  d6 49 c5 00  82 df 04 e3  44 03 67 38
    			30 b0 30 b0  f7 bd d5 5c  4a 9e 29 ff  f0 50 f9 85
    		];
    		size = <1073741824>;
    	};
    };
    

    4k page size is fine, but had to also modify the number of pages to be able to access the full memory.

    Thanks for your help.

    BR,
    Zyrus

Related