Qspi flash sample project error

Hello, I am trying to use the spi_flash sample project with a laird bl654 dvk. When I run the project however, dev->state->init_res = 19 and will not run for me. It recognizes the device and if I manually set the error code to 0 the project runs correctly. Any idea why this is occurring. The output is 

JEDEC QSPI-NOR SPI flash testing
==========================
SPI flash driver MX25R64 was not found!

This is a onboard flash that supposedly should work from this post https://devzone.nordicsemi.com/f/nordic-q-a/64769/qspi-flash-sample-in-zephyr. I am using sdk 1.9.1.

Parents Reply Children
  • Thanks for the response,

    I just tried putting that line in, but it throws "parse error: undefined node label 'mx25r6435f'" when I try to build. I tired adding the "@0" as well. Using "/delete-node/ &spi1;" is recognized but does not seem to solve the issue. In the device tree the node does show up however, I have tried manually disabling spi1 as well, but no luck. Here is my .conf and .overlay files.

    #
    # Copyright (c) 2019 Peter Bigot Consulting, LLC
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: Apache-2.0
    #
    
    CONFIG_NORDIC_QSPI_NOR=y
    CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

    /delete-node/ &mx25r6435f;
    
    &qspi {
    	status = "okay";
    	sck-pin = <19>;
    	io-pins = <20>, <21>, <22>, <23>;
    	csn-pins = <17>;
    	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>;
    		label = "MX25R64";
    		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>;
    	};
    };
    
    /*
     * UART1 as logger
     */
    / {
    	chosen {
    		zephyr,console = &uart1;
    		zephyr,shell-uart = &uart1;
    		zephyr,uart-mcumgr = &uart0;
    		zephyr,bt-mon-uart = &uart0;
    		zephyr,bt-c2h-uart = &uart0;
    	};
    };
    
    &uart1 {
    	compatible = "nordic,nrf-uarte";
    	current-speed = <115200>;
    	status = "okay";
    	tx-pin = <30>;
    	rx-pin = <31>;
    };

    I have not tried this on a nRF52840dk, does that board have a spi flash on it?

  • Hi,

     

    jspiller said:
    I just tried putting that line in, but it throws "parse error: undefined node label 'mx25r6435f'"

    Sorry for that, it seems that this peripheral/node isn't required to delete.

    This is the overlay and conf file that I placed in the board folder for the bl654_dvk:

    bl654_dvk.conf

    bl654_dvk.overlay

     

    The pin-outs are edited to match the nRF52840-DK, as I do not have this module at-hand.

    This ran as expected when flashed:

    *** Booting Zephyr OS build v2.7.99-ncs1  ***
    
    JEDEC SPI-NOR SPI flash testing
    ==========================
    
    Test 1: Flash erase
    Flash erase succeeded!
    
    Test 2: Flash write
    Attempting to write 4 bytes
    Data read matches data written. Good!!
    

  • I just tested it on a nRF52840dk and it worked as you saw as well. It is something specific to the bl654 module then that is causing an issue. Any idea what that might be?

  • Hi,

     

    Have you connected an external qspi flash or are you using the internal one on the bl654-dvk?

    Have you checked that the on-board spi flash has routed all the qspi pins?

     

    Kind regards,

    Håkon

  • There is a optional external qspi that comes on the dev kit. I followed the instructions shown here:

    And configured the qspi as such:

    &qspi {
    	status = "okay";
    	sck-pin = <14>;
    	io-pins = <9>, <13>, <12>, <11>;
    	csn-pins = <16>;
    	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>;
    		label = "MX25R64";
    		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>;
    	};
    };

    Does this seem correct?

Related