This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Zephyr QSPI Enter 32-bit Address Mode

I've made a basic QSPI setup for an MT25QU512.  By default the QSPI driver is using 24-bit addressing.  To access all of the memory, I'd like to set up the QSPI driver to use 32-bit addressing (via address-size-32).  In order to do that, a command needs to be sent to the flash to put it into 32-bit mode: ENTER 4-BYTE ADDRESS MODE (B7h).  How would I go about sending that command to the flash chip?  Is there some way to use the Zephyr flash driver interface to send an arbitrary command?

  • Hi

    The nrfx_qspi library uses the NRF_QSPI_ADDRMODE_ to set the address mode to 24 bit by default, but in nrf_qspi.h there is also a NRF_QSPI_ADDRMODE_32BIT that can be used to set 32-bit addressing I think. Alternatively you can send this op code to the QSPI flash using a custom instruction which our QSPI peripheral supports. Here is an example snippet of how you can send an OP code to the flash device. the .opcode needs to be 0xB7 in your specific case. Please note that you'll need to declare this function somewhere.

    nrfx_err_t CINSTR_function(size_t OPCODE)
    {
    	
    	nrf_qspi_cinstr_conf_t cinstr_cfg = {
    		.opcode 	= OPCODE,
    		.length 	= NRF_QSPI_CINSTR_LEN_1B,
    		.io2_level	= false,
    		.io3_level 	= false,
    		.wipwait 	= true,
    		.wren 		= true
    	};
    
        int err = nrfx_qspi_cinstr_xfer(&cinstr_cfg, NULL, NULL);
        if (err != NRFX_SUCCESS) {
    	    }
    
    
    return NRFX_SUCCESS;
    }
    

    Best regards,

    Simon

Related