This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where is the I2S interrupt handler registered in nRFX drivers?

I'm trying to use the I2S peripheral on the nRF5340DK.  It looks like the zephyr drivers don't currently support this board, so I need to use the nRFx drivers.  I've ported over an I2S example from the nRF5 SDK, but when I run it, I get stuck in a reboot loop.  As near as I can tell, the I2S interrupt service routine is not getting updated in the ISR table, and it's instead calling the default spurious interrupt handler, triggering the software reset.  There's four functions documented in the nRFx I2S driver section of the documentation, and I've stepped through them making sure I understand what happens.  At no point do I see the ISR table being updated, either with my data handler function, nor with the nrfx_i2s_irq_handler function in nrfx_i2s.c.  Deep in the CMSIS codebase, I found __NVIC_SetVector, but it doesn't seem to be getting called at any point, either.  What is preventing me from getting these interrupts working?

  • Unfortunately, I no longer remember exactly.  I think I had been having trouble configuring the devicetree overlay, and possibly with triggering using I2S_DIR_BOTH.  I went looking for the board's dts file and found the document I mentioned earlier that didn't include I2S on the list of supported peripherals.  I thought that meant that Zephyr didn't support I2S on the nRF5340, so I stopped using the Zephyr API and switched to using the nrfx drivers.

    I was, and still am, new to Zephyr and NCS.  With the gift of one month's hindsight, I can see a couple places where I had probably implemented or configured something incorrectly.  At the time, though, that document had me convinced that I2S wasn't supported and the only way was to use the nrfx drivers.

  • Hi

    No worries. There is nothing wrong with using nrfx drivers, at least not as long as the project only needs to support Nordic devices. 

    Using the Zephyr drivers means you can easily port code between parts from different vendors, but in some cases you lose a bit of functionality since the Zephyr drivers are designed to be general and not specific to Nordic hardware only.

    Certain peripherals, like the PPI controller, are so Nordic specific that no Zephyr driver exists. In this case using nrfx (or hardware registers directly) is the only option.  

    Best regards
    Torbjørn

Related