nRF9151 DK: spi slave

I am using the nRF9151-DK as an SPI slave. The SPI communication is not working as expected, and the nRF9151-DK is not receiving any data from the SPI master.

I have configured SPIS3, but the SPI transfer callback is not receiving any data.

 

Environment:

  • Board: nRF9151-DK
  • nRF Connect SDK: v3.3.4
  • Zephyr: v4.3.99
  • Board target: nrf9151dk/nrf9151/ns
  • SPI peripheral: SPIS3

  

  

  

 

  

  

  

Parents
  • Hie Aparna,

    Thanks for sharing the project. You can read.more on this in our devacademy course

    You are missing some files in your app.overlay

    &pinctrl {
    spi3_default: spi3_default {
    group1 {
    psels = <NRF_PSEL(SPIS_SCK, 0, 13)>,
    <NRF_PSEL(SPIS_MOSI, 0, 11)>,
    <NRF_PSEL(SPIS_MISO, 0, 12)>,
    <NRF_PSEL(SPIS_CSN, 0, 10)>;
    };
    };

    spi3_sleep: spi3_sleep {
    group1 {
    psels = <NRF_PSEL(SPIS_SCK, 0, 13)>,
    <NRF_PSEL(SPIS_MOSI, 0, 11)>,
    <NRF_PSEL(SPIS_MISO, 0, 12)>,
    <NRF_PSEL(SPIS_CSN, 0, 10)>;
    low-power-enable;
    };
    };
    };

    &spi3 {
    compatible = "nordic,nrf-spis";
    status = "okay";
    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";
    def-char = <0x00>;
    };

    Also,
    when using nrfx directly in Zephyr, you need to manually connect the IRQ.  Can you please add this before

    nrfx_spis_init:

    IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS3), IRQ_PRIO_LOWEST, nrfx_spis_3_irq_handler, NULL, 0); irq_enable(NRFX_IRQ_NUMBER_GET(NRF_SPIS3));

    Without this, spis_handler will never be called, hence you are not getting any data. 

    Also can you please verify which NCS version are you using.

    Please let me know if this fixes your problem.

    Regards

    Pallavi

     

Reply
  • Hie Aparna,

    Thanks for sharing the project. You can read.more on this in our devacademy course

    You are missing some files in your app.overlay

    &pinctrl {
    spi3_default: spi3_default {
    group1 {
    psels = <NRF_PSEL(SPIS_SCK, 0, 13)>,
    <NRF_PSEL(SPIS_MOSI, 0, 11)>,
    <NRF_PSEL(SPIS_MISO, 0, 12)>,
    <NRF_PSEL(SPIS_CSN, 0, 10)>;
    };
    };

    spi3_sleep: spi3_sleep {
    group1 {
    psels = <NRF_PSEL(SPIS_SCK, 0, 13)>,
    <NRF_PSEL(SPIS_MOSI, 0, 11)>,
    <NRF_PSEL(SPIS_MISO, 0, 12)>,
    <NRF_PSEL(SPIS_CSN, 0, 10)>;
    low-power-enable;
    };
    };
    };

    &spi3 {
    compatible = "nordic,nrf-spis";
    status = "okay";
    pinctrl-0 = <&spi3_default>;
    pinctrl-1 = <&spi3_sleep>;
    pinctrl-names = "default", "sleep";
    def-char = <0x00>;
    };

    Also,
    when using nrfx directly in Zephyr, you need to manually connect the IRQ.  Can you please add this before

    nrfx_spis_init:

    IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_SPIS3), IRQ_PRIO_LOWEST, nrfx_spis_3_irq_handler, NULL, 0); irq_enable(NRFX_IRQ_NUMBER_GET(NRF_SPIS3));

    Without this, spis_handler will never be called, hence you are not getting any data. 

    Also can you please verify which NCS version are you using.

    Please let me know if this fixes your problem.

    Regards

    Pallavi

     

Children
No Data
Related