Could not make SPI HCI work on Zephyr 4.3.0 with nRF54L15

Hello, I'm trying to make samples/bluetooth/hci_spi work on my nRF54L15-DK however I encounter some issues My device tree overlay is as followed:

&pinctrl {
	spi21_default_alt: spi21_default_alt {
		group1 {
			psels = <NRF_PSEL(SPIS_SCK, 1, 11)>,
				<NRF_PSEL(SPIS_MOSI, 1, 12)>,
				<NRF_PSEL(SPIS_MISO, 1, 13)>,
				<NRF_PSEL(SPIS_CSN, 1, 9)>;
		};
	};
};

&spi21 {
	compatible = "nordic,nrf-spis";
	status = "okay";
	def-char = <0x75>;
	pinctrl-0 = <&spi21_default_alt>;
	pinctrl-names = "default";
	/delete-property/ rx-delay-supported;
	/delete-property/ rx-delay;

	bt-hci@0 {
		compatible = "zephyr,bt-hci-spi-slave";
		reg = <0>;
		irq-gpios = <&gpio1 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>;
	};
};

/ {
	aliases {
		/delete-property/ sw0;
		/delete-property/ sw1;
		/delete-property/ sw2;
		/delete-property/ sw3;
		/delete-property/ mcuboot-button0;
	};
	/delete-node/ buttons;
};
/delete-node/ &spi00;
/delete-node/ &spi30;
/delete-node/ &spi20;
/delete-node/ &spi22;

&uart30 {
	status = "disabled";
};

I know that spi21.def-char should be <0x00> however for my test purpose it helps me to diagnose my SPI connection problem.

I also deleted all SPI devices and all buttons to prevent any conflict with development kit hardware

When I try to start the SPI communication with it I get the following when all pins are plugged.

If I unplug CS and plug it directly to ground I get the following result:

What I find strange is that in the case were all pins are plugged the nRF54L15 try to send on MISO data when CS goes data even without any clock.
The first few bytes send by the nRF54L15 should be 04 ff 02 01 00
I also check with an oscilloscope but the signals are very clear.
Additionally I had to set my board on 3.3V as the SPI Master use this voltage.
Is there something I missed ?
Cordially,
Robyn
  • Happy new year Robyn, thanks for your patience in waiting and glad that you had a lot of process in figuring out why the SPI was not working.

    The assert you see here, does not give much context.

    Can you please enable these configs if you have not already, to know the context of this fault.

    CONFIG_THREAD_NAME
    CONFIG_STACK_SENTINEL
    CONFIG_THREAD_ANALYZER

    These give you context of the fault and also more info on the thread stacks in case this is a stack overflow issue.

  • Hi,

    EDIT2: Thank to all your information I was able to diagnose the underlying issue and I'm finally able to make both cards communicate without any issues.

    I'm really grateful for the time you took to help me,

    Robyn

    Previous Answer:

    I enabled the config flag you mentionned and got

    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:504
            Controller unresponsive, command opcode 0x2022 timeout with err -11
    [00:00:11.628,000] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000002
    [00:00:11.628,000] <err> os: r3/a4:  0x00000003 r12/ip:  0x00002d6c r14/lr:  0x34185413
    [00:00:11.628,000] <err> os:  xpsr:  0x01000000
    [00:00:11.628,000] <err> os: Faulting instruction address (r15/pc): 0x34185422
    [00:00:11.628,000] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:11.628,000] <err> os: Current thread: 0x3419a488 (BT RX WQ)
    [00:00:11.666,000] <err> os: Halting system
    

    Which seems to make it clear that it is caused by the following warnings that I have

    <wrn> bt_hci_core: opcode 0x2022 status 0x01 BT_HCI_ERR_UNKNOWN_CMD

    EDIT1: After some research I discovered that it was because the BT_HCI_OP_LE_SET_DATA_LEN was not understood but the following configuration was missing on the nRF54 and so the command failed. After fixing the configuratuib the warning disappear.

    CONFIG_BT_DATA_LEN_UPDATE=y

    However some issues still persists after that, I've got the following error followed promptly by different crashes, each time after the following error

    EDIT2: The cause was my debug default char being set to 117 which caused the following issue.

    <err> bt_driver: Unknown BT buf type 117

    [00:00:01.531,000] <err> bt_driver: Unknown BT buf type 117
    [00:00:04.491,000] <wrn> bt_conn: conn 0x3419aa30 failed to establish. RF noise?
    [00:00:04.492,000] <wrn> bt_conn: conn 0x3419ab00 failed to establish. RF noise?
    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:504
            Controller unresponsive, command opcode 0x200e timeout with err -11
    [00:00:14.473,000] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000002
    [00:00:14.473,000] <err> os: r3/a4:  0x00000003 r12/ip:  0x00003889 r14/lr:  0x3418540b
    [00:00:14.473,000] <err> os:  xpsr:  0x01000000
    [00:00:14.473,000] <err> os: Faulting instruction address (r15/pc): 0x3418541a
    [00:00:14.473,000] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:14.473,000] <err> os: Current thread: 0x3419b550 (sysworkq)
    [00:00:14.511,000] <err> os: Halting system
    

    [00:00:02.957,000] <err> bt_driver: Unknown BT buf type 117
    [00:00:31.554,000] <err> bt_att: ATT Timeout for device F4:12:FA:86:7B:79 (public). Disconnecting...
    [00:00:31.571,000] <wrn> bt_conn: conn 0x3419a960 failed to establish. RF noise?
    ASSERTION FAIL [err == 0] @ WEST_TOPDIR/zephyr/subsys/bluetooth/host/hci_core.c:504
            Controller unresponsive, command opcode 0x0406 timeout with err -11
    [00:00:41.554,000] <err> os: r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000002
    [00:00:41.554,000] <err> os: r3/a4:  0x00000003 r12/ip:  0x0000a252 r14/lr:  0x3418540b
    [00:00:41.554,000] <err> os:  xpsr:  0x01000000
    [00:00:41.554,000] <err> os: Faulting instruction address (r15/pc): 0x3418541a
    [00:00:41.554,000] <err> os: >>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
    [00:00:41.554,000] <err> os: Current thread: 0x3419b550 (sysworkq)
    [00:00:41.592,000] <err> os: Halting system
    

Related