Zephyr Driver: Regarding the execution speed of flash read API at nrf54l15

Hi,

I'm reading 1 byte of data from a Macronics MX25R64, but the execution speed of the read operation varies depending on the SDK version.

With SDK 3.1.1, it's possible to read one byte of data in about 60us.

SDK 3.2.4 reads one byte of data in approximately 1.3 ms.

This measurement was performed by setting the GPIO output to High before executing the flash read and Low upon completion of the execution.

Based on my testing with a custom board, the SPI instance used is spi00. The communication pins are the same as those used on the NRF54L15 DK.

I believe this problem is caused by a change in the major version of the nrfx driver.

However, I cannot identify it even after reviewing the following change log.

https://github.com/nordicsemi/nrfx/blob/master/CHANGELOG.md

I believe this is due to a change in the SPI driver, but no major changes to SPIM were mentioned in the major update.

Would you tell me what the problem is?

Best regards,

Hiroki

Parents
  • Hello,

    Given the large discrepancy I suspect in the first case that the SPI flash is powered on, while with the new version it is in Deep power down (DPD) mode thus requiring the driver to wait for the flash to become ready before it can perform the read operation. Perhaps you can disable DPD (I.e. remove the has-did property from the MX25R64 DT node) to confirm if this improves the read performance.

    Best regards,

    Vidar

  • Hi,Vidar

    Thank you for reply.

    No change even if deleted.

    Furthermore, since the spi_nor driver uses the same file in both SDK 3.1.1 and SDK 3.2.4, it is unlikely that there is a problem with the file itself. Also, the overlay settings for mx25r64 are the same in both SDK 3.1.1 and SDK 3.2.4.

    Are there any other possible causes?

    Best regards,

    Hiroki

  • Thank you. One difference that stands out is that the new version has this config setting enabled:

    With this option, the flash IC is automatically put into DPD mode between use. Could you please try disabling this?

    DTS diff (the new version still has DPD enabled):

    		/* node '/soc/peripheral@50000000/spi@4a000' defined in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:132 */
    +			/* node '/soc/peripheral@50000000/spi@4a000' defined in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:135 */
     			spi00: spi@4a000 {
    -				compatible = "nordic,nrf-spim"; /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:139 */
    -				#address-cells = < 0x1 >;       /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:140 */
    -				#size-cells = < 0x0 >;          /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:141 */
    -				reg = < 0x4a000 0x1000 >;       /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:142 */
    -				interrupts = < 0x4a 0x1 >;      /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:143 */
    -				max-frequency = < 0x1e84800 >;  /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:144 */
    -				easydma-maxcnt-bits = < 0x10 >; /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:145 */
    -				rx-delay-supported;             /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:146 */
    -				rx-delay = < 0x1 >;             /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:147 */
    +				compatible = "nordic,nrf-spim"; /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:142 */
    +				#address-cells = < 0x1 >;       /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:143 */
    +				#size-cells = < 0x0 >;          /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:144 */
    +				reg = < 0x4a000 0x1000 >;       /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:145 */
    +				interrupts = < 0x4a 0x1 >;      /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:146 */
    +				max-frequency = < 0x1e84800 >;  /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:147 */
    +				easydma-maxcnt-bits = < 0x10 >; /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:148 */
    +				rx-delay-supported;             /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:149 */
    +				rx-delay = < 0x1 >;             /* in zephyr/dts/vendor/nordic/nrf54l_05_10_15.dtsi:150 */
     				status = "okay";                /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:65 */
     				cs-gpios = < &gpio2 0x5 0x1 >;  /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:66 */
     				pinctrl-0 = < &spi00_default >; /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:67 */
    @@ -270,394 +271,389 @@
     
     				/* node '/soc/peripheral@50000000/spi@4a000/mx25r6435f@0' defined in zephyr/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi:121 */
     				mx25r64: mx25r6435f@0 {
    -					compatible = "jedec,spi-nor";                                                                                                                                                                                   /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:72 */
    -					status = "okay";                                                                                                                                                                                                /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:73 */
    -					reg = < 0x0 >;                                                                                                                                                                                                  /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:74 */
    -					spi-max-frequency = < 0x7a1200 >;                                                                                                                                                                               /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:75 */
    -					jedec-id = [ C2 28 17 ];                                                                                                                                                                                        /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:76 */
    -					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 48 44 30 B0 30 B0 F7 C4 D5 5C 00 BE 29 FF F0 D0 FF FF ]; /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:77 */
    -					size = < 0x4000000 >;                                                                                                                                                                                           /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:83 */
    -					has-dpd;                                                                                                                                                                                                        /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:84 */
    -					t-enter-dpd = < 0x2710 >;                                                                                                                                                                                       /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:85 */
    -					t-exit-dpd = < 0x88b8 >;                                                                                                                                                                                        /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:86 */
    +					reset-gpios = < &gpio2 0x0 0x1 >;                                                             /* in zephyr/boards/nordic/nrf54l15dk/nrf54l_05_10_15_cpuapp_common.dtsi:137 */
    +					compatible = "jedec,spi-nor";                                                                 /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:72 */
    +					status = "okay";                                                                              /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:73 */
    +					reg = < 0x0 >;                                                                                /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:74 */
    +					spi-max-frequency = < 0x7a1200 >;                                                             /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:75 */
    +					jedec-id = [ C2 28 17 ];                                                                      /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:76 */
    +					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 48 44 30 B0 30 B0 F7 C4
    +					             D5 5C 00 BE 29 FF F0 D0 FF FF ];                                                 /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:77 */
    +					size = < 0x4000000 >;                                                                         /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:83 */
    +					has-dpd;                                                                                      /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:84 */
    +					t-enter-dpd = < 0x2710 >;                                                                     /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:85 */
    +					t-exit-dpd = < 0x88b8 >;                                                                      /* in ../../nrf54l15_cri/BLE_CRI_Demo/build/BLE_CRI_Demo/zephyr/custom.overlay:86 */
     				};
     			};

  • Hi,Vidar

    The problem has been solved.

    You're right, the startup was slow because of power control.

    Thank you.

    Is this a kconfig entry added because the specifications for the Zephyr driver have changed?

    In which source code of the Zephyr driver is this kconfig referenced?

    Also, since this config is for automatic power control, even if I turn it off, I can still put it into low power mode using the pm_device API, right?

    Best regards,

    Vidar

  • Hi,

    Good to hear, thanks for the update.

    H-ogawa said:
    Is this a kconfig entry added because the specifications for the Zephyr driver have changed?

    The "why" is summarised in the commit message here: https://github.com/nrfconnect/sdk-zephyr/commit/61a9d6aa45868d65b4d24c257a2799a62fb9d32d

    Your original version already had CONFIG_PM_DEVICE_RUNTIME enabled, but that did not do anything for the SPI NOR driver since we aren't including the "zephyr,pm-device-runtime-auto" property in the SPI node by default.

    H-ogawa said:
    Also, since this config is for automatic power control, even if I turn it off, I can still put it into low power mode using the pm_device API, right?

    Yes, you can.

    Best regards,

    Vidar

  • Hi,Vidar

    Thank you for your response.

    Since it has been resolved, I will close this issue.

    Best regards,

    Hiroki

Reply Children
No Data
Related