SPI NOR peripheral restart

Hi 

I have an external NOR flash chip which is powered off on startup. The idea is to power up the flash when needed to reserve power. On startup, I get the error message:

<err> spi_nor: SFDP magic ffffffff invalid
<err> spi_nor: SFDP read failed: -22

Enabling the power pin only starts during application code, meaning SPI-NOR fails before that.

Is there a way to restart the SPI-NOR instance or driver to re-attempt initializing the device?

I have had limited success by reorganizing boot priorities to have GPIO start before SPI, but what about the case where I have to reinitialize during runtime?

I have also tried remounting the fstab entry, but it doesn't seem to do anything to the SPI situation.

I appreciate any guidance regarding this

Parents Reply
  • Hi  

    Thanks for the response. Although the calls work, it does not reinitialize the children, like the jedec,spi-nor.

    &spi2 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	sck-pin = < 13 >;
    	mosi-pin = < 16 >;
    	miso-pin = < 17 >;
    	cs-gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
    	label = "FLASH";
    
    	exflash0: exflash@0 {
            supply-gpios = < &gpio0 12 GPIO_ACTIVE_LOW >;
    
    		status = "okay";
    		compatible = "jedec,spi-nor";
            sfdp-bfp = [ 53 46 44 50 06 01 02 ff ];
    		reg = <0>;
            requires-ulbpr;
    		hold-gpios = < &gpio0 14 GPIO_ACTIVE_LOW >;
    		wp-gpios = < &gpio0 15 GPIO_ACTIVE_LOW >;
     		jedec-id = [bf 26 42];
    		label = "EXFLASH0";
    		size = < 33554432 >;
    		spi-max-frequency = <40000000>;
    		//spi-max-frequency = <1000000>;
    	};
    };

    I have tried doing the same to the EXFLASH0 device as shown above, but it fails to suspend/resume.

Children
Related