nrfx spi using external gpio controller for CS

Hi,

I have an nrf52840 project running ncs 2.5.0

I have spi devices, and the CS pin is not in the main nrf gpio controller, but on an I2C powered IO expander.

There is no problem to add the CS in the device tree:


```

&spi1 {
compatible = "nordic,nrf-spim";

status = "okay";
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";

cs-gpios = <&exp_gpio3 4 GPIO_ACTIVE_LOW>;
};
```

The problem is that it seems that the end of an SPI operation in the nrfx driver is toggling the CS pin from inside an ISR,

which cause for an I2C operation to run in an ISR, therefore the system crashes.

Is there any workaround for it? Or I just can't use the i2c io expander gpio controller for any SPI related op?

Thanks!

Related