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.

  • Hi,

     

    For the example to work, you must define a $(board).overlay and $(board).conf file in the boards catalog of the example.

    In your case it would be boards/bl654_dvk.conf and boards/bl654_dvk.overlay.

    You should follow the setup similar to how it is done for the nRF52840-DK, with QSPI being enabled:

    https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/drivers/spi_flash/boards/nrf52840dk_nrf52840.conf#L8

     

    And the MX25R64 itself being defined in the board:

    https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts#L209-L235

     

    Kind regards,

    Håkon

  • Hi,

    Those are the steps I took to receive that message. Not sure how to proceed from there. I have also closed all the bridges required for the qspi flash.

    Thanks,

    Jacob

  • Hi Jacob,

     

    jspiller said:

    Those are the steps I took to receive that message. Not sure how to proceed from there. I have also closed all the bridges required for the qspi flash.

    Did you try this on a nRF52840-DK first to see if it worked there?

     

    I see now that the bl654_dvk board defines this as a spi-nor device in the overlay, not a qspi device:

    https://github.com/nrfconnect/sdk-zephyr/blob/main/boards/arm/bl654_dvk/bl654_dvk.dts#L135-L152

    Try adding this to the top of your .overlay file:

    /delete-node/ &mx25r6435f;

    then setup your &qspi structure with the "MX25R64" labeled device in it.

     

    If it still does not work, could you share your overlay and config files?

     

    Kind regards,

    Håkon

  • 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!!
    

Related