nRF5340 QSPI flash

Hi:

SW: NCS v2.5.0

HW: nRF5340 + flash gd25q256e 

To reduce the power consumption of the QSPI flash, we have two approaches.

1. cut off the QSPI flash's power when the product is in sleep mode (the power can be turned on/off by an LDO)

2. always keep the power of the QSPI flash, and put the flash into deep power down mode when the product is in sleep mode.

unfortunately, both of these two approaches have problems.

for approach 1, when turning on the power again, and initiating the QSPI and XIP again, the XIP doesn't work.

e.g 

 printk("#2Address of %x value %x\n", 0x10000008, *(uint32_t *)0x10000008);
 printk("#2Address of %x value %x\n", 0x10000040, *(uint32_t *)0x10000040);
 the values are wrong. 
for approach 2,
put the QSPI flash into deep power down mode by calling pm_device_action_run(flash_dev, PM_DEVICE_ACTION_SUSPEND);
this works, we can see the power consumption is reduced.
wake up the flash from deep power down mode by calling pm_device_action_run(flash_dev, PM_DEVICE_ACTION_RESUME);
but this function return -EIO, and it is caused by the nrfx_qspi_init return NRFX_ERROR_TIMEOUT.
if we don't put the flash into deep power-down mode, every thing is OK.

below is the QSPI configuration 

&qspi {
	status = "okay";
	pinctrl-0 = <&qspi_default>;
	pinctrl-1 = <&qspi_sleep>;
	pinctrl-names = "default", "sleep";
	gd25q256: gd25q256e@0 {
		compatible = "nordic,qspi-nor";
		reg = <0>;
		/* GD25Q256 supports only pp(cmd 02H) and pp4o(cmd 32H) */
		writeoc = "pp4o";
		/* GD25Q256 supports all readoc options */
		readoc = "read4io";
		sck-frequency = <8000000>;
		jedec-id = [c8 40 19];
		sfdp-bfp = [/*read the sfdp-bfp by jesd216 sample(zephyr\samples\drivers\jesd216)*/
			e5 20 f3 ff  ff ff ff 0f  44 eb 08 6b  08 3b 42 bb
			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
			10 d8 00 ff  d6 39 a5 fe  83 1f 15 51  ec 62 16 33
			7a 75 7a 75  04 bd d5 5c  00 06 64 00  08 50 00 01
		];
		size = <268435456>;
		has-dpd;
		t-enter-dpd = <40000>;
		t-exit-dpd = <45000>;
		enter-4byte-addr = <0x01>;
		address-size-32;
	};
};

Do you have any ideas on this issue?

Thanks!

  • Hi Jason, 

    Have a look at  RE: QSPI Polling of Status Register by QSPI peripheral at ACTIVATE and WRITE? 

    After calling nrf_qspi_task_trigger(NRF_QSPI, NRF_QSPI_TASK_ACTIVATE) the QSPI peripheral will try to read the status register of the external flash. 

    In the above mentioned ticket there's a hack provided. Let me know if it works for you. 

    Thanks,

    Rosh

  • Hi roshangeoroy,

    I do not quite understand how to implement this ‘’hack' , could you provide an example?

    After calling nrf_qspi_task_trigger(NRF_QSPI, NRF_QSPI_TASK_ACTIVATE) the QSPI peripheral will try to read the status register of the external flash

    do you mean this is done by the QSPI peripheral automatically? I don't see any code to read the status.

  • Hi AHaug,

    sorry for the late relay, because I was handling another urgent task.

    However, we see that the external flash only supports 2.7V-3.6V, so this might be related to one of these

    I changed the VDD voltage and made no difference.

    Also, the logic analyzer trace Simon requested in the other ticket would likely be very helpful here.

    Release from Deep Power-Down on nrf5340 DK and no problem 

    Release from Deep Power-Down on our PCBA with gd25q256e  fash,  return error, and always outputs the below waveform, no stop.

    According to the logic analyzer, it seems to be due to the flash doesn't respond to the 05H cmd.

    my question is why did the nrf5340 send the 05H cmd before sending the ABH cmd, why not just send the ABH cmd to Release from Deep-Power-Down.

    According to the FLASH datasheet,  "Once the device has entered the Deep Power-Down Mode, all commands are ignored except the Release from
    Deep Power-Down and Read Device ID (RDI) (ABH) or Enable Reset (66H) and Reset (99H) commands."

  • Hi,

    Thank you for the trace. It looks like there is a difference between the mx25 that is on the nRF5340DK and the gd25q that you're using. As you state there are only a set of instructions (see table 118 in https://infocenter.nordicsemi.com/pdf/nRF5340_PS_v1.3.1.pdf) that wakes the gd25, but any instruction from the list wakes the mx25. The wakeup procedure for qspi_nor can be seen in github.com/.../nrf_qspi_nor.c

    Are you able to wake the external flash using one of the instructions that the gd25 datasheet states that will not be ignored?

    Kind regards,
    Andreas

  • Hi AHaug,

    I checked the mx25 data sheet , it can exit Deep Power-down mode if CS pulses. But I do not think all of the QSPI Flash has such a feature, and this should not be a standard.

    Are you able to wake the external flash using one of the instructions that the gd25 datasheet states that will not be ignored?

    I think it should be able to wake the external flash. but I can not confirm it with the NCS, because that's the problem this post describes

    I found the 05H cmd is sent by function nrfx_qspi_init.

    but I can not see any code related to 05H cmd inside the nrfx_qspi_init. 

    so where does the  05H cmd come from? how can I disable this 05H cmd and make nrfx_qspi_init  work correctly?

Related