Using external flash other than MX25R64

Hi,

We are using nRF52840 for BLE functionality.

We are planing to use external flash with 128Mb which is other than MX25R64 available on DK board.

As part of initial bring up of external flash we are able to test external flash by defining PM_static.yml by having MCUBOOT secondary partition, Little FS in the external flash.

Now our main concern is we will not be able to use this flash but using other flashand the interface is QSPI.

My main concern is when we are moving to other flash what and all the changes from scratch is needed so that the external flash works as expected.

For e.g: DTS file modification for the flash, and what and all things needed as part of the driver modification.

I am new to the flash terminology and also can you help, where the driver code for flash exists and what modifications required for the flash othean default one, how to include it in the build.

Basically the steps involved in bringing up the external flash other than MX25R64

Parents
  • Not a complete answer, but I found this sample in the zephyr ics build that lets you find out all of the details of the flash chip you are using to enter in the dts. 

    zephyr/samples/drivers/jesd216

    had to add to prj.conf and change the printf to print (if you use RTT, serial comm might work as well, didn't have that hooked up)

    # QSPI configuration
    CONFIG_NORDIC_QSPI_NOR=y
    CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

    # Enable logs
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_MODE_DEFERRED=n
    CONFIG_LOG_BACKEND_RTT_MODE_DROP=n
    CONFIG_LOG_BACKEND_RTT_MESSAGE_SIZE=1024
    CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=4096
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
  • This basic details I used while using default external flashof DK . My main concern is DTS file changes for QSPI and if any driver implementation needed.
    Can you ellobarate where i can see dts file relation with flash in the path \ncs\v2.1.0\zephyr\samples\drivers\jesd216.

    I do not see any dts related here

  • Hi,

    Which board do you use?

    Do you plan to use one external QSPI flash memory on your board which is different than existing one on the DK?

    Best regards,
    Dejan

  • Hi 

    I will not be using any bard. We will be using nRF52840 interfaced with external flash ove QSPI, in our complete product. 

    I mean no DK will be used here.

  • Hi,

    If you are planning to use QSPI NOR device which follows JEDEC specification, the basic set of features should be supported directly through nrf_qspi_nor.c driver. NAND flash would most likely be incompatible due to different sector sizes or use of different flash commands.

    Best regards,
    Dejan

  • we will be using NOR flash only.

    So you mean with the general configs which we use for the flash, same will work right?

    I am new to this flash terminology. what is JEDEC spec? w.r.t this spec how the dts changes should be modified. I mean below is for default flash exists in nRF52840 DK. how these detials need to modified.

    &qspi {
    	status = "okay";
    	pinctrl-0 = <&qspi_default>;
    	pinctrl-1 = <&qspi_sleep>;
    	pinctrl-names = "default", "sleep";
    	mx25r64: mx25r6435f@0 {
    		compatible = "nordic,qspi-nor";
    		reg = <0>;
    		/* MX25R64 supports only pp and pp4io */
    		writeoc = "pp4io";
    		/* MX25R64 supports all readoc options */
    		readoc = "read4io";
    		sck-frequency = <8000000>;
    		jedec-id = [c2 28 17];
    		sfdp-bfp = [
    			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
    			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
    			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 68 44
    			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
    		];
    		size = <67108864>;
    		has-dpd;
    		t-enter-dpd = <10000>;
    		t-exit-dpd = <35000>;
    	};
    };

  • Hi,

    JEDEC provides open standards for microelectronics industry.

    General information about Devicetree bindings is available in the documentation. The meaning of specific properties related to QSPI is shown in devicetree bindings for Nordic QSPI peripheral. You should be able to find appropriate values of the properties for your particular NOR flash memory from the device manufacturer's datasheet.

    Best regards,
    Dejan

Reply Children
  • Thank you for the input. these links helped upto certain point.

    Datasheet of mx25r6435f: Flash of DK

    https://www.digikey.in/en/datasheets/macronix/macronixmx25r6435f20wide20range2064mb20v14#pf19

    Our flash is MT25QL128ABA1EW9-0SIT: Serial 128MB NOR flash

    https://media-www.micron.com/-/media/client/global/documents/products/data-sheet/nor-flash/serial-nor/mt25q/die-rev-a/mt25q_qlhs_l_128_aba_0.pdf

    Compared the values of DTS with bothe data sheets able to understand only few parameters.

    But still did not get the values of 

    writeoc, readoc values from datasheet of DK_flash to corelate to my flash.

    Also:

    sfdp-bfp,
    t-enter-dpd,
    t-exit-dpd.
    values also how it is given in DTS. did not get any clue from MX data sheet.
    Clock frequency in our data sheet is 90Mhz and 133 Mhz. not sure which one to use.
    Because in MX flash data sheet also it is 80MHZ but in the nordic DTS only 8MHZ is used.
    only JDEC ID and has dpd is only clear from the data sheets.
  • Hi,

    You could read more about QSPI NOR properties in the documentation. In QSPI electrical specification, you can see that maximum supported frequency for QSPI is 32 MHz. Table 10 in datasheet shows that some frequencies can be less that maximum 32 MHz. It might be possible to configure one of the mentioned values which are less than 32 MHz. Table 44 in the same datasheet specifies DPD exit time (most probably this would be t-exit-dpd) to be 30 us. High to deep power-down which most probably corresponds to t-enter-dpd is specified to be 3 us. The memory size is doubled, so probably you would look at value 134217728. Write and read operation codes (writeoc and readoc) depend on the supported options for your particular flash memory. In any case, I would recommend that you contact flash memory manufacturer as they produce this flash memory and can provide the most reliable information related to the parameters in question. 

    Best regards,
    Dejan

  • Hi

    We are trying to get the SFDP related details and still waiting for them.

    One more question here i have is , after updating the dts file with these details is there any other things do we need to modify.

    we are using zephyr os as part of NCS 2.1.0. do we need to integrate any driver for MT25QL128ABA1EW9-0SIT: Serial 128MB NOR flash. 

    If yes can you provide the link for the zephyr driver of this flash?

  • Hi,

    With proper configuration similar to what you showed earlier in &qspi, you would probably not need an additional driver.

    Regarding drivers, you could have a look at nrfx drivers and Zephyr flash drivers online.

    Best regards,
    Dejan

  • when we modified the details in DTS as per our MT25QL128ABA1EW9-0SIT: Serial 128MB NOR flash, ther is no success. 

    When we boot the device it is still expecting the JEDEC ID of  mx25r6435f.

    What should be the name for the our flash in dts inplace of " mx25r64: mx25r6435f@0" and compatible id.

     

    &qspi {
    	status = "okay";
    	pinctrl-0 = <&qspi_default>;
    	pinctrl-1 = <&qspi_sleep>;
    	pinctrl-names = "default", "sleep";
    	MT25QL128: MT25QL128@0 {
    		compatible = "nordic,qspi-nor";
    		reg = <0>;
    		/* MX25R64 supports only pp and pp4io */
    		writeoc = "pp2o";
    		/* MX25R64 supports all readoc options */
    		readoc = "read2o";
    		sck-frequency = <8000000>;
    		jedec-id = [20 BA 18];
    		sfdp-bfp = [
    		53 46 44 50 06 01 01 FF 00 06 01 10 30 00 00 FF 84 00 01 02 80 00 00 FF
    		FF FF FF FF FF FF FF FF
    		FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    		E5 20 F9 FF FF FF FF 07 29 EB 27 6B 27 3B
    		27 BB FF FF FF FF FF FF 27 BB FF FF 29 EB 0C 20 10 D8 0F 52 00 00
    		00 99 4A 24 C9 03 8E 8B 38 27 01 AC 7A 75 
    		7A 75 5C D5 BD FB FF 82 0F 4A 00 00 3D 81
    		FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
    		00 00 F0 FF FF FF FF FF
    		];
    		size = <134217728>;
    		has-dpd;
    		t-enter-dpd = <10000>;
    		t-exit-dpd = <35000>;
    	};
    };

    If put other name nothing happens but device is also not ready. 

    To test we are using the sample code "C:\ncs\v2.1.0\zephyr\samples\drivers\spi_flash"

    This fails as device not ready with our flash but works well with the DK flash

Related