SPI1 salve configuration results in bus fault using NRF9160 DK

I've been using the following SPI2S pins and they've been working:

CLK   -> P0.16
MOSI -> P0.17
MISO -> P0.19
CS     -> P0.18

I want to use SPI1 instead but when I replace SPI2 with SPI1 I get a bus fault:

00:00:00.297,332] <err> os: ***** BUS FAULT *****
[00:00:00.297,332] <err> os:   Precise data bus error
[00:00:00.297,363] <err> os:   BFAR Address: 0x0
[00:00:00.297,363] <err> os: r0/a1:  0x00012d44  r1/a2:  0x00012d54  r2/a3:  0x40009000
[00:00:00.297,393] <err> os: r3/a4:  0x00000010 r12/ip:  0x40842500 r14/lr:  0xfffcf8f0
[00:00:00.297,393] <err> os:  xpsr:  0x81000000
[00:00:00.297,393] <err> os: Faulting instruction address (r15/pc): 0x0000af1a
[00:00:00.297,424] <err> os: >>> ZEPHYR FATAL ERROR 25: Unknown error on CPU 0
[00:00:00.297,454] <err> os: Current thread: 0x2000cd80 (unknown)
[00:00:00.358,886] <err> os: Halting system

My device tree:

/* Disable unused peripherals */
&i2c0 {	status = "disabled";};
&spi0 {	status = "disabled";};
&i2c1 {	status = "disabled";};
&uart1 { status = "disabled";};

// Configure spi1 on Arduino header of dev kit
&pinctrl {

    spi1_default: spi1_default {
        group1 {
            psels = <NRF_PSEL(SPIS_SCK, 0, 16)>,					 
                    <NRF_PSEL(SPIS_MOSI, 0, 17)>,
                    <NRF_PSEL(SPIS_MISO, 0, 18)>,
                    <NRF_PSEL(SPIS_CSN, 0, 19)>;
        };
    };

    spi1_sleep: spi1_sleep {
        group1 {
            psels = <NRF_PSEL(SPIS_SCK, 0, 16)>,					 
                    <NRF_PSEL(SPIS_MOSI, 0, 17)>,
                    <NRF_PSEL(SPIS_MISO, 0, 18)>,
                    <NRF_PSEL(SPIS_CSN, 0, 19)>;
            low-power-enable;
        };
    };
};


spi_test: &spi1 {
    compatible = "nordic,nrf-spis";
    status = "okay";
    pinctrl-0 = <&spi1_default>;
    pinctrl-1 = <&spi1_sleep>;
    pinctrl-names = "default", "sleep";
    def-char = <0xCD>;
};

My project config is the same between both SPI1 and SPI2 setting:

CONFIG_GPIO=y
CONFIG_SPI=y
CONFIG_SPI_SLAVE=y
CONFIG_LOG=y

Parents
  • Hello,

    Please try to add CONFIG_TFM_LOG_LEVEL_SILENCE=y (this should also disable CONFIG_NRF_UARTE1_SECURE in the build) to your project configuration and see if you still get this busfault afterward. TF-M has logging enabled on UART1 by default since SDK v2.6.0, which conflicts with SPIM1/SPIS1 if kept enabled.

    Best regards,

    Vidar

Reply
  • Hello,

    Please try to add CONFIG_TFM_LOG_LEVEL_SILENCE=y (this should also disable CONFIG_NRF_UARTE1_SECURE in the build) to your project configuration and see if you still get this busfault afterward. TF-M has logging enabled on UART1 by default since SDK v2.6.0, which conflicts with SPIM1/SPIS1 if kept enabled.

    Best regards,

    Vidar

Children
Related