QSPI flash hangs after BLE bonding on nRF54L15 (sQSPI / LittleFS)

We are experiencing an issue with the QSPI driver on nRF54L15 where external flash access stops working after a BLE bonding procedure.

The system works correctly until bonding occurs. After a mobile device bonds with the board, any access to external flash via QSPI becomes unusable and the calling thread hangs indefinitely.

During investigation we temporarily added a guard/timeout around the _ASB(...) macro inside the driver. With this modification the driver sometimes returns:

flash_mspi_nor: perform_xfer: transceive() failed: -116

However, without this modification the system hangs indefinitely.


Hardware

  • Board: nRF54L15-DK

  • External flash: MX25R6435F

  • Interface: QSPI (quad mode)

The flash wiring matches the reference design used on the development kit.


Software

  • nRF Connect SDK project built from command line

  • File system: LittleFS over sQSPI flash

  • Application features:

    • BLE advertising

    • BLE connections

    • BLE bonding

    • shell commands for NVM access

Steps to Reproduce

  1. Start BLE advertising

  1. Connect from a mobile device.

  2. Perform bonding.

  3. Execute any command that accesses external flash.

Observed Behavior

External flash works correctly in the following situations:

  • before BLE advertising

  • while advertising (most of the time)

  • while a mobile device is connected but not bonded

After bonding, access to external flash becomes unusable.

When a command attempts to access flash (e.g. nvm ls), the thread performing the operation hangs indefinitely.

When a temporary timeout was added around _ASB(...), the operation sometimes fails with:

flash_mspi_nor: perform_xfer: transceive() failed: -116

But without this modification the system deadlocks.


Expected Behavior

External flash access over QSPI should continue working normally regardless of BLE bonding state.

Bonding a BLE device should not affect the operation of the external flash driver.

Workaround

Switching the external flash interface from QSPI to hardware SPI (single line) avoids the issue.

With SPI the flash works correctly even after BLE bonding.

However, this significantly reduces flash throughput compared to QSPI.


Additional Observations

While debugging with a debugger attached, the blocked execution appeared to be stuck inside the _ASB(...) macro. This observation is not fully confirmed, but it appeared consistently when inspecting the hanging thread.


Things Already Tested

We tried the following without resolving the issue:

Disable auto runtime PM for sQSPI

Lowering the operational frequency down to 1MBit

Disable Deep Power Down for MX25R6435F
(removed the following from dts):

has-dpd
t-enter-dpd
t-exit-dpd
reset timings

The issue still occurs.

If possible, could you please help investigate why BLE bonding affects QSPI flash access on nRF54L15?

Device Tree, part related to sqspi configuration:

&sqspi {
	mx25r64: mx25r6435f@0 {
		compatible = "mxicy,mx25r", "jedec,mspi-nor";
		status = "okay";
		reg = <0>;
		jedec-id = [c2 28 17];
		quad-enable-requirements = "S1B6";
		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 = <DT_SIZE_M(64)>; /* 8 MB (64 Mbit) */
		has-dpd;
		t-enter-dpd = <10000>;
		t-exit-dpd = <35000>;
		t-reset-pulse = <10000>;
		t-reset-recovery = <35000>;
		mspi-max-frequency = <DT_FREQ_M(80)>;
		mspi-io-mode = "MSPI_IO_MODE_QUAD_1_4_4";
		mspi-data-rate = "MSPI_DATA_RATE_SINGLE";
		mspi-hardware-ce-num = <1>;
		mspi-cpp-mode = "MSPI_CPP_MODE_0";
		mspi-endian = "MSPI_BIG_ENDIAN";
		mspi-ce-polarity = "MSPI_CE_ACTIVE_LOW";
		transfer-timeout = <100>;
	};
};

Parents
  • Hello,

    I have tried to reproduce this with SDK v3.3.0 and a nRF54l15 DK target, but without any luck. I am including the test sample I used if you want to try with the same project. 

    ble_lbs_sqspi.zip

    Note: this test sample was created with the help of Cursor and I have not gone through and reviewed everything.

    Best regards,

    Vidar

  • Hello, Vidar!  

    I have worked with this bug and was able to find the possible reason. External flash access hang was observed after the BLE bonding procedure with Device Runtime Power Management enabled:

    CONFIG_PM_DEVICE=y
    CONFIG_PM_DEVICE_RUNTIME=y

    The hang disappeared after I disabled CONFIG_PM_DEVICE_RUNTIME and external flash worked well before the first reset. After device reset, on any external flash operation I am getting:

    [00:00:03.699,786] <err> flash_mspi_nor: perform_xfer: transceive() failed: -116
    [00:00:03.699,812] <err> flash_mspi_nor: Read xfer failed: -116
    [00:00:03.699,843] <err> nvm_storage: nvm_storage: opendir failed /nvm, rc=-5


    I was able to reproduce this issue in a sample project, however, the behavior is slightly different: I am constantly getting:  

    flash_mspi_nor: perform_xfer: transceive() failed: -116


    after BLE bonding and device reset. I suppose this issue is strongly connected with original one, since it can be fixed by disabling Device Runtime Power Management and removing BLE advertising. 

    I believe that the issue is caused by BLE/MPSL interaction with the FLPR. Please find the sample attached.
    mqspi_ble_bonding_bug.zip
Reply
  • Hello, Vidar!  

    I have worked with this bug and was able to find the possible reason. External flash access hang was observed after the BLE bonding procedure with Device Runtime Power Management enabled:

    CONFIG_PM_DEVICE=y
    CONFIG_PM_DEVICE_RUNTIME=y

    The hang disappeared after I disabled CONFIG_PM_DEVICE_RUNTIME and external flash worked well before the first reset. After device reset, on any external flash operation I am getting:

    [00:00:03.699,786] <err> flash_mspi_nor: perform_xfer: transceive() failed: -116
    [00:00:03.699,812] <err> flash_mspi_nor: Read xfer failed: -116
    [00:00:03.699,843] <err> nvm_storage: nvm_storage: opendir failed /nvm, rc=-5


    I was able to reproduce this issue in a sample project, however, the behavior is slightly different: I am constantly getting:  

    flash_mspi_nor: perform_xfer: transceive() failed: -116


    after BLE bonding and device reset. I suppose this issue is strongly connected with original one, since it can be fixed by disabling Device Runtime Power Management and removing BLE advertising. 

    I believe that the issue is caused by BLE/MPSL interaction with the FLPR. Please find the sample attached.
    mqspi_ble_bonding_bug.zip
Children
No Data
Related