Hello, we are developing a zephyr application on top of nrf52 soc. We can use the built-in zephyr drivers for most modules (ex: I2C, UART, nvm, etc.); however, for some modules (ex: input capture and counters), we had to use the nrfx hal drivers instead. See this link for reference.
Most of these implementations require disabling the zephyr GPIO driver and using the nrfx gpio driver with the PPI hardware. Although it is not ideal, this workaround has been working. The issue we are facing now is some of the zephyr drivers rely on the zephyr GPIO driver, and it won't work if we disable it. For example, many I2C sensors use a GPIO line to trigger an interrupt line. Any idea on how we could address this compatibility issue? Thx!
I got some suggestions internally:
"obvious fix: move the ISR handler to use nrfx_gpiote in zephyr/drivers/gpio/gpio_nrfx.
You can technically work around this by using zephyr gpio, then using ppi to tie the rest together and fork out the last event (that should generate GPIOTE ISR to the app) to EGU instead. This is however not nice and not something I've tested..."
"first one requires rework of the gpio_nrfx module... not a small task"
Thanks, Simon. Can nordic update the ISR handler in gpio_nrfx driver within zephyr. We evaluated making the change ourselves but as you mentioned this is not a small task, especially that we didn't write the original code. Also, any chance we make could affect other users of this driver. Let me know if you need me to report it on Github. Thanks!
I got an update from a developer that there is some ongoing work to extend the nrfx_gpiote driver, which will make it possible to use the nrfx api and the zephyr api in the same app. The implementation is almost done. I will get keep you updated.
Great. Thank you for the update. Looking forward to it.
Hi Simon, any update on this? Thx!
I'ts not quite ready yet, the implementation is under it's final stages of review. I'll inform you when the Zephyr PR is ready. It shouldn't be too long.
That is great to hear. Thank you for the update.