Asynchronous spi chip select deasserts early

Using the zepher spi driver (which wraps nrfx) on ncs v2.6.1, the CS line goes low to start the transaction, then high about 10 us later, but the data keeps coming out.

in zephyr/drivers/spi/spi_nrfx_spim.c, a change was made between v2.4.0 and v2.6.1, where the CS finish is now handled in the transaction call, which doesn't take very long to complete.  I can 'fix' it by reverting a few changes around finish_transaction, which is called from the event done handler.

static void finish_transaction(const struct device *dev, int error)
{
	struct spi_nrfx_data *dev_data = dev->data;
	struct spi_context *ctx = &dev_data->ctx;

	spi_context_cs_control(ctx, false);

	LOG_DBG("Transaction finished with status %d", error);

	spi_context_complete(ctx, dev, error);
	dev_data->busy = false;
}

it's the spi_context_cs_control(ctx, false); line that was removed.

Is there a different way I should be using the zephyr spi driver here?  If not, this might be a bug.

Thanks

Related