NRF54L15 with 3 shared spi devices, not working

NRF54L15 with 3 shared spi devices, not working.

I have a custom NRF54L15 based board with 3 spi devices, all sharing the same SCK / MISO / MOSI lines.

SCK = P2.06
MISO = P2.09
MOSI = P2.08

The 3 devices have different CS pins:

P2.10 -> device 1
P2.05 -> device 2
P2.02 -> device 3

Currently I am only able to communicate with device 1. Is this configuration allowed / possible on the NRF54L15, or do I have to use 3 separate SCK / MISO / MOSI lines for each device?

I have made sure to disable spi00 and spi20 and uart20 within the overlay file.

  • Hi

    How have you configured the SPI in your .dts and board files? Here's an example on how the .dts can be set up (assuming you use SPI21).

    &spi21 {
        status = "okay";
        cs-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>,   /* CS for slave 0 */
                   <&gpio2 10 GPIO_ACTIVE_LOW>,   /* CS for slave 1 */
                   <&gpio1 5  GPIO_ACTIVE_LOW>;   /* CS for slave 2 */
        pinctrl-0 = <&spi21_default>;
        pinctrl-1 = <&spi21_sleep>;
        pinctrl-names = "default", "sleep";
    
        slave0: device@0 {
            compatible = "...";
            reg = <0>;
            spi-max-frequency = <8000000>;
        };
    
        slave1: device@1 {
            compatible = "...";
            reg = <1>;
            spi-max-frequency = <8000000>;
        };
    
        slave2: device@2 {
            compatible = "...";
            reg = <2>;
            spi-max-frequency = <8000000>;
        };
    };

    Can you share more information on what hardware you're using here? If you're using the development kit some of the P2 pins are used for other things by default. What is wrong exactly when trying to use the other devices? Do you see an error code or reason it can't use more than one device?

    Also, note that when you use the same instance and pins you can't communicate with them simultaneously. So this depends on what your use case is here.

    Best regards,

    Simon

  • My board files are setup similar to how you have described above, and I am using the generic NRF54L15DK dts file. It is a custom PCB, so not using a development kit, so no conflict on P2 pins. I have tried spi00 and spi21, no difference in results.

    I basically get no response from the devices when selecting P2.05 or P2.02, but I do get a response from the a chip when selecting P2.10

    &pinctrl {
    	spi00_default: spi00_default {
    		group1 {
                psels = <NRF_PSEL(SPIM_SCK, 2, 6)>,
                        <NRF_PSEL(SPIM_MOSI, 2, 8)>,
    					<NRF_PSEL(SPIM_MISO, 2, 9)>;
            };
    	};
    
    	spi00_sleep: spi00_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 2, 6)>,
    					<NRF_PSEL(SPIM_MOSI, 2, 8)>,
    					<NRF_PSEL(SPIM_MISO, 2, 9)>;
    					low-power-enable;
    		};
    	};
    };
    
    &spi00 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	pinctrl-0 = <&spi00_default>;
    	pinctrl-1 = <&spi00_sleep>;
    	pinctrl-names = "default", "sleep";
    	cs-gpios = <&gpio2 5 ( GPIO_PULL_UP | GPIO_ACTIVE_LOW )>, <&gpio2 2 ( GPIO_PULL_UP | GPIO_ACTIVE_LOW )>, <&gpio2 10 ( GPIO_PULL_UP | GPIO_ACTIVE_LOW )>;
    	cc1120_1: cc1120_1@0 {
    		compatible = "cc1120";
    		spi-max-frequency = <8000000>;
    		reg = <0>;
    		label = "cc1120_1";
    	};
    	cc1120_2: cc1120_2@1 {
    		compatible = "cc1120";
    		spi-max-frequency = <8000000>;
    		reg = <1>;
    		label = "cc1120_2";
    	};
    	icm42605: icm42605@2 {
    		zephyr,deferred-init;
    		compatible = "invensense,icm42605";
    		spi-max-frequency = <8000000>;
    		reg = <2>;
    		int-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;
    	};
    };

  • Please close this ticket, had a design flaw, my apologies...

Related