Interrupt pin configuration nRF5340

Hello,

I am having trouble reading an interrupt on an nRF5340.  This is on a custom board using the ISP2053 SIP.

We are using the high speed SPI interface on pins P0.08 - P0.11.  This is working correctly, however our SPI slave has an interrupt pin which we need to read.  This pin is connected to P0.12.

On a development board, the interrupt pin works as normal, however on our custom board we cannot see the interrupt pin toggle.  Our layout is correct.  Are there any settings or differences when using the ISP2053 SIP?

Here is our SPI code:

&pinctrl {
    spi_master_default: spi_master_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 8)>,
                    <NRF_PSEL(SPIM_MOSI, 0, 9)>,
                    <NRF_PSEL(SPIM_MISO, 0, 10)>;
            nordic,drive-mode = <NRF_DRIVE_H0H1>;
        };
    };
};

ah_spi_master: &spi4 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    pinctrl-0 = <&spi_master_default>;
    pinctrl-1 = <&spi_master_sleep>;
    cs-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
    reg_ah_spi_master:  spi-dev-a@0 {
        reg = <0>;
    };
};

/ {
    interrupts {
        compatible = "gpio-keys";

        spi_data_available: spi_data_available {
            label = "SPI Data Available";
            gpios = <&gpio0 12 (GPIO_ACTIVE_HIGH)>;
        };
    };
};

The GPIO is being configured as shown

static const struct gpio_dt_spec s_dataAvailableGPIO = GPIO_DT_SPEC_GET(DT_NODELABEL(spi_data_available), gpios);

static void dataAvailableInterrupt(const struct device *dev, struct gpio_callback *cb, uint32_t pins)
{
    LOG_INF("dataAvailableInterrupt");
}

static void configureInterrupt(void)
{
    gpio_pin_configure_dt(&s_dataAvailableGPIO, GPIO_INPUT);
    gpio_pin_interrupt_configure_dt(&s_dataAvailableGPIO, GPIO_INT_EDGE_TO_ACTIVE);

    static struct gpio_callback spiIntCB;
    gpio_init_callback(&spiIntCB, dataAvailableInterrupt, BIT(s_dataAvailableGPIO.pin));
    gpio_add_callback(s_dataAvailableGPIO.port, &spiIntCB);
}

Thank you

  • Hi,

    I do not immedately see any issues here, but I have two suggestions for how to narrow this down.

    1. Chekc he return values of all the API calls. It could be that there is an issue that is detected in soem of the API calls you make, but you will not know as none of the return values are checked. As a general rul, always check all return values. You can see an example of that in the Button sample, which demonstrates a GPIO interrupt.

    2. As this issue is only seen on your HW, can you measure the interrupt/input signal as close to the nRF as possible, to verify that it actually makes it there, and that there is no HW issue (could for instance be a soldering issue).

  • Thank you for your suggestions!  We found an error on a test/debug board in the circuit which injected this problem. 

    Fixing the breakout board rectified the issue.

    Thank you for your help.  You may close this issue.

Related