Zephyr driver vs nrfx for nRF5340

Hi,

I am evaluating the nRF5340 SoC and the recommended toolchain nRF Connect SDK (NCS).

I see that NCS is based on Zephyr RTOS, which provides also some drivers (spi, i2c, etc..) and a new approach for their development (devicetree).

Questions:

- Can you recommend some documentation/example about how to use those drivers from Zephyr ?

- Is it possible to use instead of Zephyr driver the ones from nrfx ? Are there any counterindications ?

Thanks in advance for your kind support.

Regards

Riccardo      

Parents
  • Hello Riccardo,

    - Can you recommend some documentation/example about how to use those drivers from Zephyr ?

    Zephyr provides an API documentation of its peripherals which you can find here

    If you want to work with sensors you can make usage of the Sensors API provided by Zephyr. The sensors are typically connected via I2C/SPI and this API allows you to communicate with them without addressing the interface they are connected to directly. A good example for that would be the BME680 sample with I2C and ADXL362 with SPI.

    - Is it possible to use instead of Zephyr driver the ones from nrfx ? Are there any counterindications ?

    Yes, it is totally possible to use one or more nrfx drivers directly instead. The advantage is that they are tailored towards Nordics hardware. However, for generally usage I would recommend you to go for Zephyrs API as they eventually will call the nrfx interface anyway. For more details, you can have a look at this chapter of the nRF Connect SDK Tutorial written by my colleague Simon.

    I hope my answers will help you! Please let me know if you have any more question.

    Regards,

    Markus

Reply
  • Hello Riccardo,

    - Can you recommend some documentation/example about how to use those drivers from Zephyr ?

    Zephyr provides an API documentation of its peripherals which you can find here

    If you want to work with sensors you can make usage of the Sensors API provided by Zephyr. The sensors are typically connected via I2C/SPI and this API allows you to communicate with them without addressing the interface they are connected to directly. A good example for that would be the BME680 sample with I2C and ADXL362 with SPI.

    - Is it possible to use instead of Zephyr driver the ones from nrfx ? Are there any counterindications ?

    Yes, it is totally possible to use one or more nrfx drivers directly instead. The advantage is that they are tailored towards Nordics hardware. However, for generally usage I would recommend you to go for Zephyrs API as they eventually will call the nrfx interface anyway. For more details, you can have a look at this chapter of the nRF Connect SDK Tutorial written by my colleague Simon.

    I hope my answers will help you! Please let me know if you have any more question.

    Regards,

    Markus

Children
Related