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 Reply Children
  • We're also having problems with external flash not working after BT bonding. The external flash is using the FLPR soft peripheral. We can access the flash OK, but BT bonding is unable to save the keys. 



    *** Using Zephyr OS v4.1.99-ff8f0c579eeb *** [00:00:02.271,158] ble: ble addr: 27:43:C5:46:40:E1 [00:00:02.271,360] main: BT mac addr: 27:43:C5:46:40:E1 [00:00:02.271,603] littlefs_storage: little_fs_test: Test r/w files on littlefs [00:00:02.285,021] littlefs_storage: fs_statvfs, mount: /lfs1: block sz: 16; frag sz: 65536; blocks: 64; free blks: 59 [00:00:02.285,357] littlefs_storage: storage free space: 944 [00:00:02.285,616] littlefs_storage: little_fs_test: lfs_fs_stat, blocks: 0; size: 91389; vers: 131073; max name 0 [00:00:02.440,956] imu: IMU thread started [00:00:05.270,921] nus: streaming data task start.. [00:10:01.129,651] main: clock time: 01/01/1970 00:10:01 [00:10:01.541,810] flash_mspi_nor: perform_xfer: transceive() failed: -116 [00:10:01.542,072] flash_mspi_nor: Read xfer failed: -116 [00:10:01.542,327] fs: file open error (-5) [00:10:01.542,567] ble: BT connected [00:10:01.659,059] ble: Security changed: 14:14:7D:95:6F:46 (public) level 4 [00:10:02.318,750] ble: MTU exchanged: 247 [00:10:02.319,263] bt_l2cap: Ignoring data for unknown channel ID 0x003a [00:10:02.320,476] littlefs: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1386: Corrupted dir pair at {0x1, 0x0} [00:10:02.320,804] fs: file open error (-14) [00:10:03.549,018] nus: NUS notify - Enabled [00:10:03.609,015] nus: nus_data_rcvd: nus data received, command 0x1, len 5
  •  , did you modify the driver to add the timeout like OP and are you also using the nRF54L15 chip? And do you have a minimal sample which I can use to reproduce this issue on my end?

  • We tried a number of configurations, time out etc. I'll try to put together a minimal sample, but it will take a few days. (deadlines loom)

    For now we're saving the keys in retained memory, which is not optimal as they get erased on reset/program flash.

Related